ckeditor.js 6.1 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073121074121075121076121077121078121079121080121081121082121083121084121085121086121087121088121089121090121091121092121093121094121095121096121097121098121099121100121101121102121103121104121105121106121107121108121109121110121111121112121113121114121115121116121117121118121119121120121121121122121123121124121125121126121127121128121129121130121131121132121133121134121135121136121137121138121139121140121141121142121143121144121145121146121147121148121149121150121151121152121153121154121155121156121157121158121159121160121161121162121163121164121165121166121167121168121169121170121171121172121173121174121175121176121177121178121179121180121181121182121183121184121185121186121187121188121189121190121191121192121193121194121195121196121197121198121199121200121201121202121203121204121205121206121207121208121209121210121211121212121213121214121215121216121217121218121219121220121221121222121223121224121225121226121227121228121229121230121231121232121233121234121235121236121237121238121239121240121241121242121243121244121245121246121247121248121249121250121251121252121253121254121255121256121257121258121259121260121261121262121263121264121265121266121267121268121269121270121271121272121273121274121275121276121277121278121279121280121281121282121283121284121285121286121287121288121289121290121291121292121293121294121295121296121297121298121299121300121301121302121303121304121305121306121307121308121309121310121311121312121313121314121315121316121317121318121319121320121321121322121323121324121325121326121327121328121329121330121331121332121333121334121335121336121337121338121339121340121341121342121343121344121345121346121347121348121349121350121351121352121353121354121355121356121357121358121359121360121361121362121363121364121365121366121367121368121369121370121371121372121373121374121375121376121377121378121379121380121381121382121383121384121385121386121387121388121389121390121391121392121393121394121395121396121397121398121399121400121401121402121403121404121405121406121407121408121409121410121411121412121413121414121415121416121417121418121419121420121421121422121423121424121425121426121427121428121429121430121431121432121433121434121435121436121437121438121439121440121441121442121443121444121445121446121447121448121449121450121451121452121453121454121455121456121457121458121459121460121461121462121463121464121465121466121467121468121469121470121471121472121473121474121475121476121477121478121479121480121481121482121483121484121485121486121487121488121489121490121491121492121493121494121495121496121497121498121499121500121501121502121503121504121505121506121507121508121509121510121511121512121513121514121515121516121517121518121519121520121521121522121523121524121525121526121527121528121529121530121531121532121533121534121535121536121537121538121539121540121541121542121543121544121545121546121547121548121549121550121551121552121553121554121555121556121557121558121559121560121561121562121563121564121565121566121567121568121569121570121571121572121573121574121575121576121577121578121579121580121581121582121583121584121585121586121587121588121589121590121591121592121593121594121595121596121597121598121599121600121601121602121603121604121605121606121607121608121609121610121611121612121613121614121615121616121617121618121619121620121621121622121623121624121625121626121627121628121629121630121631121632121633121634121635121636121637121638121639121640121641121642121643121644121645121646121647121648121649121650121651121652121653121654121655121656121657121658121659121660121661121662121663121664121665121666121667121668121669121670121671121672121673121674121675121676121677121678121679121680121681121682121683121684121685121686121687121688121689121690121691121692121693121694121695121696121697121698121699121700121701121702121703121704121705121706121707121708121709121710121711121712121713121714121715121716121717121718121719121720121721121722121723121724121725121726121727121728121729121730121731121732121733121734121735121736121737121738121739121740121741121742121743121744121745121746121747121748121749121750121751121752121753121754121755121756121757121758121759121760121761121762121763121764121765121766121767121768121769121770121771121772121773121774121775121776121777121778121779121780121781121782121783121784121785121786121787121788121789121790121791121792121793121794121795121796121797121798121799121800121801121802121803121804121805121806121807121808121809121810121811121812121813121814121815121816121817121818121819121820121821121822121823121824121825121826121827121828121829121830121831121832121833121834121835121836121837121838121839121840121841121842121843121844121845121846121847121848121849121850121851121852121853121854121855121856121857121858121859121860121861121862121863121864121865121866121867121868121869121870121871121872121873121874121875121876121877121878121879121880121881121882121883121884121885121886121887121888121889121890121891121892121893121894121895121896121897121898121899121900121901121902121903121904121905121906121907121908121909121910121911121912121913121914121915121916121917121918121919121920121921121922121923121924121925121926121927121928121929121930121931121932121933121934121935121936121937121938121939121940121941121942121943121944121945121946121947121948121949121950121951121952121953121954121955121956121957121958121959121960121961121962121963121964121965121966121967121968121969121970121971121972121973121974121975121976121977121978121979121980121981121982121983121984121985121986121987121988121989121990121991121992121993121994121995121996121997121998121999122000122001122002122003122004122005122006122007122008122009122010122011122012122013122014122015122016122017122018122019122020122021122022122023122024122025122026122027122028122029122030122031122032122033122034122035122036122037122038122039122040122041122042122043122044122045122046122047122048122049122050122051122052122053122054122055122056122057122058122059122060122061122062122063122064122065122066122067122068122069122070122071122072122073122074122075122076122077122078122079122080122081122082122083122084122085122086122087122088122089122090122091122092122093122094122095122096122097122098122099122100122101122102122103122104122105122106122107122108122109122110122111122112122113122114122115122116122117122118122119122120122121122122122123122124122125122126122127122128122129122130122131122132122133122134122135122136122137122138122139122140122141122142122143122144122145122146122147122148122149122150122151122152122153122154122155122156122157122158122159122160122161122162122163122164122165122166122167122168122169122170122171122172122173122174122175122176122177122178122179122180122181122182122183122184122185122186122187122188122189122190122191122192122193122194122195122196122197122198122199122200122201122202122203122204122205122206122207122208122209122210122211122212122213122214122215122216122217122218122219122220122221122222122223122224122225122226122227122228122229122230122231122232122233122234122235122236122237122238122239122240122241122242122243122244122245122246122247122248122249122250122251122252122253122254122255122256122257122258122259122260122261122262122263122264122265122266122267122268122269122270122271122272122273122274122275122276122277122278122279122280122281122282122283122284122285122286122287122288122289122290122291122292122293122294122295122296122297122298122299122300122301122302122303122304122305122306122307122308122309122310122311122312122313122314122315122316122317122318122319122320122321122322122323122324122325122326122327122328122329122330122331122332122333122334122335122336122337122338122339122340122341122342122343122344122345122346122347122348122349122350122351122352122353122354122355122356122357122358122359122360122361122362122363122364122365122366122367122368122369122370122371122372122373122374122375122376122377122378122379122380122381122382122383122384122385122386122387122388122389122390122391122392122393122394122395122396122397122398122399122400122401122402122403122404122405122406122407122408122409122410122411122412122413122414122415122416122417122418122419122420122421122422122423122424122425122426122427122428122429122430122431122432122433122434122435122436122437122438122439122440122441122442122443122444122445122446122447122448122449122450122451122452122453122454122455122456122457122458122459122460122461122462122463122464122465122466122467122468122469122470122471122472122473122474122475122476122477122478122479122480122481122482122483122484122485122486122487122488122489122490122491122492122493122494122495122496122497122498122499122500122501122502122503122504122505122506122507122508122509122510122511122512122513122514122515122516122517122518122519122520122521122522122523122524122525122526122527122528122529122530122531122532122533122534122535122536122537122538122539122540122541122542122543122544122545122546122547122548122549122550122551122552122553122554122555122556122557122558122559122560122561122562122563122564122565122566122567122568122569122570122571122572122573122574122575122576122577122578122579122580122581122582122583122584122585122586122587122588122589122590122591122592122593122594122595122596122597122598122599122600122601122602122603122604122605122606122607122608122609122610122611122612122613122614122615122616122617122618122619122620122621122622122623122624122625122626122627122628122629122630122631122632122633122634122635122636122637122638122639122640122641122642122643122644122645122646122647122648122649122650122651122652122653122654122655122656122657122658122659122660122661122662122663122664122665122666122667122668122669122670122671122672122673122674122675122676122677122678122679122680122681122682122683122684122685122686122687122688122689122690122691122692122693122694122695122696122697122698122699122700122701122702122703122704122705122706122707122708122709122710122711122712122713122714122715122716122717122718122719122720122721122722122723122724122725122726122727122728122729122730122731122732122733122734122735122736122737122738122739122740122741122742122743122744122745122746122747122748122749122750122751122752122753122754122755122756122757122758122759122760122761122762122763122764122765122766122767122768122769122770122771122772122773122774122775122776122777122778122779122780122781122782122783122784122785122786122787122788122789122790122791122792122793122794122795122796122797122798122799122800122801122802122803122804122805122806122807122808122809122810122811122812122813122814122815122816122817122818122819122820122821122822122823122824122825122826122827122828122829122830122831122832122833122834122835122836122837122838122839122840122841122842122843122844122845122846122847122848122849122850122851122852122853122854122855122856122857122858122859122860122861122862122863122864122865122866122867122868122869122870122871122872122873122874122875122876122877122878122879122880122881122882122883122884122885122886122887122888122889122890122891122892122893122894122895122896122897122898122899122900122901122902122903122904122905122906122907122908122909122910122911122912122913122914122915122916122917122918122919122920122921122922122923122924122925122926122927122928122929122930122931122932122933122934122935122936122937122938122939122940122941122942122943122944122945122946122947122948122949122950122951122952122953122954122955122956122957122958122959122960122961122962122963122964122965122966122967122968122969122970122971122972122973122974122975122976122977122978122979122980122981122982122983122984122985122986122987122988122989122990122991122992122993122994122995122996122997122998122999123000123001123002123003123004123005123006123007123008123009123010123011123012123013123014123015123016123017123018123019123020123021123022123023123024123025123026123027123028123029123030123031123032123033123034123035123036123037123038123039123040123041123042123043123044123045123046123047123048123049123050123051123052123053123054123055123056123057123058123059123060123061123062123063123064123065123066123067123068123069123070123071123072123073123074123075123076123077123078123079123080123081123082123083123084123085123086123087123088123089123090123091123092123093123094123095123096123097123098123099123100123101123102123103123104123105123106123107123108123109123110123111123112123113123114123115123116123117123118123119123120123121123122123123123124123125123126123127123128123129123130123131123132123133123134123135123136123137123138123139123140123141123142123143123144123145123146123147123148123149123150123151123152123153123154123155123156123157123158123159123160123161123162123163123164123165123166123167123168123169123170123171123172123173123174123175123176123177123178123179123180123181123182123183123184123185123186123187123188123189123190123191123192123193123194123195123196123197123198123199123200123201123202123203123204123205123206123207123208123209123210123211123212123213123214123215123216123217123218123219123220123221123222123223123224123225123226123227123228123229123230123231123232123233123234123235123236123237123238123239123240123241123242123243123244123245123246123247123248123249123250123251123252123253123254123255123256123257123258123259123260123261123262123263123264123265123266123267123268123269123270123271123272123273123274123275123276123277123278123279123280123281123282123283123284123285123286123287123288123289123290123291123292123293123294123295123296123297123298123299123300123301123302123303123304123305123306123307123308123309123310123311123312123313123314123315123316123317123318123319123320123321123322123323123324123325123326123327123328123329123330123331123332123333123334123335123336123337123338123339123340123341123342123343123344123345123346123347123348123349123350123351123352123353123354123355123356123357123358123359123360123361123362123363123364123365123366123367123368123369123370123371123372123373123374123375123376123377123378123379123380123381123382123383123384123385123386123387123388123389123390123391123392123393123394123395123396123397123398123399123400123401123402123403123404123405123406123407123408123409123410123411123412123413123414123415123416123417123418123419123420123421123422123423123424123425123426123427123428123429123430123431123432123433123434123435123436123437123438123439123440123441123442123443123444123445123446123447123448123449123450123451123452123453123454123455123456123457123458123459123460123461123462123463123464123465123466123467123468123469123470123471123472123473123474123475123476123477123478123479123480123481123482123483123484123485123486123487123488123489123490123491123492123493123494123495123496123497123498123499123500123501123502123503123504123505123506123507123508123509123510123511123512123513123514123515123516123517123518123519123520123521123522123523123524123525123526123527123528123529123530123531123532123533123534123535123536123537123538123539123540123541123542123543123544123545123546123547123548123549123550123551123552123553123554123555123556123557123558123559123560123561123562123563123564123565123566123567123568123569123570123571123572123573123574123575123576123577123578123579123580123581123582123583123584123585123586123587123588123589123590123591123592123593123594123595123596123597123598123599123600123601123602123603123604123605123606123607123608123609123610123611123612123613123614123615123616123617123618123619123620123621123622123623123624123625123626123627123628123629123630123631123632123633123634123635123636123637123638123639123640123641123642123643123644123645123646123647123648123649123650123651123652123653123654123655123656123657123658123659123660123661123662123663123664123665123666123667123668123669123670123671123672123673123674123675123676123677123678123679123680123681123682123683123684123685123686123687123688123689123690123691123692123693123694123695123696123697123698123699123700123701123702123703123704123705123706123707123708123709123710123711123712123713123714123715123716123717123718123719123720123721123722123723123724123725123726123727123728123729123730123731123732123733123734123735123736123737123738123739123740123741123742123743123744123745123746123747123748123749123750123751123752123753123754123755123756123757123758123759123760123761123762123763123764123765123766123767123768123769123770123771123772123773123774123775123776123777123778123779123780123781123782123783123784123785123786123787123788123789123790123791123792123793123794123795123796123797123798123799123800123801123802123803123804123805123806123807123808123809123810123811123812123813123814123815123816123817123818123819123820123821123822123823123824123825123826123827123828123829123830123831123832123833123834123835123836123837123838123839123840123841123842123843123844123845123846123847123848123849123850123851123852123853123854123855123856123857123858123859123860123861123862123863123864123865123866123867123868123869123870123871123872123873123874123875123876123877123878123879123880123881123882123883123884123885123886123887123888123889123890123891123892123893123894123895123896123897123898123899123900123901123902123903123904123905123906123907123908123909123910123911123912123913123914123915123916123917123918123919123920123921123922123923123924123925123926123927123928123929123930123931123932123933123934123935123936123937123938123939123940123941123942123943123944123945123946123947123948123949123950123951123952123953123954123955123956123957123958123959123960123961123962123963123964123965123966123967123968123969123970123971123972123973123974123975123976123977123978123979123980123981123982123983123984123985123986123987123988123989123990123991123992123993123994123995123996123997123998123999124000124001124002124003124004124005124006124007124008124009124010124011124012124013124014124015124016124017124018124019124020124021124022124023124024124025124026124027124028124029124030124031124032124033124034124035124036124037124038124039124040124041124042124043124044124045124046124047124048124049124050124051124052124053124054124055124056124057124058124059124060124061124062124063124064124065124066124067124068124069124070124071124072124073124074124075124076124077124078124079124080124081124082124083124084124085124086124087124088124089124090124091124092124093124094124095124096124097124098124099124100124101124102124103124104124105124106124107124108124109124110124111124112124113124114124115124116124117124118124119124120124121124122124123124124124125124126124127124128124129124130124131124132124133124134124135124136124137124138124139124140124141124142124143124144124145124146124147124148124149124150124151124152124153124154124155124156124157124158124159124160124161124162124163124164124165124166124167124168124169124170124171124172124173124174124175124176124177124178124179124180124181124182124183124184124185124186124187124188124189124190124191124192124193124194124195124196124197124198124199124200124201124202124203124204124205124206124207124208124209124210124211124212124213124214124215124216124217124218124219124220124221124222124223124224124225124226124227124228124229124230124231124232124233124234124235124236124237124238124239124240124241124242124243124244124245124246124247124248124249124250124251124252124253124254124255124256124257124258124259124260124261124262124263124264124265124266124267124268124269124270124271124272124273124274124275124276124277124278124279124280124281124282124283124284124285124286124287124288124289124290124291124292124293124294124295124296124297124298124299124300124301124302124303124304124305124306124307124308124309124310124311124312124313124314124315124316124317124318124319124320124321124322124323124324124325124326124327124328124329124330124331124332124333124334124335124336124337124338124339124340124341124342124343124344124345124346124347124348124349124350124351124352124353124354124355124356124357124358124359124360124361124362124363124364124365124366124367124368124369124370124371124372124373124374124375124376124377124378124379124380124381124382124383124384124385124386124387124388124389124390124391124392124393124394124395124396124397124398124399124400124401124402124403124404124405124406124407124408124409124410124411124412124413124414124415124416124417124418124419124420124421124422124423124424124425124426124427124428124429124430124431124432124433124434124435124436124437124438124439124440124441124442124443124444124445124446124447124448124449124450124451124452124453124454124455124456124457124458124459124460124461124462124463124464124465124466124467124468124469124470124471124472124473124474124475124476124477124478124479124480124481124482124483124484124485124486124487124488124489124490124491124492124493124494124495124496124497124498124499124500124501124502124503124504124505124506124507124508124509124510124511124512124513124514124515124516124517124518124519124520124521124522124523124524124525124526124527124528124529124530124531124532124533124534124535124536124537124538124539124540124541124542124543124544124545124546124547124548124549124550124551124552124553124554124555124556124557124558124559124560124561124562124563124564124565124566124567124568124569124570124571124572124573124574124575124576124577124578124579124580124581124582124583124584124585124586124587124588124589124590124591124592124593124594124595124596124597124598124599124600124601124602124603124604124605124606124607124608124609124610124611124612124613124614124615124616124617124618124619124620124621124622124623124624124625124626124627124628124629124630124631124632124633124634124635124636124637124638124639124640124641124642124643124644124645124646124647124648124649124650124651124652124653124654124655124656124657124658124659124660124661124662124663124664124665124666124667124668124669124670124671124672124673124674124675124676124677124678124679124680124681124682124683124684124685124686124687124688124689124690124691124692124693124694124695124696124697124698124699124700124701124702124703124704124705124706124707124708124709124710124711124712124713124714124715124716124717124718124719124720124721124722124723124724124725124726124727124728124729124730124731124732124733124734124735124736124737124738124739124740124741124742124743124744124745124746124747124748124749124750124751124752124753124754124755124756124757124758124759124760124761124762124763124764124765124766124767124768124769124770124771124772124773124774124775124776124777124778124779124780124781124782124783124784124785124786124787124788124789124790124791124792124793124794124795124796124797124798124799124800124801124802124803124804124805124806124807124808124809124810124811124812124813124814124815124816124817124818124819124820124821124822124823124824124825124826124827124828124829124830124831124832124833124834124835124836124837124838124839124840124841124842124843124844124845124846124847124848124849124850124851124852124853124854124855124856124857124858124859124860124861124862124863124864124865124866124867124868124869124870124871124872124873124874124875124876124877124878124879124880124881124882124883124884124885124886124887124888124889124890124891124892124893124894124895124896124897124898124899124900124901124902124903124904124905124906124907124908124909124910124911124912124913124914124915124916124917124918124919124920124921124922124923124924124925124926124927124928124929124930124931124932124933124934124935124936124937124938124939124940124941124942124943124944124945124946124947124948124949124950124951124952124953124954124955124956124957124958124959124960124961124962124963124964124965124966124967124968124969124970124971124972124973124974124975124976124977124978124979124980124981124982124983124984124985124986124987124988124989124990124991124992124993124994124995124996124997124998124999125000125001125002125003125004125005125006125007125008125009125010125011125012125013125014125015125016125017125018125019125020125021125022125023125024125025125026125027125028125029125030125031125032125033125034125035125036125037125038125039125040125041125042125043125044125045125046125047125048125049125050125051125052125053125054125055125056125057125058125059125060125061125062125063125064125065125066125067125068125069125070125071125072125073125074125075125076125077125078125079125080125081125082125083125084125085125086125087125088125089125090125091125092125093125094125095125096125097125098125099125100125101125102125103125104125105125106125107125108125109125110125111125112125113125114125115125116125117125118125119125120125121125122125123125124125125125126125127125128125129125130125131125132125133125134125135125136125137125138125139125140125141125142125143125144125145125146125147125148125149125150125151125152125153125154125155125156125157125158125159125160125161125162125163125164125165125166125167125168125169125170125171125172125173125174125175125176125177125178125179125180125181125182125183125184125185125186125187125188125189125190125191125192125193125194125195125196125197125198125199125200125201125202125203125204125205125206125207125208125209125210125211125212125213125214125215125216125217125218125219125220125221125222125223125224125225125226125227125228125229125230125231125232125233125234125235125236125237125238125239125240125241125242125243125244125245125246125247125248125249125250125251125252125253125254125255125256125257125258125259125260125261125262125263125264125265125266125267125268125269125270125271125272125273125274125275125276125277125278125279125280125281125282125283125284125285125286125287125288125289125290125291125292125293125294125295125296125297125298125299125300125301125302125303125304125305125306125307125308125309125310125311125312125313125314125315125316125317125318125319125320125321125322125323125324125325125326125327125328125329125330125331125332125333125334125335125336125337125338125339125340125341125342125343125344125345125346125347125348125349125350125351125352125353125354125355125356125357125358125359125360125361125362125363125364125365125366125367125368125369125370125371125372125373125374125375125376125377125378125379125380125381125382125383125384125385125386125387125388125389125390125391125392125393125394125395125396125397125398125399125400125401125402125403125404125405125406125407125408125409125410125411125412125413125414125415125416125417125418125419125420125421125422125423125424125425125426125427125428125429125430125431125432125433125434125435125436125437125438125439125440125441125442125443125444125445125446125447125448125449125450125451125452125453125454125455125456125457125458125459125460125461125462125463125464125465125466125467125468125469125470125471125472125473125474125475125476125477125478125479125480125481125482125483125484125485125486125487125488125489125490125491125492125493125494125495125496125497125498125499125500125501125502125503125504125505125506125507125508125509125510125511125512125513125514125515125516125517125518125519125520125521125522125523125524125525125526125527125528125529125530125531125532125533125534125535125536125537125538125539125540125541125542125543125544125545125546125547125548125549125550125551125552125553125554125555125556125557125558125559125560125561125562125563125564125565125566125567125568125569125570125571125572125573125574125575125576125577125578125579125580125581125582125583125584125585125586125587125588125589125590125591125592125593125594125595125596125597125598125599125600125601125602125603125604125605125606125607125608125609125610125611125612125613125614125615125616125617125618125619125620125621125622125623125624125625125626125627125628125629125630125631125632125633125634125635125636125637125638125639125640125641125642125643125644125645125646125647125648125649125650125651125652125653125654125655125656125657125658125659125660125661125662125663125664125665125666125667125668125669125670125671125672125673125674125675125676125677125678125679125680125681125682125683125684125685125686125687125688125689125690125691125692125693125694125695125696125697125698125699125700125701125702125703125704125705125706125707125708125709125710125711125712125713125714125715125716125717125718125719125720125721125722125723125724125725125726125727125728125729125730125731125732125733125734125735125736125737125738125739125740125741125742125743125744125745125746125747125748125749125750125751125752125753125754125755125756125757125758125759125760125761125762125763125764125765125766125767125768125769125770125771125772125773125774125775125776125777125778125779125780125781125782125783125784125785125786125787125788125789125790125791125792125793125794125795125796125797125798125799125800125801125802125803125804125805125806125807125808125809125810125811125812125813125814125815125816125817125818125819125820125821125822125823125824125825125826125827125828125829125830125831125832125833125834125835125836125837125838125839125840125841125842125843125844125845125846125847125848125849125850125851125852125853125854125855125856125857125858125859125860125861125862125863125864125865125866125867125868125869125870125871125872125873125874125875125876125877125878125879125880125881125882125883125884125885125886125887125888125889125890125891125892125893125894125895125896125897125898125899125900125901125902125903125904125905125906125907125908125909125910125911125912125913125914125915125916125917125918125919125920125921125922125923125924125925125926125927125928125929125930125931125932125933125934125935125936125937125938125939125940125941125942125943125944125945125946125947125948125949125950125951125952125953125954125955125956125957125958125959125960125961125962125963125964125965125966125967125968125969125970125971125972125973125974125975125976125977125978125979125980125981125982125983125984125985125986125987125988125989125990125991125992125993125994125995125996125997125998125999126000126001126002126003126004126005126006126007126008126009126010126011126012126013126014126015126016126017126018126019126020126021126022126023126024126025126026126027126028126029126030126031126032126033126034126035126036126037126038126039126040126041126042126043126044126045126046126047126048126049126050126051126052126053126054126055126056126057126058126059126060126061126062126063126064126065126066126067126068126069126070126071126072126073126074126075126076126077126078126079126080126081126082126083126084126085126086126087126088126089126090126091126092126093126094126095126096126097126098126099126100126101126102126103126104126105126106126107126108126109126110126111126112126113126114126115126116126117126118126119126120126121126122126123126124126125126126126127126128126129126130126131126132126133126134126135126136126137126138126139126140126141126142126143126144126145126146126147126148126149126150126151126152126153126154126155126156126157126158126159126160126161126162126163126164126165126166126167126168126169126170126171126172126173126174126175126176126177126178126179126180126181126182126183126184126185126186126187126188126189126190126191126192126193126194126195126196126197126198126199126200126201126202126203126204126205126206126207126208126209126210126211126212126213126214126215126216126217126218126219126220126221126222126223126224126225126226126227126228126229126230126231126232126233126234126235126236126237126238126239126240126241126242126243126244126245126246126247126248126249126250126251126252126253126254126255126256126257126258126259126260126261126262126263126264126265126266126267126268126269126270126271126272126273126274126275126276126277126278126279126280126281126282126283126284126285126286126287126288126289126290126291126292126293126294126295126296126297126298126299126300126301126302126303126304126305126306126307126308126309126310126311126312126313126314126315126316126317126318126319126320126321126322126323126324126325126326126327126328126329126330126331126332126333126334126335126336126337126338126339126340126341126342126343126344126345126346126347126348126349126350126351126352126353126354126355126356126357126358126359126360126361126362126363126364126365126366126367126368126369126370126371126372126373126374126375126376126377126378126379126380126381126382126383126384126385126386126387126388126389126390126391126392126393126394126395126396126397126398126399126400126401126402126403126404126405126406126407126408126409126410126411126412126413126414126415126416126417126418126419126420126421126422126423126424126425126426126427126428126429126430126431126432126433126434126435126436126437126438126439126440126441126442126443126444126445126446126447126448126449126450126451126452126453126454126455126456126457126458126459126460126461126462126463126464126465126466126467126468126469126470126471126472126473126474126475126476126477126478126479126480126481126482126483126484126485126486126487126488126489126490126491126492126493126494126495126496126497126498126499126500126501126502126503126504126505126506126507126508126509126510126511126512126513126514126515126516126517126518126519126520126521126522126523126524126525126526126527126528126529126530126531126532126533126534126535126536126537126538126539126540126541126542126543126544126545126546126547126548126549126550126551126552126553126554126555126556126557126558126559126560126561126562126563126564126565126566126567126568126569126570126571126572126573126574126575126576126577126578126579126580126581126582126583126584126585126586126587126588126589126590126591126592126593126594126595126596126597126598126599126600126601126602126603126604126605126606126607126608126609126610126611126612126613126614126615126616126617126618126619126620126621126622126623126624126625126626126627126628126629126630126631126632126633126634126635126636126637126638126639126640126641126642126643126644126645126646126647126648126649126650126651126652126653126654126655126656126657126658126659126660126661126662126663126664126665126666126667126668126669126670126671126672126673126674126675126676126677126678126679126680126681126682126683126684126685126686126687126688126689126690126691126692126693126694126695126696126697126698126699126700126701126702126703126704126705126706126707126708126709126710126711126712126713126714126715126716126717126718126719126720126721126722126723126724126725126726126727126728126729126730126731126732126733126734126735126736126737126738126739126740126741126742126743126744126745126746126747126748126749126750126751126752126753126754126755126756126757126758126759126760126761126762126763126764126765126766126767126768126769126770126771126772126773126774126775126776126777126778126779126780126781126782126783126784126785126786126787126788126789126790126791126792126793126794126795126796126797126798126799126800126801126802126803126804126805126806126807126808126809126810126811126812126813126814126815126816126817126818126819126820126821126822126823126824126825126826126827126828126829126830126831126832126833126834126835126836126837126838126839126840126841126842126843126844126845126846126847126848126849126850126851126852126853126854126855126856126857126858126859126860126861126862126863126864126865126866126867126868126869126870126871126872126873126874126875126876126877126878126879126880126881126882126883126884126885126886126887126888126889126890126891126892126893126894126895126896126897126898126899126900126901126902126903126904126905126906126907126908126909126910126911126912126913126914126915126916126917126918126919126920126921126922126923126924126925126926126927126928126929126930126931126932126933126934126935126936126937126938126939126940126941126942126943126944126945126946126947126948126949126950126951126952126953126954126955126956126957126958126959126960126961126962126963126964126965126966126967126968126969126970126971126972126973126974126975126976126977126978126979126980126981126982126983126984126985126986126987126988126989126990126991126992126993126994126995126996126997126998126999127000127001127002127003127004127005127006127007127008127009127010127011127012127013127014127015127016127017127018127019127020127021127022127023127024127025127026127027127028127029127030127031127032127033127034127035127036127037127038127039127040127041127042127043127044127045127046127047127048127049127050127051127052127053127054127055127056127057127058127059127060127061127062127063127064127065127066127067127068127069127070127071127072127073127074127075127076127077127078127079127080127081127082127083127084127085127086127087127088127089127090127091127092127093127094127095127096127097127098127099127100127101127102127103127104127105127106127107127108127109127110127111127112127113127114127115127116127117127118127119127120127121127122127123127124127125127126127127127128127129127130127131127132127133127134127135127136127137127138127139127140127141127142127143127144127145127146127147127148127149127150127151127152127153127154127155127156127157127158127159127160127161127162127163127164127165127166127167127168127169127170127171127172127173127174127175127176127177127178127179127180127181127182127183127184127185127186127187127188127189127190127191127192127193127194127195127196127197127198127199127200127201127202127203127204127205127206127207127208127209127210127211127212127213127214127215127216127217127218127219127220127221127222127223127224127225127226127227127228127229127230127231127232127233127234127235127236127237127238127239127240127241127242127243127244127245127246127247127248127249127250127251127252127253127254127255127256127257127258127259127260127261127262127263127264127265127266127267127268127269127270127271127272127273127274127275127276127277127278127279127280127281127282127283127284127285127286127287127288127289127290127291127292127293127294127295127296127297127298127299127300127301127302127303127304127305127306127307127308127309127310127311127312127313127314127315127316127317127318127319127320127321127322127323127324127325127326127327127328127329127330127331127332127333127334127335127336127337127338127339127340127341127342127343127344127345127346127347127348127349127350127351127352127353127354127355127356127357127358127359127360127361127362127363127364127365127366127367127368127369127370127371127372127373127374127375127376127377127378127379127380127381127382127383127384127385127386127387127388127389127390127391127392127393127394127395127396127397127398127399127400127401127402127403127404127405127406127407127408127409127410127411127412127413127414127415127416127417127418127419127420127421127422127423127424127425127426127427127428127429127430127431127432127433127434127435127436127437127438127439127440127441127442127443127444127445127446127447127448127449127450127451127452127453127454127455127456127457127458127459127460127461127462127463127464127465127466127467127468127469127470127471127472127473127474127475127476127477127478127479127480127481127482127483127484127485127486127487127488127489127490127491127492127493127494127495127496127497127498127499127500127501127502127503127504127505127506127507127508127509127510127511127512127513127514127515127516127517127518127519127520127521127522127523127524127525127526127527127528127529127530127531127532127533127534127535127536127537127538127539127540127541127542127543127544127545127546127547127548127549127550127551127552127553127554127555127556127557127558127559127560127561127562127563127564127565127566127567127568127569127570127571127572127573127574127575127576127577127578127579127580127581127582127583127584127585127586127587127588127589127590127591127592127593127594127595127596127597127598127599127600127601127602127603127604127605127606127607127608127609127610127611127612127613127614127615127616127617127618127619127620127621127622127623127624127625127626127627127628127629127630127631127632127633127634127635127636127637127638127639127640127641127642127643127644127645127646127647127648127649127650127651127652127653127654127655127656127657127658127659127660127661127662127663127664127665127666127667127668127669127670127671127672127673127674127675127676127677127678127679127680127681127682127683127684127685127686127687127688127689127690127691127692127693127694127695127696127697127698127699127700127701127702127703127704127705127706127707127708127709127710127711127712127713127714127715127716127717127718127719127720127721127722127723127724127725127726127727127728127729127730127731127732127733127734127735127736127737127738127739127740127741127742127743127744127745127746127747127748127749127750127751127752127753127754127755127756127757127758127759127760127761127762127763127764127765127766127767127768127769127770127771127772127773127774127775127776127777127778127779127780127781127782127783127784127785127786127787127788127789127790127791127792127793127794127795127796127797127798127799127800127801127802127803127804127805127806127807127808127809127810127811127812127813127814127815127816127817127818127819127820127821127822127823127824127825127826127827127828127829127830127831127832127833127834127835127836127837127838127839127840127841127842127843127844127845127846127847127848127849127850127851127852127853127854127855127856127857127858127859127860127861127862127863127864127865127866127867127868127869127870127871127872127873127874127875127876127877127878127879127880127881127882127883127884127885127886127887127888127889127890127891127892127893127894127895127896127897127898127899127900127901127902127903127904127905127906127907127908127909127910127911127912127913127914127915127916127917127918127919127920127921127922127923127924127925127926127927127928127929127930127931127932127933127934127935127936127937127938127939127940127941127942127943127944127945127946127947127948127949127950127951127952127953127954127955127956127957127958127959127960127961127962127963127964127965127966127967127968127969127970127971127972127973127974127975127976127977127978127979127980127981127982127983127984127985127986127987127988127989127990127991127992127993127994127995127996127997127998127999128000128001128002128003128004128005128006128007128008128009128010128011128012128013128014128015128016128017128018128019128020128021128022128023128024128025128026128027128028128029128030128031128032128033128034128035128036128037128038128039128040128041128042128043128044128045128046128047128048128049128050128051128052128053128054128055128056128057128058128059128060128061128062128063128064128065128066128067128068128069128070128071128072128073128074128075128076128077128078128079128080128081128082128083128084128085128086128087128088128089128090128091128092128093128094128095128096128097128098128099128100128101128102128103128104128105128106128107128108128109128110128111128112128113128114128115128116128117128118128119128120128121128122128123128124128125128126128127128128128129128130128131128132128133128134128135128136128137128138128139128140128141128142128143128144128145128146128147128148128149128150128151128152128153128154128155128156128157128158128159128160128161128162128163128164128165128166128167128168128169128170128171128172128173128174128175128176128177128178128179128180128181128182128183128184128185128186128187128188128189128190128191128192128193128194128195128196128197128198128199128200128201128202128203128204128205128206128207128208128209128210128211128212128213128214128215128216128217128218128219128220128221128222128223128224128225128226128227128228128229128230128231128232128233128234128235128236128237128238128239128240128241128242128243128244128245128246128247128248128249128250128251128252128253128254128255128256128257128258128259128260128261128262128263128264128265128266128267128268128269128270128271128272128273128274128275128276128277128278128279128280128281128282128283128284128285128286128287128288128289128290128291128292128293128294128295128296128297128298128299128300128301128302128303128304128305128306128307128308128309128310128311128312128313128314128315128316128317128318128319128320128321128322128323128324128325128326128327128328128329128330128331128332128333128334128335128336128337128338128339128340128341128342128343128344128345128346128347128348128349128350128351128352128353128354128355128356128357128358128359128360128361128362128363128364128365128366128367128368128369128370128371128372128373128374128375128376128377128378128379128380128381128382128383128384128385128386128387128388128389128390128391128392128393128394128395128396128397128398128399128400128401128402128403128404128405128406128407128408128409128410128411128412128413128414128415128416128417128418128419128420128421128422128423128424128425128426128427128428128429128430128431128432128433128434128435128436128437128438128439128440128441128442128443128444128445128446128447128448128449128450128451128452128453128454128455128456128457128458128459128460128461128462128463128464128465128466128467128468128469128470128471128472128473128474128475128476128477128478128479128480128481128482128483128484128485128486128487128488128489128490128491128492128493128494128495128496128497128498128499128500128501128502128503128504128505128506128507128508128509128510128511128512128513128514128515128516128517128518128519128520128521128522128523128524128525128526128527128528128529128530128531128532128533128534128535128536128537128538128539128540128541128542128543128544128545128546128547128548128549128550128551128552128553128554128555128556128557128558128559128560128561128562128563128564128565128566128567128568128569128570128571128572128573128574128575128576128577128578128579128580128581128582128583128584128585128586128587128588128589128590128591128592128593128594128595128596128597128598128599128600128601128602128603128604128605128606128607128608128609128610128611128612128613128614128615128616128617128618128619128620128621128622128623128624128625128626128627128628128629128630128631128632128633128634128635128636128637128638128639128640128641128642128643128644128645128646128647128648128649128650128651128652128653128654128655128656128657128658128659128660128661128662128663128664128665128666128667128668128669128670128671128672128673128674128675128676128677128678128679128680128681128682128683128684128685128686128687128688128689128690128691128692128693128694128695128696128697128698128699128700128701128702128703128704128705128706128707128708128709128710128711128712128713128714128715128716128717128718128719128720128721128722128723128724128725128726128727128728128729128730128731128732128733128734128735128736128737128738128739128740128741128742128743128744128745128746128747128748128749128750128751128752128753128754128755128756128757128758128759128760128761128762128763128764128765128766128767128768128769128770128771128772128773128774128775128776128777128778128779128780128781128782128783128784128785128786128787128788128789128790128791128792128793128794128795128796128797128798128799128800128801128802128803128804128805128806128807128808128809128810128811128812128813128814128815128816128817128818128819128820128821128822128823128824128825128826128827128828128829128830128831128832128833128834128835128836128837128838128839128840128841128842128843128844128845128846128847128848128849128850128851128852128853128854128855128856128857128858128859128860128861128862128863128864128865128866128867128868128869128870128871128872128873128874128875128876128877128878128879128880128881128882128883128884128885128886128887128888128889128890128891128892128893128894128895128896128897128898128899128900128901128902128903128904128905128906128907128908128909128910128911128912128913128914128915128916128917128918128919128920128921128922128923128924128925128926128927128928128929128930128931128932128933128934128935128936128937128938128939128940128941128942128943128944128945128946128947128948128949128950128951128952128953128954128955128956128957128958128959128960128961128962128963128964128965128966128967128968128969128970128971128972128973128974128975128976128977128978128979128980128981128982128983128984128985128986128987128988128989128990128991128992128993128994128995128996128997128998128999129000129001129002129003129004129005129006129007129008129009129010129011129012129013129014129015129016129017129018129019129020129021129022129023129024129025129026129027129028129029129030129031129032129033129034129035129036129037129038129039129040129041129042129043129044129045129046129047129048129049129050129051129052129053129054129055129056129057129058129059129060129061129062129063129064129065129066129067129068129069129070129071129072129073129074129075129076129077129078129079129080129081129082129083129084129085129086129087129088129089129090129091129092129093129094129095129096129097129098129099129100129101129102129103129104129105129106129107129108129109129110129111129112129113129114129115129116129117129118129119129120129121129122129123129124129125129126129127129128129129129130129131129132129133129134129135129136129137129138129139129140129141129142129143129144129145129146129147129148129149129150129151129152129153129154129155129156129157129158129159129160129161129162129163129164129165129166129167129168129169129170129171129172129173129174129175129176129177129178129179129180129181129182129183129184129185129186129187129188129189129190129191129192129193129194129195129196129197129198129199129200129201129202129203129204129205129206129207129208129209129210129211129212129213129214129215129216129217129218129219129220129221129222129223129224129225129226129227129228129229129230129231129232129233129234129235129236129237129238129239129240129241129242129243129244129245129246129247129248129249129250129251129252129253129254129255129256129257129258129259129260129261129262129263129264129265129266129267129268129269129270129271129272129273129274129275129276129277129278129279129280129281129282129283129284129285129286129287129288129289129290129291129292129293129294129295129296129297129298129299129300129301129302129303129304129305129306129307129308129309129310129311129312129313129314129315129316129317129318129319129320129321129322129323129324129325129326129327129328129329129330129331129332129333129334129335129336129337129338129339129340129341129342129343129344129345129346129347129348129349129350129351129352129353129354129355129356129357129358129359129360129361129362129363129364129365129366129367129368129369129370129371129372129373129374129375129376129377129378129379129380129381129382129383129384129385129386129387129388129389129390129391129392129393129394129395129396129397129398129399129400129401129402129403129404129405129406129407129408129409129410129411129412129413129414129415129416129417129418129419129420129421129422129423129424129425129426129427129428129429129430129431129432129433129434129435129436129437129438129439129440129441129442129443129444129445129446129447129448129449129450129451129452129453129454129455129456129457129458129459129460129461129462129463129464129465129466129467129468129469129470129471129472129473129474129475129476129477129478129479129480129481129482129483129484129485129486129487129488129489129490129491129492129493129494129495129496129497129498129499129500129501129502129503129504129505129506129507129508129509129510129511129512129513129514129515129516129517129518129519129520129521129522129523129524129525129526129527129528129529129530129531129532129533129534129535129536129537129538129539129540129541129542129543129544129545129546129547129548129549129550129551129552129553129554129555129556129557129558129559129560129561129562129563129564129565129566129567129568129569129570129571129572129573129574129575129576129577129578129579129580129581129582129583129584129585129586129587129588129589129590129591129592129593129594129595129596129597129598129599129600129601129602129603129604129605129606129607129608129609129610129611129612129613129614129615129616129617129618129619129620129621129622129623129624129625129626129627129628129629129630129631129632129633129634129635129636129637129638129639129640129641129642129643129644129645129646129647129648129649129650129651129652129653129654129655129656129657129658129659129660129661129662129663129664129665129666129667129668129669129670129671129672129673129674129675129676129677129678129679129680129681129682129683129684129685129686129687129688129689129690129691129692129693129694129695129696129697129698129699129700129701129702129703129704129705129706129707129708129709129710129711129712129713129714129715129716129717129718129719129720129721129722129723129724129725129726129727129728129729129730129731129732129733129734129735129736129737129738129739129740129741129742129743129744129745129746129747129748129749129750129751129752129753129754129755129756129757129758129759129760129761129762129763129764129765129766129767129768129769129770129771129772129773129774129775129776129777129778129779129780129781129782129783129784129785129786129787129788129789129790129791129792129793129794129795129796129797129798129799129800129801129802129803129804129805129806129807129808129809129810129811129812129813129814129815129816129817129818129819129820129821129822129823129824129825129826129827129828129829129830129831129832129833129834129835129836129837129838129839129840129841129842129843129844129845129846129847129848129849129850129851129852129853129854129855129856129857129858129859129860129861129862129863129864129865129866129867129868129869129870129871129872129873129874129875129876129877129878129879129880129881129882129883129884129885129886129887129888129889129890129891129892129893129894129895129896129897129898129899129900129901129902129903129904129905129906129907129908129909129910129911129912129913129914129915129916129917129918129919129920129921129922129923129924129925129926129927129928129929129930129931129932129933129934129935129936129937129938129939129940129941129942129943129944129945129946129947129948129949129950129951129952129953129954129955129956129957129958129959129960129961129962129963129964129965129966129967129968129969129970129971129972129973129974129975129976129977129978129979129980129981129982129983129984129985129986129987129988129989129990129991129992129993129994129995129996129997129998129999130000130001130002130003130004130005130006130007130008130009130010130011130012130013130014130015130016130017130018130019130020130021130022130023130024130025130026130027130028130029130030130031130032130033130034130035130036130037130038130039130040130041130042130043130044130045130046130047130048130049130050130051130052130053130054130055130056130057130058130059130060130061130062130063130064130065130066130067130068130069130070130071130072130073130074130075130076130077130078130079130080130081130082130083130084130085130086130087130088130089130090130091130092130093130094130095130096130097130098130099130100130101130102130103130104130105130106130107130108130109130110130111130112130113130114130115130116130117130118130119130120130121130122130123130124130125130126130127130128130129130130130131130132130133130134130135130136130137130138130139130140130141130142130143130144130145130146130147130148130149130150130151130152130153130154130155130156130157130158130159130160130161130162130163130164130165130166130167130168130169130170130171130172130173130174130175130176130177130178130179130180130181130182130183130184130185130186130187130188130189130190130191130192130193130194130195130196130197130198130199130200130201130202130203130204130205130206130207130208130209130210130211130212130213130214130215130216130217130218130219130220130221130222130223130224130225130226130227130228130229130230130231130232130233130234130235130236130237130238130239130240130241130242130243130244130245130246130247130248130249130250130251130252130253130254130255130256130257130258130259130260130261130262130263130264130265130266130267130268130269130270130271130272130273130274130275130276130277130278130279130280130281130282130283130284130285130286130287130288130289130290130291130292130293130294130295130296130297130298130299130300130301130302130303130304130305130306130307130308130309130310130311130312130313130314130315130316130317130318130319130320130321130322130323130324130325130326130327130328130329130330130331130332130333130334130335130336130337130338130339130340130341130342130343130344130345130346130347130348130349130350130351130352130353130354130355130356130357130358130359130360130361130362130363130364130365130366130367130368130369130370130371130372130373130374130375130376130377130378130379130380130381130382130383130384130385130386130387130388130389130390130391130392130393130394130395130396130397130398130399130400130401130402130403130404130405130406130407130408130409130410130411130412130413130414130415130416130417130418130419130420130421130422130423130424130425130426130427130428130429130430130431130432130433130434130435130436130437130438130439130440130441130442130443130444130445130446130447130448130449130450130451130452130453130454130455130456130457130458130459130460130461130462130463130464130465130466130467130468130469130470130471130472130473130474130475130476130477130478130479130480130481130482130483130484130485130486130487130488130489130490130491130492130493130494130495130496130497130498130499130500130501130502130503130504130505130506130507130508130509130510130511130512130513130514130515130516130517130518130519130520130521130522130523130524130525130526130527130528130529130530130531130532130533130534130535130536130537130538130539130540130541130542130543130544130545130546130547130548130549130550130551130552130553130554130555130556130557130558130559130560130561130562130563130564130565130566130567130568130569130570130571130572130573130574130575130576130577130578130579130580130581130582130583130584130585130586130587130588130589130590130591130592130593130594130595130596130597130598130599130600130601130602130603130604130605130606130607130608130609130610130611130612130613130614130615130616130617130618130619130620130621130622130623130624130625130626130627130628130629130630130631130632130633130634130635130636130637130638130639130640130641130642130643130644130645130646130647130648130649130650130651130652130653130654130655130656130657130658130659130660130661130662130663130664130665130666130667130668130669130670130671130672130673130674130675130676130677130678130679130680130681130682130683130684130685130686130687130688130689130690130691130692130693130694130695130696130697130698130699130700130701130702130703130704130705130706130707130708130709130710130711130712130713130714130715130716130717130718130719130720130721130722130723130724130725130726130727130728130729130730130731130732130733130734130735130736130737130738130739130740130741130742130743130744130745130746130747130748130749130750130751130752130753130754130755130756130757130758130759130760130761130762130763130764130765130766130767130768130769130770130771130772130773130774130775130776130777130778130779130780130781130782130783130784130785130786130787130788130789130790130791130792130793130794130795130796130797130798130799130800130801130802130803130804130805130806130807130808130809130810130811130812130813130814130815130816130817130818130819130820130821130822130823130824130825130826130827130828130829130830130831130832130833130834130835130836130837130838130839130840130841130842130843130844130845130846130847130848130849130850130851130852130853130854130855130856130857130858130859130860130861130862130863130864130865130866130867130868130869130870130871130872130873130874130875130876130877130878130879130880130881130882130883130884130885130886130887130888130889130890130891130892130893130894130895130896130897130898130899130900130901130902130903130904130905130906130907130908130909130910130911130912130913130914130915130916130917130918130919130920130921130922130923130924130925130926130927130928130929130930130931130932130933130934130935130936130937130938130939130940130941130942130943130944130945130946130947130948130949130950130951130952130953130954130955130956130957130958130959130960130961130962130963130964130965130966130967130968130969130970130971130972130973130974130975130976130977130978130979130980130981130982130983130984130985130986130987130988130989130990130991130992130993130994130995130996130997130998130999131000131001131002131003131004131005131006131007131008131009131010131011131012131013131014131015131016131017131018131019131020131021131022131023131024131025131026131027131028131029131030131031131032131033131034131035131036131037131038131039131040131041131042131043131044131045131046131047131048131049131050131051131052131053131054131055131056131057131058131059131060131061131062131063131064131065131066131067131068131069131070131071131072131073131074131075131076131077131078131079131080131081131082131083131084131085131086131087131088131089131090131091131092131093131094131095131096131097131098131099131100131101131102131103131104131105131106131107131108131109131110131111131112131113131114131115131116131117131118131119131120131121131122131123131124131125131126131127131128131129131130131131131132131133131134131135131136131137131138131139131140131141131142131143131144131145131146131147131148131149131150131151131152131153131154131155131156131157131158131159131160131161131162131163131164131165131166131167131168131169131170131171131172131173131174131175131176131177131178131179131180131181131182131183131184131185131186131187131188131189131190131191131192131193131194131195131196131197131198131199131200131201131202131203131204131205131206131207131208131209131210131211131212131213131214131215131216131217131218131219131220131221131222131223131224131225131226131227131228131229131230131231131232131233131234131235131236131237131238131239131240131241131242131243131244131245131246131247131248131249131250131251131252131253131254131255131256131257131258131259131260131261131262131263131264131265131266131267131268131269131270131271131272131273131274131275131276131277131278131279131280131281131282131283131284131285131286131287131288131289131290131291131292131293131294131295131296131297131298131299131300131301131302131303131304131305131306131307131308131309131310131311131312131313131314131315131316131317131318131319131320131321131322131323131324131325131326131327131328131329131330131331131332131333131334131335131336131337131338131339131340131341131342131343131344131345131346131347131348131349131350131351131352131353131354131355131356131357131358131359131360131361131362131363131364131365131366131367131368131369131370131371131372131373131374131375131376131377131378131379131380131381131382131383131384131385131386131387131388131389131390131391131392131393131394131395131396131397131398131399131400131401131402131403131404131405131406131407131408131409131410131411131412131413131414131415131416131417131418131419131420131421131422131423131424131425131426131427131428131429131430131431131432131433131434131435131436131437131438131439131440131441131442131443131444131445131446131447131448131449131450131451131452131453131454131455131456131457131458131459131460131461131462131463131464131465131466131467131468131469131470131471131472131473131474131475131476131477131478131479131480131481131482131483131484131485131486131487131488131489131490131491131492131493131494131495131496131497131498131499131500131501131502131503131504131505131506131507131508131509131510131511131512131513131514131515131516131517131518131519131520131521131522131523131524131525131526131527131528131529131530131531131532131533131534131535131536131537131538131539131540131541131542131543131544131545131546131547131548131549131550131551131552131553131554131555131556131557131558131559131560131561131562131563131564131565131566131567131568131569131570131571131572131573131574131575131576131577131578131579131580131581131582131583131584131585131586131587131588131589131590131591131592131593131594131595131596131597131598131599131600131601131602131603131604131605131606131607131608131609131610131611131612131613131614131615131616131617131618131619131620131621131622131623131624131625131626131627131628131629131630131631131632131633131634131635131636131637131638131639131640131641131642131643131644131645131646131647131648131649131650131651131652131653131654131655131656131657131658131659131660131661131662131663131664131665131666131667131668131669131670131671131672131673131674131675131676131677131678131679131680131681131682131683131684131685131686131687131688131689131690131691131692131693131694131695131696131697131698131699131700131701131702131703131704131705131706131707131708131709131710131711131712131713131714131715131716131717131718131719131720131721131722131723131724131725131726131727131728131729131730131731131732131733131734131735131736131737131738131739131740131741131742131743131744131745131746131747131748131749131750131751131752131753131754131755131756131757131758131759131760131761131762131763131764131765131766131767131768131769131770131771131772131773131774131775131776131777131778131779131780131781131782131783131784131785131786131787131788131789131790131791131792131793131794131795131796131797131798131799131800131801131802131803131804131805131806131807131808131809131810131811131812131813131814131815131816131817131818131819131820131821131822131823131824131825131826131827131828131829131830131831131832131833131834131835131836131837131838131839131840131841131842131843131844131845131846131847131848131849131850131851131852131853131854131855131856131857131858131859131860131861131862131863131864131865131866131867131868131869131870131871131872131873131874131875131876131877131878131879131880131881131882131883131884131885131886131887131888131889131890131891131892131893131894131895131896131897131898131899131900131901131902131903131904131905131906131907131908131909131910131911131912131913131914131915131916131917131918131919131920131921131922131923131924131925131926131927131928131929131930131931131932131933131934131935131936131937131938131939131940131941131942131943131944131945131946131947131948131949131950131951131952131953131954131955131956131957131958131959131960131961131962131963131964131965131966131967131968131969131970131971131972131973131974131975131976131977131978131979131980131981131982131983131984131985131986131987131988131989131990131991131992131993131994131995131996131997131998131999132000132001132002132003132004132005132006132007132008132009132010132011132012132013132014132015132016132017132018132019132020132021132022132023132024132025132026132027132028132029132030132031132032132033132034132035132036132037132038132039132040132041132042132043132044132045132046132047132048132049132050132051132052132053132054132055132056132057132058132059132060132061132062132063132064132065132066132067132068132069132070132071132072132073132074132075132076132077132078132079132080132081132082132083132084132085132086132087132088132089132090132091132092132093132094132095132096132097132098132099132100132101132102132103132104132105132106132107132108132109132110132111132112132113132114132115132116132117132118132119132120132121132122132123132124132125132126132127132128132129132130132131132132132133132134132135132136132137132138132139132140132141132142132143132144132145132146132147132148132149132150132151132152132153132154132155132156132157132158132159132160132161132162132163132164132165132166132167132168132169132170132171132172132173132174132175132176132177132178132179132180132181132182132183132184132185132186132187132188132189132190132191132192132193132194132195132196132197132198132199132200132201132202132203132204132205132206132207132208132209132210132211132212132213132214132215132216132217132218132219132220132221132222132223132224132225132226132227132228132229132230132231132232132233132234132235132236132237132238132239132240132241132242132243132244132245132246132247132248132249132250132251132252132253132254132255132256132257132258132259132260132261132262132263132264132265132266132267132268132269132270132271132272132273132274132275132276132277132278132279132280132281132282132283132284132285132286132287132288132289132290132291132292132293132294132295132296132297132298132299132300132301132302132303132304132305132306132307132308132309132310132311132312132313132314132315132316132317132318132319132320132321132322132323132324132325132326132327132328132329132330132331132332132333132334132335132336132337132338132339132340132341132342132343132344132345132346132347132348132349132350132351132352132353132354132355132356132357132358132359132360132361132362132363132364132365132366132367132368132369132370132371132372132373132374132375132376132377132378132379132380132381132382132383132384132385132386132387132388132389132390132391132392132393132394132395132396132397132398132399132400132401132402132403132404132405132406132407132408132409132410132411132412132413132414132415132416132417132418132419132420132421132422132423132424132425132426132427132428132429132430132431132432132433132434132435132436132437132438132439132440132441132442132443132444132445132446132447132448132449132450132451132452132453132454132455132456132457132458132459132460132461132462132463132464132465132466132467132468132469132470132471132472132473132474132475132476132477132478132479132480132481132482132483132484132485132486132487132488132489132490132491132492132493132494132495132496132497132498132499132500132501132502132503132504132505132506132507132508132509132510132511132512132513132514132515132516132517132518132519132520132521132522132523132524132525132526132527132528132529132530132531132532132533132534132535132536132537132538132539132540132541132542132543132544132545132546132547132548132549132550132551132552132553132554132555132556132557132558132559132560132561132562132563132564132565132566132567132568132569132570132571132572132573132574132575132576132577132578132579132580132581132582132583132584132585132586132587132588132589132590132591132592132593132594132595132596132597132598132599132600132601132602132603132604132605132606132607132608132609132610132611132612132613132614132615132616132617132618132619132620132621132622132623132624132625132626132627132628132629132630132631132632132633132634132635132636132637132638132639132640132641132642132643132644132645132646132647132648132649132650132651132652132653132654132655132656132657132658132659132660132661132662132663132664132665132666132667132668132669132670132671132672132673132674132675132676132677132678132679132680132681132682132683132684132685132686132687132688132689132690132691132692132693132694132695132696132697132698132699132700132701132702132703132704132705132706132707132708132709132710132711132712132713132714132715132716132717132718132719132720132721132722132723132724132725132726132727132728132729132730132731132732132733132734132735132736132737132738132739132740132741132742132743132744132745132746132747132748132749132750132751132752132753132754132755132756132757132758132759132760132761132762132763132764132765132766132767132768132769132770132771132772132773132774132775132776132777132778132779132780132781132782132783132784132785132786132787132788132789132790132791132792132793132794132795132796132797132798132799132800132801132802132803132804132805132806132807132808132809132810132811132812132813132814132815132816132817132818132819132820132821132822132823132824132825132826132827132828132829132830132831132832132833132834132835132836132837132838132839132840132841132842132843132844132845132846132847132848132849132850132851132852132853132854132855132856132857132858132859132860132861132862132863132864132865132866132867132868132869132870132871132872132873132874132875132876132877132878132879132880132881132882132883132884132885132886132887132888132889132890132891132892132893132894132895132896132897132898132899132900132901132902132903132904132905132906132907132908132909132910132911132912132913132914132915132916132917132918132919132920132921132922132923132924132925132926132927132928132929132930132931132932132933132934132935132936132937132938132939132940132941132942132943132944132945132946132947132948132949132950132951132952132953132954132955132956132957132958132959132960132961132962132963132964132965132966132967132968132969132970132971132972132973132974132975132976132977132978132979132980132981132982132983132984132985132986132987132988132989132990132991132992132993132994132995132996132997132998132999133000133001133002133003133004133005133006133007133008133009133010133011133012133013133014133015133016133017133018133019133020133021133022133023133024133025133026133027133028133029133030133031133032133033133034133035133036133037133038133039133040133041133042133043133044133045133046133047133048133049133050133051133052133053133054133055133056133057133058133059133060133061133062133063133064133065133066133067133068133069133070133071133072133073133074133075133076133077133078133079133080133081133082133083133084133085133086133087133088133089133090133091133092133093133094133095133096133097133098133099133100133101133102133103133104133105133106133107133108133109133110133111133112133113133114133115133116133117133118133119133120133121133122133123133124133125133126133127133128133129133130133131133132133133133134133135133136133137133138133139133140133141133142133143133144133145133146133147133148133149133150133151133152133153133154133155133156133157133158133159133160133161133162133163133164133165133166133167133168133169133170133171133172133173133174133175133176133177133178133179133180133181133182133183133184133185133186133187133188133189133190133191133192133193133194133195133196133197133198133199133200133201133202133203133204133205133206133207133208133209133210133211133212133213133214133215133216133217133218133219133220133221133222133223133224133225133226133227133228133229133230133231133232133233133234133235133236133237133238133239133240133241133242133243133244133245133246133247133248133249133250133251133252133253133254133255133256133257133258133259133260133261133262133263133264133265133266133267133268133269133270133271133272133273133274133275133276133277133278133279133280133281133282133283133284133285133286133287133288133289133290133291133292133293133294133295133296133297133298133299133300133301133302133303133304133305133306133307133308133309133310133311133312133313133314133315133316133317133318133319133320133321133322133323133324133325133326133327133328133329133330133331133332133333133334133335133336133337133338133339133340133341133342133343133344133345133346133347133348133349133350133351133352133353133354133355133356133357133358133359133360133361133362133363133364133365133366133367133368133369133370133371133372133373133374133375133376133377133378133379133380133381133382133383133384133385133386133387133388133389133390133391133392133393133394133395133396133397133398133399133400133401133402133403133404133405133406133407133408133409133410133411133412133413133414133415133416133417133418133419133420133421133422133423133424133425133426133427133428133429133430133431133432133433133434133435133436133437133438133439133440133441133442133443133444133445133446133447133448133449133450133451133452133453133454133455133456133457133458133459133460133461133462133463133464133465133466133467133468133469133470133471133472133473133474133475133476133477133478133479133480133481133482133483133484133485133486133487133488133489133490133491133492133493133494133495133496133497133498133499133500133501133502133503133504133505133506133507133508133509133510133511133512133513133514133515133516133517133518133519133520133521133522133523133524133525133526133527133528133529133530133531133532133533133534133535133536133537133538133539133540133541133542133543133544133545133546133547133548133549133550133551133552133553133554133555133556133557133558133559133560133561133562133563133564133565133566133567133568133569133570133571133572133573133574133575133576133577133578133579133580133581133582133583133584133585133586133587133588133589133590133591133592133593133594133595133596133597133598133599133600133601133602133603133604133605133606133607133608133609133610133611133612133613133614133615133616133617133618133619133620133621133622133623133624133625133626133627133628133629133630133631133632133633133634133635133636133637133638133639133640133641133642133643133644133645133646133647133648133649133650133651133652133653133654133655133656133657133658133659133660133661133662133663133664133665133666133667133668133669133670133671133672133673133674133675133676133677133678133679133680133681133682133683133684133685133686133687133688133689133690133691133692133693133694133695133696133697133698133699133700133701133702133703133704133705133706133707133708133709133710133711133712133713133714133715133716133717133718133719133720133721133722133723133724133725133726133727133728133729133730133731133732133733133734133735133736133737133738133739133740133741133742133743133744133745133746133747133748133749133750133751133752133753133754133755133756133757133758133759133760133761133762133763133764133765133766133767133768133769133770133771133772133773133774133775133776133777133778133779133780133781133782133783133784133785133786133787133788133789133790133791133792133793133794133795133796133797133798133799133800133801133802133803133804133805133806133807133808133809133810133811133812133813133814133815133816133817133818133819133820133821133822133823133824133825133826133827133828133829133830133831133832133833133834133835133836133837133838133839133840133841133842133843133844133845133846133847133848133849133850133851133852133853133854133855133856133857133858133859133860133861133862133863133864133865133866133867133868133869133870133871133872133873133874133875133876133877133878133879133880133881133882133883133884133885133886133887133888133889133890133891133892133893133894133895133896133897133898133899133900133901133902133903133904133905133906133907133908133909133910133911133912133913133914133915133916133917133918133919133920133921133922133923133924133925133926133927133928133929133930133931133932133933133934133935133936133937133938133939133940133941133942133943133944133945133946133947133948133949133950133951133952133953133954133955133956133957133958133959133960133961133962133963133964133965133966133967133968133969133970133971133972133973133974133975133976133977133978133979133980133981133982133983133984133985133986133987133988133989133990133991133992133993133994133995133996133997133998133999134000134001134002134003134004134005134006134007134008134009134010134011134012134013134014134015134016134017134018134019134020134021134022134023134024134025134026134027134028134029134030134031134032134033134034134035134036134037134038134039134040134041134042134043134044134045134046134047134048134049134050134051134052134053134054134055134056134057134058134059134060134061134062134063134064134065134066134067134068134069134070134071134072134073134074134075134076134077134078134079134080134081134082134083134084134085134086134087134088134089134090134091134092134093134094134095134096134097134098134099134100134101134102134103134104134105134106134107134108134109134110134111134112134113134114134115134116134117134118134119134120134121134122134123134124134125134126134127134128134129134130134131134132134133134134134135134136134137134138134139134140134141134142134143134144134145134146134147134148134149134150134151134152134153134154134155134156134157134158134159134160134161134162134163134164134165134166134167134168134169134170134171134172134173134174134175134176134177134178134179134180134181134182134183134184134185134186134187134188134189134190134191134192134193134194134195134196134197134198134199134200134201134202134203134204134205134206134207134208134209134210134211134212134213134214134215134216134217134218134219134220134221134222134223134224134225134226134227134228134229134230134231134232134233134234134235134236134237134238134239134240134241134242134243134244134245134246134247134248134249134250134251134252134253134254134255134256134257134258134259134260134261134262134263134264134265134266134267134268134269134270134271134272134273134274134275134276134277134278134279134280134281134282134283134284134285134286134287134288134289134290134291134292134293134294134295134296134297134298134299134300134301134302134303134304134305134306134307134308134309134310134311134312134313134314134315134316134317134318134319134320134321134322134323134324134325134326134327134328134329134330134331134332134333134334134335134336134337134338134339134340134341134342134343134344134345134346134347134348134349134350134351134352134353134354134355134356134357134358134359134360134361134362134363134364134365134366134367134368134369134370134371134372134373134374134375134376134377134378134379134380134381134382134383134384134385134386134387134388134389134390134391134392134393134394134395134396134397134398134399134400134401134402134403134404134405134406134407134408134409134410134411134412134413134414134415134416134417134418134419134420134421134422134423134424134425134426134427134428134429134430134431134432134433134434134435134436134437134438134439134440134441134442134443134444134445134446134447134448134449134450134451134452134453134454134455134456134457134458134459134460134461134462134463134464134465134466134467134468134469134470134471134472134473134474134475134476134477134478134479134480134481134482134483134484134485134486134487134488134489134490134491134492134493134494134495134496134497134498134499134500134501134502134503134504134505134506134507134508134509134510134511134512134513134514134515134516134517134518134519134520134521134522134523134524134525134526134527134528134529134530134531134532134533134534134535134536134537134538134539134540134541134542134543134544134545134546134547134548134549134550134551134552134553134554134555134556134557134558134559134560134561134562134563134564134565134566134567134568134569134570134571134572134573134574134575134576134577134578134579134580134581134582134583134584134585134586134587134588134589134590134591134592134593134594134595134596134597134598134599134600134601134602134603134604134605134606134607134608134609134610134611134612134613134614134615134616134617134618134619134620134621134622134623134624134625134626134627134628134629134630134631134632134633134634134635134636134637134638134639134640134641134642134643134644134645134646134647134648134649134650134651134652134653134654134655134656134657134658134659134660134661134662134663134664134665134666134667134668134669134670134671134672134673134674134675134676134677134678134679134680134681134682134683134684134685134686134687134688134689134690134691134692134693134694134695134696134697134698134699134700134701134702134703134704134705134706134707134708134709134710134711134712134713134714134715134716134717134718134719134720134721134722134723134724134725134726134727134728134729134730134731134732134733134734134735134736134737134738134739134740134741134742134743134744134745134746134747134748134749134750134751134752134753134754134755134756134757134758134759134760134761134762134763134764134765134766134767134768134769134770134771134772134773134774134775134776134777134778134779134780134781134782134783134784134785134786134787134788134789134790134791134792134793134794134795134796134797134798134799134800134801134802134803134804134805134806134807134808134809134810134811134812134813134814134815134816134817134818134819134820134821134822134823134824134825134826134827134828134829134830134831134832134833134834134835134836134837134838134839134840134841134842134843134844134845134846134847134848134849134850134851134852134853134854134855134856134857134858134859134860134861134862134863134864134865134866134867134868134869134870134871134872134873134874134875134876134877134878134879134880134881134882134883134884134885134886134887134888134889134890134891134892134893134894134895134896134897134898134899134900134901134902134903134904134905134906134907134908134909134910134911134912134913134914134915134916134917134918134919134920134921134922134923134924134925134926134927134928134929134930134931134932134933134934134935134936134937134938134939134940134941134942134943134944134945134946134947134948134949134950134951134952134953134954134955134956134957134958134959134960134961134962134963134964134965134966134967134968134969134970134971134972134973134974134975134976134977134978134979134980134981134982134983134984134985134986134987134988134989134990134991134992134993134994134995134996134997134998134999135000135001135002135003135004135005135006135007135008135009135010135011135012135013135014135015135016135017135018135019135020135021135022135023135024135025135026135027135028135029135030135031135032135033135034135035135036135037135038135039135040135041135042135043135044135045135046135047135048135049135050135051135052135053135054135055135056135057135058135059135060135061135062135063135064135065135066135067135068135069135070135071135072135073135074135075135076135077135078135079135080135081135082135083135084135085135086135087135088135089135090135091135092135093135094135095135096135097135098135099135100135101135102135103135104135105135106135107135108135109135110135111135112135113135114135115135116135117135118135119135120135121135122135123135124135125135126135127135128135129135130135131135132135133135134135135135136135137135138135139135140135141135142135143135144135145135146135147135148135149135150135151135152135153135154135155135156135157135158135159135160135161135162135163135164135165135166135167135168135169135170135171135172135173135174135175135176135177135178135179135180135181135182135183135184135185135186135187135188135189135190135191135192135193135194135195135196135197135198135199135200135201135202135203135204135205135206135207135208135209135210135211135212135213135214135215135216135217135218135219135220135221135222135223135224135225135226135227135228135229135230135231135232135233135234135235135236135237135238135239135240135241135242135243135244135245135246135247135248135249135250135251135252135253135254135255135256135257135258135259135260135261135262135263135264135265135266135267135268135269135270135271135272135273135274135275135276135277135278135279135280135281135282135283135284135285135286135287135288135289135290135291135292135293135294135295135296135297135298135299135300135301135302135303135304135305135306135307135308135309135310135311135312135313135314135315135316135317135318135319135320135321135322135323135324135325135326135327135328135329135330135331135332135333135334135335135336135337135338135339135340135341135342135343135344135345135346135347135348135349135350135351135352135353135354135355135356135357135358135359135360135361135362135363135364135365135366135367135368135369135370135371135372135373135374135375135376135377135378135379135380135381135382135383135384135385135386135387135388135389135390135391135392135393135394135395135396135397135398135399135400135401135402135403135404135405135406135407135408135409135410135411135412135413135414135415135416135417135418135419135420135421135422135423135424135425135426135427135428135429135430135431135432135433135434135435135436135437135438135439135440135441135442135443135444135445135446135447135448135449135450135451135452135453135454135455135456135457135458135459135460135461135462135463135464135465135466135467135468135469135470135471135472135473135474135475135476135477135478135479135480135481135482135483135484135485135486135487135488135489135490135491135492135493135494135495135496135497135498135499135500135501135502135503135504135505135506135507135508135509135510135511135512135513135514135515135516135517135518135519135520135521135522135523135524135525135526135527135528135529135530135531135532135533135534135535135536135537135538135539135540135541135542135543135544135545135546135547135548135549135550135551135552135553135554135555135556135557135558135559135560135561135562135563135564135565135566135567135568135569135570135571135572135573135574135575135576135577135578135579135580135581135582135583135584135585135586135587135588135589135590135591135592135593135594135595135596135597135598135599135600135601135602135603135604135605135606135607135608135609135610135611135612135613135614135615135616135617135618135619135620135621135622135623135624135625135626135627135628135629135630135631135632135633135634135635135636135637135638135639135640135641135642135643135644135645135646135647135648135649135650135651135652135653135654135655135656135657135658135659135660135661135662135663135664135665135666135667135668135669135670135671135672135673135674135675135676135677135678135679135680135681135682135683135684135685135686135687135688135689135690135691135692135693135694135695135696135697135698135699135700135701135702135703135704135705135706135707135708135709135710135711135712135713135714135715135716135717135718135719135720135721135722135723135724135725135726135727135728135729135730135731135732135733135734135735135736135737135738135739135740135741135742135743135744135745135746135747135748135749135750135751135752135753135754135755135756135757135758135759135760135761135762135763135764135765135766135767135768135769135770135771135772135773135774135775135776135777135778135779135780135781135782135783135784135785135786135787135788135789135790135791135792135793135794135795135796135797135798135799135800135801135802135803135804135805135806135807135808135809135810135811135812135813135814135815135816135817135818135819135820135821135822135823135824135825135826135827135828135829135830135831135832135833135834135835135836135837135838135839135840135841135842135843135844135845135846135847135848135849135850135851135852135853135854135855135856135857135858135859135860135861135862135863135864135865135866135867135868135869135870135871135872135873135874135875135876135877135878135879135880135881135882135883135884135885135886135887135888135889135890135891135892135893135894135895135896135897135898135899135900135901135902135903135904135905135906135907135908135909135910135911135912135913135914135915135916135917135918135919135920135921135922135923135924135925135926135927135928135929135930135931135932135933135934135935135936135937135938135939135940135941135942135943135944135945135946135947135948135949135950135951135952135953135954135955135956135957135958135959135960135961135962135963135964135965135966135967135968135969135970135971135972135973135974135975135976135977135978135979135980135981135982135983135984135985135986135987135988135989135990135991135992135993135994135995135996135997135998135999136000136001136002136003136004136005136006136007136008136009136010136011136012136013136014136015136016136017136018136019136020136021136022136023136024136025136026136027136028136029136030136031136032136033136034136035136036136037136038136039136040136041136042136043136044136045136046136047136048136049136050136051136052136053136054136055136056136057136058136059136060136061136062136063136064136065136066136067136068136069136070136071136072136073136074136075136076136077136078136079136080136081136082136083136084136085136086136087136088136089136090136091136092136093136094136095136096136097136098136099136100136101136102136103136104136105136106136107136108136109136110136111136112136113136114136115136116136117136118136119136120136121136122136123136124136125136126136127136128136129136130136131136132136133136134136135136136136137136138136139136140136141136142136143136144136145136146136147136148136149136150136151136152136153136154136155136156136157136158136159136160136161136162136163136164136165136166136167136168136169136170136171136172136173136174136175136176136177136178136179136180136181136182136183136184136185136186136187136188136189136190136191136192136193136194136195136196136197136198136199136200136201136202136203136204136205136206136207136208136209136210136211136212136213136214136215136216136217136218136219136220136221136222136223136224136225136226136227136228136229136230136231136232136233136234136235136236136237136238136239136240136241136242136243136244136245136246136247136248136249136250136251136252136253136254136255136256136257136258136259136260136261136262136263136264136265136266136267136268136269136270136271136272136273136274136275136276136277136278136279136280136281136282136283136284136285136286136287136288136289136290136291136292136293136294136295136296136297136298136299136300136301136302136303136304136305136306136307136308136309136310136311136312136313136314136315136316136317136318136319136320136321136322136323136324136325136326136327136328136329136330136331136332136333136334136335136336136337136338136339136340136341136342136343136344136345136346136347136348136349136350136351136352136353136354136355136356136357136358136359136360136361136362136363136364136365136366136367136368136369136370136371136372136373136374136375136376136377136378136379136380136381136382136383136384136385136386136387136388136389136390136391136392136393136394136395136396136397136398136399136400136401136402136403136404136405136406136407136408136409136410136411136412136413136414136415136416136417136418136419136420136421136422136423136424136425136426136427136428136429136430136431136432136433136434136435136436136437136438136439136440136441136442136443136444136445136446136447136448136449136450136451136452136453136454136455136456136457136458136459136460136461136462136463136464136465136466136467136468136469136470136471136472136473136474136475136476136477136478136479136480136481136482136483136484136485136486136487136488136489136490136491136492136493136494136495136496136497136498136499136500136501136502136503136504136505136506136507136508136509136510136511136512136513136514136515136516136517136518136519136520136521136522136523136524136525136526136527136528136529136530136531136532136533136534136535136536136537136538136539136540136541136542136543136544136545136546136547136548136549136550136551136552136553136554136555136556136557136558136559136560136561136562136563136564136565136566136567136568136569136570136571136572136573136574136575136576136577136578136579136580136581136582136583136584136585136586136587136588136589136590136591136592136593136594136595136596136597136598136599136600136601136602136603136604136605136606136607136608136609136610136611136612136613136614136615136616136617136618136619136620136621136622136623136624136625136626136627136628136629136630136631136632136633136634136635136636136637136638136639136640136641136642136643136644136645136646136647136648136649136650136651136652136653136654136655136656136657136658136659136660136661136662136663136664136665136666136667136668136669136670136671136672136673136674136675136676136677136678136679136680136681136682136683136684136685136686136687136688136689136690136691136692136693136694136695136696136697136698136699136700136701136702136703136704136705136706136707136708136709136710136711136712136713136714136715136716136717136718136719136720136721136722136723136724136725136726136727136728136729136730136731136732136733136734136735136736136737136738136739136740136741136742136743136744136745136746136747136748136749136750136751136752136753136754136755136756136757136758136759136760136761136762136763136764136765136766136767136768136769136770136771136772136773136774136775136776136777136778136779136780136781136782136783136784136785136786136787136788136789136790136791136792136793136794136795136796136797136798136799136800136801136802136803136804136805136806136807136808136809136810136811136812136813136814136815136816136817136818136819136820136821136822136823136824136825136826136827136828136829136830136831136832136833136834136835136836136837136838136839136840136841136842136843136844136845136846136847136848136849136850136851136852136853136854136855136856136857136858136859136860136861136862136863136864136865136866136867136868136869136870136871136872136873136874136875136876136877136878136879136880136881136882136883136884136885136886136887136888136889136890136891136892136893136894136895136896136897136898136899136900136901136902136903136904136905136906136907136908136909136910136911136912136913136914136915136916136917136918136919136920136921136922136923136924136925136926136927136928136929136930136931136932136933136934136935136936136937136938136939136940136941136942136943136944136945136946136947136948136949136950136951136952136953136954136955136956136957136958136959136960136961136962136963136964136965136966136967136968136969136970136971136972136973136974136975136976136977136978136979136980136981136982136983136984136985136986136987136988136989136990136991136992136993136994136995136996136997136998136999137000137001137002137003137004137005137006137007137008137009137010137011137012137013137014137015137016137017137018137019137020137021137022137023137024137025137026137027137028137029137030137031137032137033137034137035137036137037137038137039137040137041137042137043137044137045137046137047137048137049137050137051137052137053137054137055137056137057137058137059137060137061137062137063137064137065137066137067137068137069137070137071137072137073137074137075137076137077137078137079137080137081137082137083137084137085137086137087137088137089137090137091137092137093137094137095137096137097137098137099137100137101137102137103137104137105137106137107137108137109137110137111137112137113137114137115137116137117137118137119137120137121137122137123137124137125137126137127137128137129137130137131137132137133137134137135137136137137137138137139137140137141137142137143137144137145137146137147137148137149137150137151137152137153137154137155137156137157137158137159137160137161137162137163137164137165137166137167137168137169137170137171137172137173137174137175137176137177137178137179137180137181137182137183137184137185137186137187137188137189137190137191137192137193137194137195137196137197137198137199137200137201137202137203137204137205137206137207137208137209137210137211137212137213137214137215137216137217137218137219137220137221137222137223137224137225137226137227137228137229137230137231137232137233137234137235137236137237137238137239137240137241137242137243137244137245137246137247137248137249137250137251137252137253137254137255137256137257137258137259137260137261137262137263137264137265137266137267137268137269137270137271137272137273137274137275137276137277137278137279137280137281137282137283137284137285137286137287137288137289137290137291137292137293137294137295137296137297137298137299137300137301137302137303137304137305137306137307137308137309137310137311137312137313137314137315137316137317137318137319137320137321137322137323137324137325137326137327137328137329137330137331137332137333137334137335137336137337137338137339137340137341137342137343137344137345137346137347137348137349137350137351137352137353137354137355137356137357137358137359137360137361137362137363137364137365137366137367137368137369137370137371137372137373137374137375137376137377137378137379137380137381137382137383137384137385137386137387137388137389137390137391137392137393137394137395137396137397137398137399137400137401137402137403137404137405137406137407137408137409137410137411137412137413137414137415137416137417137418137419137420137421137422137423137424137425137426137427137428137429137430137431137432137433137434137435137436137437137438137439137440137441137442137443137444137445137446137447137448137449137450137451137452137453137454137455137456137457137458137459137460137461137462137463137464137465137466137467137468137469137470137471137472137473137474137475137476137477137478137479137480137481137482137483137484137485137486137487137488137489137490137491137492137493137494137495137496137497137498137499137500137501137502137503137504137505137506137507137508137509137510137511137512137513137514137515137516137517137518137519137520137521137522137523137524137525137526137527137528137529137530137531137532137533137534137535137536137537137538137539137540137541137542137543137544137545137546137547137548137549137550137551137552137553137554137555137556137557137558137559137560137561137562137563137564137565137566137567137568137569137570137571137572137573137574137575137576137577137578137579137580137581137582137583137584137585137586137587137588137589137590137591137592137593137594137595137596137597137598137599137600137601137602137603137604137605137606137607137608137609137610137611137612137613137614137615137616137617137618137619137620137621137622137623137624137625137626137627137628137629137630137631137632137633137634137635137636137637137638137639137640137641137642137643137644137645137646137647137648137649137650137651137652137653137654137655137656137657137658137659137660137661137662137663137664137665137666137667137668137669137670137671137672137673137674137675137676137677137678137679137680137681137682137683137684137685137686137687137688137689137690137691137692137693137694137695137696137697137698137699137700137701137702137703137704137705137706137707137708137709137710137711137712137713137714137715137716137717137718137719137720137721137722137723137724137725137726137727137728137729137730137731137732137733137734137735137736137737137738137739137740137741137742137743137744137745137746137747137748137749137750137751137752137753137754137755137756137757137758137759137760137761137762137763137764137765137766137767137768137769137770137771137772137773137774137775137776137777137778137779137780137781137782137783137784137785137786137787137788137789137790137791137792137793137794137795137796137797137798137799137800137801137802137803137804137805137806137807137808137809137810137811137812137813137814137815137816137817137818137819137820137821137822137823137824137825137826137827137828137829137830137831137832137833137834137835137836137837137838137839137840137841137842137843137844137845137846137847137848137849137850137851137852137853137854137855137856137857137858137859137860137861137862137863137864137865137866137867137868137869137870137871137872137873137874137875137876137877137878137879137880137881137882137883137884137885137886137887137888137889137890137891137892137893137894137895137896137897137898137899137900137901137902137903137904137905137906137907137908137909137910137911137912137913137914137915137916137917137918137919137920137921137922137923137924137925137926137927137928137929137930137931137932137933137934137935137936137937137938137939137940137941137942137943137944137945137946137947137948137949137950137951137952137953137954137955137956137957137958137959137960137961137962137963137964137965137966137967137968137969137970137971137972137973137974137975137976137977137978137979137980137981137982137983137984137985137986137987137988137989137990137991137992137993137994137995137996137997137998137999138000138001138002138003138004138005138006138007138008138009138010138011138012138013138014138015138016138017138018138019138020138021138022138023138024138025138026138027138028138029138030138031138032138033138034138035138036138037138038138039138040138041138042138043138044138045138046138047138048138049138050138051138052138053138054138055138056138057138058138059138060138061138062138063138064138065138066138067138068138069138070138071138072138073138074138075138076138077138078138079138080138081138082138083138084138085138086138087138088138089138090138091138092138093138094138095138096138097138098138099138100138101138102138103138104138105138106138107138108138109138110138111138112138113138114138115138116138117138118138119138120138121138122138123138124138125138126138127138128138129138130138131138132138133138134138135138136138137138138138139138140138141138142138143138144138145138146138147138148138149138150138151138152138153138154138155138156138157138158138159138160138161138162138163138164138165138166138167138168138169138170138171138172138173138174138175138176138177138178138179138180138181138182138183138184138185138186138187138188138189138190138191138192138193138194138195138196138197138198138199138200138201138202138203138204138205138206138207138208138209138210138211138212138213138214138215138216138217138218138219138220138221138222138223138224138225138226138227138228138229138230138231138232138233138234138235138236138237138238138239138240138241138242138243138244138245138246138247138248138249138250138251138252138253138254138255138256138257138258138259138260138261138262138263138264138265138266138267138268138269138270138271138272138273138274138275138276138277138278138279138280138281138282138283138284138285138286138287138288138289138290138291138292138293138294138295138296138297138298138299138300138301138302138303138304138305138306138307138308138309138310138311138312138313138314138315138316138317138318138319138320138321138322138323138324138325138326138327138328138329138330138331138332138333138334138335138336138337138338138339138340138341138342138343138344138345138346138347138348138349138350138351138352138353138354138355138356138357138358138359138360138361138362138363138364138365138366138367138368138369138370138371138372138373138374138375138376138377138378138379138380138381138382138383138384138385138386138387138388138389138390138391138392138393138394138395138396138397138398138399138400138401138402138403138404138405138406138407138408138409138410138411138412138413138414138415138416138417138418138419138420138421138422138423138424138425138426138427138428138429138430138431138432138433138434138435138436138437138438138439138440138441138442138443138444138445138446138447138448138449138450138451138452138453138454138455138456138457138458138459138460138461138462138463138464138465138466138467138468138469138470138471138472138473138474138475138476138477138478138479138480138481138482138483138484138485138486138487138488138489138490138491138492138493138494138495138496138497138498138499138500138501138502138503138504138505138506138507138508138509138510138511138512138513138514138515138516138517138518138519138520138521138522138523138524138525138526138527138528138529138530138531138532138533138534138535138536138537138538138539138540138541138542138543138544138545138546138547138548138549138550138551138552138553138554138555138556138557138558138559138560138561138562138563138564138565138566138567138568138569138570138571138572138573138574138575138576138577138578138579138580138581138582138583138584138585138586138587138588138589138590138591138592138593138594138595138596138597138598138599138600138601138602138603138604138605138606138607138608138609138610138611138612138613138614138615138616138617138618138619138620138621138622138623138624138625138626138627138628138629138630138631138632138633138634138635138636138637138638138639138640138641138642138643138644138645138646138647138648138649138650138651138652138653138654138655138656138657138658138659138660138661138662138663138664138665138666138667138668138669138670138671138672138673138674138675138676138677138678138679138680138681138682138683138684138685138686138687138688138689138690138691138692138693138694138695138696138697138698138699138700138701138702138703138704138705138706138707138708138709138710138711138712138713138714138715138716138717138718138719138720138721138722138723138724138725138726138727138728138729138730138731138732138733138734138735138736138737138738138739138740138741138742138743138744138745138746138747138748138749138750138751138752138753138754138755138756138757138758138759138760138761138762138763138764138765138766138767138768138769138770138771138772138773138774138775138776138777138778138779138780138781138782138783138784138785138786138787138788138789138790138791138792138793138794138795138796138797138798138799138800138801138802138803138804138805138806138807138808138809138810138811138812138813138814138815138816138817138818138819138820138821138822138823138824138825138826138827138828138829138830138831138832138833138834138835138836138837138838138839138840138841138842138843138844138845138846138847138848138849138850138851138852138853138854138855138856138857138858138859138860138861138862138863138864138865138866138867138868138869138870138871138872138873138874138875138876138877138878138879138880138881138882138883138884138885138886138887138888138889138890138891138892138893138894138895138896138897138898138899138900138901138902138903138904138905138906138907138908138909138910138911138912138913138914138915138916138917138918138919138920138921138922138923138924138925138926138927138928138929138930138931138932138933138934138935138936138937138938138939138940138941138942138943138944138945138946138947138948138949138950138951138952138953138954138955138956138957138958138959138960138961138962138963138964138965138966138967138968138969138970138971138972138973138974138975138976138977138978138979138980138981138982138983138984138985138986138987138988138989138990138991138992138993138994138995138996138997138998138999139000139001139002139003139004139005139006139007139008139009139010139011139012139013139014139015139016139017139018139019139020139021139022139023139024139025139026139027139028139029139030139031139032139033139034139035139036139037139038139039139040139041139042139043139044139045139046139047139048139049139050139051139052139053139054139055139056139057139058139059139060139061139062139063139064139065139066139067139068139069139070139071139072139073139074139075139076139077139078139079139080139081139082139083139084139085139086139087139088139089139090139091139092139093139094139095139096139097139098139099139100139101139102139103139104139105139106139107139108139109139110139111139112139113139114139115139116139117139118139119139120139121139122139123139124139125139126139127139128139129139130139131139132139133139134139135139136139137139138139139139140139141139142139143139144139145139146139147139148139149139150139151139152139153139154139155139156139157139158139159139160139161139162139163139164139165139166139167139168139169139170139171139172139173139174139175139176139177139178139179139180139181139182139183139184139185139186139187139188139189139190139191139192139193139194139195139196139197139198139199139200139201139202139203139204139205139206139207139208139209139210139211139212139213139214139215139216139217139218139219139220139221139222139223139224139225139226139227139228139229139230139231139232139233139234139235139236139237139238139239139240139241139242139243139244139245139246139247139248139249139250139251139252139253139254139255139256139257139258139259139260139261139262139263139264139265139266139267139268139269139270139271139272139273139274139275139276139277139278139279139280139281139282139283139284139285139286139287139288139289139290139291139292139293139294139295139296139297139298139299139300139301139302139303139304139305139306139307139308139309139310139311139312139313139314139315139316139317139318139319139320139321139322139323139324139325139326139327139328139329139330139331139332139333139334139335139336139337139338139339139340139341139342139343139344139345139346139347139348139349139350139351139352139353139354139355139356139357139358139359139360139361139362139363139364139365139366139367139368139369139370139371139372139373139374139375139376139377139378139379139380139381139382139383139384139385139386139387139388139389139390139391139392139393139394139395139396139397139398139399139400139401139402139403139404139405139406139407139408139409139410139411139412139413139414139415139416139417139418139419139420139421139422139423139424139425139426139427139428139429139430139431139432139433139434139435139436139437139438139439139440139441139442139443139444139445139446139447139448139449139450139451139452139453139454139455139456139457139458139459139460139461139462139463139464139465139466139467139468139469139470139471139472139473139474139475139476139477139478139479139480139481139482139483139484139485139486139487139488139489139490139491139492139493139494139495139496139497139498139499139500139501139502139503139504139505139506139507139508139509139510139511139512139513139514139515139516139517139518139519139520139521139522139523139524139525139526139527139528139529139530139531139532139533139534139535139536139537139538139539139540139541139542139543139544139545139546139547139548139549139550139551139552139553139554139555139556139557139558139559139560139561139562139563139564139565139566139567139568139569139570139571139572139573139574139575139576139577139578139579139580139581139582139583139584139585139586139587139588139589139590139591139592139593139594139595139596139597139598139599139600139601139602139603139604139605139606139607139608139609139610139611139612139613139614139615139616139617139618139619139620139621139622139623139624139625139626139627139628139629139630139631139632139633139634139635139636139637139638139639139640139641139642139643139644139645139646139647139648139649139650139651139652139653139654139655139656139657139658139659139660139661139662139663139664139665139666139667139668139669139670139671139672139673139674139675139676139677139678139679139680139681139682139683139684139685139686139687139688139689139690139691139692139693139694139695139696139697139698139699139700139701139702139703139704139705139706139707139708139709139710139711139712139713139714139715139716139717139718139719139720139721139722139723139724139725139726139727139728139729139730139731139732139733139734139735139736139737139738139739139740139741139742139743139744139745139746139747139748139749139750139751139752139753139754139755139756139757139758139759139760139761139762139763139764139765139766139767139768139769139770139771139772139773139774139775139776139777139778139779139780139781139782139783139784139785139786139787139788139789139790139791139792139793139794139795139796139797139798139799139800139801139802139803139804139805139806139807139808139809139810139811139812139813139814139815139816139817139818139819139820139821139822139823139824139825139826139827139828139829139830139831139832139833139834139835139836139837139838139839139840139841139842139843139844139845139846139847139848139849139850139851139852139853139854139855139856139857139858139859139860139861139862139863139864139865139866139867139868139869139870139871139872139873139874139875139876139877139878139879139880139881139882139883139884139885139886139887139888139889139890139891139892139893139894139895139896139897139898139899139900139901139902139903139904139905139906139907139908139909139910139911139912139913139914139915139916139917139918139919139920139921139922139923139924139925139926139927139928139929139930139931139932139933139934139935139936139937139938139939139940139941139942139943139944139945139946139947139948139949139950139951139952139953139954139955139956139957139958139959139960139961139962139963139964139965139966139967139968139969139970139971139972139973139974139975139976139977139978139979139980139981139982139983139984139985139986139987139988139989139990139991139992139993139994139995139996139997139998139999140000140001140002140003140004140005140006140007140008140009140010140011140012140013140014140015140016140017140018140019140020140021140022140023140024140025140026140027140028140029140030140031140032140033140034140035140036140037140038140039140040140041140042140043140044140045140046140047140048140049140050140051140052140053140054140055140056140057140058140059140060140061140062140063140064140065140066140067140068140069140070140071140072140073140074140075140076140077140078140079140080140081140082140083140084140085140086140087140088140089140090140091140092140093140094140095140096140097140098140099140100140101140102140103140104140105140106140107140108140109140110140111140112140113140114140115140116140117140118140119140120140121140122140123140124140125140126140127140128140129140130140131140132140133140134140135140136140137140138140139140140140141140142140143140144140145140146140147140148140149140150140151140152140153140154140155140156140157140158140159140160140161140162140163140164140165140166140167140168140169140170140171140172140173140174140175140176140177140178140179140180140181140182140183140184140185140186140187140188140189140190140191140192140193140194140195140196140197140198140199140200140201140202140203140204140205140206140207140208140209140210140211140212140213140214140215140216140217140218140219140220140221140222140223140224140225140226140227140228140229140230140231140232140233140234140235140236140237140238140239140240140241140242140243140244140245140246140247140248140249140250140251140252140253140254140255140256140257140258140259140260140261140262140263140264140265140266140267140268140269140270140271140272140273140274140275140276140277140278140279140280140281140282140283140284140285140286140287140288140289140290140291140292140293140294140295140296140297140298140299140300140301140302140303140304140305140306140307140308140309140310140311140312140313140314140315140316140317140318140319140320140321140322140323140324140325140326140327140328140329140330140331140332140333140334140335140336140337140338140339140340140341140342140343140344140345140346140347140348140349140350140351140352140353140354140355140356140357140358140359140360140361140362140363140364140365140366140367140368140369140370140371140372140373140374140375140376140377140378140379140380140381140382140383140384140385140386140387140388140389140390140391140392140393140394140395140396140397140398140399140400140401140402140403140404140405140406140407140408140409140410140411140412140413140414140415140416140417140418140419140420140421140422140423140424140425140426140427140428140429140430140431140432140433140434140435140436140437140438140439140440140441140442140443140444140445140446140447140448140449140450140451140452140453140454140455140456140457140458140459140460140461140462140463140464140465140466140467140468140469140470140471140472140473140474140475140476140477140478140479140480140481140482140483140484140485140486140487140488140489140490140491140492140493140494140495140496140497140498140499140500140501140502140503140504140505140506140507140508140509140510140511140512140513140514140515140516140517140518140519140520140521140522140523140524140525140526140527140528140529140530140531140532140533140534140535140536140537140538140539140540140541140542140543140544140545140546140547140548140549140550140551140552140553140554140555140556140557140558140559140560140561140562140563140564140565140566140567140568140569140570140571140572140573140574140575140576140577140578140579140580140581140582140583140584140585140586140587140588140589140590140591140592140593140594140595140596140597140598140599140600140601140602140603140604140605140606140607140608140609140610140611140612140613140614140615140616140617140618140619140620140621140622140623140624140625140626140627140628140629140630140631140632140633140634140635140636140637140638140639140640140641140642140643140644140645140646140647140648140649140650140651140652140653140654140655140656140657140658140659140660140661140662140663140664140665140666140667140668140669140670140671140672140673140674140675140676140677140678140679140680140681140682140683140684140685140686140687140688140689140690140691140692140693140694140695140696140697140698140699140700140701140702140703140704140705140706140707140708140709140710140711140712140713140714140715140716140717140718140719140720140721140722140723140724140725140726140727140728140729140730140731140732140733140734140735140736140737140738140739140740140741140742140743140744140745140746140747140748140749140750140751140752140753140754140755140756140757140758140759140760140761140762140763140764140765140766140767140768140769140770140771140772140773140774140775140776140777140778140779140780140781140782140783140784140785140786140787140788140789140790140791140792140793140794140795140796140797140798140799140800140801140802140803140804140805140806140807140808140809140810140811140812140813140814140815140816140817140818140819140820140821140822140823140824140825140826140827140828140829140830140831140832140833140834140835140836140837140838140839140840140841140842140843140844140845140846140847140848140849140850140851140852140853140854140855140856140857140858140859140860140861140862140863140864140865140866140867140868140869140870140871140872140873140874140875140876140877140878140879140880140881140882140883140884140885140886140887140888140889140890140891140892140893140894140895140896140897140898140899140900140901140902140903140904140905140906140907140908140909140910140911140912140913140914140915140916140917140918140919140920140921140922140923140924140925140926140927140928140929140930140931140932140933140934140935140936140937140938140939140940140941140942140943140944140945140946140947140948140949140950140951140952140953140954140955140956140957140958140959140960140961140962140963140964140965140966140967140968140969140970140971140972140973140974140975140976140977140978140979140980140981140982140983140984140985140986140987140988140989140990140991140992140993140994140995140996140997140998140999141000141001141002141003141004141005141006141007141008141009141010141011141012141013141014141015141016141017141018141019141020141021141022141023141024141025141026141027141028141029141030141031141032141033141034141035141036141037141038141039141040141041141042141043141044141045141046141047141048141049141050141051141052141053141054141055141056141057141058141059141060141061141062141063141064141065141066141067141068141069141070141071141072141073141074141075141076141077141078141079141080141081141082141083141084141085141086141087141088141089141090141091141092141093141094141095141096141097141098141099141100141101141102141103141104141105141106141107141108141109141110141111141112141113141114141115141116141117141118141119141120141121141122141123141124141125141126141127141128141129141130141131141132141133141134141135141136141137141138141139141140141141141142141143141144141145141146141147141148141149141150141151141152141153141154141155141156141157141158141159141160141161141162141163141164141165141166141167141168141169141170141171141172141173141174141175141176141177141178141179141180141181141182141183141184141185141186141187141188141189141190141191141192141193141194141195141196141197141198141199141200141201141202141203141204141205141206141207141208141209141210141211141212141213141214141215141216141217141218141219141220141221141222141223141224141225141226141227141228141229141230141231141232141233141234141235141236141237141238141239141240141241141242141243141244141245141246141247141248141249141250141251141252141253141254141255141256141257141258141259141260141261141262141263141264141265141266141267141268141269141270141271141272141273141274141275141276141277141278141279141280141281141282141283141284141285141286141287141288141289141290141291141292141293141294141295141296141297141298141299141300141301141302141303141304141305141306141307141308141309141310141311141312141313141314141315141316141317141318141319141320141321141322141323141324141325141326141327141328141329141330141331141332141333141334141335141336141337141338141339141340141341141342141343141344141345141346141347141348141349141350141351141352141353141354141355141356141357141358141359141360141361141362141363141364141365141366141367141368141369141370141371141372141373141374141375141376141377141378141379141380141381141382141383141384141385141386141387141388141389141390141391141392141393141394141395141396141397141398141399141400141401141402141403141404141405141406141407141408141409141410141411141412141413141414141415141416141417141418141419141420141421141422141423141424141425141426141427141428141429141430141431141432141433141434141435141436141437141438141439141440141441141442141443141444141445141446141447141448141449141450141451141452141453141454141455141456141457141458141459141460141461141462141463141464141465141466141467141468141469141470141471141472141473141474141475141476141477141478141479141480141481141482141483141484141485141486141487141488141489141490141491141492141493141494141495141496141497141498141499141500141501141502141503141504141505141506141507141508141509141510141511141512141513141514141515141516141517141518141519141520141521141522141523141524141525141526141527141528141529141530141531141532141533141534141535141536141537141538141539141540141541141542141543141544141545141546141547141548141549141550141551141552141553141554141555141556141557141558141559141560141561141562141563141564141565141566141567141568141569141570141571141572141573141574141575141576141577141578141579141580141581141582141583141584141585141586141587141588141589141590141591141592141593141594141595141596141597141598141599141600141601141602141603141604141605141606141607141608141609141610141611141612141613141614141615141616141617141618141619141620141621141622141623141624141625141626141627141628141629141630141631141632141633141634141635141636141637141638141639141640141641141642141643141644141645141646141647141648141649141650141651141652141653141654141655141656141657141658141659141660141661141662141663141664141665141666141667141668141669141670141671141672141673141674141675141676141677141678141679141680141681141682141683141684141685141686141687141688141689141690141691141692141693141694141695141696141697141698141699141700141701141702141703141704141705141706141707141708141709141710141711141712141713141714141715141716141717141718141719141720141721141722141723141724141725141726141727141728141729141730141731141732141733141734141735141736141737141738141739141740141741141742141743141744141745141746141747141748141749141750141751141752141753141754141755141756141757141758141759141760141761141762141763141764141765141766141767141768141769141770141771141772141773141774141775141776141777141778141779141780141781141782141783141784141785141786141787141788141789141790141791141792141793141794141795141796141797141798141799141800141801141802141803141804141805141806141807141808141809141810141811141812141813141814141815141816141817141818141819141820141821141822141823141824141825141826141827141828141829141830141831141832141833141834141835141836141837141838141839141840141841141842141843141844141845141846141847141848141849141850141851141852141853141854141855141856141857141858141859141860141861141862141863141864141865141866141867141868141869141870141871141872141873141874141875141876141877141878141879141880141881141882141883141884141885141886141887141888141889141890141891141892141893141894141895141896141897141898141899141900141901141902141903141904141905141906141907141908141909141910141911141912141913141914141915141916141917141918141919141920141921141922141923141924141925141926141927141928141929141930141931141932141933141934141935141936141937141938141939141940141941141942141943141944141945141946141947141948141949141950141951141952141953141954141955141956141957141958141959141960141961141962141963141964141965141966141967141968141969141970141971141972141973141974141975141976141977141978141979141980141981141982141983141984141985141986141987141988141989141990141991141992141993141994141995141996141997141998141999142000142001142002142003142004142005142006142007142008142009142010142011142012142013142014142015142016142017142018142019142020142021142022142023142024142025142026142027142028142029142030142031142032142033142034142035142036142037142038142039142040142041142042142043142044142045142046142047142048142049142050142051142052142053142054142055142056142057142058142059142060142061142062142063142064142065142066142067142068142069142070142071142072142073142074142075142076142077142078142079142080142081142082142083142084142085142086142087142088142089142090142091142092142093142094142095142096142097142098142099142100142101142102142103142104142105142106142107142108142109142110142111142112142113142114142115142116142117142118142119142120142121142122142123142124142125142126142127142128142129142130142131142132142133142134142135142136142137142138142139142140142141142142142143142144142145142146142147142148142149142150142151142152142153142154142155142156142157142158142159142160142161142162142163142164142165142166142167142168142169142170142171142172142173142174142175142176142177142178142179142180142181142182142183142184142185142186142187142188142189142190142191142192142193142194142195142196142197142198142199142200142201142202142203142204142205142206142207142208142209142210142211142212142213142214142215142216142217142218142219142220142221142222142223142224142225142226142227142228142229142230142231142232142233142234142235142236142237142238142239142240142241142242142243142244142245142246142247142248142249142250142251142252142253142254142255142256142257142258142259142260142261142262142263142264142265142266142267142268142269142270142271142272142273142274142275142276142277142278142279142280142281142282142283142284142285142286142287142288142289142290142291142292142293142294142295142296142297142298142299142300142301142302142303142304142305142306142307142308142309142310142311142312142313142314142315142316142317142318142319142320142321142322142323142324142325142326142327142328142329142330142331142332142333142334142335142336142337142338142339142340142341142342142343142344142345142346142347142348142349142350142351142352142353142354142355142356142357142358142359142360142361142362142363142364142365142366142367142368142369142370142371142372142373142374142375142376142377142378142379142380142381142382142383142384142385142386142387142388142389142390142391142392142393142394142395142396142397142398142399142400142401142402142403142404142405142406142407142408142409142410142411142412142413142414142415142416142417142418142419142420142421142422142423142424142425142426142427142428142429142430142431142432142433142434142435142436142437142438142439142440142441142442142443142444142445142446142447142448142449142450142451142452142453142454142455142456142457142458142459142460142461142462142463142464142465142466142467142468142469142470142471142472142473142474142475142476142477142478142479142480142481142482142483142484142485142486142487142488142489142490142491142492142493142494142495142496142497142498142499142500142501142502142503142504142505142506142507142508142509142510142511142512142513142514142515142516142517142518142519142520142521142522142523142524142525142526142527142528142529142530142531142532142533142534142535142536142537142538142539142540142541142542142543142544142545142546142547142548142549142550142551142552142553142554142555142556142557142558142559142560142561142562142563142564142565142566142567142568142569142570142571142572142573142574142575142576142577142578142579142580142581142582142583142584142585142586142587142588142589142590142591142592142593142594142595142596142597142598142599142600142601142602142603142604142605142606142607142608142609142610142611142612142613142614142615142616142617142618142619142620142621142622142623142624142625142626142627142628142629142630142631142632142633142634142635142636142637142638142639142640142641142642142643142644142645142646142647142648142649142650142651142652142653142654142655142656142657142658142659142660142661142662142663142664142665142666142667142668142669142670142671142672142673142674142675142676142677142678142679142680142681142682142683142684142685142686142687142688142689142690142691142692142693142694142695142696142697142698142699142700142701142702142703142704142705142706142707142708142709142710142711142712142713142714142715142716142717142718142719142720142721142722142723142724142725142726142727142728142729142730142731142732142733142734142735142736142737142738142739142740142741142742142743142744142745142746142747142748142749142750142751142752142753142754142755142756142757142758142759142760142761142762142763142764142765142766142767142768142769142770142771142772142773142774142775142776142777142778142779142780142781142782142783142784142785142786142787142788142789142790142791142792142793142794142795142796142797142798142799142800142801142802142803142804142805142806142807142808142809142810142811142812142813142814142815142816142817142818142819142820142821142822142823142824142825142826142827142828142829142830142831142832142833142834142835142836142837142838142839142840142841142842142843142844142845142846142847142848142849142850142851142852142853142854142855142856142857142858142859142860142861142862142863142864142865142866142867142868142869142870142871142872142873142874142875142876142877142878142879142880142881142882142883142884142885142886142887142888142889142890142891142892142893142894142895142896142897142898142899142900142901142902142903142904142905142906142907142908142909142910142911142912142913142914142915142916142917142918142919142920142921142922142923142924142925142926142927142928142929142930142931142932142933142934142935142936142937142938142939142940142941142942142943142944142945142946142947142948142949142950142951142952142953142954142955142956142957142958142959142960142961142962142963142964142965142966142967142968142969142970142971142972142973142974142975142976142977142978142979142980142981142982142983142984142985142986142987142988142989142990142991142992142993142994142995142996142997142998142999143000143001143002143003143004143005143006143007143008143009143010143011143012143013143014143015143016143017143018143019143020143021143022143023143024143025143026143027143028143029143030143031143032143033143034143035143036143037143038143039143040143041143042143043143044143045143046143047143048143049143050143051143052143053143054143055143056143057143058143059143060143061143062143063143064143065143066143067143068143069143070143071143072143073143074143075143076143077143078143079143080143081143082143083143084143085143086143087143088143089143090143091143092143093143094143095143096143097143098143099143100143101143102143103143104143105143106143107143108143109143110143111143112143113143114143115143116143117143118143119143120143121143122143123143124143125143126143127143128143129143130143131143132143133143134143135143136143137143138143139143140143141143142143143143144143145143146143147143148143149143150143151143152143153143154143155143156143157143158143159143160143161143162143163143164143165143166143167143168143169143170143171143172143173143174143175143176143177143178143179143180143181143182143183143184143185143186143187143188143189143190143191143192143193143194143195143196143197143198143199143200143201143202143203143204143205143206143207143208143209143210143211143212143213143214143215143216143217143218143219143220143221143222143223143224143225143226143227143228143229143230143231143232143233143234143235143236143237143238143239143240143241143242143243143244143245143246143247143248143249143250143251143252143253143254143255143256143257143258143259143260143261143262143263143264143265143266143267143268143269143270143271143272143273143274143275143276143277143278143279143280143281143282143283143284143285143286143287143288143289143290143291143292143293143294143295143296143297143298143299143300143301143302143303143304143305143306143307143308143309143310143311143312143313143314143315143316143317143318143319143320143321143322143323143324143325143326143327143328143329143330143331143332143333143334143335143336143337143338143339143340143341143342143343143344143345143346143347143348143349143350143351143352143353143354143355143356143357143358143359143360143361143362143363143364143365143366143367143368143369143370143371143372143373143374143375143376143377143378143379143380143381143382143383143384143385143386143387143388143389143390143391143392143393143394143395143396143397143398143399143400143401143402143403143404143405143406143407143408143409143410143411143412143413143414143415143416143417143418143419143420143421143422143423143424143425143426143427143428143429143430143431143432143433143434143435143436143437143438143439143440143441143442143443143444143445143446143447143448143449143450143451143452143453143454143455143456143457143458143459143460143461143462143463143464143465143466143467143468143469143470143471143472143473143474143475143476143477143478143479143480143481143482143483143484143485143486143487143488143489143490143491143492143493143494143495143496143497143498143499143500143501143502143503143504143505143506143507143508143509143510143511143512143513143514143515143516143517143518143519143520143521143522143523143524143525143526143527143528143529143530143531143532143533143534143535143536143537143538143539143540143541143542143543143544143545143546143547143548143549143550143551143552143553143554143555143556143557143558143559143560143561143562143563143564143565143566143567143568143569143570143571143572143573143574143575143576143577143578143579143580143581143582143583143584143585143586143587143588143589143590143591143592143593143594143595143596143597143598143599143600143601143602143603143604143605143606143607143608143609143610143611143612143613143614143615143616143617143618143619143620143621143622143623143624143625143626143627143628143629143630143631143632143633143634143635143636143637143638143639143640143641143642143643143644143645143646143647143648143649143650143651143652143653143654143655143656143657143658143659143660143661143662143663143664143665143666143667143668143669143670143671143672143673143674143675143676143677143678143679143680143681143682143683143684143685143686143687143688143689143690143691143692143693143694143695143696143697143698143699143700143701143702143703143704143705143706143707143708143709143710143711143712143713143714143715143716143717143718143719143720143721143722143723143724143725143726143727143728143729143730143731143732143733143734143735143736143737143738143739143740143741143742143743143744143745143746143747143748143749143750143751143752143753143754143755143756143757143758143759143760143761143762143763143764143765143766143767143768143769143770143771143772143773143774143775143776143777143778143779143780143781143782143783143784143785143786143787143788143789143790143791143792143793143794143795143796143797143798143799143800143801143802143803143804143805143806143807143808143809143810143811143812143813143814143815143816143817143818143819143820143821143822143823143824143825143826143827143828143829143830143831143832143833143834143835143836143837143838143839143840143841143842143843143844143845143846143847143848143849143850143851143852143853143854143855143856143857143858143859143860143861143862143863143864143865143866143867143868143869143870143871143872143873143874143875143876143877143878143879143880143881143882143883143884143885143886143887143888143889143890143891143892143893143894143895143896143897143898143899143900143901143902143903143904143905143906143907143908143909143910143911143912143913143914143915143916143917143918143919143920143921143922143923143924143925143926143927143928143929143930143931143932143933143934143935143936143937143938143939143940143941143942143943143944143945143946143947143948143949143950143951143952143953143954143955143956143957143958143959143960143961143962143963143964143965143966143967143968143969143970143971143972143973143974143975143976143977143978143979143980143981143982143983143984143985143986143987143988143989143990143991143992143993143994143995143996143997143998143999144000144001144002144003144004144005144006144007144008144009144010144011144012144013144014144015144016144017144018144019144020144021144022144023144024144025144026144027144028144029144030144031144032144033144034144035144036144037144038144039144040144041144042144043144044144045144046144047144048144049144050144051144052144053144054144055144056144057144058144059144060144061144062144063144064144065144066144067144068144069144070144071144072144073144074144075144076144077144078144079144080144081144082144083144084144085144086144087144088144089144090144091144092144093144094144095144096144097144098144099144100144101144102144103144104144105144106144107144108144109144110144111144112144113144114144115144116144117144118144119144120144121144122144123144124144125144126144127144128144129144130144131144132144133144134144135144136144137144138144139144140144141144142144143144144144145144146144147144148144149144150144151144152144153144154144155144156144157144158144159144160144161144162144163144164144165144166144167144168144169144170144171144172144173144174144175144176144177144178144179144180144181144182144183144184144185144186144187144188144189144190144191144192144193144194144195144196144197144198144199144200144201144202144203144204144205144206144207144208144209144210144211144212144213144214144215144216144217144218144219144220144221144222144223144224144225144226144227144228144229144230144231144232144233144234144235144236144237144238144239144240144241144242144243144244144245144246144247144248144249144250144251144252144253144254144255144256144257144258144259144260144261144262144263144264144265144266144267144268144269144270144271144272144273144274144275144276144277144278144279144280144281144282144283144284144285144286144287144288144289144290144291144292144293144294144295144296144297144298144299144300144301144302144303144304144305144306144307144308144309144310144311144312144313144314144315144316144317144318144319144320144321144322144323144324144325144326144327144328144329144330144331144332144333144334144335144336144337144338144339144340144341144342144343144344144345144346144347144348144349144350144351144352144353144354144355144356144357144358144359144360144361144362144363144364144365144366144367144368144369144370144371144372144373144374144375144376144377144378144379144380144381144382144383144384144385144386144387144388144389144390144391144392144393144394144395144396144397144398144399144400144401144402144403144404144405144406144407144408144409144410144411144412144413144414144415144416144417144418144419144420144421144422144423144424144425144426144427144428144429144430144431144432144433144434144435144436144437144438144439144440144441144442144443144444144445144446144447144448144449144450144451144452144453144454144455144456144457144458144459144460144461144462144463144464144465144466144467144468144469144470144471144472144473144474144475144476144477144478144479144480144481144482144483144484144485144486144487144488144489144490144491144492144493144494144495144496144497144498144499144500144501144502144503144504144505144506144507144508144509144510144511144512144513144514144515144516144517144518144519144520144521144522144523144524144525144526144527144528144529144530144531144532144533144534144535144536144537144538144539144540144541144542144543144544144545144546144547144548144549144550144551144552144553144554144555144556144557144558144559144560144561144562144563144564144565144566144567144568144569144570144571144572144573144574144575144576144577144578144579144580144581144582144583144584144585144586144587144588144589144590144591144592144593144594144595144596144597144598144599144600144601144602144603144604144605144606144607144608144609144610144611144612144613144614144615144616144617144618144619144620144621144622144623144624144625144626144627144628144629144630144631144632144633144634144635144636144637144638144639144640144641144642144643144644144645144646144647144648144649144650144651144652144653144654144655144656144657144658144659144660144661144662144663144664144665144666144667144668144669144670144671144672144673144674144675144676144677144678144679144680144681144682144683144684144685144686144687144688144689144690144691144692144693144694144695144696144697144698144699144700144701144702144703144704144705144706144707144708144709144710144711144712144713144714144715144716144717144718144719144720144721144722144723144724144725144726144727144728144729144730144731144732144733144734144735144736144737144738144739144740144741144742144743144744144745144746144747144748144749144750144751144752144753144754144755144756144757144758144759144760144761144762144763144764144765144766144767144768144769144770144771144772144773144774144775144776144777144778144779144780144781144782144783144784144785144786144787144788144789144790144791144792144793144794144795144796144797144798144799144800144801144802144803144804144805144806144807144808144809144810144811144812144813144814144815144816144817144818144819144820144821144822144823144824144825144826144827144828144829144830144831144832144833144834144835144836144837144838144839144840144841144842144843144844144845144846144847144848144849144850144851144852144853144854144855144856144857144858144859144860144861144862144863144864144865144866144867144868144869144870144871144872144873144874144875144876144877144878144879144880144881144882144883144884144885144886144887144888144889144890144891144892144893144894144895144896144897144898144899144900144901144902144903144904144905144906144907144908144909144910144911144912144913144914144915144916144917144918144919144920144921144922144923144924144925144926144927144928144929144930144931144932144933144934144935144936144937144938144939144940144941144942144943144944144945144946144947144948144949144950144951144952144953144954144955144956144957144958144959144960144961144962144963144964144965144966144967144968144969144970144971144972144973144974144975144976144977144978144979144980144981144982144983144984144985144986144987144988144989144990144991144992144993144994144995144996144997144998144999145000145001145002145003145004145005145006145007145008145009145010145011145012145013145014145015145016145017145018145019145020145021145022145023145024145025145026145027145028145029145030145031145032145033145034145035145036145037145038145039145040145041145042145043145044145045145046145047145048145049145050145051145052145053145054145055145056145057145058145059145060145061145062145063145064145065145066145067145068145069145070145071145072145073145074145075145076145077145078145079145080145081145082145083145084145085145086145087145088145089145090145091145092145093145094145095145096145097145098145099145100145101145102145103145104145105145106145107145108145109145110145111145112145113145114145115145116145117145118145119145120145121145122145123145124145125145126145127145128145129145130145131145132145133145134145135145136145137145138145139145140145141145142145143145144145145145146145147145148145149145150145151145152145153145154145155145156145157145158145159145160145161145162145163145164145165145166145167145168145169145170145171145172145173145174145175145176145177145178145179145180145181145182145183145184145185145186145187145188145189145190145191145192145193145194145195145196145197145198145199145200145201145202145203145204145205145206145207145208145209145210145211145212145213145214145215145216145217145218145219145220145221145222145223145224145225145226145227145228145229145230145231145232145233145234145235145236145237145238145239145240145241145242145243145244145245145246145247145248145249145250145251145252145253145254145255145256145257145258145259145260145261145262145263145264145265145266145267145268145269145270145271145272145273145274145275145276145277145278145279145280145281145282145283145284145285145286145287145288145289145290145291145292145293145294145295145296145297145298145299145300145301145302145303145304145305145306145307145308145309145310145311145312145313145314145315145316145317145318145319145320145321145322145323145324145325145326145327145328145329145330145331145332145333145334145335145336145337145338145339145340145341145342145343145344145345145346145347145348145349145350145351145352145353145354145355145356145357145358145359145360145361145362145363145364145365145366145367145368145369145370145371145372145373145374145375145376145377145378145379145380145381145382145383145384145385145386145387145388145389145390145391145392145393145394145395145396145397145398145399145400145401145402145403145404145405145406145407145408145409145410145411145412145413145414145415145416145417145418145419145420145421145422145423145424145425145426145427145428145429145430145431145432145433145434145435145436145437145438145439145440145441145442145443145444145445145446145447145448145449145450145451145452145453145454145455145456145457145458145459145460145461145462145463145464145465145466145467145468145469145470145471145472145473145474145475145476145477145478145479145480145481145482145483145484145485145486145487145488145489145490145491145492145493145494145495145496145497145498145499145500145501145502145503145504145505145506145507145508145509145510145511145512145513145514145515145516145517145518145519145520145521145522145523145524145525145526145527145528145529145530145531145532145533145534145535145536145537145538145539145540145541145542145543145544145545145546145547145548145549145550145551145552145553145554145555145556145557145558145559145560145561145562145563145564145565145566145567145568145569145570145571145572145573145574145575145576145577145578145579145580145581145582145583145584145585145586145587145588145589145590145591145592145593145594145595145596145597145598145599145600145601145602145603145604145605145606145607145608145609145610145611145612145613145614145615145616145617145618145619145620145621145622145623145624145625145626145627145628145629145630145631145632145633145634145635145636145637145638145639145640145641145642145643145644145645145646145647145648145649145650145651145652145653145654145655145656145657145658145659145660145661145662145663145664145665145666145667145668145669145670145671145672145673145674145675145676145677145678145679145680145681145682145683145684145685145686145687145688145689145690145691145692145693145694145695145696145697145698145699145700145701145702145703145704145705145706145707145708145709145710145711145712145713145714145715145716145717145718145719145720145721145722145723145724145725145726145727145728145729145730145731145732145733145734145735145736145737145738145739145740145741145742145743145744145745145746145747145748145749145750145751145752145753145754145755145756145757145758145759145760145761145762145763145764145765145766145767145768145769145770145771145772145773145774145775145776145777145778145779145780145781145782145783145784145785145786145787145788145789145790145791145792145793145794145795145796145797145798145799145800145801145802145803145804145805145806145807145808145809145810145811145812145813145814145815145816145817145818145819145820145821145822145823145824145825145826145827145828145829145830145831145832145833145834145835145836145837145838145839145840145841145842145843145844145845145846145847145848145849145850145851145852145853145854145855145856145857145858145859145860145861145862145863145864145865145866145867145868145869145870145871145872145873145874145875145876145877145878145879145880145881145882145883145884145885145886145887145888145889145890145891145892145893145894145895145896145897145898145899145900145901145902145903145904145905145906145907145908145909145910145911145912145913145914145915145916145917145918145919145920145921145922145923145924145925145926145927145928145929145930145931145932145933145934145935145936145937145938145939145940145941145942145943145944145945145946145947145948145949145950145951145952145953145954145955145956145957145958145959145960145961145962145963145964145965145966145967145968145969145970145971145972145973145974145975145976145977145978145979145980145981145982145983145984145985145986145987145988145989145990145991145992145993145994145995145996145997145998145999146000146001146002146003146004146005146006146007146008146009146010146011146012146013146014146015146016146017146018146019146020146021146022146023146024146025146026146027146028146029146030146031146032146033146034146035146036146037146038146039146040146041146042146043146044146045146046146047146048146049146050146051146052146053146054146055146056146057146058146059146060146061146062146063146064146065146066146067146068146069146070146071146072146073146074146075146076146077146078146079146080146081146082146083146084146085146086146087146088146089146090146091146092146093146094146095146096146097146098146099146100146101146102146103146104146105146106146107146108146109146110146111146112146113146114146115146116146117146118146119146120146121146122146123146124146125146126146127146128146129146130146131146132146133146134146135146136146137146138146139146140146141146142146143146144146145146146146147146148146149146150146151146152146153146154146155146156146157146158146159146160146161146162146163146164146165146166146167146168146169146170146171146172146173146174146175146176146177146178146179146180146181146182146183146184146185146186146187146188146189146190146191146192146193146194146195146196146197146198146199146200146201146202146203146204146205146206146207146208146209146210146211146212146213146214146215146216146217146218146219146220146221146222146223146224146225146226146227146228146229146230146231146232146233146234146235146236146237146238146239146240146241146242146243146244146245146246146247146248146249146250146251146252146253146254146255146256146257146258146259146260146261146262146263146264146265146266146267146268146269146270146271146272146273146274146275146276146277146278146279146280146281146282146283146284146285146286146287146288146289146290146291146292146293146294146295146296146297146298146299146300146301146302146303146304146305146306146307146308146309146310146311146312146313146314146315146316146317146318146319146320146321146322146323146324146325146326146327146328146329146330146331146332146333146334146335146336146337146338146339146340146341146342146343146344146345146346146347146348146349146350146351146352146353146354146355146356146357146358146359146360146361146362146363146364146365146366146367146368146369146370146371146372146373146374146375146376146377146378146379146380146381146382146383146384146385146386146387146388146389146390146391146392146393146394146395146396146397146398146399146400146401146402146403146404146405146406146407146408146409146410146411146412146413146414146415146416146417146418146419146420146421146422146423146424146425146426146427146428146429146430146431146432146433146434146435146436146437146438146439146440146441146442146443146444146445146446146447146448146449146450146451146452146453146454146455146456146457146458146459146460146461146462146463146464146465146466146467146468146469146470146471146472146473146474146475146476146477146478146479146480146481146482146483146484146485146486146487146488146489146490146491146492146493146494146495146496146497146498146499146500146501146502146503146504146505146506146507146508146509146510146511146512146513146514146515146516146517146518146519146520146521146522146523146524146525146526146527146528146529146530146531146532146533146534146535146536146537146538146539146540146541146542146543146544146545146546146547146548146549146550146551146552146553146554146555146556146557146558146559146560146561146562146563146564146565146566146567146568146569146570146571146572146573146574146575146576146577146578146579146580146581146582146583146584146585146586146587146588146589146590146591146592146593146594146595146596146597146598146599146600146601146602146603146604146605146606146607146608146609146610146611146612146613146614146615146616146617146618146619146620146621146622146623146624146625146626146627146628146629146630146631146632146633146634146635146636146637146638146639146640146641146642146643146644146645146646146647146648146649146650146651146652146653146654146655146656146657146658146659146660146661146662146663146664146665146666146667146668146669146670146671146672146673146674146675146676146677146678146679146680146681146682146683146684146685146686146687146688146689146690146691146692146693146694146695146696146697146698146699146700146701146702146703146704146705146706146707146708146709146710146711146712146713146714146715146716146717146718146719146720146721146722146723146724146725146726146727146728146729146730146731146732146733146734146735146736146737146738146739146740146741146742146743146744146745146746146747146748146749146750146751146752146753146754146755146756146757146758146759146760146761146762146763146764146765146766146767146768146769146770146771146772146773146774146775146776146777146778146779146780146781146782146783146784146785146786146787146788146789146790146791146792146793146794146795146796146797146798146799146800146801146802146803146804146805146806146807146808146809146810146811146812146813146814146815146816146817146818146819146820146821146822146823146824146825146826146827146828146829146830146831146832146833146834146835146836146837146838146839146840146841146842146843146844146845146846146847146848146849146850146851146852146853146854146855146856146857146858146859146860146861146862146863146864146865146866146867146868146869146870146871146872146873146874146875146876146877146878146879146880146881146882146883146884146885146886146887146888146889146890146891146892146893146894146895146896146897146898146899146900146901146902146903146904146905146906146907146908146909146910146911146912146913146914146915146916146917146918146919146920146921146922146923146924146925146926146927146928146929146930146931146932146933146934146935146936146937146938146939146940146941146942146943146944146945146946146947146948146949146950146951146952146953146954146955146956146957146958146959146960146961146962146963146964146965146966146967146968146969146970146971146972146973146974146975146976146977146978146979146980146981146982146983146984146985146986146987146988146989146990146991146992146993146994146995146996146997146998146999147000147001147002147003147004147005147006147007147008147009147010147011147012147013147014147015147016147017147018147019147020147021147022147023147024147025147026147027147028147029147030147031147032147033147034147035147036147037147038147039147040147041147042147043147044147045147046147047147048147049147050147051147052147053147054147055147056147057147058147059147060147061147062147063147064147065147066147067147068147069147070147071147072147073147074147075147076147077147078147079147080147081147082147083147084147085147086147087147088147089147090147091147092147093147094147095147096147097147098147099147100147101147102147103147104147105147106147107147108147109147110147111147112147113147114147115147116147117147118147119147120147121147122147123147124147125147126147127147128147129147130147131147132147133147134147135147136147137147138147139147140147141147142147143147144147145147146147147147148147149147150147151147152147153147154147155147156147157147158147159147160147161147162147163147164147165147166147167147168147169147170147171147172147173147174147175147176147177147178147179147180147181147182147183147184147185147186147187147188147189147190147191147192147193147194147195147196147197147198147199147200147201147202147203147204147205147206147207147208147209147210147211147212147213147214147215147216147217147218147219147220147221147222147223147224147225147226147227147228147229147230147231147232147233147234147235147236147237147238147239147240147241147242147243147244147245147246147247147248147249147250147251147252147253147254147255147256147257147258147259147260147261147262147263147264147265147266147267147268147269147270147271147272147273147274147275147276147277147278147279147280147281147282147283147284147285147286147287147288147289147290147291147292147293147294147295147296147297147298147299147300147301147302147303147304147305147306147307147308147309147310147311147312147313147314147315147316147317147318147319147320147321147322147323147324147325147326147327147328147329147330147331147332147333147334147335147336147337147338147339147340147341147342147343147344147345147346147347147348147349147350147351147352147353147354147355147356147357147358147359147360147361147362147363147364147365147366147367147368147369147370147371147372147373147374147375147376147377147378147379147380147381147382147383147384147385147386147387147388147389147390147391147392147393147394147395147396147397147398147399147400147401147402147403147404147405147406147407147408147409147410147411147412147413147414147415147416147417147418147419147420147421147422147423147424147425147426147427147428147429147430147431147432147433147434147435147436147437147438147439147440147441147442147443147444147445147446147447147448147449147450147451147452147453147454147455147456147457147458147459147460147461147462147463147464147465147466147467147468147469147470147471147472147473147474147475147476147477147478147479147480147481147482147483147484147485147486147487147488147489147490147491147492147493147494147495147496147497147498147499147500147501147502147503147504147505147506147507147508147509147510147511147512147513147514147515147516147517147518147519147520147521147522147523147524147525147526147527147528147529147530147531147532147533147534147535147536147537147538147539147540147541147542147543147544147545147546147547147548147549147550147551147552147553147554147555147556147557147558147559147560147561147562147563147564147565147566147567147568147569147570147571147572147573147574147575147576147577147578147579147580147581147582147583147584147585147586147587147588147589147590147591147592147593147594147595147596147597147598147599147600147601147602147603147604147605147606147607147608147609147610147611147612147613147614147615147616147617147618147619147620147621147622147623147624147625147626147627147628147629147630147631147632147633147634147635147636147637147638147639147640147641147642147643147644147645147646147647147648147649147650147651147652147653147654147655147656147657147658147659147660147661147662147663147664147665147666147667147668147669147670147671147672147673147674147675147676147677147678147679147680147681147682147683147684147685147686147687147688147689147690147691147692147693147694147695147696147697147698147699147700147701147702147703147704147705147706147707147708147709147710147711147712147713147714147715147716147717147718147719147720147721147722147723147724147725147726147727147728147729147730147731147732147733147734147735147736147737147738147739147740147741147742147743147744147745147746147747147748147749147750147751147752147753147754147755147756147757147758147759147760147761147762147763147764147765147766147767147768147769147770147771147772147773147774147775147776147777147778147779147780147781147782147783147784147785147786147787147788147789147790147791147792147793147794147795147796147797147798147799147800147801147802147803147804147805147806147807147808147809147810147811147812147813147814147815147816147817147818147819147820147821147822147823147824147825147826147827147828147829147830147831147832147833147834147835147836147837147838147839147840147841147842147843147844147845147846147847147848147849147850147851147852147853147854147855147856147857147858147859147860147861147862147863147864147865147866147867147868147869147870147871147872147873147874147875147876147877147878147879147880147881147882147883147884147885147886147887147888147889147890147891147892147893147894147895147896147897147898147899147900147901147902147903147904147905147906147907147908147909147910147911147912147913147914147915147916147917147918147919147920147921147922147923147924147925147926147927147928147929147930147931147932147933147934147935147936147937147938147939147940147941147942147943147944147945147946147947147948147949147950147951147952147953147954147955147956147957147958147959147960147961147962147963147964147965147966147967147968147969147970147971147972147973147974147975147976147977147978147979147980147981147982147983147984147985147986147987147988147989147990147991147992147993147994147995147996147997147998147999148000148001148002148003148004148005148006148007148008148009148010148011148012148013148014148015148016148017148018148019148020148021148022148023148024148025148026148027148028148029148030148031148032148033148034148035148036148037148038148039148040148041148042148043148044148045148046148047148048148049148050148051148052148053148054148055148056148057148058148059148060148061148062148063148064148065148066148067148068148069148070148071148072148073148074148075148076148077148078148079148080148081148082148083148084148085148086148087148088148089148090148091148092148093148094148095148096148097148098148099148100148101148102148103148104148105148106148107148108148109148110148111148112148113148114148115148116148117148118148119148120148121148122148123148124148125148126148127148128148129148130148131148132148133148134148135148136148137148138148139148140148141148142148143148144148145148146148147148148148149148150148151148152148153148154148155148156148157148158148159148160148161148162148163148164148165148166148167148168148169148170148171148172148173148174148175148176148177148178148179148180148181148182148183148184148185148186148187148188148189148190148191148192148193148194148195148196148197148198148199148200148201148202148203148204148205148206148207148208148209148210148211148212148213148214148215148216148217148218148219148220148221148222148223148224148225148226148227148228148229148230148231148232148233148234148235148236148237148238148239148240148241148242148243148244148245148246148247148248148249148250148251148252148253148254148255148256148257148258148259148260148261148262148263148264148265148266148267148268148269148270148271148272148273148274148275148276148277148278148279148280148281148282148283148284148285148286148287148288148289148290148291148292148293148294148295148296148297148298148299148300148301148302148303148304148305148306148307148308148309148310148311148312148313148314148315148316148317148318148319148320148321148322148323148324148325148326148327148328148329148330148331148332148333148334148335148336148337148338148339148340148341148342148343148344148345148346148347148348148349148350148351148352148353148354148355148356148357148358148359148360148361148362148363148364148365148366148367148368148369148370148371148372148373148374148375148376148377148378148379148380148381148382148383148384148385148386148387148388148389148390148391148392148393148394148395148396148397148398148399148400148401148402148403148404148405148406148407148408148409148410148411148412148413148414148415148416148417148418148419148420148421148422148423148424148425148426148427148428148429148430148431148432148433148434148435148436148437148438148439148440148441148442148443148444148445148446148447148448148449148450148451148452148453148454148455148456148457148458148459148460148461148462148463148464148465148466148467148468148469148470148471148472148473148474148475148476148477148478148479148480148481148482148483148484148485148486148487148488148489148490148491148492148493148494148495148496148497148498148499148500148501148502148503148504148505148506148507148508148509148510148511148512148513148514148515148516148517148518148519148520148521148522148523148524148525148526148527148528148529148530148531148532148533148534148535148536148537148538148539148540148541148542148543148544148545148546148547148548148549148550148551148552148553148554148555148556148557148558148559148560148561148562148563148564148565148566148567148568148569148570148571148572148573148574148575148576148577148578148579148580148581148582148583148584148585148586148587148588148589148590148591148592148593148594148595148596148597148598148599148600148601148602148603148604148605148606148607148608148609148610148611148612148613148614148615148616148617148618148619148620148621148622148623148624148625148626148627148628148629148630148631148632148633148634148635148636148637148638148639148640148641148642148643148644148645148646148647148648148649148650148651148652148653148654148655148656148657148658148659148660148661148662148663148664148665148666148667148668148669148670148671148672148673148674148675148676148677148678148679148680148681148682148683148684148685148686148687148688148689148690148691148692148693148694148695148696148697148698148699148700148701148702148703148704148705148706148707148708148709148710148711148712148713148714148715148716148717148718148719148720148721148722148723148724148725148726148727148728148729148730148731148732148733148734148735148736148737148738148739148740148741148742148743148744148745148746148747148748148749148750148751148752148753148754148755148756148757148758148759148760148761148762148763148764148765148766148767148768148769148770148771148772148773148774148775148776148777148778148779148780148781148782148783148784148785148786148787148788148789148790148791148792148793148794148795148796148797148798148799148800148801148802148803148804148805148806148807148808148809148810148811148812148813148814148815148816148817148818148819148820148821148822148823148824148825148826148827148828148829148830148831148832148833148834148835148836148837148838148839148840148841148842148843148844148845148846148847148848148849148850148851148852148853148854148855148856148857148858148859148860148861148862148863148864148865148866148867148868148869148870148871148872148873148874148875148876148877148878148879148880148881148882148883148884148885148886148887148888148889148890148891148892148893148894148895148896148897148898148899148900148901148902148903148904148905148906148907148908148909148910148911148912148913148914148915148916148917148918148919148920148921148922148923148924148925148926148927148928148929148930148931148932148933148934148935148936148937148938148939148940148941148942148943148944148945148946148947148948148949148950148951148952148953148954148955148956148957148958148959148960148961148962148963148964148965148966148967148968148969148970148971148972148973148974148975148976148977148978148979148980148981148982148983148984148985148986148987148988148989148990148991148992148993148994148995148996148997148998148999149000149001149002149003149004149005149006149007149008149009149010149011149012149013149014149015149016149017149018149019149020149021149022149023149024149025149026149027149028149029149030149031149032149033149034149035149036149037149038149039149040149041149042149043149044149045149046149047149048149049149050149051149052149053149054149055149056149057149058149059149060149061149062149063149064149065149066149067149068149069149070149071149072149073149074149075149076149077149078149079149080149081149082149083149084149085149086149087149088149089149090149091149092149093149094149095149096149097149098149099149100149101149102149103149104149105149106149107149108149109149110149111149112149113149114149115149116149117149118149119149120149121149122149123149124149125149126149127149128149129149130149131149132149133149134149135149136149137149138149139149140149141149142149143149144149145149146149147149148149149149150149151149152149153149154149155149156149157149158149159149160149161149162149163149164149165149166149167149168149169149170149171149172149173149174149175149176149177149178149179149180149181149182149183149184149185149186149187149188149189149190149191149192149193149194149195149196149197149198149199149200149201149202149203149204149205149206149207149208149209149210149211149212149213149214149215149216149217149218149219149220149221149222149223149224149225149226149227149228149229149230149231149232149233149234149235149236149237149238149239149240149241149242149243149244149245149246149247149248149249149250149251149252149253149254149255149256149257149258149259149260149261149262149263149264149265149266149267149268149269149270149271149272149273149274149275149276149277149278149279149280149281149282149283149284149285149286149287149288149289149290149291149292149293149294149295149296149297149298149299149300149301149302149303149304149305149306149307149308149309149310149311149312149313149314149315149316149317149318149319149320149321149322149323149324149325149326149327149328149329149330149331149332149333149334149335149336149337149338149339149340149341149342149343149344149345149346149347149348149349149350149351149352149353149354149355149356149357149358149359149360149361149362149363149364149365149366149367149368149369149370149371149372149373149374149375149376149377149378149379149380149381149382149383149384149385149386149387149388149389149390149391149392149393149394149395149396149397149398149399149400149401149402149403149404149405149406149407149408149409149410149411149412149413149414149415149416149417149418149419149420149421149422149423149424149425149426149427149428149429149430149431149432149433149434149435149436149437149438149439149440149441149442149443149444149445149446149447149448149449149450149451149452149453149454149455149456149457149458149459149460149461149462149463149464149465149466149467149468149469149470149471149472149473149474149475149476149477149478149479149480149481149482149483149484149485149486149487149488149489149490149491149492149493149494149495149496149497149498149499149500149501149502149503149504149505149506149507149508149509149510149511149512149513149514149515149516149517149518149519149520149521149522149523149524149525149526149527149528149529149530149531149532149533149534149535149536149537149538149539149540149541149542149543149544149545149546149547149548149549149550149551149552149553149554149555149556149557149558149559149560149561149562149563149564149565149566149567149568149569149570149571149572149573149574149575149576149577149578149579149580149581149582149583149584149585149586149587149588149589149590149591149592149593149594149595149596149597149598149599149600149601149602149603149604149605149606149607149608149609149610149611149612149613149614149615149616149617149618149619149620149621149622149623149624149625149626149627149628149629149630149631149632149633149634149635149636149637149638149639149640149641149642149643149644149645149646149647149648149649149650149651149652149653149654149655149656149657149658149659149660149661149662149663149664149665149666149667149668149669149670149671149672149673149674149675149676149677149678149679149680149681149682149683149684149685149686149687149688149689149690149691149692149693149694149695149696149697149698149699149700149701149702149703149704149705149706149707149708149709149710149711149712149713149714149715149716149717149718149719149720149721149722149723149724149725149726149727149728149729149730149731149732149733149734149735149736149737149738149739149740149741149742149743149744149745149746149747149748149749149750149751149752149753149754149755149756149757149758149759149760149761149762149763149764149765149766149767149768149769149770149771149772149773149774149775149776149777149778149779149780149781149782149783149784149785149786149787149788149789149790149791149792149793149794149795149796149797149798149799149800149801149802149803149804149805149806149807149808149809149810149811149812149813149814149815149816149817149818149819149820149821149822149823149824149825149826149827149828149829149830149831149832149833149834149835149836149837149838149839149840149841149842149843149844149845149846149847149848149849149850149851149852149853149854149855149856149857149858149859149860149861149862149863149864149865149866149867149868149869149870149871149872149873149874149875149876149877149878149879149880149881149882149883149884149885149886149887149888149889149890149891149892149893149894149895149896149897149898149899149900149901149902149903149904149905149906149907149908149909149910149911149912149913149914149915149916149917149918149919149920149921149922149923149924149925149926149927149928149929149930149931149932149933149934149935149936149937149938149939149940149941149942149943149944149945149946149947149948149949149950149951149952149953149954149955149956149957149958149959149960149961149962149963149964149965149966149967149968149969149970149971149972149973149974149975149976149977149978149979149980149981149982149983149984149985149986149987149988149989149990149991149992149993149994149995149996149997149998149999150000150001150002150003150004150005150006150007150008150009150010150011150012150013150014150015150016150017150018150019150020150021150022150023150024150025150026150027150028150029150030150031150032150033150034150035150036150037150038150039150040150041150042150043150044150045150046150047150048150049150050150051150052150053150054150055150056150057150058150059150060150061150062150063150064150065150066150067150068150069150070150071150072150073150074150075150076150077150078150079150080150081150082150083150084150085150086150087150088150089150090150091150092150093150094150095150096150097150098150099150100150101150102150103150104150105150106150107150108150109150110150111150112150113150114150115150116150117150118150119150120150121150122150123150124150125150126150127150128150129150130150131150132150133150134150135150136150137150138150139150140150141150142150143150144150145150146150147150148150149150150150151150152150153150154150155150156150157150158150159150160150161150162150163150164150165150166150167150168150169150170150171150172150173150174150175150176150177150178150179150180150181150182150183150184150185150186150187150188150189150190150191150192150193150194150195150196150197150198150199150200150201150202150203150204150205150206150207150208150209150210150211150212150213150214150215150216150217150218150219150220150221150222150223150224150225150226150227150228150229150230150231150232150233150234150235150236150237150238150239150240150241150242150243150244150245150246150247150248150249150250150251150252150253150254150255150256150257150258150259150260150261150262150263150264150265150266150267150268150269150270150271150272150273150274150275150276150277150278150279150280150281150282150283150284150285150286150287150288150289150290150291150292150293150294150295150296150297150298150299150300150301150302150303150304150305150306150307150308150309150310150311150312150313150314150315150316150317150318150319150320150321150322150323150324150325150326150327150328150329150330150331150332150333150334150335150336150337150338150339150340150341150342150343150344150345150346150347150348150349150350150351150352150353150354150355150356150357150358150359150360150361150362150363150364150365150366150367150368150369150370150371150372150373150374150375150376150377150378150379150380150381150382150383150384150385150386150387150388150389150390150391150392150393150394150395150396150397150398150399150400150401150402150403150404150405150406150407150408150409150410150411150412150413150414150415150416150417150418150419150420150421150422150423150424150425150426150427150428150429150430150431150432150433150434150435150436150437150438150439150440150441150442150443150444150445150446150447150448150449150450150451150452150453150454150455150456150457150458150459150460150461150462150463150464150465150466150467150468150469150470150471150472150473150474150475150476150477150478150479150480150481150482150483150484150485150486150487150488150489150490150491150492150493150494150495150496150497150498150499150500150501150502150503150504150505150506150507150508150509150510150511150512150513150514150515150516150517150518150519150520150521150522150523150524150525150526150527150528150529150530150531150532150533150534150535150536150537150538150539150540150541150542150543150544150545150546150547150548150549150550150551150552150553150554150555150556150557150558150559150560150561150562150563150564150565150566150567150568150569150570150571150572150573150574150575150576150577150578150579150580150581150582150583150584150585150586150587150588150589150590150591150592150593150594150595150596150597150598150599150600150601150602150603150604150605150606150607150608150609150610150611150612150613150614150615150616150617150618150619150620150621150622150623150624150625150626150627150628150629150630150631150632150633150634150635150636150637150638150639150640150641150642150643150644150645150646150647150648150649150650150651150652150653150654150655150656150657150658150659150660150661150662150663150664150665150666150667150668150669150670150671150672150673150674150675150676150677150678150679150680150681150682150683150684150685150686150687150688150689150690150691150692150693150694150695150696150697150698150699150700150701150702150703150704150705150706150707150708150709150710150711150712150713150714150715150716150717150718150719150720150721150722150723150724150725150726150727150728150729150730150731150732150733150734150735150736150737150738150739150740150741150742150743150744150745150746150747150748150749150750150751150752150753150754150755150756150757150758150759150760150761150762150763150764150765150766150767150768150769150770150771150772150773150774150775150776150777150778150779150780150781150782150783150784150785150786150787150788150789150790150791150792150793150794150795150796150797150798150799150800150801150802150803150804150805150806150807150808150809150810150811150812150813150814150815150816150817150818150819150820150821150822150823150824150825150826150827150828150829150830150831150832150833150834150835150836150837150838150839150840150841150842150843150844150845150846150847150848150849150850150851150852150853150854150855150856150857150858150859150860150861150862150863150864150865150866150867150868150869150870150871150872150873150874150875150876150877150878150879150880150881150882150883150884150885150886150887150888150889150890150891150892150893150894150895150896150897150898150899150900150901150902150903150904150905150906150907150908150909150910150911150912150913150914150915150916150917150918150919150920150921150922150923150924150925150926150927150928150929150930150931150932150933150934150935150936150937150938150939150940150941150942150943150944150945150946150947150948150949150950150951150952150953150954150955150956150957150958150959150960150961150962150963150964150965150966150967150968150969150970150971150972150973150974150975150976150977150978150979150980150981150982150983150984150985150986150987150988150989150990150991150992150993150994150995150996150997150998150999151000151001151002151003151004151005151006151007151008151009151010151011151012151013151014151015151016151017151018151019151020151021151022151023151024151025151026151027151028151029151030151031151032151033151034151035151036151037151038151039151040151041151042151043151044151045151046151047151048151049151050151051151052151053151054151055151056151057151058151059151060151061151062151063151064151065151066151067151068151069151070151071151072151073151074151075151076151077151078151079151080151081151082151083151084151085151086151087151088151089151090151091151092151093151094151095151096151097151098151099151100151101151102151103151104151105151106151107151108151109151110151111151112151113151114151115151116151117151118151119151120151121151122151123151124151125151126151127151128151129151130151131151132151133151134151135151136151137151138151139151140151141151142151143151144151145151146151147151148151149151150151151151152151153151154151155151156151157151158151159151160151161151162151163151164151165151166151167151168151169151170151171151172151173151174151175151176151177151178151179151180151181151182151183151184151185151186151187151188151189151190151191151192151193151194151195151196151197151198151199151200151201151202151203151204151205151206151207151208151209151210151211151212151213151214151215151216151217151218151219151220151221151222151223151224151225151226151227151228151229151230151231151232151233151234151235151236151237151238151239151240151241151242151243151244151245151246151247151248151249151250151251151252151253151254151255151256151257151258151259151260151261151262151263151264151265151266151267151268151269151270151271151272151273151274151275151276151277151278151279151280151281151282151283151284151285151286151287151288151289151290151291151292151293151294151295151296151297151298151299151300151301151302151303151304151305151306151307151308151309151310151311151312151313151314151315151316151317151318151319151320151321151322151323151324151325151326151327151328151329151330151331151332151333151334151335151336151337151338151339151340151341151342151343151344151345151346151347151348151349151350151351151352151353151354151355151356151357151358151359151360151361151362151363151364151365151366151367151368151369151370151371151372151373151374151375151376151377151378151379151380151381151382151383151384151385151386151387151388151389151390151391151392151393151394151395151396151397151398151399151400151401151402151403151404151405151406151407151408151409151410151411151412151413151414151415151416151417151418151419151420151421151422151423151424151425151426151427151428151429151430151431151432151433151434151435151436151437151438151439151440151441151442151443151444151445151446151447151448151449151450151451151452151453151454151455151456151457151458151459151460151461151462151463151464151465151466151467151468151469151470151471151472151473151474151475151476151477151478151479151480151481151482151483151484151485151486151487151488151489151490151491151492151493151494151495151496151497151498151499151500151501151502151503151504151505151506151507151508151509151510151511151512151513151514151515151516151517151518151519151520151521151522151523151524151525151526151527151528151529151530151531151532151533151534151535151536151537151538151539151540151541151542151543151544151545151546151547151548151549151550151551151552151553151554151555151556151557151558151559151560151561151562151563151564151565151566151567151568151569151570151571151572151573151574151575151576151577151578151579151580151581151582151583151584151585151586151587151588151589151590151591151592151593151594151595151596151597151598151599151600151601151602151603151604151605151606151607151608151609151610151611151612151613151614151615151616151617151618151619151620151621151622151623151624151625151626151627151628151629151630151631151632151633151634151635151636151637151638151639151640151641151642151643151644151645151646151647151648151649151650151651151652151653151654151655151656151657151658151659151660151661151662151663151664151665151666151667151668151669151670151671151672151673151674151675151676151677151678151679151680151681151682151683151684151685151686151687151688151689151690151691151692151693151694151695151696151697151698151699151700151701151702151703151704151705151706151707151708151709151710151711151712151713151714151715151716151717151718151719151720151721151722151723151724151725151726151727151728151729151730151731151732151733151734151735151736151737151738151739151740151741151742151743151744151745151746151747151748151749151750151751151752151753151754151755151756151757151758151759151760151761151762151763151764151765151766151767151768151769151770151771151772151773151774151775151776151777151778151779151780151781151782151783151784151785151786151787151788151789151790151791151792151793151794151795151796151797151798151799151800151801151802151803151804151805151806151807151808151809151810151811151812151813151814151815151816151817151818151819151820151821151822151823151824151825151826151827151828151829151830151831151832151833151834151835151836151837151838151839151840151841151842151843151844151845151846151847151848151849151850151851151852151853151854151855151856151857151858151859151860151861151862151863151864151865151866151867151868151869151870151871151872151873151874151875151876151877151878151879151880151881151882151883151884151885151886151887151888151889151890151891151892151893151894151895151896151897151898151899151900151901151902151903151904151905151906151907151908151909151910151911151912151913151914151915151916151917151918151919151920151921151922151923151924151925151926151927151928151929151930151931151932151933151934151935151936151937151938151939151940151941151942151943151944151945151946151947151948151949151950151951151952151953151954151955151956151957151958151959151960151961151962151963151964151965151966151967151968151969151970151971151972151973151974151975151976151977151978151979151980151981151982151983151984151985151986151987151988151989151990151991151992151993151994151995151996151997151998151999152000152001152002152003152004152005152006152007152008152009152010152011152012152013152014152015152016152017152018152019152020152021152022152023152024152025152026152027152028152029152030152031152032152033152034152035152036152037152038152039152040152041152042152043152044152045152046152047152048152049152050152051152052152053152054152055152056152057152058152059152060152061152062152063152064152065152066152067152068152069152070152071152072152073152074152075152076152077152078152079152080152081152082152083152084152085152086152087152088152089152090152091152092152093152094152095152096152097152098152099152100152101152102152103152104152105152106152107152108152109152110152111152112152113152114152115152116152117152118152119152120152121152122152123152124152125152126152127152128152129152130152131152132152133152134152135152136152137152138152139152140152141152142152143152144152145152146152147152148152149152150152151152152152153152154152155152156152157152158152159152160152161152162152163152164152165152166152167152168152169152170152171152172152173152174152175152176152177152178152179152180152181152182152183152184152185152186152187152188152189152190152191152192152193152194152195152196152197152198152199152200152201152202152203152204152205152206152207152208152209152210152211152212152213152214152215152216152217152218152219152220152221152222152223152224152225152226152227152228152229152230152231152232152233152234152235152236152237152238152239152240152241152242152243152244152245152246152247152248152249152250152251152252152253152254152255152256152257152258152259152260152261152262152263152264152265152266152267152268152269152270152271152272152273152274152275152276152277152278152279152280152281152282152283152284152285152286152287152288152289152290152291152292152293152294152295152296152297152298152299152300152301152302152303152304152305152306152307152308152309152310152311152312152313152314152315152316152317152318152319152320152321152322152323152324152325152326152327152328152329152330152331152332152333152334152335152336152337152338152339152340152341152342152343152344152345152346152347152348152349152350152351152352152353152354152355152356152357152358152359152360152361152362152363152364152365152366152367152368152369152370152371152372152373152374152375152376152377152378152379152380152381152382152383152384152385152386152387152388152389152390152391152392152393152394152395152396152397152398152399152400152401152402152403152404152405152406152407152408152409152410152411152412152413152414152415152416152417152418152419152420152421152422152423152424152425152426152427152428152429152430152431152432152433152434152435152436152437152438152439152440152441152442152443152444152445152446152447152448152449152450152451152452152453152454152455152456152457152458152459152460152461152462152463152464152465152466152467152468152469152470152471152472152473152474152475152476152477152478152479152480152481152482152483152484152485152486152487152488152489152490152491152492152493152494152495152496152497152498152499152500152501152502152503152504152505152506152507152508152509152510152511152512152513152514152515152516152517152518152519152520152521152522152523152524152525152526152527152528152529152530152531152532152533152534152535152536152537152538152539152540152541152542152543152544152545152546152547152548152549152550152551152552152553152554152555152556152557152558152559152560152561152562152563152564152565152566152567152568152569152570152571152572152573152574152575152576152577152578152579152580152581152582152583152584152585152586152587152588152589152590152591152592152593152594152595152596152597152598152599152600152601152602152603152604152605152606152607152608152609152610152611152612152613152614152615152616152617152618152619152620152621152622152623152624152625152626152627152628152629152630152631152632152633152634152635152636152637152638152639152640152641152642152643152644152645152646152647152648152649152650152651152652152653152654152655152656152657152658152659152660152661152662152663152664152665152666152667152668152669152670152671152672152673152674152675152676152677152678152679152680152681152682152683152684152685152686152687152688152689152690152691152692152693152694152695152696152697152698152699152700152701152702152703152704152705152706152707152708152709152710152711152712152713152714152715152716152717152718152719152720152721152722152723152724152725152726152727152728152729152730152731152732152733152734152735152736152737152738152739152740152741152742152743152744152745152746152747152748152749152750152751152752152753152754152755152756152757152758152759152760152761152762152763152764152765152766152767152768152769152770152771152772152773152774152775152776152777152778152779152780152781152782152783152784152785152786152787152788152789152790152791152792152793152794152795152796152797152798152799152800152801152802152803152804152805152806152807152808152809152810152811152812152813152814152815152816152817152818152819152820152821152822152823152824152825152826152827152828152829152830152831152832152833152834152835152836152837152838152839152840152841152842152843152844152845152846152847152848152849152850152851152852152853152854152855152856152857152858152859152860152861152862152863152864152865152866152867152868152869152870152871152872152873152874152875152876152877152878152879152880152881152882152883152884152885152886152887152888152889152890152891152892152893152894152895152896152897152898152899152900152901152902152903152904152905152906152907152908152909152910152911152912152913152914152915152916152917152918152919152920152921152922152923152924152925152926152927152928152929152930152931152932152933152934152935152936152937152938152939152940152941152942152943152944152945152946152947152948152949152950152951152952152953152954152955152956152957152958152959152960152961152962152963152964152965152966152967152968152969152970152971152972152973152974152975152976152977152978152979152980152981152982152983152984152985152986152987152988152989152990152991152992152993152994152995152996152997152998152999153000153001153002153003153004153005153006153007153008153009153010153011153012153013153014153015153016153017153018153019153020153021153022153023153024153025153026153027153028153029153030153031153032153033153034153035153036153037153038153039153040153041153042153043153044153045153046153047153048153049153050153051153052153053153054153055153056153057153058153059153060153061153062153063153064153065153066153067153068153069153070153071153072153073153074153075153076153077153078153079153080153081153082153083153084153085153086153087153088153089153090153091153092153093153094153095153096153097153098153099153100153101153102153103153104153105153106153107153108153109153110153111153112153113153114153115153116153117153118153119153120153121153122153123153124153125153126153127153128153129153130153131153132153133153134153135153136153137153138153139153140153141153142153143153144153145153146153147153148153149153150153151153152153153153154153155153156153157153158153159153160153161153162153163153164153165153166153167153168153169153170153171153172153173153174153175153176153177153178153179153180153181153182153183153184153185153186153187153188153189153190153191153192153193153194153195153196153197153198153199153200153201153202153203153204153205153206153207153208153209153210153211153212153213153214153215153216153217153218153219153220153221153222153223153224153225153226153227153228153229153230153231153232153233153234153235153236153237153238153239153240153241153242153243153244153245153246153247153248153249153250153251153252153253153254153255153256153257153258153259153260153261153262153263153264153265153266153267153268153269153270153271153272153273153274153275153276153277153278153279153280153281153282153283153284153285153286153287153288153289153290153291153292153293153294153295153296153297153298153299153300153301153302153303153304153305153306153307153308153309153310153311153312153313153314153315153316153317153318153319153320153321153322153323153324153325153326153327153328153329153330153331153332153333153334153335153336153337153338153339153340153341153342153343153344153345153346153347153348153349153350153351153352153353153354153355153356153357153358153359153360153361153362153363153364153365153366153367153368153369153370153371153372153373153374153375153376153377153378153379153380153381153382153383153384153385153386153387153388153389153390153391153392153393153394153395153396153397153398153399153400153401153402153403153404153405153406153407153408153409153410153411153412153413153414153415153416153417153418153419153420153421153422153423153424153425153426153427153428153429153430153431153432153433153434153435153436153437153438153439153440153441153442153443153444153445153446153447153448153449153450153451153452153453153454153455153456153457153458153459153460153461153462153463153464153465153466153467153468153469153470153471153472153473153474153475153476153477153478153479153480153481153482153483153484153485153486153487153488153489153490153491153492153493153494153495153496153497153498153499153500153501153502153503153504153505153506153507153508153509153510153511153512153513153514153515153516153517153518153519153520153521153522153523153524153525153526153527153528153529153530153531153532153533153534153535153536153537153538153539153540153541153542153543153544153545153546153547153548153549153550153551153552153553153554153555153556153557153558153559153560153561153562153563153564153565153566153567153568153569153570153571153572153573153574153575153576153577153578153579153580153581153582153583153584153585153586153587153588153589153590153591153592153593153594153595153596153597153598153599153600153601153602153603153604153605153606153607153608153609153610153611153612153613153614153615153616153617153618153619153620153621153622153623153624153625153626153627153628153629153630153631153632153633153634153635153636153637153638153639153640153641153642153643153644153645153646153647153648153649153650153651153652153653153654153655153656153657153658153659153660153661153662153663153664153665153666153667153668153669153670153671153672153673153674153675153676153677153678153679153680153681153682153683153684153685153686153687153688153689153690153691153692153693153694153695153696153697153698153699153700153701153702153703153704153705153706153707153708153709153710153711153712153713153714153715153716153717153718153719153720153721153722153723153724153725153726153727153728153729153730153731153732153733153734153735153736153737153738153739153740153741153742153743153744153745153746153747153748153749153750153751153752153753153754153755153756153757153758153759153760153761153762153763153764153765153766153767153768153769153770153771153772153773153774153775153776153777153778153779153780153781153782153783153784153785153786153787153788153789153790153791153792153793153794153795153796153797153798153799153800153801153802153803153804153805153806153807153808153809153810153811153812153813153814153815153816153817153818153819153820153821153822153823153824153825153826153827153828153829153830153831153832153833153834153835153836153837153838153839153840153841153842153843153844153845153846153847153848153849153850153851153852153853153854153855153856153857153858153859153860153861153862153863153864153865153866153867153868153869153870153871153872153873153874153875153876153877153878153879153880153881153882153883153884153885153886153887153888153889153890153891153892153893153894153895153896153897153898153899153900153901153902153903153904153905153906153907153908153909153910153911153912153913153914153915153916153917153918153919153920153921153922153923153924153925153926153927153928153929153930153931153932153933153934153935153936153937153938153939153940153941153942153943153944153945153946153947153948153949153950153951153952153953153954153955153956153957153958153959153960153961153962153963153964153965153966153967153968153969153970153971153972153973153974153975153976153977153978153979153980153981153982153983153984153985153986153987153988153989153990153991153992153993153994153995153996153997153998153999154000154001154002154003154004154005154006154007154008154009154010154011154012154013154014154015154016154017154018154019154020154021154022154023154024154025154026154027154028154029154030154031154032154033154034154035154036154037154038154039154040154041154042154043154044154045154046154047154048154049154050154051154052154053154054154055154056154057154058154059154060154061154062154063154064154065154066154067154068154069154070154071154072154073154074154075154076154077154078154079154080154081154082154083154084154085154086154087154088154089154090154091154092154093154094154095154096154097154098154099154100154101154102154103154104154105154106154107154108154109154110154111154112154113154114154115154116154117154118154119154120154121154122154123154124154125154126154127154128154129154130154131154132154133154134154135154136154137154138154139154140154141154142154143154144154145154146154147154148154149154150154151154152154153154154154155154156154157154158154159154160154161154162154163154164154165154166154167154168154169154170154171154172154173154174154175154176154177154178154179154180154181154182154183154184154185154186154187154188154189154190154191154192154193154194154195154196154197154198154199154200154201154202154203154204154205154206154207154208154209154210154211154212154213154214154215154216154217154218154219154220154221154222154223154224154225154226154227154228154229154230154231154232154233154234154235154236154237154238154239154240154241154242154243154244154245154246154247154248154249154250154251154252154253154254154255154256154257154258154259154260154261154262154263154264154265154266154267154268154269154270154271154272154273154274154275154276154277154278154279154280154281154282154283154284154285154286154287154288154289154290154291154292154293154294154295154296154297154298154299154300154301154302154303154304154305154306154307154308154309154310154311154312154313154314154315154316154317154318154319154320154321154322154323154324154325154326154327154328154329154330154331154332154333154334154335154336154337154338154339154340154341154342154343154344154345154346154347154348154349154350154351154352154353154354154355154356154357154358154359154360154361154362154363154364154365154366154367154368154369154370154371154372154373154374154375154376154377154378154379154380154381154382154383154384154385154386154387154388154389154390154391154392154393154394154395154396154397154398154399154400154401154402154403154404154405154406154407154408154409154410154411154412154413154414154415154416154417154418154419154420154421154422154423154424154425154426154427154428154429154430154431154432154433154434154435154436154437154438154439154440154441154442154443154444154445154446154447154448154449154450154451154452154453154454154455154456154457154458154459154460154461154462154463154464154465154466154467154468154469154470154471154472154473154474154475154476154477154478154479154480154481154482154483154484154485154486154487154488154489154490154491154492154493154494154495154496154497154498154499154500154501154502154503154504154505154506154507154508154509154510154511154512154513154514154515154516154517154518154519154520154521154522154523154524154525154526154527154528154529154530154531154532154533154534154535154536154537154538154539154540154541154542154543154544154545154546154547154548154549154550154551154552154553154554154555154556154557154558154559154560154561154562154563154564154565154566154567154568154569154570154571154572154573154574154575154576154577154578154579154580154581154582154583154584154585154586154587154588154589154590154591154592154593154594154595154596154597154598154599154600154601154602154603154604154605154606154607154608154609154610154611154612154613154614154615154616154617154618154619154620154621154622154623154624154625154626154627154628154629154630154631154632154633154634154635154636154637154638154639154640154641154642154643154644154645154646154647154648154649154650154651154652154653154654154655154656154657154658154659154660154661154662154663154664154665154666154667154668154669154670154671154672154673154674154675154676154677154678154679154680154681154682154683154684154685154686154687154688154689154690154691154692154693154694154695154696154697154698154699154700154701154702154703154704154705154706154707154708154709154710154711154712154713154714154715154716154717154718154719154720154721154722154723154724154725154726154727154728154729154730154731154732154733154734154735154736154737154738154739154740154741154742154743154744154745154746154747154748154749154750154751154752154753154754154755154756154757154758154759154760154761154762154763154764154765154766154767154768154769154770154771154772154773154774154775154776154777154778154779154780154781154782154783154784154785154786154787154788154789154790154791154792154793154794154795154796154797154798154799154800154801154802154803154804154805154806154807154808154809154810154811154812154813154814154815154816154817154818154819154820154821154822154823154824154825154826154827154828154829154830154831154832154833154834154835154836154837154838154839154840154841154842154843154844154845154846154847154848154849154850154851154852154853154854154855154856154857154858154859154860154861154862154863154864154865154866154867154868154869154870154871154872154873154874154875154876154877154878154879154880154881154882154883154884154885154886154887154888154889154890154891154892154893154894154895154896154897154898154899154900154901154902154903154904154905154906154907154908154909154910154911154912154913154914154915154916154917154918154919154920154921154922154923154924154925154926154927154928154929154930154931154932154933154934154935154936154937154938154939154940154941154942154943154944154945154946154947154948154949154950154951154952154953154954154955154956154957154958154959154960154961154962154963154964154965154966154967154968154969154970154971154972154973154974154975154976154977154978154979154980154981154982154983154984154985154986154987154988154989154990154991154992154993154994154995154996154997154998154999155000155001155002155003155004155005155006155007155008155009155010155011155012155013155014155015155016155017155018155019155020155021155022155023155024155025155026155027155028155029155030155031155032155033155034155035155036155037155038155039155040155041155042155043155044155045155046155047155048155049155050155051155052155053155054155055155056155057155058155059155060155061155062155063155064155065155066155067155068155069155070155071155072155073155074155075155076155077155078155079155080155081155082155083155084155085155086155087155088155089155090155091155092155093155094155095155096155097155098155099155100155101155102155103155104155105155106155107155108155109155110155111155112155113155114155115155116155117155118155119155120155121155122155123155124155125155126155127155128155129155130155131155132155133155134155135155136155137155138155139155140155141155142155143155144155145155146155147155148155149155150155151155152155153155154155155155156155157155158155159155160155161155162155163155164155165155166155167155168155169155170155171155172155173155174155175155176155177155178155179155180155181155182155183155184155185155186155187155188155189155190155191155192155193155194155195155196155197155198155199155200155201155202155203155204155205155206155207155208155209155210155211155212155213155214155215155216155217155218155219155220155221
  1. /*!
  2. * @license Copyright (c) 2003-2022, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. (function(d){ const l = d['ru'] = d['ru'] || {}; l.dictionary=Object.assign( l.dictionary||{}, {"%0 of %1":"%0 из %1","Align center":"Выравнивание по центру","Align left":"Выравнивание по левому краю","Align right":"Выравнивание по правому краю",Aquamarine:"Аквамариновый",Black:"Чёрный","Block quote":"Цитата",Blue:"Синий",Bold:"Жирный","Break text":"Разрывать текст","Bulleted List":"Маркированный список",Cancel:"Отмена","Cannot upload file:":"Невозможно загрузить файл","Centered image":"Выравнивание по центру","Change image text alternative":"Редактировать альтернативный текст","Choose heading":"Выбор стиля",Column:"Столбец","Could not insert image at the current position.":"Нельзя вставить изображение на текущую позицию.","Could not obtain resized image URL.":"Не удалось получить URL с измененным размером изображения.","Decrease indent":"Уменьшить отступ","Delete column":"Удалить столбец","Delete row":"Удалить строку","Dim grey":"Тёмно-серый","Document colors":"Цвет страницы",Downloadable:"Загружаемые","Dropdown toolbar":"Выпадающая панель инструментов","Edit block":"Редактировать блок","Edit link":"Редактировать ссылку","Edit source":"Изменить код","Editor toolbar":"Панель инструментов редактора","Empty snippet content":"Нет контента","Enter image caption":"Подпись к изображению","Font Background Color":"Цвет фона","Font Color":"Цвет шрифта","Full size image":"Оригинальный размер изображения",Green:"Зелёный",Grey:"Серый","Header column":"Столбец заголовков","Header row":"Строка заголовков",Heading:"Стиль","Heading 1":"Заголовок 1","Heading 2":"Заголовок 2","Heading 3":"Заголовок 3","Heading 4":"Заголовок 4","Heading 5":"Заголовок 5","Heading 6":"Заголовок 6","HTML snippet":"HTML сниппет","Image resize list":"Список размеров","Image toolbar":"Панель инструментов изображения","image widget":"Виджет изображений","In line":"В тексте","Increase indent":"Увеличить отступ","Insert column left":"Вставить столбец слева","Insert column right":"Вставить столбец справа","Insert HTML":"Вставить HTML","Insert image":"Вставить изображение","Insert image or file":"Вставьте изображение или файл","Insert paragraph after block":"Вставить параграф после блока","Insert paragraph before block":"Вставить параграф перед блоком","Insert row above":"Вставить строку выше","Insert row below":"Вставить строку ниже","Insert table":"Вставить таблицу","Inserting image failed":"Вставка изображения не удалась",Italic:"Курсив",Justify:"Выравнивание по ширине","Left aligned image":"Выравнивание по левому краю","Light blue":"Голубой","Light green":"Салатовый","Light grey":"Светло-серый",Link:"Ссылка","Link image":"Ссылка на изображение","Link URL":"Ссылка URL","Merge cell down":"Объединить с ячейкой снизу","Merge cell left":"Объединить с ячейкой слева","Merge cell right":"Объединить с ячейкой справа","Merge cell up":"Объединить с ячейкой сверху","Merge cells":"Объединить ячейки",Next:"Следующий","No preview available":"Предпросмотр недоступен","Numbered List":"Нумерованный список","Open in a new tab":"Открыть в новой вкладке","Open link in new tab":"Открыть ссылку в новой вкладке",Orange:"Оранжевый",Original:"Оригинальный",Paragraph:"Параграф","Paste raw HTML here...":"Вставьте HTML код сюда...",Previous:"Предыдущий",Purple:"Фиолетовый",Red:"Красный",Redo:"Повторить","Remove color":"Убрать цвет","Remove Format":"Убрать форматирование","Resize image":"Изменить размер изображения","Resize image to %0":"Изменить размер изображения до %0","Resize image to the original size":"Вернуть размер изображения к оригинальному","Rich Text Editor":"Редактор","Rich Text Editor, %0":"Редактор, %0","Right aligned image":"Выравнивание по правому краю",Row:"Строка",Save:"Сохранить","Save changes":"Сохранить изменения","Select all":"Выбрать все","Select column":"Выбрать столбец","Select row":"Выбрать строку","Selecting resized image failed":"Выбор изображения с измененным размером не удался","Show more items":"Другие инструменты","Side image":"Боковое изображение","Split cell horizontally":"Разделить ячейку горизонтально","Split cell vertically":"Разделить ячейку вертикально",Strikethrough:"Зачеркнутый",Subscript:"Подстрочный",Superscript:"Надстрочный","Table toolbar":"Панель инструментов таблицы","Text alignment":"Выравнивание текста","Text alignment toolbar":"Выравнивание","Text alternative":"Альтернативный текст","This link has no URL":"Для этой ссылки не установлен адрес URL","Toggle caption off":"Выключить описание","Toggle caption on":"Включить описание",Turquoise:"Бирюзовый",Underline:"Подчеркнутый",Undo:"Отменить",Unlink:"Убрать ссылку","Upload failed":"Загрузка не выполнена","Upload in progress":"Идёт загрузка",White:"Белый","Widget toolbar":"Панель инструментов виджета","Wrap text":"Обтекать текст",Yellow:"Жёлтый"} );l.getPluralForm=function(n){return (n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);;};})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
  6. (function webpackUniversalModuleDefinition(root, factory) {
  7. if(typeof exports === 'object' && typeof module === 'object')
  8. module.exports = factory();
  9. else if(typeof define === 'function' && define.amd)
  10. define([], factory);
  11. else if(typeof exports === 'object')
  12. exports["ClassicEditor"] = factory();
  13. else
  14. root["ClassicEditor"] = factory();
  15. })(window, function() {
  16. return /******/ (function(modules) { // webpackBootstrap
  17. /******/ // The module cache
  18. /******/ var installedModules = {};
  19. /******/
  20. /******/ // The require function
  21. /******/ function __webpack_require__(moduleId) {
  22. /******/
  23. /******/ // Check if module is in cache
  24. /******/ if(installedModules[moduleId]) {
  25. /******/ return installedModules[moduleId].exports;
  26. /******/ }
  27. /******/ // Create a new module (and put it into the cache)
  28. /******/ var module = installedModules[moduleId] = {
  29. /******/ i: moduleId,
  30. /******/ l: false,
  31. /******/ exports: {}
  32. /******/ };
  33. /******/
  34. /******/ // Execute the module function
  35. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  36. /******/
  37. /******/ // Flag the module as loaded
  38. /******/ module.l = true;
  39. /******/
  40. /******/ // Return the exports of the module
  41. /******/ return module.exports;
  42. /******/ }
  43. /******/
  44. /******/
  45. /******/ // expose the modules object (__webpack_modules__)
  46. /******/ __webpack_require__.m = modules;
  47. /******/
  48. /******/ // expose the module cache
  49. /******/ __webpack_require__.c = installedModules;
  50. /******/
  51. /******/ // define getter function for harmony exports
  52. /******/ __webpack_require__.d = function(exports, name, getter) {
  53. /******/ if(!__webpack_require__.o(exports, name)) {
  54. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  55. /******/ }
  56. /******/ };
  57. /******/
  58. /******/ // define __esModule on exports
  59. /******/ __webpack_require__.r = function(exports) {
  60. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  61. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  62. /******/ }
  63. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  64. /******/ };
  65. /******/
  66. /******/ // create a fake namespace object
  67. /******/ // mode & 1: value is a module id, require it
  68. /******/ // mode & 2: merge all properties of value into the ns
  69. /******/ // mode & 4: return value when already ns object
  70. /******/ // mode & 8|1: behave like require
  71. /******/ __webpack_require__.t = function(value, mode) {
  72. /******/ if(mode & 1) value = __webpack_require__(value);
  73. /******/ if(mode & 8) return value;
  74. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  75. /******/ var ns = Object.create(null);
  76. /******/ __webpack_require__.r(ns);
  77. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  78. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  79. /******/ return ns;
  80. /******/ };
  81. /******/
  82. /******/ // getDefaultExport function for compatibility with non-harmony modules
  83. /******/ __webpack_require__.n = function(module) {
  84. /******/ var getter = module && module.__esModule ?
  85. /******/ function getDefault() { return module['default']; } :
  86. /******/ function getModuleExports() { return module; };
  87. /******/ __webpack_require__.d(getter, 'a', getter);
  88. /******/ return getter;
  89. /******/ };
  90. /******/
  91. /******/ // Object.prototype.hasOwnProperty.call
  92. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  93. /******/
  94. /******/ // __webpack_public_path__
  95. /******/ __webpack_require__.p = "";
  96. /******/
  97. /******/
  98. /******/ // Load entry module and return exports
  99. /******/ return __webpack_require__(__webpack_require__.s = "./src/ckeditor.js");
  100. /******/ })
  101. /************************************************************************/
  102. /******/ ({
  103. /***/ "./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js":
  104. /*!********************************************************************************!*\
  105. !*** ./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js ***!
  106. \********************************************************************************/
  107. /*! exports provided: default */
  108. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109. "use strict";
  110. __webpack_require__.r(__webpack_exports__);
  111. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinderUploadAdapter; });
  112. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  113. /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
  114. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/utils.js");
  115. /**
  116. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  117. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  118. */
  119. /* globals XMLHttpRequest, FormData */
  120. /**
  121. * @module adapter-ckfinder/uploadadapter
  122. */
  123. /**
  124. * A plugin that enables file uploads in CKEditor 5 using the CKFinder server–side connector.
  125. *
  126. * See the {@glink features/images/image-upload/ckfinder "CKFinder file manager integration" guide} to learn how to configure
  127. * and use this feature as well as find out more about the full integration with the file manager
  128. * provided by the {@link module:ckfinder/ckfinder~CKFinder} plugin.
  129. *
  130. * Check out the {@glink features/images/image-upload/image-upload comprehensive "Image upload overview"} to learn about
  131. * other ways to upload images into CKEditor 5.
  132. *
  133. * @extends module:core/plugin~Plugin
  134. */
  135. class CKFinderUploadAdapter extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  136. /**
  137. * @inheritDoc
  138. */
  139. static get requires() {
  140. return [ ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileRepository"] ];
  141. }
  142. /**
  143. * @inheritDoc
  144. */
  145. static get pluginName() {
  146. return 'CKFinderUploadAdapter';
  147. }
  148. /**
  149. * @inheritDoc
  150. */
  151. init() {
  152. const url = this.editor.config.get( 'ckfinder.uploadUrl' );
  153. if ( !url ) {
  154. return;
  155. }
  156. // Register CKFinderAdapter
  157. this.editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileRepository"] ).createUploadAdapter = loader => new UploadAdapter( loader, url, this.editor.t );
  158. }
  159. }
  160. /**
  161. * Upload adapter for CKFinder.
  162. *
  163. * @private
  164. * @implements module:upload/filerepository~UploadAdapter
  165. */
  166. class UploadAdapter {
  167. /**
  168. * Creates a new adapter instance.
  169. *
  170. * @param {module:upload/filerepository~FileLoader} loader
  171. * @param {String} url
  172. * @param {module:utils/locale~Locale#t} t
  173. */
  174. constructor( loader, url, t ) {
  175. /**
  176. * FileLoader instance to use during the upload.
  177. *
  178. * @member {module:upload/filerepository~FileLoader} #loader
  179. */
  180. this.loader = loader;
  181. /**
  182. * Upload URL.
  183. *
  184. * @member {String} #url
  185. */
  186. this.url = url;
  187. /**
  188. * Locale translation method.
  189. *
  190. * @member {module:utils/locale~Locale#t} #t
  191. */
  192. this.t = t;
  193. }
  194. /**
  195. * Starts the upload process.
  196. *
  197. * @see module:upload/filerepository~UploadAdapter#upload
  198. * @returns {Promise.<Object>}
  199. */
  200. upload() {
  201. return this.loader.file.then( file => {
  202. return new Promise( ( resolve, reject ) => {
  203. this._initRequest();
  204. this._initListeners( resolve, reject, file );
  205. this._sendRequest( file );
  206. } );
  207. } );
  208. }
  209. /**
  210. * Aborts the upload process.
  211. *
  212. * @see module:upload/filerepository~UploadAdapter#abort
  213. */
  214. abort() {
  215. if ( this.xhr ) {
  216. this.xhr.abort();
  217. }
  218. }
  219. /**
  220. * Initializes the XMLHttpRequest object.
  221. *
  222. * @private
  223. */
  224. _initRequest() {
  225. const xhr = this.xhr = new XMLHttpRequest();
  226. xhr.open( 'POST', this.url, true );
  227. xhr.responseType = 'json';
  228. }
  229. /**
  230. * Initializes XMLHttpRequest listeners.
  231. *
  232. * @private
  233. * @param {Function} resolve Callback function to be called when the request is successful.
  234. * @param {Function} reject Callback function to be called when the request cannot be completed.
  235. * @param {File} file File instance to be uploaded.
  236. */
  237. _initListeners( resolve, reject, file ) {
  238. const xhr = this.xhr;
  239. const loader = this.loader;
  240. const t = this.t;
  241. const genericError = t( 'Cannot upload file:' ) + ` ${ file.name }.`;
  242. xhr.addEventListener( 'error', () => reject( genericError ) );
  243. xhr.addEventListener( 'abort', () => reject() );
  244. xhr.addEventListener( 'load', () => {
  245. const response = xhr.response;
  246. if ( !response || !response.uploaded ) {
  247. return reject( response && response.error && response.error.message ? response.error.message : genericError );
  248. }
  249. resolve( {
  250. default: response.url
  251. } );
  252. } );
  253. // Upload progress when it's supported.
  254. /* istanbul ignore else */
  255. if ( xhr.upload ) {
  256. xhr.upload.addEventListener( 'progress', evt => {
  257. if ( evt.lengthComputable ) {
  258. loader.uploadTotal = evt.total;
  259. loader.uploaded = evt.loaded;
  260. }
  261. } );
  262. }
  263. }
  264. /**
  265. * Prepares the data and sends the request.
  266. *
  267. * @private
  268. * @param {File} file File instance to be uploaded.
  269. */
  270. _sendRequest( file ) {
  271. // Prepare form data.
  272. const data = new FormData();
  273. data.append( 'upload', file );
  274. data.append( 'ckCsrfToken', Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getCsrfToken"])() );
  275. // Send request.
  276. this.xhr.send( data );
  277. }
  278. }
  279. /***/ }),
  280. /***/ "./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/utils.js":
  281. /*!************************************************************************!*\
  282. !*** ./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/utils.js ***!
  283. \************************************************************************/
  284. /*! exports provided: getCsrfToken, getCookie, setCookie */
  285. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  286. "use strict";
  287. __webpack_require__.r(__webpack_exports__);
  288. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCsrfToken", function() { return getCsrfToken; });
  289. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCookie", function() { return getCookie; });
  290. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCookie", function() { return setCookie; });
  291. /**
  292. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  293. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  294. */
  295. /* globals window, document */
  296. /**
  297. * @module adapter-ckfinder/utils
  298. */
  299. const TOKEN_COOKIE_NAME = 'ckCsrfToken';
  300. const TOKEN_LENGTH = 40;
  301. const tokenCharset = 'abcdefghijklmnopqrstuvwxyz0123456789';
  302. /**
  303. * Returns the CSRF token value. The value is a hash stored in `document.cookie`
  304. * under the `ckCsrfToken` key. The CSRF token can be used to secure the communication
  305. * between the web browser and the CKFinder server.
  306. *
  307. * @returns {String}
  308. */
  309. function getCsrfToken() {
  310. let token = getCookie( TOKEN_COOKIE_NAME );
  311. if ( !token || token.length != TOKEN_LENGTH ) {
  312. token = generateToken( TOKEN_LENGTH );
  313. setCookie( TOKEN_COOKIE_NAME, token );
  314. }
  315. return token;
  316. }
  317. /**
  318. * Returns the value of the cookie with a given name or `null` if the cookie is not found.
  319. *
  320. * @param {String} name
  321. * @returns {String|null}
  322. */
  323. function getCookie( name ) {
  324. name = name.toLowerCase();
  325. const parts = document.cookie.split( ';' );
  326. for ( const part of parts ) {
  327. const pair = part.split( '=' );
  328. const key = decodeURIComponent( pair[ 0 ].trim().toLowerCase() );
  329. if ( key === name ) {
  330. return decodeURIComponent( pair[ 1 ] );
  331. }
  332. }
  333. return null;
  334. }
  335. /**
  336. * Sets the value of the cookie with a given name.
  337. *
  338. * @param {String} name
  339. * @param {String} value
  340. */
  341. function setCookie( name, value ) {
  342. document.cookie = encodeURIComponent( name ) + '=' + encodeURIComponent( value ) + ';path=/';
  343. }
  344. // Generates the CSRF token with the given length.
  345. //
  346. // @private
  347. // @param {Number} length
  348. // @returns {string}
  349. function generateToken( length ) {
  350. let result = '';
  351. const randValues = new Uint8Array( length );
  352. window.crypto.getRandomValues( randValues );
  353. for ( let j = 0; j < randValues.length; j++ ) {
  354. const character = tokenCharset.charAt( randValues[ j ] % tokenCharset.length );
  355. result += Math.random() > 0.5 ? character.toUpperCase() : character;
  356. }
  357. return result;
  358. }
  359. /***/ }),
  360. /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignment.js":
  361. /*!*********************************************************************!*\
  362. !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/alignment.js ***!
  363. \*********************************************************************/
  364. /*! exports provided: default */
  365. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  366. "use strict";
  367. __webpack_require__.r(__webpack_exports__);
  368. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Alignment; });
  369. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  370. /* harmony import */ var _alignmentediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./alignmentediting */ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentediting.js");
  371. /* harmony import */ var _alignmentui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./alignmentui */ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentui.js");
  372. /**
  373. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  374. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  375. */
  376. /**
  377. * @module alignment/alignment
  378. */
  379. /**
  380. * The text alignment plugin.
  381. *
  382. * For a detailed overview, check the {@glink features/text-alignment Text alignment feature documentation}
  383. * and the {@glink api/alignment package page}.
  384. *
  385. * This is a "glue" plugin which loads the {@link module:alignment/alignmentediting~AlignmentEditing} and
  386. * {@link module:alignment/alignmentui~AlignmentUI} plugins.
  387. *
  388. * @extends module:core/plugin~Plugin
  389. */
  390. class Alignment extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  391. /**
  392. * @inheritDoc
  393. */
  394. static get requires() {
  395. return [ _alignmentediting__WEBPACK_IMPORTED_MODULE_1__["default"], _alignmentui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  396. }
  397. /**
  398. * @inheritDoc
  399. */
  400. static get pluginName() {
  401. return 'Alignment';
  402. }
  403. }
  404. /**
  405. * The configuration of the {@link module:alignment/alignment~Alignment alignment feature}.
  406. *
  407. * Read more in {@link module:alignment/alignment~AlignmentConfig}.
  408. *
  409. * @member {module:alignment/alignment~AlignmentConfig} module:core/editor/editorconfig~EditorConfig#alignment
  410. */
  411. /**
  412. * The configuration of the {@link module:alignment/alignment~Alignment alignment feature}.
  413. *
  414. * ClassicEditor
  415. * .create( editorElement, {
  416. * alignment: {
  417. * options: [ 'left', 'right' ]
  418. * }
  419. * } )
  420. * .then( ... )
  421. * .catch( ... );
  422. *
  423. * See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
  424. *
  425. * @interface AlignmentConfig
  426. */
  427. /**
  428. * Available alignment options.
  429. *
  430. * The available options are: `'left'`, `'right'`, `'center'` and `'justify'`. Other values are ignored.
  431. *
  432. * **Note:** It is recommended to always use `'left'` or `'right'` as these are default values which the user should
  433. * normally be able to choose depending on the
  434. * {@glink features/ui-language#setting-the-language-of-the-content language of the editor content}.
  435. *
  436. * ClassicEditor
  437. * .create( editorElement, {
  438. * alignment: {
  439. * options: [ 'left', 'right' ]
  440. * }
  441. * } )
  442. * .then( ... )
  443. * .catch( ... );
  444. *
  445. * By default the alignment is set inline using the `text-align` CSS property. To further customize the alignment,
  446. * you can provide names of classes for each alignment option using the `className` property.
  447. *
  448. * **Note:** Once you define the `className` property for one option, you need to specify it for all other options.
  449. *
  450. * ClassicEditor
  451. * .create( editorElement, {
  452. * alignment: {
  453. * options: [
  454. * { name: 'left', className: 'my-align-left' },
  455. * { name: 'right', className: 'my-align-right' }
  456. * ]
  457. * }
  458. * } )
  459. * .then( ... )
  460. * .catch( ... );
  461. *
  462. * See the demo of {@glink features/text-alignment#configuring-alignment-options custom alignment options}.
  463. *
  464. * @member {Array.<String|module:alignment/alignmentediting~AlignmentFormat>} module:alignment/alignment~AlignmentConfig#options
  465. */
  466. /***/ }),
  467. /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentcommand.js":
  468. /*!****************************************************************************!*\
  469. !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentcommand.js ***!
  470. \****************************************************************************/
  471. /*! exports provided: default */
  472. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  473. "use strict";
  474. __webpack_require__.r(__webpack_exports__);
  475. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AlignmentCommand; });
  476. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  477. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  478. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js");
  479. /**
  480. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  481. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  482. */
  483. /**
  484. * @module alignment/alignmentcommand
  485. */
  486. const ALIGNMENT = 'alignment';
  487. /**
  488. * The alignment command plugin.
  489. *
  490. * @extends module:core/command~Command
  491. */
  492. class AlignmentCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  493. /**
  494. * @inheritDoc
  495. */
  496. refresh() {
  497. const editor = this.editor;
  498. const locale = editor.locale;
  499. const firstBlock = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this.editor.model.document.selection.getSelectedBlocks() );
  500. // As first check whether to enable or disable the command as the value will always be false if the command cannot be enabled.
  501. this.isEnabled = !!firstBlock && this._canBeAligned( firstBlock );
  502. /**
  503. * A value of the current block's alignment.
  504. *
  505. * @observable
  506. * @readonly
  507. * @member {String} #value
  508. */
  509. if ( this.isEnabled && firstBlock.hasAttribute( 'alignment' ) ) {
  510. this.value = firstBlock.getAttribute( 'alignment' );
  511. } else {
  512. this.value = locale.contentLanguageDirection === 'rtl' ? 'right' : 'left';
  513. }
  514. }
  515. /**
  516. * Executes the command. Applies the alignment `value` to the selected blocks.
  517. * If no `value` is passed, the `value` is the default one or it is equal to the currently selected block's alignment attribute,
  518. * the command will remove the attribute from the selected blocks.
  519. *
  520. * @param {Object} [options] Options for the executed command.
  521. * @param {String} [options.value] The value to apply.
  522. * @fires execute
  523. */
  524. execute( options = {} ) {
  525. const editor = this.editor;
  526. const locale = editor.locale;
  527. const model = editor.model;
  528. const doc = model.document;
  529. const value = options.value;
  530. model.change( writer => {
  531. // Get only those blocks from selected that can have alignment set
  532. const blocks = Array.from( doc.selection.getSelectedBlocks() ).filter( block => this._canBeAligned( block ) );
  533. const currentAlignment = blocks[ 0 ].getAttribute( 'alignment' );
  534. // Remove alignment attribute if current alignment is:
  535. // - default (should not be stored in model as it will bloat model data)
  536. // - equal to currently set
  537. // - or no value is passed - denotes default alignment.
  538. const removeAlignment = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["isDefault"])( value, locale ) || currentAlignment === value || !value;
  539. if ( removeAlignment ) {
  540. removeAlignmentFromSelection( blocks, writer );
  541. } else {
  542. setAlignmentOnSelection( blocks, writer, value );
  543. }
  544. } );
  545. }
  546. /**
  547. * Checks whether a block can have alignment set.
  548. *
  549. * @private
  550. * @param {module:engine/model/element~Element} block The block to be checked.
  551. * @returns {Boolean}
  552. */
  553. _canBeAligned( block ) {
  554. return this.editor.model.schema.checkAttribute( block, ALIGNMENT );
  555. }
  556. }
  557. // Removes the alignment attribute from blocks.
  558. // @private
  559. function removeAlignmentFromSelection( blocks, writer ) {
  560. for ( const block of blocks ) {
  561. writer.removeAttribute( ALIGNMENT, block );
  562. }
  563. }
  564. // Sets the alignment attribute on blocks.
  565. // @private
  566. function setAlignmentOnSelection( blocks, writer, alignment ) {
  567. for ( const block of blocks ) {
  568. writer.setAttribute( ALIGNMENT, alignment, block );
  569. }
  570. }
  571. /***/ }),
  572. /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentediting.js":
  573. /*!****************************************************************************!*\
  574. !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentediting.js ***!
  575. \****************************************************************************/
  576. /*! exports provided: default */
  577. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  578. "use strict";
  579. __webpack_require__.r(__webpack_exports__);
  580. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AlignmentEditing; });
  581. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  582. /* harmony import */ var _alignmentcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./alignmentcommand */ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentcommand.js");
  583. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js");
  584. /**
  585. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  586. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  587. */
  588. /**
  589. * @module alignment/alignmentediting
  590. */
  591. /**
  592. * The alignment editing feature. It introduces the {@link module:alignment/alignmentcommand~AlignmentCommand command} and adds
  593. * the `alignment` attribute for block elements in the {@link module:engine/model/model~Model model}.
  594. * @extends module:core/plugin~Plugin
  595. */
  596. class AlignmentEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  597. /**
  598. * @inheritDoc
  599. */
  600. static get pluginName() {
  601. return 'AlignmentEditing';
  602. }
  603. /**
  604. * @inheritDoc
  605. */
  606. constructor( editor ) {
  607. super( editor );
  608. editor.config.define( 'alignment', {
  609. options: [ ..._utils__WEBPACK_IMPORTED_MODULE_2__["supportedOptions"].map( option => ( { name: option } ) ) ]
  610. } );
  611. }
  612. /**
  613. * @inheritDoc
  614. */
  615. init() {
  616. const editor = this.editor;
  617. const locale = editor.locale;
  618. const schema = editor.model.schema;
  619. const options = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeAlignmentOptions"])( editor.config.get( 'alignment.options' ) );
  620. // Filter out unsupported options and those that are redundant, e.g. `left` in LTR / `right` in RTL mode.
  621. const optionsToConvert = options.filter(
  622. option => Object(_utils__WEBPACK_IMPORTED_MODULE_2__["isSupported"])( option.name ) && !Object(_utils__WEBPACK_IMPORTED_MODULE_2__["isDefault"])( option.name, locale )
  623. );
  624. // Once there is at least one `className` defined, we switch to alignment with classes.
  625. const shouldUseClasses = optionsToConvert.some( option => !!option.className );
  626. // Allow alignment attribute on all blocks.
  627. schema.extend( '$block', { allowAttributes: 'alignment' } );
  628. editor.model.schema.setAttributeProperties( 'alignment', { isFormatting: true } );
  629. if ( shouldUseClasses ) {
  630. editor.conversion.attributeToAttribute( buildClassDefinition( optionsToConvert ) );
  631. } else {
  632. // Downcast inline styles.
  633. editor.conversion.for( 'downcast' ).attributeToAttribute( buildDowncastInlineDefinition( optionsToConvert ) );
  634. }
  635. const upcastInlineDefinitions = buildUpcastInlineDefinitions( optionsToConvert );
  636. // Always upcast from inline styles.
  637. for ( const definition of upcastInlineDefinitions ) {
  638. editor.conversion.for( 'upcast' ).attributeToAttribute( definition );
  639. }
  640. const upcastCompatibilityDefinitions = buildUpcastCompatibilityDefinitions( optionsToConvert );
  641. // Always upcast from deprecated `align` attribute.
  642. for ( const definition of upcastCompatibilityDefinitions ) {
  643. editor.conversion.for( 'upcast' ).attributeToAttribute( definition );
  644. }
  645. editor.commands.add( 'alignment', new _alignmentcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  646. }
  647. }
  648. // Prepare downcast conversion definition for inline alignment styling.
  649. // @private
  650. function buildDowncastInlineDefinition( options ) {
  651. const definition = {
  652. model: {
  653. key: 'alignment',
  654. values: options.map( option => option.name )
  655. },
  656. view: {}
  657. };
  658. for ( const { name } of options ) {
  659. definition.view[ name ] = {
  660. key: 'style',
  661. value: {
  662. 'text-align': name
  663. }
  664. };
  665. }
  666. return definition;
  667. }
  668. // Prepare upcast definitions for inline alignment styles.
  669. // @private
  670. function buildUpcastInlineDefinitions( options ) {
  671. const definitions = [];
  672. for ( const { name } of options ) {
  673. definitions.push( {
  674. view: {
  675. key: 'style',
  676. value: {
  677. 'text-align': name
  678. }
  679. },
  680. model: {
  681. key: 'alignment',
  682. value: name
  683. }
  684. } );
  685. }
  686. return definitions;
  687. }
  688. // Prepare upcast definitions for deprecated `align` attribute.
  689. // @private
  690. function buildUpcastCompatibilityDefinitions( options ) {
  691. const definitions = [];
  692. for ( const { name } of options ) {
  693. definitions.push( {
  694. view: {
  695. key: 'align',
  696. value: name
  697. },
  698. model: {
  699. key: 'alignment',
  700. value: name
  701. }
  702. } );
  703. }
  704. return definitions;
  705. }
  706. // Prepare conversion definitions for upcast and downcast alignment with classes.
  707. // @private
  708. function buildClassDefinition( options ) {
  709. const definition = {
  710. model: {
  711. key: 'alignment',
  712. values: options.map( option => option.name )
  713. },
  714. view: {}
  715. };
  716. for ( const option of options ) {
  717. definition.view[ option.name ] = {
  718. key: 'class',
  719. value: option.className
  720. };
  721. }
  722. return definition;
  723. }
  724. /**
  725. * The alignment configuration format descriptor.
  726. *
  727. * const alignmentFormat = {
  728. * name: 'right',
  729. * className: 'my-align-right-class'
  730. * }
  731. *
  732. * @typedef {Object} module:alignment/alignmentediting~AlignmentFormat
  733. *
  734. * @property {'left'|'right'|'center'|'justify'} name One of the alignment names options.
  735. *
  736. * @property {String} className The CSS class used to represent the style in the view.
  737. * Used to override default, inline styling for alignment.
  738. */
  739. /***/ }),
  740. /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentui.js":
  741. /*!***********************************************************************!*\
  742. !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentui.js ***!
  743. \***********************************************************************/
  744. /*! exports provided: default */
  745. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  746. "use strict";
  747. __webpack_require__.r(__webpack_exports__);
  748. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AlignmentUI; });
  749. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  750. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  751. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js");
  752. /**
  753. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  754. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  755. */
  756. /**
  757. * @module alignment/alignmentui
  758. */
  759. const iconsMap = new Map( [
  760. [ 'left', ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].alignLeft ],
  761. [ 'right', ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].alignRight ],
  762. [ 'center', ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].alignCenter ],
  763. [ 'justify', ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].alignJustify ]
  764. ] );
  765. /**
  766. * The default alignment UI plugin.
  767. *
  768. * It introduces the `'alignment:left'`, `'alignment:right'`, `'alignment:center'` and `'alignment:justify'` buttons
  769. * and the `'alignment'` dropdown.
  770. *
  771. * @extends module:core/plugin~Plugin
  772. */
  773. class AlignmentUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  774. /**
  775. * Returns the localized option titles provided by the plugin.
  776. *
  777. * The following localized titles corresponding with
  778. * {@link module:alignment/alignment~AlignmentConfig#options} are available:
  779. *
  780. * * `'left'`,
  781. * * `'right'`,
  782. * * `'center'`,
  783. * * `'justify'`.
  784. *
  785. * @readonly
  786. * @type {Object.<String,String>}
  787. */
  788. get localizedOptionTitles() {
  789. const t = this.editor.t;
  790. return {
  791. 'left': t( 'Align left' ),
  792. 'right': t( 'Align right' ),
  793. 'center': t( 'Align center' ),
  794. 'justify': t( 'Justify' )
  795. };
  796. }
  797. /**
  798. * @inheritDoc
  799. */
  800. static get pluginName() {
  801. return 'AlignmentUI';
  802. }
  803. /**
  804. * @inheritDoc
  805. */
  806. init() {
  807. const editor = this.editor;
  808. const componentFactory = editor.ui.componentFactory;
  809. const t = editor.t;
  810. const options = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeAlignmentOptions"])( editor.config.get( 'alignment.options' ) );
  811. options
  812. .map( option => option.name )
  813. .filter( _utils__WEBPACK_IMPORTED_MODULE_2__["isSupported"] )
  814. .forEach( option => this._addButton( option ) );
  815. componentFactory.add( 'alignment', locale => {
  816. const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
  817. // Add existing alignment buttons to dropdown's toolbar.
  818. const buttons = options.map( option => componentFactory.create( `alignment:${ option.name }` ) );
  819. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["addToolbarToDropdown"])( dropdownView, buttons );
  820. // Configure dropdown properties an behavior.
  821. dropdownView.buttonView.set( {
  822. label: t( 'Text alignment' ),
  823. tooltip: true
  824. } );
  825. dropdownView.toolbarView.isVertical = true;
  826. dropdownView.toolbarView.ariaLabel = t( 'Text alignment toolbar' );
  827. dropdownView.extendTemplate( {
  828. attributes: {
  829. class: 'ck-alignment-dropdown'
  830. }
  831. } );
  832. // The default icon depends on the direction of the content.
  833. const defaultIcon = locale.contentLanguageDirection === 'rtl' ? iconsMap.get( 'right' ) : iconsMap.get( 'left' );
  834. // Change icon to reflect current selection's alignment.
  835. dropdownView.buttonView.bind( 'icon' ).toMany( buttons, 'isOn', ( ...areActive ) => {
  836. // Get the index of an active button.
  837. const index = areActive.findIndex( value => value );
  838. // If none of the commands is active, display either defaultIcon or the first button's icon.
  839. if ( index < 0 ) {
  840. return defaultIcon;
  841. }
  842. // Return active button's icon.
  843. return buttons[ index ].icon;
  844. } );
  845. // Enable button if any of the buttons is enabled.
  846. dropdownView.bind( 'isEnabled' ).toMany( buttons, 'isEnabled', ( ...areEnabled ) => areEnabled.some( isEnabled => isEnabled ) );
  847. return dropdownView;
  848. } );
  849. }
  850. /**
  851. * Helper method for initializing the button and linking it with an appropriate command.
  852. *
  853. * @private
  854. * @param {String} option The name of the alignment option for which the button is added.
  855. */
  856. _addButton( option ) {
  857. const editor = this.editor;
  858. editor.ui.componentFactory.add( `alignment:${ option }`, locale => {
  859. const command = editor.commands.get( 'alignment' );
  860. const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  861. buttonView.set( {
  862. label: this.localizedOptionTitles[ option ],
  863. icon: iconsMap.get( option ),
  864. tooltip: true,
  865. isToggleable: true
  866. } );
  867. // Bind button model to command.
  868. buttonView.bind( 'isEnabled' ).to( command );
  869. buttonView.bind( 'isOn' ).to( command, 'value', value => value === option );
  870. // Execute command.
  871. this.listenTo( buttonView, 'execute', () => {
  872. editor.execute( 'alignment', { value: option } );
  873. editor.editing.view.focus();
  874. } );
  875. return buttonView;
  876. } );
  877. }
  878. }
  879. /***/ }),
  880. /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js":
  881. /*!*****************************************************************!*\
  882. !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js ***!
  883. \*****************************************************************/
  884. /*! exports provided: supportedOptions, isSupported, isDefault, normalizeAlignmentOptions */
  885. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  886. "use strict";
  887. __webpack_require__.r(__webpack_exports__);
  888. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportedOptions", function() { return supportedOptions; });
  889. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSupported", function() { return isSupported; });
  890. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDefault", function() { return isDefault; });
  891. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeAlignmentOptions", function() { return normalizeAlignmentOptions; });
  892. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  893. /**
  894. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  895. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  896. */
  897. /**
  898. * @module alignment/utils
  899. */
  900. /**
  901. * The list of supported alignment options:
  902. *
  903. * * `'left'`,
  904. * * `'right'`,
  905. * * `'center'`,
  906. * * `'justify'`
  907. */
  908. const supportedOptions = [ 'left', 'right', 'center', 'justify' ];
  909. /**
  910. * Checks whether the passed option is supported by {@link module:alignment/alignmentediting~AlignmentEditing}.
  911. *
  912. * @param {String} option The option value to check.
  913. * @returns {Boolean}
  914. */
  915. function isSupported( option ) {
  916. return supportedOptions.includes( option );
  917. }
  918. /**
  919. * Checks whether alignment is the default one considering the direction
  920. * of the editor content.
  921. *
  922. * @param {String} alignment The name of the alignment to check.
  923. * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor#locale} instance.
  924. * @returns {Boolean}
  925. */
  926. function isDefault( alignment, locale ) {
  927. // Right now only LTR is supported so the 'left' value is always the default one.
  928. if ( locale.contentLanguageDirection == 'rtl' ) {
  929. return alignment === 'right';
  930. } else {
  931. return alignment === 'left';
  932. }
  933. }
  934. /**
  935. * Brings the configuration to the common form, an array of objects.
  936. *
  937. * @param {Array.<String|module:alignment/alignmentediting~AlignmentFormat>} configuredOptions Alignment plugin configuration.
  938. * @returns {Array.<module:alignment/alignmentediting~AlignmentFormat>} Normalized object holding the configuration.
  939. */
  940. function normalizeAlignmentOptions( configuredOptions ) {
  941. const normalizedOptions = configuredOptions
  942. .map( option => {
  943. let result;
  944. if ( typeof option == 'string' ) {
  945. result = { name: option };
  946. } else {
  947. result = option;
  948. }
  949. return result;
  950. } )
  951. // Remove all unknown options.
  952. .filter( option => {
  953. const isNameValid = !!supportedOptions.includes( option.name );
  954. if ( !isNameValid ) {
  955. /**
  956. * The `name` in one of the `alignment.options` is not recognized.
  957. * The available options are: `'left'`, `'right'`, `'center'` and `'justify'`.
  958. *
  959. * @error alignment-config-name-not-recognized
  960. * @param {Object} option Options with unknown value of the `name` property.
  961. */
  962. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["logWarning"])( 'alignment-config-name-not-recognized', { option } );
  963. }
  964. return isNameValid;
  965. } );
  966. const classNameCount = normalizedOptions.filter( option => !!option.className ).length;
  967. // We either use classes for all styling options or for none.
  968. if ( classNameCount && classNameCount < normalizedOptions.length ) {
  969. /**
  970. * The `className` property has to be defined for all options once at least one option declares `className`.
  971. *
  972. * @error alignment-config-classnames-are-missing
  973. * @param {Array.<String|module:alignment/alignmentediting~AlignmentFormat>} configuredOptions Contents of `alignment.options`.
  974. */
  975. throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"]( 'alignment-config-classnames-are-missing', { configuredOptions } );
  976. }
  977. // Validate resulting config.
  978. normalizedOptions.forEach( ( option, index, allOptions ) => {
  979. const succeedingOptions = allOptions.slice( index + 1 );
  980. const nameAlreadyExists = succeedingOptions.some( item => item.name == option.name );
  981. if ( nameAlreadyExists ) {
  982. /**
  983. * The same `name` in one of the `alignment.options` was already declared.
  984. * Each `name` representing one alignment option can be set exactly once.
  985. *
  986. * @error alignment-config-name-already-defined
  987. * @param {Object} option First option that declares given `name`.
  988. * @param {Array.<String|module:alignment/alignmentediting~AlignmentFormat>} configuredOptions Contents of `alignment.options`.
  989. */
  990. throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"]( 'alignment-config-name-already-defined', { option, configuredOptions } );
  991. }
  992. // The `className` property is present. Check for duplicates then.
  993. if ( option.className ) {
  994. const classNameAlreadyExists = succeedingOptions.some( item => item.className == option.className );
  995. if ( classNameAlreadyExists ) {
  996. /**
  997. * The same `className` in one of the `alignment.options` was already declared.
  998. *
  999. * @error alignment-config-classname-already-defined
  1000. * @param {Object} option First option that declares given `className`.
  1001. * @param {Array.<String|module:alignment/alignmentediting~AlignmentFormat>} configuredOptions
  1002. * Contents of `alignment.options`.
  1003. */
  1004. throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"]( 'alignment-config-classname-already-defined', { option, configuredOptions } );
  1005. }
  1006. }
  1007. } );
  1008. return normalizedOptions;
  1009. }
  1010. /***/ }),
  1011. /***/ "./node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js":
  1012. /*!***********************************************************************!*\
  1013. !*** ./node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js ***!
  1014. \***********************************************************************/
  1015. /*! exports provided: default */
  1016. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1017. "use strict";
  1018. __webpack_require__.r(__webpack_exports__);
  1019. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Autoformat; });
  1020. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  1021. /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
  1022. /* harmony import */ var _blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./blockautoformatediting */ "./node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js");
  1023. /* harmony import */ var _inlineautoformatediting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./inlineautoformatediting */ "./node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js");
  1024. /**
  1025. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1026. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1027. */
  1028. /**
  1029. * @module autoformat/autoformat
  1030. */
  1031. /**
  1032. * Enables a set of predefined autoformatting actions.
  1033. *
  1034. * For a detailed overview, check the {@glink features/autoformat Autoformatting feature documentation}
  1035. * and the {@glink api/autoformat package page}.
  1036. *
  1037. * @extends module:core/plugin~Plugin
  1038. */
  1039. class Autoformat extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  1040. /**
  1041. * @inheritdoc
  1042. */
  1043. static get requires() {
  1044. return [ ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__["Delete"] ];
  1045. }
  1046. /**
  1047. * @inheritDoc
  1048. */
  1049. static get pluginName() {
  1050. return 'Autoformat';
  1051. }
  1052. /**
  1053. * @inheritDoc
  1054. */
  1055. afterInit() {
  1056. this._addListAutoformats();
  1057. this._addBasicStylesAutoformats();
  1058. this._addHeadingAutoformats();
  1059. this._addBlockQuoteAutoformats();
  1060. this._addCodeBlockAutoformats();
  1061. this._addHorizontalLineAutoformats();
  1062. }
  1063. /**
  1064. * Adds autoformatting related to the {@link module:list/list~List}.
  1065. *
  1066. * When typed:
  1067. * - `* ` or `- ` &ndash; A paragraph will be changed to a bulleted list.
  1068. * - `1. ` or `1) ` &ndash; A paragraph will be changed to a numbered list ("1" can be any digit or a list of digits).
  1069. * - `[] ` or `[ ] ` &ndash; A paragraph will be changed to a to-do list.
  1070. * - `[x] ` or `[ x ] ` &ndash; A paragraph will be changed to a checked to-do list.
  1071. *
  1072. * @private
  1073. */
  1074. _addListAutoformats() {
  1075. const commands = this.editor.commands;
  1076. if ( commands.get( 'bulletedList' ) ) {
  1077. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /^[*-]\s$/, 'bulletedList' );
  1078. }
  1079. if ( commands.get( 'numberedList' ) ) {
  1080. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /^1[.|)]\s$/, 'numberedList' );
  1081. }
  1082. if ( commands.get( 'todoList' ) ) {
  1083. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /^\[\s?\]\s$/, 'todoList' );
  1084. }
  1085. if ( commands.get( 'checkTodoList' ) ) {
  1086. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /^\[\s?x\s?\]\s$/, () => {
  1087. this.editor.execute( 'todoList' );
  1088. this.editor.execute( 'checkTodoList' );
  1089. } );
  1090. }
  1091. }
  1092. /**
  1093. * Adds autoformatting related to the {@link module:basic-styles/bold~Bold},
  1094. * {@link module:basic-styles/italic~Italic}, {@link module:basic-styles/code~Code}
  1095. * and {@link module:basic-styles/strikethrough~Strikethrough}
  1096. *
  1097. * When typed:
  1098. * - `**foobar**` &ndash; `**` characters are removed and `foobar` is set to bold,
  1099. * - `__foobar__` &ndash; `__` characters are removed and `foobar` is set to bold,
  1100. * - `*foobar*` &ndash; `*` characters are removed and `foobar` is set to italic,
  1101. * - `_foobar_` &ndash; `_` characters are removed and `foobar` is set to italic,
  1102. * - ``` `foobar` &ndash; ``` ` ``` characters are removed and `foobar` is set to code,
  1103. * - `~~foobar~~` &ndash; `~~` characters are removed and `foobar` is set to strikethrough.
  1104. *
  1105. * @private
  1106. */
  1107. _addBasicStylesAutoformats() {
  1108. const commands = this.editor.commands;
  1109. if ( commands.get( 'bold' ) ) {
  1110. const boldCallback = getCallbackFunctionForInlineAutoformat( this.editor, 'bold' );
  1111. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_3__["default"])( this.editor, this, /(?:^|\s)(\*\*)([^*]+)(\*\*)$/g, boldCallback );
  1112. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_3__["default"])( this.editor, this, /(?:^|\s)(__)([^_]+)(__)$/g, boldCallback );
  1113. }
  1114. if ( commands.get( 'italic' ) ) {
  1115. const italicCallback = getCallbackFunctionForInlineAutoformat( this.editor, 'italic' );
  1116. // The italic autoformatter cannot be triggered by the bold markers, so we need to check the
  1117. // text before the pattern (e.g. `(?:^|[^\*])`).
  1118. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_3__["default"])( this.editor, this, /(?:^|\s)(\*)([^*_]+)(\*)$/g, italicCallback );
  1119. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_3__["default"])( this.editor, this, /(?:^|\s)(_)([^_]+)(_)$/g, italicCallback );
  1120. }
  1121. if ( commands.get( 'code' ) ) {
  1122. const codeCallback = getCallbackFunctionForInlineAutoformat( this.editor, 'code' );
  1123. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_3__["default"])( this.editor, this, /(`)([^`]+)(`)$/g, codeCallback );
  1124. }
  1125. if ( commands.get( 'strikethrough' ) ) {
  1126. const strikethroughCallback = getCallbackFunctionForInlineAutoformat( this.editor, 'strikethrough' );
  1127. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_3__["default"])( this.editor, this, /(~~)([^~]+)(~~)$/g, strikethroughCallback );
  1128. }
  1129. }
  1130. /**
  1131. * Adds autoformatting related to {@link module:heading/heading~Heading}.
  1132. *
  1133. * It is using a number at the end of the command name to associate it with the proper trigger:
  1134. *
  1135. * * `heading` with value `heading1` will be executed when typing `#`,
  1136. * * `heading` with value `heading2` will be executed when typing `##`,
  1137. * * ... up to `heading6` and `######`.
  1138. *
  1139. * @private
  1140. */
  1141. _addHeadingAutoformats() {
  1142. const command = this.editor.commands.get( 'heading' );
  1143. if ( command ) {
  1144. command.modelElements
  1145. .filter( name => name.match( /^heading[1-6]$/ ) )
  1146. .forEach( modelName => {
  1147. const level = modelName[ 7 ];
  1148. const pattern = new RegExp( `^(#{${ level }})\\s$` );
  1149. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, pattern, () => {
  1150. // Should only be active if command is enabled and heading style associated with pattern is inactive.
  1151. if ( !command.isEnabled || command.value === modelName ) {
  1152. return false;
  1153. }
  1154. this.editor.execute( 'heading', { value: modelName } );
  1155. } );
  1156. } );
  1157. }
  1158. }
  1159. /**
  1160. * Adds autoformatting related to {@link module:block-quote/blockquote~BlockQuote}.
  1161. *
  1162. * When typed:
  1163. * * `> ` &ndash; A paragraph will be changed to a block quote.
  1164. *
  1165. * @private
  1166. */
  1167. _addBlockQuoteAutoformats() {
  1168. if ( this.editor.commands.get( 'blockQuote' ) ) {
  1169. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /^>\s$/, 'blockQuote' );
  1170. }
  1171. }
  1172. /**
  1173. * Adds autoformatting related to {@link module:code-block/codeblock~CodeBlock}.
  1174. *
  1175. * When typed:
  1176. * - `` ``` `` &ndash; A paragraph will be changed to a code block.
  1177. *
  1178. * @private
  1179. */
  1180. _addCodeBlockAutoformats() {
  1181. const editor = this.editor;
  1182. const selection = editor.model.document.selection;
  1183. if ( editor.commands.get( 'codeBlock' ) ) {
  1184. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( editor, this, /^```$/, () => {
  1185. if ( selection.getFirstPosition().parent.is( 'element', 'listItem' ) ) {
  1186. return false;
  1187. }
  1188. this.editor.execute( 'codeBlock', {
  1189. usePreviousLanguageChoice: true
  1190. } );
  1191. } );
  1192. }
  1193. }
  1194. /**
  1195. * Adds autoformatting related to {@link module:horizontal-line/horizontalline~HorizontalLine}.
  1196. *
  1197. * When typed:
  1198. * - `` --- `` &ndash; Will be replaced with a horizontal line.
  1199. *
  1200. * @private
  1201. */
  1202. _addHorizontalLineAutoformats() {
  1203. if ( this.editor.commands.get( 'horizontalLine' ) ) {
  1204. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__["default"])( this.editor, this, /^---$/, 'horizontalLine' );
  1205. }
  1206. }
  1207. }
  1208. // Helper function for getting `inlineAutoformatEditing` callbacks that checks if command is enabled.
  1209. //
  1210. // @param {module:core/editor/editor~Editor} editor
  1211. // @param {String} attributeKey
  1212. // @returns {Function}
  1213. function getCallbackFunctionForInlineAutoformat( editor, attributeKey ) {
  1214. return ( writer, rangesToFormat ) => {
  1215. const command = editor.commands.get( attributeKey );
  1216. if ( !command.isEnabled ) {
  1217. return false;
  1218. }
  1219. const validRanges = editor.model.schema.getValidRanges( rangesToFormat, attributeKey );
  1220. for ( const range of validRanges ) {
  1221. writer.setAttribute( attributeKey, true, range );
  1222. }
  1223. // After applying attribute to the text, remove given attribute from the selection.
  1224. // This way user is able to type a text without attribute used by auto formatter.
  1225. writer.removeSelectionAttribute( attributeKey );
  1226. };
  1227. }
  1228. /***/ }),
  1229. /***/ "./node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js":
  1230. /*!***********************************************************************************!*\
  1231. !*** ./node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js ***!
  1232. \***********************************************************************************/
  1233. /*! exports provided: default */
  1234. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1235. "use strict";
  1236. __webpack_require__.r(__webpack_exports__);
  1237. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return blockAutoformatEditing; });
  1238. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  1239. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  1240. /**
  1241. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1242. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1243. */
  1244. /**
  1245. * The block autoformatting engine. It allows to format various block patterns. For example,
  1246. * it can be configured to turn a paragraph starting with `*` and followed by a space into a list item.
  1247. *
  1248. * The autoformatting operation is integrated with the undo manager,
  1249. * so the autoformatting step can be undone if the user's intention was not to format the text.
  1250. *
  1251. * See the {@link module:autoformat/blockautoformatediting~blockAutoformatEditing `blockAutoformatEditing`} documentation
  1252. * to learn how to create custom block autoformatters. You can also use
  1253. * the {@link module:autoformat/autoformat~Autoformat} feature which enables a set of default autoformatters
  1254. * (lists, headings, bold and italic).
  1255. *
  1256. * @module autoformat/blockautoformatediting
  1257. */
  1258. /**
  1259. * Creates a listener triggered on {@link module:engine/model/document~Document#event:change:data `change:data`} event in the document.
  1260. * Calls the callback when inserted text matches the regular expression or the command name
  1261. * if provided instead of the callback.
  1262. *
  1263. * Examples of usage:
  1264. *
  1265. * To convert a paragraph to heading 1 when `- ` is typed, using just the command name:
  1266. *
  1267. * blockAutoformatEditing( editor, plugin, /^\- $/, 'heading1' );
  1268. *
  1269. * To convert a paragraph to heading 1 when `- ` is typed, using just the callback:
  1270. *
  1271. * blockAutoformatEditing( editor, plugin, /^\- $/, ( context ) => {
  1272. * const { match } = context;
  1273. * const headingLevel = match[ 1 ].length;
  1274. *
  1275. * editor.execute( 'heading', {
  1276. * formatId: `heading${ headingLevel }`
  1277. * } );
  1278. * } );
  1279. *
  1280. * @param {module:core/editor/editor~Editor} editor The editor instance.
  1281. * @param {module:autoformat/autoformat~Autoformat} plugin The autoformat plugin instance.
  1282. * @param {RegExp} pattern The regular expression to execute on just inserted text. The regular expression is tested against the text
  1283. * from the beginning until the caret position.
  1284. * @param {Function|String} callbackOrCommand The callback to execute or the command to run when the text is matched.
  1285. * In case of providing the callback, it receives the following parameter:
  1286. * * {Object} match RegExp.exec() result of matching the pattern to inserted text.
  1287. */
  1288. function blockAutoformatEditing( editor, plugin, pattern, callbackOrCommand ) {
  1289. let callback;
  1290. let command = null;
  1291. if ( typeof callbackOrCommand == 'function' ) {
  1292. callback = callbackOrCommand;
  1293. } else {
  1294. // We assume that the actual command name was provided.
  1295. command = editor.commands.get( callbackOrCommand );
  1296. callback = () => {
  1297. editor.execute( callbackOrCommand );
  1298. };
  1299. }
  1300. editor.model.document.on( 'change:data', ( evt, batch ) => {
  1301. if ( command && !command.isEnabled || !plugin.isEnabled ) {
  1302. return;
  1303. }
  1304. const range = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( editor.model.document.selection.getRanges() );
  1305. if ( !range.isCollapsed ) {
  1306. return;
  1307. }
  1308. if ( batch.type == 'transparent' ) {
  1309. return;
  1310. }
  1311. const changes = Array.from( editor.model.document.differ.getChanges() );
  1312. const entry = changes[ 0 ];
  1313. // Typing is represented by only a single change.
  1314. if ( changes.length != 1 || entry.type !== 'insert' || entry.name != '$text' || entry.length != 1 ) {
  1315. return;
  1316. }
  1317. const blockToFormat = entry.position.parent;
  1318. // Block formatting should be disabled in codeBlocks (#5800).
  1319. if ( blockToFormat.is( 'element', 'codeBlock' ) ) {
  1320. return;
  1321. }
  1322. // Only list commands and custom callbacks can be applied inside a list.
  1323. if ( blockToFormat.is( 'element', 'listItem' ) &&
  1324. typeof callbackOrCommand !== 'function' &&
  1325. ![ 'numberedList', 'bulletedList', 'todoList' ].includes( callbackOrCommand )
  1326. ) {
  1327. return;
  1328. }
  1329. // In case a command is bound, do not re-execute it over an existing block style which would result with a style removal.
  1330. // Instead just drop processing so that autoformat trigger text is not lost. E.g. writing "# " in a level 1 heading.
  1331. if ( command && command.value === true ) {
  1332. return;
  1333. }
  1334. const firstNode = blockToFormat.getChild( 0 );
  1335. const firstNodeRange = editor.model.createRangeOn( firstNode );
  1336. // Range is only expected to be within or at the very end of the first text node.
  1337. if ( !firstNodeRange.containsRange( range ) && !range.end.isEqual( firstNodeRange.end ) ) {
  1338. return;
  1339. }
  1340. const match = pattern.exec( firstNode.data.substr( 0, range.end.offset ) );
  1341. // ...and this text node's data match the pattern.
  1342. if ( !match ) {
  1343. return;
  1344. }
  1345. // Use enqueueChange to create new batch to separate typing batch from the auto-format changes.
  1346. editor.model.enqueueChange( writer => {
  1347. // Matched range.
  1348. const start = writer.createPositionAt( blockToFormat, 0 );
  1349. const end = writer.createPositionAt( blockToFormat, match[ 0 ].length );
  1350. const range = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["LiveRange"]( start, end );
  1351. const wasChanged = callback( { match } );
  1352. // Remove matched text.
  1353. if ( wasChanged !== false ) {
  1354. writer.remove( range );
  1355. const selectionRange = editor.model.document.selection.getFirstRange();
  1356. const blockRange = writer.createRangeIn( blockToFormat );
  1357. // If the block is empty and the document selection has been moved when
  1358. // applying formatting (e.g. is now in newly created block).
  1359. if ( blockToFormat.isEmpty && !blockRange.isEqual( selectionRange ) && !blockRange.containsRange( selectionRange, true ) ) {
  1360. writer.remove( blockToFormat );
  1361. }
  1362. }
  1363. range.detach();
  1364. editor.model.enqueueChange( () => {
  1365. editor.plugins.get( 'Delete' ).requestUndoOnBackspace();
  1366. } );
  1367. } );
  1368. } );
  1369. }
  1370. /***/ }),
  1371. /***/ "./node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js":
  1372. /*!************************************************************************************!*\
  1373. !*** ./node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js ***!
  1374. \************************************************************************************/
  1375. /*! exports provided: default */
  1376. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1377. "use strict";
  1378. __webpack_require__.r(__webpack_exports__);
  1379. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return inlineAutoformatEditing; });
  1380. /**
  1381. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1382. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1383. */
  1384. /**
  1385. * The inline autoformatting engine. It allows to format various inline patterns. For example,
  1386. * it can be configured to make "foo" bold when typed `**foo**` (the `**` markers will be removed).
  1387. *
  1388. * The autoformatting operation is integrated with the undo manager,
  1389. * so the autoformatting step can be undone if the user's intention was not to format the text.
  1390. *
  1391. * See the {@link module:autoformat/inlineautoformatediting~inlineAutoformatEditing `inlineAutoformatEditing`} documentation
  1392. * to learn how to create custom inline autoformatters. You can also use
  1393. * the {@link module:autoformat/autoformat~Autoformat} feature which enables a set of default autoformatters
  1394. * (lists, headings, bold and italic).
  1395. *
  1396. * @module autoformat/inlineautoformatediting
  1397. */
  1398. /**
  1399. * Enables autoformatting mechanism for a given {@link module:core/editor/editor~Editor}.
  1400. *
  1401. * It formats the matched text by applying the given model attribute or by running the provided formatting callback.
  1402. * On every {@link module:engine/model/document~Document#event:change:data data change} in the model document
  1403. * the autoformatting engine checks the text on the left of the selection
  1404. * and executes the provided action if the text matches given criteria (regular expression or callback).
  1405. *
  1406. * @param {module:core/editor/editor~Editor} editor The editor instance.
  1407. * @param {module:autoformat/autoformat~Autoformat} plugin The autoformat plugin instance.
  1408. * @param {Function|RegExp} testRegexpOrCallback The regular expression or callback to execute on text.
  1409. * Provided regular expression *must* have three capture groups. The first and the third capture group
  1410. * should match opening and closing delimiters. The second capture group should match the text to format.
  1411. *
  1412. * // Matches the `**bold text**` pattern.
  1413. * // There are three capturing groups:
  1414. * // - The first to match the starting `**` delimiter.
  1415. * // - The second to match the text to format.
  1416. * // - The third to match the ending `**` delimiter.
  1417. * inlineAutoformatEditing( editor, plugin, /(\*\*)([^\*]+?)(\*\*)$/g, formatCallback );
  1418. *
  1419. * When a function is provided instead of the regular expression, it will be executed with the text to match as a parameter.
  1420. * The function should return proper "ranges" to delete and format.
  1421. *
  1422. * {
  1423. * remove: [
  1424. * [ 0, 1 ], // Remove the first letter from the given text.
  1425. * [ 5, 6 ] // Remove the 6th letter from the given text.
  1426. * ],
  1427. * format: [
  1428. * [ 1, 5 ] // Format all letters from 2nd to 5th.
  1429. * ]
  1430. * }
  1431. *
  1432. * @param {Function} formatCallback A callback to apply actual formatting.
  1433. * It should return `false` if changes should not be applied (e.g. if a command is disabled).
  1434. *
  1435. * inlineAutoformatEditing( editor, plugin, /(\*\*)([^\*]+?)(\*\*)$/g, ( writer, rangesToFormat ) => {
  1436. * const command = editor.commands.get( 'bold' );
  1437. *
  1438. * if ( !command.isEnabled ) {
  1439. * return false;
  1440. * }
  1441. *
  1442. * const validRanges = editor.model.schema.getValidRanges( rangesToFormat, 'bold' );
  1443. *
  1444. * for ( let range of validRanges ) {
  1445. * writer.setAttribute( 'bold', true, range );
  1446. * }
  1447. * } );
  1448. */
  1449. function inlineAutoformatEditing( editor, plugin, testRegexpOrCallback, formatCallback ) {
  1450. let regExp;
  1451. let testCallback;
  1452. if ( testRegexpOrCallback instanceof RegExp ) {
  1453. regExp = testRegexpOrCallback;
  1454. } else {
  1455. testCallback = testRegexpOrCallback;
  1456. }
  1457. // A test callback run on changed text.
  1458. testCallback = testCallback || ( text => {
  1459. let result;
  1460. const remove = [];
  1461. const format = [];
  1462. while ( ( result = regExp.exec( text ) ) !== null ) {
  1463. // There should be full match and 3 capture groups.
  1464. if ( result && result.length < 4 ) {
  1465. break;
  1466. }
  1467. let {
  1468. index,
  1469. '1': leftDel,
  1470. '2': content,
  1471. '3': rightDel
  1472. } = result;
  1473. // Real matched string - there might be some non-capturing groups so we need to recalculate starting index.
  1474. const found = leftDel + content + rightDel;
  1475. index += result[ 0 ].length - found.length;
  1476. // Start and End offsets of delimiters to remove.
  1477. const delStart = [
  1478. index,
  1479. index + leftDel.length
  1480. ];
  1481. const delEnd = [
  1482. index + leftDel.length + content.length,
  1483. index + leftDel.length + content.length + rightDel.length
  1484. ];
  1485. remove.push( delStart );
  1486. remove.push( delEnd );
  1487. format.push( [ index + leftDel.length, index + leftDel.length + content.length ] );
  1488. }
  1489. return {
  1490. remove,
  1491. format
  1492. };
  1493. } );
  1494. editor.model.document.on( 'change:data', ( evt, batch ) => {
  1495. if ( batch.type == 'transparent' || !plugin.isEnabled ) {
  1496. return;
  1497. }
  1498. const model = editor.model;
  1499. const selection = model.document.selection;
  1500. // Do nothing if selection is not collapsed.
  1501. if ( !selection.isCollapsed ) {
  1502. return;
  1503. }
  1504. const changes = Array.from( model.document.differ.getChanges() );
  1505. const entry = changes[ 0 ];
  1506. // Typing is represented by only a single change.
  1507. if ( changes.length != 1 || entry.type !== 'insert' || entry.name != '$text' || entry.length != 1 ) {
  1508. return;
  1509. }
  1510. const focus = selection.focus;
  1511. const block = focus.parent;
  1512. const { text, range } = getTextAfterCode( model.createRange( model.createPositionAt( block, 0 ), focus ), model );
  1513. const testOutput = testCallback( text );
  1514. const rangesToFormat = testOutputToRanges( range.start, testOutput.format, model );
  1515. const rangesToRemove = testOutputToRanges( range.start, testOutput.remove, model );
  1516. if ( !( rangesToFormat.length && rangesToRemove.length ) ) {
  1517. return;
  1518. }
  1519. // Use enqueueChange to create new batch to separate typing batch from the auto-format changes.
  1520. model.enqueueChange( writer => {
  1521. // Apply format.
  1522. const hasChanged = formatCallback( writer, rangesToFormat );
  1523. // Strict check on `false` to have backward compatibility (when callbacks were returning `undefined`).
  1524. if ( hasChanged === false ) {
  1525. return;
  1526. }
  1527. // Remove delimiters - use reversed order to not mix the offsets while removing.
  1528. for ( const range of rangesToRemove.reverse() ) {
  1529. writer.remove( range );
  1530. }
  1531. model.enqueueChange( () => {
  1532. editor.plugins.get( 'Delete' ).requestUndoOnBackspace();
  1533. } );
  1534. } );
  1535. } );
  1536. }
  1537. // Converts output of the test function provided to the inlineAutoformatEditing and converts it to the model ranges
  1538. // inside provided block.
  1539. //
  1540. // @private
  1541. // @param {module:engine/model/position~Position} start
  1542. // @param {Array.<Array>} arrays
  1543. // @param {module:engine/model/model~Model} model
  1544. function testOutputToRanges( start, arrays, model ) {
  1545. return arrays
  1546. .filter( array => ( array[ 0 ] !== undefined && array[ 1 ] !== undefined ) )
  1547. .map( array => {
  1548. return model.createRange( start.getShiftedBy( array[ 0 ] ), start.getShiftedBy( array[ 1 ] ) );
  1549. } );
  1550. }
  1551. // Returns the last text line after the last code element from the given range.
  1552. // It is similar to {@link module:typing/utils/getlasttextline.getLastTextLine `getLastTextLine()`},
  1553. // but it ignores any text before the last `code`.
  1554. //
  1555. // @param {module:engine/model/range~Range} range
  1556. // @param {module:engine/model/model~Model} model
  1557. // @returns {module:typing/utils/getlasttextline~LastTextLineData}
  1558. function getTextAfterCode( range, model ) {
  1559. let start = range.start;
  1560. const text = Array.from( range.getItems() ).reduce( ( rangeText, node ) => {
  1561. // Trim text to a last occurrence of an inline element and update range start.
  1562. if ( !( node.is( '$text' ) || node.is( '$textProxy' ) ) || node.getAttribute( 'code' ) ) {
  1563. start = model.createPositionAfter( node );
  1564. return '';
  1565. }
  1566. return rangeText + node.data;
  1567. }, '' );
  1568. return { text, range: model.createRange( start, range.end ) };
  1569. }
  1570. /***/ }),
  1571. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js":
  1572. /*!*******************************************************************************!*\
  1573. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js ***!
  1574. \*******************************************************************************/
  1575. /*! exports provided: default */
  1576. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1577. "use strict";
  1578. __webpack_require__.r(__webpack_exports__);
  1579. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AttributeCommand; });
  1580. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  1581. /**
  1582. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1583. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1584. */
  1585. /**
  1586. * @module basic-styles/attributecommand
  1587. */
  1588. /**
  1589. * An extension of the base {@link module:core/command~Command} class, which provides utilities for a command
  1590. * that toggles a single attribute on a text or an element.
  1591. *
  1592. * `AttributeCommand` uses {@link module:engine/model/document~Document#selection}
  1593. * to decide which nodes (if any) should be changed, and applies or removes the attribute from them.
  1594. *
  1595. * The command checks the {@link module:engine/model/model~Model#schema} to decide if it can be enabled
  1596. * for the current selection and to which nodes the attribute can be applied.
  1597. *
  1598. * @extends module:core/command~Command
  1599. */
  1600. class AttributeCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  1601. /**
  1602. * @param {module:core/editor/editor~Editor} editor
  1603. * @param {String} attributeKey Attribute that will be set by the command.
  1604. */
  1605. constructor( editor, attributeKey ) {
  1606. super( editor );
  1607. /**
  1608. * The attribute that will be set by the command.
  1609. *
  1610. * @readonly
  1611. * @member {String}
  1612. */
  1613. this.attributeKey = attributeKey;
  1614. /**
  1615. * Flag indicating whether the command is active. The command is active when the
  1616. * {@link module:engine/model/selection~Selection#hasAttribute selection has the attribute} which means that:
  1617. *
  1618. * * If the selection is not empty &ndash; That the attribute is set on the first node in the selection that allows this attribute.
  1619. * * If the selection is empty &ndash; That the selection has the attribute itself (which means that newly typed
  1620. * text will have this attribute, too).
  1621. *
  1622. * @observable
  1623. * @readonly
  1624. * @member {Boolean} #value
  1625. */
  1626. }
  1627. /**
  1628. * Updates the command's {@link #value} and {@link #isEnabled} based on the current selection.
  1629. */
  1630. refresh() {
  1631. const model = this.editor.model;
  1632. const doc = model.document;
  1633. this.value = this._getValueFromFirstAllowedNode();
  1634. this.isEnabled = model.schema.checkAttributeInSelection( doc.selection, this.attributeKey );
  1635. }
  1636. /**
  1637. * Executes the command &mdash; applies the attribute to the selection or removes it from the selection.
  1638. *
  1639. * If the command is active (`value == true`), it will remove attributes. Otherwise, it will set attributes.
  1640. *
  1641. * The execution result differs, depending on the {@link module:engine/model/document~Document#selection}:
  1642. *
  1643. * * If the selection is on a range, the command applies the attribute to all nodes in that range
  1644. * (if they are allowed to have this attribute by the {@link module:engine/model/schema~Schema schema}).
  1645. * * If the selection is collapsed in a non-empty node, the command applies the attribute to the
  1646. * {@link module:engine/model/document~Document#selection} itself (note that typed characters copy attributes from the selection).
  1647. * * If the selection is collapsed in an empty node, the command applies the attribute to the parent node of the selection (note
  1648. * that the selection inherits all attributes from a node if it is in an empty node).
  1649. *
  1650. * @fires execute
  1651. * @param {Object} [options] Command options.
  1652. * @param {Boolean} [options.forceValue] If set, it will force the command behavior. If `true`, the command will apply the attribute,
  1653. * otherwise the command will remove the attribute.
  1654. * If not set, the command will look for its current value to decide what it should do.
  1655. */
  1656. execute( options = {} ) {
  1657. const model = this.editor.model;
  1658. const doc = model.document;
  1659. const selection = doc.selection;
  1660. const value = ( options.forceValue === undefined ) ? !this.value : options.forceValue;
  1661. model.change( writer => {
  1662. if ( selection.isCollapsed ) {
  1663. if ( value ) {
  1664. writer.setSelectionAttribute( this.attributeKey, true );
  1665. } else {
  1666. writer.removeSelectionAttribute( this.attributeKey );
  1667. }
  1668. } else {
  1669. const ranges = model.schema.getValidRanges( selection.getRanges(), this.attributeKey );
  1670. for ( const range of ranges ) {
  1671. if ( value ) {
  1672. writer.setAttribute( this.attributeKey, value, range );
  1673. } else {
  1674. writer.removeAttribute( this.attributeKey, range );
  1675. }
  1676. }
  1677. }
  1678. } );
  1679. }
  1680. /**
  1681. * Checks the attribute value of the first node in the selection that allows the attribute.
  1682. * For the collapsed selection returns the selection attribute.
  1683. *
  1684. * @private
  1685. * @returns {Boolean} The attribute value.
  1686. */
  1687. _getValueFromFirstAllowedNode() {
  1688. const model = this.editor.model;
  1689. const schema = model.schema;
  1690. const selection = model.document.selection;
  1691. if ( selection.isCollapsed ) {
  1692. return selection.hasAttribute( this.attributeKey );
  1693. }
  1694. for ( const range of selection.getRanges() ) {
  1695. for ( const item of range.getItems() ) {
  1696. if ( schema.checkAttribute( item, this.attributeKey ) ) {
  1697. return item.hasAttribute( this.attributeKey );
  1698. }
  1699. }
  1700. }
  1701. return false;
  1702. }
  1703. }
  1704. /***/ }),
  1705. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js":
  1706. /*!*******************************************************************!*\
  1707. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js ***!
  1708. \*******************************************************************/
  1709. /*! exports provided: default */
  1710. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1711. "use strict";
  1712. __webpack_require__.r(__webpack_exports__);
  1713. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Bold; });
  1714. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  1715. /* harmony import */ var _bold_boldediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bold/boldediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js");
  1716. /* harmony import */ var _bold_boldui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bold/boldui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js");
  1717. /**
  1718. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1719. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1720. */
  1721. /**
  1722. * @module basic-styles/bold
  1723. */
  1724. /**
  1725. * The bold feature.
  1726. *
  1727. * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}
  1728. * and the {@glink api/basic-styles package page}.
  1729. *
  1730. * This is a "glue" plugin which loads the {@link module:basic-styles/bold/boldediting~BoldEditing bold editing feature}
  1731. * and {@link module:basic-styles/bold/boldui~BoldUI bold UI feature}.
  1732. *
  1733. * @extends module:core/plugin~Plugin
  1734. */
  1735. class Bold extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  1736. /**
  1737. * @inheritDoc
  1738. */
  1739. static get requires() {
  1740. return [ _bold_boldediting__WEBPACK_IMPORTED_MODULE_1__["default"], _bold_boldui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  1741. }
  1742. /**
  1743. * @inheritDoc
  1744. */
  1745. static get pluginName() {
  1746. return 'Bold';
  1747. }
  1748. }
  1749. /***/ }),
  1750. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js":
  1751. /*!*******************************************************************************!*\
  1752. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js ***!
  1753. \*******************************************************************************/
  1754. /*! exports provided: default */
  1755. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1756. "use strict";
  1757. __webpack_require__.r(__webpack_exports__);
  1758. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BoldEditing; });
  1759. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  1760. /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
  1761. /**
  1762. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1763. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1764. */
  1765. /**
  1766. * @module basic-styles/bold/boldediting
  1767. */
  1768. const BOLD = 'bold';
  1769. /**
  1770. * The bold editing feature.
  1771. *
  1772. * It registers the `'bold'` command and introduces the `bold` attribute in the model which renders to the view
  1773. * as a `<strong>` element.
  1774. *
  1775. * @extends module:core/plugin~Plugin
  1776. */
  1777. class BoldEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  1778. /**
  1779. * @inheritDoc
  1780. */
  1781. static get pluginName() {
  1782. return 'BoldEditing';
  1783. }
  1784. /**
  1785. * @inheritDoc
  1786. */
  1787. init() {
  1788. const editor = this.editor;
  1789. // Allow bold attribute on text nodes.
  1790. editor.model.schema.extend( '$text', { allowAttributes: BOLD } );
  1791. editor.model.schema.setAttributeProperties( BOLD, {
  1792. isFormatting: true,
  1793. copyOnEnter: true
  1794. } );
  1795. // Build converter from model to view for data and editing pipelines.
  1796. editor.conversion.attributeToElement( {
  1797. model: BOLD,
  1798. view: 'strong',
  1799. upcastAlso: [
  1800. 'b',
  1801. viewElement => {
  1802. const fontWeight = viewElement.getStyle( 'font-weight' );
  1803. if ( !fontWeight ) {
  1804. return null;
  1805. }
  1806. // Value of the `font-weight` attribute can be defined as a string or a number.
  1807. if ( fontWeight == 'bold' || Number( fontWeight ) >= 600 ) {
  1808. return {
  1809. name: true,
  1810. styles: [ 'font-weight' ]
  1811. };
  1812. }
  1813. }
  1814. ]
  1815. } );
  1816. // Create bold command.
  1817. editor.commands.add( BOLD, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, BOLD ) );
  1818. // Set the Ctrl+B keystroke.
  1819. editor.keystrokes.set( 'CTRL+B', BOLD );
  1820. }
  1821. }
  1822. /***/ }),
  1823. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js":
  1824. /*!**************************************************************************!*\
  1825. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js ***!
  1826. \**************************************************************************/
  1827. /*! exports provided: default */
  1828. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1829. "use strict";
  1830. __webpack_require__.r(__webpack_exports__);
  1831. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BoldUI; });
  1832. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  1833. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  1834. /* harmony import */ var _theme_icons_bold_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/bold.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/bold.svg");
  1835. /**
  1836. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1837. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1838. */
  1839. /**
  1840. * @module basic-styles/bold/boldui
  1841. */
  1842. const BOLD = 'bold';
  1843. /**
  1844. * The bold UI feature. It introduces the Bold button.
  1845. *
  1846. * @extends module:core/plugin~Plugin
  1847. */
  1848. class BoldUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  1849. /**
  1850. * @inheritDoc
  1851. */
  1852. static get pluginName() {
  1853. return 'BoldUI';
  1854. }
  1855. /**
  1856. * @inheritDoc
  1857. */
  1858. init() {
  1859. const editor = this.editor;
  1860. const t = editor.t;
  1861. // Add bold button to feature components.
  1862. editor.ui.componentFactory.add( BOLD, locale => {
  1863. const command = editor.commands.get( BOLD );
  1864. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  1865. view.set( {
  1866. label: t( 'Bold' ),
  1867. icon: _theme_icons_bold_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  1868. keystroke: 'CTRL+B',
  1869. tooltip: true,
  1870. isToggleable: true
  1871. } );
  1872. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  1873. // Execute command.
  1874. this.listenTo( view, 'execute', () => {
  1875. editor.execute( BOLD );
  1876. editor.editing.view.focus();
  1877. } );
  1878. return view;
  1879. } );
  1880. }
  1881. }
  1882. /***/ }),
  1883. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js":
  1884. /*!*********************************************************************!*\
  1885. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js ***!
  1886. \*********************************************************************/
  1887. /*! exports provided: default */
  1888. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1889. "use strict";
  1890. __webpack_require__.r(__webpack_exports__);
  1891. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Italic; });
  1892. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  1893. /* harmony import */ var _italic_italicediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./italic/italicediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js");
  1894. /* harmony import */ var _italic_italicui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./italic/italicui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js");
  1895. /**
  1896. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1897. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1898. */
  1899. /**
  1900. * @module basic-styles/italic
  1901. */
  1902. /**
  1903. * The italic feature.
  1904. *
  1905. * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}
  1906. * and the {@glink api/basic-styles package page}.
  1907. *
  1908. * This is a "glue" plugin which loads the {@link module:basic-styles/italic/italicediting~ItalicEditing} and
  1909. * {@link module:basic-styles/italic/italicui~ItalicUI} plugins.
  1910. *
  1911. * @extends module:core/plugin~Plugin
  1912. */
  1913. class Italic extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  1914. /**
  1915. * @inheritDoc
  1916. */
  1917. static get requires() {
  1918. return [ _italic_italicediting__WEBPACK_IMPORTED_MODULE_1__["default"], _italic_italicui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  1919. }
  1920. /**
  1921. * @inheritDoc
  1922. */
  1923. static get pluginName() {
  1924. return 'Italic';
  1925. }
  1926. }
  1927. /***/ }),
  1928. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js":
  1929. /*!***********************************************************************************!*\
  1930. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js ***!
  1931. \***********************************************************************************/
  1932. /*! exports provided: default */
  1933. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1934. "use strict";
  1935. __webpack_require__.r(__webpack_exports__);
  1936. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ItalicEditing; });
  1937. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  1938. /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
  1939. /**
  1940. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  1941. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1942. */
  1943. /**
  1944. * @module basic-styles/italic/italicediting
  1945. */
  1946. const ITALIC = 'italic';
  1947. /**
  1948. * The italic editing feature.
  1949. *
  1950. * It registers the `'italic'` command, the <kbd>Ctrl+I</kbd> keystroke and introduces the `italic` attribute in the model
  1951. * which renders to the view as an `<i>` element.
  1952. *
  1953. * @extends module:core/plugin~Plugin
  1954. */
  1955. class ItalicEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  1956. /**
  1957. * @inheritDoc
  1958. */
  1959. static get pluginName() {
  1960. return 'ItalicEditing';
  1961. }
  1962. /**
  1963. * @inheritDoc
  1964. */
  1965. init() {
  1966. const editor = this.editor;
  1967. // Allow italic attribute on text nodes.
  1968. editor.model.schema.extend( '$text', { allowAttributes: ITALIC } );
  1969. editor.model.schema.setAttributeProperties( ITALIC, {
  1970. isFormatting: true,
  1971. copyOnEnter: true
  1972. } );
  1973. editor.conversion.attributeToElement( {
  1974. model: ITALIC,
  1975. view: 'i',
  1976. upcastAlso: [
  1977. 'em',
  1978. {
  1979. styles: {
  1980. 'font-style': 'italic'
  1981. }
  1982. }
  1983. ]
  1984. } );
  1985. // Create italic command.
  1986. editor.commands.add( ITALIC, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, ITALIC ) );
  1987. // Set the Ctrl+I keystroke.
  1988. editor.keystrokes.set( 'CTRL+I', ITALIC );
  1989. }
  1990. }
  1991. /***/ }),
  1992. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js":
  1993. /*!******************************************************************************!*\
  1994. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js ***!
  1995. \******************************************************************************/
  1996. /*! exports provided: default */
  1997. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1998. "use strict";
  1999. __webpack_require__.r(__webpack_exports__);
  2000. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ItalicUI; });
  2001. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2002. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  2003. /* harmony import */ var _theme_icons_italic_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/italic.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg");
  2004. /**
  2005. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2006. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2007. */
  2008. /**
  2009. * @module basic-styles/italic/italicui
  2010. */
  2011. const ITALIC = 'italic';
  2012. /**
  2013. * The italic UI feature. It introduces the Italic button.
  2014. *
  2015. * @extends module:core/plugin~Plugin
  2016. */
  2017. class ItalicUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2018. /**
  2019. * @inheritDoc
  2020. */
  2021. static get pluginName() {
  2022. return 'ItalicUI';
  2023. }
  2024. /**
  2025. * @inheritDoc
  2026. */
  2027. init() {
  2028. const editor = this.editor;
  2029. const t = editor.t;
  2030. // Add bold button to feature components.
  2031. editor.ui.componentFactory.add( ITALIC, locale => {
  2032. const command = editor.commands.get( ITALIC );
  2033. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  2034. view.set( {
  2035. label: t( 'Italic' ),
  2036. icon: _theme_icons_italic_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  2037. keystroke: 'CTRL+I',
  2038. tooltip: true,
  2039. isToggleable: true
  2040. } );
  2041. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  2042. // Execute command.
  2043. this.listenTo( view, 'execute', () => {
  2044. editor.execute( ITALIC );
  2045. editor.editing.view.focus();
  2046. } );
  2047. return view;
  2048. } );
  2049. }
  2050. }
  2051. /***/ }),
  2052. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js":
  2053. /*!****************************************************************************!*\
  2054. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js ***!
  2055. \****************************************************************************/
  2056. /*! exports provided: default */
  2057. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2058. "use strict";
  2059. __webpack_require__.r(__webpack_exports__);
  2060. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Strikethrough; });
  2061. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2062. /* harmony import */ var _strikethrough_strikethroughediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./strikethrough/strikethroughediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js");
  2063. /* harmony import */ var _strikethrough_strikethroughui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./strikethrough/strikethroughui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js");
  2064. /**
  2065. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2066. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2067. */
  2068. /**
  2069. * @module basic-styles/strikethrough
  2070. */
  2071. /**
  2072. * The strikethrough feature.
  2073. *
  2074. * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}
  2075. * and the {@glink api/basic-styles package page}.
  2076. *
  2077. * This is a "glue" plugin which loads the {@link module:basic-styles/strikethrough/strikethroughediting~StrikethroughEditing} and
  2078. * {@link module:basic-styles/strikethrough/strikethroughui~StrikethroughUI} plugins.
  2079. *
  2080. * @extends module:core/plugin~Plugin
  2081. */
  2082. class Strikethrough extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2083. /**
  2084. * @inheritDoc
  2085. */
  2086. static get requires() {
  2087. return [ _strikethrough_strikethroughediting__WEBPACK_IMPORTED_MODULE_1__["default"], _strikethrough_strikethroughui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  2088. }
  2089. /**
  2090. * @inheritDoc
  2091. */
  2092. static get pluginName() {
  2093. return 'Strikethrough';
  2094. }
  2095. }
  2096. /***/ }),
  2097. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js":
  2098. /*!*************************************************************************************************!*\
  2099. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js ***!
  2100. \*************************************************************************************************/
  2101. /*! exports provided: default */
  2102. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2103. "use strict";
  2104. __webpack_require__.r(__webpack_exports__);
  2105. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return StrikethroughEditing; });
  2106. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2107. /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
  2108. /**
  2109. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2110. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2111. */
  2112. /**
  2113. * @module basic-styles/strikethrough/strikethroughediting
  2114. */
  2115. const STRIKETHROUGH = 'strikethrough';
  2116. /**
  2117. * The strikethrough editing feature.
  2118. *
  2119. * It registers the `'strikethrough'` command, the <kbd>Ctrl+Shift+X</kbd> keystroke and introduces the
  2120. * `strikethroughsthrough` attribute in the model which renders to the view
  2121. * as a `<s>` element.
  2122. *
  2123. * @extends module:core/plugin~Plugin
  2124. */
  2125. class StrikethroughEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2126. /**
  2127. * @inheritDoc
  2128. */
  2129. static get pluginName() {
  2130. return 'StrikethroughEditing';
  2131. }
  2132. /**
  2133. * @inheritDoc
  2134. */
  2135. init() {
  2136. const editor = this.editor;
  2137. // Allow strikethrough attribute on text nodes.
  2138. editor.model.schema.extend( '$text', { allowAttributes: STRIKETHROUGH } );
  2139. editor.model.schema.setAttributeProperties( STRIKETHROUGH, {
  2140. isFormatting: true,
  2141. copyOnEnter: true
  2142. } );
  2143. editor.conversion.attributeToElement( {
  2144. model: STRIKETHROUGH,
  2145. view: 's',
  2146. upcastAlso: [
  2147. 'del',
  2148. 'strike',
  2149. {
  2150. styles: {
  2151. 'text-decoration': 'line-through'
  2152. }
  2153. }
  2154. ]
  2155. } );
  2156. // Create strikethrough command.
  2157. editor.commands.add( STRIKETHROUGH, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, STRIKETHROUGH ) );
  2158. // Set the Ctrl+Shift+X keystroke.
  2159. editor.keystrokes.set( 'CTRL+SHIFT+X', 'strikethrough' );
  2160. }
  2161. }
  2162. /***/ }),
  2163. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js":
  2164. /*!********************************************************************************************!*\
  2165. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js ***!
  2166. \********************************************************************************************/
  2167. /*! exports provided: default */
  2168. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2169. "use strict";
  2170. __webpack_require__.r(__webpack_exports__);
  2171. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return StrikethroughUI; });
  2172. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2173. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  2174. /* harmony import */ var _theme_icons_strikethrough_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/strikethrough.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/strikethrough.svg");
  2175. /**
  2176. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2177. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2178. */
  2179. /**
  2180. * @module basic-styles/strikethrough/strikethroughui
  2181. */
  2182. const STRIKETHROUGH = 'strikethrough';
  2183. /**
  2184. * The strikethrough UI feature. It introduces the Strikethrough button.
  2185. *
  2186. * @extends module:core/plugin~Plugin
  2187. */
  2188. class StrikethroughUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2189. /**
  2190. * @inheritDoc
  2191. */
  2192. static get pluginName() {
  2193. return 'StrikethroughUI';
  2194. }
  2195. /**
  2196. * @inheritDoc
  2197. */
  2198. init() {
  2199. const editor = this.editor;
  2200. const t = editor.t;
  2201. // Add strikethrough button to feature components.
  2202. editor.ui.componentFactory.add( STRIKETHROUGH, locale => {
  2203. const command = editor.commands.get( STRIKETHROUGH );
  2204. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  2205. view.set( {
  2206. label: t( 'Strikethrough' ),
  2207. icon: _theme_icons_strikethrough_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  2208. keystroke: 'CTRL+SHIFT+X',
  2209. tooltip: true,
  2210. isToggleable: true
  2211. } );
  2212. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  2213. // Execute command.
  2214. this.listenTo( view, 'execute', () => {
  2215. editor.execute( STRIKETHROUGH );
  2216. editor.editing.view.focus();
  2217. } );
  2218. return view;
  2219. } );
  2220. }
  2221. }
  2222. /***/ }),
  2223. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js":
  2224. /*!************************************************************************!*\
  2225. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js ***!
  2226. \************************************************************************/
  2227. /*! exports provided: default */
  2228. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2229. "use strict";
  2230. __webpack_require__.r(__webpack_exports__);
  2231. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Subscript; });
  2232. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2233. /* harmony import */ var _subscript_subscriptediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./subscript/subscriptediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.js");
  2234. /* harmony import */ var _subscript_subscriptui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./subscript/subscriptui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.js");
  2235. /**
  2236. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2237. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2238. */
  2239. /**
  2240. * @module basic-styles/subscript
  2241. */
  2242. /**
  2243. * The subscript feature.
  2244. *
  2245. * It loads the {@link module:basic-styles/subscript/subscriptediting~SubscriptEditing} and
  2246. * {@link module:basic-styles/subscript/subscriptui~SubscriptUI} plugins.
  2247. *
  2248. * @extends module:core/plugin~Plugin
  2249. */
  2250. class Subscript extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2251. /**
  2252. * @inheritDoc
  2253. */
  2254. static get requires() {
  2255. return [ _subscript_subscriptediting__WEBPACK_IMPORTED_MODULE_1__["default"], _subscript_subscriptui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  2256. }
  2257. /**
  2258. * @inheritDoc
  2259. */
  2260. static get pluginName() {
  2261. return 'Subscript';
  2262. }
  2263. }
  2264. /***/ }),
  2265. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.js":
  2266. /*!*****************************************************************************************!*\
  2267. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.js ***!
  2268. \*****************************************************************************************/
  2269. /*! exports provided: default */
  2270. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2271. "use strict";
  2272. __webpack_require__.r(__webpack_exports__);
  2273. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SubscriptEditing; });
  2274. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2275. /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
  2276. /**
  2277. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2278. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2279. */
  2280. /**
  2281. * @module basic-styles/subscript/subscriptediting
  2282. */
  2283. const SUBSCRIPT = 'subscript';
  2284. /**
  2285. * The subscript editing feature.
  2286. *
  2287. * It registers the `sub` command and introduces the `sub` attribute in the model which renders to the view
  2288. * as a `<sub>` element.
  2289. *
  2290. * @extends module:core/plugin~Plugin
  2291. */
  2292. class SubscriptEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2293. /**
  2294. * @inheritDoc
  2295. */
  2296. static get pluginName() {
  2297. return 'SubscriptEditing';
  2298. }
  2299. /**
  2300. * @inheritDoc
  2301. */
  2302. init() {
  2303. const editor = this.editor;
  2304. // Allow sub attribute on text nodes.
  2305. editor.model.schema.extend( '$text', { allowAttributes: SUBSCRIPT } );
  2306. editor.model.schema.setAttributeProperties( SUBSCRIPT, {
  2307. isFormatting: true,
  2308. copyOnEnter: true
  2309. } );
  2310. // Build converter from model to view for data and editing pipelines.
  2311. editor.conversion.attributeToElement( {
  2312. model: SUBSCRIPT,
  2313. view: 'sub',
  2314. upcastAlso: [
  2315. {
  2316. styles: {
  2317. 'vertical-align': 'sub'
  2318. }
  2319. }
  2320. ]
  2321. } );
  2322. // Create sub command.
  2323. editor.commands.add( SUBSCRIPT, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, SUBSCRIPT ) );
  2324. }
  2325. }
  2326. /***/ }),
  2327. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.js":
  2328. /*!************************************************************************************!*\
  2329. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.js ***!
  2330. \************************************************************************************/
  2331. /*! exports provided: default */
  2332. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2333. "use strict";
  2334. __webpack_require__.r(__webpack_exports__);
  2335. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SubscriptUI; });
  2336. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2337. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  2338. /* harmony import */ var _theme_icons_subscript_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/subscript.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/subscript.svg");
  2339. /**
  2340. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2341. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2342. */
  2343. /**
  2344. * @module basic-styles/subscript/subscriptui
  2345. */
  2346. const SUBSCRIPT = 'subscript';
  2347. /**
  2348. * The subscript UI feature. It introduces the Subscript button.
  2349. *
  2350. * @extends module:core/plugin~Plugin
  2351. */
  2352. class SubscriptUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2353. /**
  2354. * @inheritDoc
  2355. */
  2356. static get pluginName() {
  2357. return 'SubscriptUI';
  2358. }
  2359. /**
  2360. * @inheritDoc
  2361. */
  2362. init() {
  2363. const editor = this.editor;
  2364. const t = editor.t;
  2365. // Add subscript button to feature components.
  2366. editor.ui.componentFactory.add( SUBSCRIPT, locale => {
  2367. const command = editor.commands.get( SUBSCRIPT );
  2368. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  2369. view.set( {
  2370. label: t( 'Subscript' ),
  2371. icon: _theme_icons_subscript_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  2372. tooltip: true,
  2373. isToggleable: true
  2374. } );
  2375. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  2376. // Execute command.
  2377. this.listenTo( view, 'execute', () => {
  2378. editor.execute( SUBSCRIPT );
  2379. editor.editing.view.focus();
  2380. } );
  2381. return view;
  2382. } );
  2383. }
  2384. }
  2385. /***/ }),
  2386. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js":
  2387. /*!**************************************************************************!*\
  2388. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js ***!
  2389. \**************************************************************************/
  2390. /*! exports provided: default */
  2391. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2392. "use strict";
  2393. __webpack_require__.r(__webpack_exports__);
  2394. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Superscript; });
  2395. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2396. /* harmony import */ var _superscript_superscriptediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./superscript/superscriptediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.js");
  2397. /* harmony import */ var _superscript_superscriptui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./superscript/superscriptui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.js");
  2398. /**
  2399. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2400. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2401. */
  2402. /**
  2403. * @module basic-styles/superscript
  2404. */
  2405. /**
  2406. * The superscript feature.
  2407. *
  2408. * It loads the {@link module:basic-styles/superscript/superscriptediting~SuperscriptEditing} and
  2409. * {@link module:basic-styles/superscript/superscriptui~SuperscriptUI} plugins.
  2410. *
  2411. * @extends module:core/plugin~Plugin
  2412. */
  2413. class Superscript extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2414. /**
  2415. * @inheritDoc
  2416. */
  2417. static get requires() {
  2418. return [ _superscript_superscriptediting__WEBPACK_IMPORTED_MODULE_1__["default"], _superscript_superscriptui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  2419. }
  2420. /**
  2421. * @inheritDoc
  2422. */
  2423. static get pluginName() {
  2424. return 'Superscript';
  2425. }
  2426. }
  2427. /***/ }),
  2428. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.js":
  2429. /*!*********************************************************************************************!*\
  2430. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.js ***!
  2431. \*********************************************************************************************/
  2432. /*! exports provided: default */
  2433. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2434. "use strict";
  2435. __webpack_require__.r(__webpack_exports__);
  2436. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SuperscriptEditing; });
  2437. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2438. /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
  2439. /**
  2440. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2441. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2442. */
  2443. /**
  2444. * @module basic-styles/superscript/superscriptediting
  2445. */
  2446. const SUPERSCRIPT = 'superscript';
  2447. /**
  2448. * The superscript editing feature.
  2449. *
  2450. * It registers the `super` command and introduces the `super` attribute in the model which renders to the view
  2451. * as a `<super>` element.
  2452. *
  2453. * @extends module:core/plugin~Plugin
  2454. */
  2455. class SuperscriptEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2456. /**
  2457. * @inheritDoc
  2458. */
  2459. static get pluginName() {
  2460. return 'SuperscriptEditing';
  2461. }
  2462. /**
  2463. * @inheritDoc
  2464. */
  2465. init() {
  2466. const editor = this.editor;
  2467. // Allow super attribute on text nodes.
  2468. editor.model.schema.extend( '$text', { allowAttributes: SUPERSCRIPT } );
  2469. editor.model.schema.setAttributeProperties( SUPERSCRIPT, {
  2470. isFormatting: true,
  2471. copyOnEnter: true
  2472. } );
  2473. // Build converter from model to view for data and editing pipelines.
  2474. editor.conversion.attributeToElement( {
  2475. model: SUPERSCRIPT,
  2476. view: 'sup',
  2477. upcastAlso: [
  2478. {
  2479. styles: {
  2480. 'vertical-align': 'super'
  2481. }
  2482. }
  2483. ]
  2484. } );
  2485. // Create super command.
  2486. editor.commands.add( SUPERSCRIPT, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, SUPERSCRIPT ) );
  2487. }
  2488. }
  2489. /***/ }),
  2490. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.js":
  2491. /*!****************************************************************************************!*\
  2492. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.js ***!
  2493. \****************************************************************************************/
  2494. /*! exports provided: default */
  2495. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2496. "use strict";
  2497. __webpack_require__.r(__webpack_exports__);
  2498. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SuperscriptUI; });
  2499. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2500. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  2501. /* harmony import */ var _theme_icons_superscript_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/superscript.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/superscript.svg");
  2502. /**
  2503. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2504. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2505. */
  2506. /**
  2507. * @module basic-styles/superscript/superscriptui
  2508. */
  2509. const SUPERSCRIPT = 'superscript';
  2510. /**
  2511. * The superscript UI feature. It introduces the Superscript button.
  2512. *
  2513. * @extends module:core/plugin~Plugin
  2514. */
  2515. class SuperscriptUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2516. /**
  2517. * @inheritDoc
  2518. */
  2519. static get pluginName() {
  2520. return 'SuperscriptUI';
  2521. }
  2522. /**
  2523. * @inheritDoc
  2524. */
  2525. init() {
  2526. const editor = this.editor;
  2527. const t = editor.t;
  2528. // Add superscript button to feature components.
  2529. editor.ui.componentFactory.add( SUPERSCRIPT, locale => {
  2530. const command = editor.commands.get( SUPERSCRIPT );
  2531. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  2532. view.set( {
  2533. label: t( 'Superscript' ),
  2534. icon: _theme_icons_superscript_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  2535. tooltip: true,
  2536. isToggleable: true
  2537. } );
  2538. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  2539. // Execute command.
  2540. this.listenTo( view, 'execute', () => {
  2541. editor.execute( SUPERSCRIPT );
  2542. editor.editing.view.focus();
  2543. } );
  2544. return view;
  2545. } );
  2546. }
  2547. }
  2548. /***/ }),
  2549. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js":
  2550. /*!************************************************************************!*\
  2551. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js ***!
  2552. \************************************************************************/
  2553. /*! exports provided: default */
  2554. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2555. "use strict";
  2556. __webpack_require__.r(__webpack_exports__);
  2557. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Underline; });
  2558. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2559. /* harmony import */ var _underline_underlineediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./underline/underlineediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.js");
  2560. /* harmony import */ var _underline_underlineui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./underline/underlineui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.js");
  2561. /**
  2562. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2563. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2564. */
  2565. /**
  2566. * @module basic-styles/underline
  2567. */
  2568. /**
  2569. * The underline feature.
  2570. *
  2571. * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}
  2572. * and the {@glink api/basic-styles package page}.
  2573. *
  2574. * This is a "glue" plugin which loads the {@link module:basic-styles/underline/underlineediting~UnderlineEditing} and
  2575. * {@link module:basic-styles/underline/underlineui~UnderlineUI} plugins.
  2576. *
  2577. * @extends module:core/plugin~Plugin
  2578. */
  2579. class Underline extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2580. /**
  2581. * @inheritDoc
  2582. */
  2583. static get requires() {
  2584. return [ _underline_underlineediting__WEBPACK_IMPORTED_MODULE_1__["default"], _underline_underlineui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  2585. }
  2586. /**
  2587. * @inheritDoc
  2588. */
  2589. static get pluginName() {
  2590. return 'Underline';
  2591. }
  2592. }
  2593. /***/ }),
  2594. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.js":
  2595. /*!*****************************************************************************************!*\
  2596. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.js ***!
  2597. \*****************************************************************************************/
  2598. /*! exports provided: default */
  2599. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2600. "use strict";
  2601. __webpack_require__.r(__webpack_exports__);
  2602. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UnderlineEditing; });
  2603. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2604. /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
  2605. /**
  2606. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2607. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2608. */
  2609. /**
  2610. * @module basic-styles/underline/underlineediting
  2611. */
  2612. const UNDERLINE = 'underline';
  2613. /**
  2614. * The underline editing feature.
  2615. *
  2616. * It registers the `'underline'` command, the <kbd>Ctrl+U</kbd> keystroke
  2617. * and introduces the `underline` attribute in the model which renders to the view as an `<u>` element.
  2618. *
  2619. * @extends module:core/plugin~Plugin
  2620. */
  2621. class UnderlineEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2622. /**
  2623. * @inheritDoc
  2624. */
  2625. static get pluginName() {
  2626. return 'UnderlineEditing';
  2627. }
  2628. /**
  2629. * @inheritDoc
  2630. */
  2631. init() {
  2632. const editor = this.editor;
  2633. // Allow strikethrough attribute on text nodes.
  2634. editor.model.schema.extend( '$text', { allowAttributes: UNDERLINE } );
  2635. editor.model.schema.setAttributeProperties( UNDERLINE, {
  2636. isFormatting: true,
  2637. copyOnEnter: true
  2638. } );
  2639. editor.conversion.attributeToElement( {
  2640. model: UNDERLINE,
  2641. view: 'u',
  2642. upcastAlso: {
  2643. styles: {
  2644. 'text-decoration': 'underline'
  2645. }
  2646. }
  2647. } );
  2648. // Create underline command.
  2649. editor.commands.add( UNDERLINE, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, UNDERLINE ) );
  2650. // Set the Ctrl+U keystroke.
  2651. editor.keystrokes.set( 'CTRL+U', 'underline' );
  2652. }
  2653. }
  2654. /***/ }),
  2655. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.js":
  2656. /*!************************************************************************************!*\
  2657. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.js ***!
  2658. \************************************************************************************/
  2659. /*! exports provided: default */
  2660. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2661. "use strict";
  2662. __webpack_require__.r(__webpack_exports__);
  2663. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UnderlineUI; });
  2664. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2665. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  2666. /* harmony import */ var _theme_icons_underline_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/underline.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/underline.svg");
  2667. /**
  2668. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2669. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2670. */
  2671. /**
  2672. * @module basic-styles/underline/underlineui
  2673. */
  2674. const UNDERLINE = 'underline';
  2675. /**
  2676. * The underline UI feature. It introduces the Underline button.
  2677. *
  2678. * @extends module:core/plugin~Plugin
  2679. */
  2680. class UnderlineUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2681. /**
  2682. * @inheritDoc
  2683. */
  2684. static get pluginName() {
  2685. return 'UnderlineUI';
  2686. }
  2687. /**
  2688. * @inheritDoc
  2689. */
  2690. init() {
  2691. const editor = this.editor;
  2692. const t = editor.t;
  2693. // Add bold button to feature components.
  2694. editor.ui.componentFactory.add( UNDERLINE, locale => {
  2695. const command = editor.commands.get( UNDERLINE );
  2696. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  2697. view.set( {
  2698. label: t( 'Underline' ),
  2699. icon: _theme_icons_underline_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  2700. keystroke: 'CTRL+U',
  2701. tooltip: true,
  2702. isToggleable: true
  2703. } );
  2704. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  2705. // Execute command.
  2706. this.listenTo( view, 'execute', () => {
  2707. editor.execute( UNDERLINE );
  2708. editor.editing.view.focus();
  2709. } );
  2710. return view;
  2711. } );
  2712. }
  2713. }
  2714. /***/ }),
  2715. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/bold.svg":
  2716. /*!****************************************************************************!*\
  2717. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/bold.svg ***!
  2718. \****************************************************************************/
  2719. /*! exports provided: default */
  2720. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2721. "use strict";
  2722. __webpack_require__.r(__webpack_exports__);
  2723. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10.187 17H5.773c-.637 0-1.092-.138-1.364-.415-.273-.277-.409-.718-.409-1.323V4.738c0-.617.14-1.062.419-1.332.279-.27.73-.406 1.354-.406h4.68c.69 0 1.288.041 1.793.124.506.083.96.242 1.36.478.341.197.644.447.906.75a3.262 3.262 0 0 1 .808 2.162c0 1.401-.722 2.426-2.167 3.075C15.05 10.175 16 11.315 16 13.01a3.756 3.756 0 0 1-2.296 3.504 6.1 6.1 0 0 1-1.517.377c-.571.073-1.238.11-2 .11zm-.217-6.217H7v4.087h3.069c1.977 0 2.965-.69 2.965-2.072 0-.707-.256-1.22-.768-1.537-.512-.319-1.277-.478-2.296-.478zM7 5.13v3.619h2.606c.729 0 1.292-.067 1.69-.2a1.6 1.6 0 0 0 .91-.765c.165-.267.247-.566.247-.897 0-.707-.26-1.176-.778-1.409-.519-.232-1.31-.348-2.375-.348H7z\"/></svg>");
  2724. /***/ }),
  2725. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg":
  2726. /*!******************************************************************************!*\
  2727. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg ***!
  2728. \******************************************************************************/
  2729. /*! exports provided: default */
  2730. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2731. "use strict";
  2732. __webpack_require__.r(__webpack_exports__);
  2733. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m9.586 14.633.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z\"/></svg>");
  2734. /***/ }),
  2735. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/strikethrough.svg":
  2736. /*!*************************************************************************************!*\
  2737. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/strikethrough.svg ***!
  2738. \*************************************************************************************/
  2739. /*! exports provided: default */
  2740. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2741. "use strict";
  2742. __webpack_require__.r(__webpack_exports__);
  2743. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 16.4c-.8-.4-1.5-.9-2.2-1.5a.6.6 0 0 1-.2-.5l.3-.6h1c1 1.2 2.1 1.7 3.7 1.7 1 0 1.8-.3 2.3-.6.6-.4.6-1.2.6-1.3.2-1.2-.9-2.1-.9-2.1h2.1c.3.7.4 1.2.4 1.7v.8l-.6 1.2c-.6.8-1.1 1-1.6 1.2a6 6 0 0 1-2.4.6c-1 0-1.8-.3-2.5-.6zM6.8 9 6 8.3c-.4-.5-.5-.8-.5-1.6 0-.7.1-1.3.5-1.8.4-.6 1-1 1.6-1.3a6.3 6.3 0 0 1 4.7 0 4 4 0 0 1 1.7 1l.3.7c0 .1.2.4-.2.7-.4.2-.9.1-1 0a3 3 0 0 0-1.2-1c-.4-.2-1-.3-2-.4-.7 0-1.4.2-2 .6-.8.6-1 .8-1 1.5 0 .8.5 1 1.2 1.5.6.4 1.1.7 1.9 1H6.8z\"/><path d=\"M3 10.5V9h14v1.5z\"/></svg>");
  2744. /***/ }),
  2745. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/subscript.svg":
  2746. /*!*********************************************************************************!*\
  2747. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/subscript.svg ***!
  2748. \*********************************************************************************/
  2749. /*! exports provided: default */
  2750. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2751. "use strict";
  2752. __webpack_require__.r(__webpack_exports__);
  2753. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m7.03 10.349 3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82zm8.147 7.829h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309z\"/></svg>");
  2754. /***/ }),
  2755. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/superscript.svg":
  2756. /*!***********************************************************************************!*\
  2757. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/superscript.svg ***!
  2758. \***********************************************************************************/
  2759. /*! exports provided: default */
  2760. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2761. "use strict";
  2762. __webpack_require__.r(__webpack_exports__);
  2763. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M15.677 8.678h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309zM7.03 10.349l3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82z\"/></svg>");
  2764. /***/ }),
  2765. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/underline.svg":
  2766. /*!*********************************************************************************!*\
  2767. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/underline.svg ***!
  2768. \*********************************************************************************/
  2769. /*! exports provided: default */
  2770. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2771. "use strict";
  2772. __webpack_require__.r(__webpack_exports__);
  2773. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3 18v-1.5h14V18zm2.2-8V3.6c0-.4.4-.6.8-.6.3 0 .7.2.7.6v6.2c0 2 1.3 2.8 3.2 2.8 1.9 0 3.4-.9 3.4-2.9V3.6c0-.3.4-.5.8-.5.3 0 .7.2.7.5V10c0 2.7-2.2 4-4.9 4-2.6 0-4.7-1.2-4.7-4z\"/></svg>");
  2774. /***/ }),
  2775. /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js":
  2776. /*!************************************************************************!*\
  2777. !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js ***!
  2778. \************************************************************************/
  2779. /*! exports provided: default */
  2780. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2781. "use strict";
  2782. __webpack_require__.r(__webpack_exports__);
  2783. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockQuote; });
  2784. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2785. /* harmony import */ var _blockquoteediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./blockquoteediting */ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js");
  2786. /* harmony import */ var _blockquoteui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./blockquoteui */ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js");
  2787. /**
  2788. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2789. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2790. */
  2791. /**
  2792. * @module block-quote/blockquote
  2793. */
  2794. /**
  2795. * The block quote plugin.
  2796. *
  2797. * For more information about this feature check the {@glink api/block-quote package page}.
  2798. *
  2799. * This is a "glue" plugin which loads the {@link module:block-quote/blockquoteediting~BlockQuoteEditing block quote editing feature}
  2800. * and {@link module:block-quote/blockquoteui~BlockQuoteUI block quote UI feature}.
  2801. *
  2802. * @extends module:core/plugin~Plugin
  2803. */
  2804. class BlockQuote extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  2805. /**
  2806. * @inheritDoc
  2807. */
  2808. static get requires() {
  2809. return [ _blockquoteediting__WEBPACK_IMPORTED_MODULE_1__["default"], _blockquoteui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  2810. }
  2811. /**
  2812. * @inheritDoc
  2813. */
  2814. static get pluginName() {
  2815. return 'BlockQuote';
  2816. }
  2817. }
  2818. /***/ }),
  2819. /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js":
  2820. /*!*******************************************************************************!*\
  2821. !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js ***!
  2822. \*******************************************************************************/
  2823. /*! exports provided: default */
  2824. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2825. "use strict";
  2826. __webpack_require__.r(__webpack_exports__);
  2827. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockQuoteCommand; });
  2828. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  2829. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  2830. /**
  2831. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  2832. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2833. */
  2834. /**
  2835. * @module block-quote/blockquotecommand
  2836. */
  2837. /**
  2838. * The block quote command plugin.
  2839. *
  2840. * @extends module:core/command~Command
  2841. */
  2842. class BlockQuoteCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  2843. /**
  2844. * Whether the selection starts in a block quote.
  2845. *
  2846. * @observable
  2847. * @readonly
  2848. * @member {Boolean} #value
  2849. */
  2850. /**
  2851. * @inheritDoc
  2852. */
  2853. refresh() {
  2854. this.value = this._getValue();
  2855. this.isEnabled = this._checkEnabled();
  2856. }
  2857. /**
  2858. * Executes the command. When the command {@link #value is on}, all top-most block quotes within
  2859. * the selection will be removed. If it is off, all selected blocks will be wrapped with
  2860. * a block quote.
  2861. *
  2862. * @fires execute
  2863. * @param {Object} [options] Command options.
  2864. * @param {Boolean} [options.forceValue] If set, it will force the command behavior. If `true`, the command will apply a block quote,
  2865. * otherwise the command will remove the block quote. If not set, the command will act basing on its current value.
  2866. */
  2867. execute( options = {} ) {
  2868. const model = this.editor.model;
  2869. const schema = model.schema;
  2870. const selection = model.document.selection;
  2871. const blocks = Array.from( selection.getSelectedBlocks() );
  2872. const value = ( options.forceValue === undefined ) ? !this.value : options.forceValue;
  2873. model.change( writer => {
  2874. if ( !value ) {
  2875. this._removeQuote( writer, blocks.filter( findQuote ) );
  2876. } else {
  2877. const blocksToQuote = blocks.filter( block => {
  2878. // Already quoted blocks needs to be considered while quoting too
  2879. // in order to reuse their <bQ> elements.
  2880. return findQuote( block ) || checkCanBeQuoted( schema, block );
  2881. } );
  2882. this._applyQuote( writer, blocksToQuote );
  2883. }
  2884. } );
  2885. }
  2886. /**
  2887. * Checks the command's {@link #value}.
  2888. *
  2889. * @private
  2890. * @returns {Boolean} The current value.
  2891. */
  2892. _getValue() {
  2893. const selection = this.editor.model.document.selection;
  2894. const firstBlock = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( selection.getSelectedBlocks() );
  2895. // In the current implementation, the block quote must be an immediate parent of a block element.
  2896. return !!( firstBlock && findQuote( firstBlock ) );
  2897. }
  2898. /**
  2899. * Checks whether the command can be enabled in the current context.
  2900. *
  2901. * @private
  2902. * @returns {Boolean} Whether the command should be enabled.
  2903. */
  2904. _checkEnabled() {
  2905. if ( this.value ) {
  2906. return true;
  2907. }
  2908. const selection = this.editor.model.document.selection;
  2909. const schema = this.editor.model.schema;
  2910. const firstBlock = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( selection.getSelectedBlocks() );
  2911. if ( !firstBlock ) {
  2912. return false;
  2913. }
  2914. return checkCanBeQuoted( schema, firstBlock );
  2915. }
  2916. /**
  2917. * Removes the quote from given blocks.
  2918. *
  2919. * If blocks which are supposed to be "unquoted" are in the middle of a quote,
  2920. * start it or end it, then the quote will be split (if needed) and the blocks
  2921. * will be moved out of it, so other quoted blocks remained quoted.
  2922. *
  2923. * @private
  2924. * @param {module:engine/model/writer~Writer} writer
  2925. * @param {Array.<module:engine/model/element~Element>} blocks
  2926. */
  2927. _removeQuote( writer, blocks ) {
  2928. // Unquote all groups of block. Iterate in the reverse order to not break following ranges.
  2929. getRangesOfBlockGroups( writer, blocks ).reverse().forEach( groupRange => {
  2930. if ( groupRange.start.isAtStart && groupRange.end.isAtEnd ) {
  2931. writer.unwrap( groupRange.start.parent );
  2932. return;
  2933. }
  2934. // The group of blocks are at the beginning of an <bQ> so let's move them left (out of the <bQ>).
  2935. if ( groupRange.start.isAtStart ) {
  2936. const positionBefore = writer.createPositionBefore( groupRange.start.parent );
  2937. writer.move( groupRange, positionBefore );
  2938. return;
  2939. }
  2940. // The blocks are in the middle of an <bQ> so we need to split the <bQ> after the last block
  2941. // so we move the items there.
  2942. if ( !groupRange.end.isAtEnd ) {
  2943. writer.split( groupRange.end );
  2944. }
  2945. // Now we are sure that groupRange.end.isAtEnd is true, so let's move the blocks right.
  2946. const positionAfter = writer.createPositionAfter( groupRange.end.parent );
  2947. writer.move( groupRange, positionAfter );
  2948. } );
  2949. }
  2950. /**
  2951. * Applies the quote to given blocks.
  2952. *
  2953. * @private
  2954. * @param {module:engine/model/writer~Writer} writer
  2955. * @param {Array.<module:engine/model/element~Element>} blocks
  2956. */
  2957. _applyQuote( writer, blocks ) {
  2958. const quotesToMerge = [];
  2959. // Quote all groups of block. Iterate in the reverse order to not break following ranges.
  2960. getRangesOfBlockGroups( writer, blocks ).reverse().forEach( groupRange => {
  2961. let quote = findQuote( groupRange.start );
  2962. if ( !quote ) {
  2963. quote = writer.createElement( 'blockQuote' );
  2964. writer.wrap( groupRange, quote );
  2965. }
  2966. quotesToMerge.push( quote );
  2967. } );
  2968. // Merge subsequent <bQ> elements. Reverse the order again because this time we want to go through
  2969. // the <bQ> elements in the source order (due to how merge works – it moves the right element's content
  2970. // to the first element and removes the right one. Since we may need to merge a couple of subsequent `<bQ>` elements
  2971. // we want to keep the reference to the first (furthest left) one.
  2972. quotesToMerge.reverse().reduce( ( currentQuote, nextQuote ) => {
  2973. if ( currentQuote.nextSibling == nextQuote ) {
  2974. writer.merge( writer.createPositionAfter( currentQuote ) );
  2975. return currentQuote;
  2976. }
  2977. return nextQuote;
  2978. } );
  2979. }
  2980. }
  2981. function findQuote( elementOrPosition ) {
  2982. return elementOrPosition.parent.name == 'blockQuote' ? elementOrPosition.parent : null;
  2983. }
  2984. // Returns a minimal array of ranges containing groups of subsequent blocks.
  2985. //
  2986. // content: abcdefgh
  2987. // blocks: [ a, b, d, f, g, h ]
  2988. // output ranges: [ab]c[d]e[fgh]
  2989. //
  2990. // @param {Array.<module:engine/model/element~Element>} blocks
  2991. // @returns {Array.<module:engine/model/range~Range>}
  2992. function getRangesOfBlockGroups( writer, blocks ) {
  2993. let startPosition;
  2994. let i = 0;
  2995. const ranges = [];
  2996. while ( i < blocks.length ) {
  2997. const block = blocks[ i ];
  2998. const nextBlock = blocks[ i + 1 ];
  2999. if ( !startPosition ) {
  3000. startPosition = writer.createPositionBefore( block );
  3001. }
  3002. if ( !nextBlock || block.nextSibling != nextBlock ) {
  3003. ranges.push( writer.createRange( startPosition, writer.createPositionAfter( block ) ) );
  3004. startPosition = null;
  3005. }
  3006. i++;
  3007. }
  3008. return ranges;
  3009. }
  3010. // Checks whether <bQ> can wrap the block.
  3011. function checkCanBeQuoted( schema, block ) {
  3012. // TMP will be replaced with schema.checkWrap().
  3013. const isBQAllowed = schema.checkChild( block.parent, 'blockQuote' );
  3014. const isBlockAllowedInBQ = schema.checkChild( [ '$root', 'blockQuote' ], block );
  3015. return isBQAllowed && isBlockAllowedInBQ;
  3016. }
  3017. /***/ }),
  3018. /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js":
  3019. /*!*******************************************************************************!*\
  3020. !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js ***!
  3021. \*******************************************************************************/
  3022. /*! exports provided: default */
  3023. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3024. "use strict";
  3025. __webpack_require__.r(__webpack_exports__);
  3026. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockQuoteEditing; });
  3027. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  3028. /* harmony import */ var ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/enter */ "./node_modules/ckeditor5/src/enter.js");
  3029. /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
  3030. /* harmony import */ var _blockquotecommand__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./blockquotecommand */ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js");
  3031. /**
  3032. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3033. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3034. */
  3035. /**
  3036. * @module block-quote/blockquoteediting
  3037. */
  3038. /**
  3039. * The block quote editing.
  3040. *
  3041. * Introduces the `'blockQuote'` command and the `'blockQuote'` model element.
  3042. *
  3043. * @extends module:core/plugin~Plugin
  3044. */
  3045. class BlockQuoteEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  3046. /**
  3047. * @inheritDoc
  3048. */
  3049. static get pluginName() {
  3050. return 'BlockQuoteEditing';
  3051. }
  3052. /**
  3053. * @inheritDoc
  3054. */
  3055. static get requires() {
  3056. return [ ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_1__["Enter"], ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["Delete"] ];
  3057. }
  3058. /**
  3059. * @inheritDoc
  3060. */
  3061. init() {
  3062. const editor = this.editor;
  3063. const schema = editor.model.schema;
  3064. editor.commands.add( 'blockQuote', new _blockquotecommand__WEBPACK_IMPORTED_MODULE_3__["default"]( editor ) );
  3065. schema.register( 'blockQuote', {
  3066. allowWhere: '$block',
  3067. allowContentOf: '$root'
  3068. } );
  3069. editor.conversion.elementToElement( { model: 'blockQuote', view: 'blockquote' } );
  3070. // Postfixer which cleans incorrect model states connected with block quotes.
  3071. editor.model.document.registerPostFixer( writer => {
  3072. const changes = editor.model.document.differ.getChanges();
  3073. for ( const entry of changes ) {
  3074. if ( entry.type == 'insert' ) {
  3075. const element = entry.position.nodeAfter;
  3076. if ( !element ) {
  3077. // We are inside a text node.
  3078. continue;
  3079. }
  3080. if ( element.is( 'element', 'blockQuote' ) && element.isEmpty ) {
  3081. // Added an empty blockQuote - remove it.
  3082. writer.remove( element );
  3083. return true;
  3084. } else if ( element.is( 'element', 'blockQuote' ) && !schema.checkChild( entry.position, element ) ) {
  3085. // Added a blockQuote in incorrect place. Unwrap it so the content inside is not lost.
  3086. writer.unwrap( element );
  3087. return true;
  3088. } else if ( element.is( 'element' ) ) {
  3089. // Just added an element. Check that all children meet the scheme rules.
  3090. const range = writer.createRangeIn( element );
  3091. for ( const child of range.getItems() ) {
  3092. if (
  3093. child.is( 'element', 'blockQuote' ) &&
  3094. !schema.checkChild( writer.createPositionBefore( child ), child )
  3095. ) {
  3096. writer.unwrap( child );
  3097. return true;
  3098. }
  3099. }
  3100. }
  3101. } else if ( entry.type == 'remove' ) {
  3102. const parent = entry.position.parent;
  3103. if ( parent.is( 'element', 'blockQuote' ) && parent.isEmpty ) {
  3104. // Something got removed and now blockQuote is empty. Remove the blockQuote as well.
  3105. writer.remove( parent );
  3106. return true;
  3107. }
  3108. }
  3109. }
  3110. return false;
  3111. } );
  3112. const viewDocument = this.editor.editing.view.document;
  3113. const selection = editor.model.document.selection;
  3114. const blockQuoteCommand = editor.commands.get( 'blockQuote' );
  3115. // Overwrite default Enter key behavior.
  3116. // If Enter key is pressed with selection collapsed in empty block inside a quote, break the quote.
  3117. this.listenTo( viewDocument, 'enter', ( evt, data ) => {
  3118. if ( !selection.isCollapsed || !blockQuoteCommand.value ) {
  3119. return;
  3120. }
  3121. const positionParent = selection.getLastPosition().parent;
  3122. if ( positionParent.isEmpty ) {
  3123. editor.execute( 'blockQuote' );
  3124. editor.editing.view.scrollToTheSelection();
  3125. data.preventDefault();
  3126. evt.stop();
  3127. }
  3128. }, { context: 'blockquote' } );
  3129. // Overwrite default Backspace key behavior.
  3130. // If Backspace key is pressed with selection collapsed in first empty block inside a quote, break the quote.
  3131. this.listenTo( viewDocument, 'delete', ( evt, data ) => {
  3132. if ( data.direction != 'backward' || !selection.isCollapsed || !blockQuoteCommand.value ) {
  3133. return;
  3134. }
  3135. const positionParent = selection.getLastPosition().parent;
  3136. if ( positionParent.isEmpty && !positionParent.previousSibling ) {
  3137. editor.execute( 'blockQuote' );
  3138. editor.editing.view.scrollToTheSelection();
  3139. data.preventDefault();
  3140. evt.stop();
  3141. }
  3142. }, { context: 'blockquote' } );
  3143. }
  3144. }
  3145. /***/ }),
  3146. /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js":
  3147. /*!**************************************************************************!*\
  3148. !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js ***!
  3149. \**************************************************************************/
  3150. /*! exports provided: default */
  3151. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3152. "use strict";
  3153. __webpack_require__.r(__webpack_exports__);
  3154. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockQuoteUI; });
  3155. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  3156. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  3157. /* harmony import */ var _theme_blockquote_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/blockquote.css */ "./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css");
  3158. /**
  3159. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3160. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3161. */
  3162. /**
  3163. * @module block-quote/blockquoteui
  3164. */
  3165. /**
  3166. * The block quote UI plugin.
  3167. *
  3168. * It introduces the `'blockQuote'` button.
  3169. *
  3170. * @extends module:core/plugin~Plugin
  3171. */
  3172. class BlockQuoteUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  3173. /**
  3174. * @inheritDoc
  3175. */
  3176. static get pluginName() {
  3177. return 'BlockQuoteUI';
  3178. }
  3179. /**
  3180. * @inheritDoc
  3181. */
  3182. init() {
  3183. const editor = this.editor;
  3184. const t = editor.t;
  3185. editor.ui.componentFactory.add( 'blockQuote', locale => {
  3186. const command = editor.commands.get( 'blockQuote' );
  3187. const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  3188. buttonView.set( {
  3189. label: t( 'Block quote' ),
  3190. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].quote,
  3191. tooltip: true,
  3192. isToggleable: true
  3193. } );
  3194. // Bind button model to command.
  3195. buttonView.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  3196. // Execute command.
  3197. this.listenTo( buttonView, 'execute', () => {
  3198. editor.execute( 'blockQuote' );
  3199. editor.editing.view.focus();
  3200. } );
  3201. return buttonView;
  3202. } );
  3203. }
  3204. }
  3205. /***/ }),
  3206. /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css":
  3207. /*!***************************************************************************!*\
  3208. !*** ./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css ***!
  3209. \***************************************************************************/
  3210. /*! exports provided: default */
  3211. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3212. "use strict";
  3213. __webpack_require__.r(__webpack_exports__);
  3214. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  3215. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  3216. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_blockquote_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./blockquote.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css");
  3217. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  3218. options.insert = "head";
  3219. options.singleton = true;
  3220. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_blockquote_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  3221. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_blockquote_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  3222. /***/ }),
  3223. /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinder.js":
  3224. /*!*******************************************************************!*\
  3225. !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinder.js ***!
  3226. \*******************************************************************/
  3227. /*! exports provided: default */
  3228. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3229. "use strict";
  3230. __webpack_require__.r(__webpack_exports__);
  3231. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinder; });
  3232. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  3233. /* harmony import */ var _ckfinderui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ckfinderui */ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderui.js");
  3234. /* harmony import */ var _ckfinderediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ckfinderediting */ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderediting.js");
  3235. /**
  3236. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3237. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3238. */
  3239. /**
  3240. * @module ckfinder/ckfinder
  3241. */
  3242. /**
  3243. * The CKFinder feature, a bridge between the CKEditor 5 WYSIWYG editor and the
  3244. * [CKFinder](https://ckeditor.com/ckfinder) file manager and uploader.
  3245. *
  3246. * This is a "glue" plugin which enables:
  3247. *
  3248. * * {@link module:ckfinder/ckfinderediting~CKFinderEditing},
  3249. * * {@link module:ckfinder/ckfinderui~CKFinderUI},
  3250. * * {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter}.
  3251. *
  3252. * See the {@glink features/images/image-upload/ckfinder "CKFinder integration" guide} to learn how to configure
  3253. * and use this feature.
  3254. *
  3255. * Check out the {@glink features/images/image-upload/image-upload comprehensive "Image upload" guide} to learn about
  3256. * other ways to upload images into CKEditor 5.
  3257. *
  3258. * @extends module:core/plugin~Plugin
  3259. */
  3260. class CKFinder extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  3261. /**
  3262. * @inheritDoc
  3263. */
  3264. static get pluginName() {
  3265. return 'CKFinder';
  3266. }
  3267. /**
  3268. * @inheritDoc
  3269. */
  3270. static get requires() {
  3271. return [ 'Link', 'CKFinderUploadAdapter', _ckfinderediting__WEBPACK_IMPORTED_MODULE_2__["default"], _ckfinderui__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  3272. }
  3273. }
  3274. /**
  3275. * The configuration of the {@link module:ckfinder/ckfinder~CKFinder CKFinder feature}.
  3276. *
  3277. * Read more in {@link module:ckfinder/ckfinder~CKFinderConfig}.
  3278. *
  3279. * @member {module:ckfinder/ckfinder~CKFinderConfig} module:core/editor/editorconfig~EditorConfig#ckfinder
  3280. */
  3281. /**
  3282. * The configuration of the {@link module:ckfinder/ckfinder~CKFinder CKFinder feature}
  3283. * and its {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter upload adapter}.
  3284. *
  3285. * ClassicEditor
  3286. * .create( editorElement, {
  3287. * ckfinder: {
  3288. * options: {
  3289. * resourceType: 'Images'
  3290. * }
  3291. * }
  3292. * } )
  3293. * .then( ... )
  3294. * .catch( ... );
  3295. *
  3296. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  3297. *
  3298. * @interface CKFinderConfig
  3299. */
  3300. /**
  3301. * The configuration options passed to the CKFinder file manager instance.
  3302. *
  3303. * Check the file manager [documentation](https://ckeditor.com/docs/ckfinder/ckfinder3/#!/api/CKFinder.Config-cfg-language)
  3304. * for the complete list of options.
  3305. *
  3306. * @member {Object} module:ckfinder/ckfinder~CKFinderConfig#options
  3307. */
  3308. /**
  3309. * The type of the CKFinder opener method.
  3310. *
  3311. * Supported types are:
  3312. *
  3313. * * `'modal'` &ndash; Opens CKFinder in a modal,
  3314. * * `'popup'` &ndash; Opens CKFinder in a new "pop-up" window.
  3315. *
  3316. * Defaults to `'modal'`.
  3317. *
  3318. * @member {String} module:ckfinder/ckfinder~CKFinderConfig#openerMethod
  3319. */
  3320. /**
  3321. * The path (URL) to the connector which handles the file upload in CKFinder file manager.
  3322. * When specified, it enables the automatic upload of resources such as images inserted into the content.
  3323. *
  3324. * For instance, to use CKFinder's
  3325. * [quick upload](https://ckeditor.com/docs/ckfinder/ckfinder3-php/commands.html#command_quick_upload)
  3326. * command, your can use the following (or similar) path:
  3327. *
  3328. * ClassicEditor
  3329. * .create( editorElement, {
  3330. * ckfinder: {
  3331. * uploadUrl: '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files&responseType=json'
  3332. * }
  3333. * } )
  3334. * .then( ... )
  3335. * .catch( ... );
  3336. *
  3337. * Used by the {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter upload adapter}.
  3338. *
  3339. * @member {String} module:ckfinder/ckfinder~CKFinderConfig#uploadUrl
  3340. */
  3341. /***/ }),
  3342. /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfindercommand.js":
  3343. /*!**************************************************************************!*\
  3344. !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfindercommand.js ***!
  3345. \**************************************************************************/
  3346. /*! exports provided: default */
  3347. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3348. "use strict";
  3349. __webpack_require__.r(__webpack_exports__);
  3350. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinderCommand; });
  3351. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  3352. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  3353. /**
  3354. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3355. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3356. */
  3357. /* global window */
  3358. /**
  3359. * @module ckfinder/ckfindercommand
  3360. */
  3361. /**
  3362. * The CKFinder command. It is used by the {@link module:ckfinder/ckfinderediting~CKFinderEditing CKFinder editing feature}
  3363. * to open the CKFinder file manager to insert an image or a link to a file into the editor content.
  3364. *
  3365. * editor.execute( 'ckfinder' );
  3366. *
  3367. * **Note:** This command uses other features to perform tasks:
  3368. * - To insert images the {@link module:image/image/insertimagecommand~InsertImageCommand 'insertImage'} command
  3369. * from the {@link module:image/image~Image Image feature}.
  3370. * - To insert links to files the {@link module:link/linkcommand~LinkCommand 'link'} command
  3371. * from the {@link module:link/link~Link Link feature}.
  3372. *
  3373. * @extends module:core/command~Command
  3374. */
  3375. class CKFinderCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  3376. /**
  3377. * @inheritDoc
  3378. */
  3379. constructor( editor ) {
  3380. super( editor );
  3381. // Remove default document listener to lower its priority.
  3382. this.stopListening( this.editor.model.document, 'change' );
  3383. // Lower this command listener priority to be sure that refresh() will be called after link & image refresh.
  3384. this.listenTo( this.editor.model.document, 'change', () => this.refresh(), { priority: 'low' } );
  3385. }
  3386. /**
  3387. * @inheritDoc
  3388. */
  3389. refresh() {
  3390. const imageCommand = this.editor.commands.get( 'insertImage' );
  3391. const linkCommand = this.editor.commands.get( 'link' );
  3392. // The CKFinder command is enabled when one of image or link command is enabled.
  3393. this.isEnabled = imageCommand.isEnabled || linkCommand.isEnabled;
  3394. }
  3395. /**
  3396. * @inheritDoc
  3397. */
  3398. execute() {
  3399. const editor = this.editor;
  3400. const openerMethod = this.editor.config.get( 'ckfinder.openerMethod' ) || 'modal';
  3401. if ( openerMethod != 'popup' && openerMethod != 'modal' ) {
  3402. /**
  3403. * The `ckfinder.openerMethod` must be one of: "popup" or "modal".
  3404. *
  3405. * @error ckfinder-unknown-openermethod
  3406. */
  3407. throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["CKEditorError"]( 'ckfinder-unknown-openermethod', editor );
  3408. }
  3409. const options = this.editor.config.get( 'ckfinder.options' ) || {};
  3410. options.chooseFiles = true;
  3411. // Cache the user-defined onInit method
  3412. const originalOnInit = options.onInit;
  3413. // Pass the lang code to the CKFinder if not defined by user.
  3414. if ( !options.language ) {
  3415. options.language = editor.locale.uiLanguage;
  3416. }
  3417. // The onInit method allows to extend CKFinder's behavior. It is used to attach event listeners to file choosing related events.
  3418. options.onInit = finder => {
  3419. // Call original options.onInit if it was defined by user.
  3420. if ( originalOnInit ) {
  3421. originalOnInit( finder );
  3422. }
  3423. finder.on( 'files:choose', evt => {
  3424. const files = evt.data.files.toArray();
  3425. // Insert links
  3426. const links = files.filter( file => !file.isImage() );
  3427. const images = files.filter( file => file.isImage() );
  3428. for ( const linkFile of links ) {
  3429. editor.execute( 'link', linkFile.getUrl() );
  3430. }
  3431. const imagesUrls = [];
  3432. for ( const image of images ) {
  3433. const url = image.getUrl();
  3434. imagesUrls.push( url ? url : finder.request( 'file:getProxyUrl', { file: image } ) );
  3435. }
  3436. if ( imagesUrls.length ) {
  3437. insertImages( editor, imagesUrls );
  3438. }
  3439. } );
  3440. finder.on( 'file:choose:resizedImage', evt => {
  3441. const resizedUrl = evt.data.resizedUrl;
  3442. if ( !resizedUrl ) {
  3443. const notification = editor.plugins.get( 'Notification' );
  3444. const t = editor.locale.t;
  3445. notification.showWarning( t( 'Could not obtain resized image URL.' ), {
  3446. title: t( 'Selecting resized image failed' ),
  3447. namespace: 'ckfinder'
  3448. } );
  3449. return;
  3450. }
  3451. insertImages( editor, [ resizedUrl ] );
  3452. } );
  3453. };
  3454. window.CKFinder[ openerMethod ]( options );
  3455. }
  3456. }
  3457. function insertImages( editor, urls ) {
  3458. const imageCommand = editor.commands.get( 'insertImage' );
  3459. // Check if inserting an image is actually possible - it might be possible to only insert a link.
  3460. if ( !imageCommand.isEnabled ) {
  3461. const notification = editor.plugins.get( 'Notification' );
  3462. const t = editor.locale.t;
  3463. notification.showWarning( t( 'Could not insert image at the current position.' ), {
  3464. title: t( 'Inserting image failed' ),
  3465. namespace: 'ckfinder'
  3466. } );
  3467. return;
  3468. }
  3469. editor.execute( 'insertImage', { source: urls } );
  3470. }
  3471. /***/ }),
  3472. /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderediting.js":
  3473. /*!**************************************************************************!*\
  3474. !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderediting.js ***!
  3475. \**************************************************************************/
  3476. /*! exports provided: default */
  3477. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3478. "use strict";
  3479. __webpack_require__.r(__webpack_exports__);
  3480. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinderEditing; });
  3481. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  3482. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  3483. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  3484. /* harmony import */ var _ckfindercommand__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ckfindercommand */ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfindercommand.js");
  3485. /**
  3486. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3487. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3488. */
  3489. /**
  3490. * @module ckfinder/ckfinderediting
  3491. */
  3492. /**
  3493. * The CKFinder editing feature. It introduces the {@link module:ckfinder/ckfindercommand~CKFinderCommand CKFinder command}.
  3494. *
  3495. * @extends module:core/plugin~Plugin
  3496. */
  3497. class CKFinderEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  3498. /**
  3499. * @inheritDoc
  3500. */
  3501. static get pluginName() {
  3502. return 'CKFinderEditing';
  3503. }
  3504. /**
  3505. * @inheritDoc
  3506. */
  3507. static get requires() {
  3508. return [ ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Notification"], 'LinkEditing' ];
  3509. }
  3510. /**
  3511. * @inheritDoc
  3512. */
  3513. init() {
  3514. const editor = this.editor;
  3515. if ( !editor.plugins.has( 'ImageBlockEditing' ) && !editor.plugins.has( 'ImageInlineEditing' ) ) {
  3516. /**
  3517. * CKFinder requires at least one plugin providing support for images loaded in the editor. Please
  3518. * make sure either:
  3519. *
  3520. * * {@link module:image/image~Image} (which loads both types of images),
  3521. * * or {@link module:image/imageblock~ImageBlock},
  3522. * * or {@link module:image/imageinline~ImageInline}.
  3523. *
  3524. * is loaded in your editor configuration.
  3525. *
  3526. * @error ckfinder-missing-image-plugin
  3527. */
  3528. throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["CKEditorError"]( 'ckfinder-missing-image-plugin', editor );
  3529. }
  3530. editor.commands.add( 'ckfinder', new _ckfindercommand__WEBPACK_IMPORTED_MODULE_3__["default"]( editor ) );
  3531. }
  3532. }
  3533. /***/ }),
  3534. /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderui.js":
  3535. /*!*********************************************************************!*\
  3536. !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderui.js ***!
  3537. \*********************************************************************/
  3538. /*! exports provided: default */
  3539. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3540. "use strict";
  3541. __webpack_require__.r(__webpack_exports__);
  3542. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinderUI; });
  3543. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  3544. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  3545. /* harmony import */ var _theme_icons_browse_files_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/browse-files.svg */ "./node_modules/@ckeditor/ckeditor5-ckfinder/theme/icons/browse-files.svg");
  3546. /**
  3547. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3548. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3549. */
  3550. /**
  3551. * @module ckfinder/ckfinderui
  3552. */
  3553. /**
  3554. * The CKFinder UI plugin. It introduces the `'ckfinder'` toolbar button.
  3555. *
  3556. * @extends module:core/plugin~Plugin
  3557. */
  3558. class CKFinderUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  3559. /**
  3560. * @inheritDoc
  3561. */
  3562. static get pluginName() {
  3563. return 'CKFinderUI';
  3564. }
  3565. /**
  3566. * @inheritDoc
  3567. */
  3568. init() {
  3569. const editor = this.editor;
  3570. const componentFactory = editor.ui.componentFactory;
  3571. const t = editor.t;
  3572. componentFactory.add( 'ckfinder', locale => {
  3573. const command = editor.commands.get( 'ckfinder' );
  3574. const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  3575. button.set( {
  3576. label: t( 'Insert image or file' ),
  3577. icon: _theme_icons_browse_files_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  3578. tooltip: true
  3579. } );
  3580. button.bind( 'isEnabled' ).to( command );
  3581. button.on( 'execute', () => {
  3582. editor.execute( 'ckfinder' );
  3583. editor.editing.view.focus();
  3584. } );
  3585. return button;
  3586. } );
  3587. }
  3588. }
  3589. /***/ }),
  3590. /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/theme/icons/browse-files.svg":
  3591. /*!********************************************************************************!*\
  3592. !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/theme/icons/browse-files.svg ***!
  3593. \********************************************************************************/
  3594. /*! exports provided: default */
  3595. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3596. "use strict";
  3597. __webpack_require__.r(__webpack_exports__);
  3598. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.627 16.5zm5.873-.196zm0-7.001V8h-13v8.5h4.341c.191.54.457 1.044.785 1.5H2a1.5 1.5 0 0 1-1.5-1.5v-13A1.5 1.5 0 0 1 2 2h4.5a1.5 1.5 0 0 1 1.06.44L9.122 4H16a1.5 1.5 0 0 1 1.5 1.5v1A1.5 1.5 0 0 1 19 8v2.531a6.027 6.027 0 0 0-1.5-1.228zM16 6.5v-1H8.5l-2-2H2v13h1V8a1.5 1.5 0 0 1 1.5-1.5H16z\"/><path d=\"M14.5 19.5a5 5 0 1 1 0-10 5 5 0 0 1 0 10zM15 14v-2h-1v2h-2v1h2v2h1v-2h2v-1h-2z\"/></svg>");
  3599. /***/ }),
  3600. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js":
  3601. /*!*********************************************************************!*\
  3602. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js ***!
  3603. \*********************************************************************/
  3604. /*! exports provided: default */
  3605. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3606. "use strict";
  3607. __webpack_require__.r(__webpack_exports__);
  3608. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Clipboard; });
  3609. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  3610. /* harmony import */ var _clipboardpipeline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clipboardpipeline */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js");
  3611. /* harmony import */ var _dragdrop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dragdrop */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js");
  3612. /* harmony import */ var _pasteplaintext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pasteplaintext */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js");
  3613. /**
  3614. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3615. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3616. */
  3617. /**
  3618. * @module clipboard/clipboard
  3619. */
  3620. /**
  3621. * The clipboard feature.
  3622. *
  3623. * Read more about the clipboard integration in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
  3624. *
  3625. * This is a "glue" plugin which loads the following plugins:
  3626. * * {@link module:clipboard/clipboardpipeline~ClipboardPipeline}
  3627. * * {@link module:clipboard/dragdrop~DragDrop}
  3628. * * {@link module:clipboard/pasteplaintext~PastePlainText}
  3629. *
  3630. * @extends module:core/plugin~Plugin
  3631. */
  3632. class Clipboard extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  3633. /**
  3634. * @inheritDoc
  3635. */
  3636. static get pluginName() {
  3637. return 'Clipboard';
  3638. }
  3639. /**
  3640. * @inheritDoc
  3641. */
  3642. static get requires() {
  3643. return [ _clipboardpipeline__WEBPACK_IMPORTED_MODULE_1__["default"], _dragdrop__WEBPACK_IMPORTED_MODULE_2__["default"], _pasteplaintext__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  3644. }
  3645. }
  3646. /***/ }),
  3647. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js":
  3648. /*!*****************************************************************************!*\
  3649. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js ***!
  3650. \*****************************************************************************/
  3651. /*! exports provided: default */
  3652. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3653. "use strict";
  3654. __webpack_require__.r(__webpack_exports__);
  3655. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClipboardObserver; });
  3656. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  3657. /* harmony import */ var _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/eventinfo */ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js");
  3658. /* harmony import */ var _datatransfer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./datatransfer */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/datatransfer.js");
  3659. /**
  3660. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3661. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3662. */
  3663. /**
  3664. * @module clipboard/clipboardobserver
  3665. */
  3666. /**
  3667. * Clipboard events observer.
  3668. *
  3669. * Fires the following events:
  3670. *
  3671. * * {@link module:engine/view/document~Document#event:clipboardInput},
  3672. * * {@link module:engine/view/document~Document#event:paste},
  3673. * * {@link module:engine/view/document~Document#event:copy},
  3674. * * {@link module:engine/view/document~Document#event:cut},
  3675. * * {@link module:engine/view/document~Document#event:drop},
  3676. * * {@link module:engine/view/document~Document#event:dragover},
  3677. * * {@link module:engine/view/document~Document#event:dragging},
  3678. * * {@link module:engine/view/document~Document#event:dragstart},
  3679. * * {@link module:engine/view/document~Document#event:dragend},
  3680. * * {@link module:engine/view/document~Document#event:dragenter},
  3681. * * {@link module:engine/view/document~Document#event:dragleave}.
  3682. *
  3683. * **Note**: This observer is not available by default (ckeditor5-engine does not add it on its own).
  3684. * To make it available, it needs to be added to {@link module:engine/view/document~Document} by using
  3685. * the {@link module:engine/view/view~View#addObserver `View#addObserver()`} method. Alternatively, you can load the
  3686. * {@link module:clipboard/clipboard~Clipboard} plugin which adds this observer automatically (because it uses it).
  3687. *
  3688. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  3689. */
  3690. class ClipboardObserver extends _ckeditor_ckeditor5_engine_src_view_observer_domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  3691. constructor( view ) {
  3692. super( view );
  3693. const viewDocument = this.document;
  3694. this.domEventType = [ 'paste', 'copy', 'cut', 'drop', 'dragover', 'dragstart', 'dragend', 'dragenter', 'dragleave' ];
  3695. this.listenTo( viewDocument, 'paste', handleInput( 'clipboardInput' ), { priority: 'low' } );
  3696. this.listenTo( viewDocument, 'drop', handleInput( 'clipboardInput' ), { priority: 'low' } );
  3697. this.listenTo( viewDocument, 'dragover', handleInput( 'dragging' ), { priority: 'low' } );
  3698. function handleInput( type ) {
  3699. return ( evt, data ) => {
  3700. data.preventDefault();
  3701. const targetRanges = data.dropRange ? [ data.dropRange ] : null;
  3702. const eventInfo = new _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_1__["default"]( viewDocument, type );
  3703. viewDocument.fire( eventInfo, {
  3704. dataTransfer: data.dataTransfer,
  3705. method: evt.name,
  3706. targetRanges,
  3707. target: data.target
  3708. } );
  3709. // If CKEditor handled the input, do not bubble the original event any further.
  3710. // This helps external integrations recognize that fact and act accordingly.
  3711. // https://github.com/ckeditor/ckeditor5-upload/issues/92
  3712. if ( eventInfo.stop.called ) {
  3713. data.stopPropagation();
  3714. }
  3715. };
  3716. }
  3717. }
  3718. onDomEvent( domEvent ) {
  3719. const evtData = {
  3720. dataTransfer: new _datatransfer__WEBPACK_IMPORTED_MODULE_2__["default"]( domEvent.clipboardData ? domEvent.clipboardData : domEvent.dataTransfer )
  3721. };
  3722. if ( domEvent.type == 'drop' || domEvent.type == 'dragover' ) {
  3723. evtData.dropRange = getDropViewRange( this.view, domEvent );
  3724. }
  3725. this.fire( domEvent.type, domEvent, evtData );
  3726. }
  3727. }
  3728. function getDropViewRange( view, domEvent ) {
  3729. const domDoc = domEvent.target.ownerDocument;
  3730. const x = domEvent.clientX;
  3731. const y = domEvent.clientY;
  3732. let domRange;
  3733. // Webkit & Blink.
  3734. if ( domDoc.caretRangeFromPoint && domDoc.caretRangeFromPoint( x, y ) ) {
  3735. domRange = domDoc.caretRangeFromPoint( x, y );
  3736. }
  3737. // FF.
  3738. else if ( domEvent.rangeParent ) {
  3739. domRange = domDoc.createRange();
  3740. domRange.setStart( domEvent.rangeParent, domEvent.rangeOffset );
  3741. domRange.collapse( true );
  3742. }
  3743. if ( domRange ) {
  3744. return view.domConverter.domRangeToView( domRange );
  3745. }
  3746. return null;
  3747. }
  3748. /**
  3749. * Fired as a continuation of the {@link #event:paste} and {@link #event:drop} events.
  3750. *
  3751. * It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
  3752. *
  3753. * This event carries a `dataTransfer` object which comes from the clipboard and whose content should be processed
  3754. * and inserted into the editor.
  3755. *
  3756. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3757. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3758. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3759. * the observer must be added manually.
  3760. *
  3761. * @see module:clipboard/clipboardobserver~ClipboardObserver
  3762. * @see module:clipboard/clipboard~Clipboard
  3763. * @event module:engine/view/document~Document#event:clipboardInput
  3764. * @param {Object} data The event data.
  3765. * @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer The data transfer instance.
  3766. * @param {'paste'|'drop'} method Whether the event was triggered by a paste or drop operation.
  3767. * @param {module:engine/view/element~Element} target The tree view element representing the target.
  3768. * @param {Array.<module:engine/view/range~Range>} data.targetRanges Ranges which are the target of the operation
  3769. * (usually – into which the content should be inserted).
  3770. * If the clipboard input was triggered by a paste operation, this property is not set. If by a drop operation,
  3771. * then it is the drop position (which can be different than the selection at the moment of drop).
  3772. */
  3773. /**
  3774. * Fired when the user drags the content over one of the editing roots of the editor.
  3775. *
  3776. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3777. *
  3778. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3779. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3780. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3781. * the observer must be added manually.
  3782. *
  3783. * @see module:engine/view/document~Document#event:clipboardInput
  3784. * @event module:engine/view/document~Document#event:dragover
  3785. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3786. */
  3787. /**
  3788. * Fired when the user dropped the content into one of the editing roots of the editor.
  3789. *
  3790. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3791. *
  3792. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3793. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3794. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3795. * the observer must be added manually.
  3796. *
  3797. * @see module:engine/view/document~Document#event:clipboardInput
  3798. * @event module:engine/view/document~Document#event:drop
  3799. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3800. * @param {module:engine/view/range~Range} dropRange The position into which the content is dropped.
  3801. */
  3802. /**
  3803. * Fired when the user pasted the content into one of the editing roots of the editor.
  3804. *
  3805. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3806. *
  3807. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3808. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3809. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3810. * the observer must be added manually.
  3811. *
  3812. * @see module:engine/view/document~Document#event:clipboardInput
  3813. * @event module:engine/view/document~Document#event:paste
  3814. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3815. */
  3816. /**
  3817. * Fired when the user copied the content from one of the editing roots of the editor.
  3818. *
  3819. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3820. *
  3821. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3822. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3823. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3824. * the observer must be added manually.
  3825. *
  3826. * @see module:clipboard/clipboardobserver~ClipboardObserver
  3827. * @event module:engine/view/document~Document#event:copy
  3828. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3829. */
  3830. /**
  3831. * Fired when the user cut the content from one of the editing roots of the editor.
  3832. *
  3833. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3834. *
  3835. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3836. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3837. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3838. * the observer must be added manually.
  3839. *
  3840. * @see module:clipboard/clipboardobserver~ClipboardObserver
  3841. * @event module:engine/view/document~Document#event:cut
  3842. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3843. */
  3844. /**
  3845. * The value of the {@link module:engine/view/document~Document#event:paste},
  3846. * {@link module:engine/view/document~Document#event:copy} and {@link module:engine/view/document~Document#event:cut} events.
  3847. *
  3848. * In order to access the clipboard data, use the `dataTransfer` property.
  3849. *
  3850. * @class module:clipboard/clipboardobserver~ClipboardEventData
  3851. * @extends module:engine/view/observer/domeventdata~DomEventData
  3852. */
  3853. /**
  3854. * The data transfer instance.
  3855. *
  3856. * @readonly
  3857. * @member {module:clipboard/datatransfer~DataTransfer} module:clipboard/clipboardobserver~ClipboardEventData#dataTransfer
  3858. */
  3859. /**
  3860. * Fired as a continuation of the {@link #event:dragover} event.
  3861. *
  3862. * It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
  3863. *
  3864. * This event carries a `dataTransfer` object which comes from the clipboard and whose content should be processed
  3865. * and inserted into the editor.
  3866. *
  3867. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3868. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3869. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3870. * the observer must be added manually.
  3871. *
  3872. * @see module:clipboard/clipboardobserver~ClipboardObserver
  3873. * @see module:clipboard/clipboard~Clipboard
  3874. * @event module:engine/view/document~Document#event:dragging
  3875. * @param {Object} data The event data.
  3876. * @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer The data transfer instance.
  3877. * @param {module:engine/view/element~Element} target The tree view element representing the target.
  3878. * @param {Array.<module:engine/view/range~Range>} data.targetRanges Ranges which are the target of the operation
  3879. * (usually – into which the content should be inserted).
  3880. * It is the drop position (which can be different than the selection at the moment of drop).
  3881. */
  3882. /**
  3883. * Fired when the user starts dragging the content in one of the editing roots of the editor.
  3884. *
  3885. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3886. *
  3887. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3888. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3889. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3890. * the observer must be added manually.
  3891. *
  3892. * @see module:engine/view/document~Document#event:clipboardInput
  3893. * @event module:engine/view/document~Document#event:dragstart
  3894. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3895. */
  3896. /**
  3897. * Fired when the user ended dragging the content.
  3898. *
  3899. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3900. *
  3901. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3902. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3903. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3904. * the observer must be added manually.
  3905. *
  3906. * @see module:engine/view/document~Document#event:clipboardInput
  3907. * @event module:engine/view/document~Document#event:dragend
  3908. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3909. */
  3910. /**
  3911. * Fired when the user drags the content into one of the editing roots of the editor.
  3912. *
  3913. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3914. *
  3915. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3916. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3917. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3918. * the observer must be added manually.
  3919. *
  3920. * @see module:engine/view/document~Document#event:clipboardInput
  3921. * @event module:engine/view/document~Document#event:dragenter
  3922. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3923. */
  3924. /**
  3925. * Fired when the user drags the content out of one of the editing roots of the editor.
  3926. *
  3927. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  3928. *
  3929. * **Note**: This event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
  3930. * needs to be added to the {@link module:engine/view/document~Document} by using the {@link module:engine/view/view~View#addObserver}
  3931. * method. This is usually done by the {@link module:clipboard/clipboard~Clipboard} plugin, but if for some reason it is not loaded,
  3932. * the observer must be added manually.
  3933. *
  3934. * @see module:engine/view/document~Document#event:clipboardInput
  3935. * @event module:engine/view/document~Document#event:dragleave
  3936. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  3937. */
  3938. /***/ }),
  3939. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js":
  3940. /*!*****************************************************************************!*\
  3941. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js ***!
  3942. \*****************************************************************************/
  3943. /*! exports provided: default */
  3944. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3945. "use strict";
  3946. __webpack_require__.r(__webpack_exports__);
  3947. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClipboardPipeline; });
  3948. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  3949. /* harmony import */ var _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/eventinfo */ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js");
  3950. /* harmony import */ var _clipboardobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clipboardobserver */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js");
  3951. /* harmony import */ var _utils_plaintexttohtml__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/plaintexttohtml */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js");
  3952. /* harmony import */ var _utils_normalizeclipboarddata__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/normalizeclipboarddata */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js");
  3953. /* harmony import */ var _utils_viewtoplaintext_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/viewtoplaintext.js */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js");
  3954. /**
  3955. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  3956. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3957. */
  3958. /**
  3959. * @module clipboard/clipboardpipeline
  3960. */
  3961. // Input pipeline events overview:
  3962. //
  3963. // ┌──────────────────────┐ ┌──────────────────────┐
  3964. // │ view.Document │ │ view.Document │
  3965. // │ paste │ │ drop │
  3966. // └───────────┬──────────┘ └───────────┬──────────┘
  3967. // │ │
  3968. // └────────────────┌────────────────┘
  3969. // │
  3970. // ┌─────────V────────┐
  3971. // │ view.Document │ Retrieves text/html or text/plain from data.dataTransfer
  3972. // │ clipboardInput │ and processes it to view.DocumentFragment.
  3973. // └─────────┬────────┘
  3974. // │
  3975. // ┌───────────V───────────┐
  3976. // │ ClipboardPipeline │ Converts view.DocumentFragment to model.DocumentFragment.
  3977. // │ inputTransformation │
  3978. // └───────────┬───────────┘
  3979. // │
  3980. // ┌──────────V──────────┐
  3981. // │ ClipboardPipeline │ Calls model.insertContent().
  3982. // │ contentInsertion │
  3983. // └─────────────────────┘
  3984. //
  3985. //
  3986. // Output pipeline events overview:
  3987. //
  3988. // ┌──────────────────────┐ ┌──────────────────────┐
  3989. // │ view.Document │ │ view.Document │ Retrieves the selected model.DocumentFragment
  3990. // │ copy │ │ cut │ and converts it to view.DocumentFragment.
  3991. // └───────────┬──────────┘ └───────────┬──────────┘
  3992. // │ │
  3993. // └────────────────┌────────────────┘
  3994. // │
  3995. // ┌─────────V────────┐
  3996. // │ view.Document │ Processes view.DocumentFragment to text/html and text/plain
  3997. // │ clipboardOutput │ and stores the results in data.dataTransfer.
  3998. // └──────────────────┘
  3999. //
  4000. /**
  4001. * The clipboard pipeline feature. It is responsible for intercepting the `paste` and `drop` events and
  4002. * passing the pasted content through a series of events in order to insert it into the editor's content.
  4003. * It also handles the `cut` and `copy` events to fill the native clipboard with the serialized editor's data.
  4004. *
  4005. * # Input pipeline
  4006. *
  4007. * The behavior of the default handlers (all at a `low` priority):
  4008. *
  4009. * ## Event: `paste` or `drop`
  4010. *
  4011. * 1. Translates the event data.
  4012. * 2. Fires the {@link module:engine/view/document~Document#event:clipboardInput `view.Document#clipboardInput`} event.
  4013. *
  4014. * ## Event: `view.Document#clipboardInput`
  4015. *
  4016. * 1. If the `data.content` event field is already set (by some listener on a higher priority), it takes this content and fires the event
  4017. * from the last point.
  4018. * 2. Otherwise, it retrieves `text/html` or `text/plain` from `data.dataTransfer`.
  4019. * 3. Normalizes the raw data by applying simple filters on string data.
  4020. * 4. Processes the raw data to {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`} with the
  4021. * {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}.
  4022. * 5. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation
  4023. * `ClipboardPipeline#inputTransformation`} event with the view document fragment in the `data.content` event field.
  4024. *
  4025. * ## Event: `ClipboardPipeline#inputTransformation`
  4026. *
  4027. * 1. Converts {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`} from the `data.content` field to
  4028. * {@link module:engine/model/documentfragment~DocumentFragment `model.DocumentFragment`}.
  4029. * 2. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:contentInsertion `ClipboardPipeline#contentInsertion`}
  4030. * event with the model document fragment in the `data.content` event field.
  4031. * **Note**: The `ClipboardPipeline#contentInsertion` event is fired within a model change block to allow other handlers
  4032. * to run in the same block without post-fixers called in between (i.e., the selection post-fixer).
  4033. *
  4034. * ## Event: `ClipboardPipeline#contentInsertion`
  4035. *
  4036. * 1. Calls {@link module:engine/model/model~Model#insertContent `model.insertContent()`} to insert `data.content`
  4037. * at the current selection position.
  4038. *
  4039. * # Output pipeline
  4040. *
  4041. * The behavior of the default handlers (all at a `low` priority):
  4042. *
  4043. * ## Event: `copy`, `cut` or `dragstart`
  4044. *
  4045. * 1. Retrieves the selected {@link module:engine/model/documentfragment~DocumentFragment `model.DocumentFragment`} by calling
  4046. * {@link module:engine/model/model~Model#getSelectedContent `model#getSelectedContent()`}.
  4047. * 2. Converts the model document fragment to {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`}.
  4048. * 3. Fires the {@link module:engine/view/document~Document#event:clipboardOutput `view.Document#clipboardOutput`} event
  4049. * with the view document fragment in the `data.content` event field.
  4050. *
  4051. * ## Event: `view.Document#clipboardOutput`
  4052. *
  4053. * 1. Processes `data.content` to HTML and plain text with the
  4054. * {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}.
  4055. * 2. Updates the `data.dataTransfer` data for `text/html` and `text/plain` with the processed data.
  4056. * 3. For the `cut` method, calls {@link module:engine/model/model~Model#deleteContent `model.deleteContent()`}
  4057. * on the current selection.
  4058. *
  4059. * Read more about the clipboard integration in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
  4060. *
  4061. * @extends module:core/plugin~Plugin
  4062. */
  4063. class ClipboardPipeline extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  4064. /**
  4065. * @inheritDoc
  4066. */
  4067. static get pluginName() {
  4068. return 'ClipboardPipeline';
  4069. }
  4070. /**
  4071. * @inheritDoc
  4072. */
  4073. init() {
  4074. const editor = this.editor;
  4075. const view = editor.editing.view;
  4076. view.addObserver( _clipboardobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
  4077. this._setupPasteDrop();
  4078. this._setupCopyCut();
  4079. }
  4080. /**
  4081. * The clipboard paste pipeline.
  4082. *
  4083. * @private
  4084. */
  4085. _setupPasteDrop() {
  4086. const editor = this.editor;
  4087. const model = editor.model;
  4088. const view = editor.editing.view;
  4089. const viewDocument = view.document;
  4090. // Pasting and dropping is disabled when editor is in the read-only mode.
  4091. // See: https://github.com/ckeditor/ckeditor5-clipboard/issues/26.
  4092. this.listenTo( viewDocument, 'clipboardInput', evt => {
  4093. if ( editor.isReadOnly ) {
  4094. evt.stop();
  4095. }
  4096. }, { priority: 'highest' } );
  4097. this.listenTo( viewDocument, 'clipboardInput', ( evt, data ) => {
  4098. const dataTransfer = data.dataTransfer;
  4099. let content = data.content || '';
  4100. // Some feature could already inject content in the higher priority event handler (i.e., codeBlock).
  4101. if ( !content ) {
  4102. if ( dataTransfer.getData( 'text/html' ) ) {
  4103. content = Object(_utils_normalizeclipboarddata__WEBPACK_IMPORTED_MODULE_4__["default"])( dataTransfer.getData( 'text/html' ) );
  4104. } else if ( dataTransfer.getData( 'text/plain' ) ) {
  4105. content = Object(_utils_plaintexttohtml__WEBPACK_IMPORTED_MODULE_3__["default"])( dataTransfer.getData( 'text/plain' ) );
  4106. }
  4107. content = this.editor.data.htmlProcessor.toView( content );
  4108. }
  4109. const eventInfo = new _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_1__["default"]( this, 'inputTransformation' );
  4110. this.fire( eventInfo, {
  4111. content,
  4112. dataTransfer,
  4113. targetRanges: data.targetRanges,
  4114. method: data.method
  4115. } );
  4116. // If CKEditor handled the input, do not bubble the original event any further.
  4117. // This helps external integrations recognize this fact and act accordingly.
  4118. // https://github.com/ckeditor/ckeditor5-upload/issues/92
  4119. if ( eventInfo.stop.called ) {
  4120. evt.stop();
  4121. }
  4122. view.scrollToTheSelection();
  4123. }, { priority: 'low' } );
  4124. this.listenTo( this, 'inputTransformation', ( evt, data ) => {
  4125. if ( data.content.isEmpty ) {
  4126. return;
  4127. }
  4128. const dataController = this.editor.data;
  4129. // Convert the pasted content into a model document fragment.
  4130. // The conversion is contextual, but in this case an "all allowed" context is needed
  4131. // and for that we use the $clipboardHolder item.
  4132. const modelFragment = dataController.toModel( data.content, '$clipboardHolder' );
  4133. if ( modelFragment.childCount == 0 ) {
  4134. return;
  4135. }
  4136. evt.stop();
  4137. // Fire content insertion event in a single change block to allow other handlers to run in the same block
  4138. // without post-fixers called in between (i.e., the selection post-fixer).
  4139. model.change( () => {
  4140. this.fire( 'contentInsertion', {
  4141. content: modelFragment,
  4142. method: data.method,
  4143. dataTransfer: data.dataTransfer,
  4144. targetRanges: data.targetRanges
  4145. } );
  4146. } );
  4147. }, { priority: 'low' } );
  4148. this.listenTo( this, 'contentInsertion', ( evt, data ) => {
  4149. data.resultRange = model.insertContent( data.content );
  4150. }, { priority: 'low' } );
  4151. }
  4152. /**
  4153. * The clipboard copy/cut pipeline.
  4154. *
  4155. * @private
  4156. */
  4157. _setupCopyCut() {
  4158. const editor = this.editor;
  4159. const modelDocument = editor.model.document;
  4160. const view = editor.editing.view;
  4161. const viewDocument = view.document;
  4162. function onCopyCut( evt, data ) {
  4163. const dataTransfer = data.dataTransfer;
  4164. data.preventDefault();
  4165. const content = editor.data.toView( editor.model.getSelectedContent( modelDocument.selection ) );
  4166. viewDocument.fire( 'clipboardOutput', { dataTransfer, content, method: evt.name } );
  4167. }
  4168. this.listenTo( viewDocument, 'copy', onCopyCut, { priority: 'low' } );
  4169. this.listenTo( viewDocument, 'cut', ( evt, data ) => {
  4170. // Cutting is disabled when editor is in the read-only mode.
  4171. // See: https://github.com/ckeditor/ckeditor5-clipboard/issues/26.
  4172. if ( editor.isReadOnly ) {
  4173. data.preventDefault();
  4174. } else {
  4175. onCopyCut( evt, data );
  4176. }
  4177. }, { priority: 'low' } );
  4178. this.listenTo( viewDocument, 'clipboardOutput', ( evt, data ) => {
  4179. if ( !data.content.isEmpty ) {
  4180. data.dataTransfer.setData( 'text/html', this.editor.data.htmlProcessor.toData( data.content ) );
  4181. data.dataTransfer.setData( 'text/plain', Object(_utils_viewtoplaintext_js__WEBPACK_IMPORTED_MODULE_5__["default"])( data.content ) );
  4182. }
  4183. if ( data.method == 'cut' ) {
  4184. editor.model.deleteContent( modelDocument.selection );
  4185. }
  4186. }, { priority: 'low' } );
  4187. }
  4188. }
  4189. /**
  4190. * Fired with the `content`, `dataTransfer`, `method`, and `targetRanges` properties:
  4191. *
  4192. * * The `content` which comes from the clipboard (it was pasted or dropped) should be processed in order to be inserted into the editor.
  4193. * * The `dataTransfer` object is available in case the transformation functions need access to the raw clipboard data.
  4194. * * The `method` indicates the original DOM event (for example `'drop'` or `'paste'`).
  4195. * * The `targetRanges` property is an array of view ranges (it is available only for `'drop'`).
  4196. *
  4197. * It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
  4198. *
  4199. * **Note**: You should not stop this event if you want to change the input data. You should modify the `content` property instead.
  4200. *
  4201. * @see module:clipboard/clipboardobserver~ClipboardObserver
  4202. * @see module:clipboard/clipboardpipeline~ClipboardPipeline
  4203. * @event module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation
  4204. * @param {Object} data The event data.
  4205. * @param {module:engine/view/documentfragment~DocumentFragment} data.content The event data. The content to be inserted into the editor.
  4206. * It can be modified by event listeners. Read more about the clipboard pipelines in
  4207. * the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
  4208. * @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer The data transfer instance.
  4209. * @param {'paste'|'drop'} data.method Whether the event was triggered by a paste or drop operation.
  4210. * @param {Array.<module:engine/view/range~Range>} data.targetRanges The target drop ranges.
  4211. */
  4212. /**
  4213. * Fired with the `content`, `dataTransfer`, `method`, and `targetRanges` properties:
  4214. *
  4215. * * The `content` which comes from the clipboard (was pasted or dropped) should be processed in order to be inserted into the editor.
  4216. * * The `dataTransfer` object is available in case the transformation functions need access to the raw clipboard data.
  4217. * * The `method` indicates the original DOM event (for example `'drop'` or `'paste'`).
  4218. * * The `targetRanges` property is an array of view ranges (it is available only for `'drop'`).
  4219. *
  4220. * Event handlers can modify the content according to the final insertion position.
  4221. *
  4222. * It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
  4223. *
  4224. * **Note**: You should not stop this event if you want to change the input data. You should modify the `content` property instead.
  4225. *
  4226. * @see module:clipboard/clipboardobserver~ClipboardObserver
  4227. * @see module:clipboard/clipboardpipeline~ClipboardPipeline
  4228. * @see module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation
  4229. * @event module:clipboard/clipboardpipeline~ClipboardPipeline#event:contentInsertion
  4230. * @param {Object} data The event data.
  4231. * @param {module:engine/model/documentfragment~DocumentFragment} data.content The event data. The content to be inserted into the editor.
  4232. * Read more about the clipboard pipelines in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
  4233. * @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer The data transfer instance.
  4234. * @param {'paste'|'drop'} data.method Whether the event was triggered by a paste or drop operation.
  4235. * @param {Array.<module:engine/view/range~Range>} data.targetRanges The target drop ranges.
  4236. * @param {module:engine/model/range~Range} data.resultRange The result of the `model.insertContent()` call
  4237. * (inserted by the event handler at a low priority).
  4238. */
  4239. /**
  4240. * Fired on {@link module:engine/view/document~Document#event:copy} and {@link module:engine/view/document~Document#event:cut}
  4241. * with a copy of the selected content. The content can be processed before it ends up in the clipboard.
  4242. *
  4243. * It is a part of the {@glink framework/guides/deep-dive/clipboard#output-pipeline clipboard output pipeline}.
  4244. *
  4245. * @see module:clipboard/clipboardobserver~ClipboardObserver
  4246. * @see module:clipboard/clipboardpipeline~ClipboardPipeline
  4247. * @event module:engine/view/document~Document#event:clipboardOutput
  4248. * @param {module:clipboard/clipboardpipeline~ClipboardOutputEventData} data The event data.
  4249. */
  4250. /**
  4251. * The value of the {@link module:engine/view/document~Document#event:clipboardOutput} event.
  4252. *
  4253. * @class module:clipboard/clipboardpipeline~ClipboardOutputEventData
  4254. */
  4255. /**
  4256. * The data transfer instance.
  4257. *
  4258. * @readonly
  4259. * @member {module:clipboard/datatransfer~DataTransfer} module:clipboard/clipboardpipeline~ClipboardOutputEventData#dataTransfer
  4260. */
  4261. /**
  4262. * Content to be put into the clipboard. It can be modified by the event listeners.
  4263. * Read more about the clipboard pipelines in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
  4264. *
  4265. * @member {module:engine/view/documentfragment~DocumentFragment} module:clipboard/clipboardpipeline~ClipboardOutputEventData#content
  4266. */
  4267. /**
  4268. * Whether the event was triggered by a copy or cut operation.
  4269. *
  4270. * @member {'copy'|'cut'} module:clipboard/clipboardpipeline~ClipboardOutputEventData#method
  4271. */
  4272. /***/ }),
  4273. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/datatransfer.js":
  4274. /*!************************************************************************!*\
  4275. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/datatransfer.js ***!
  4276. \************************************************************************/
  4277. /*! exports provided: default */
  4278. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4279. "use strict";
  4280. __webpack_require__.r(__webpack_exports__);
  4281. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DataTransfer; });
  4282. /**
  4283. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  4284. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4285. */
  4286. /**
  4287. * @module clipboard/datatransfer
  4288. */
  4289. /**
  4290. * A facade over the native [`DataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) object.
  4291. */
  4292. class DataTransfer {
  4293. constructor( nativeDataTransfer ) {
  4294. /**
  4295. * The array of files created from the native `DataTransfer#files` or `DataTransfer#items`.
  4296. *
  4297. * @readonly
  4298. * @member {Array.<File>} #files
  4299. */
  4300. this.files = getFiles( nativeDataTransfer );
  4301. /**
  4302. * The native DataTransfer object.
  4303. *
  4304. * @private
  4305. * @member {DataTransfer} #_native
  4306. */
  4307. this._native = nativeDataTransfer;
  4308. }
  4309. /**
  4310. * Returns an array of available native content types.
  4311. *
  4312. * @returns {Array.<String>}
  4313. */
  4314. get types() {
  4315. return this._native.types;
  4316. }
  4317. /**
  4318. * Gets the data from the data transfer by its MIME type.
  4319. *
  4320. * dataTransfer.getData( 'text/plain' );
  4321. *
  4322. * @param {String} type The MIME type. E.g. `text/html` or `text/plain`.
  4323. * @returns {String}
  4324. */
  4325. getData( type ) {
  4326. return this._native.getData( type );
  4327. }
  4328. /**
  4329. * Sets the data in the data transfer.
  4330. *
  4331. * @param {String} type The MIME type. E.g. `text/html` or `text/plain`.
  4332. * @param {String} data
  4333. */
  4334. setData( type, data ) {
  4335. this._native.setData( type, data );
  4336. }
  4337. /**
  4338. * The effect that is allowed for a drag operation.
  4339. *
  4340. * @param {String} value
  4341. */
  4342. set effectAllowed( value ) {
  4343. this._native.effectAllowed = value;
  4344. }
  4345. get effectAllowed() {
  4346. return this._native.effectAllowed;
  4347. }
  4348. /**
  4349. * The actual drop effect.
  4350. *
  4351. * @param {String} value
  4352. */
  4353. set dropEffect( value ) {
  4354. this._native.dropEffect = value;
  4355. }
  4356. get dropEffect() {
  4357. return this._native.dropEffect;
  4358. }
  4359. /**
  4360. * Whether the dragging operation was canceled.
  4361. *
  4362. * @returns {Boolean}
  4363. */
  4364. get isCanceled() {
  4365. return this._native.dropEffect == 'none' || !!this._native.mozUserCancelled;
  4366. }
  4367. }
  4368. function getFiles( nativeDataTransfer ) {
  4369. // DataTransfer.files and items are array-like and might not have an iterable interface.
  4370. const files = Array.from( nativeDataTransfer.files || [] );
  4371. const items = Array.from( nativeDataTransfer.items || [] );
  4372. if ( files.length ) {
  4373. return files;
  4374. }
  4375. // Chrome has empty DataTransfer.files, but allows getting files through the items interface.
  4376. return items
  4377. .filter( item => item.kind === 'file' )
  4378. .map( item => item.getAsFile() );
  4379. }
  4380. /***/ }),
  4381. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js":
  4382. /*!********************************************************************!*\
  4383. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js ***!
  4384. \********************************************************************/
  4385. /*! exports provided: default */
  4386. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4387. "use strict";
  4388. __webpack_require__.r(__webpack_exports__);
  4389. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DragDrop; });
  4390. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  4391. /* harmony import */ var _ckeditor_ckeditor5_engine_src_model_liverange__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/model/liverange */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js");
  4392. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/mouseobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js");
  4393. /* harmony import */ var _ckeditor_ckeditor5_widget_src_widget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget/src/widget */ "./node_modules/@ckeditor/ckeditor5-widget/src/widget.js");
  4394. /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  4395. /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  4396. /* harmony import */ var _ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget/src/utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  4397. /* harmony import */ var _clipboardpipeline__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./clipboardpipeline */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js");
  4398. /* harmony import */ var _clipboardobserver__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./clipboardobserver */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js");
  4399. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  4400. /* harmony import */ var _theme_clipboard_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../theme/clipboard.css */ "./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css");
  4401. /**
  4402. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  4403. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4404. */
  4405. /**
  4406. * @module clipboard/dragdrop
  4407. */
  4408. /* globals setTimeout, clearTimeout */
  4409. // Drag and drop events overview:
  4410. //
  4411. // ┌──────────────────┐
  4412. // │ mousedown │ Sets the draggable attribute.
  4413. // └─────────┬────────┘
  4414. // │
  4415. // └─────────────────────┐
  4416. // │ │
  4417. // │ ┌─────────V────────┐
  4418. // │ │ mouseup │ Dragging did not start, removes the draggable attribute.
  4419. // │ └──────────────────┘
  4420. // │
  4421. // ┌─────────V────────┐ Retrieves the selected model.DocumentFragment
  4422. // │ dragstart │ and converts it to view.DocumentFragment.
  4423. // └─────────┬────────┘
  4424. // │
  4425. // ┌─────────V────────┐ Processes view.DocumentFragment to text/html and text/plain
  4426. // │ clipboardOutput │ and stores the results in data.dataTransfer.
  4427. // └─────────┬────────┘
  4428. // │
  4429. // │ DOM dragover
  4430. // ┌────────────┐
  4431. // │ │
  4432. // ┌─────────V────────┐ │
  4433. // │ dragging │ │ Updates the drop target marker.
  4434. // └─────────┬────────┘ │
  4435. // │ │
  4436. // ┌─────────────└────────────┘
  4437. // │ │ │
  4438. // │ ┌─────────V────────┐ │
  4439. // │ │ dragleave │ │ Removes the drop target marker.
  4440. // │ └─────────┬────────┘ │
  4441. // │ │ │
  4442. // ┌───│─────────────┘ │
  4443. // │ │ │ │
  4444. // │ │ ┌─────────V────────┐ │
  4445. // │ │ │ dragenter │ │ Focuses the editor view.
  4446. // │ │ └─────────┬────────┘ │
  4447. // │ │ │ │
  4448. // │ │ └────────────┘
  4449. // │ │
  4450. // │ └─────────────┐
  4451. // │ │ │
  4452. // │ │ ┌─────────V────────┐
  4453. // └───┐ │ drop │ (The default handler of the clipboard pipeline).
  4454. // │ └─────────┬────────┘
  4455. // │ │
  4456. // │ ┌─────────V────────┐ Resolves the final data.targetRanges.
  4457. // │ │ clipboardInput │ Aborts if dropping on dragged content.
  4458. // │ └─────────┬────────┘
  4459. // │ │
  4460. // │ ┌─────────V────────┐
  4461. // │ │ clipboardInput │ (The default handler of the clipboard pipeline).
  4462. // │ └─────────┬────────┘
  4463. // │ │
  4464. // │ ┌───────────V───────────┐
  4465. // │ │ inputTransformation │ (The default handler of the clipboard pipeline).
  4466. // │ └───────────┬───────────┘
  4467. // │ │
  4468. // │ ┌──────────V──────────┐
  4469. // │ │ contentInsertion │ Updates the document selection to drop range.
  4470. // │ └──────────┬──────────┘
  4471. // │ │
  4472. // │ ┌──────────V──────────┐
  4473. // │ │ contentInsertion │ (The default handler of the clipboard pipeline).
  4474. // │ └──────────┬──────────┘
  4475. // │ │
  4476. // │ ┌──────────V──────────┐
  4477. // │ │ contentInsertion │ Removes the content from the original range if the insertion was successful.
  4478. // │ └──────────┬──────────┘
  4479. // │ │
  4480. // └─────────────┐
  4481. // │
  4482. // ┌─────────V────────┐
  4483. // │ dragend │ Removes the drop marker and cleans the state.
  4484. // └──────────────────┘
  4485. //
  4486. /**
  4487. * The drag and drop feature. It works on top of the {@link module:clipboard/clipboardpipeline~ClipboardPipeline}.
  4488. *
  4489. * Read more about the clipboard integration in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}.
  4490. *
  4491. * @extends module:core/plugin~Plugin
  4492. */
  4493. class DragDrop extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  4494. /**
  4495. * @inheritDoc
  4496. */
  4497. static get pluginName() {
  4498. return 'DragDrop';
  4499. }
  4500. /**
  4501. * @inheritDoc
  4502. */
  4503. static get requires() {
  4504. return [ _clipboardpipeline__WEBPACK_IMPORTED_MODULE_7__["default"], _ckeditor_ckeditor5_widget_src_widget__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  4505. }
  4506. /**
  4507. * @inheritDoc
  4508. */
  4509. init() {
  4510. const editor = this.editor;
  4511. const view = editor.editing.view;
  4512. /**
  4513. * The live range over the original content that is being dragged.
  4514. *
  4515. * @private
  4516. * @type {module:engine/model/liverange~LiveRange}
  4517. */
  4518. this._draggedRange = null;
  4519. /**
  4520. * The UID of current dragging that is used to verify if the drop started in the same editor as the drag start.
  4521. *
  4522. * **Note**: This is a workaround for broken 'dragend' events (they are not fired if the source text node got removed).
  4523. *
  4524. * @private
  4525. * @type {String}
  4526. */
  4527. this._draggingUid = '';
  4528. /**
  4529. * The reference to the model element that currently has a `draggable` attribute set (it is set while dragging).
  4530. *
  4531. * @private
  4532. * @type {module:engine/model/element~Element}
  4533. */
  4534. this._draggableElement = null;
  4535. /**
  4536. * A throttled callback updating the drop marker.
  4537. *
  4538. * @private
  4539. * @type {Function}
  4540. */
  4541. this._updateDropMarkerThrottled = Object(lodash_es__WEBPACK_IMPORTED_MODULE_9__["throttle"])( targetRange => this._updateDropMarker( targetRange ), 40 );
  4542. /**
  4543. * A delayed callback removing the drop marker.
  4544. *
  4545. * @private
  4546. * @type {Function}
  4547. */
  4548. this._removeDropMarkerDelayed = delay( () => this._removeDropMarker(), 40 );
  4549. /**
  4550. * A delayed callback removing draggable attributes.
  4551. *
  4552. * @private
  4553. * @type {Function}
  4554. */
  4555. this._clearDraggableAttributesDelayed = delay( () => this._clearDraggableAttributes(), 40 );
  4556. view.addObserver( _clipboardobserver__WEBPACK_IMPORTED_MODULE_8__["default"] );
  4557. view.addObserver( _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
  4558. this._setupDragging();
  4559. this._setupContentInsertionIntegration();
  4560. this._setupClipboardInputIntegration();
  4561. this._setupDropMarker();
  4562. this._setupDraggableAttributeHandling();
  4563. this.listenTo( editor, 'change:isReadOnly', ( evt, name, isReadOnly ) => {
  4564. if ( isReadOnly ) {
  4565. this.forceDisabled( 'readOnlyMode' );
  4566. } else {
  4567. this.clearForceDisabled( 'readOnlyMode' );
  4568. }
  4569. } );
  4570. this.on( 'change:isEnabled', ( evt, name, isEnabled ) => {
  4571. if ( !isEnabled ) {
  4572. this._finalizeDragging( false );
  4573. }
  4574. } );
  4575. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isAndroid ) {
  4576. this.forceDisabled( 'noAndroidSupport' );
  4577. }
  4578. }
  4579. /**
  4580. * @inheritDoc
  4581. */
  4582. destroy() {
  4583. if ( this._draggedRange ) {
  4584. this._draggedRange.detach();
  4585. this._draggedRange = null;
  4586. }
  4587. this._updateDropMarkerThrottled.cancel();
  4588. this._removeDropMarkerDelayed.cancel();
  4589. this._clearDraggableAttributesDelayed.cancel();
  4590. return super.destroy();
  4591. }
  4592. /**
  4593. * Drag and drop events handling.
  4594. *
  4595. * @private
  4596. */
  4597. _setupDragging() {
  4598. const editor = this.editor;
  4599. const model = editor.model;
  4600. const modelDocument = model.document;
  4601. const view = editor.editing.view;
  4602. const viewDocument = view.document;
  4603. // The handler for the drag start; it is responsible for setting data transfer object.
  4604. this.listenTo( viewDocument, 'dragstart', ( evt, data ) => {
  4605. const selection = modelDocument.selection;
  4606. // Don't drag the editable element itself.
  4607. if ( data.target && data.target.is( 'editableElement' ) ) {
  4608. data.preventDefault();
  4609. return;
  4610. }
  4611. // TODO we could clone this node somewhere and style it to match editing view but without handles,
  4612. // selection outline, WTA buttons, etc.
  4613. // data.dataTransfer._native.setDragImage( data.domTarget, 0, 0 );
  4614. // Check if this is dragstart over the widget (but not a nested editable).
  4615. const draggableWidget = data.target ? findDraggableWidget( data.target ) : null;
  4616. if ( draggableWidget ) {
  4617. const modelElement = editor.editing.mapper.toModelElement( draggableWidget );
  4618. this._draggedRange = _ckeditor_ckeditor5_engine_src_model_liverange__WEBPACK_IMPORTED_MODULE_1__["default"].fromRange( model.createRangeOn( modelElement ) );
  4619. // Disable toolbars so they won't obscure the drop area.
  4620. if ( editor.plugins.has( 'WidgetToolbarRepository' ) ) {
  4621. editor.plugins.get( 'WidgetToolbarRepository' ).forceDisabled( 'dragDrop' );
  4622. }
  4623. }
  4624. // If this was not a widget we should check if we need to drag some text content.
  4625. else if ( !viewDocument.selection.isCollapsed ) {
  4626. const selectedElement = viewDocument.selection.getSelectedElement();
  4627. if ( !selectedElement || !Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( selectedElement ) ) {
  4628. this._draggedRange = _ckeditor_ckeditor5_engine_src_model_liverange__WEBPACK_IMPORTED_MODULE_1__["default"].fromRange( selection.getFirstRange() );
  4629. }
  4630. }
  4631. if ( !this._draggedRange ) {
  4632. data.preventDefault();
  4633. return;
  4634. }
  4635. this._draggingUid = Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_4__["default"])();
  4636. data.dataTransfer.effectAllowed = this.isEnabled ? 'copyMove' : 'copy';
  4637. data.dataTransfer.setData( 'application/ckeditor5-dragging-uid', this._draggingUid );
  4638. const draggedSelection = model.createSelection( this._draggedRange.toRange() );
  4639. const content = editor.data.toView( model.getSelectedContent( draggedSelection ) );
  4640. viewDocument.fire( 'clipboardOutput', { dataTransfer: data.dataTransfer, content, method: evt.name } );
  4641. if ( !this.isEnabled ) {
  4642. this._draggedRange.detach();
  4643. this._draggedRange = null;
  4644. this._draggingUid = '';
  4645. }
  4646. }, { priority: 'low' } );
  4647. // The handler for finalizing drag and drop. It should always be triggered after dragging completes
  4648. // even if it was completed in a different application.
  4649. // Note: This is not fired if source text node got removed while downcasting a marker.
  4650. this.listenTo( viewDocument, 'dragend', ( evt, data ) => {
  4651. this._finalizeDragging( !data.dataTransfer.isCanceled && data.dataTransfer.dropEffect == 'move' );
  4652. }, { priority: 'low' } );
  4653. // Dragging over the editable.
  4654. this.listenTo( viewDocument, 'dragenter', () => {
  4655. if ( !this.isEnabled ) {
  4656. return;
  4657. }
  4658. view.focus();
  4659. } );
  4660. // Dragging out of the editable.
  4661. this.listenTo( viewDocument, 'dragleave', () => {
  4662. // We do not know if the mouse left the editor or just some element in it, so let us wait a few milliseconds
  4663. // to check if 'dragover' is not fired.
  4664. this._removeDropMarkerDelayed();
  4665. } );
  4666. // Handler for moving dragged content over the target area.
  4667. this.listenTo( viewDocument, 'dragging', ( evt, data ) => {
  4668. if ( !this.isEnabled ) {
  4669. data.dataTransfer.dropEffect = 'none';
  4670. return;
  4671. }
  4672. this._removeDropMarkerDelayed.cancel();
  4673. const targetRange = findDropTargetRange( editor, data.targetRanges, data.target );
  4674. // If this is content being dragged from another editor, moving out of current editor instance
  4675. // is not possible until 'dragend' event case will be fixed.
  4676. if ( !this._draggedRange ) {
  4677. data.dataTransfer.dropEffect = 'copy';
  4678. }
  4679. // In Firefox it is already set and effect allowed remains the same as originally set.
  4680. if ( !_ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isGecko ) {
  4681. if ( data.dataTransfer.effectAllowed == 'copy' ) {
  4682. data.dataTransfer.dropEffect = 'copy';
  4683. } else if ( [ 'all', 'copyMove' ].includes( data.dataTransfer.effectAllowed ) ) {
  4684. data.dataTransfer.dropEffect = 'move';
  4685. }
  4686. }
  4687. /* istanbul ignore else */
  4688. if ( targetRange ) {
  4689. this._updateDropMarkerThrottled( targetRange );
  4690. }
  4691. }, { priority: 'low' } );
  4692. }
  4693. /**
  4694. * Integration with the `clipboardInput` event.
  4695. *
  4696. * @private
  4697. */
  4698. _setupClipboardInputIntegration() {
  4699. const editor = this.editor;
  4700. const view = editor.editing.view;
  4701. const viewDocument = view.document;
  4702. // Update the event target ranges and abort dropping if dropping over itself.
  4703. this.listenTo( viewDocument, 'clipboardInput', ( evt, data ) => {
  4704. if ( data.method != 'drop' ) {
  4705. return;
  4706. }
  4707. const targetRange = findDropTargetRange( editor, data.targetRanges, data.target );
  4708. // The dragging markers must be removed after searching for the target range because sometimes
  4709. // the target lands on the marker itself.
  4710. this._removeDropMarker();
  4711. /* istanbul ignore if */
  4712. if ( !targetRange ) {
  4713. this._finalizeDragging( false );
  4714. evt.stop();
  4715. return;
  4716. }
  4717. // Since we cannot rely on the drag end event, we must check if the local drag range is from the current drag and drop
  4718. // or it is from some previous not cleared one.
  4719. if ( this._draggedRange && this._draggingUid != data.dataTransfer.getData( 'application/ckeditor5-dragging-uid' ) ) {
  4720. this._draggedRange.detach();
  4721. this._draggedRange = null;
  4722. this._draggingUid = '';
  4723. }
  4724. // Do not do anything if some content was dragged within the same document to the same position.
  4725. const isMove = getFinalDropEffect( data.dataTransfer ) == 'move';
  4726. if ( isMove && this._draggedRange && this._draggedRange.containsRange( targetRange, true ) ) {
  4727. this._finalizeDragging( false );
  4728. evt.stop();
  4729. return;
  4730. }
  4731. // Override the target ranges with the one adjusted to the best one for a drop.
  4732. data.targetRanges = [ editor.editing.mapper.toViewRange( targetRange ) ];
  4733. }, { priority: 'high' } );
  4734. }
  4735. /**
  4736. * Integration with the `contentInsertion` event of the clipboard pipeline.
  4737. *
  4738. * @private
  4739. */
  4740. _setupContentInsertionIntegration() {
  4741. const clipboardPipeline = this.editor.plugins.get( _clipboardpipeline__WEBPACK_IMPORTED_MODULE_7__["default"] );
  4742. clipboardPipeline.on( 'contentInsertion', ( evt, data ) => {
  4743. if ( !this.isEnabled || data.method !== 'drop' ) {
  4744. return;
  4745. }
  4746. // Update the selection to the target range in the same change block to avoid selection post-fixing
  4747. // and to be able to clone text attributes for plain text dropping.
  4748. const ranges = data.targetRanges.map( viewRange => this.editor.editing.mapper.toModelRange( viewRange ) );
  4749. this.editor.model.change( writer => writer.setSelection( ranges ) );
  4750. }, { priority: 'high' } );
  4751. clipboardPipeline.on( 'contentInsertion', ( evt, data ) => {
  4752. if ( !this.isEnabled || data.method !== 'drop' ) {
  4753. return;
  4754. }
  4755. // Remove dragged range content, remove markers, clean after dragging.
  4756. const isMove = getFinalDropEffect( data.dataTransfer ) == 'move';
  4757. // Whether any content was inserted (insertion might fail if the schema is disallowing some elements
  4758. // (for example an image caption allows only the content of a block but not blocks themselves.
  4759. // Some integrations might not return valid range (i.e., table pasting).
  4760. const isSuccess = !data.resultRange || !data.resultRange.isCollapsed;
  4761. this._finalizeDragging( isSuccess && isMove );
  4762. }, { priority: 'lowest' } );
  4763. }
  4764. /**
  4765. * Adds listeners that add the `draggable` attribute to the elements while the mouse button is down so the dragging could start.
  4766. *
  4767. * @private
  4768. */
  4769. _setupDraggableAttributeHandling() {
  4770. const editor = this.editor;
  4771. const view = editor.editing.view;
  4772. const viewDocument = view.document;
  4773. // Add the 'draggable' attribute to the widget while pressing the selection handle.
  4774. // This is required for widgets to be draggable. In Chrome it will enable dragging text nodes.
  4775. this.listenTo( viewDocument, 'mousedown', ( evt, data ) => {
  4776. // The lack of data can be caused by editor tests firing fake mouse events. This should not occur
  4777. // in real-life scenarios but this greatly simplifies editor tests that would otherwise fail a lot.
  4778. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isAndroid || !data ) {
  4779. return;
  4780. }
  4781. this._clearDraggableAttributesDelayed.cancel();
  4782. // Check if this is a mousedown over the widget (but not a nested editable).
  4783. let draggableElement = findDraggableWidget( data.target );
  4784. // Note: There is a limitation that if more than a widget is selected (a widget and some text)
  4785. // and dragging starts on the widget, then only the widget is dragged.
  4786. // If this was not a widget then we should check if we need to drag some text content.
  4787. // In Chrome set a 'draggable' attribute on closest editable to allow immediate dragging of the selected text range.
  4788. // In Firefox this is not needed. In Safari it makes the whole editable draggable (not just textual content).
  4789. // Disabled in read-only mode because draggable="true" + contenteditable="false" results
  4790. // in not firing selectionchange event ever, which makes the selection stuck in read-only mode.
  4791. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isBlink && !editor.isReadOnly && !draggableElement && !viewDocument.selection.isCollapsed ) {
  4792. const selectedElement = viewDocument.selection.getSelectedElement();
  4793. if ( !selectedElement || !Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( selectedElement ) ) {
  4794. draggableElement = viewDocument.selection.editableElement;
  4795. }
  4796. }
  4797. if ( draggableElement ) {
  4798. view.change( writer => {
  4799. writer.setAttribute( 'draggable', 'true', draggableElement );
  4800. } );
  4801. // Keep the reference to the model element in case the view element gets removed while dragging.
  4802. this._draggableElement = editor.editing.mapper.toModelElement( draggableElement );
  4803. }
  4804. } );
  4805. // Remove the draggable attribute in case no dragging started (only mousedown + mouseup).
  4806. this.listenTo( viewDocument, 'mouseup', () => {
  4807. if ( !_ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isAndroid ) {
  4808. this._clearDraggableAttributesDelayed();
  4809. }
  4810. } );
  4811. }
  4812. /**
  4813. * Removes the `draggable` attribute from the element that was used for dragging.
  4814. *
  4815. * @private
  4816. */
  4817. _clearDraggableAttributes() {
  4818. const editing = this.editor.editing;
  4819. editing.view.change( writer => {
  4820. // Remove 'draggable' attribute.
  4821. if ( this._draggableElement && this._draggableElement.root.rootName != '$graveyard' ) {
  4822. writer.removeAttribute( 'draggable', editing.mapper.toViewElement( this._draggableElement ) );
  4823. }
  4824. this._draggableElement = null;
  4825. } );
  4826. }
  4827. /**
  4828. * Creates downcast conversion for the drop target marker.
  4829. *
  4830. * @private
  4831. */
  4832. _setupDropMarker() {
  4833. const editor = this.editor;
  4834. // Drop marker conversion for hovering over widgets.
  4835. editor.conversion.for( 'editingDowncast' ).markerToHighlight( {
  4836. model: 'drop-target',
  4837. view: {
  4838. classes: [ 'ck-clipboard-drop-target-range' ]
  4839. }
  4840. } );
  4841. // Drop marker conversion for in text drop target.
  4842. editor.conversion.for( 'editingDowncast' ).markerToElement( {
  4843. model: 'drop-target',
  4844. view: ( data, { writer } ) => {
  4845. const inText = editor.model.schema.checkChild( data.markerRange.start, '$text' );
  4846. if ( !inText ) {
  4847. return;
  4848. }
  4849. return writer.createUIElement( 'span', { class: 'ck ck-clipboard-drop-target-position' }, function( domDocument ) {
  4850. const domElement = this.toDomElement( domDocument );
  4851. // Using word joiner to make this marker as high as text and also making text not break on marker.
  4852. domElement.innerHTML = '&NoBreak;<span></span>&NoBreak;';
  4853. return domElement;
  4854. } );
  4855. }
  4856. } );
  4857. }
  4858. /**
  4859. * Updates the drop target marker to the provided range.
  4860. *
  4861. * @private
  4862. * @param {module:engine/model/range~Range} targetRange The range to set the marker to.
  4863. */
  4864. _updateDropMarker( targetRange ) {
  4865. const editor = this.editor;
  4866. const markers = editor.model.markers;
  4867. editor.model.change( writer => {
  4868. if ( markers.has( 'drop-target' ) ) {
  4869. if ( !markers.get( 'drop-target' ).getRange().isEqual( targetRange ) ) {
  4870. writer.updateMarker( 'drop-target', { range: targetRange } );
  4871. }
  4872. } else {
  4873. writer.addMarker( 'drop-target', {
  4874. range: targetRange,
  4875. usingOperation: false,
  4876. affectsData: false
  4877. } );
  4878. }
  4879. } );
  4880. }
  4881. /**
  4882. * Removes the drop target marker.
  4883. *
  4884. * @private
  4885. */
  4886. _removeDropMarker() {
  4887. const model = this.editor.model;
  4888. this._removeDropMarkerDelayed.cancel();
  4889. this._updateDropMarkerThrottled.cancel();
  4890. if ( model.markers.has( 'drop-target' ) ) {
  4891. model.change( writer => {
  4892. writer.removeMarker( 'drop-target' );
  4893. } );
  4894. }
  4895. }
  4896. /**
  4897. * Deletes the dragged content from its original range and clears the dragging state.
  4898. *
  4899. * @private
  4900. * @param {Boolean} moved Whether the move succeeded.
  4901. */
  4902. _finalizeDragging( moved ) {
  4903. const editor = this.editor;
  4904. const model = editor.model;
  4905. this._removeDropMarker();
  4906. this._clearDraggableAttributes();
  4907. if ( editor.plugins.has( 'WidgetToolbarRepository' ) ) {
  4908. editor.plugins.get( 'WidgetToolbarRepository' ).clearForceDisabled( 'dragDrop' );
  4909. }
  4910. this._draggingUid = '';
  4911. if ( !this._draggedRange ) {
  4912. return;
  4913. }
  4914. // Delete moved content.
  4915. if ( moved && this.isEnabled ) {
  4916. model.deleteContent( model.createSelection( this._draggedRange ), { doNotAutoparagraph: true } );
  4917. }
  4918. this._draggedRange.detach();
  4919. this._draggedRange = null;
  4920. }
  4921. }
  4922. // Returns fixed selection range for given position and target element.
  4923. //
  4924. // @param {module:core/editor/editor~Editor} editor
  4925. // @param {Array.<module:engine/view/range~Range>} targetViewRanges
  4926. // @param {module:engine/view/element~Element} targetViewElement
  4927. // @returns {module:engine/model/range~Range|null}
  4928. function findDropTargetRange( editor, targetViewRanges, targetViewElement ) {
  4929. const model = editor.model;
  4930. const mapper = editor.editing.mapper;
  4931. let range = null;
  4932. const targetViewPosition = targetViewRanges ? targetViewRanges[ 0 ].start : null;
  4933. // A UIElement is not a valid drop element, use parent (this could be a drop marker or any other UIElement).
  4934. if ( targetViewElement.is( 'uiElement' ) ) {
  4935. targetViewElement = targetViewElement.parent;
  4936. }
  4937. // Quick win if the target is a widget (but not a nested editable).
  4938. range = findDropTargetRangeOnWidget( editor, targetViewElement );
  4939. if ( range ) {
  4940. return range;
  4941. }
  4942. // The easiest part is over, now we need to move to the model space.
  4943. // Find target model element and position.
  4944. const targetModelElement = getClosestMappedModelElement( editor, targetViewElement );
  4945. const targetModelPosition = targetViewPosition ? mapper.toModelPosition( targetViewPosition ) : null;
  4946. // There is no target position while hovering over an empty table cell.
  4947. // In Safari, target position can be empty while hovering over a widget (e.g., a page-break).
  4948. // Find the drop position inside the element.
  4949. if ( !targetModelPosition ) {
  4950. return findDropTargetRangeInElement( editor, targetModelElement );
  4951. }
  4952. // Check if target position is between blocks and adjust drop position to the next object.
  4953. // This is because while hovering over a root element next to a widget the target position can jump in crazy places.
  4954. range = findDropTargetRangeBetweenBlocks( editor, targetModelPosition, targetModelElement );
  4955. if ( range ) {
  4956. return range;
  4957. }
  4958. // Try fixing selection position.
  4959. // In Firefox, the target position lands before widgets but in other browsers it tends to land after a widget.
  4960. range = model.schema.getNearestSelectionRange( targetModelPosition, _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isGecko ? 'forward' : 'backward' );
  4961. if ( range ) {
  4962. return range;
  4963. }
  4964. // There is no valid selection position inside the current limit element so find a closest object ancestor.
  4965. // This happens if the model position lands directly in the <table> element itself (view target element was a `<td>`
  4966. // so a nested editable, but view target position was directly in the `<figure>` element).
  4967. return findDropTargetRangeOnAncestorObject( editor, targetModelPosition.parent );
  4968. }
  4969. // Returns fixed selection range for a given position and a target element if it is over the widget but not over its nested editable.
  4970. //
  4971. // @param {module:core/editor/editor~Editor} editor
  4972. // @param {module:engine/view/element~Element} targetViewElement
  4973. // @returns {module:engine/model/range~Range|null}
  4974. function findDropTargetRangeOnWidget( editor, targetViewElement ) {
  4975. const model = editor.model;
  4976. const mapper = editor.editing.mapper;
  4977. // Quick win if the target is a widget.
  4978. if ( Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( targetViewElement ) ) {
  4979. return model.createRangeOn( mapper.toModelElement( targetViewElement ) );
  4980. }
  4981. // Check if we are deeper over a widget (but not over a nested editable).
  4982. if ( !targetViewElement.is( 'editableElement' ) ) {
  4983. // Find a closest ancestor that is either a widget or an editable element...
  4984. const ancestor = targetViewElement.findAncestor( node => Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( node ) || node.is( 'editableElement' ) );
  4985. // ...and if the widget was closer then it is a drop target.
  4986. if ( Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( ancestor ) ) {
  4987. return model.createRangeOn( mapper.toModelElement( ancestor ) );
  4988. }
  4989. }
  4990. return null;
  4991. }
  4992. // Returns fixed selection range inside a model element.
  4993. //
  4994. // @param {module:core/editor/editor~Editor} editor
  4995. // @param {module:engine/model/element~Element} targetModelElement
  4996. // @returns {module:engine/model/range~Range}
  4997. function findDropTargetRangeInElement( editor, targetModelElement ) {
  4998. const model = editor.model;
  4999. const schema = model.schema;
  5000. const positionAtElementStart = model.createPositionAt( targetModelElement, 0 );
  5001. return schema.getNearestSelectionRange( positionAtElementStart, 'forward' );
  5002. }
  5003. // Returns fixed selection range for a given position and a target element if the drop is between blocks.
  5004. //
  5005. // @param {module:core/editor/editor~Editor} editor
  5006. // @param {module:engine/model/position~Position} targetModelPosition
  5007. // @param {module:engine/model/element~Element} targetModelElement
  5008. // @returns {module:engine/model/range~Range|null}
  5009. function findDropTargetRangeBetweenBlocks( editor, targetModelPosition, targetModelElement ) {
  5010. const model = editor.model;
  5011. // Check if target is between blocks.
  5012. if ( !model.schema.checkChild( targetModelElement, '$block' ) ) {
  5013. return null;
  5014. }
  5015. // Find position between blocks.
  5016. const positionAtElementStart = model.createPositionAt( targetModelElement, 0 );
  5017. // Get the common part of the path (inside the target element and the target position).
  5018. const commonPath = targetModelPosition.path.slice( 0, positionAtElementStart.path.length );
  5019. // Position between the blocks.
  5020. const betweenBlocksPosition = model.createPositionFromPath( targetModelPosition.root, commonPath );
  5021. const nodeAfter = betweenBlocksPosition.nodeAfter;
  5022. // Adjust drop position to the next object.
  5023. // This is because while hovering over a root element next to a widget the target position can jump in crazy places.
  5024. if ( nodeAfter && model.schema.isObject( nodeAfter ) ) {
  5025. return model.createRangeOn( nodeAfter );
  5026. }
  5027. return null;
  5028. }
  5029. // Returns a selection range on the ancestor object.
  5030. //
  5031. // @param {module:core/editor/editor~Editor} editor
  5032. // @param {module:engine/model/element~Element} element
  5033. // @returns {module:engine/model/range~Range}
  5034. function findDropTargetRangeOnAncestorObject( editor, element ) {
  5035. const model = editor.model;
  5036. while ( element ) {
  5037. if ( model.schema.isObject( element ) ) {
  5038. return model.createRangeOn( element );
  5039. }
  5040. element = element.parent;
  5041. }
  5042. }
  5043. // Returns the closest model element for the specified view element.
  5044. //
  5045. // @param {module:core/editor/editor~Editor} editor
  5046. // @param {module:engine/view/element~Element} element
  5047. // @returns {module:engine/model/element~Element}
  5048. function getClosestMappedModelElement( editor, element ) {
  5049. const mapper = editor.editing.mapper;
  5050. const view = editor.editing.view;
  5051. const targetModelElement = mapper.toModelElement( element );
  5052. if ( targetModelElement ) {
  5053. return targetModelElement;
  5054. }
  5055. // Find mapped ancestor if the target is inside not mapped element (for example inline code element).
  5056. const viewPosition = view.createPositionBefore( element );
  5057. const viewElement = mapper.findMappedViewAncestor( viewPosition );
  5058. return mapper.toModelElement( viewElement );
  5059. }
  5060. // Returns the drop effect that should be a result of dragging the content.
  5061. // This function is handling a quirk when checking the effect in the 'drop' DOM event.
  5062. function getFinalDropEffect( dataTransfer ) {
  5063. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isGecko ) {
  5064. return dataTransfer.dropEffect;
  5065. }
  5066. return [ 'all', 'copyMove' ].includes( dataTransfer.effectAllowed ) ? 'move' : 'copy';
  5067. }
  5068. // Returns a function wrapper that will trigger a function after a specified wait time.
  5069. // The timeout can be canceled by calling the cancel function on the returned wrapped function.
  5070. //
  5071. // @param {Function} func The function to wrap.
  5072. // @param {Number} wait The timeout in ms.
  5073. // @returns {Function}
  5074. function delay( func, wait ) {
  5075. let timer;
  5076. function delayed( ...args ) {
  5077. delayed.cancel();
  5078. timer = setTimeout( () => func( ...args ), wait );
  5079. }
  5080. delayed.cancel = () => {
  5081. clearTimeout( timer );
  5082. };
  5083. return delayed;
  5084. }
  5085. // Returns a widget element that should be dragged.
  5086. //
  5087. // @param {module:engine/view/element~Element} target
  5088. // @returns {module:engine/view/element~Element}
  5089. function findDraggableWidget( target ) {
  5090. // This is directly an editable so not a widget for sure.
  5091. if ( target.is( 'editableElement' ) ) {
  5092. return null;
  5093. }
  5094. // TODO: Let's have a isWidgetSelectionHandleDomElement() helper in ckeditor5-widget utils.
  5095. if ( target.hasClass( 'ck-widget__selection-handle' ) ) {
  5096. return target.findAncestor( _ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"] );
  5097. }
  5098. // Direct hit on a widget.
  5099. if ( Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( target ) ) {
  5100. return target;
  5101. }
  5102. // Find closest ancestor that is either a widget or an editable element...
  5103. const ancestor = target.findAncestor( node => Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( node ) || node.is( 'editableElement' ) );
  5104. // ...and if closer was the widget then enable dragging it.
  5105. if ( Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_6__["isWidget"])( ancestor ) ) {
  5106. return ancestor;
  5107. }
  5108. return null;
  5109. }
  5110. /***/ }),
  5111. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/index.js":
  5112. /*!*****************************************************************!*\
  5113. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/index.js ***!
  5114. \*****************************************************************/
  5115. /*! exports provided: Clipboard, ClipboardPipeline, DragDrop, PastePlainText */
  5116. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5117. "use strict";
  5118. __webpack_require__.r(__webpack_exports__);
  5119. /* harmony import */ var _clipboard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clipboard */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js");
  5120. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Clipboard", function() { return _clipboard__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  5121. /* harmony import */ var _clipboardpipeline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clipboardpipeline */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js");
  5122. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClipboardPipeline", function() { return _clipboardpipeline__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  5123. /* harmony import */ var _dragdrop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dragdrop */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js");
  5124. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragDrop", function() { return _dragdrop__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  5125. /* harmony import */ var _pasteplaintext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pasteplaintext */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js");
  5126. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PastePlainText", function() { return _pasteplaintext__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  5127. /**
  5128. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  5129. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5130. */
  5131. /**
  5132. * @module clipboard
  5133. */
  5134. /***/ }),
  5135. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js":
  5136. /*!**************************************************************************!*\
  5137. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js ***!
  5138. \**************************************************************************/
  5139. /*! exports provided: default */
  5140. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5141. "use strict";
  5142. __webpack_require__.r(__webpack_exports__);
  5143. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PastePlainText; });
  5144. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  5145. /* harmony import */ var _clipboardobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clipboardobserver */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js");
  5146. /* harmony import */ var _clipboardpipeline__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clipboardpipeline */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js");
  5147. /**
  5148. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  5149. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5150. */
  5151. /**
  5152. * @module clipboard/pasteplaintext
  5153. */
  5154. /**
  5155. * The plugin detects the user's intention to paste plain text.
  5156. *
  5157. * For example, it detects the <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> keystroke.
  5158. *
  5159. * @extends module:core/plugin~Plugin
  5160. */
  5161. class PastePlainText extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  5162. /**
  5163. * @inheritDoc
  5164. */
  5165. static get pluginName() {
  5166. return 'PastePlainText';
  5167. }
  5168. /**
  5169. * @inheritDoc
  5170. */
  5171. static get requires() {
  5172. return [ _clipboardpipeline__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  5173. }
  5174. /**
  5175. * @inheritDoc
  5176. */
  5177. init() {
  5178. const editor = this.editor;
  5179. const model = editor.model;
  5180. const view = editor.editing.view;
  5181. const viewDocument = view.document;
  5182. const selection = model.document.selection;
  5183. let shiftPressed = false;
  5184. view.addObserver( _clipboardobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
  5185. this.listenTo( viewDocument, 'keydown', ( evt, data ) => {
  5186. shiftPressed = data.shiftKey;
  5187. } );
  5188. editor.plugins.get( _clipboardpipeline__WEBPACK_IMPORTED_MODULE_2__["default"] ).on( 'contentInsertion', ( evt, data ) => {
  5189. // Plain text can be determined based on the event flag (#7799) or auto-detection (#1006). If detected,
  5190. // preserve selection attributes on pasted items.
  5191. if ( !shiftPressed && !isPlainTextFragment( data.content, model.schema ) ) {
  5192. return;
  5193. }
  5194. model.change( writer => {
  5195. // Formatting attributes should be preserved.
  5196. const textAttributes = Array.from( selection.getAttributes() )
  5197. .filter( ( [ key ] ) => model.schema.getAttributeProperties( key ).isFormatting );
  5198. if ( !selection.isCollapsed ) {
  5199. model.deleteContent( selection, { doNotAutoparagraph: true } );
  5200. }
  5201. // Also preserve other attributes if they survived the content deletion (because they were not fully selected).
  5202. // For example linkHref is not a formatting attribute but it should be preserved if pasted text was in the middle
  5203. // of a link.
  5204. textAttributes.push( ...selection.getAttributes() );
  5205. const range = writer.createRangeIn( data.content );
  5206. for ( const item of range.getItems() ) {
  5207. if ( item.is( '$textProxy' ) ) {
  5208. writer.setAttributes( textAttributes, item );
  5209. }
  5210. }
  5211. } );
  5212. } );
  5213. }
  5214. }
  5215. // Returns true if specified `documentFragment` represents a plain text.
  5216. //
  5217. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment
  5218. // @param {module:engine/model/schema~Schema} schema
  5219. // @returns {Boolean}
  5220. function isPlainTextFragment( documentFragment, schema ) {
  5221. if ( documentFragment.childCount > 1 ) {
  5222. return false;
  5223. }
  5224. const child = documentFragment.getChild( 0 );
  5225. if ( schema.isObject( child ) ) {
  5226. return false;
  5227. }
  5228. return [ ...child.getAttributeKeys() ].length == 0;
  5229. }
  5230. /***/ }),
  5231. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js":
  5232. /*!****************************************************************************************!*\
  5233. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js ***!
  5234. \****************************************************************************************/
  5235. /*! exports provided: default */
  5236. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5237. "use strict";
  5238. __webpack_require__.r(__webpack_exports__);
  5239. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeClipboardData; });
  5240. /**
  5241. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  5242. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5243. */
  5244. /**
  5245. * @module clipboard/utils/normalizeclipboarddata
  5246. */
  5247. /**
  5248. * Removes some popular browser quirks out of the clipboard data (HTML).
  5249. * Removes all HTML comments. These are considered an internal thing and it makes little sense if they leak into the editor data.
  5250. *
  5251. * @param {String} data The HTML data to normalize.
  5252. * @returns {String} Normalized HTML.
  5253. */
  5254. function normalizeClipboardData( data ) {
  5255. return data
  5256. .replace( /<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g, ( fullMatch, spaces ) => {
  5257. // Handle the most popular and problematic case when even a single space becomes an nbsp;.
  5258. // Decode those to normal spaces. Read more in https://github.com/ckeditor/ckeditor5-clipboard/issues/2.
  5259. if ( spaces.length == 1 ) {
  5260. return ' ';
  5261. }
  5262. return spaces;
  5263. } )
  5264. // Remove all HTML comments.
  5265. .replace( /<!--[\s\S]*?-->/g, '' );
  5266. }
  5267. /***/ }),
  5268. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js":
  5269. /*!*********************************************************************************!*\
  5270. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js ***!
  5271. \*********************************************************************************/
  5272. /*! exports provided: default */
  5273. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5274. "use strict";
  5275. __webpack_require__.r(__webpack_exports__);
  5276. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return plainTextToHtml; });
  5277. /**
  5278. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  5279. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5280. */
  5281. /**
  5282. * @module clipboard/utils/plaintexttohtml
  5283. */
  5284. /**
  5285. * Converts plain text to its HTML-ized version.
  5286. *
  5287. * @param {String} text The plain text to convert.
  5288. * @returns {String} HTML generated from the plain text.
  5289. */
  5290. function plainTextToHtml( text ) {
  5291. text = text
  5292. // Encode <>.
  5293. .replace( /</g, '&lt;' )
  5294. .replace( />/g, '&gt;' )
  5295. // Creates a paragraph for each double line break.
  5296. .replace( /\r?\n\r?\n/g, '</p><p>' )
  5297. // Creates a line break for each single line break.
  5298. .replace( /\r?\n/g, '<br>' )
  5299. // Preserve trailing spaces (only the first and last one – the rest is handled below).
  5300. .replace( /^\s/, '&nbsp;' )
  5301. .replace( /\s$/, '&nbsp;' )
  5302. // Preserve other subsequent spaces now.
  5303. .replace( /\s\s/g, ' &nbsp;' );
  5304. if ( text.includes( '</p><p>' ) || text.includes( '<br>' ) ) {
  5305. // If we created paragraphs above, add the trailing ones.
  5306. text = `<p>${ text }</p>`;
  5307. }
  5308. // TODO:
  5309. // * What about '\nfoo' vs ' foo'?
  5310. return text;
  5311. }
  5312. /***/ }),
  5313. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js":
  5314. /*!*********************************************************************************!*\
  5315. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js ***!
  5316. \*********************************************************************************/
  5317. /*! exports provided: default */
  5318. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5319. "use strict";
  5320. __webpack_require__.r(__webpack_exports__);
  5321. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return viewToPlainText; });
  5322. /**
  5323. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  5324. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5325. */
  5326. /**
  5327. * @module clipboard/utils/viewtoplaintext
  5328. */
  5329. // Elements which should not have empty-line padding.
  5330. // Most `view.ContainerElement` want to be separate by new-line, but some are creating one structure
  5331. // together (like `<li>`) so it is better to separate them by only one "\n".
  5332. const smallPaddingElements = [ 'figcaption', 'li' ];
  5333. /**
  5334. * Converts {@link module:engine/view/item~Item view item} and all of its children to plain text.
  5335. *
  5336. * @param {module:engine/view/item~Item} viewItem View item to convert.
  5337. * @returns {String} Plain text representation of `viewItem`.
  5338. */
  5339. function viewToPlainText( viewItem ) {
  5340. let text = '';
  5341. if ( viewItem.is( '$text' ) || viewItem.is( '$textProxy' ) ) {
  5342. // If item is `Text` or `TextProxy` simple take its text data.
  5343. text = viewItem.data;
  5344. } else if ( viewItem.is( 'element', 'img' ) && viewItem.hasAttribute( 'alt' ) ) {
  5345. // Special case for images - use alt attribute if it is provided.
  5346. text = viewItem.getAttribute( 'alt' );
  5347. } else if ( viewItem.is( 'element', 'br' ) ) {
  5348. // A soft break should be converted into a single line break (#8045).
  5349. text = '\n';
  5350. } else {
  5351. // Other elements are document fragments, attribute elements or container elements.
  5352. // They don't have their own text value, so convert their children.
  5353. let prev = null;
  5354. for ( const child of viewItem.getChildren() ) {
  5355. const childText = viewToPlainText( child );
  5356. // Separate container element children with one or more new-line characters.
  5357. if ( prev && ( prev.is( 'containerElement' ) || child.is( 'containerElement' ) ) ) {
  5358. if ( smallPaddingElements.includes( prev.name ) || smallPaddingElements.includes( child.name ) ) {
  5359. text += '\n';
  5360. } else {
  5361. text += '\n\n';
  5362. }
  5363. }
  5364. text += childText;
  5365. prev = child;
  5366. }
  5367. }
  5368. return text;
  5369. }
  5370. /***/ }),
  5371. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css":
  5372. /*!************************************************************************!*\
  5373. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css ***!
  5374. \************************************************************************/
  5375. /*! exports provided: default */
  5376. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5377. "use strict";
  5378. __webpack_require__.r(__webpack_exports__);
  5379. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  5380. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  5381. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_clipboard_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./clipboard.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css");
  5382. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  5383. options.insert = "head";
  5384. options.singleton = true;
  5385. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_clipboard_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  5386. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_clipboard_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  5387. /***/ }),
  5388. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/command.js":
  5389. /*!**************************************************************!*\
  5390. !*** ./node_modules/@ckeditor/ckeditor5-core/src/command.js ***!
  5391. \**************************************************************/
  5392. /*! exports provided: default */
  5393. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5394. "use strict";
  5395. __webpack_require__.r(__webpack_exports__);
  5396. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Command; });
  5397. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  5398. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  5399. /**
  5400. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  5401. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5402. */
  5403. /**
  5404. * @module core/command
  5405. */
  5406. /**
  5407. * The base class for CKEditor commands.
  5408. *
  5409. * Commands are the main way to manipulate editor contents and state. They are mostly used by UI elements (or by other
  5410. * commands) to make changes in the model. Commands are available in every part of code that has access to
  5411. * the {@link module:core/editor/editor~Editor editor} instance.
  5412. *
  5413. * Instances of registered commands can be retrieved from {@link module:core/editor/editor~Editor#commands `editor.commands`}.
  5414. * The easiest way to execute a command is through {@link module:core/editor/editor~Editor#execute `editor.execute()`}.
  5415. *
  5416. * By default, commands are disabled when the editor is in {@link module:core/editor/editor~Editor#isReadOnly read-only} mode
  5417. * but commands with the {@link module:core/command~Command#affectsData `affectsData`} flag set to `false` will not be disabled.
  5418. *
  5419. * @mixes module:utils/observablemixin~ObservableMixin
  5420. */
  5421. class Command {
  5422. /**
  5423. * Creates a new `Command` instance.
  5424. *
  5425. * @param {module:core/editor/editor~Editor} editor Editor on which this command will be used.
  5426. */
  5427. constructor( editor ) {
  5428. /**
  5429. * The editor on which this command will be used.
  5430. *
  5431. * @readonly
  5432. * @member {module:core/editor/editor~Editor}
  5433. */
  5434. this.editor = editor;
  5435. /**
  5436. * The value of the command. A concrete command class should define what it represents for it.
  5437. *
  5438. * For example, the `'bold'` command's value indicates whether the selection starts in a bolded text.
  5439. * And the value of the `'link'` command may be an object with links details.
  5440. *
  5441. * It is possible for a command to have no value (e.g. for stateless actions such as `'uploadImage'`).
  5442. *
  5443. * A concrete command class should control this value by overriding the {@link #refresh `refresh()`} method.
  5444. *
  5445. * @observable
  5446. * @readonly
  5447. * @member #value
  5448. */
  5449. this.set( 'value', undefined );
  5450. /**
  5451. * Flag indicating whether a command is enabled or disabled.
  5452. * A disabled command will do nothing when executed.
  5453. *
  5454. * A concrete command class should control this value by overriding the {@link #refresh `refresh()`} method.
  5455. *
  5456. * It is possible to disable a command from "outside". For instance, in your integration you may want to disable
  5457. * a certain set of commands for the time being. To do that, you can use the fact that `isEnabled` is observable
  5458. * and it fires the `set:isEnabled` event every time anyone tries to modify its value:
  5459. *
  5460. * function disableCommand( cmd ) {
  5461. * cmd.on( 'set:isEnabled', forceDisable, { priority: 'highest' } );
  5462. *
  5463. * cmd.isEnabled = false;
  5464. *
  5465. * // Make it possible to enable the command again.
  5466. * return () => {
  5467. * cmd.off( 'set:isEnabled', forceDisable );
  5468. * cmd.refresh();
  5469. * };
  5470. *
  5471. * function forceDisable( evt ) {
  5472. * evt.return = false;
  5473. * evt.stop();
  5474. * }
  5475. * }
  5476. *
  5477. * // Usage:
  5478. *
  5479. * // Disabling the command.
  5480. * const enableBold = disableCommand( editor.commands.get( 'bold' ) );
  5481. *
  5482. * // Enabling the command again.
  5483. * enableBold();
  5484. *
  5485. * @observable
  5486. * @readonly
  5487. * @member {Boolean} #isEnabled
  5488. */
  5489. this.set( 'isEnabled', false );
  5490. /**
  5491. * A flag indicating whether a command execution changes the editor data or not.
  5492. *
  5493. * Commands with `affectsData` set to `false` will not be automatically disabled in
  5494. * the {@link module:core/editor/editor~Editor#isReadOnly read-only mode} and
  5495. * {@glink features/read-only#related-features other editor modes} with restricted user write permissions.
  5496. *
  5497. * **Note:** You do not have to set it for your every command. It is `true` by default.
  5498. *
  5499. * @readonly
  5500. * @default true
  5501. * @member {Boolean} #affectsData
  5502. */
  5503. this.affectsData = true;
  5504. /**
  5505. * Holds identifiers for {@link #forceDisabled} mechanism.
  5506. *
  5507. * @type {Set.<String>}
  5508. * @private
  5509. */
  5510. this._disableStack = new Set();
  5511. this.decorate( 'execute' );
  5512. // By default every command is refreshed when changes are applied to the model.
  5513. this.listenTo( this.editor.model.document, 'change', () => {
  5514. this.refresh();
  5515. } );
  5516. this.on( 'execute', evt => {
  5517. if ( !this.isEnabled ) {
  5518. evt.stop();
  5519. }
  5520. }, { priority: 'high' } );
  5521. // By default commands are disabled when the editor is in read-only mode.
  5522. this.listenTo( editor, 'change:isReadOnly', ( evt, name, value ) => {
  5523. if ( value && this.affectsData ) {
  5524. this.forceDisabled( 'readOnlyMode' );
  5525. } else {
  5526. this.clearForceDisabled( 'readOnlyMode' );
  5527. }
  5528. } );
  5529. }
  5530. /**
  5531. * Refreshes the command. The command should update its {@link #isEnabled} and {@link #value} properties
  5532. * in this method.
  5533. *
  5534. * This method is automatically called when
  5535. * {@link module:engine/model/document~Document#event:change any changes are applied to the document}.
  5536. */
  5537. refresh() {
  5538. this.isEnabled = true;
  5539. }
  5540. /**
  5541. * Disables the command.
  5542. *
  5543. * Command may be disabled by multiple features or algorithms (at once). When disabling a command, unique id should be passed
  5544. * (e.g. feature name). The same identifier should be used when {@link #clearForceDisabled enabling back} the command.
  5545. * The command becomes enabled only after all features {@link #clearForceDisabled enabled it back}.
  5546. *
  5547. * Disabling and enabling a command:
  5548. *
  5549. * command.isEnabled; // -> true
  5550. * command.forceDisabled( 'MyFeature' );
  5551. * command.isEnabled; // -> false
  5552. * command.clearForceDisabled( 'MyFeature' );
  5553. * command.isEnabled; // -> true
  5554. *
  5555. * Command disabled by multiple features:
  5556. *
  5557. * command.forceDisabled( 'MyFeature' );
  5558. * command.forceDisabled( 'OtherFeature' );
  5559. * command.clearForceDisabled( 'MyFeature' );
  5560. * command.isEnabled; // -> false
  5561. * command.clearForceDisabled( 'OtherFeature' );
  5562. * command.isEnabled; // -> true
  5563. *
  5564. * Multiple disabling with the same identifier is redundant:
  5565. *
  5566. * command.forceDisabled( 'MyFeature' );
  5567. * command.forceDisabled( 'MyFeature' );
  5568. * command.clearForceDisabled( 'MyFeature' );
  5569. * command.isEnabled; // -> true
  5570. *
  5571. * **Note:** some commands or algorithms may have more complex logic when it comes to enabling or disabling certain commands,
  5572. * so the command might be still disabled after {@link #clearForceDisabled} was used.
  5573. *
  5574. * @param {String} id Unique identifier for disabling. Use the same id when {@link #clearForceDisabled enabling back} the command.
  5575. */
  5576. forceDisabled( id ) {
  5577. this._disableStack.add( id );
  5578. if ( this._disableStack.size == 1 ) {
  5579. this.on( 'set:isEnabled', forceDisable, { priority: 'highest' } );
  5580. this.isEnabled = false;
  5581. }
  5582. }
  5583. /**
  5584. * Clears forced disable previously set through {@link #forceDisabled}. See {@link #forceDisabled}.
  5585. *
  5586. * @param {String} id Unique identifier, equal to the one passed in {@link #forceDisabled} call.
  5587. */
  5588. clearForceDisabled( id ) {
  5589. this._disableStack.delete( id );
  5590. if ( this._disableStack.size == 0 ) {
  5591. this.off( 'set:isEnabled', forceDisable );
  5592. this.refresh();
  5593. }
  5594. }
  5595. /**
  5596. * Executes the command.
  5597. *
  5598. * A command may accept parameters. They will be passed from {@link module:core/editor/editor~Editor#execute `editor.execute()`}
  5599. * to the command.
  5600. *
  5601. * The `execute()` method will automatically abort when the command is disabled ({@link #isEnabled} is `false`).
  5602. * This behavior is implemented by a high priority listener to the {@link #event:execute} event.
  5603. *
  5604. * In order to see how to disable a command from "outside" see the {@link #isEnabled} documentation.
  5605. *
  5606. * This method may return a value, which would be forwarded all the way down to the
  5607. * {@link module:core/editor/editor~Editor#execute `editor.execute()`}.
  5608. *
  5609. * @fires execute
  5610. */
  5611. execute() {}
  5612. /**
  5613. * Destroys the command.
  5614. */
  5615. destroy() {
  5616. this.stopListening();
  5617. }
  5618. /**
  5619. * Event fired by the {@link #execute} method. The command action is a listener to this event so it's
  5620. * possible to change/cancel the behavior of the command by listening to this event.
  5621. *
  5622. * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.
  5623. *
  5624. * **Note:** This event is fired even if command is disabled. However, it is automatically blocked
  5625. * by a high priority listener in order to prevent command execution.
  5626. *
  5627. * @event execute
  5628. */
  5629. }
  5630. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( Command, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  5631. // Helper function that forces command to be disabled.
  5632. function forceDisable( evt ) {
  5633. evt.return = false;
  5634. evt.stop();
  5635. }
  5636. /***/ }),
  5637. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js":
  5638. /*!************************************************************************!*\
  5639. !*** ./node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js ***!
  5640. \************************************************************************/
  5641. /*! exports provided: default */
  5642. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5643. "use strict";
  5644. __webpack_require__.r(__webpack_exports__);
  5645. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CommandCollection; });
  5646. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  5647. /**
  5648. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  5649. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5650. */
  5651. /**
  5652. * @module core/commandcollection
  5653. */
  5654. /**
  5655. * Collection of commands. Its instance is available in {@link module:core/editor/editor~Editor#commands `editor.commands`}.
  5656. */
  5657. class CommandCollection {
  5658. /**
  5659. * Creates collection instance.
  5660. */
  5661. constructor() {
  5662. /**
  5663. * Command map.
  5664. *
  5665. * @private
  5666. * @member {Map}
  5667. */
  5668. this._commands = new Map();
  5669. }
  5670. /**
  5671. * Registers a new command.
  5672. *
  5673. * @param {String} commandName The name of the command.
  5674. * @param {module:core/command~Command} command
  5675. */
  5676. add( commandName, command ) {
  5677. this._commands.set( commandName, command );
  5678. }
  5679. /**
  5680. * Retrieves a command from the collection.
  5681. *
  5682. * @param {String} commandName The name of the command.
  5683. * @returns {module:core/command~Command}
  5684. */
  5685. get( commandName ) {
  5686. return this._commands.get( commandName );
  5687. }
  5688. /**
  5689. * Executes a command.
  5690. *
  5691. * @param {String} commandName The name of the command.
  5692. * @param {*} [...commandParams] Command parameters.
  5693. * @returns {*} The value returned by the {@link module:core/command~Command#execute `command.execute()`}.
  5694. */
  5695. execute( commandName, ...args ) {
  5696. const command = this.get( commandName );
  5697. if ( !command ) {
  5698. /**
  5699. * Command does not exist.
  5700. *
  5701. * @error commandcollection-command-not-found
  5702. * @param {String} commandName Name of the command.
  5703. */
  5704. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'commandcollection-command-not-found', this, { commandName } );
  5705. }
  5706. return command.execute( ...args );
  5707. }
  5708. /**
  5709. * Returns iterator of command names.
  5710. *
  5711. * @returns {Iterable.<String>}
  5712. */
  5713. * names() {
  5714. yield* this._commands.keys();
  5715. }
  5716. /**
  5717. * Returns iterator of command instances.
  5718. *
  5719. * @returns {Iterable.<module:core/command~Command>}
  5720. */
  5721. * commands() {
  5722. yield* this._commands.values();
  5723. }
  5724. /**
  5725. * Iterable interface.
  5726. *
  5727. * Returns `[ commandName, commandInstance ]` pairs.
  5728. *
  5729. * @returns {Iterable.<Array>}
  5730. */
  5731. [ Symbol.iterator ]() {
  5732. return this._commands[ Symbol.iterator ]();
  5733. }
  5734. /**
  5735. * Destroys all collection commands.
  5736. */
  5737. destroy() {
  5738. for ( const command of this.commands() ) {
  5739. command.destroy();
  5740. }
  5741. }
  5742. }
  5743. /***/ }),
  5744. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/context.js":
  5745. /*!**************************************************************!*\
  5746. !*** ./node_modules/@ckeditor/ckeditor5-core/src/context.js ***!
  5747. \**************************************************************/
  5748. /*! exports provided: default */
  5749. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5750. "use strict";
  5751. __webpack_require__.r(__webpack_exports__);
  5752. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Context; });
  5753. /* harmony import */ var _ckeditor_ckeditor5_utils_src_config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/config */ "./node_modules/@ckeditor/ckeditor5-utils/src/config.js");
  5754. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  5755. /* harmony import */ var _plugincollection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./plugincollection */ "./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js");
  5756. /* harmony import */ var _ckeditor_ckeditor5_utils_src_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/locale */ "./node_modules/@ckeditor/ckeditor5-utils/src/locale.js");
  5757. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  5758. /**
  5759. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  5760. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5761. */
  5762. /**
  5763. * @module core/context
  5764. */
  5765. /**
  5766. * Provides a common, higher-level environment for solutions that use multiple {@link module:core/editor/editor~Editor editors}
  5767. * or plugins that work outside the editor. Use it instead of {@link module:core/editor/editor~Editor.create `Editor.create()`}
  5768. * in advanced application integrations.
  5769. *
  5770. * All configuration options passed to a context will be used as default options for editor instances initialized in that context.
  5771. *
  5772. * {@link module:core/contextplugin~ContextPlugin Context plugins} passed to a context instance will be shared among all
  5773. * editor instances initialized in this context. These will be the same plugin instances for all the editors.
  5774. *
  5775. * **Note:** The context can only be initialized with {@link module:core/contextplugin~ContextPlugin context plugins}
  5776. * (e.g. [comments](https://ckeditor.com/collaboration/comments/)). Regular {@link module:core/plugin~Plugin plugins} require an
  5777. * editor instance to work and cannot be added to a context.
  5778. *
  5779. * **Note:** You can add a context plugin to an editor instance, though.
  5780. *
  5781. * If you are using multiple editor instances on one page and use any context plugins, create a context to share the configuration and
  5782. * plugins among these editors. Some plugins will use the information about all existing editors to better integrate between them.
  5783. *
  5784. * If you are using plugins that do not require an editor to work (e.g. [comments](https://ckeditor.com/collaboration/comments/)),
  5785. * enable and configure them using the context.
  5786. *
  5787. * If you are using only a single editor on each page, use {@link module:core/editor/editor~Editor.create `Editor.create()`} instead.
  5788. * In such case, a context instance will be created by the editor instance in a transparent way.
  5789. *
  5790. * See {@link module:core/context~Context.create `Context.create()`} for usage examples.
  5791. */
  5792. class Context {
  5793. /**
  5794. * Creates a context instance with a given configuration.
  5795. *
  5796. * Usually not to be used directly. See the static {@link module:core/context~Context.create `create()`} method.
  5797. *
  5798. * @param {Object} [config={}] The context configuration.
  5799. */
  5800. constructor( config ) {
  5801. /**
  5802. * Stores all the configurations specific to this context instance.
  5803. *
  5804. * @readonly
  5805. * @type {module:utils/config~Config}
  5806. */
  5807. this.config = new _ckeditor_ckeditor5_utils_src_config__WEBPACK_IMPORTED_MODULE_0__["default"]( config, this.constructor.defaultConfig );
  5808. const availablePlugins = this.constructor.builtinPlugins;
  5809. this.config.define( 'plugins', availablePlugins );
  5810. /**
  5811. * The plugins loaded and in use by this context instance.
  5812. *
  5813. * @readonly
  5814. * @type {module:core/plugincollection~PluginCollection}
  5815. */
  5816. this.plugins = new _plugincollection__WEBPACK_IMPORTED_MODULE_2__["default"]( this, availablePlugins );
  5817. const languageConfig = this.config.get( 'language' ) || {};
  5818. /**
  5819. * @readonly
  5820. * @type {module:utils/locale~Locale}
  5821. */
  5822. this.locale = new _ckeditor_ckeditor5_utils_src_locale__WEBPACK_IMPORTED_MODULE_3__["default"]( {
  5823. uiLanguage: typeof languageConfig === 'string' ? languageConfig : languageConfig.ui,
  5824. contentLanguage: this.config.get( 'language.content' )
  5825. } );
  5826. /**
  5827. * Shorthand for {@link module:utils/locale~Locale#t}.
  5828. *
  5829. * @see module:utils/locale~Locale#t
  5830. * @method #t
  5831. */
  5832. this.t = this.locale.t;
  5833. /**
  5834. * A list of editors that this context instance is injected to.
  5835. *
  5836. * @readonly
  5837. * @type {module:utils/collection~Collection}
  5838. */
  5839. this.editors = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__["default"]();
  5840. /**
  5841. * Reference to the editor which created the context.
  5842. * Null when the context was created outside of the editor.
  5843. *
  5844. * It is used to destroy the context when removing the editor that has created the context.
  5845. *
  5846. * @private
  5847. * @type {module:core/editor/editor~Editor|null}
  5848. */
  5849. this._contextOwner = null;
  5850. }
  5851. /**
  5852. * Loads and initializes plugins specified in the configuration.
  5853. *
  5854. * @returns {Promise.<module:core/plugin~LoadedPlugins>} A promise which resolves
  5855. * once the initialization is completed, providing an array of loaded plugins.
  5856. */
  5857. initPlugins() {
  5858. const plugins = this.config.get( 'plugins' ) || [];
  5859. const substitutePlugins = this.config.get( 'substitutePlugins' ) || [];
  5860. // Plugins for substitution should be checked as well.
  5861. for ( const Plugin of plugins.concat( substitutePlugins ) ) {
  5862. if ( typeof Plugin != 'function' ) {
  5863. /**
  5864. * Only a constructor function is allowed as a {@link module:core/contextplugin~ContextPlugin context plugin}.
  5865. *
  5866. * @error context-initplugins-constructor-only
  5867. */
  5868. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  5869. 'context-initplugins-constructor-only',
  5870. null,
  5871. { Plugin }
  5872. );
  5873. }
  5874. if ( Plugin.isContextPlugin !== true ) {
  5875. /**
  5876. * Only a plugin marked as a {@link module:core/contextplugin~ContextPlugin.isContextPlugin context plugin}
  5877. * is allowed to be used with a context.
  5878. *
  5879. * @error context-initplugins-invalid-plugin
  5880. */
  5881. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  5882. 'context-initplugins-invalid-plugin',
  5883. null,
  5884. { Plugin }
  5885. );
  5886. }
  5887. }
  5888. return this.plugins.init( plugins, [], substitutePlugins );
  5889. }
  5890. /**
  5891. * Destroys the context instance and all editors used with the context,
  5892. * releasing all resources used by the context.
  5893. *
  5894. * @returns {Promise} A promise that resolves once the context instance is fully destroyed.
  5895. */
  5896. destroy() {
  5897. return Promise.all( Array.from( this.editors, editor => editor.destroy() ) )
  5898. .then( () => this.plugins.destroy() );
  5899. }
  5900. /**
  5901. * Adds a reference to the editor which is used with this context.
  5902. *
  5903. * When the given editor has created the context, the reference to this editor will be stored
  5904. * as a {@link ~Context#_contextOwner}.
  5905. *
  5906. * This method should only be used by the editor.
  5907. *
  5908. * @protected
  5909. * @param {module:core/editor/editor~Editor} editor
  5910. * @param {Boolean} isContextOwner Stores the given editor as a context owner.
  5911. */
  5912. _addEditor( editor, isContextOwner ) {
  5913. if ( this._contextOwner ) {
  5914. /**
  5915. * Cannot add multiple editors to the context which is created by the editor.
  5916. *
  5917. * @error context-addeditor-private-context
  5918. */
  5919. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'context-addeditor-private-context' );
  5920. }
  5921. this.editors.add( editor );
  5922. if ( isContextOwner ) {
  5923. this._contextOwner = editor;
  5924. }
  5925. }
  5926. /**
  5927. * Removes a reference to the editor which was used with this context.
  5928. * When the context was created by the given editor, the context will be destroyed.
  5929. *
  5930. * This method should only be used by the editor.
  5931. *
  5932. * @protected
  5933. * @param {module:core/editor/editor~Editor} editor
  5934. * @return {Promise} A promise that resolves once the editor is removed from the context or when the context was destroyed.
  5935. */
  5936. _removeEditor( editor ) {
  5937. if ( this.editors.has( editor ) ) {
  5938. this.editors.remove( editor );
  5939. }
  5940. if ( this._contextOwner === editor ) {
  5941. return this.destroy();
  5942. }
  5943. return Promise.resolve();
  5944. }
  5945. /**
  5946. * Returns the context configuration which will be copied to the editors created using this context.
  5947. *
  5948. * The configuration returned by this method has the plugins configuration removed &mdash; plugins are shared with all editors
  5949. * through another mechanism.
  5950. *
  5951. * This method should only be used by the editor.
  5952. *
  5953. * @protected
  5954. * @returns {Object} Configuration as a plain object.
  5955. */
  5956. _getEditorConfig() {
  5957. const result = {};
  5958. for ( const name of this.config.names() ) {
  5959. if ( ![ 'plugins', 'removePlugins', 'extraPlugins' ].includes( name ) ) {
  5960. result[ name ] = this.config.get( name );
  5961. }
  5962. }
  5963. return result;
  5964. }
  5965. /**
  5966. * Creates and initializes a new context instance.
  5967. *
  5968. * const commonConfig = { ... }; // Configuration for all the plugins and editors.
  5969. * const editorPlugins = [ ... ]; // Regular plugins here.
  5970. *
  5971. * Context
  5972. * .create( {
  5973. * // Only context plugins here.
  5974. * plugins: [ ... ],
  5975. *
  5976. * // Configure the language for all the editors (it cannot be overwritten).
  5977. * language: { ... },
  5978. *
  5979. * // Configuration for context plugins.
  5980. * comments: { ... },
  5981. * ...
  5982. *
  5983. * // Default configuration for editor plugins.
  5984. * toolbar: { ... },
  5985. * image: { ... },
  5986. * ...
  5987. * } )
  5988. * .then( context => {
  5989. * const promises = [];
  5990. *
  5991. * promises.push( ClassicEditor.create(
  5992. * document.getElementById( 'editor1' ),
  5993. * {
  5994. * editorPlugins,
  5995. * context
  5996. * }
  5997. * ) );
  5998. *
  5999. * promises.push( ClassicEditor.create(
  6000. * document.getElementById( 'editor2' ),
  6001. * {
  6002. * editorPlugins,
  6003. * context,
  6004. * toolbar: { ... } // You can overwrite the configuration of the context.
  6005. * }
  6006. * ) );
  6007. *
  6008. * return Promise.all( promises );
  6009. * } );
  6010. *
  6011. * @param {Object} [config] The context configuration.
  6012. * @returns {Promise} A promise resolved once the context is ready. The promise resolves with the created context instance.
  6013. */
  6014. static create( config ) {
  6015. return new Promise( resolve => {
  6016. const context = new this( config );
  6017. resolve( context.initPlugins().then( () => context ) );
  6018. } );
  6019. }
  6020. }
  6021. /**
  6022. * An array of plugins built into the `Context` class.
  6023. *
  6024. * It is used in CKEditor 5 builds featuring `Context` to provide a list of context plugins which are later automatically initialized
  6025. * during the context initialization.
  6026. *
  6027. * They will be automatically initialized by `Context` unless `config.plugins` is passed.
  6028. *
  6029. * // Build some context plugins into the Context class first.
  6030. * Context.builtinPlugins = [ FooPlugin, BarPlugin ];
  6031. *
  6032. * // Normally, you need to define config.plugins, but since Context.builtinPlugins was
  6033. * // defined, now you can call create() without any configuration.
  6034. * Context
  6035. * .create()
  6036. * .then( context => {
  6037. * context.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
  6038. * context.plugins.get( BarPlugin ); // -> An instance of the Bar plugin.
  6039. * } );
  6040. *
  6041. * See also {@link module:core/context~Context.defaultConfig `Context.defaultConfig`}
  6042. * and {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}.
  6043. *
  6044. * @static
  6045. * @member {Array.<Function>} module:core/context~Context.builtinPlugins
  6046. */
  6047. /**
  6048. * The default configuration which is built into the `Context` class.
  6049. *
  6050. * It is used in CKEditor 5 builds featuring `Context` to provide the default configuration options which are later used during the
  6051. * context initialization.
  6052. *
  6053. * Context.defaultConfig = {
  6054. * foo: 1,
  6055. * bar: 2
  6056. * };
  6057. *
  6058. * Context
  6059. * .create()
  6060. * .then( context => {
  6061. * context.config.get( 'foo' ); // -> 1
  6062. * context.config.get( 'bar' ); // -> 2
  6063. * } );
  6064. *
  6065. * // The default options can be overridden by the configuration passed to create().
  6066. * Context
  6067. * .create( { bar: 3 } )
  6068. * .then( context => {
  6069. * context.config.get( 'foo' ); // -> 1
  6070. * context.config.get( 'bar' ); // -> 3
  6071. * } );
  6072. *
  6073. * See also {@link module:core/context~Context.builtinPlugins `Context.builtinPlugins`}
  6074. * and {@link module:core/editor/editor~Editor.defaultConfig `Editor.defaultConfig`}.
  6075. *
  6076. * @static
  6077. * @member {Object} module:core/context~Context.defaultConfig
  6078. */
  6079. /***/ }),
  6080. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js":
  6081. /*!********************************************************************!*\
  6082. !*** ./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js ***!
  6083. \********************************************************************/
  6084. /*! exports provided: default */
  6085. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6086. "use strict";
  6087. __webpack_require__.r(__webpack_exports__);
  6088. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ContextPlugin; });
  6089. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  6090. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  6091. /**
  6092. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  6093. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6094. */
  6095. /**
  6096. * @module core/contextplugin
  6097. */
  6098. /**
  6099. * The base class for {@link module:core/context~Context} plugin classes.
  6100. *
  6101. * A context plugin can either be initialized for an {@link module:core/editor/editor~Editor editor} or for
  6102. * a {@link module:core/context~Context context}. In other words, it can either
  6103. * work within one editor instance or with one or more editor instances that use a single context.
  6104. * It is the context plugin's role to implement handling for both modes.
  6105. *
  6106. * There are a few rules for interaction between the editor plugins and context plugins:
  6107. *
  6108. * * A context plugin can require another context plugin.
  6109. * * An {@link module:core/plugin~Plugin editor plugin} can require a context plugin.
  6110. * * A context plugin MUST NOT require an {@link module:core/plugin~Plugin editor plugin}.
  6111. *
  6112. * @implements module:core/plugin~PluginInterface
  6113. * @mixes module:utils/observablemixin~ObservableMixin
  6114. */
  6115. class ContextPlugin {
  6116. /**
  6117. * Creates a new plugin instance.
  6118. *
  6119. * @param {module:core/context~Context|module:core/editor/editor~Editor} context
  6120. */
  6121. constructor( context ) {
  6122. /**
  6123. * The context instance.
  6124. *
  6125. * @readonly
  6126. * @type {module:core/context~Context|module:core/editor/editor~Editor}
  6127. */
  6128. this.context = context;
  6129. }
  6130. /**
  6131. * @inheritDoc
  6132. */
  6133. destroy() {
  6134. this.stopListening();
  6135. }
  6136. /**
  6137. * @inheritDoc
  6138. */
  6139. static get isContextPlugin() {
  6140. return true;
  6141. }
  6142. }
  6143. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( ContextPlugin, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  6144. /***/ }),
  6145. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js":
  6146. /*!******************************************************************************!*\
  6147. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js ***!
  6148. \******************************************************************************/
  6149. /*! exports provided: default */
  6150. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6151. "use strict";
  6152. __webpack_require__.r(__webpack_exports__);
  6153. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditingKeystrokeHandler; });
  6154. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  6155. /**
  6156. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  6157. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6158. */
  6159. /**
  6160. * @module core/editingkeystrokehandler
  6161. */
  6162. /**
  6163. * A keystroke handler for editor editing. Its instance is available
  6164. * in {@link module:core/editor/editor~Editor#keystrokes} so plugins
  6165. * can register their keystrokes.
  6166. *
  6167. * E.g. an undo plugin would do this:
  6168. *
  6169. * editor.keystrokes.set( 'Ctrl+Z', 'undo' );
  6170. * editor.keystrokes.set( 'Ctrl+Shift+Z', 'redo' );
  6171. * editor.keystrokes.set( 'Ctrl+Y', 'redo' );
  6172. *
  6173. * @extends module:utils/keystrokehandler~KeystrokeHandler
  6174. */
  6175. class EditingKeystrokeHandler extends _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_0__["default"] {
  6176. /**
  6177. * Creates an instance of the keystroke handler.
  6178. *
  6179. * @param {module:core/editor/editor~Editor} editor
  6180. */
  6181. constructor( editor ) {
  6182. super();
  6183. /**
  6184. * The editor instance.
  6185. *
  6186. * @readonly
  6187. * @member {module:core/editor/editor~Editor}
  6188. */
  6189. this.editor = editor;
  6190. }
  6191. /**
  6192. * Registers a handler for the specified keystroke.
  6193. *
  6194. * The handler can be specified as a command name or a callback.
  6195. *
  6196. * @param {String|Array.<String|Number>} keystroke Keystroke defined in a format accepted by
  6197. * the {@link module:utils/keyboard~parseKeystroke} function.
  6198. * @param {Function|String} callback If a string is passed, then the keystroke will
  6199. * {@link module:core/editor/editor~Editor#execute execute a command}.
  6200. * If a function, then it will be called with the
  6201. * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and
  6202. * a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.
  6203. * @param {Object} [options={}] Additional options.
  6204. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of the keystroke
  6205. * callback. The higher the priority value the sooner the callback will be executed. Keystrokes having the same priority
  6206. * are called in the order they were added.
  6207. */
  6208. set( keystroke, callback, options = {} ) {
  6209. if ( typeof callback == 'string' ) {
  6210. const commandName = callback;
  6211. callback = ( evtData, cancel ) => {
  6212. this.editor.execute( commandName );
  6213. cancel();
  6214. };
  6215. }
  6216. super.set( keystroke, callback, options );
  6217. }
  6218. }
  6219. /***/ }),
  6220. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/editor.js":
  6221. /*!********************************************************************!*\
  6222. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/editor.js ***!
  6223. \********************************************************************/
  6224. /*! exports provided: default */
  6225. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6226. "use strict";
  6227. __webpack_require__.r(__webpack_exports__);
  6228. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Editor; });
  6229. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../context */ "./node_modules/@ckeditor/ckeditor5-core/src/context.js");
  6230. /* harmony import */ var _ckeditor_ckeditor5_utils_src_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/config */ "./node_modules/@ckeditor/ckeditor5-utils/src/config.js");
  6231. /* harmony import */ var _ckeditor_ckeditor5_engine_src_controller_editingcontroller__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/controller/editingcontroller */ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js");
  6232. /* harmony import */ var _plugincollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../plugincollection */ "./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js");
  6233. /* harmony import */ var _commandcollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../commandcollection */ "./node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js");
  6234. /* harmony import */ var _ckeditor_ckeditor5_engine_src_controller_datacontroller__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/controller/datacontroller */ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js");
  6235. /* harmony import */ var _ckeditor_ckeditor5_engine_src_conversion_conversion__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/conversion/conversion */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.js");
  6236. /* harmony import */ var _ckeditor_ckeditor5_engine_src_model_model__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/model/model */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/model.js");
  6237. /* harmony import */ var _editingkeystrokehandler__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../editingkeystrokehandler */ "./node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js");
  6238. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  6239. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  6240. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  6241. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_stylesmap__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/stylesmap */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js");
  6242. /**
  6243. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  6244. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6245. */
  6246. /**
  6247. * @module core/editor/editor
  6248. */
  6249. /**
  6250. * The class representing a basic, generic editor.
  6251. *
  6252. * Check out the list of its subclasses to learn about specific editor implementations.
  6253. *
  6254. * All editor implementations (like {@link module:editor-classic/classiceditor~ClassicEditor} or
  6255. * {@link module:editor-inline/inlineeditor~InlineEditor}) should extend this class. They can add their
  6256. * own methods and properties.
  6257. *
  6258. * When you are implementing a plugin, this editor represents the API
  6259. * which your plugin can expect to get when using its {@link module:core/plugin~Plugin#editor} property.
  6260. *
  6261. * This API should be sufficient in order to implement the "editing" part of your feature
  6262. * (schema definition, conversion, commands, keystrokes, etc.).
  6263. * It does not define the editor UI, which is available only if
  6264. * the specific editor implements also the {@link module:core/editor/editorwithui~EditorWithUI} interface
  6265. * (as most editor implementations do).
  6266. *
  6267. * @abstract
  6268. * @mixes module:utils/observablemixin~ObservableMixin
  6269. */
  6270. class Editor {
  6271. /**
  6272. * Creates a new instance of the editor class.
  6273. *
  6274. * Usually, not to be used directly. See the static {@link module:core/editor/editor~Editor.create `create()`} method.
  6275. *
  6276. * @param {Object} [config={}] The editor configuration.
  6277. */
  6278. constructor( config = {} ) {
  6279. // Prefer the language passed as the argument to the constructor instead of the constructor's `defaultConfig`, if both are set.
  6280. const language = config.language || ( this.constructor.defaultConfig && this.constructor.defaultConfig.language );
  6281. /**
  6282. * The editor context.
  6283. * When it is not provided through the configuration, the editor creates it.
  6284. *
  6285. * @protected
  6286. * @type {module:core/context~Context}
  6287. */
  6288. this._context = config.context || new _context__WEBPACK_IMPORTED_MODULE_0__["default"]( { language } );
  6289. this._context._addEditor( this, !config.context );
  6290. // Clone the plugins to make sure that the plugin array will not be shared
  6291. // between editors and make the watchdog feature work correctly.
  6292. const availablePlugins = Array.from( this.constructor.builtinPlugins || [] );
  6293. /**
  6294. * Stores all configurations specific to this editor instance.
  6295. *
  6296. * editor.config.get( 'image.toolbar' );
  6297. * // -> [ 'imageStyle:block', 'imageStyle:side', '|', 'toggleImageCaption', 'imageTextAlternative' ]
  6298. *
  6299. * @readonly
  6300. * @member {module:utils/config~Config}
  6301. */
  6302. this.config = new _ckeditor_ckeditor5_utils_src_config__WEBPACK_IMPORTED_MODULE_1__["default"]( config, this.constructor.defaultConfig );
  6303. this.config.define( 'plugins', availablePlugins );
  6304. this.config.define( this._context._getEditorConfig() );
  6305. /**
  6306. * The plugins loaded and in use by this editor instance.
  6307. *
  6308. * editor.plugins.get( 'ClipboardPipeline' ); // -> An instance of the clipboard pipeline plugin.
  6309. *
  6310. * @readonly
  6311. * @member {module:core/plugincollection~PluginCollection}
  6312. */
  6313. this.plugins = new _plugincollection__WEBPACK_IMPORTED_MODULE_3__["default"]( this, availablePlugins, this._context.plugins );
  6314. /**
  6315. * The locale instance.
  6316. *
  6317. * @readonly
  6318. * @type {module:utils/locale~Locale}
  6319. */
  6320. this.locale = this._context.locale;
  6321. /**
  6322. * Shorthand for {@link module:utils/locale~Locale#t}.
  6323. *
  6324. * @see module:utils/locale~Locale#t
  6325. * @method #t
  6326. */
  6327. this.t = this.locale.t;
  6328. /**
  6329. * Commands registered to the editor.
  6330. *
  6331. * Use the shorthand {@link #execute `editor.execute()`} method to execute commands:
  6332. *
  6333. * // Execute the bold command:
  6334. * editor.execute( 'bold' );
  6335. *
  6336. * // Check the state of the bold command:
  6337. * editor.commands.get( 'bold' ).value;
  6338. *
  6339. * @readonly
  6340. * @member {module:core/commandcollection~CommandCollection}
  6341. */
  6342. this.commands = new _commandcollection__WEBPACK_IMPORTED_MODULE_4__["default"]();
  6343. /**
  6344. * Indicates the editor life-cycle state.
  6345. *
  6346. * The editor is in one of the following states:
  6347. *
  6348. * * `initializing` &ndash; During the editor initialization (before
  6349. * {@link module:core/editor/editor~Editor.create `Editor.create()`}) finished its job.
  6350. * * `ready` &ndash; After the promise returned by the {@link module:core/editor/editor~Editor.create `Editor.create()`}
  6351. * method is resolved.
  6352. * * `destroyed` &ndash; Once the {@link #destroy `editor.destroy()`} method was called.
  6353. *
  6354. * @observable
  6355. * @member {'initializing'|'ready'|'destroyed'} #state
  6356. */
  6357. this.set( 'state', 'initializing' );
  6358. this.once( 'ready', () => ( this.state = 'ready' ), { priority: 'high' } );
  6359. this.once( 'destroy', () => ( this.state = 'destroyed' ), { priority: 'high' } );
  6360. /**
  6361. * Defines whether this editor is in read-only mode.
  6362. *
  6363. * In read-only mode the editor {@link #commands commands} are disabled so it is not possible
  6364. * to modify the document by using them. Also, the editable element(s) become non-editable.
  6365. *
  6366. * In order to make the editor read-only, you can set this value directly:
  6367. *
  6368. * editor.isReadOnly = true;
  6369. *
  6370. * @observable
  6371. * @member {Boolean} #isReadOnly
  6372. */
  6373. this.set( 'isReadOnly', false );
  6374. /**
  6375. * The editor's model.
  6376. *
  6377. * The central point of the editor's abstract data model.
  6378. *
  6379. * @readonly
  6380. * @member {module:engine/model/model~Model}
  6381. */
  6382. this.model = new _ckeditor_ckeditor5_engine_src_model_model__WEBPACK_IMPORTED_MODULE_7__["default"]();
  6383. const stylesProcessor = new _ckeditor_ckeditor5_engine_src_view_stylesmap__WEBPACK_IMPORTED_MODULE_12__["StylesProcessor"]();
  6384. /**
  6385. * The {@link module:engine/controller/datacontroller~DataController data controller}.
  6386. * Used e.g. for setting and retrieving the editor data.
  6387. *
  6388. * @readonly
  6389. * @member {module:engine/controller/datacontroller~DataController}
  6390. */
  6391. this.data = new _ckeditor_ckeditor5_engine_src_controller_datacontroller__WEBPACK_IMPORTED_MODULE_5__["default"]( this.model, stylesProcessor );
  6392. /**
  6393. * The {@link module:engine/controller/editingcontroller~EditingController editing controller}.
  6394. * Controls user input and rendering the content for editing.
  6395. *
  6396. * @readonly
  6397. * @member {module:engine/controller/editingcontroller~EditingController}
  6398. */
  6399. this.editing = new _ckeditor_ckeditor5_engine_src_controller_editingcontroller__WEBPACK_IMPORTED_MODULE_2__["default"]( this.model, stylesProcessor );
  6400. this.editing.view.document.bind( 'isReadOnly' ).to( this );
  6401. /**
  6402. * Conversion manager through which you can register model-to-view and view-to-model converters.
  6403. *
  6404. * See the {@link module:engine/conversion/conversion~Conversion} documentation to learn how to add converters.
  6405. *
  6406. * @readonly
  6407. * @member {module:engine/conversion/conversion~Conversion}
  6408. */
  6409. this.conversion = new _ckeditor_ckeditor5_engine_src_conversion_conversion__WEBPACK_IMPORTED_MODULE_6__["default"]( [ this.editing.downcastDispatcher, this.data.downcastDispatcher ], this.data.upcastDispatcher );
  6410. this.conversion.addAlias( 'dataDowncast', this.data.downcastDispatcher );
  6411. this.conversion.addAlias( 'editingDowncast', this.editing.downcastDispatcher );
  6412. /**
  6413. * An instance of the {@link module:core/editingkeystrokehandler~EditingKeystrokeHandler}.
  6414. *
  6415. * It allows setting simple keystrokes:
  6416. *
  6417. * // Execute the bold command on Ctrl+E:
  6418. * editor.keystrokes.set( 'Ctrl+E', 'bold' );
  6419. *
  6420. * // Execute your own callback:
  6421. * editor.keystrokes.set( 'Ctrl+E', ( data, cancel ) => {
  6422. * console.log( data.keyCode );
  6423. *
  6424. * // Prevent the default (native) action and stop the underlying keydown event
  6425. * // so no other editor feature will interfere.
  6426. * cancel();
  6427. * } );
  6428. *
  6429. * Note: Certain typing-oriented keystrokes (like <kbd>Backspace</kbd> or <kbd>Enter</kbd>) are handled
  6430. * by a low-level mechanism and trying to listen to them via the keystroke handler will not work reliably.
  6431. * To handle these specific keystrokes, see the events fired by the
  6432. * {@link module:engine/view/document~Document editing view document} (`editor.editing.view.document`).
  6433. *
  6434. * @readonly
  6435. * @member {module:core/editingkeystrokehandler~EditingKeystrokeHandler}
  6436. */
  6437. this.keystrokes = new _editingkeystrokehandler__WEBPACK_IMPORTED_MODULE_8__["default"]( this );
  6438. this.keystrokes.listenTo( this.editing.view.document );
  6439. }
  6440. /**
  6441. * Loads and initializes plugins specified in the configuration.
  6442. *
  6443. * @returns {Promise.<module:core/plugin~LoadedPlugins>} A promise which resolves
  6444. * once the initialization is completed, providing an array of loaded plugins.
  6445. */
  6446. initPlugins() {
  6447. const config = this.config;
  6448. const plugins = config.get( 'plugins' );
  6449. const removePlugins = config.get( 'removePlugins' ) || [];
  6450. const extraPlugins = config.get( 'extraPlugins' ) || [];
  6451. const substitutePlugins = config.get( 'substitutePlugins' ) || [];
  6452. return this.plugins.init( plugins.concat( extraPlugins ), removePlugins, substitutePlugins );
  6453. }
  6454. /**
  6455. * Destroys the editor instance, releasing all resources used by it.
  6456. *
  6457. * **Note** The editor cannot be destroyed during the initialization phase so if it is called
  6458. * while the editor {@link #state is being initialized}, it will wait for the editor initialization before destroying it.
  6459. *
  6460. * @fires destroy
  6461. * @returns {Promise} A promise that resolves once the editor instance is fully destroyed.
  6462. */
  6463. destroy() {
  6464. let readyPromise = Promise.resolve();
  6465. if ( this.state == 'initializing' ) {
  6466. readyPromise = new Promise( resolve => this.once( 'ready', resolve ) );
  6467. }
  6468. return readyPromise
  6469. .then( () => {
  6470. this.fire( 'destroy' );
  6471. this.stopListening();
  6472. this.commands.destroy();
  6473. } )
  6474. .then( () => this.plugins.destroy() )
  6475. .then( () => {
  6476. this.model.destroy();
  6477. this.data.destroy();
  6478. this.editing.destroy();
  6479. this.keystrokes.destroy();
  6480. } )
  6481. // Remove the editor from the context.
  6482. // When the context was created by this editor, the context will be destroyed.
  6483. .then( () => this._context._removeEditor( this ) );
  6484. }
  6485. /**
  6486. * Executes the specified command with given parameters.
  6487. *
  6488. * Shorthand for:
  6489. *
  6490. * editor.commands.get( commandName ).execute( ... );
  6491. *
  6492. * @param {String} commandName The name of the command to execute.
  6493. * @param {*} [...commandParams] Command parameters.
  6494. * @returns {*} The value returned by the {@link module:core/commandcollection~CommandCollection#execute `commands.execute()`}.
  6495. */
  6496. execute( ...args ) {
  6497. try {
  6498. return this.commands.execute( ...args );
  6499. } catch ( err ) {
  6500. // @if CK_DEBUG // throw err;
  6501. /* istanbul ignore next */
  6502. _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__["default"].rethrowUnexpectedError( err, this );
  6503. }
  6504. }
  6505. /**
  6506. * Focuses the editor.
  6507. *
  6508. * **Note** To explicitly focus the editing area of the editor, use the
  6509. * {@link module:engine/view/view~View#focus `editor.editing.view.focus()`} method of the editing view.
  6510. *
  6511. * Check out the {@glink framework/guides/deep-dive/ui/focus-tracking#focus-in-the-editor-ui Focus in the editor UI} section
  6512. * of the {@glink framework/guides/deep-dive/ui/focus-tracking Deep dive into focus tracking} guide to learn more.
  6513. */
  6514. focus() {
  6515. this.editing.view.focus();
  6516. }
  6517. /**
  6518. * Creates and initializes a new editor instance.
  6519. *
  6520. * This is an abstract method. Every editor type needs to implement its own initialization logic.
  6521. *
  6522. * See the `create()` methods of the existing editor types to learn how to use them:
  6523. *
  6524. * * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}
  6525. * * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}
  6526. * * {@link module:editor-decoupled/decouplededitor~DecoupledEditor.create `DecoupledEditor.create()`}
  6527. * * {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`}
  6528. *
  6529. * @abstract
  6530. * @method module:core/editor/editor~Editor.create
  6531. */
  6532. }
  6533. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_10__["default"])( Editor, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_9__["default"] );
  6534. /**
  6535. * Fired when the {@link module:engine/controller/datacontroller~DataController#event:ready data} and all additional
  6536. * editor components are ready.
  6537. *
  6538. * Note: This event is most useful for plugin developers. When integrating the editor with your website or
  6539. * application, you do not have to listen to `editor#ready` because when the promise returned by the static
  6540. * {@link module:core/editor/editor~Editor.create `Editor.create()`} event is resolved, the editor is already ready.
  6541. * In fact, since the first moment when the editor instance is available to you is inside `then()`'s callback,
  6542. * you cannot even add a listener to the `editor#ready` event.
  6543. *
  6544. * See also the {@link #state `editor.state`} property.
  6545. *
  6546. * @event ready
  6547. */
  6548. /**
  6549. * Fired when this editor instance is destroyed. The editor at this point is not usable and this event should be used to
  6550. * perform the clean-up in any plugin.
  6551. *
  6552. *
  6553. * See also the {@link #state `editor.state`} property.
  6554. *
  6555. * @event destroy
  6556. */
  6557. /**
  6558. * This error is thrown when trying to pass a `<textarea>` element to a `create()` function of an editor class.
  6559. *
  6560. * The only editor type which can be initialized on `<textarea>` elements is
  6561. * the {@glink builds/guides/predefined-builds/overview#classic-editor classic editor}.
  6562. * This editor hides the passed element and inserts its own UI next to it. Other types of editors reuse the passed element as their root
  6563. * editable element and therefore `<textarea>` is not appropriate for them. Use a `<div>` or another text container instead:
  6564. *
  6565. * <div id="editor">
  6566. * <p>Initial content.</p>
  6567. * </div>
  6568. *
  6569. * @error editor-wrong-element
  6570. */
  6571. /**
  6572. * An array of plugins built into this editor class.
  6573. *
  6574. * It is used in CKEditor 5 builds to provide a list of plugins which are later automatically initialized
  6575. * during the editor initialization.
  6576. *
  6577. * They will be automatically initialized by the editor, unless listed in `config.removePlugins` and
  6578. * unless `config.plugins` is passed.
  6579. *
  6580. * // Build some plugins into the editor class first.
  6581. * ClassicEditor.builtinPlugins = [ FooPlugin, BarPlugin ];
  6582. *
  6583. * // Normally, you need to define config.plugins, but since ClassicEditor.builtinPlugins was
  6584. * // defined, now you can call create() without any configuration.
  6585. * ClassicEditor
  6586. * .create( sourceElement )
  6587. * .then( editor => {
  6588. * editor.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
  6589. * editor.plugins.get( BarPlugin ); // -> An instance of the Bar plugin.
  6590. * } );
  6591. *
  6592. * ClassicEditor
  6593. * .create( sourceElement, {
  6594. * // Do not initialize these plugins (note: it is defined by a string):
  6595. * removePlugins: [ 'Foo' ]
  6596. * } )
  6597. * .then( editor => {
  6598. * editor.plugins.get( FooPlugin ); // -> Undefined.
  6599. * editor.config.get( BarPlugin ); // -> An instance of the Bar plugin.
  6600. * } );
  6601. *
  6602. * ClassicEditor
  6603. * .create( sourceElement, {
  6604. * // Load only this plugin. It can also be defined by a string if
  6605. * // this plugin was built into the editor class.
  6606. * plugins: [ FooPlugin ]
  6607. * } )
  6608. * .then( editor => {
  6609. * editor.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
  6610. * editor.config.get( BarPlugin ); // -> Undefined.
  6611. * } );
  6612. *
  6613. * See also {@link module:core/editor/editor~Editor.defaultConfig}.
  6614. *
  6615. * @static
  6616. * @member {Array.<Function>} module:core/editor/editor~Editor.builtinPlugins
  6617. */
  6618. /**
  6619. * The default configuration which is built into the editor class.
  6620. *
  6621. * It is used in CKEditor 5 builds to provide the default configuration options which are later used during the editor initialization.
  6622. *
  6623. * ClassicEditor.defaultConfig = {
  6624. * foo: 1,
  6625. * bar: 2
  6626. * };
  6627. *
  6628. * ClassicEditor
  6629. * .create( sourceElement )
  6630. * .then( editor => {
  6631. * editor.config.get( 'foo' ); // -> 1
  6632. * editor.config.get( 'bar' ); // -> 2
  6633. * } );
  6634. *
  6635. * // The default options can be overridden by the configuration passed to create().
  6636. * ClassicEditor
  6637. * .create( sourceElement, { bar: 3 } )
  6638. * .then( editor => {
  6639. * editor.config.get( 'foo' ); // -> 1
  6640. * editor.config.get( 'bar' ); // -> 3
  6641. * } );
  6642. *
  6643. * See also {@link module:core/editor/editor~Editor.builtinPlugins}.
  6644. *
  6645. * @static
  6646. * @member {Object} module:core/editor/editor~Editor.defaultConfig
  6647. */
  6648. /***/ }),
  6649. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/editorui.js":
  6650. /*!**********************************************************************!*\
  6651. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/editorui.js ***!
  6652. \**********************************************************************/
  6653. /*! exports provided: default */
  6654. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6655. "use strict";
  6656. __webpack_require__.r(__webpack_exports__);
  6657. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditorUI; });
  6658. /* harmony import */ var _ckeditor_ckeditor5_ui_src_componentfactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/componentfactory */ "./node_modules/@ckeditor/ckeditor5-ui/src/componentfactory.js");
  6659. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  6660. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  6661. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  6662. /**
  6663. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  6664. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6665. */
  6666. /**
  6667. * @module core/editor/editorui
  6668. */
  6669. /* globals console */
  6670. /**
  6671. * A class providing the minimal interface that is required to successfully bootstrap any editor UI.
  6672. *
  6673. * @mixes module:utils/emittermixin~EmitterMixin
  6674. */
  6675. class EditorUI {
  6676. /**
  6677. * Creates an instance of the editor UI class.
  6678. *
  6679. * @param {module:core/editor/editor~Editor} editor The editor instance.
  6680. */
  6681. constructor( editor ) {
  6682. /**
  6683. * The editor that the UI belongs to.
  6684. *
  6685. * @readonly
  6686. * @member {module:core/editor/editor~Editor} #editor
  6687. */
  6688. this.editor = editor;
  6689. /**
  6690. * An instance of the {@link module:ui/componentfactory~ComponentFactory}, a registry used by plugins
  6691. * to register factories of specific UI components.
  6692. *
  6693. * @readonly
  6694. * @member {module:ui/componentfactory~ComponentFactory} #componentFactory
  6695. */
  6696. this.componentFactory = new _ckeditor_ckeditor5_ui_src_componentfactory__WEBPACK_IMPORTED_MODULE_0__["default"]( editor );
  6697. /**
  6698. * Stores the information about the editor UI focus and propagates it so various plugins and components
  6699. * are unified as a focus group.
  6700. *
  6701. * @readonly
  6702. * @member {module:utils/focustracker~FocusTracker} #focusTracker
  6703. */
  6704. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__["default"]();
  6705. /**
  6706. * Stores viewport offsets from every direction.
  6707. *
  6708. * Viewport offset can be used to constrain balloons or other UI elements into an element smaller than the viewport.
  6709. * This can be useful if there are any other absolutely positioned elements that may interfere with editor UI.
  6710. *
  6711. * Example `editor.ui.viewportOffset` returns:
  6712. *
  6713. * ```js
  6714. * {
  6715. * top: 50,
  6716. * right: 50,
  6717. * bottom: 50,
  6718. * left: 50
  6719. * }
  6720. * ```
  6721. *
  6722. * This property can be overriden after editor already being initialized:
  6723. *
  6724. * ```js
  6725. * editor.ui.viewportOffset = {
  6726. * top: 100,
  6727. * right: 0,
  6728. * bottom: 0,
  6729. * left: 0
  6730. * };
  6731. * ```
  6732. *
  6733. * @observable
  6734. * @member {Object} #viewportOffset
  6735. */
  6736. this.set( 'viewportOffset', this._readViewportOffsetFromConfig() );
  6737. /**
  6738. * Stores all editable elements used by the editor instance.
  6739. *
  6740. * @private
  6741. * @member {Map.<String,HTMLElement>}
  6742. */
  6743. this._editableElementsMap = new Map();
  6744. // Informs UI components that should be refreshed after layout change.
  6745. this.listenTo( editor.editing.view.document, 'layoutChanged', () => this.update() );
  6746. }
  6747. /**
  6748. * The main (outermost) DOM element of the editor UI.
  6749. *
  6750. * For example, in {@link module:editor-classic/classiceditor~ClassicEditor} it is a `<div>` which
  6751. * wraps the editable element and the toolbar. In {@link module:editor-inline/inlineeditor~InlineEditor}
  6752. * it is the editable element itself (as there is no other wrapper). However, in
  6753. * {@link module:editor-decoupled/decouplededitor~DecoupledEditor} it is set to `null` because this editor does not
  6754. * come with a single "main" HTML element (its editable element and toolbar are separate).
  6755. *
  6756. * This property can be understood as a shorthand for retrieving the element that a specific editor integration
  6757. * considers to be its main DOM element.
  6758. *
  6759. * @readonly
  6760. * @member {HTMLElement|null} #element
  6761. */
  6762. get element() {
  6763. return null;
  6764. }
  6765. /**
  6766. * Fires the {@link module:core/editor/editorui~EditorUI#event:update `update`} event.
  6767. *
  6768. * This method should be called when the editor UI (e.g. positions of its balloons) needs to be updated due to
  6769. * some environmental change which CKEditor 5 is not aware of (e.g. resize of a container in which it is used).
  6770. */
  6771. update() {
  6772. this.fire( 'update' );
  6773. }
  6774. /**
  6775. * Destroys the UI.
  6776. */
  6777. destroy() {
  6778. this.stopListening();
  6779. this.focusTracker.destroy();
  6780. // Clean–up the references to the CKEditor instance stored in the native editable DOM elements.
  6781. for ( const domElement of this._editableElementsMap.values() ) {
  6782. domElement.ckeditorInstance = null;
  6783. }
  6784. this._editableElementsMap = new Map();
  6785. }
  6786. /**
  6787. * Store the native DOM editable element used by the editor under
  6788. * a unique name.
  6789. *
  6790. * @param {String} rootName The unique name of the editable element.
  6791. * @param {HTMLElement} domElement The native DOM editable element.
  6792. */
  6793. setEditableElement( rootName, domElement ) {
  6794. this._editableElementsMap.set( rootName, domElement );
  6795. // Put a reference to the CKEditor instance in the editable native DOM element.
  6796. // It helps 3rd–party software (browser extensions, other libraries) access and recognize
  6797. // CKEditor 5 instances (editing roots) and use their API (there is no global editor
  6798. // instance registry).
  6799. if ( !domElement.ckeditorInstance ) {
  6800. domElement.ckeditorInstance = this.editor;
  6801. }
  6802. }
  6803. /**
  6804. * Returns the editable editor element with the given name or null if editable does not exist.
  6805. *
  6806. * @param {String} [rootName=main] The editable name.
  6807. * @returns {HTMLElement|undefined}
  6808. */
  6809. getEditableElement( rootName = 'main' ) {
  6810. return this._editableElementsMap.get( rootName );
  6811. }
  6812. /**
  6813. * Returns array of names of all editor editable elements.
  6814. *
  6815. * @returns {Iterable.<String>}
  6816. */
  6817. getEditableElementsNames() {
  6818. return this._editableElementsMap.keys();
  6819. }
  6820. /**
  6821. * Stores all editable elements used by the editor instance.
  6822. *
  6823. * @protected
  6824. * @deprecated
  6825. * @member {Map.<String,HTMLElement>}
  6826. */
  6827. get _editableElements() {
  6828. /**
  6829. * The {@link module:core/editor/editorui~EditorUI#_editableElements `EditorUI#_editableElements`} property has been
  6830. * deprecated and will be removed in the near future. Please use {@link #setEditableElement `setEditableElement()`} and
  6831. * {@link #getEditableElement `getEditableElement()`} methods instead.
  6832. *
  6833. * @error editor-ui-deprecated-editable-elements
  6834. * @param {module:core/editor/editorui~EditorUI} editorUI Editor UI instance the deprecated property belongs to.
  6835. */
  6836. console.warn(
  6837. 'editor-ui-deprecated-editable-elements: ' +
  6838. 'The EditorUI#_editableElements property has been deprecated and will be removed in the near future.',
  6839. { editorUI: this } );
  6840. return this._editableElementsMap;
  6841. }
  6842. /**
  6843. * Returns viewport offsets object:
  6844. *
  6845. * ```js
  6846. * {
  6847. * top: Number,
  6848. * right: Number,
  6849. * bottom: Number,
  6850. * left: Number
  6851. * }
  6852. * ```
  6853. *
  6854. * Only top property is currently supported.
  6855. *
  6856. * @private
  6857. * @return {Object}
  6858. */
  6859. _readViewportOffsetFromConfig() {
  6860. const editor = this.editor;
  6861. const viewportOffsetConfig = editor.config.get( 'ui.viewportOffset' );
  6862. if ( viewportOffsetConfig ) {
  6863. return viewportOffsetConfig;
  6864. }
  6865. const legacyOffsetConfig = editor.config.get( 'toolbar.viewportTopOffset' );
  6866. // Fall back to deprecated toolbar config.
  6867. if ( legacyOffsetConfig ) {
  6868. /**
  6869. * The {@link module:core/editor/editorconfig~EditorConfig#toolbar `EditorConfig#toolbar.viewportTopOffset`}
  6870. * property has been deprecated and will be removed in the near future. Please use
  6871. * {@link module:core/editor/editorconfig~EditorConfig#ui `EditorConfig#ui.viewportOffset`} instead.
  6872. *
  6873. * @error editor-ui-deprecated-viewport-offset-config
  6874. */
  6875. console.warn(
  6876. 'editor-ui-deprecated-viewport-offset-config: ' +
  6877. 'The `toolbar.vieportTopOffset` configuration option is deprecated. ' +
  6878. 'It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead.'
  6879. );
  6880. return { top: legacyOffsetConfig };
  6881. }
  6882. // More keys to come in the future.
  6883. return { top: 0 };
  6884. }
  6885. /**
  6886. * Fired when the editor UI is ready.
  6887. *
  6888. * Fired before {@link module:engine/controller/datacontroller~DataController#event:ready}.
  6889. *
  6890. * @event ready
  6891. */
  6892. /**
  6893. * Fired whenever the UI (all related components) should be refreshed.
  6894. *
  6895. * **Note:**: The event is fired after each {@link module:engine/view/document~Document#event:layoutChanged}.
  6896. * It can also be fired manually via the {@link module:core/editor/editorui~EditorUI#update} method.
  6897. *
  6898. * @event update
  6899. */
  6900. }
  6901. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( EditorUI, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  6902. /***/ }),
  6903. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/attachtoform.js":
  6904. /*!********************************************************************************!*\
  6905. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/attachtoform.js ***!
  6906. \********************************************************************************/
  6907. /*! exports provided: default */
  6908. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6909. "use strict";
  6910. __webpack_require__.r(__webpack_exports__);
  6911. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return attachToForm; });
  6912. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  6913. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  6914. /**
  6915. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  6916. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6917. */
  6918. /**
  6919. * @module core/editor/utils/attachtoform
  6920. */
  6921. /**
  6922. * Checks if the editor is initialized on a `<textarea>` element that belongs to a form. If yes, it updates the editor's element
  6923. * content before submitting the form.
  6924. *
  6925. * This helper requires the {@link module:core/editor/utils/elementapimixin~ElementApi ElementApi interface}.
  6926. *
  6927. * @param {module:core/editor/editor~Editor} editor Editor instance.
  6928. */
  6929. function attachToForm( editor ) {
  6930. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isFunction"])( editor.updateSourceElement ) ) {
  6931. /**
  6932. * The editor passed to `attachToForm()` must implement the
  6933. * {@link module:core/editor/utils/elementapimixin~ElementApi} interface.
  6934. *
  6935. * @error attachtoform-missing-elementapi-interface
  6936. */
  6937. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  6938. 'attachtoform-missing-elementapi-interface',
  6939. editor
  6940. );
  6941. }
  6942. const sourceElement = editor.sourceElement;
  6943. // Only when replacing a textarea which is inside of a form element.
  6944. if ( sourceElement && sourceElement.tagName.toLowerCase() === 'textarea' && sourceElement.form ) {
  6945. let originalSubmit;
  6946. const form = sourceElement.form;
  6947. const onSubmit = () => editor.updateSourceElement();
  6948. // Replace the original form#submit() to call a custom submit function first.
  6949. // Check if #submit is a function because the form might have an input named "submit".
  6950. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isFunction"])( form.submit ) ) {
  6951. originalSubmit = form.submit;
  6952. form.submit = () => {
  6953. onSubmit();
  6954. originalSubmit.apply( form );
  6955. };
  6956. }
  6957. // Update the replaced textarea with data before each form#submit event.
  6958. form.addEventListener( 'submit', onSubmit );
  6959. // Remove the submit listener and revert the original submit method on
  6960. // editor#destroy.
  6961. editor.on( 'destroy', () => {
  6962. form.removeEventListener( 'submit', onSubmit );
  6963. if ( originalSubmit ) {
  6964. form.submit = originalSubmit;
  6965. }
  6966. } );
  6967. }
  6968. }
  6969. /***/ }),
  6970. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin.js":
  6971. /*!********************************************************************************!*\
  6972. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin.js ***!
  6973. \********************************************************************************/
  6974. /*! exports provided: default */
  6975. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6976. "use strict";
  6977. __webpack_require__.r(__webpack_exports__);
  6978. /**
  6979. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  6980. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6981. */
  6982. /**
  6983. * @module core/editor/utils/dataapimixin
  6984. */
  6985. /**
  6986. * Implementation of the {@link module:core/editor/utils/dataapimixin~DataApi}.
  6987. *
  6988. * @mixin DataApiMixin
  6989. * @implements module:core/editor/utils/dataapimixin~DataApi
  6990. */
  6991. const DataApiMixin = {
  6992. /**
  6993. * @inheritDoc
  6994. */
  6995. setData( data ) {
  6996. this.data.set( data );
  6997. },
  6998. /**
  6999. * @inheritDoc
  7000. */
  7001. getData( options ) {
  7002. return this.data.get( options );
  7003. }
  7004. };
  7005. /* harmony default export */ __webpack_exports__["default"] = (DataApiMixin);
  7006. /**
  7007. * Interface defining editor methods for setting and getting data to and from the editor's main root element
  7008. * using the {@link module:core/editor/editor~Editor#data data pipeline}.
  7009. *
  7010. * This interface is not a part of the {@link module:core/editor/editor~Editor} class because one may want to implement
  7011. * an editor with multiple root elements, in which case the methods for setting and getting data will need to be implemented
  7012. * differently.
  7013. *
  7014. * @interface DataApi
  7015. */
  7016. /**
  7017. * Sets the data in the editor.
  7018. *
  7019. * editor.setData( '<p>This is editor!</p>' );
  7020. *
  7021. * By default the editor accepts HTML. This can be controlled by injecting a different data processor.
  7022. * See the {@glink features/markdown Markdown output} guide for more details.
  7023. *
  7024. * Note: Not only is the format of the data configurable, but the type of the `setData()`'s parameter does not
  7025. * have to be a string either. You can e.g. accept an object or a DOM `DocumentFragment` if you consider this
  7026. * the right format for you.
  7027. *
  7028. * @method #setData
  7029. * @param {String} data Input data.
  7030. */
  7031. /**
  7032. * Gets the data from the editor.
  7033. *
  7034. * editor.getData(); // -> '<p>This is editor!</p>'
  7035. *
  7036. * By default the editor outputs HTML. This can be controlled by injecting a different data processor.
  7037. * See the {@glink features/markdown Markdown output} guide for more details.
  7038. *
  7039. * Note: Not only is the format of the data configurable, but the type of the `getData()`'s return value does not
  7040. * have to be a string either. You can e.g. return an object or a DOM `DocumentFragment` if you consider this
  7041. * the right format for you.
  7042. *
  7043. * @method #getData
  7044. * @param {Object} [options] Additional configuration for the retrieved data.
  7045. * Editor features may introduce more configuration options that can be set through this parameter.
  7046. * @param {String} [options.rootName='main'] Root name.
  7047. * @param {String} [options.trim='empty'] Whether returned data should be trimmed. This option is set to `'empty'` by default,
  7048. * which means that whenever editor content is considered empty, an empty string is returned. To turn off trimming
  7049. * use `'none'`. In such cases exact content will be returned (for example `'<p>&nbsp;</p>'` for an empty editor).
  7050. * @returns {String} Output data.
  7051. */
  7052. /***/ }),
  7053. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin.js":
  7054. /*!***********************************************************************************!*\
  7055. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin.js ***!
  7056. \***********************************************************************************/
  7057. /*! exports provided: default */
  7058. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7059. "use strict";
  7060. __webpack_require__.r(__webpack_exports__);
  7061. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  7062. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_setdatainelement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/setdatainelement */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js");
  7063. /**
  7064. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  7065. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  7066. */
  7067. /**
  7068. * @module core/editor/utils/elementapimixin
  7069. */
  7070. /**
  7071. * Implementation of the {@link module:core/editor/utils/elementapimixin~ElementApi}.
  7072. *
  7073. * @mixin ElementApiMixin
  7074. * @implements module:core/editor/utils/elementapimixin~ElementApi
  7075. */
  7076. const ElementApiMixin = {
  7077. /**
  7078. * @inheritDoc
  7079. */
  7080. updateSourceElement() {
  7081. if ( !this.sourceElement ) {
  7082. /**
  7083. * Cannot update the source element of a detached editor.
  7084. *
  7085. * The {@link ~ElementApi#updateSourceElement `updateSourceElement()`} method cannot be called if you did not
  7086. * pass an element to `Editor.create()`.
  7087. *
  7088. * @error editor-missing-sourceelement
  7089. */
  7090. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  7091. 'editor-missing-sourceelement',
  7092. this
  7093. );
  7094. }
  7095. Object(_ckeditor_ckeditor5_utils_src_dom_setdatainelement__WEBPACK_IMPORTED_MODULE_1__["default"])( this.sourceElement, this.data.get() );
  7096. }
  7097. };
  7098. /* harmony default export */ __webpack_exports__["default"] = (ElementApiMixin);
  7099. /**
  7100. * Interface describing an editor that replaced a DOM element (was "initialized on an element").
  7101. *
  7102. * Such an editor should provide a method to
  7103. * {@link module:core/editor/utils/elementapimixin~ElementApi#updateSourceElement update the replaced element with the current data}.
  7104. *
  7105. * @interface ElementApi
  7106. */
  7107. /**
  7108. * The element on which the editor has been initialized.
  7109. *
  7110. * @readonly
  7111. * @member {HTMLElement} #sourceElement
  7112. */
  7113. /**
  7114. * Updates the {@link #sourceElement editor source element}'s content with the data.
  7115. *
  7116. * @method #updateSourceElement
  7117. */
  7118. /***/ }),
  7119. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/securesourceelement.js":
  7120. /*!***************************************************************************************!*\
  7121. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/securesourceelement.js ***!
  7122. \***************************************************************************************/
  7123. /*! exports provided: default */
  7124. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7125. "use strict";
  7126. __webpack_require__.r(__webpack_exports__);
  7127. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return secureSourceElement; });
  7128. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  7129. /**
  7130. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  7131. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  7132. */
  7133. /**
  7134. * @module core/editor/utils/securesourceelement
  7135. */
  7136. /**
  7137. * Marks the source element on which the editor was initialized. This prevents other editor instances from using this element.
  7138. *
  7139. * Running multiple editor instances on the same source element causes various issues and it is
  7140. * crucial this helper is called as soon as the source element is known to prevent collisions.
  7141. *
  7142. * @param {module:core/editor/editor~Editor} editor Editor instance.
  7143. */
  7144. function secureSourceElement( editor ) {
  7145. const sourceElement = editor.sourceElement;
  7146. // If the editor was initialized without specifying an element, we don't need to secure anything.
  7147. if ( !sourceElement ) {
  7148. return;
  7149. }
  7150. if ( sourceElement.ckeditorInstance ) {
  7151. /**
  7152. * A DOM element used to create the editor (e.g.
  7153. * {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`})
  7154. * has already been used to create another editor instance. Make sure each editor is
  7155. * created with an unique DOM element.
  7156. *
  7157. * @error editor-source-element-already-used
  7158. * @param {HTMLElement} element DOM element that caused the collision.
  7159. */
  7160. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  7161. 'editor-source-element-already-used',
  7162. editor
  7163. );
  7164. }
  7165. sourceElement.ckeditorInstance = editor;
  7166. editor.once( 'destroy', () => {
  7167. delete sourceElement.ckeditorInstance;
  7168. } );
  7169. }
  7170. /***/ }),
  7171. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/index.js":
  7172. /*!************************************************************!*\
  7173. !*** ./node_modules/@ckeditor/ckeditor5-core/src/index.js ***!
  7174. \************************************************************/
  7175. /*! exports provided: Plugin, Command, MultiCommand, Context, ContextPlugin, Editor, EditorUI, attachToForm, DataApiMixin, ElementApiMixin, secureSourceElement, PendingActions, icons */
  7176. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7177. "use strict";
  7178. __webpack_require__.r(__webpack_exports__);
  7179. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "icons", function() { return icons; });
  7180. /* harmony import */ var _plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  7181. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Plugin", function() { return _plugin__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  7182. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  7183. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return _command__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  7184. /* harmony import */ var _multicommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./multicommand */ "./node_modules/@ckeditor/ckeditor5-core/src/multicommand.js");
  7185. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiCommand", function() { return _multicommand__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  7186. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./context */ "./node_modules/@ckeditor/ckeditor5-core/src/context.js");
  7187. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return _context__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  7188. /* harmony import */ var _contextplugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./contextplugin */ "./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js");
  7189. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContextPlugin", function() { return _contextplugin__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  7190. /* harmony import */ var _editor_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./editor/editor */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/editor.js");
  7191. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Editor", function() { return _editor_editor__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  7192. /* harmony import */ var _editor_editorui__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editor/editorui */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/editorui.js");
  7193. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorUI", function() { return _editor_editorui__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  7194. /* harmony import */ var _editor_utils_attachtoform__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./editor/utils/attachtoform */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/attachtoform.js");
  7195. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "attachToForm", function() { return _editor_utils_attachtoform__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  7196. /* harmony import */ var _editor_utils_dataapimixin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./editor/utils/dataapimixin */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin.js");
  7197. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataApiMixin", function() { return _editor_utils_dataapimixin__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  7198. /* harmony import */ var _editor_utils_elementapimixin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./editor/utils/elementapimixin */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin.js");
  7199. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ElementApiMixin", function() { return _editor_utils_elementapimixin__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  7200. /* harmony import */ var _editor_utils_securesourceelement__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./editor/utils/securesourceelement */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/securesourceelement.js");
  7201. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "secureSourceElement", function() { return _editor_utils_securesourceelement__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  7202. /* harmony import */ var _pendingactions__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./pendingactions */ "./node_modules/@ckeditor/ckeditor5-core/src/pendingactions.js");
  7203. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PendingActions", function() { return _pendingactions__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  7204. /* harmony import */ var _theme_icons_cancel_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../theme/icons/cancel.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/cancel.svg");
  7205. /* harmony import */ var _theme_icons_caption_svg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./../theme/icons/caption.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/caption.svg");
  7206. /* harmony import */ var _theme_icons_check_svg__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./../theme/icons/check.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/check.svg");
  7207. /* harmony import */ var _theme_icons_cog_svg__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../theme/icons/cog.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/cog.svg");
  7208. /* harmony import */ var _theme_icons_eraser_svg__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../theme/icons/eraser.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/eraser.svg");
  7209. /* harmony import */ var _theme_icons_low_vision_svg__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./../theme/icons/low-vision.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/low-vision.svg");
  7210. /* harmony import */ var _theme_icons_image_svg__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./../theme/icons/image.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/image.svg");
  7211. /* harmony import */ var _theme_icons_align_bottom_svg__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./../theme/icons/align-bottom.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-bottom.svg");
  7212. /* harmony import */ var _theme_icons_align_middle_svg__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./../theme/icons/align-middle.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-middle.svg");
  7213. /* harmony import */ var _theme_icons_align_top_svg__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./../theme/icons/align-top.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-top.svg");
  7214. /* harmony import */ var _theme_icons_align_left_svg__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./../theme/icons/align-left.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-left.svg");
  7215. /* harmony import */ var _theme_icons_align_center_svg__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./../theme/icons/align-center.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-center.svg");
  7216. /* harmony import */ var _theme_icons_align_right_svg__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./../theme/icons/align-right.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-right.svg");
  7217. /* harmony import */ var _theme_icons_align_justify_svg__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./../theme/icons/align-justify.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-justify.svg");
  7218. /* harmony import */ var _theme_icons_object_left_svg__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./../theme/icons/object-left.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-left.svg");
  7219. /* harmony import */ var _theme_icons_object_center_svg__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./../theme/icons/object-center.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-center.svg");
  7220. /* harmony import */ var _theme_icons_object_right_svg__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./../theme/icons/object-right.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-right.svg");
  7221. /* harmony import */ var _theme_icons_object_full_width_svg__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./../theme/icons/object-full-width.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg");
  7222. /* harmony import */ var _theme_icons_object_inline_svg__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./../theme/icons/object-inline.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline.svg");
  7223. /* harmony import */ var _theme_icons_object_inline_left_svg__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./../theme/icons/object-inline-left.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline-left.svg");
  7224. /* harmony import */ var _theme_icons_object_inline_right_svg__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./../theme/icons/object-inline-right.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline-right.svg");
  7225. /* harmony import */ var _theme_icons_object_size_full_svg__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./../theme/icons/object-size-full.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-full.svg");
  7226. /* harmony import */ var _theme_icons_object_size_large_svg__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./../theme/icons/object-size-large.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-large.svg");
  7227. /* harmony import */ var _theme_icons_object_size_small_svg__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./../theme/icons/object-size-small.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-small.svg");
  7228. /* harmony import */ var _theme_icons_object_size_medium_svg__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./../theme/icons/object-size-medium.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg");
  7229. /* harmony import */ var _theme_icons_pencil_svg__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./../theme/icons/pencil.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/pencil.svg");
  7230. /* harmony import */ var _theme_icons_pilcrow_svg__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./../theme/icons/pilcrow.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg");
  7231. /* harmony import */ var _theme_icons_quote_svg__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./../theme/icons/quote.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/quote.svg");
  7232. /* harmony import */ var _theme_icons_three_vertical_dots_svg__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./../theme/icons/three-vertical-dots.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg");
  7233. /**
  7234. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  7235. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  7236. */
  7237. /**
  7238. * @module core
  7239. */
  7240. const icons = {
  7241. cancel: _theme_icons_cancel_svg__WEBPACK_IMPORTED_MODULE_12__["default"],
  7242. caption: _theme_icons_caption_svg__WEBPACK_IMPORTED_MODULE_13__["default"],
  7243. check: _theme_icons_check_svg__WEBPACK_IMPORTED_MODULE_14__["default"],
  7244. cog: _theme_icons_cog_svg__WEBPACK_IMPORTED_MODULE_15__["default"],
  7245. eraser: _theme_icons_eraser_svg__WEBPACK_IMPORTED_MODULE_16__["default"],
  7246. lowVision: _theme_icons_low_vision_svg__WEBPACK_IMPORTED_MODULE_17__["default"],
  7247. image: _theme_icons_image_svg__WEBPACK_IMPORTED_MODULE_18__["default"],
  7248. alignBottom: _theme_icons_align_bottom_svg__WEBPACK_IMPORTED_MODULE_19__["default"],
  7249. alignMiddle: _theme_icons_align_middle_svg__WEBPACK_IMPORTED_MODULE_20__["default"],
  7250. alignTop: _theme_icons_align_top_svg__WEBPACK_IMPORTED_MODULE_21__["default"],
  7251. alignLeft: _theme_icons_align_left_svg__WEBPACK_IMPORTED_MODULE_22__["default"],
  7252. alignCenter: _theme_icons_align_center_svg__WEBPACK_IMPORTED_MODULE_23__["default"],
  7253. alignRight: _theme_icons_align_right_svg__WEBPACK_IMPORTED_MODULE_24__["default"],
  7254. alignJustify: _theme_icons_align_justify_svg__WEBPACK_IMPORTED_MODULE_25__["default"],
  7255. objectLeft: _theme_icons_object_inline_left_svg__WEBPACK_IMPORTED_MODULE_31__["default"],
  7256. objectCenter: _theme_icons_object_center_svg__WEBPACK_IMPORTED_MODULE_27__["default"],
  7257. objectRight: _theme_icons_object_inline_right_svg__WEBPACK_IMPORTED_MODULE_32__["default"],
  7258. objectFullWidth: _theme_icons_object_full_width_svg__WEBPACK_IMPORTED_MODULE_29__["default"],
  7259. objectInline: _theme_icons_object_inline_svg__WEBPACK_IMPORTED_MODULE_30__["default"],
  7260. objectBlockLeft: _theme_icons_object_left_svg__WEBPACK_IMPORTED_MODULE_26__["default"],
  7261. objectBlockRight: _theme_icons_object_right_svg__WEBPACK_IMPORTED_MODULE_28__["default"],
  7262. objectSizeFull: _theme_icons_object_size_full_svg__WEBPACK_IMPORTED_MODULE_33__["default"],
  7263. objectSizeLarge: _theme_icons_object_size_large_svg__WEBPACK_IMPORTED_MODULE_34__["default"],
  7264. objectSizeSmall: _theme_icons_object_size_small_svg__WEBPACK_IMPORTED_MODULE_35__["default"],
  7265. objectSizeMedium: _theme_icons_object_size_medium_svg__WEBPACK_IMPORTED_MODULE_36__["default"],
  7266. pencil: _theme_icons_pencil_svg__WEBPACK_IMPORTED_MODULE_37__["default"],
  7267. pilcrow: _theme_icons_pilcrow_svg__WEBPACK_IMPORTED_MODULE_38__["default"],
  7268. quote: _theme_icons_quote_svg__WEBPACK_IMPORTED_MODULE_39__["default"],
  7269. threeVerticalDots: _theme_icons_three_vertical_dots_svg__WEBPACK_IMPORTED_MODULE_40__["default"]
  7270. };
  7271. /***/ }),
  7272. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/multicommand.js":
  7273. /*!*******************************************************************!*\
  7274. !*** ./node_modules/@ckeditor/ckeditor5-core/src/multicommand.js ***!
  7275. \*******************************************************************/
  7276. /*! exports provided: default */
  7277. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7278. "use strict";
  7279. __webpack_require__.r(__webpack_exports__);
  7280. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MultiCommand; });
  7281. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  7282. /**
  7283. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  7284. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  7285. */
  7286. /**
  7287. * @module core/multicommand
  7288. */
  7289. /**
  7290. * A CKEditor command that aggregates other commands.
  7291. *
  7292. * This command is used to proxy multiple commands. The multi-command is enabled when
  7293. * at least one of its registered child commands is enabled.
  7294. * When executing a multi-command the first command that is enabled will be executed.
  7295. *
  7296. * const multiCommand = new MultiCommand( editor );
  7297. *
  7298. * const commandFoo = new Command( editor );
  7299. * const commandBar = new Command( editor );
  7300. *
  7301. * // Register child commands.
  7302. * multiCommand.registerChildCommand( commandFoo );
  7303. * multiCommand.registerChildCommand( commandBar );
  7304. *
  7305. * // Enable one of the commands.
  7306. * commandBar.isEnabled = true;
  7307. *
  7308. * multiCommand.execute(); // Will execute commandBar.
  7309. *
  7310. * @extends module:core/command~Command
  7311. */
  7312. class MultiCommand extends _command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  7313. /**
  7314. * @inheritDoc
  7315. */
  7316. constructor( editor ) {
  7317. super( editor );
  7318. /**
  7319. * Registered child commands.
  7320. *
  7321. * @type {Array.<module:core/command~Command>}
  7322. * @private
  7323. */
  7324. this._childCommands = [];
  7325. }
  7326. /**
  7327. * @inheritDoc
  7328. */
  7329. refresh() {
  7330. // Override base command refresh(): the command's state is changed when one of child commands changes states.
  7331. }
  7332. /**
  7333. * Executes the first of it registered child commands.
  7334. *
  7335. * @returns {*} The value returned by the {@link module:core/command~Command#execute `command.execute()`}.
  7336. */
  7337. execute( ...args ) {
  7338. const command = this._getFirstEnabledCommand();
  7339. return command != null && command.execute( args );
  7340. }
  7341. /**
  7342. * Registers a child command.
  7343. *
  7344. * @param {module:core/command~Command} command
  7345. */
  7346. registerChildCommand( command ) {
  7347. this._childCommands.push( command );
  7348. // Change multi command enabled state when one of registered commands changes state.
  7349. command.on( 'change:isEnabled', () => this._checkEnabled() );
  7350. this._checkEnabled();
  7351. }
  7352. /**
  7353. * Checks if any of child commands is enabled.
  7354. *
  7355. * @private
  7356. */
  7357. _checkEnabled() {
  7358. this.isEnabled = !!this._getFirstEnabledCommand();
  7359. }
  7360. /**
  7361. * Returns a first enabled command or undefined if none of them is enabled.
  7362. *
  7363. * @returns {module:core/command~Command|undefined}
  7364. * @private
  7365. */
  7366. _getFirstEnabledCommand() {
  7367. return this._childCommands.find( command => command.isEnabled );
  7368. }
  7369. }
  7370. /***/ }),
  7371. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/pendingactions.js":
  7372. /*!*********************************************************************!*\
  7373. !*** ./node_modules/@ckeditor/ckeditor5-core/src/pendingactions.js ***!
  7374. \*********************************************************************/
  7375. /*! exports provided: default */
  7376. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7377. "use strict";
  7378. __webpack_require__.r(__webpack_exports__);
  7379. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PendingActions; });
  7380. /* harmony import */ var _contextplugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contextplugin */ "./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js");
  7381. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  7382. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  7383. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  7384. /**
  7385. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  7386. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  7387. */
  7388. /**
  7389. * @module core/pendingactions
  7390. */
  7391. /**
  7392. * The list of pending editor actions.
  7393. *
  7394. * This plugin should be used to synchronise plugins that execute long-lasting actions
  7395. * (e.g. file upload) with the editor integration. It gives the developer who integrates the editor
  7396. * an easy way to check if there are any actions pending whenever such information is needed.
  7397. * All plugins that register a pending action also provide a message about the action that is ongoing
  7398. * which can be displayed to the user. This lets them decide if they want to interrupt the action or wait.
  7399. *
  7400. * Adding and updating a pending action:
  7401. *
  7402. * const pendingActions = editor.plugins.get( 'PendingActions' );
  7403. * const action = pendingActions.add( 'Upload in progress: 0%.' );
  7404. *
  7405. * // You can update the message:
  7406. * action.message = 'Upload in progress: 10%.';
  7407. *
  7408. * Removing a pending action:
  7409. *
  7410. * const pendingActions = editor.plugins.get( 'PendingActions' );
  7411. * const action = pendingActions.add( 'Unsaved changes.' );
  7412. *
  7413. * pendingActions.remove( action );
  7414. *
  7415. * Getting pending actions:
  7416. *
  7417. * const pendingActions = editor.plugins.get( 'PendingActions' );
  7418. *
  7419. * const action1 = pendingActions.add( 'Action 1' );
  7420. * const action2 = pendingActions.add( 'Action 2' );
  7421. *
  7422. * pendingActions.first; // Returns action1
  7423. * Array.from( pendingActions ); // Returns [ action1, action2 ]
  7424. *
  7425. * This plugin is used by features like {@link module:upload/filerepository~FileRepository} to register their ongoing actions
  7426. * and by features like {@link module:autosave/autosave~Autosave} to detect whether there are any ongoing actions.
  7427. * Read more about saving the data in the {@glink builds/guides/integration/saving-data Saving and getting data} guide.
  7428. *
  7429. * @extends module:core/contextplugin~ContextPlugin
  7430. */
  7431. class PendingActions extends _contextplugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  7432. /**
  7433. * @inheritDoc
  7434. */
  7435. static get pluginName() {
  7436. return 'PendingActions';
  7437. }
  7438. /**
  7439. * @inheritDoc
  7440. */
  7441. init() {
  7442. /**
  7443. * Defines whether there is any registered pending action.
  7444. *
  7445. * @readonly
  7446. * @observable
  7447. * @member {Boolean} #hasAny
  7448. */
  7449. this.set( 'hasAny', false );
  7450. /**
  7451. * A list of pending actions.
  7452. *
  7453. * @private
  7454. * @type {module:utils/collection~Collection}
  7455. */
  7456. this._actions = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_2__["default"]( { idProperty: '_id' } );
  7457. this._actions.delegate( 'add', 'remove' ).to( this );
  7458. }
  7459. /**
  7460. * Adds an action to the list of pending actions.
  7461. *
  7462. * This method returns an action object with an observable message property.
  7463. * The action object can be later used in the {@link #remove} method. It also allows you to change the message.
  7464. *
  7465. * @param {String} message The action message.
  7466. * @returns {Object} An observable object that represents a pending action.
  7467. */
  7468. add( message ) {
  7469. if ( typeof message !== 'string' ) {
  7470. /**
  7471. * The message must be a string.
  7472. *
  7473. * @error pendingactions-add-invalid-message
  7474. */
  7475. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"]( 'pendingactions-add-invalid-message', this );
  7476. }
  7477. const action = Object.create( _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  7478. action.set( 'message', message );
  7479. this._actions.add( action );
  7480. this.hasAny = true;
  7481. return action;
  7482. }
  7483. /**
  7484. * Removes an action from the list of pending actions.
  7485. *
  7486. * @param {Object} action An action object.
  7487. */
  7488. remove( action ) {
  7489. this._actions.remove( action );
  7490. this.hasAny = !!this._actions.length;
  7491. }
  7492. /**
  7493. * Returns the first action from the list or null when list is empty
  7494. *
  7495. * returns {Object|null} The pending action object.
  7496. */
  7497. get first() {
  7498. return this._actions.get( 0 );
  7499. }
  7500. /**
  7501. * Iterable interface.
  7502. *
  7503. * @returns {Iterable.<*>}
  7504. */
  7505. [ Symbol.iterator ]() {
  7506. return this._actions[ Symbol.iterator ]();
  7507. }
  7508. /**
  7509. * Fired when an action is added to the list.
  7510. *
  7511. * @event add
  7512. * @param {Object} action The added action.
  7513. */
  7514. /**
  7515. * Fired when an action is removed from the list.
  7516. *
  7517. * @event remove
  7518. * @param {Object} action The removed action.
  7519. */
  7520. }
  7521. /***/ }),
  7522. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js":
  7523. /*!*************************************************************!*\
  7524. !*** ./node_modules/@ckeditor/ckeditor5-core/src/plugin.js ***!
  7525. \*************************************************************/
  7526. /*! exports provided: default */
  7527. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7528. "use strict";
  7529. __webpack_require__.r(__webpack_exports__);
  7530. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Plugin; });
  7531. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  7532. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  7533. /**
  7534. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  7535. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  7536. */
  7537. /**
  7538. * @module core/plugin
  7539. */
  7540. /**
  7541. * The base class for CKEditor plugin classes.
  7542. *
  7543. * @implements module:core/plugin~PluginInterface
  7544. * @mixes module:utils/observablemixin~ObservableMixin
  7545. */
  7546. class Plugin {
  7547. /**
  7548. * @inheritDoc
  7549. */
  7550. constructor( editor ) {
  7551. /**
  7552. * The editor instance.
  7553. *
  7554. * Note that most editors implement the {@link module:core/editor/editorwithui~EditorWithUI} interface in addition
  7555. * to the base {@link module:core/editor/editor~Editor} interface. However, editors with an external UI
  7556. * (i.e. Bootstrap-based) or a headless editor may not implement the {@link module:core/editor/editorwithui~EditorWithUI}
  7557. * interface.
  7558. *
  7559. * Because of above, to make plugins more universal, it is recommended to split features into:
  7560. * - The "editing" part that only uses the {@link module:core/editor/editor~Editor} interface.
  7561. * - The "UI" part that uses both the {@link module:core/editor/editor~Editor} interface and
  7562. * the {@link module:core/editor/editorwithui~EditorWithUI} interface.
  7563. *
  7564. * @readonly
  7565. * @member {module:core/editor/editor~Editor} #editor
  7566. */
  7567. this.editor = editor;
  7568. /**
  7569. * Flag indicating whether a plugin is enabled or disabled.
  7570. * A disabled plugin will not transform text.
  7571. *
  7572. * Plugin can be simply disabled like that:
  7573. *
  7574. * // Disable the plugin so that no toolbars are visible.
  7575. * editor.plugins.get( 'TextTransformation' ).isEnabled = false;
  7576. *
  7577. * You can also use {@link #forceDisabled} method.
  7578. *
  7579. * @observable
  7580. * @readonly
  7581. * @member {Boolean} #isEnabled
  7582. */
  7583. this.set( 'isEnabled', true );
  7584. /**
  7585. * Holds identifiers for {@link #forceDisabled} mechanism.
  7586. *
  7587. * @type {Set.<String>}
  7588. * @private
  7589. */
  7590. this._disableStack = new Set();
  7591. }
  7592. /**
  7593. * Disables the plugin.
  7594. *
  7595. * Plugin may be disabled by multiple features or algorithms (at once). When disabling a plugin, unique id should be passed
  7596. * (e.g. feature name). The same identifier should be used when {@link #clearForceDisabled enabling back} the plugin.
  7597. * The plugin becomes enabled only after all features {@link #clearForceDisabled enabled it back}.
  7598. *
  7599. * Disabling and enabling a plugin:
  7600. *
  7601. * plugin.isEnabled; // -> true
  7602. * plugin.forceDisabled( 'MyFeature' );
  7603. * plugin.isEnabled; // -> false
  7604. * plugin.clearForceDisabled( 'MyFeature' );
  7605. * plugin.isEnabled; // -> true
  7606. *
  7607. * Plugin disabled by multiple features:
  7608. *
  7609. * plugin.forceDisabled( 'MyFeature' );
  7610. * plugin.forceDisabled( 'OtherFeature' );
  7611. * plugin.clearForceDisabled( 'MyFeature' );
  7612. * plugin.isEnabled; // -> false
  7613. * plugin.clearForceDisabled( 'OtherFeature' );
  7614. * plugin.isEnabled; // -> true
  7615. *
  7616. * Multiple disabling with the same identifier is redundant:
  7617. *
  7618. * plugin.forceDisabled( 'MyFeature' );
  7619. * plugin.forceDisabled( 'MyFeature' );
  7620. * plugin.clearForceDisabled( 'MyFeature' );
  7621. * plugin.isEnabled; // -> true
  7622. *
  7623. * **Note:** some plugins or algorithms may have more complex logic when it comes to enabling or disabling certain plugins,
  7624. * so the plugin might be still disabled after {@link #clearForceDisabled} was used.
  7625. *
  7626. * @param {String} id Unique identifier for disabling. Use the same id when {@link #clearForceDisabled enabling back} the plugin.
  7627. */
  7628. forceDisabled( id ) {
  7629. this._disableStack.add( id );
  7630. if ( this._disableStack.size == 1 ) {
  7631. this.on( 'set:isEnabled', forceDisable, { priority: 'highest' } );
  7632. this.isEnabled = false;
  7633. }
  7634. }
  7635. /**
  7636. * Clears forced disable previously set through {@link #forceDisabled}. See {@link #forceDisabled}.
  7637. *
  7638. * @param {String} id Unique identifier, equal to the one passed in {@link #forceDisabled} call.
  7639. */
  7640. clearForceDisabled( id ) {
  7641. this._disableStack.delete( id );
  7642. if ( this._disableStack.size == 0 ) {
  7643. this.off( 'set:isEnabled', forceDisable );
  7644. this.isEnabled = true;
  7645. }
  7646. }
  7647. /**
  7648. * @inheritDoc
  7649. */
  7650. destroy() {
  7651. this.stopListening();
  7652. }
  7653. /**
  7654. * @inheritDoc
  7655. */
  7656. static get isContextPlugin() {
  7657. return false;
  7658. }
  7659. }
  7660. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( Plugin, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  7661. /**
  7662. * The base interface for CKEditor plugins.
  7663. *
  7664. * In its minimal form a plugin can be a simple function that accepts {@link module:core/editor/editor~Editor the editor}
  7665. * as a parameter:
  7666. *
  7667. * // A simple plugin that enables a data processor.
  7668. * function MyPlugin( editor ) {
  7669. * editor.data.processor = new MyDataProcessor();
  7670. * }
  7671. *
  7672. * In most cases however, you will want to inherit from the {@link module:core/plugin~Plugin} class which implements the
  7673. * {@link module:utils/observablemixin~ObservableMixin} and is, therefore, more convenient:
  7674. *
  7675. * class MyPlugin extends Plugin {
  7676. * init() {
  7677. * // `listenTo()` and `editor` are available thanks to `Plugin`.
  7678. * // By using `listenTo()` you will ensure that the listener is removed when
  7679. * // the plugin is destroyed.
  7680. * this.listenTo( this.editor.data, 'ready', () => {
  7681. * // Do something when the data is ready.
  7682. * } );
  7683. * }
  7684. * }
  7685. *
  7686. * The plugin can also implement methods (e.g. {@link module:core/plugin~PluginInterface#init `init()`} or
  7687. * {@link module:core/plugin~PluginInterface#destroy `destroy()`}) which, when present, will be used to properly
  7688. * initialize and destroy the plugin.
  7689. *
  7690. * **Note:** When defined as a plain function, the plugin acts as a constructor and will be
  7691. * called in parallel with other plugins' {@link module:core/plugin~PluginInterface#constructor constructors}.
  7692. * This means the code of that plugin will be executed **before** {@link module:core/plugin~PluginInterface#init `init()`} and
  7693. * {@link module:core/plugin~PluginInterface#afterInit `afterInit()`} methods of other plugins and, for instance,
  7694. * you cannot use it to extend other plugins' {@glink framework/guides/architecture/editing-engine#schema schema}
  7695. * rules as they are defined later on during the `init()` stage.
  7696. *
  7697. * @interface PluginInterface
  7698. */
  7699. /**
  7700. * Creates a new plugin instance. This is the first step of the plugin initialization.
  7701. * See also {@link #init} and {@link #afterInit}.
  7702. *
  7703. * A plugin is always instantiated after its {@link module:core/plugin~PluginInterface.requires dependencies} and the
  7704. * {@link #init} and {@link #afterInit} methods are called in the same order.
  7705. *
  7706. * Usually, you will want to put your plugin's initialization code in the {@link #init} method.
  7707. * The constructor can be understood as "before init" and used in special cases, just like
  7708. * {@link #afterInit} serves the special "after init" scenarios (e.g.the code which depends on other
  7709. * plugins, but which does not {@link module:core/plugin~PluginInterface.requires explicitly require} them).
  7710. *
  7711. * @method #constructor
  7712. * @param {module:core/editor/editor~Editor} editor
  7713. */
  7714. /**
  7715. * An array of plugins required by this plugin.
  7716. *
  7717. * To keep the plugin class definition tight it is recommended to define this property as a static getter:
  7718. *
  7719. * import Image from './image.js';
  7720. *
  7721. * export default class ImageCaption {
  7722. * static get requires() {
  7723. * return [ Image ];
  7724. * }
  7725. * }
  7726. *
  7727. * @static
  7728. * @readonly
  7729. * @member {Array.<Function>|undefined} module:core/plugin~PluginInterface.requires
  7730. */
  7731. /**
  7732. * An optional name of the plugin. If set, the plugin will be available in
  7733. * {@link module:core/plugincollection~PluginCollection#get} by its
  7734. * name and its constructor. If not, then only by its constructor.
  7735. *
  7736. * The name should reflect the constructor name.
  7737. *
  7738. * To keep the plugin class definition tight, it is recommended to define this property as a static getter:
  7739. *
  7740. * export default class ImageCaption {
  7741. * static get pluginName() {
  7742. * return 'ImageCaption';
  7743. * }
  7744. * }
  7745. *
  7746. * Note: The native `Function.name` property could not be used to keep the plugin name because
  7747. * it will be mangled during code minification.
  7748. *
  7749. * Naming a plugin is necessary to enable removing it through the
  7750. * {@link module:core/editor/editorconfig~EditorConfig#removePlugins `config.removePlugins`} option.
  7751. *
  7752. * @static
  7753. * @readonly
  7754. * @member {String|undefined} module:core/plugin~PluginInterface.pluginName
  7755. */
  7756. /**
  7757. * The second stage (after plugin {@link #constructor}) of the plugin initialization.
  7758. * Unlike the plugin constructor this method can be asynchronous.
  7759. *
  7760. * A plugin's `init()` method is called after its {@link module:core/plugin~PluginInterface.requires dependencies} are initialized,
  7761. * so in the same order as the constructors of these plugins.
  7762. *
  7763. * **Note:** This method is optional. A plugin instance does not need to have it defined.
  7764. *
  7765. * @method #init
  7766. * @returns {null|Promise}
  7767. */
  7768. /**
  7769. * The third (and last) stage of the plugin initialization. See also {@link #constructor} and {@link #init}.
  7770. *
  7771. * **Note:** This method is optional. A plugin instance does not need to have it defined.
  7772. *
  7773. * @method #afterInit
  7774. * @returns {null|Promise}
  7775. */
  7776. /**
  7777. * Destroys the plugin.
  7778. *
  7779. * **Note:** This method is optional. A plugin instance does not need to have it defined.
  7780. *
  7781. * @method #destroy
  7782. * @returns {null|Promise}
  7783. */
  7784. /**
  7785. * A flag which defines if a plugin is allowed or not allowed to be used directly by a {@link module:core/context~Context}.
  7786. *
  7787. * @static
  7788. * @readonly
  7789. * @member {Boolean} module:core/plugin~PluginInterface.isContextPlugin
  7790. */
  7791. /**
  7792. * An array of loaded plugins.
  7793. *
  7794. * @typedef {Array.<module:core/plugin~PluginInterface>} module:core/plugin~LoadedPlugins
  7795. */
  7796. // Helper function that forces plugin to be disabled.
  7797. function forceDisable( evt ) {
  7798. evt.return = false;
  7799. evt.stop();
  7800. }
  7801. /***/ }),
  7802. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js":
  7803. /*!***********************************************************************!*\
  7804. !*** ./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js ***!
  7805. \***********************************************************************/
  7806. /*! exports provided: default */
  7807. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7808. "use strict";
  7809. __webpack_require__.r(__webpack_exports__);
  7810. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PluginCollection; });
  7811. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  7812. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  7813. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  7814. /**
  7815. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  7816. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  7817. */
  7818. /**
  7819. * @module core/plugincollection
  7820. */
  7821. /**
  7822. * Manages a list of CKEditor plugins, including loading, resolving dependencies and initialization.
  7823. *
  7824. * @mixes module:utils/emittermixin~EmitterMixin
  7825. */
  7826. class PluginCollection {
  7827. /**
  7828. * Creates an instance of the plugin collection class.
  7829. * Allows loading and initializing plugins and their dependencies.
  7830. * Allows providing a list of already loaded plugins. These plugins will not be destroyed along with this collection.
  7831. *
  7832. * @param {module:core/editor/editor~Editor|module:core/context~Context} context
  7833. * @param {Array.<Function>} [availablePlugins] Plugins (constructors) which the collection will be able to use
  7834. * when {@link module:core/plugincollection~PluginCollection#init} is used with the plugin names (strings, instead of constructors).
  7835. * Usually, the editor will pass its built-in plugins to the collection so they can later be
  7836. * used in `config.plugins` or `config.removePlugins` by names.
  7837. * @param {Iterable.<Array>} contextPlugins A list of already initialized plugins represented by a
  7838. * `[ PluginConstructor, pluginInstance ]` pair.
  7839. */
  7840. constructor( context, availablePlugins = [], contextPlugins = [] ) {
  7841. /**
  7842. * @protected
  7843. * @type {module:core/editor/editor~Editor|module:core/context~Context}
  7844. */
  7845. this._context = context;
  7846. /**
  7847. * @protected
  7848. * @type {Map}
  7849. */
  7850. this._plugins = new Map();
  7851. /**
  7852. * A map of plugin constructors that can be retrieved by their names.
  7853. *
  7854. * @protected
  7855. * @type {Map.<String|Function,Function>}
  7856. */
  7857. this._availablePlugins = new Map();
  7858. for ( const PluginConstructor of availablePlugins ) {
  7859. if ( PluginConstructor.pluginName ) {
  7860. this._availablePlugins.set( PluginConstructor.pluginName, PluginConstructor );
  7861. }
  7862. }
  7863. /**
  7864. * Map of {@link module:core/contextplugin~ContextPlugin context plugins} which can be retrieved by their constructors or instances.
  7865. *
  7866. * @protected
  7867. * @type {Map<Function,Function>}
  7868. */
  7869. this._contextPlugins = new Map();
  7870. for ( const [ PluginConstructor, pluginInstance ] of contextPlugins ) {
  7871. this._contextPlugins.set( PluginConstructor, pluginInstance );
  7872. this._contextPlugins.set( pluginInstance, PluginConstructor );
  7873. // To make it possible to require a plugin by its name.
  7874. if ( PluginConstructor.pluginName ) {
  7875. this._availablePlugins.set( PluginConstructor.pluginName, PluginConstructor );
  7876. }
  7877. }
  7878. }
  7879. /**
  7880. * Iterable interface.
  7881. *
  7882. * Returns `[ PluginConstructor, pluginInstance ]` pairs.
  7883. *
  7884. * @returns {Iterable.<Array>}
  7885. */
  7886. * [ Symbol.iterator ]() {
  7887. for ( const entry of this._plugins ) {
  7888. if ( typeof entry[ 0 ] == 'function' ) {
  7889. yield entry;
  7890. }
  7891. }
  7892. }
  7893. /**
  7894. * Gets the plugin instance by its constructor or name.
  7895. *
  7896. * // Check if 'Clipboard' plugin was loaded.
  7897. * if ( editor.plugins.has( 'ClipboardPipeline' ) ) {
  7898. * // Get clipboard plugin instance
  7899. * const clipboard = editor.plugins.get( 'ClipboardPipeline' );
  7900. *
  7901. * this.listenTo( clipboard, 'inputTransformation', ( evt, data ) => {
  7902. * // Do something on clipboard input.
  7903. * } );
  7904. * }
  7905. *
  7906. * **Note**: This method will throw an error if a plugin is not loaded. Use `{@link #has editor.plugins.has()}`
  7907. * to check if a plugin is available.
  7908. *
  7909. * @param {Function|String} key The plugin constructor or {@link module:core/plugin~PluginInterface.pluginName name}.
  7910. * @returns {module:core/plugin~PluginInterface}
  7911. */
  7912. get( key ) {
  7913. const plugin = this._plugins.get( key );
  7914. if ( !plugin ) {
  7915. let pluginName = key;
  7916. if ( typeof key == 'function' ) {
  7917. pluginName = key.pluginName || key.name;
  7918. }
  7919. /**
  7920. * The plugin is not loaded and could not be obtained.
  7921. *
  7922. * Plugin classes (constructors) need to be provided to the editor and must be loaded before they can be obtained from
  7923. * the plugin collection.
  7924. * This is usually done in CKEditor 5 builds by setting the {@link module:core/editor/editor~Editor.builtinPlugins}
  7925. * property.
  7926. *
  7927. * **Note**: You can use `{@link module:core/plugincollection~PluginCollection#has editor.plugins.has()}`
  7928. * to check if a plugin was loaded.
  7929. *
  7930. * @error plugincollection-plugin-not-loaded
  7931. * @param {String} plugin The name of the plugin which is not loaded.
  7932. */
  7933. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-plugin-not-loaded', this._context, { plugin: pluginName } );
  7934. }
  7935. return plugin;
  7936. }
  7937. /**
  7938. * Checks if a plugin is loaded.
  7939. *
  7940. * // Check if the 'Clipboard' plugin was loaded.
  7941. * if ( editor.plugins.has( 'ClipboardPipeline' ) ) {
  7942. * // Now use the clipboard plugin instance:
  7943. * const clipboard = editor.plugins.get( 'ClipboardPipeline' );
  7944. *
  7945. * // ...
  7946. * }
  7947. *
  7948. * @param {Function|String} key The plugin constructor or {@link module:core/plugin~PluginInterface.pluginName name}.
  7949. * @returns {Boolean}
  7950. */
  7951. has( key ) {
  7952. return this._plugins.has( key );
  7953. }
  7954. /**
  7955. * Initializes a set of plugins and adds them to the collection.
  7956. *
  7957. * @param {Array.<Function|String>} plugins An array of {@link module:core/plugin~PluginInterface plugin constructors}
  7958. * or {@link module:core/plugin~PluginInterface.pluginName plugin names}.
  7959. * @param {Array.<String|Function>} [pluginsToRemove] Names of the plugins or plugin constructors
  7960. * that should not be loaded (despite being specified in the `plugins` array).
  7961. * @param {Array.<Function>} [pluginsSubstitutions] An array of {@link module:core/plugin~PluginInterface plugin constructors}
  7962. * that will be used to replace plugins of the same names that were passed in `plugins` or that are in their dependency tree.
  7963. * A useful option for replacing built-in plugins while creating tests (for mocking their APIs). Plugins that will be replaced
  7964. * must follow these rules:
  7965. * * The new plugin must be a class.
  7966. * * The new plugin must be named.
  7967. * * Both plugins must not depend on other plugins.
  7968. * @returns {Promise.<module:core/plugin~LoadedPlugins>} A promise which gets resolved once all plugins are loaded
  7969. * and available in the collection.
  7970. */
  7971. init( plugins, pluginsToRemove = [], pluginsSubstitutions = [] ) {
  7972. // Plugin initialization procedure consists of 2 main steps:
  7973. // 1) collecting all available plugin constructors,
  7974. // 2) verification whether all required plugins can be instantiated.
  7975. //
  7976. // In the first step, all plugin constructors, available in the provided `plugins` array and inside
  7977. // plugin's dependencies (from the `Plugin.requires` array), are recursively collected and added to the existing
  7978. // `this._availablePlugins` map, but without any verification at the given moment. Performing the verification
  7979. // at this point (during the plugin constructor searching) would cause false errors to occur, that some plugin
  7980. // is missing but in fact it may be defined further in the array as the dependency of other plugin. After
  7981. // traversing the entire dependency tree, it will be checked if all required "top level" plugins are available.
  7982. //
  7983. // In the second step, the list of plugins that have not been explicitly removed is traversed to get all the
  7984. // plugin constructors to be instantiated in the correct order and to validate against some rules. Finally, if
  7985. // no plugin is missing and no other error has been found, they all will be instantiated.
  7986. const that = this;
  7987. const context = this._context;
  7988. findAvailablePluginConstructors( plugins );
  7989. validatePlugins( plugins );
  7990. const pluginsToLoad = plugins.filter( plugin => !isPluginRemoved( plugin, pluginsToRemove ) );
  7991. const pluginConstructors = [ ...getPluginConstructors( pluginsToLoad ) ];
  7992. substitutePlugins( pluginConstructors, pluginsSubstitutions );
  7993. const pluginInstances = loadPlugins( pluginConstructors );
  7994. return initPlugins( pluginInstances, 'init' )
  7995. .then( () => initPlugins( pluginInstances, 'afterInit' ) )
  7996. .then( () => pluginInstances );
  7997. function isPluginConstructor( plugin ) {
  7998. return typeof plugin === 'function';
  7999. }
  8000. function isContextPlugin( plugin ) {
  8001. return isPluginConstructor( plugin ) && plugin.isContextPlugin;
  8002. }
  8003. function isPluginRemoved( plugin, pluginsToRemove ) {
  8004. return pluginsToRemove.some( removedPlugin => {
  8005. if ( removedPlugin === plugin ) {
  8006. return true;
  8007. }
  8008. if ( getPluginName( plugin ) === removedPlugin ) {
  8009. return true;
  8010. }
  8011. if ( getPluginName( removedPlugin ) === plugin ) {
  8012. return true;
  8013. }
  8014. return false;
  8015. } );
  8016. }
  8017. function getPluginName( plugin ) {
  8018. return isPluginConstructor( plugin ) ?
  8019. plugin.pluginName || plugin.name :
  8020. plugin;
  8021. }
  8022. function findAvailablePluginConstructors( plugins, processed = new Set() ) {
  8023. plugins.forEach( plugin => {
  8024. if ( !isPluginConstructor( plugin ) ) {
  8025. return;
  8026. }
  8027. if ( processed.has( plugin ) ) {
  8028. return;
  8029. }
  8030. processed.add( plugin );
  8031. if ( plugin.pluginName && !that._availablePlugins.has( plugin.pluginName ) ) {
  8032. that._availablePlugins.set( plugin.pluginName, plugin );
  8033. }
  8034. if ( plugin.requires ) {
  8035. findAvailablePluginConstructors( plugin.requires, processed );
  8036. }
  8037. } );
  8038. }
  8039. function getPluginConstructors( plugins, processed = new Set() ) {
  8040. return plugins
  8041. .map( plugin => {
  8042. return isPluginConstructor( plugin ) ?
  8043. plugin :
  8044. that._availablePlugins.get( plugin );
  8045. } )
  8046. .reduce( ( result, plugin ) => {
  8047. if ( processed.has( plugin ) ) {
  8048. return result;
  8049. }
  8050. processed.add( plugin );
  8051. if ( plugin.requires ) {
  8052. validatePlugins( plugin.requires, plugin );
  8053. getPluginConstructors( plugin.requires, processed ).forEach( plugin => result.add( plugin ) );
  8054. }
  8055. return result.add( plugin );
  8056. }, new Set() );
  8057. }
  8058. function validatePlugins( plugins, parentPluginConstructor = null ) {
  8059. plugins
  8060. .map( plugin => {
  8061. return isPluginConstructor( plugin ) ?
  8062. plugin :
  8063. that._availablePlugins.get( plugin ) || plugin;
  8064. } )
  8065. .forEach( plugin => {
  8066. checkMissingPlugin( plugin, parentPluginConstructor );
  8067. checkContextPlugin( plugin, parentPluginConstructor );
  8068. checkRemovedPlugin( plugin, parentPluginConstructor );
  8069. } );
  8070. }
  8071. function checkMissingPlugin( plugin, parentPluginConstructor ) {
  8072. if ( isPluginConstructor( plugin ) ) {
  8073. return;
  8074. }
  8075. if ( parentPluginConstructor ) {
  8076. /**
  8077. * A required "soft" dependency was not found on the plugin list.
  8078. *
  8079. * When configuring the editor, either prior to building (via
  8080. * {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}) or when
  8081. * creating a new instance of the editor (e.g. via
  8082. * {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`}), you need to provide
  8083. * some of the dependencies for other plugins that you used.
  8084. *
  8085. * This error is thrown when one of these dependencies was not provided. The name of the missing plugin
  8086. * can be found in `missingPlugin` and the plugin that required it in `requiredBy`.
  8087. *
  8088. * In order to resolve it, you need to import the missing plugin and add it to the
  8089. * current list of plugins (`Editor.builtinPlugins` or `config.plugins`/`config.extraPlugins`).
  8090. *
  8091. * Soft requirements were introduced in version 26.0.0. If you happen to stumble upon this error
  8092. * when upgrading to version 26.0.0, read also the
  8093. * {@glink builds/guides/migration/migration-to-26 Migration to 26.0.0} guide.
  8094. *
  8095. * @error plugincollection-soft-required
  8096. * @param {String} missingPlugin The name of the required plugin.
  8097. * @param {String} requiredBy The name of the plugin that requires the other plugin.
  8098. */
  8099. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  8100. 'plugincollection-soft-required',
  8101. context,
  8102. { missingPlugin: plugin, requiredBy: getPluginName( parentPluginConstructor ) }
  8103. );
  8104. }
  8105. /**
  8106. * A plugin is not available and could not be loaded.
  8107. *
  8108. * Plugin classes (constructors) need to be provided to the editor before they can be loaded by name.
  8109. * This is usually done in CKEditor 5 builds by setting the {@link module:core/editor/editor~Editor.builtinPlugins}
  8110. * property.
  8111. *
  8112. * **If you see this warning when using one of the {@glink builds/index CKEditor 5 Builds}**, it means
  8113. * that you try to enable a plugin which was not included in that build. This may be due to a typo
  8114. * in the plugin name or simply because that plugin is not a part of this build. In the latter scenario,
  8115. * read more about {@glink builds/guides/development/custom-builds custom builds}.
  8116. *
  8117. * **If you see this warning when using one of the editor creators directly** (not a build), then it means
  8118. * that you tried loading plugins by name. However, unlike CKEditor 4, CKEditor 5 does not implement a "plugin loader".
  8119. * This means that CKEditor 5 does not know where to load the plugin modules from. Therefore, you need to
  8120. * provide each plugin through a reference (as a constructor function). Check out the examples in
  8121. * {@glink builds/guides/integration/advanced-setup#scenario-2-building-from-source "Building from source"}.
  8122. *
  8123. * @error plugincollection-plugin-not-found
  8124. * @param {String} plugin The name of the plugin which could not be loaded.
  8125. */
  8126. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  8127. 'plugincollection-plugin-not-found',
  8128. context,
  8129. { plugin }
  8130. );
  8131. }
  8132. function checkContextPlugin( plugin, parentPluginConstructor ) {
  8133. if ( !isContextPlugin( parentPluginConstructor ) ) {
  8134. return;
  8135. }
  8136. if ( isContextPlugin( plugin ) ) {
  8137. return;
  8138. }
  8139. /**
  8140. * If a plugin is a context plugin, all plugins it requires should also be context plugins
  8141. * instead of plugins. In other words, if one plugin can be used in the context,
  8142. * all its requirements should also be ready to be used in the context. Note that the context
  8143. * provides only a part of the API provided by the editor. If one plugin needs a full
  8144. * editor API, all plugins which require it are considered as plugins that need a full
  8145. * editor API.
  8146. *
  8147. * @error plugincollection-context-required
  8148. * @param {String} plugin The name of the required plugin.
  8149. * @param {String} requiredBy The name of the parent plugin.
  8150. */
  8151. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  8152. 'plugincollection-context-required',
  8153. context,
  8154. { plugin: getPluginName( plugin ), requiredBy: getPluginName( parentPluginConstructor ) }
  8155. );
  8156. }
  8157. function checkRemovedPlugin( plugin, parentPluginConstructor ) {
  8158. if ( !parentPluginConstructor ) {
  8159. return;
  8160. }
  8161. if ( !isPluginRemoved( plugin, pluginsToRemove ) ) {
  8162. return;
  8163. }
  8164. /**
  8165. * Cannot load a plugin because one of its dependencies is listed in the `removePlugins` option.
  8166. *
  8167. * @error plugincollection-required
  8168. * @param {String} plugin The name of the required plugin.
  8169. * @param {String} requiredBy The name of the parent plugin.
  8170. */
  8171. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  8172. 'plugincollection-required',
  8173. context,
  8174. { plugin: getPluginName( plugin ), requiredBy: getPluginName( parentPluginConstructor ) }
  8175. );
  8176. }
  8177. function loadPlugins( pluginConstructors ) {
  8178. return pluginConstructors.map( PluginConstructor => {
  8179. const pluginInstance = that._contextPlugins.get( PluginConstructor ) || new PluginConstructor( context );
  8180. that._add( PluginConstructor, pluginInstance );
  8181. return pluginInstance;
  8182. } );
  8183. }
  8184. function initPlugins( pluginInstances, method ) {
  8185. return pluginInstances.reduce( ( promise, plugin ) => {
  8186. if ( !plugin[ method ] ) {
  8187. return promise;
  8188. }
  8189. if ( that._contextPlugins.has( plugin ) ) {
  8190. return promise;
  8191. }
  8192. return promise.then( plugin[ method ].bind( plugin ) );
  8193. }, Promise.resolve() );
  8194. }
  8195. // Replaces plugin constructors with the specified set of plugins.
  8196. //
  8197. // @param {Array.<Function>} pluginConstructors
  8198. // @param {Array.<Function>} pluginsSubstitutions
  8199. function substitutePlugins( pluginConstructors, pluginsSubstitutions ) {
  8200. for ( const pluginItem of pluginsSubstitutions ) {
  8201. if ( typeof pluginItem != 'function' ) {
  8202. /**
  8203. * The plugin replacing an existing plugin must be a function.
  8204. *
  8205. * @error plugincollection-replace-plugin-invalid-type
  8206. */
  8207. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-replace-plugin-invalid-type', null, { pluginItem } );
  8208. }
  8209. const pluginName = pluginItem.pluginName;
  8210. if ( !pluginName ) {
  8211. /**
  8212. * The plugin replacing an existing plugin must have a name.
  8213. *
  8214. * @error plugincollection-replace-plugin-missing-name
  8215. */
  8216. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-replace-plugin-missing-name', null, { pluginItem } );
  8217. }
  8218. if ( pluginItem.requires && pluginItem.requires.length ) {
  8219. /**
  8220. * The plugin replacing an existing plugin cannot depend on other plugins.
  8221. *
  8222. * @error plugincollection-plugin-for-replacing-cannot-have-dependencies
  8223. */
  8224. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-plugin-for-replacing-cannot-have-dependencies', null, { pluginName } );
  8225. }
  8226. const pluginToReplace = that._availablePlugins.get( pluginName );
  8227. if ( !pluginToReplace ) {
  8228. /**
  8229. * The replaced plugin does not exist in the
  8230. * {@link module:core/plugincollection~PluginCollection available plugins} collection.
  8231. *
  8232. * @error plugincollection-plugin-for-replacing-not-exist
  8233. */
  8234. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-plugin-for-replacing-not-exist', null, { pluginName } );
  8235. }
  8236. const indexInPluginConstructors = pluginConstructors.indexOf( pluginToReplace );
  8237. if ( indexInPluginConstructors === -1 ) {
  8238. // The Context feature can substitute plugins as well.
  8239. // It may happen that the editor will be created with the given context, where the plugin for substitute
  8240. // was already replaced. In such a case, we don't want to do it again.
  8241. if ( that._contextPlugins.has( pluginToReplace ) ) {
  8242. return;
  8243. }
  8244. /**
  8245. * The replaced plugin will not be loaded so it cannot be replaced.
  8246. *
  8247. * @error plugincollection-plugin-for-replacing-not-loaded
  8248. */
  8249. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-plugin-for-replacing-not-loaded', null, { pluginName } );
  8250. }
  8251. if ( pluginToReplace.requires && pluginToReplace.requires.length ) {
  8252. /**
  8253. * The replaced plugin cannot depend on other plugins.
  8254. *
  8255. * @error plugincollection-replaced-plugin-cannot-have-dependencies
  8256. */
  8257. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-replaced-plugin-cannot-have-dependencies', null, { pluginName } );
  8258. }
  8259. pluginConstructors.splice( indexInPluginConstructors, 1, pluginItem );
  8260. that._availablePlugins.set( pluginName, pluginItem );
  8261. }
  8262. }
  8263. }
  8264. /**
  8265. * Destroys all loaded plugins.
  8266. *
  8267. * @returns {Promise}
  8268. */
  8269. destroy() {
  8270. const promises = [];
  8271. for ( const [ , pluginInstance ] of this ) {
  8272. if ( typeof pluginInstance.destroy == 'function' && !this._contextPlugins.has( pluginInstance ) ) {
  8273. promises.push( pluginInstance.destroy() );
  8274. }
  8275. }
  8276. return Promise.all( promises );
  8277. }
  8278. /**
  8279. * Adds the plugin to the collection. Exposed mainly for testing purposes.
  8280. *
  8281. * @protected
  8282. * @param {Function} PluginConstructor The plugin constructor.
  8283. * @param {module:core/plugin~PluginInterface} plugin The instance of the plugin.
  8284. */
  8285. _add( PluginConstructor, plugin ) {
  8286. this._plugins.set( PluginConstructor, plugin );
  8287. const pluginName = PluginConstructor.pluginName;
  8288. if ( !pluginName ) {
  8289. return;
  8290. }
  8291. if ( this._plugins.has( pluginName ) ) {
  8292. /**
  8293. * Two plugins with the same {@link module:core/plugin~PluginInterface.pluginName} were loaded.
  8294. * This will lead to runtime conflicts between these plugins.
  8295. *
  8296. * In practice, this warning usually means that new plugins were added to an existing CKEditor 5 build.
  8297. * Plugins should always be added to a source version of the editor (`@ckeditor/ckeditor5-editor-*`),
  8298. * not to an editor imported from one of the `@ckeditor/ckeditor5-build-*` packages.
  8299. *
  8300. * Check your import paths and the list of plugins passed to
  8301. * {@link module:core/editor/editor~Editor.create `Editor.create()`}
  8302. * or specified in {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}.
  8303. *
  8304. * The second option is that your `node_modules/` directory contains duplicated versions of the same
  8305. * CKEditor 5 packages. Normally, on clean installations, npm deduplicates packages in `node_modules/`, so
  8306. * it may be enough to call `rm -rf node_modules && npm i`. However, if you installed conflicting versions
  8307. * of some packages, their dependencies may need to be installed in more than one version which may lead to this
  8308. * warning.
  8309. *
  8310. * Technically speaking, this error occurs because after adding a plugin to an existing editor build
  8311. * the dependencies of this plugin are being duplicated.
  8312. * They are already built into that editor build and now get added for the second time as dependencies
  8313. * of the plugin you are installing.
  8314. *
  8315. * Read more about {@glink builds/guides/integration/installing-plugins installing plugins}.
  8316. *
  8317. * @error plugincollection-plugin-name-conflict
  8318. * @param {String} pluginName The duplicated plugin name.
  8319. * @param {Function} plugin1 The first plugin constructor.
  8320. * @param {Function} plugin2 The second plugin constructor.
  8321. */
  8322. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  8323. 'plugincollection-plugin-name-conflict',
  8324. null,
  8325. { pluginName, plugin1: this._plugins.get( pluginName ).constructor, plugin2: PluginConstructor }
  8326. );
  8327. }
  8328. this._plugins.set( pluginName, plugin );
  8329. }
  8330. }
  8331. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( PluginCollection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  8332. /***/ }),
  8333. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-bottom.svg":
  8334. /*!****************************************************************************!*\
  8335. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-bottom.svg ***!
  8336. \****************************************************************************/
  8337. /*! exports provided: default */
  8338. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8339. "use strict";
  8340. __webpack_require__.r(__webpack_exports__);
  8341. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m9.239 13.938-2.88-1.663a.75.75 0 0 1 .75-1.3L9 12.067V4.75a.75.75 0 1 1 1.5 0v7.318l1.89-1.093a.75.75 0 0 1 .75 1.3l-2.879 1.663a.752.752 0 0 1-.511.187.752.752 0 0 1-.511-.187zM4.25 17a.75.75 0 1 1 0-1.5h10.5a.75.75 0 0 1 0 1.5H4.25z\"/></svg>");
  8342. /***/ }),
  8343. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-center.svg":
  8344. /*!****************************************************************************!*\
  8345. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-center.svg ***!
  8346. \****************************************************************************/
  8347. /*! exports provided: default */
  8348. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8349. "use strict";
  8350. __webpack_require__.r(__webpack_exports__);
  8351. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm2.286 4c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75z\"/></svg>");
  8352. /***/ }),
  8353. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-justify.svg":
  8354. /*!*****************************************************************************!*\
  8355. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-justify.svg ***!
  8356. \*****************************************************************************/
  8357. /*! exports provided: default */
  8358. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8359. "use strict";
  8360. __webpack_require__.r(__webpack_exports__);
  8361. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z\"/></svg>");
  8362. /***/ }),
  8363. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-left.svg":
  8364. /*!**************************************************************************!*\
  8365. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-left.svg ***!
  8366. \**************************************************************************/
  8367. /*! exports provided: default */
  8368. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8369. "use strict";
  8370. __webpack_require__.r(__webpack_exports__);
  8371. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z\"/></svg>");
  8372. /***/ }),
  8373. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-middle.svg":
  8374. /*!****************************************************************************!*\
  8375. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-middle.svg ***!
  8376. \****************************************************************************/
  8377. /*! exports provided: default */
  8378. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8379. "use strict";
  8380. __webpack_require__.r(__webpack_exports__);
  8381. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M9.75 11.875a.752.752 0 0 1 .508.184l2.883 1.666a.75.75 0 0 1-.659 1.344l-.091-.044-1.892-1.093.001 4.318a.75.75 0 1 1-1.5 0v-4.317l-1.89 1.092a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .51-.187zM15.25 9a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM9.75.375a.75.75 0 0 1 .75.75v4.318l1.89-1.093.092-.045a.75.75 0 0 1 .659 1.344l-2.883 1.667a.752.752 0 0 1-.508.184.752.752 0 0 1-.511-.187L6.359 5.65a.75.75 0 0 1 .75-1.299L9 5.442V1.125a.75.75 0 0 1 .75-.75z\"/></svg>");
  8382. /***/ }),
  8383. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-right.svg":
  8384. /*!***************************************************************************!*\
  8385. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-right.svg ***!
  8386. \***************************************************************************/
  8387. /*! exports provided: default */
  8388. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8389. "use strict";
  8390. __webpack_require__.r(__webpack_exports__);
  8391. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M18 3.75a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 8a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 4a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75zm0-8a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75z\"/></svg>");
  8392. /***/ }),
  8393. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-top.svg":
  8394. /*!*************************************************************************!*\
  8395. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-top.svg ***!
  8396. \*************************************************************************/
  8397. /*! exports provided: default */
  8398. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8399. "use strict";
  8400. __webpack_require__.r(__webpack_exports__);
  8401. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m10.261 7.062 2.88 1.663a.75.75 0 0 1-.75 1.3L10.5 8.933v7.317a.75.75 0 1 1-1.5 0V8.932l-1.89 1.093a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .511-.187.752.752 0 0 1 .511.187zM15.25 4a.75.75 0 1 1 0 1.5H4.75a.75.75 0 0 1 0-1.5h10.5z\"/></svg>");
  8402. /***/ }),
  8403. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/cancel.svg":
  8404. /*!**********************************************************************!*\
  8405. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/cancel.svg ***!
  8406. \**********************************************************************/
  8407. /*! exports provided: default */
  8408. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8409. "use strict";
  8410. __webpack_require__.r(__webpack_exports__);
  8411. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.591 10.177 4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z\"/></svg>");
  8412. /***/ }),
  8413. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/caption.svg":
  8414. /*!***********************************************************************!*\
  8415. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/caption.svg ***!
  8416. \***********************************************************************/
  8417. /*! exports provided: default */
  8418. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8419. "use strict";
  8420. __webpack_require__.r(__webpack_exports__);
  8421. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 16h9a1 1 0 0 1 0 2H2a1 1 0 0 1 0-2z\"/><path d=\"M17 1a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14zm0 1.5H3a.5.5 0 0 0-.492.41L2.5 3v9a.5.5 0 0 0 .41.492L3 12.5h14a.5.5 0 0 0 .492-.41L17.5 12V3a.5.5 0 0 0-.41-.492L17 2.5z\" fill-opacity=\".6\"/></svg>");
  8422. /***/ }),
  8423. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/check.svg":
  8424. /*!*********************************************************************!*\
  8425. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/check.svg ***!
  8426. \*********************************************************************/
  8427. /*! exports provided: default */
  8428. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8429. "use strict";
  8430. __webpack_require__.r(__webpack_exports__);
  8431. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z\"/></svg>");
  8432. /***/ }),
  8433. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/cog.svg":
  8434. /*!*******************************************************************!*\
  8435. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/cog.svg ***!
  8436. \*******************************************************************/
  8437. /*! exports provided: default */
  8438. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8439. "use strict";
  8440. __webpack_require__.r(__webpack_exports__);
  8441. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.333 2 .19 2.263a5.899 5.899 0 0 1 1.458.604L14.714 3.4 16.6 5.286l-1.467 1.733c.263.452.468.942.605 1.46L18 8.666v2.666l-2.263.19a5.899 5.899 0 0 1-.604 1.458l1.467 1.733-1.886 1.886-1.733-1.467a5.899 5.899 0 0 1-1.46.605L11.334 18H8.667l-.19-2.263a5.899 5.899 0 0 1-1.458-.604L5.286 16.6 3.4 14.714l1.467-1.733a5.899 5.899 0 0 1-.604-1.458L2 11.333V8.667l2.262-.189a5.899 5.899 0 0 1 .605-1.459L3.4 5.286 5.286 3.4l1.733 1.467a5.899 5.899 0 0 1 1.46-.605L8.666 2h2.666zM10 6.267a3.733 3.733 0 1 0 0 7.466 3.733 3.733 0 0 0 0-7.466z\"/></svg>");
  8442. /***/ }),
  8443. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/eraser.svg":
  8444. /*!**********************************************************************!*\
  8445. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/eraser.svg ***!
  8446. \**********************************************************************/
  8447. /*! exports provided: default */
  8448. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8449. "use strict";
  8450. __webpack_require__.r(__webpack_exports__);
  8451. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m8.636 9.531-2.758 3.94a.5.5 0 0 0 .122.696l3.224 2.284h1.314l2.636-3.736L8.636 9.53zm.288 8.451L5.14 15.396a2 2 0 0 1-.491-2.786l6.673-9.53a2 2 0 0 1 2.785-.49l3.742 2.62a2 2 0 0 1 .491 2.785l-7.269 10.053-2.147-.066z\"/><path d=\"M4 18h5.523v-1H4zm-2 0h1v-1H2z\"/></svg>");
  8452. /***/ }),
  8453. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/image.svg":
  8454. /*!*********************************************************************!*\
  8455. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/image.svg ***!
  8456. \*********************************************************************/
  8457. /*! exports provided: default */
  8458. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8459. "use strict";
  8460. __webpack_require__.r(__webpack_exports__);
  8461. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6.91 10.54c.26-.23.64-.21.88.03l3.36 3.14 2.23-2.06a.64.64 0 0 1 .87 0l2.52 2.97V4.5H3.2v10.12l3.71-4.08zm10.27-7.51c.6 0 1.09.47 1.09 1.05v11.84c0 .59-.49 1.06-1.09 1.06H2.79c-.6 0-1.09-.47-1.09-1.06V4.08c0-.58.49-1.05 1.1-1.05h14.38zm-5.22 5.56a1.96 1.96 0 1 1 3.4-1.96 1.96 1.96 0 0 1-3.4 1.96z\"/></svg>");
  8462. /***/ }),
  8463. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/low-vision.svg":
  8464. /*!**************************************************************************!*\
  8465. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/low-vision.svg ***!
  8466. \**************************************************************************/
  8467. /*! exports provided: default */
  8468. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8469. "use strict";
  8470. __webpack_require__.r(__webpack_exports__);
  8471. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.085 6.22 2.943 4.078a.75.75 0 1 1 1.06-1.06l2.592 2.59A11.094 11.094 0 0 1 10 5.068c4.738 0 8.578 3.101 8.578 5.083 0 1.197-1.401 2.803-3.555 3.887l1.714 1.713a.75.75 0 0 1-.09 1.138.488.488 0 0 1-.15.084.75.75 0 0 1-.821-.16L6.17 7.304c-.258.11-.51.233-.757.365l6.239 6.24-.006.005.78.78c-.388.094-.78.166-1.174.215l-1.11-1.11h.011L4.55 8.197a7.2 7.2 0 0 0-.665.514l-.112.098 4.897 4.897-.005.006 1.276 1.276a10.164 10.164 0 0 1-1.477-.117l-.479-.479-.009.009-4.863-4.863-.022.031a2.563 2.563 0 0 0-.124.2c-.043.077-.08.158-.108.241a.534.534 0 0 0-.028.133.29.29 0 0 0 .008.072.927.927 0 0 0 .082.226c.067.133.145.26.234.379l3.242 3.365.025.01.59.623c-3.265-.918-5.59-3.155-5.59-4.668 0-1.194 1.448-2.838 3.663-3.93zm7.07.531a4.632 4.632 0 0 1 1.108 5.992l.345.344.046-.018a9.313 9.313 0 0 0 2-1.112c.256-.187.5-.392.727-.613.137-.134.27-.277.392-.431.072-.091.141-.185.203-.286.057-.093.107-.19.148-.292a.72.72 0 0 0 .036-.12.29.29 0 0 0 .008-.072.492.492 0 0 0-.028-.133.999.999 0 0 0-.036-.096 2.165 2.165 0 0 0-.071-.145 2.917 2.917 0 0 0-.125-.2 3.592 3.592 0 0 0-.263-.335 5.444 5.444 0 0 0-.53-.523 7.955 7.955 0 0 0-1.054-.768 9.766 9.766 0 0 0-1.879-.891c-.337-.118-.68-.219-1.027-.301zm-2.85.21-.069.002a.508.508 0 0 0-.254.097.496.496 0 0 0-.104.679.498.498 0 0 0 .326.199l.045.005c.091.003.181.003.272.012a2.45 2.45 0 0 1 2.017 1.513c.024.061.043.125.069.185a.494.494 0 0 0 .45.287h.008a.496.496 0 0 0 .35-.158.482.482 0 0 0 .13-.335.638.638 0 0 0-.048-.219 3.379 3.379 0 0 0-.36-.723 3.438 3.438 0 0 0-2.791-1.543l-.028-.001h-.013z\"/></svg>");
  8472. /***/ }),
  8473. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-center.svg":
  8474. /*!*****************************************************************************!*\
  8475. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-center.svg ***!
  8476. \*****************************************************************************/
  8477. /*! exports provided: default */
  8478. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8479. "use strict";
  8480. __webpack_require__.r(__webpack_exports__);
  8481. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path opacity=\".5\" d=\"M2 3h16v1.5H2zm0 12h16v1.5H2z\"/><path d=\"M15.003 7v5.5a1 1 0 0 1-1 1H5.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H6.5V12h6.997V7.5z\"/></svg>");
  8482. /***/ }),
  8483. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg":
  8484. /*!*********************************************************************************!*\
  8485. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg ***!
  8486. \*********************************************************************************/
  8487. /*! exports provided: default */
  8488. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8489. "use strict";
  8490. __webpack_require__.r(__webpack_exports__);
  8491. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path opacity=\".5\" d=\"M2 3h16v1.5H2zm0 12h16v1.5H2z\"/><path d=\"M18 7v5.5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1zm-1.505.5H3.504V12h12.991V7.5z\"/></svg>");
  8492. /***/ }),
  8493. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline-left.svg":
  8494. /*!**********************************************************************************!*\
  8495. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline-left.svg ***!
  8496. \**********************************************************************************/
  8497. /*! exports provided: default */
  8498. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8499. "use strict";
  8500. __webpack_require__.r(__webpack_exports__);
  8501. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path opacity=\".5\" d=\"M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zm0-3H18v1.5h-4.5zm0-3H18v1.5h-4.5zM2 15h16v1.5H2z\"/><path d=\"M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z\"/></svg>");
  8502. /***/ }),
  8503. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline-right.svg":
  8504. /*!***********************************************************************************!*\
  8505. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline-right.svg ***!
  8506. \***********************************************************************************/
  8507. /*! exports provided: default */
  8508. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8509. "use strict";
  8510. __webpack_require__.r(__webpack_exports__);
  8511. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path opacity=\".5\" d=\"M2 3h16v1.5H2zm0 12h16v1.5H2zm0-9h5v1.5H2zm0 3h5v1.5H2zm0 3h5v1.5H2z\"/><path d=\"M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H9.5V12h6.997V7.5z\"/></svg>");
  8512. /***/ }),
  8513. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline.svg":
  8514. /*!*****************************************************************************!*\
  8515. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline.svg ***!
  8516. \*****************************************************************************/
  8517. /*! exports provided: default */
  8518. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8519. "use strict";
  8520. __webpack_require__.r(__webpack_exports__);
  8521. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path opacity=\".5\" d=\"M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zM2 15h16v1.5H2z\"/><path d=\"M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z\"/></svg>");
  8522. /***/ }),
  8523. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-left.svg":
  8524. /*!***************************************************************************!*\
  8525. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-left.svg ***!
  8526. \***************************************************************************/
  8527. /*! exports provided: default */
  8528. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8529. "use strict";
  8530. __webpack_require__.r(__webpack_exports__);
  8531. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path opacity=\".5\" d=\"M2 3h16v1.5H2zm0 12h16v1.5H2z\"/><path d=\"M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z\"/></svg>");
  8532. /***/ }),
  8533. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-right.svg":
  8534. /*!****************************************************************************!*\
  8535. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-right.svg ***!
  8536. \****************************************************************************/
  8537. /*! exports provided: default */
  8538. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8539. "use strict";
  8540. __webpack_require__.r(__webpack_exports__);
  8541. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path opacity=\".5\" d=\"M2 3h16v1.5H2zm0 12h16v1.5H2z\"/><path d=\"M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H9.5V12h6.997V7.5z\"/></svg>");
  8542. /***/ }),
  8543. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-full.svg":
  8544. /*!********************************************************************************!*\
  8545. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-full.svg ***!
  8546. \********************************************************************************/
  8547. /*! exports provided: default */
  8548. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8549. "use strict";
  8550. __webpack_require__.r(__webpack_exports__);
  8551. /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z\"/><path d=\"M18.095 2H1.905C.853 2 0 2.895 0 4v12c0 1.105.853 2 1.905 2h16.19C19.147 18 20 17.105 20 16V4c0-1.105-.853-2-1.905-2zm0 1.5c.263 0 .476.224.476.5v12c0 .276-.213.5-.476.5H1.905a.489.489 0 0 1-.476-.5V4c0-.276.213-.5.476-.5h16.19z\"/></svg>");
  8552. /***/ }),
  8553. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-large.svg":
  8554. /*!*********************************************************************************!*\
  8555. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-large.svg ***!
  8556. \*********************************************************************************/
  8557. /*! exports provided: default */
  8558. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8559. "use strict";
  8560. __webpack_require__.r(__webpack_exports__);
  8561. /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z\"/><path d=\"M13 6H2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5V8a.5.5 0 0 1 .5-.5h11z\"/></svg>");
  8562. /***/ }),
  8563. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg":
  8564. /*!**********************************************************************************!*\
  8565. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg ***!
  8566. \**********************************************************************************/
  8567. /*! exports provided: default */
  8568. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8569. "use strict";
  8570. __webpack_require__.r(__webpack_exports__);
  8571. /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z\"/><path d=\"M10 8H2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-6a.5.5 0 0 1 .5-.5h8z\"/></svg>");
  8572. /***/ }),
  8573. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-small.svg":
  8574. /*!*********************************************************************************!*\
  8575. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-small.svg ***!
  8576. \*********************************************************************************/
  8577. /*! exports provided: default */
  8578. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8579. "use strict";
  8580. __webpack_require__.r(__webpack_exports__);
  8581. /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z\"/><path d=\"M7 10H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5h5z\"/></svg>");
  8582. /***/ }),
  8583. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/pencil.svg":
  8584. /*!**********************************************************************!*\
  8585. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/pencil.svg ***!
  8586. \**********************************************************************/
  8587. /*! exports provided: default */
  8588. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8589. "use strict";
  8590. __webpack_require__.r(__webpack_exports__);
  8591. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m7.3 17.37-.061.088a1.518 1.518 0 0 1-.934.535l-4.178.663-.806-4.153a1.495 1.495 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055L7.3 17.37zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346L9.14 4.728zM6.07 16.512l-3.276-2.295.53 2.73 2.746-.435zM9.994 3.506 13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5 9.375 17H19v1.5H8z\"/></svg>");
  8592. /***/ }),
  8593. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg":
  8594. /*!***********************************************************************!*\
  8595. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg ***!
  8596. \***********************************************************************/
  8597. /*! exports provided: default */
  8598. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8599. "use strict";
  8600. __webpack_require__.r(__webpack_exports__);
  8601. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6.999 2H15a1 1 0 0 1 0 2h-1.004v13a1 1 0 1 1-2 0V4H8.999v13a1 1 0 1 1-2 0v-7A4 4 0 0 1 3 6a4 4 0 0 1 3.999-4z\"/></svg>");
  8602. /***/ }),
  8603. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/quote.svg":
  8604. /*!*********************************************************************!*\
  8605. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/quote.svg ***!
  8606. \*********************************************************************/
  8607. /*! exports provided: default */
  8608. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8609. "use strict";
  8610. __webpack_require__.r(__webpack_exports__);
  8611. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574z\"/></svg>");
  8612. /***/ }),
  8613. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg":
  8614. /*!***********************************************************************************!*\
  8615. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg ***!
  8616. \***********************************************************************************/
  8617. /*! exports provided: default */
  8618. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8619. "use strict";
  8620. __webpack_require__.r(__webpack_exports__);
  8621. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"9.5\" cy=\"4.5\" r=\"1.5\"/><circle cx=\"9.5\" cy=\"10.5\" r=\"1.5\"/><circle cx=\"9.5\" cy=\"16.5\" r=\"1.5\"/></svg>");
  8622. /***/ }),
  8623. /***/ "./node_modules/@ckeditor/ckeditor5-easy-image/src/cloudservicesuploadadapter.js":
  8624. /*!***************************************************************************************!*\
  8625. !*** ./node_modules/@ckeditor/ckeditor5-easy-image/src/cloudservicesuploadadapter.js ***!
  8626. \***************************************************************************************/
  8627. /*! exports provided: default */
  8628. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8629. "use strict";
  8630. __webpack_require__.r(__webpack_exports__);
  8631. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CloudServicesUploadAdapter; });
  8632. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  8633. /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
  8634. /**
  8635. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  8636. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  8637. */
  8638. /**
  8639. * @module easy-image/cloudservicesuploadadapter
  8640. */
  8641. /**
  8642. * A plugin that enables upload to [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/).
  8643. *
  8644. * It is mainly used by the {@link module:easy-image/easyimage~EasyImage} feature.
  8645. *
  8646. * After enabling this adapter you need to configure the CKEditor Cloud Services integration through
  8647. * {@link module:cloud-services/cloudservices~CloudServicesConfig `config.cloudServices`}.
  8648. *
  8649. * @extends module:core/plugin~Plugin
  8650. */
  8651. class CloudServicesUploadAdapter extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  8652. /**
  8653. * @inheritDoc
  8654. */
  8655. static get pluginName() {
  8656. return 'CloudServicesUploadAdapter';
  8657. }
  8658. /**
  8659. * @inheritDoc
  8660. */
  8661. static get requires() {
  8662. return [ 'CloudServices', ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileRepository"] ];
  8663. }
  8664. /**
  8665. * @inheritDoc
  8666. */
  8667. init() {
  8668. const editor = this.editor;
  8669. const cloudServices = editor.plugins.get( 'CloudServices' );
  8670. const token = cloudServices.token;
  8671. const uploadUrl = cloudServices.uploadUrl;
  8672. if ( !token ) {
  8673. return;
  8674. }
  8675. this._uploadGateway = editor.plugins.get( 'CloudServicesCore' ).createUploadGateway( token, uploadUrl );
  8676. editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileRepository"] ).createUploadAdapter = loader => {
  8677. return new Adapter( this._uploadGateway, loader );
  8678. };
  8679. }
  8680. }
  8681. /**
  8682. * @private
  8683. */
  8684. class Adapter {
  8685. constructor( uploadGateway, loader ) {
  8686. this.uploadGateway = uploadGateway;
  8687. this.loader = loader;
  8688. }
  8689. upload() {
  8690. return this.loader.file.then( file => {
  8691. this.fileUploader = this.uploadGateway.upload( file );
  8692. this.fileUploader.on( 'progress', ( evt, data ) => {
  8693. this.loader.uploadTotal = data.total;
  8694. this.loader.uploaded = data.uploaded;
  8695. } );
  8696. return this.fileUploader.send();
  8697. } );
  8698. }
  8699. abort() {
  8700. this.fileUploader.abort();
  8701. }
  8702. }
  8703. /***/ }),
  8704. /***/ "./node_modules/@ckeditor/ckeditor5-easy-image/src/easyimage.js":
  8705. /*!**********************************************************************!*\
  8706. !*** ./node_modules/@ckeditor/ckeditor5-easy-image/src/easyimage.js ***!
  8707. \**********************************************************************/
  8708. /*! exports provided: default */
  8709. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8710. "use strict";
  8711. __webpack_require__.r(__webpack_exports__);
  8712. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EasyImage; });
  8713. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  8714. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  8715. /* harmony import */ var _cloudservicesuploadadapter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cloudservicesuploadadapter */ "./node_modules/@ckeditor/ckeditor5-easy-image/src/cloudservicesuploadadapter.js");
  8716. /**
  8717. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  8718. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  8719. */
  8720. /**
  8721. * @module easy-image/easyimage
  8722. */
  8723. /**
  8724. * The Easy Image feature, which makes the image upload in CKEditor 5 possible with virtually zero
  8725. * server setup. A part of the [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/)
  8726. * family.
  8727. *
  8728. * This is a "glue" plugin which enables:
  8729. *
  8730. * * {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter}.
  8731. *
  8732. * This plugin requires plugin to be present in the editor configuration:
  8733. *
  8734. * * {@link module:image/image~Image},
  8735. * * {@link module:image/imageupload~ImageUpload},
  8736. *
  8737. * See the {@glink features/images/image-upload/easy-image "Easy Image integration" guide} to learn how to configure
  8738. * and use this feature.
  8739. *
  8740. * Check out the {@glink features/images/image-upload/image-upload comprehensive "Image upload" guide} to learn about
  8741. * other ways to upload images into CKEditor 5.
  8742. *
  8743. * **Note**: After enabling the Easy Image plugin you need to configure the
  8744. * [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/)
  8745. * integration through {@link module:cloud-services/cloudservices~CloudServicesConfig `config.cloudServices`}.
  8746. *
  8747. * @extends module:core/plugin~Plugin
  8748. */
  8749. class EasyImage extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  8750. /**
  8751. * @inheritDoc
  8752. */
  8753. static get requires() {
  8754. return [ _cloudservicesuploadadapter__WEBPACK_IMPORTED_MODULE_2__["default"], 'ImageUpload' ];
  8755. }
  8756. /**
  8757. * @inheritDoc
  8758. */
  8759. init() {
  8760. const editor = this.editor;
  8761. if ( !editor.plugins.has( 'ImageBlockEditing' ) && !editor.plugins.has( 'ImageInlineEditing' ) ) {
  8762. /**
  8763. * The Easy Image feature requires one of the following plugins to be loaded to work correctly:
  8764. *
  8765. * * {@link module:image/imageblock~ImageBlock},
  8766. * * {@link module:image/imageinline~ImageInline},
  8767. * * {@link module:image/image~Image} (loads both `ImageBlock` and `ImageInline`)
  8768. *
  8769. * Please make sure your editor configuration is correct.
  8770. *
  8771. * @error easy-image-image-feature-missing
  8772. * @param {module:core/editor/editor~Editor} editor
  8773. */
  8774. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["logWarning"])( 'easy-image-image-feature-missing', editor );
  8775. }
  8776. }
  8777. /**
  8778. * @inheritDoc
  8779. */
  8780. static get pluginName() {
  8781. return 'EasyImage';
  8782. }
  8783. }
  8784. /***/ }),
  8785. /***/ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js":
  8786. /*!******************************************************************************!*\
  8787. !*** ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js ***!
  8788. \******************************************************************************/
  8789. /*! exports provided: default */
  8790. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8791. "use strict";
  8792. __webpack_require__.r(__webpack_exports__);
  8793. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClassicEditor; });
  8794. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  8795. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  8796. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  8797. /* harmony import */ var _classiceditorui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./classiceditorui */ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditorui.js");
  8798. /* harmony import */ var _classiceditoruiview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./classiceditoruiview */ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js");
  8799. /**
  8800. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  8801. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  8802. */
  8803. /**
  8804. * @module editor-classic/classiceditor
  8805. */
  8806. /**
  8807. * The {@glink builds/guides/predefined-builds/overview#classic-editor classic editor} implementation.
  8808. * It uses an inline editable and a sticky toolbar, all enclosed in a boxed UI.
  8809. * See the {@glink examples/builds/classic-editor demo}.
  8810. *
  8811. * In order to create a classic editor instance, use the static
  8812. * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`} method.
  8813. *
  8814. * # Classic editor and classic build
  8815. *
  8816. * The classic editor can be used directly from source (if you installed the
  8817. * [`@ckeditor/ckeditor5-editor-classic`](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-classic) package)
  8818. * but it is also available in the {@glink builds/guides/predefined-builds/overview#classic-editor classic build}.
  8819. *
  8820. * {@glink builds/guides/predefined-builds/overview Builds} are ready-to-use editors with plugins bundled in. When using the editor from
  8821. * source you need to take care of loading all plugins by yourself
  8822. * (through the {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`} option).
  8823. * Using the editor from source gives much better flexibility and allows easier customization.
  8824. *
  8825. * Read more about initializing the editor from source or as a build in
  8826. * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.
  8827. *
  8828. * @mixes module:core/editor/utils/dataapimixin~DataApiMixin
  8829. * @mixes module:core/editor/utils/elementapimixin~ElementApiMixin
  8830. * @implements module:core/editor/editorwithui~EditorWithUI
  8831. * @extends module:core/editor/editor~Editor
  8832. */
  8833. class ClassicEditor extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Editor"] {
  8834. /**
  8835. * Creates an instance of the classic editor.
  8836. *
  8837. * **Note:** do not use the constructor to create editor instances. Use the static
  8838. * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`} method instead.
  8839. *
  8840. * @protected
  8841. * @param {HTMLElement|String} sourceElementOrData The DOM element that will be the source for the created editor
  8842. * or the editor's initial data. For more information see
  8843. * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.
  8844. * @param {module:core/editor/editorconfig~EditorConfig} config The editor configuration.
  8845. */
  8846. constructor( sourceElementOrData, config ) {
  8847. super( config );
  8848. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["isElement"])( sourceElementOrData ) ) {
  8849. this.sourceElement = sourceElementOrData;
  8850. }
  8851. this.model.document.createRoot();
  8852. const shouldToolbarGroupWhenFull = !this.config.get( 'toolbar.shouldNotGroupWhenFull' );
  8853. const view = new _classiceditoruiview__WEBPACK_IMPORTED_MODULE_4__["default"]( this.locale, this.editing.view, {
  8854. shouldToolbarGroupWhenFull
  8855. } );
  8856. this.ui = new _classiceditorui__WEBPACK_IMPORTED_MODULE_3__["default"]( this, view );
  8857. Object(ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["attachToForm"])( this );
  8858. }
  8859. /**
  8860. * Destroys the editor instance, releasing all resources used by it.
  8861. *
  8862. * Updates the editor's source element with the data.
  8863. *
  8864. * @returns {Promise}
  8865. */
  8866. destroy() {
  8867. if ( this.sourceElement ) {
  8868. this.updateSourceElement();
  8869. }
  8870. this.ui.destroy();
  8871. return super.destroy();
  8872. }
  8873. /**
  8874. * Creates a new classic editor instance.
  8875. *
  8876. * There are three ways how the editor can be initialized.
  8877. *
  8878. * # Replacing a DOM element (and loading data from it)
  8879. *
  8880. * You can initialize the editor using an existing DOM element:
  8881. *
  8882. * ClassicEditor
  8883. * .create( document.querySelector( '#editor' ) )
  8884. * .then( editor => {
  8885. * console.log( 'Editor was initialized', editor );
  8886. * } )
  8887. * .catch( err => {
  8888. * console.error( err.stack );
  8889. * } );
  8890. *
  8891. * The element's content will be used as the editor data and the element will be replaced by the editor UI.
  8892. *
  8893. * # Creating a detached editor
  8894. *
  8895. * Alternatively, you can initialize the editor by passing the initial data directly as a string.
  8896. * In this case, the editor will render an element that must be inserted into the DOM:
  8897. *
  8898. * ClassicEditor
  8899. * .create( '<p>Hello world!</p>' )
  8900. * .then( editor => {
  8901. * console.log( 'Editor was initialized', editor );
  8902. *
  8903. * // Initial data was provided so the editor UI element needs to be added manually to the DOM.
  8904. * document.body.appendChild( editor.ui.element );
  8905. * } )
  8906. * .catch( err => {
  8907. * console.error( err.stack );
  8908. * } );
  8909. *
  8910. * This lets you dynamically append the editor to your web page whenever it is convenient for you. You may use this method if your
  8911. * web page content is generated on the client side and the DOM structure is not ready at the moment when you initialize the editor.
  8912. *
  8913. * # Replacing a DOM element (and data provided in `config.initialData`)
  8914. *
  8915. * You can also mix these two ways by providing a DOM element to be used and passing the initial data through the configuration:
  8916. *
  8917. * ClassicEditor
  8918. * .create( document.querySelector( '#editor' ), {
  8919. * initialData: '<h2>Initial data</h2><p>Foo bar.</p>'
  8920. * } )
  8921. * .then( editor => {
  8922. * console.log( 'Editor was initialized', editor );
  8923. * } )
  8924. * .catch( err => {
  8925. * console.error( err.stack );
  8926. * } );
  8927. *
  8928. * This method can be used to initialize the editor on an existing element with the specified content in case if your integration
  8929. * makes it difficult to set the content of the source element.
  8930. *
  8931. * Note that an error will be thrown if you pass the initial data both as the first parameter and also in the configuration.
  8932. *
  8933. * # Configuring the editor
  8934. *
  8935. * See the {@link module:core/editor/editorconfig~EditorConfig editor configuration documentation} to learn more about
  8936. * customizing plugins, toolbar and more.
  8937. *
  8938. * # Using the editor from source
  8939. *
  8940. * The code samples listed in the previous sections of this documentation assume that you are using an
  8941. * {@glink builds/guides/predefined-builds/overview editor build} (for example – `@ckeditor/ckeditor5-build-classic`).
  8942. *
  8943. * If you want to use the classic editor from source (`@ckeditor/ckeditor5-editor-classic/src/classiceditor`),
  8944. * you need to define the list of
  8945. * {@link module:core/editor/editorconfig~EditorConfig#plugins plugins to be initialized} and
  8946. * {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar items}. Read more about using the editor from
  8947. * source in the {@glink builds/guides/integration/advanced-setup "Advanced setup" guide}.
  8948. *
  8949. * @param {HTMLElement|String} sourceElementOrData The DOM element that will be the source for the created editor
  8950. * or the editor's initial data.
  8951. *
  8952. * If a DOM element is passed, its content will be automatically loaded to the editor upon initialization
  8953. * and the {@link module:editor-classic/classiceditorui~ClassicEditorUI#element editor element} will replace the passed element
  8954. * in the DOM (the original one will be hidden and the editor will be injected next to it).
  8955. *
  8956. * Moreover, the editor data will be set back to the original element once the editor is destroyed and when a form, in which
  8957. * this element is contained, is submitted (if the original element is a `<textarea>`). This ensures seamless integration with native
  8958. * web forms.
  8959. *
  8960. * If the initial data is passed, a detached editor will be created. In this case you need to insert it into the DOM manually.
  8961. * It is available under the {@link module:editor-classic/classiceditorui~ClassicEditorUI#element `editor.ui.element`} property.
  8962. *
  8963. * @param {module:core/editor/editorconfig~EditorConfig} [config] The editor configuration.
  8964. * @returns {Promise} A promise resolved once the editor is ready. The promise resolves with the created editor instance.
  8965. */
  8966. static create( sourceElementOrData, config = {} ) {
  8967. return new Promise( resolve => {
  8968. const editor = new this( sourceElementOrData, config );
  8969. resolve(
  8970. editor.initPlugins()
  8971. .then( () => editor.ui.init( Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["isElement"])( sourceElementOrData ) ? sourceElementOrData : null ) )
  8972. .then( () => {
  8973. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["isElement"])( sourceElementOrData ) && config.initialData ) {
  8974. // Documented in core/editor/editorconfig.jdoc.
  8975. // eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
  8976. throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["CKEditorError"]( 'editor-create-initial-data', null );
  8977. }
  8978. const initialData = config.initialData !== undefined ? config.initialData : getInitialData( sourceElementOrData );
  8979. return editor.data.init( initialData );
  8980. } )
  8981. .then( () => editor.fire( 'ready' ) )
  8982. .then( () => editor )
  8983. );
  8984. } );
  8985. }
  8986. }
  8987. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["mix"])( ClassicEditor, ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["DataApiMixin"] );
  8988. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["mix"])( ClassicEditor, ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["ElementApiMixin"] );
  8989. function getInitialData( sourceElementOrData ) {
  8990. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["isElement"])( sourceElementOrData ) ? Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["getDataFromElement"])( sourceElementOrData ) : sourceElementOrData;
  8991. }
  8992. /***/ }),
  8993. /***/ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditorui.js":
  8994. /*!********************************************************************************!*\
  8995. !*** ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditorui.js ***!
  8996. \********************************************************************************/
  8997. /*! exports provided: default */
  8998. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8999. "use strict";
  9000. __webpack_require__.r(__webpack_exports__);
  9001. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClassicEditorUI; });
  9002. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  9003. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  9004. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  9005. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  9006. /**
  9007. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  9008. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  9009. */
  9010. /**
  9011. * @module editor-classic/classiceditorui
  9012. */
  9013. /**
  9014. * The classic editor UI class.
  9015. *
  9016. * @extends module:core/editor/editorui~EditorUI
  9017. */
  9018. class ClassicEditorUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["EditorUI"] {
  9019. /**
  9020. * Creates an instance of the classic editor UI class.
  9021. *
  9022. * @param {module:core/editor/editor~Editor} editor The editor instance.
  9023. * @param {module:ui/editorui/editoruiview~EditorUIView} view The view of the UI.
  9024. */
  9025. constructor( editor, view ) {
  9026. super( editor );
  9027. /**
  9028. * The main (top–most) view of the editor UI.
  9029. *
  9030. * @readonly
  9031. * @member {module:ui/editorui/editoruiview~EditorUIView} #view
  9032. */
  9033. this.view = view;
  9034. /**
  9035. * A normalized `config.toolbar` object.
  9036. *
  9037. * @private
  9038. * @member {Object}
  9039. */
  9040. this._toolbarConfig = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["normalizeToolbarConfig"])( editor.config.get( 'toolbar' ) );
  9041. /**
  9042. * The element replacer instance used to hide the editor's source element.
  9043. *
  9044. * @protected
  9045. * @member {module:utils/elementreplacer~ElementReplacer}
  9046. */
  9047. this._elementReplacer = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["ElementReplacer"]();
  9048. }
  9049. /**
  9050. * @inheritDoc
  9051. */
  9052. get element() {
  9053. return this.view.element;
  9054. }
  9055. /**
  9056. * Initializes the UI.
  9057. *
  9058. * @param {HTMLElement|null} replacementElement The DOM element that will be the source for the created editor.
  9059. */
  9060. init( replacementElement ) {
  9061. const editor = this.editor;
  9062. const view = this.view;
  9063. const editingView = editor.editing.view;
  9064. const editable = view.editable;
  9065. const editingRoot = editingView.document.getRoot();
  9066. // The editable UI and editing root should share the same name. Then name is used
  9067. // to recognize the particular editable, for instance in ARIA attributes.
  9068. editable.name = editingRoot.rootName;
  9069. view.render();
  9070. // The editable UI element in DOM is available for sure only after the editor UI view has been rendered.
  9071. // But it can be available earlier if a DOM element has been passed to BalloonEditor.create().
  9072. const editableElement = editable.element;
  9073. // Register the editable UI view in the editor. A single editor instance can aggregate multiple
  9074. // editable areas (roots) but the classic editor has only one.
  9075. this.setEditableElement( editable.name, editableElement );
  9076. // Let the global focus tracker know that the editable UI element is focusable and
  9077. // belongs to the editor. From now on, the focus tracker will sustain the editor focus
  9078. // as long as the editable is focused (e.g. the user is typing).
  9079. this.focusTracker.add( editableElement );
  9080. // Let the editable UI element respond to the changes in the global editor focus
  9081. // tracker. It has been added to the same tracker a few lines above but, in reality, there are
  9082. // many focusable areas in the editor, like balloons, toolbars or dropdowns and as long
  9083. // as they have focus, the editable should act like it is focused too (although technically
  9084. // it isn't), e.g. by setting the proper CSS class, visually announcing focus to the user.
  9085. // Doing otherwise will result in editable focus styles disappearing, once e.g. the
  9086. // toolbar gets focused.
  9087. view.editable.bind( 'isFocused' ).to( this.focusTracker );
  9088. // Bind the editable UI element to the editing view, making it an end– and entry–point
  9089. // of the editor's engine. This is where the engine meets the UI.
  9090. editingView.attachDomRoot( editableElement );
  9091. // If an element containing the initial data of the editor was provided, replace it with
  9092. // an editor instance's UI in DOM until the editor is destroyed. For instance, a <textarea>
  9093. // can be such element.
  9094. if ( replacementElement ) {
  9095. this._elementReplacer.replace( replacementElement, this.element );
  9096. }
  9097. this._initPlaceholder();
  9098. this._initToolbar();
  9099. this.fire( 'ready' );
  9100. }
  9101. /**
  9102. * @inheritDoc
  9103. */
  9104. destroy() {
  9105. const view = this.view;
  9106. const editingView = this.editor.editing.view;
  9107. this._elementReplacer.restore();
  9108. editingView.detachDomRoot( view.editable.name );
  9109. view.destroy();
  9110. super.destroy();
  9111. }
  9112. /**
  9113. * Initializes the editor toolbar.
  9114. *
  9115. * @private
  9116. */
  9117. _initToolbar() {
  9118. const editor = this.editor;
  9119. const view = this.view;
  9120. const editingView = editor.editing.view;
  9121. // Set–up the sticky panel with toolbar.
  9122. view.stickyPanel.bind( 'isActive' ).to( this.focusTracker, 'isFocused' );
  9123. view.stickyPanel.limiterElement = view.element;
  9124. view.stickyPanel.bind( 'viewportTopOffset' ).to( this, 'viewportOffset', ( { top } ) => top );
  9125. view.toolbar.fillFromConfig( this._toolbarConfig, this.componentFactory );
  9126. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["enableToolbarKeyboardFocus"])( {
  9127. origin: editingView,
  9128. originFocusTracker: this.focusTracker,
  9129. originKeystrokeHandler: editor.keystrokes,
  9130. toolbar: view.toolbar
  9131. } );
  9132. }
  9133. /**
  9134. * Enable the placeholder text on the editing root, if any was configured.
  9135. *
  9136. * @private
  9137. */
  9138. _initPlaceholder() {
  9139. const editor = this.editor;
  9140. const editingView = editor.editing.view;
  9141. const editingRoot = editingView.document.getRoot();
  9142. const sourceElement = editor.sourceElement;
  9143. const placeholderText = editor.config.get( 'placeholder' ) ||
  9144. sourceElement && sourceElement.tagName.toLowerCase() === 'textarea' && sourceElement.getAttribute( 'placeholder' );
  9145. if ( placeholderText ) {
  9146. Object(ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_2__["enablePlaceholder"])( {
  9147. view: editingView,
  9148. element: editingRoot,
  9149. text: placeholderText,
  9150. isDirectHost: false,
  9151. keepOnFocus: true
  9152. } );
  9153. }
  9154. }
  9155. }
  9156. /***/ }),
  9157. /***/ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js":
  9158. /*!************************************************************************************!*\
  9159. !*** ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js ***!
  9160. \************************************************************************************/
  9161. /*! exports provided: default */
  9162. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9163. "use strict";
  9164. __webpack_require__.r(__webpack_exports__);
  9165. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClassicEditorUIView; });
  9166. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  9167. /* harmony import */ var _theme_classiceditor_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../theme/classiceditor.css */ "./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css");
  9168. /**
  9169. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  9170. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  9171. */
  9172. /**
  9173. * @module editor-classic/classiceditoruiview
  9174. */
  9175. /**
  9176. * Classic editor UI view. Uses an inline editable and a sticky toolbar, all
  9177. * enclosed in a boxed UI view.
  9178. *
  9179. * @extends module:ui/editorui/boxed/boxededitoruiview~BoxedEditorUIView
  9180. */
  9181. class ClassicEditorUIView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["BoxedEditorUIView"] {
  9182. /**
  9183. * Creates an instance of the classic editor UI view.
  9184. *
  9185. * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor#locale} instance.
  9186. * @param {module:engine/view/view~View} editingView The editing view instance this view is related to.
  9187. * @param {Object} [options={}] Configuration options for the view instance.
  9188. * @param {Boolean} [options.shouldToolbarGroupWhenFull] When set `true` enables automatic items grouping
  9189. * in the main {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#toolbar toolbar}.
  9190. * See {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull} to learn more.
  9191. */
  9192. constructor( locale, editingView, options = {} ) {
  9193. super( locale );
  9194. /**
  9195. * Sticky panel view instance. This is a parent view of a {@link #toolbar}
  9196. * that makes toolbar sticky.
  9197. *
  9198. * @readonly
  9199. * @member {module:ui/panel/sticky/stickypanelview~StickyPanelView}
  9200. */
  9201. this.stickyPanel = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["StickyPanelView"]( locale );
  9202. /**
  9203. * Toolbar view instance.
  9204. *
  9205. * @readonly
  9206. * @member {module:ui/toolbar/toolbarview~ToolbarView}
  9207. */
  9208. this.toolbar = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ToolbarView"]( locale, {
  9209. shouldGroupWhenFull: options.shouldToolbarGroupWhenFull
  9210. } );
  9211. /**
  9212. * Editable UI view.
  9213. *
  9214. * @readonly
  9215. * @member {module:ui/editableui/inline/inlineeditableuiview~InlineEditableUIView}
  9216. */
  9217. this.editable = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["InlineEditableUIView"]( locale, editingView );
  9218. }
  9219. /**
  9220. * @inheritDoc
  9221. */
  9222. render() {
  9223. super.render();
  9224. // Set toolbar as a child of a stickyPanel and makes toolbar sticky.
  9225. this.stickyPanel.content.add( this.toolbar );
  9226. this.top.add( this.stickyPanel );
  9227. this.main.add( this.editable );
  9228. }
  9229. }
  9230. /***/ }),
  9231. /***/ "./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css":
  9232. /*!*********************************************************************************!*\
  9233. !*** ./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css ***!
  9234. \*********************************************************************************/
  9235. /*! exports provided: default */
  9236. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9237. "use strict";
  9238. __webpack_require__.r(__webpack_exports__);
  9239. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  9240. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  9241. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_classiceditor_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./classiceditor.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css");
  9242. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  9243. options.insert = "head";
  9244. options.singleton = true;
  9245. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_classiceditor_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  9246. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_classiceditor_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  9247. /***/ }),
  9248. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js":
  9249. /*!**********************************************************************************!*\
  9250. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js ***!
  9251. \**********************************************************************************/
  9252. /*! exports provided: default */
  9253. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9254. "use strict";
  9255. __webpack_require__.r(__webpack_exports__);
  9256. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DataController; });
  9257. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  9258. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  9259. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  9260. /* harmony import */ var _conversion_mapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../conversion/mapper */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js");
  9261. /* harmony import */ var _conversion_downcastdispatcher__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../conversion/downcastdispatcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js");
  9262. /* harmony import */ var _conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../conversion/downcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js");
  9263. /* harmony import */ var _conversion_upcastdispatcher__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../conversion/upcastdispatcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcastdispatcher.js");
  9264. /* harmony import */ var _conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../conversion/upcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js");
  9265. /* harmony import */ var _view_documentfragment__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../view/documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js");
  9266. /* harmony import */ var _view_document__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../view/document */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js");
  9267. /* harmony import */ var _view_downcastwriter__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../view/downcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js");
  9268. /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  9269. /* harmony import */ var _model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../model/utils/autoparagraphing */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js");
  9270. /* harmony import */ var _dataprocessor_htmldataprocessor__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../dataprocessor/htmldataprocessor */ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js");
  9271. /**
  9272. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  9273. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  9274. */
  9275. /**
  9276. * @module engine/controller/datacontroller
  9277. */
  9278. /**
  9279. * Controller for the data pipeline. The data pipeline controls how data is retrieved from the document
  9280. * and set inside it. Hence, the controller features two methods which allow to {@link ~DataController#get get}
  9281. * and {@link ~DataController#set set} data of the {@link ~DataController#model model}
  9282. * using given:
  9283. *
  9284. * * {@link module:engine/dataprocessor/dataprocessor~DataProcessor data processor},
  9285. * * downcast converters,
  9286. * * upcast converters.
  9287. *
  9288. * An instance of the data controller is always available in the {@link module:core/editor/editor~Editor#data `editor.data`}
  9289. * property:
  9290. *
  9291. * editor.data.get( { rootName: 'customRoot' } ); // -> '<p>Hello!</p>'
  9292. *
  9293. * @mixes module:utils/observablemixin~ObservableMixin
  9294. */
  9295. class DataController {
  9296. /**
  9297. * Creates a data controller instance.
  9298. *
  9299. * @param {module:engine/model/model~Model} model Data model.
  9300. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor The styles processor instance.
  9301. */
  9302. constructor( model, stylesProcessor ) {
  9303. /**
  9304. * Data model.
  9305. *
  9306. * @readonly
  9307. * @member {module:engine/model/model~Model}
  9308. */
  9309. this.model = model;
  9310. /**
  9311. * Mapper used for the conversion. It has no permanent bindings, because they are created when getting data and
  9312. * cleared directly after the data are converted. However, the mapper is defined as a class property, because
  9313. * it needs to be passed to the `DowncastDispatcher` as a conversion API.
  9314. *
  9315. * @readonly
  9316. * @member {module:engine/conversion/mapper~Mapper}
  9317. */
  9318. this.mapper = new _conversion_mapper__WEBPACK_IMPORTED_MODULE_3__["default"]();
  9319. /**
  9320. * Downcast dispatcher used by the {@link #get get method}. Downcast converters should be attached to it.
  9321. *
  9322. * @readonly
  9323. * @member {module:engine/conversion/downcastdispatcher~DowncastDispatcher}
  9324. */
  9325. this.downcastDispatcher = new _conversion_downcastdispatcher__WEBPACK_IMPORTED_MODULE_4__["default"]( {
  9326. mapper: this.mapper,
  9327. schema: model.schema
  9328. } );
  9329. this.downcastDispatcher.on( 'insert:$text', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_5__["insertText"])(), { priority: 'lowest' } );
  9330. /**
  9331. * Upcast dispatcher used by the {@link #set set method}. Upcast converters should be attached to it.
  9332. *
  9333. * @readonly
  9334. * @member {module:engine/conversion/upcastdispatcher~UpcastDispatcher}
  9335. */
  9336. this.upcastDispatcher = new _conversion_upcastdispatcher__WEBPACK_IMPORTED_MODULE_6__["default"]( {
  9337. schema: model.schema
  9338. } );
  9339. /**
  9340. * The view document used by the data controller.
  9341. *
  9342. * @readonly
  9343. * @member {module:engine/view/document~Document}
  9344. */
  9345. this.viewDocument = new _view_document__WEBPACK_IMPORTED_MODULE_9__["default"]( stylesProcessor );
  9346. /**
  9347. * Styles processor used during the conversion.
  9348. *
  9349. * @readonly
  9350. * @member {module:engine/view/stylesmap~StylesProcessor}
  9351. */
  9352. this.stylesProcessor = stylesProcessor;
  9353. /**
  9354. * Data processor used specifically for HTML conversion.
  9355. *
  9356. * @readonly
  9357. * @member {module:engine/dataprocessor/htmldataprocessor~HtmlDataProcessor} #htmlProcessor
  9358. */
  9359. this.htmlProcessor = new _dataprocessor_htmldataprocessor__WEBPACK_IMPORTED_MODULE_13__["default"]( this.viewDocument );
  9360. /**
  9361. * Data processor used during the conversion.
  9362. * Same instance as {@link #htmlProcessor} by default. Can be replaced at run time to handle different format, e.g. XML or Markdown.
  9363. *
  9364. * @member {module:engine/dataprocessor/dataprocessor~DataProcessor} #processor
  9365. */
  9366. this.processor = this.htmlProcessor;
  9367. /**
  9368. * The view downcast writer just for data conversion purposes, i.e. to modify
  9369. * the {@link #viewDocument}.
  9370. *
  9371. * @private
  9372. * @readonly
  9373. * @member {module:engine/view/downcastwriter~DowncastWriter}
  9374. */
  9375. this._viewWriter = new _view_downcastwriter__WEBPACK_IMPORTED_MODULE_10__["default"]( this.viewDocument );
  9376. // Define default converters for text and elements.
  9377. //
  9378. // Note that if there is no default converter for the element it will be skipped, for instance `<b>foo</b>` will be
  9379. // converted to nothing. We therefore add `convertToModelFragment` as a last converter so it converts children of that
  9380. // element to the document fragment and so `<b>foo</b>` will be converted to `foo` if there is no converter for `<b>`.
  9381. this.upcastDispatcher.on( 'text', Object(_conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__["convertText"])(), { priority: 'lowest' } );
  9382. this.upcastDispatcher.on( 'element', Object(_conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__["convertToModelFragment"])(), { priority: 'lowest' } );
  9383. this.upcastDispatcher.on( 'documentFragment', Object(_conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__["convertToModelFragment"])(), { priority: 'lowest' } );
  9384. this.decorate( 'init' );
  9385. this.decorate( 'set' );
  9386. this.decorate( 'get' );
  9387. // Fire the `ready` event when the initialization has completed. Such low-level listener gives possibility
  9388. // to plug into the initialization pipeline without interrupting the initialization flow.
  9389. this.on( 'init', () => {
  9390. this.fire( 'ready' );
  9391. }, { priority: 'lowest' } );
  9392. // Fix empty roots after DataController is 'ready' (note that init method could be decorated and stopped).
  9393. // We need to handle this event because initial data could be empty and post-fixer would not get triggered.
  9394. this.on( 'ready', () => {
  9395. this.model.enqueueChange( 'transparent', _model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_12__["autoParagraphEmptyRoots"] );
  9396. }, { priority: 'lowest' } );
  9397. }
  9398. /**
  9399. * Returns the model's data converted by downcast dispatchers attached to {@link #downcastDispatcher} and
  9400. * formatted by the {@link #processor data processor}.
  9401. *
  9402. * @fires get
  9403. * @param {Object} [options] Additional configuration for the retrieved data. `DataController` provides two optional
  9404. * properties: `rootName` and `trim`. Other properties of this object are specified by various editor features.
  9405. * @param {String} [options.rootName='main'] Root name.
  9406. * @param {String} [options.trim='empty'] Whether returned data should be trimmed. This option is set to `empty` by default,
  9407. * which means whenever editor content is considered empty, an empty string will be returned. To turn off trimming completely
  9408. * use `'none'`. In such cases exact content will be returned (for example `<p>&nbsp;</p>` for an empty editor).
  9409. * @returns {String} Output data.
  9410. */
  9411. get( options = {} ) {
  9412. const { rootName = 'main', trim = 'empty' } = options;
  9413. if ( !this._checkIfRootsExists( [ rootName ] ) ) {
  9414. /**
  9415. * Cannot get data from a non-existing root. This error is thrown when {@link #get DataController#get() method}
  9416. * is called with non-existent root name. For example, if there is an editor instance with only `main` root,
  9417. * calling {@link #get} like:
  9418. *
  9419. * data.get( { rootName: 'root2' } );
  9420. *
  9421. * will throw this error.
  9422. *
  9423. * @error datacontroller-get-non-existent-root
  9424. */
  9425. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'datacontroller-get-non-existent-root', this );
  9426. }
  9427. const root = this.model.document.getRoot( rootName );
  9428. if ( trim === 'empty' && !this.model.hasContent( root, { ignoreWhitespaces: true } ) ) {
  9429. return '';
  9430. }
  9431. return this.stringify( root, options );
  9432. }
  9433. /**
  9434. * Returns the content of the given {@link module:engine/model/element~Element model's element} or
  9435. * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast converters
  9436. * attached to {@link #downcastDispatcher} and formatted by the {@link #processor data processor}.
  9437. *
  9438. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} modelElementOrFragment
  9439. * Element whose content will be stringified.
  9440. * @param {Object} [options] Additional configuration passed to the conversion process.
  9441. * @returns {String} Output data.
  9442. */
  9443. stringify( modelElementOrFragment, options = {} ) {
  9444. // Model -> view.
  9445. const viewDocumentFragment = this.toView( modelElementOrFragment, options );
  9446. // View -> data.
  9447. return this.processor.toData( viewDocumentFragment );
  9448. }
  9449. /**
  9450. * Returns the content of the given {@link module:engine/model/element~Element model element} or
  9451. * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast
  9452. * converters attached to {@link #downcastDispatcher} to a
  9453. * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}.
  9454. *
  9455. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} modelElementOrFragment
  9456. * Element or document fragment whose content will be converted.
  9457. * @param {Object} [options={}] Additional configuration that will be available through
  9458. * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi#options} during the conversion process.
  9459. * @returns {module:engine/view/documentfragment~DocumentFragment} Output view DocumentFragment.
  9460. */
  9461. toView( modelElementOrFragment, options = {} ) {
  9462. const viewDocument = this.viewDocument;
  9463. const viewWriter = this._viewWriter;
  9464. // Clear bindings so the call to this method gives correct results.
  9465. this.mapper.clearBindings();
  9466. // First, convert elements.
  9467. const modelRange = _model_range__WEBPACK_IMPORTED_MODULE_11__["default"]._createIn( modelElementOrFragment );
  9468. const viewDocumentFragment = new _view_documentfragment__WEBPACK_IMPORTED_MODULE_8__["default"]( viewDocument );
  9469. this.mapper.bindElements( modelElementOrFragment, viewDocumentFragment );
  9470. // Make additional options available during conversion process through `conversionApi`.
  9471. this.downcastDispatcher.conversionApi.options = options;
  9472. // We have no view controller and rendering to DOM in DataController so view.change() block is not used here.
  9473. this.downcastDispatcher.convertInsert( modelRange, viewWriter );
  9474. // Convert markers.
  9475. // For document fragment, simply take the markers assigned to this document fragment.
  9476. // For model root, all markers in that root will be taken.
  9477. // For model element, we need to check which markers are intersecting with this element and relatively modify the markers' ranges.
  9478. // Collapsed markers at element boundary, although considered as not intersecting with the element, will also be returned.
  9479. const markers = modelElementOrFragment.is( 'documentFragment' ) ?
  9480. Array.from( modelElementOrFragment.markers ) :
  9481. _getMarkersRelativeToElement( modelElementOrFragment );
  9482. for ( const [ name, range ] of markers ) {
  9483. this.downcastDispatcher.convertMarkerAdd( name, range, viewWriter );
  9484. }
  9485. // Clean `conversionApi`.
  9486. delete this.downcastDispatcher.conversionApi.options;
  9487. return viewDocumentFragment;
  9488. }
  9489. /**
  9490. * Sets initial input data parsed by the {@link #processor data processor} and
  9491. * converted by the {@link #upcastDispatcher view-to-model converters}.
  9492. * Initial data can be set only to document that {@link module:engine/model/document~Document#version} is equal 0.
  9493. *
  9494. * **Note** This method is {@link module:utils/observablemixin~ObservableMixin#decorate decorated} which is
  9495. * used by e.g. collaborative editing plugin that syncs remote data on init.
  9496. *
  9497. * When data is passed as a string it is initialized on a default `main` root:
  9498. *
  9499. * dataController.init( '<p>Foo</p>' ); // Initializes data on the `main` root.
  9500. *
  9501. * To initialize data on a different root or multiple roots at once, object containing `rootName` - `data` pairs should be passed:
  9502. *
  9503. * dataController.init( { main: '<p>Foo</p>', title: '<h1>Bar</h1>' } ); // Initializes data on the `main` and `title` roots.
  9504. *
  9505. * @fires init
  9506. * @param {String|Object.<String,String>} data Input data as a string or an object containing `rootName` - `data`
  9507. * pairs to initialize data on multiple roots at once.
  9508. * @returns {Promise} Promise that is resolved after the data is set on the editor.
  9509. */
  9510. init( data ) {
  9511. if ( this.model.document.version ) {
  9512. /**
  9513. * Cannot set initial data to not empty {@link module:engine/model/document~Document}.
  9514. * Initial data should be set once, during {@link module:core/editor/editor~Editor} initialization,
  9515. * when the {@link module:engine/model/document~Document#version} is equal 0.
  9516. *
  9517. * @error datacontroller-init-document-not-empty
  9518. */
  9519. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'datacontroller-init-document-not-empty', this );
  9520. }
  9521. let initialData = {};
  9522. if ( typeof data === 'string' ) {
  9523. initialData.main = data; // Default root is 'main'. To initiate data on a different root, object should be passed.
  9524. } else {
  9525. initialData = data;
  9526. }
  9527. if ( !this._checkIfRootsExists( Object.keys( initialData ) ) ) {
  9528. /**
  9529. * Cannot init data on a non-existing root. This error is thrown when {@link #init DataController#init() method}
  9530. * is called with non-existent root name. For example, if there is an editor instance with only `main` root,
  9531. * calling {@link #init} like:
  9532. *
  9533. * data.init( { main: '<p>Foo</p>', root2: '<p>Bar</p>' } );
  9534. *
  9535. * will throw this error.
  9536. *
  9537. * @error datacontroller-init-non-existent-root
  9538. */
  9539. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'datacontroller-init-non-existent-root', this );
  9540. }
  9541. this.model.enqueueChange( 'transparent', writer => {
  9542. for ( const rootName of Object.keys( initialData ) ) {
  9543. const modelRoot = this.model.document.getRoot( rootName );
  9544. writer.insert( this.parse( initialData[ rootName ], modelRoot ), modelRoot, 0 );
  9545. }
  9546. } );
  9547. return Promise.resolve();
  9548. }
  9549. /**
  9550. * Sets input data parsed by the {@link #processor data processor} and
  9551. * converted by the {@link #upcastDispatcher view-to-model converters}.
  9552. * This method can be used any time to replace existing editor data by the new one without clearing the
  9553. * {@link module:engine/model/document~Document#history document history}.
  9554. *
  9555. * This method also creates a batch with all the changes applied. If all you need is to parse data, use
  9556. * the {@link #parse} method.
  9557. *
  9558. * When data is passed as a string it is set on a default `main` root:
  9559. *
  9560. * dataController.set( '<p>Foo</p>' ); // Sets data on the `main` root.
  9561. *
  9562. * To set data on a different root or multiple roots at once, object containing `rootName` - `data` pairs should be passed:
  9563. *
  9564. * dataController.set( { main: '<p>Foo</p>', title: '<h1>Bar</h1>' } ); // Sets data on the `main` and `title` roots.
  9565. *
  9566. * To set the data with preserved undo stacks and set the current change to this stack, use the `{ batchType: 'default' }` option.
  9567. *
  9568. * dataController.set( '<p>Foo</p>', { batchType: 'default' } ); // Sets data as a new change.
  9569. *
  9570. * @fires set
  9571. * @param {String|Object.<String,String>} data Input data as a string or an object containing `rootName` - `data`
  9572. * pairs to set data on multiple roots at once.
  9573. * @param {Object} [options={}] Options for setting data.
  9574. * @param {'default'|'transparent'} [options.batchType='default'] The batch type that will be used to create a batch for the changes.
  9575. * When set to `default`, the undo and redo stacks will be preserved. Note that when not set, the undo feature (when present) will
  9576. * override it to `transparent` and all undo steps will be lost.
  9577. */
  9578. set( data, options = {} ) {
  9579. let newData = {};
  9580. if ( typeof data === 'string' ) {
  9581. newData.main = data; // Default root is 'main'. To set data on a different root, object should be passed.
  9582. } else {
  9583. newData = data;
  9584. }
  9585. if ( !this._checkIfRootsExists( Object.keys( newData ) ) ) {
  9586. /**
  9587. * Cannot set data on a non-existing root. This error is thrown when {@link #set DataController#set() method}
  9588. * is called with non-existent root name. For example, if there is an editor instance with only `main` root,
  9589. * calling {@link #set} like:
  9590. *
  9591. * data.set( { main: '<p>Foo</p>', root2: '<p>Bar</p>' } );
  9592. *
  9593. * will throw this error.
  9594. *
  9595. * @error datacontroller-set-non-existent-root
  9596. */
  9597. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'datacontroller-set-non-existent-root', this );
  9598. }
  9599. const batchType = options.batchType || 'default';
  9600. this.model.enqueueChange( batchType, writer => {
  9601. writer.setSelection( null );
  9602. writer.removeSelectionAttribute( this.model.document.selection.getAttributeKeys() );
  9603. for ( const rootName of Object.keys( newData ) ) {
  9604. // Save to model.
  9605. const modelRoot = this.model.document.getRoot( rootName );
  9606. writer.remove( writer.createRangeIn( modelRoot ) );
  9607. writer.insert( this.parse( newData[ rootName ], modelRoot ), modelRoot, 0 );
  9608. }
  9609. } );
  9610. }
  9611. /**
  9612. * Returns the data parsed by the {@link #processor data processor} and then converted by upcast converters
  9613. * attached to the {@link #upcastDispatcher}.
  9614. *
  9615. * @see #set
  9616. * @param {String} data Data to parse.
  9617. * @param {module:engine/model/schema~SchemaContextDefinition} [context='$root'] Base context in which the view will
  9618. * be converted to the model. See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.
  9619. * @returns {module:engine/model/documentfragment~DocumentFragment} Parsed data.
  9620. */
  9621. parse( data, context = '$root' ) {
  9622. // data -> view
  9623. const viewDocumentFragment = this.processor.toView( data );
  9624. // view -> model
  9625. return this.toModel( viewDocumentFragment, context );
  9626. }
  9627. /**
  9628. * Returns the result of the given {@link module:engine/view/element~Element view element} or
  9629. * {@link module:engine/view/documentfragment~DocumentFragment view document fragment} converted by the
  9630. * {@link #upcastDispatcher view-to-model converters}, wrapped by {@link module:engine/model/documentfragment~DocumentFragment}.
  9631. *
  9632. * When marker elements were converted during the conversion process, it will be set as a document fragment's
  9633. * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.
  9634. *
  9635. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} viewElementOrFragment
  9636. * Element or document fragment whose content will be converted.
  9637. * @param {module:engine/model/schema~SchemaContextDefinition} [context='$root'] Base context in which the view will
  9638. * be converted to the model. See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.
  9639. * @returns {module:engine/model/documentfragment~DocumentFragment} Output document fragment.
  9640. */
  9641. toModel( viewElementOrFragment, context = '$root' ) {
  9642. return this.model.change( writer => {
  9643. return this.upcastDispatcher.convert( viewElementOrFragment, writer, context );
  9644. } );
  9645. }
  9646. /**
  9647. * Adds a style processor normalization rules.
  9648. *
  9649. * You can implement your own rules as well as use one of the available processor rules:
  9650. *
  9651. * * background: {@link module:engine/view/styles/background~addBackgroundRules}
  9652. * * border: {@link module:engine/view/styles/border~addBorderRules}
  9653. * * margin: {@link module:engine/view/styles/margin~addMarginRules}
  9654. * * padding: {@link module:engine/view/styles/padding~addPaddingRules}
  9655. *
  9656. * @param {Function} callback
  9657. */
  9658. addStyleProcessorRules( callback ) {
  9659. callback( this.stylesProcessor );
  9660. }
  9661. /**
  9662. * Registers a {@link module:engine/view/matcher~MatcherPattern} on {@link #htmlProcessor htmlProcessor}
  9663. * and {@link #processor processor} for view elements whose content should be treated as a raw data
  9664. * and not processed during conversion from DOM to view elements.
  9665. *
  9666. * The raw data can be later accessed by {@link module:engine/view/element~Element#getCustomProperty view element custom property}
  9667. * `"$rawContent"`.
  9668. *
  9669. * @param {module:engine/view/matcher~MatcherPattern} pattern Pattern matching all view elements whose content should
  9670. * be treated as a raw data.
  9671. */
  9672. registerRawContentMatcher( pattern ) {
  9673. // No need to register the pattern if both `htmlProcessor` and `processor` are the same instances.
  9674. if ( this.processor && this.processor !== this.htmlProcessor ) {
  9675. this.processor.registerRawContentMatcher( pattern );
  9676. }
  9677. this.htmlProcessor.registerRawContentMatcher( pattern );
  9678. }
  9679. /**
  9680. * Removes all event listeners set by the DataController.
  9681. */
  9682. destroy() {
  9683. this.stopListening();
  9684. }
  9685. /**
  9686. * Checks if all provided root names are existing editor roots.
  9687. *
  9688. * @private
  9689. * @param {Array.<String>} rootNames Root names to check.
  9690. * @returns {Boolean} Whether all provided root names are existing editor roots.
  9691. */
  9692. _checkIfRootsExists( rootNames ) {
  9693. for ( const rootName of rootNames ) {
  9694. if ( !this.model.document.getRootNames().includes( rootName ) ) {
  9695. return false;
  9696. }
  9697. }
  9698. return true;
  9699. }
  9700. /**
  9701. * Event fired once the data initialization has finished.
  9702. *
  9703. * @event ready
  9704. */
  9705. /**
  9706. * Event fired after the {@link #init `init()` method} was run. It can be {@link #listenTo listened to} in order to adjust or modify
  9707. * the initialization flow. However, if the `init` event is stopped or prevented, the {@link #event:ready `ready` event}
  9708. * should be fired manually.
  9709. *
  9710. * The `init` event is fired by the decorated {@link #init} method.
  9711. * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.
  9712. *
  9713. * @event init
  9714. */
  9715. /**
  9716. * Event fired after {@link #set set() method} has been run.
  9717. *
  9718. * The `set` event is fired by decorated {@link #set} method.
  9719. * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.
  9720. *
  9721. * @event set
  9722. */
  9723. /**
  9724. * Event fired after the {@link #get get() method} has been run.
  9725. *
  9726. * The `get` event is fired by decorated {@link #get} method.
  9727. * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.
  9728. *
  9729. * @event get
  9730. */
  9731. }
  9732. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( DataController, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  9733. // Helper function for downcast conversion.
  9734. //
  9735. // Takes a document element (element that is added to a model document) and checks which markers are inside it. If the marker is collapsed
  9736. // at element boundary, it is considered as contained inside the element and marker range is returned. Otherwise, if the marker is
  9737. // intersecting with the element, the intersection is returned.
  9738. function _getMarkersRelativeToElement( element ) {
  9739. const result = [];
  9740. const doc = element.root.document;
  9741. if ( !doc ) {
  9742. return [];
  9743. }
  9744. const elementRange = _model_range__WEBPACK_IMPORTED_MODULE_11__["default"]._createIn( element );
  9745. for ( const marker of doc.model.markers ) {
  9746. const markerRange = marker.getRange();
  9747. const isMarkerCollapsed = markerRange.isCollapsed;
  9748. const isMarkerAtElementBoundary = markerRange.start.isEqual( elementRange.start ) || markerRange.end.isEqual( elementRange.end );
  9749. if ( isMarkerCollapsed && isMarkerAtElementBoundary ) {
  9750. result.push( [ marker.name, markerRange ] );
  9751. } else {
  9752. const updatedMarkerRange = elementRange.getIntersection( markerRange );
  9753. if ( updatedMarkerRange ) {
  9754. result.push( [ marker.name, updatedMarkerRange ] );
  9755. }
  9756. }
  9757. }
  9758. // Sort the markers in a stable fashion to ensure that the order in which they are
  9759. // added to the model's marker collection does not affect how they are
  9760. // downcast. One particular use case that we are targeting here, is one where
  9761. // two markers are adjacent but not overlapping, such as an insertion/deletion
  9762. // suggestion pair representing the replacement of a range of text. In this
  9763. // case, putting the markers in DOM order causes the first marker's end to be
  9764. // serialized right after the second marker's start, while putting the markers
  9765. // in reverse DOM order causes it to be right before the second marker's
  9766. // start. So, we sort these in a way that ensures non-intersecting ranges are in
  9767. // reverse DOM order, and intersecting ranges are in something approximating
  9768. // reverse DOM order (since reverse DOM order doesn't have a precise meaning
  9769. // when working with intersecting ranges).
  9770. return result.sort( ( [ n1, r1 ], [ n2, r2 ] ) => {
  9771. if ( r1.end.compareWith( r2.start ) !== 'after' ) {
  9772. // m1.end <= m2.start -- m1 is entirely <= m2
  9773. return 1;
  9774. } else if ( r1.start.compareWith( r2.end ) !== 'before' ) {
  9775. // m1.start >= m2.end -- m1 is entirely >= m2
  9776. return -1;
  9777. } else {
  9778. // they overlap, so use their start positions as the primary sort key and
  9779. // end positions as the secondary sort key
  9780. switch ( r1.start.compareWith( r2.start ) ) {
  9781. case 'before':
  9782. return 1;
  9783. case 'after':
  9784. return -1;
  9785. default:
  9786. switch ( r1.end.compareWith( r2.end ) ) {
  9787. case 'before':
  9788. return 1;
  9789. case 'after':
  9790. return -1;
  9791. default:
  9792. return n2.localeCompare( n1 );
  9793. }
  9794. }
  9795. }
  9796. } );
  9797. }
  9798. /***/ }),
  9799. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js":
  9800. /*!*************************************************************************************!*\
  9801. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js ***!
  9802. \*************************************************************************************/
  9803. /*! exports provided: default */
  9804. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9805. "use strict";
  9806. __webpack_require__.r(__webpack_exports__);
  9807. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditingController; });
  9808. /* harmony import */ var _view_rooteditableelement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view/rooteditableelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.js");
  9809. /* harmony import */ var _view_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../view/view */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/view.js");
  9810. /* harmony import */ var _conversion_mapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../conversion/mapper */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js");
  9811. /* harmony import */ var _conversion_downcastdispatcher__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../conversion/downcastdispatcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js");
  9812. /* harmony import */ var _conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../conversion/downcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js");
  9813. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  9814. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  9815. /* harmony import */ var _conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../conversion/upcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js");
  9816. /**
  9817. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  9818. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  9819. */
  9820. /**
  9821. * @module engine/controller/editingcontroller
  9822. */
  9823. // @if CK_DEBUG_ENGINE // const { dumpTrees, initDocumentDumping } = require( '../dev-utils/utils' );
  9824. /**
  9825. * Controller for the editing pipeline. The editing pipeline controls {@link ~EditingController#model model} rendering,
  9826. * including selection handling. It also creates the {@link ~EditingController#view view} which builds a
  9827. * browser-independent virtualization over the DOM elements. The editing controller also attaches default converters.
  9828. *
  9829. * @mixes module:utils/observablemixin~ObservableMixin
  9830. */
  9831. class EditingController {
  9832. /**
  9833. * Creates an editing controller instance.
  9834. *
  9835. * @param {module:engine/model/model~Model} model Editing model.
  9836. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor The styles processor instance.
  9837. */
  9838. constructor( model, stylesProcessor ) {
  9839. /**
  9840. * Editor model.
  9841. *
  9842. * @readonly
  9843. * @member {module:engine/model/model~Model}
  9844. */
  9845. this.model = model;
  9846. /**
  9847. * Editing view controller.
  9848. *
  9849. * @readonly
  9850. * @member {module:engine/view/view~View}
  9851. */
  9852. this.view = new _view_view__WEBPACK_IMPORTED_MODULE_1__["default"]( stylesProcessor );
  9853. /**
  9854. * Mapper which describes the model-view binding.
  9855. *
  9856. * @readonly
  9857. * @member {module:engine/conversion/mapper~Mapper}
  9858. */
  9859. this.mapper = new _conversion_mapper__WEBPACK_IMPORTED_MODULE_2__["default"]();
  9860. /**
  9861. * Downcast dispatcher that converts changes from the model to {@link #view the editing view}.
  9862. *
  9863. * @readonly
  9864. * @member {module:engine/conversion/downcastdispatcher~DowncastDispatcher} #downcastDispatcher
  9865. */
  9866. this.downcastDispatcher = new _conversion_downcastdispatcher__WEBPACK_IMPORTED_MODULE_3__["default"]( {
  9867. mapper: this.mapper,
  9868. schema: model.schema
  9869. } );
  9870. const doc = this.model.document;
  9871. const selection = doc.selection;
  9872. const markers = this.model.markers;
  9873. // When plugins listen on model changes (on selection change, post fixers, etc.) and change the view as a result of
  9874. // model's change, they might trigger view rendering before the conversion is completed (e.g. before the selection
  9875. // is converted). We disable rendering for the length of the outermost model change() block to prevent that.
  9876. //
  9877. // See https://github.com/ckeditor/ckeditor5-engine/issues/1528
  9878. this.listenTo( this.model, '_beforeChanges', () => {
  9879. this.view._disableRendering( true );
  9880. }, { priority: 'highest' } );
  9881. this.listenTo( this.model, '_afterChanges', () => {
  9882. this.view._disableRendering( false );
  9883. }, { priority: 'lowest' } );
  9884. // Whenever model document is changed, convert those changes to the view (using model.Document#differ).
  9885. // Do it on 'low' priority, so changes are converted after other listeners did their job.
  9886. // Also convert model selection.
  9887. this.listenTo( doc, 'change', () => {
  9888. this.view.change( writer => {
  9889. this.downcastDispatcher.convertChanges( doc.differ, markers, writer );
  9890. this.downcastDispatcher.convertSelection( selection, markers, writer );
  9891. } );
  9892. }, { priority: 'low' } );
  9893. // Convert selection from the view to the model when it changes in the view.
  9894. this.listenTo( this.view.document, 'selectionChange', Object(_conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__["convertSelectionChange"])( this.model, this.mapper ) );
  9895. // Attach default model converters.
  9896. this.downcastDispatcher.on( 'insert:$text', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["insertText"])(), { priority: 'lowest' } );
  9897. this.downcastDispatcher.on( 'remove', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["remove"])(), { priority: 'low' } );
  9898. // Attach default model selection converters.
  9899. this.downcastDispatcher.on( 'selection', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["clearAttributes"])(), { priority: 'high' } );
  9900. this.downcastDispatcher.on( 'selection', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["convertRangeSelection"])(), { priority: 'low' } );
  9901. this.downcastDispatcher.on( 'selection', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["convertCollapsedSelection"])(), { priority: 'low' } );
  9902. // Binds {@link module:engine/view/document~Document#roots view roots collection} to
  9903. // {@link module:engine/model/document~Document#roots model roots collection} so creating
  9904. // model root automatically creates corresponding view root.
  9905. this.view.document.roots.bindTo( this.model.document.roots ).using( root => {
  9906. // $graveyard is a special root that has no reflection in the view.
  9907. if ( root.rootName == '$graveyard' ) {
  9908. return null;
  9909. }
  9910. const viewRoot = new _view_rooteditableelement__WEBPACK_IMPORTED_MODULE_0__["default"]( this.view.document, root.name );
  9911. viewRoot.rootName = root.rootName;
  9912. this.mapper.bindElements( root, viewRoot );
  9913. return viewRoot;
  9914. } );
  9915. // @if CK_DEBUG_ENGINE // initDocumentDumping( this.model.document );
  9916. // @if CK_DEBUG_ENGINE // initDocumentDumping( this.view.document );
  9917. // @if CK_DEBUG_ENGINE // dumpTrees( this.model.document, this.model.document.version );
  9918. // @if CK_DEBUG_ENGINE // dumpTrees( this.view.document, this.model.document.version );
  9919. // @if CK_DEBUG_ENGINE // this.model.document.on( 'change', () => {
  9920. // @if CK_DEBUG_ENGINE // dumpTrees( this.view.document, this.model.document.version );
  9921. // @if CK_DEBUG_ENGINE // }, { priority: 'lowest' } );
  9922. }
  9923. /**
  9924. * Removes all event listeners attached to the `EditingController`. Destroys all objects created
  9925. * by `EditingController` that need to be destroyed.
  9926. */
  9927. destroy() {
  9928. this.view.destroy();
  9929. this.stopListening();
  9930. }
  9931. }
  9932. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( EditingController, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_5__["default"] );
  9933. /***/ }),
  9934. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.js":
  9935. /*!******************************************************************************!*\
  9936. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.js ***!
  9937. \******************************************************************************/
  9938. /*! exports provided: default */
  9939. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9940. "use strict";
  9941. __webpack_require__.r(__webpack_exports__);
  9942. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Conversion; });
  9943. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  9944. /* harmony import */ var _upcasthelpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./upcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js");
  9945. /* harmony import */ var _downcasthelpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./downcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js");
  9946. /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
  9947. /**
  9948. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  9949. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  9950. */
  9951. /**
  9952. * @module engine/conversion/conversion
  9953. */
  9954. /**
  9955. * A utility class that helps add converters to upcast and downcast dispatchers.
  9956. *
  9957. * We recommend reading the {@glink framework/guides/architecture/editing-engine Editing engine architecture} guide first to
  9958. * understand the core concepts of the conversion mechanisms.
  9959. *
  9960. * An instance of the conversion manager is available in the
  9961. * {@link module:core/editor/editor~Editor#conversion `editor.conversion`} property
  9962. * and by default has the following groups of dispatchers (i.e. directions of conversion):
  9963. *
  9964. * * `downcast` (editing and data downcasts)
  9965. * * `editingDowncast`
  9966. * * `dataDowncast`
  9967. * * `upcast`
  9968. *
  9969. * # One-way converters
  9970. *
  9971. * To add a converter to a specific group, use the {@link module:engine/conversion/conversion~Conversion#for `for()`}
  9972. * method:
  9973. *
  9974. * // Add a converter to editing downcast and data downcast.
  9975. * editor.conversion.for( 'downcast' ).elementToElement( config ) );
  9976. *
  9977. * // Add a converter to the data pipepline only:
  9978. * editor.conversion.for( 'dataDowncast' ).elementToElement( dataConversionConfig ) );
  9979. *
  9980. * // And a slightly different one for the editing pipeline:
  9981. * editor.conversion.for( 'editingDowncast' ).elementToElement( editingConversionConfig ) );
  9982. *
  9983. * See {@link module:engine/conversion/conversion~Conversion#for `for()`} method documentation to learn more about
  9984. * available conversion helpers and how to use your custom ones.
  9985. *
  9986. * # Two-way converters
  9987. *
  9988. * Besides using one-way converters via the `for()` method, you can also use other methods available in this
  9989. * class to add two-way converters (upcast and downcast):
  9990. *
  9991. * * {@link module:engine/conversion/conversion~Conversion#elementToElement `elementToElement()`} &ndash;
  9992. * Model element to view element and vice versa.
  9993. * * {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement()`} &ndash;
  9994. * Model attribute to view element and vice versa.
  9995. * * {@link module:engine/conversion/conversion~Conversion#attributeToAttribute `attributeToAttribute()`} &ndash;
  9996. * Model attribute to view element and vice versa.
  9997. */
  9998. class Conversion {
  9999. /**
  10000. * Creates a new conversion instance.
  10001. *
  10002. * @param {module:engine/conversion/downcastdispatcher~DowncastDispatcher|
  10003. * Array.<module:engine/conversion/downcastdispatcher~DowncastDispatcher>} downcastDispatchers
  10004. * @param {module:engine/conversion/upcastdispatcher~UpcastDispatcher|
  10005. * Array.<module:engine/conversion/upcastdispatcher~UpcastDispatcher>} upcastDispatchers
  10006. */
  10007. constructor( downcastDispatchers, upcastDispatchers ) {
  10008. /**
  10009. * Maps dispatchers group name to ConversionHelpers instances.
  10010. *
  10011. * @private
  10012. * @member {Map.<String,module:engine/conversion/conversionhelpers~ConversionHelpers>}
  10013. */
  10014. this._helpers = new Map();
  10015. // Define default 'downcast' & 'upcast' dispatchers groups. Those groups are always available as two-way converters needs them.
  10016. this._downcast = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__["default"])( downcastDispatchers );
  10017. this._createConversionHelpers( { name: 'downcast', dispatchers: this._downcast, isDowncast: true } );
  10018. this._upcast = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__["default"])( upcastDispatchers );
  10019. this._createConversionHelpers( { name: 'upcast', dispatchers: this._upcast, isDowncast: false } );
  10020. }
  10021. /**
  10022. * Define an alias for registered dispatcher.
  10023. *
  10024. * const conversion = new Conversion(
  10025. * [ dataDowncastDispatcher, editingDowncastDispatcher ],
  10026. * upcastDispatcher
  10027. * );
  10028. *
  10029. * conversion.addAlias( 'dataDowncast', dataDowncastDispatcher );
  10030. *
  10031. * @param {String} alias An alias of a dispatcher.
  10032. * @param {module:engine/conversion/downcastdispatcher~DowncastDispatcher|
  10033. * module:engine/conversion/upcastdispatcher~UpcastDispatcher} dispatcher Dispatcher which should have an alias.
  10034. */
  10035. addAlias( alias, dispatcher ) {
  10036. const isDowncast = this._downcast.includes( dispatcher );
  10037. const isUpcast = this._upcast.includes( dispatcher );
  10038. if ( !isUpcast && !isDowncast ) {
  10039. /**
  10040. * Trying to register and alias for a dispatcher that nas not been registered.
  10041. *
  10042. * @error conversion-add-alias-dispatcher-not-registered
  10043. */
  10044. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  10045. 'conversion-add-alias-dispatcher-not-registered',
  10046. this
  10047. );
  10048. }
  10049. this._createConversionHelpers( { name: alias, dispatchers: [ dispatcher ], isDowncast } );
  10050. }
  10051. /**
  10052. * Provides a chainable API to assign converters to conversion dispatchers group.
  10053. *
  10054. * If the given group name has not been registered, the
  10055. * {@link module:utils/ckeditorerror~CKEditorError `conversion-for-unknown-group` error} is thrown.
  10056. *
  10057. * You can use conversion helpers available directly in the `for()` chain or your custom ones via
  10058. * the {@link module:engine/conversion/conversionhelpers~ConversionHelpers#add `add()`} method.
  10059. *
  10060. * # Using bulit-in conversion helpers
  10061. *
  10062. * The `for()` chain comes with a set of conversion helpers which you can use like this:
  10063. *
  10064. * editor.conversion.for( 'downcast' )
  10065. * .elementToElement( config1 ) // Adds an element-to-element downcast converter.
  10066. * .attributeToElement( config2 ); // Adds an attribute-to-element downcast converter.
  10067. *
  10068. * editor.conversion.for( 'upcast' )
  10069. * .elementToAttribute( config3 ); // Adds an element-to-attribute upcast converter.
  10070. *
  10071. * Refer to the documentation of built-in conversion helpers to learn about their configuration options.
  10072. *
  10073. * * downcast (model-to-view) conversion helpers:
  10074. *
  10075. * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`},
  10076. * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement `attributeToElement()`},
  10077. * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToAttribute `attributeToAttribute()`}.
  10078. * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToElement `markerToElement()`}.
  10079. * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToHighlight `markerToHighlight()`}.
  10080. *
  10081. * * upcast (view-to-model) conversion helpers:
  10082. *
  10083. * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToElement `elementToElement()`},
  10084. * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToAttribute `elementToAttribute()`},
  10085. * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute `attributeToAttribute()`}.
  10086. * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToMarker `elementToMarker()`}.
  10087. *
  10088. * # Using custom conversion helpers
  10089. *
  10090. * If you need to implement a nontypical converter, you can do so by calling:
  10091. *
  10092. * editor.conversion.for( direction ).add( customHelper );
  10093. *
  10094. * The `.add()` method takes exactly one parameter, which is a function. This function should accept one parameter that
  10095. * is a dispatcher instance. The function should add an actual converter to the passed dispatcher instance.
  10096. *
  10097. * Example:
  10098. *
  10099. * editor.conversion.for( 'upcast' ).add( dispatcher => {
  10100. * dispatcher.on( 'element:a', ( evt, data, conversionApi ) => {
  10101. * // Do something with a view <a> element.
  10102. * } );
  10103. * } );
  10104. *
  10105. * Refer to the documentation of {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}
  10106. * and {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} to learn how to write
  10107. * custom converters.
  10108. *
  10109. * @param {String} groupName The name of dispatchers group to add the converters to.
  10110. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers|module:engine/conversion/upcasthelpers~UpcastHelpers}
  10111. */
  10112. for( groupName ) {
  10113. if ( !this._helpers.has( groupName ) ) {
  10114. /**
  10115. * Trying to add a converter to an unknown dispatchers group.
  10116. *
  10117. * @error conversion-for-unknown-group
  10118. */
  10119. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'conversion-for-unknown-group', this );
  10120. }
  10121. return this._helpers.get( groupName );
  10122. }
  10123. /**
  10124. * Sets up converters between the model and the view that convert a model element to a view element (and vice versa).
  10125. * For example, the model `<paragraph>Foo</paragraph>` is `<p>Foo</p>` in the view.
  10126. *
  10127. * // A simple conversion from the `paragraph` model element to the `<p>` view element (and vice versa).
  10128. * editor.conversion.elementToElement( { model: 'paragraph', view: 'p' } );
  10129. *
  10130. * // Override other converters by specifying a converter definition with a higher priority.
  10131. * editor.conversion.elementToElement( { model: 'paragraph', view: 'div', converterPriority: 'high' } );
  10132. *
  10133. * // View specified as an object instead of a string.
  10134. * editor.conversion.elementToElement( {
  10135. * model: 'fancyParagraph',
  10136. * view: {
  10137. * name: 'p',
  10138. * classes: 'fancy'
  10139. * }
  10140. * } );
  10141. *
  10142. * // Use `upcastAlso` to define other view elements that should also be converted to a `paragraph` element.
  10143. * editor.conversion.elementToElement( {
  10144. * model: 'paragraph',
  10145. * view: 'p',
  10146. * upcastAlso: [
  10147. * 'div',
  10148. * {
  10149. * // Any element with the `display: block` style.
  10150. * styles: {
  10151. * display: 'block'
  10152. * }
  10153. * }
  10154. * ]
  10155. * } );
  10156. *
  10157. * // `upcastAlso` set as callback enables a conversion of a wide range of different view elements.
  10158. * editor.conversion.elementToElement( {
  10159. * model: 'heading',
  10160. * view: 'h2',
  10161. * // Convert "heading-like" paragraphs to headings.
  10162. * upcastAlso: viewElement => {
  10163. * const fontSize = viewElement.getStyle( 'font-size' );
  10164. *
  10165. * if ( !fontSize ) {
  10166. * return null;
  10167. * }
  10168. *
  10169. * const match = fontSize.match( /(\d+)\s*px/ );
  10170. *
  10171. * if ( !match ) {
  10172. * return null;
  10173. * }
  10174. *
  10175. * const size = Number( match[ 1 ] );
  10176. *
  10177. * if ( size > 26 ) {
  10178. * // Returned value can be an object with the matched properties.
  10179. * // These properties will be "consumed" during the conversion.
  10180. * // See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.
  10181. *
  10182. * return { name: true, styles: [ 'font-size' ] };
  10183. * }
  10184. *
  10185. * return null;
  10186. * }
  10187. * } );
  10188. *
  10189. * `definition.model` is a `String` with a model element name to convert from or to.
  10190. * See {@link module:engine/conversion/conversion~ConverterDefinition} to learn about other parameters.
  10191. *
  10192. * @param {module:engine/conversion/conversion~ConverterDefinition} definition The converter definition.
  10193. */
  10194. elementToElement( definition ) {
  10195. // Set up downcast converter.
  10196. this.for( 'downcast' ).elementToElement( definition );
  10197. // Set up upcast converter.
  10198. for ( const { model, view } of _getAllUpcastDefinitions( definition ) ) {
  10199. this.for( 'upcast' )
  10200. .elementToElement( {
  10201. model,
  10202. view,
  10203. converterPriority: definition.converterPriority
  10204. } );
  10205. }
  10206. }
  10207. /**
  10208. * Sets up converters between the model and the view that convert a model attribute to a view element (and vice versa).
  10209. * For example, a model text node with `"Foo"` as data and the `bold` attribute is `<strong>Foo</strong>` in the view.
  10210. *
  10211. * // A simple conversion from the `bold=true` attribute to the `<strong>` view element (and vice versa).
  10212. * editor.conversion.attributeToElement( { model: 'bold', view: 'strong' } );
  10213. *
  10214. * // Override other converters by specifying a converter definition with a higher priority.
  10215. * editor.conversion.attributeToElement( { model: 'bold', view: 'b', converterPriority: 'high' } );
  10216. *
  10217. * // View specified as an object instead of a string.
  10218. * editor.conversion.attributeToElement( {
  10219. * model: 'bold',
  10220. * view: {
  10221. * name: 'span',
  10222. * classes: 'bold'
  10223. * }
  10224. * } );
  10225. *
  10226. * // Use `config.model.name` to define the conversion only from a given node type, `$text` in this case.
  10227. * // The same attribute on different elements may then be handled by a different converter.
  10228. * editor.conversion.attributeToElement( {
  10229. * model: {
  10230. * key: 'textDecoration',
  10231. * values: [ 'underline', 'lineThrough' ],
  10232. * name: '$text'
  10233. * },
  10234. * view: {
  10235. * underline: {
  10236. * name: 'span',
  10237. * styles: {
  10238. * 'text-decoration': 'underline'
  10239. * }
  10240. * },
  10241. * lineThrough: {
  10242. * name: 'span',
  10243. * styles: {
  10244. * 'text-decoration': 'line-through'
  10245. * }
  10246. * }
  10247. * }
  10248. * } );
  10249. *
  10250. * // Use `upcastAlso` to define other view elements that should also be converted to the `bold` attribute.
  10251. * editor.conversion.attributeToElement( {
  10252. * model: 'bold',
  10253. * view: 'strong',
  10254. * upcastAlso: [
  10255. * 'b',
  10256. * {
  10257. * name: 'span',
  10258. * classes: 'bold'
  10259. * },
  10260. * {
  10261. * name: 'span',
  10262. * styles: {
  10263. * 'font-weight': 'bold'
  10264. * }
  10265. * },
  10266. * viewElement => {
  10267. * const fontWeight = viewElement.getStyle( 'font-weight' );
  10268. *
  10269. * if ( viewElement.is( 'element', 'span' ) && fontWeight && /\d+/.test() && Number( fontWeight ) > 500 ) {
  10270. * // Returned value can be an object with the matched properties.
  10271. * // These properties will be "consumed" during the conversion.
  10272. * // See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.
  10273. *
  10274. * return {
  10275. * name: true,
  10276. * styles: [ 'font-weight' ]
  10277. * };
  10278. * }
  10279. * }
  10280. * ]
  10281. * } );
  10282. *
  10283. * // Conversion from and to a model attribute key whose value is an enum (`fontSize=big|small`).
  10284. * // `upcastAlso` set as callback enables a conversion of a wide range of different view elements.
  10285. * editor.conversion.attributeToElement( {
  10286. * model: {
  10287. * key: 'fontSize',
  10288. * values: [ 'big', 'small' ]
  10289. * },
  10290. * view: {
  10291. * big: {
  10292. * name: 'span',
  10293. * styles: {
  10294. * 'font-size': '1.2em'
  10295. * }
  10296. * },
  10297. * small: {
  10298. * name: 'span',
  10299. * styles: {
  10300. * 'font-size': '0.8em'
  10301. * }
  10302. * }
  10303. * },
  10304. * upcastAlso: {
  10305. * big: viewElement => {
  10306. * const fontSize = viewElement.getStyle( 'font-size' );
  10307. *
  10308. * if ( !fontSize ) {
  10309. * return null;
  10310. * }
  10311. *
  10312. * const match = fontSize.match( /(\d+)\s*px/ );
  10313. *
  10314. * if ( !match ) {
  10315. * return null;
  10316. * }
  10317. *
  10318. * const size = Number( match[ 1 ] );
  10319. *
  10320. * if ( viewElement.is( 'element', 'span' ) && size > 10 ) {
  10321. * // Returned value can be an object with the matched properties.
  10322. * // These properties will be "consumed" during the conversion.
  10323. * // See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.
  10324. *
  10325. * return { name: true, styles: [ 'font-size' ] };
  10326. * }
  10327. *
  10328. * return null;
  10329. * },
  10330. * small: viewElement => {
  10331. * const fontSize = viewElement.getStyle( 'font-size' );
  10332. *
  10333. * if ( !fontSize ) {
  10334. * return null;
  10335. * }
  10336. *
  10337. * const match = fontSize.match( /(\d+)\s*px/ );
  10338. *
  10339. * if ( !match ) {
  10340. * return null;
  10341. * }
  10342. *
  10343. * const size = Number( match[ 1 ] );
  10344. *
  10345. * if ( viewElement.is( 'element', 'span' ) && size < 10 ) {
  10346. * // Returned value can be an object with the matched properties.
  10347. * // These properties will be "consumed" during the conversion.
  10348. * // See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.
  10349. *
  10350. * return { name: true, styles: [ 'font-size' ] };
  10351. * }
  10352. *
  10353. * return null;
  10354. * }
  10355. * }
  10356. * } );
  10357. *
  10358. * The `definition.model` parameter specifies which model attribute should be converted from or to. It can be a `{ key, value }` object
  10359. * describing the attribute key and value to convert or a `String` specifying just the attribute key (then `value` is set to `true`).
  10360. * See {@link module:engine/conversion/conversion~ConverterDefinition} to learn about other parameters.
  10361. *
  10362. * @param {module:engine/conversion/conversion~ConverterDefinition} definition The converter definition.
  10363. */
  10364. attributeToElement( definition ) {
  10365. // Set up downcast converter.
  10366. this.for( 'downcast' ).attributeToElement( definition );
  10367. // Set up upcast converter.
  10368. for ( const { model, view } of _getAllUpcastDefinitions( definition ) ) {
  10369. this.for( 'upcast' )
  10370. .elementToAttribute( {
  10371. view,
  10372. model,
  10373. converterPriority: definition.converterPriority
  10374. } );
  10375. }
  10376. }
  10377. /**
  10378. * Sets up converters between the model and the view that convert a model attribute to a view attribute (and vice versa). For example,
  10379. * `<imageBlock src='foo.jpg'></imageBlock>` is converted to `<img src='foo.jpg'></img>` (the same attribute key and value).
  10380. * This type of converters is intended to be used with {@link module:engine/model/element~Element model element} nodes.
  10381. * To convert text attributes {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement converter`}
  10382. * should be set up.
  10383. *
  10384. * // A simple conversion from the `source` model attribute to the `src` view attribute (and vice versa).
  10385. * editor.conversion.attributeToAttribute( { model: 'source', view: 'src' } );
  10386. *
  10387. * // Attribute values are strictly specified.
  10388. * editor.conversion.attributeToAttribute( {
  10389. * model: {
  10390. * name: 'imageInline',
  10391. * key: 'aside',
  10392. * values: [ 'aside' ]
  10393. * },
  10394. * view: {
  10395. * aside: {
  10396. * name: 'img',
  10397. * key: 'class',
  10398. * value: [ 'aside', 'half-size' ]
  10399. * }
  10400. * }
  10401. * } );
  10402. *
  10403. * // Set the style attribute.
  10404. * editor.conversion.attributeToAttribute( {
  10405. * model: {
  10406. * name: 'imageInline',
  10407. * key: 'aside',
  10408. * values: [ 'aside' ]
  10409. * },
  10410. * view: {
  10411. * aside: {
  10412. * name: 'img',
  10413. * key: 'style',
  10414. * value: {
  10415. * float: 'right',
  10416. * width: '50%',
  10417. * margin: '5px'
  10418. * }
  10419. * }
  10420. * }
  10421. * } );
  10422. *
  10423. * // Conversion from and to a model attribute key whose value is an enum (`align=right|center`).
  10424. * // Use `upcastAlso` to define other view elements that should also be converted to the `align=right` attribute.
  10425. * editor.conversion.attributeToAttribute( {
  10426. * model: {
  10427. * key: 'align',
  10428. * values: [ 'right', 'center' ]
  10429. * },
  10430. * view: {
  10431. * right: {
  10432. * key: 'class',
  10433. * value: 'align-right'
  10434. * },
  10435. * center: {
  10436. * key: 'class',
  10437. * value: 'align-center'
  10438. * }
  10439. * },
  10440. * upcastAlso: {
  10441. * right: {
  10442. * styles: {
  10443. * 'text-align': 'right'
  10444. * }
  10445. * },
  10446. * center: {
  10447. * styles: {
  10448. * 'text-align': 'center'
  10449. * }
  10450. * }
  10451. * }
  10452. * } );
  10453. *
  10454. * The `definition.model` parameter specifies which model attribute should be converted from and to.
  10455. * It can be a `{ key, [ values ], [ name ] }` object or a `String`, which will be treated like `{ key: definition.model }`.
  10456. * The `key` property is the model attribute key to convert from and to.
  10457. * The `values` are the possible model attribute values. If `values` is not set, the model attribute value will be the same as the
  10458. * view attribute value.
  10459. * If `name` is set, the conversion will be set up only for model elements with the given name.
  10460. *
  10461. * The `definition.view` parameter specifies which view attribute should be converted from and to.
  10462. * It can be a `{ key, value, [ name ] }` object or a `String`, which will be treated like `{ key: definition.view }`.
  10463. * The `key` property is the view attribute key to convert from and to.
  10464. * The `value` is the view attribute value to convert from and to. If `definition.value` is not set, the view attribute value will be
  10465. * the same as the model attribute value.
  10466. * If `key` is `'class'`, `value` can be a `String` or an array of `String`s.
  10467. * If `key` is `'style'`, `value` is an object with key-value pairs.
  10468. * In other cases, `value` is a `String`.
  10469. * If `name` is set, the conversion will be set up only for model elements with the given name.
  10470. * If `definition.model.values` is set, `definition.view` is an object that assigns values from `definition.model.values`
  10471. * to `{ key, value, [ name ] }` objects.
  10472. *
  10473. * `definition.upcastAlso` specifies which other matching view elements should also be upcast to the given model configuration.
  10474. * If `definition.model.values` is set, `definition.upcastAlso` should be an object assigning values from `definition.model.values`
  10475. * to {@link module:engine/view/matcher~MatcherPattern}s or arrays of {@link module:engine/view/matcher~MatcherPattern}s.
  10476. *
  10477. * **Note:** `definition.model` and `definition.view` form should be mirrored, so the same types of parameters should
  10478. * be given in both parameters.
  10479. *
  10480. * @param {Object} definition The converter definition.
  10481. * @param {String|Object} definition.model The model attribute to convert from and to.
  10482. * @param {String|Object} definition.view The view attribute to convert from and to.
  10483. * @param {module:engine/view/matcher~MatcherPattern|Array.<module:engine/view/matcher~MatcherPattern>} [definition.upcastAlso]
  10484. * Any view element matching `definition.upcastAlso` will also be converted to the given model attribute. `definition.upcastAlso`
  10485. * is used only if `config.model.values` is specified.
  10486. */
  10487. attributeToAttribute( definition ) {
  10488. // Set up downcast converter.
  10489. this.for( 'downcast' ).attributeToAttribute( definition );
  10490. // Set up upcast converter.
  10491. for ( const { model, view } of _getAllUpcastDefinitions( definition ) ) {
  10492. this.for( 'upcast' )
  10493. .attributeToAttribute( {
  10494. view,
  10495. model
  10496. } );
  10497. }
  10498. }
  10499. /**
  10500. * Creates and caches conversion helpers for given dispatchers group.
  10501. *
  10502. * @private
  10503. * @param {Object} options
  10504. * @param {String} options.name Group name.
  10505. * @param {Array.<module:engine/conversion/downcastdispatcher~DowncastDispatcher|
  10506. * module:engine/conversion/upcastdispatcher~UpcastDispatcher>} options.dispatchers
  10507. * @param {Boolean} options.isDowncast
  10508. */
  10509. _createConversionHelpers( { name, dispatchers, isDowncast } ) {
  10510. if ( this._helpers.has( name ) ) {
  10511. /**
  10512. * Trying to register a group name that has already been registered.
  10513. *
  10514. * @error conversion-group-exists
  10515. */
  10516. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'conversion-group-exists', this );
  10517. }
  10518. const helpers = isDowncast ? new _downcasthelpers__WEBPACK_IMPORTED_MODULE_2__["default"]( dispatchers ) : new _upcasthelpers__WEBPACK_IMPORTED_MODULE_1__["default"]( dispatchers );
  10519. this._helpers.set( name, helpers );
  10520. }
  10521. }
  10522. /**
  10523. * Defines how the model should be converted from and to the view.
  10524. *
  10525. * @typedef {Object} module:engine/conversion/conversion~ConverterDefinition
  10526. *
  10527. * @property {*} [model] The model conversion definition. Describes the model element or model attribute to convert. This parameter differs
  10528. * for different functions that accept `ConverterDefinition`. See the description of the function to learn how to set it.
  10529. * @property {module:engine/view/elementdefinition~ElementDefinition|Object} view The definition of the view element to convert from and
  10530. * to. If `model` describes multiple values, `view` is an object that assigns these values (`view` object keys) to view element definitions
  10531. * (`view` object values).
  10532. * @property {module:engine/view/matcher~MatcherPattern|Array.<module:engine/view/matcher~MatcherPattern>} [upcastAlso]
  10533. * Any view element matching `upcastAlso` will also be converted to the model. If `model` describes multiple values, `upcastAlso`
  10534. * is an object that assigns these values (`upcastAlso` object keys) to {@link module:engine/view/matcher~MatcherPattern}s
  10535. * (`upcastAlso` object values).
  10536. * @property {module:utils/priorities~PriorityString} [converterPriority] The converter priority.
  10537. */
  10538. // Helper function that creates a joint array out of an item passed in `definition.view` and items passed in
  10539. // `definition.upcastAlso`.
  10540. //
  10541. // @param {module:engine/conversion/conversion~ConverterDefinition} definition
  10542. // @returns {Array} Array containing view definitions.
  10543. function* _getAllUpcastDefinitions( definition ) {
  10544. if ( definition.model.values ) {
  10545. for ( const value of definition.model.values ) {
  10546. const model = { key: definition.model.key, value };
  10547. const view = definition.view[ value ];
  10548. const upcastAlso = definition.upcastAlso ? definition.upcastAlso[ value ] : undefined;
  10549. yield* _getUpcastDefinition( model, view, upcastAlso );
  10550. }
  10551. } else {
  10552. yield* _getUpcastDefinition( definition.model, definition.view, definition.upcastAlso );
  10553. }
  10554. }
  10555. function* _getUpcastDefinition( model, view, upcastAlso ) {
  10556. yield { model, view };
  10557. if ( upcastAlso ) {
  10558. for ( const upcastAlsoItem of Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__["default"])( upcastAlso ) ) {
  10559. yield { model, view: upcastAlsoItem };
  10560. }
  10561. }
  10562. }
  10563. /***/ }),
  10564. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js":
  10565. /*!*************************************************************************************!*\
  10566. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js ***!
  10567. \*************************************************************************************/
  10568. /*! exports provided: default */
  10569. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10570. "use strict";
  10571. __webpack_require__.r(__webpack_exports__);
  10572. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ConversionHelpers; });
  10573. /**
  10574. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  10575. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  10576. */
  10577. /**
  10578. * @module engine/conversion/conversionhelpers
  10579. */
  10580. /**
  10581. * Base class for conversion helpers.
  10582. */
  10583. class ConversionHelpers {
  10584. /**
  10585. * Creates a conversion helpers instance.
  10586. *
  10587. * @param {Array.<module:engine/conversion/downcastdispatcher~DowncastDispatcher|
  10588. * module:engine/conversion/upcastdispatcher~UpcastDispatcher>} dispatchers
  10589. */
  10590. constructor( dispatchers ) {
  10591. this._dispatchers = dispatchers;
  10592. }
  10593. /**
  10594. * Registers a conversion helper.
  10595. *
  10596. * **Note**: See full usage example in the `{@link module:engine/conversion/conversion~Conversion#for conversion.for()}`
  10597. * method description.
  10598. *
  10599. * @param {Function} conversionHelper The function to be called on event.
  10600. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers|module:engine/conversion/upcasthelpers~UpcastHelpers}
  10601. */
  10602. add( conversionHelper ) {
  10603. for ( const dispatcher of this._dispatchers ) {
  10604. conversionHelper( dispatcher );
  10605. }
  10606. return this;
  10607. }
  10608. }
  10609. /***/ }),
  10610. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js":
  10611. /*!**************************************************************************************!*\
  10612. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js ***!
  10613. \**************************************************************************************/
  10614. /*! exports provided: default */
  10615. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10616. "use strict";
  10617. __webpack_require__.r(__webpack_exports__);
  10618. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DowncastDispatcher; });
  10619. /* harmony import */ var _modelconsumable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modelconsumable */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/modelconsumable.js");
  10620. /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  10621. /* harmony import */ var _model_position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model/position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  10622. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  10623. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  10624. /**
  10625. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  10626. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  10627. */
  10628. /**
  10629. * @module engine/conversion/downcastdispatcher
  10630. */
  10631. /**
  10632. * The downcast dispatcher is a central point of downcasting (conversion from the model to the view), which is a process of reacting
  10633. * to changes in the model and firing a set of events. Callbacks listening to these events are called converters. The
  10634. * converters' role is to convert the model changes to changes in view (for example, adding view nodes or
  10635. * changing attributes on view elements).
  10636. *
  10637. * During the conversion process, downcast dispatcher fires events basing on the state of the model and prepares
  10638. * data for these events. It is important to understand that the events are connected with the changes done on the model,
  10639. * for example: "a node has been inserted" or "an attribute has changed". This is in contrary to upcasting (a view-to-model conversion)
  10640. * where you convert the view state (view nodes) to a model tree.
  10641. *
  10642. * The events are prepared basing on a diff created by {@link module:engine/model/differ~Differ Differ}, which buffers them
  10643. * and then passes to the downcast dispatcher as a diff between the old model state and the new model state.
  10644. *
  10645. * Note that because the changes are converted, there is a need to have a mapping between the model structure and the view structure.
  10646. * To map positions and elements during the downcast (a model-to-view conversion), use {@link module:engine/conversion/mapper~Mapper}.
  10647. *
  10648. * Downcast dispatcher fires the following events for model tree changes:
  10649. *
  10650. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert`} &ndash;
  10651. * If a range of nodes was inserted to the model tree.
  10652. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove `remove`} &ndash;
  10653. * If a range of nodes was removed from the model tree.
  10654. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute`} &ndash;
  10655. * If an attribute was added, changed or removed from a model node.
  10656. *
  10657. * For {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert`}
  10658. * and {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute`},
  10659. * downcast dispatcher generates {@link module:engine/conversion/modelconsumable~ModelConsumable consumables}.
  10660. * These are used to have control over which changes have already been consumed. It is useful when some converters
  10661. * overwrite others or convert multiple changes (for example, it converts an insertion of an element and also converts that
  10662. * element's attributes during the insertion).
  10663. *
  10664. * Additionally, downcast dispatcher fires events for {@link module:engine/model/markercollection~Marker marker} changes:
  10665. *
  10666. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker} &ndash; If a marker was added.
  10667. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:removeMarker} &ndash; If a marker was removed.
  10668. *
  10669. * Note that changing a marker is done through removing the marker from the old range and adding it to the new range,
  10670. * so both events are fired.
  10671. *
  10672. * Finally, downcast dispatcher also handles firing events for the {@link module:engine/model/selection model selection}
  10673. * conversion:
  10674. *
  10675. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:selection}
  10676. * &ndash; Converts the selection from the model to the view.
  10677. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute}
  10678. * &ndash; Fired for every selection attribute.
  10679. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}
  10680. * &ndash; Fired for every marker that contains a selection.
  10681. *
  10682. * Unlike the model tree and the markers, the events for selection are not fired for changes but for a selection state.
  10683. *
  10684. * When providing custom listeners for a downcast dispatcher, remember to check whether a given change has not been
  10685. * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed} yet.
  10686. *
  10687. * When providing custom listeners for downcast dispatcher, keep in mind that any callback that has
  10688. * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed} a value from a consumable and
  10689. * converted the change should also stop the event (for efficiency purposes).
  10690. *
  10691. * When providing custom listeners for downcast dispatcher, remember to use the provided
  10692. * {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer} to apply changes to the view document.
  10693. *
  10694. * You can read more about conversion in the following guides:
  10695. *
  10696. * * {@glink framework/guides/deep-dive/conversion/conversion-introduction Advanced conversion concepts &mdash; attributes}
  10697. * * {@glink framework/guides/deep-dive/conversion/conversion-extending-output Extending the editor output }
  10698. * * {@glink framework/guides/deep-dive/conversion/custom-element-conversion Custom element conversion}
  10699. *
  10700. * An example of a custom converter for the downcast dispatcher:
  10701. *
  10702. * // You will convert inserting a "paragraph" model element into the model.
  10703. * downcastDispatcher.on( 'insert:paragraph', ( evt, data, conversionApi ) => {
  10704. * // Remember to check whether the change has not been consumed yet and consume it.
  10705. * if ( !conversionApi.consumable.consume( data.item, 'insert' ) ) {
  10706. * return;
  10707. * }
  10708. *
  10709. * // Translate the position in the model to a position in the view.
  10710. * const viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
  10711. *
  10712. * // Create a <p> element that will be inserted into the view at the `viewPosition`.
  10713. * const viewElement = conversionApi.writer.createContainerElement( 'p' );
  10714. *
  10715. * // Bind the newly created view element to the model element so positions will map accordingly in the future.
  10716. * conversionApi.mapper.bindElements( data.item, viewElement );
  10717. *
  10718. * // Add the newly created view element to the view.
  10719. * conversionApi.writer.insert( viewPosition, viewElement );
  10720. *
  10721. * // Remember to stop the event propagation.
  10722. * evt.stop();
  10723. * } );
  10724. */
  10725. class DowncastDispatcher {
  10726. /**
  10727. * Creates a downcast dispatcher instance.
  10728. *
  10729. * @see module:engine/conversion/downcastdispatcher~DowncastConversionApi
  10730. * @param {Object} conversionApi Additional properties for an interface that will be passed to events fired
  10731. * by the downcast dispatcher.
  10732. */
  10733. constructor( conversionApi ) {
  10734. /**
  10735. * An interface passed by the dispatcher to the event callbacks.
  10736. *
  10737. * @member {module:engine/conversion/downcastdispatcher~DowncastConversionApi}
  10738. */
  10739. this.conversionApi = Object.assign( { dispatcher: this }, conversionApi );
  10740. /**
  10741. * Maps conversion event names that will trigger element reconversion for a given element name.
  10742. *
  10743. * @type {Map<String, String>}
  10744. * @private
  10745. */
  10746. this._reconversionEventsMapping = new Map();
  10747. }
  10748. /**
  10749. * Takes a {@link module:engine/model/differ~Differ model differ} object with buffered changes and fires conversion basing on it.
  10750. *
  10751. * @param {module:engine/model/differ~Differ} differ The differ object with buffered changes.
  10752. * @param {module:engine/model/markercollection~MarkerCollection} markers Markers connected with the converted model.
  10753. * @param {module:engine/view/downcastwriter~DowncastWriter} writer The view writer that should be used to modify the view document.
  10754. */
  10755. convertChanges( differ, markers, writer ) {
  10756. // Before the view is updated, remove markers which have changed.
  10757. for ( const change of differ.getMarkersToRemove() ) {
  10758. this.convertMarkerRemove( change.name, change.range, writer );
  10759. }
  10760. const changes = this._mapChangesWithAutomaticReconversion( differ );
  10761. // Convert changes that happened on model tree.
  10762. for ( const entry of changes ) {
  10763. if ( entry.type === 'insert' ) {
  10764. this.convertInsert( _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( entry.position, entry.length ), writer );
  10765. } else if ( entry.type === 'remove' ) {
  10766. this.convertRemove( entry.position, entry.length, entry.name, writer );
  10767. } else if ( entry.type === 'reconvert' ) {
  10768. this.reconvertElement( entry.element, writer );
  10769. } else {
  10770. // Defaults to 'attribute' change.
  10771. this.convertAttribute( entry.range, entry.attributeKey, entry.attributeOldValue, entry.attributeNewValue, writer );
  10772. }
  10773. }
  10774. for ( const markerName of this.conversionApi.mapper.flushUnboundMarkerNames() ) {
  10775. const markerRange = markers.get( markerName ).getRange();
  10776. this.convertMarkerRemove( markerName, markerRange, writer );
  10777. this.convertMarkerAdd( markerName, markerRange, writer );
  10778. }
  10779. // After the view is updated, convert markers which have changed.
  10780. for ( const change of differ.getMarkersToAdd() ) {
  10781. this.convertMarkerAdd( change.name, change.range, writer );
  10782. }
  10783. }
  10784. /**
  10785. * Starts a conversion of a range insertion.
  10786. *
  10787. * For each node in the range, {@link #event:insert `insert` event is fired}. For each attribute on each node,
  10788. * {@link #event:attribute `attribute` event is fired}.
  10789. *
  10790. * @fires insert
  10791. * @fires attribute
  10792. * @param {module:engine/model/range~Range} range The inserted range.
  10793. * @param {module:engine/view/downcastwriter~DowncastWriter} writer The view writer that should be used to modify the view document.
  10794. */
  10795. convertInsert( range, writer ) {
  10796. this.conversionApi.writer = writer;
  10797. // Create a list of things that can be consumed, consisting of nodes and their attributes.
  10798. this.conversionApi.consumable = this._createInsertConsumable( range );
  10799. // Fire a separate insert event for each node and text fragment contained in the range.
  10800. for ( const data of Array.from( range ).map( walkerValueToEventData ) ) {
  10801. this._convertInsertWithAttributes( data );
  10802. }
  10803. this._clearConversionApi();
  10804. }
  10805. /**
  10806. * Fires conversion of a single node removal. Fires {@link #event:remove remove event} with provided data.
  10807. *
  10808. * @param {module:engine/model/position~Position} position Position from which node was removed.
  10809. * @param {Number} length Offset size of removed node.
  10810. * @param {String} name Name of removed node.
  10811. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.
  10812. */
  10813. convertRemove( position, length, name, writer ) {
  10814. this.conversionApi.writer = writer;
  10815. this.fire( 'remove:' + name, { position, length }, this.conversionApi );
  10816. this._clearConversionApi();
  10817. }
  10818. /**
  10819. * Starts a conversion of an attribute change on a given `range`.
  10820. *
  10821. * For each node in the given `range`, {@link #event:attribute attribute event} is fired with the passed data.
  10822. *
  10823. * @fires attribute
  10824. * @param {module:engine/model/range~Range} range Changed range.
  10825. * @param {String} key Key of the attribute that has changed.
  10826. * @param {*} oldValue Attribute value before the change or `null` if the attribute has not been set before.
  10827. * @param {*} newValue New attribute value or `null` if the attribute has been removed.
  10828. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.
  10829. */
  10830. convertAttribute( range, key, oldValue, newValue, writer ) {
  10831. this.conversionApi.writer = writer;
  10832. // Create a list with attributes to consume.
  10833. this.conversionApi.consumable = this._createConsumableForRange( range, `attribute:${ key }` );
  10834. // Create a separate attribute event for each node in the range.
  10835. for ( const value of range ) {
  10836. const item = value.item;
  10837. const itemRange = _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( value.previousPosition, value.length );
  10838. const data = {
  10839. item,
  10840. range: itemRange,
  10841. attributeKey: key,
  10842. attributeOldValue: oldValue,
  10843. attributeNewValue: newValue
  10844. };
  10845. this._testAndFire( `attribute:${ key }`, data );
  10846. }
  10847. this._clearConversionApi();
  10848. }
  10849. /**
  10850. * Starts the reconversion of an element. It will:
  10851. *
  10852. * * Fire an {@link #event:insert `insert` event} for the element to reconvert.
  10853. * * Fire an {@link #event:attribute `attribute` event} for element attributes.
  10854. *
  10855. * This will not reconvert children of the element if they have existing (already converted) views. For newly inserted child elements
  10856. * it will behave the same as {@link #convertInsert}.
  10857. *
  10858. * Element reconversion is defined by the `triggerBy` configuration for the
  10859. * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`} conversion helper.
  10860. *
  10861. * @fires insert
  10862. * @fires attribute
  10863. * @param {module:engine/model/element~Element} element The element to be reconverted.
  10864. * @param {module:engine/view/downcastwriter~DowncastWriter} writer The view writer that should be used to modify the view document.
  10865. */
  10866. reconvertElement( element, writer ) {
  10867. const elementRange = _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( element );
  10868. this.conversionApi.writer = writer;
  10869. // Create a list of things that can be consumed, consisting of nodes and their attributes.
  10870. this.conversionApi.consumable = this._createInsertConsumable( elementRange );
  10871. const mapper = this.conversionApi.mapper;
  10872. const currentView = mapper.toViewElement( element );
  10873. // Remove the old view but do not remove mapper mappings - those will be used to revive existing elements.
  10874. writer.remove( currentView );
  10875. // Convert the element - without converting children.
  10876. this._convertInsertWithAttributes( {
  10877. item: element,
  10878. range: elementRange
  10879. } );
  10880. const convertedViewElement = mapper.toViewElement( element );
  10881. // Iterate over children of reconverted element in order to...
  10882. for ( const value of _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( element ) ) {
  10883. const { item } = value;
  10884. const view = elementOrTextProxyToView( item, mapper );
  10885. // ...either bring back previously converted view...
  10886. if ( view ) {
  10887. // Do not move views that are already in converted element - those might be created by the main element converter in case
  10888. // when main element converts also its direct children.
  10889. if ( view.root !== convertedViewElement.root ) {
  10890. writer.move(
  10891. writer.createRangeOn( view ),
  10892. mapper.toViewPosition( _model_position__WEBPACK_IMPORTED_MODULE_2__["default"]._createBefore( item ) )
  10893. );
  10894. }
  10895. }
  10896. // ... or by converting newly inserted elements.
  10897. else {
  10898. this._convertInsertWithAttributes( walkerValueToEventData( value ) );
  10899. }
  10900. }
  10901. // After reconversion is done we can unbind the old view.
  10902. mapper.unbindViewElement( currentView );
  10903. this._clearConversionApi();
  10904. }
  10905. /**
  10906. * Starts the model selection conversion.
  10907. *
  10908. * Fires events for a given {@link module:engine/model/selection~Selection selection} to start the selection conversion.
  10909. *
  10910. * @fires selection
  10911. * @fires addMarker
  10912. * @fires attribute
  10913. * @param {module:engine/model/selection~Selection} selection The selection to convert.
  10914. * @param {module:engine/model/markercollection~MarkerCollection} markers Markers connected with the converted model.
  10915. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify the view document.
  10916. */
  10917. convertSelection( selection, markers, writer ) {
  10918. const markersAtSelection = Array.from( markers.getMarkersAtPosition( selection.getFirstPosition() ) );
  10919. this.conversionApi.writer = writer;
  10920. this.conversionApi.consumable = this._createSelectionConsumable( selection, markersAtSelection );
  10921. this.fire( 'selection', { selection }, this.conversionApi );
  10922. if ( !selection.isCollapsed ) {
  10923. this._clearConversionApi();
  10924. return;
  10925. }
  10926. for ( const marker of markersAtSelection ) {
  10927. const markerRange = marker.getRange();
  10928. if ( !shouldMarkerChangeBeConverted( selection.getFirstPosition(), marker, this.conversionApi.mapper ) ) {
  10929. continue;
  10930. }
  10931. const data = {
  10932. item: selection,
  10933. markerName: marker.name,
  10934. markerRange
  10935. };
  10936. if ( this.conversionApi.consumable.test( selection, 'addMarker:' + marker.name ) ) {
  10937. this.fire( 'addMarker:' + marker.name, data, this.conversionApi );
  10938. }
  10939. }
  10940. for ( const key of selection.getAttributeKeys() ) {
  10941. const data = {
  10942. item: selection,
  10943. range: selection.getFirstRange(),
  10944. attributeKey: key,
  10945. attributeOldValue: null,
  10946. attributeNewValue: selection.getAttribute( key )
  10947. };
  10948. // Do not fire event if the attribute has been consumed.
  10949. if ( this.conversionApi.consumable.test( selection, 'attribute:' + data.attributeKey ) ) {
  10950. this.fire( 'attribute:' + data.attributeKey + ':$text', data, this.conversionApi );
  10951. }
  10952. }
  10953. this._clearConversionApi();
  10954. }
  10955. /**
  10956. * Converts the added marker. Fires the {@link #event:addMarker `addMarker`} event for each item
  10957. * in the marker's range. If the range is collapsed, a single event is dispatched. See the event description for more details.
  10958. *
  10959. * @fires addMarker
  10960. * @param {String} markerName Marker name.
  10961. * @param {module:engine/model/range~Range} markerRange The marker range.
  10962. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify the view document.
  10963. */
  10964. convertMarkerAdd( markerName, markerRange, writer ) {
  10965. // Do not convert if range is in graveyard.
  10966. if ( markerRange.root.rootName == '$graveyard' ) {
  10967. return;
  10968. }
  10969. this.conversionApi.writer = writer;
  10970. // In markers' case, event name == consumable name.
  10971. const eventName = 'addMarker:' + markerName;
  10972. //
  10973. // First, fire an event for the whole marker.
  10974. //
  10975. const consumable = new _modelconsumable__WEBPACK_IMPORTED_MODULE_0__["default"]();
  10976. consumable.add( markerRange, eventName );
  10977. this.conversionApi.consumable = consumable;
  10978. this.fire( eventName, { markerName, markerRange }, this.conversionApi );
  10979. //
  10980. // Do not fire events for each item inside the range if the range got consumed.
  10981. //
  10982. if ( !consumable.test( markerRange, eventName ) ) {
  10983. this._clearConversionApi();
  10984. return;
  10985. }
  10986. //
  10987. // Then, fire an event for each item inside the marker range.
  10988. //
  10989. this.conversionApi.consumable = this._createConsumableForRange( markerRange, eventName );
  10990. for ( const item of markerRange.getItems() ) {
  10991. // Do not fire event for already consumed items.
  10992. if ( !this.conversionApi.consumable.test( item, eventName ) ) {
  10993. continue;
  10994. }
  10995. const data = { item, range: _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( item ), markerName, markerRange };
  10996. this.fire( eventName, data, this.conversionApi );
  10997. }
  10998. this._clearConversionApi();
  10999. }
  11000. /**
  11001. * Fires the conversion of the marker removal. Fires the {@link #event:removeMarker `removeMarker`} event with the provided data.
  11002. *
  11003. * @fires removeMarker
  11004. * @param {String} markerName Marker name.
  11005. * @param {module:engine/model/range~Range} markerRange The marker range.
  11006. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify the view document.
  11007. */
  11008. convertMarkerRemove( markerName, markerRange, writer ) {
  11009. // Do not convert if range is in graveyard.
  11010. if ( markerRange.root.rootName == '$graveyard' ) {
  11011. return;
  11012. }
  11013. this.conversionApi.writer = writer;
  11014. this.fire( 'removeMarker:' + markerName, { markerName, markerRange }, this.conversionApi );
  11015. this._clearConversionApi();
  11016. }
  11017. /**
  11018. * Maps the model element "insert" reconversion for given event names. The event names must be fully specified:
  11019. *
  11020. * * For "attribute" change event, it should include the main element name, i.e: `'attribute:attributeName:elementName'`.
  11021. * * For child node change events, these should use the child event name as well, i.e:
  11022. * * For adding a node: `'insert:childElementName'`.
  11023. * * For removing a node: `'remove:childElementName'`.
  11024. *
  11025. * **Note**: This method should not be used directly. The reconversion is defined by the `triggerBy()` configuration of the
  11026. * `elementToElement()` conversion helper.
  11027. *
  11028. * @protected
  11029. * @param {String} modelName The name of the main model element for which the events will trigger the reconversion.
  11030. * @param {String} eventName The name of an event that would trigger conversion for a given model element.
  11031. */
  11032. _mapReconversionTriggerEvent( modelName, eventName ) {
  11033. this._reconversionEventsMapping.set( eventName, modelName );
  11034. }
  11035. /**
  11036. * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with values to consume from a given range,
  11037. * assuming that the range has just been inserted to the model.
  11038. *
  11039. * @private
  11040. * @param {module:engine/model/range~Range} range The inserted range.
  11041. * @returns {module:engine/conversion/modelconsumable~ModelConsumable} The values to consume.
  11042. */
  11043. _createInsertConsumable( range ) {
  11044. const consumable = new _modelconsumable__WEBPACK_IMPORTED_MODULE_0__["default"]();
  11045. for ( const value of range ) {
  11046. const item = value.item;
  11047. consumable.add( item, 'insert' );
  11048. for ( const key of item.getAttributeKeys() ) {
  11049. consumable.add( item, 'attribute:' + key );
  11050. }
  11051. }
  11052. return consumable;
  11053. }
  11054. /**
  11055. * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with values to consume for a given range.
  11056. *
  11057. * @private
  11058. * @param {module:engine/model/range~Range} range The affected range.
  11059. * @param {String} type Consumable type.
  11060. * @returns {module:engine/conversion/modelconsumable~ModelConsumable} The values to consume.
  11061. */
  11062. _createConsumableForRange( range, type ) {
  11063. const consumable = new _modelconsumable__WEBPACK_IMPORTED_MODULE_0__["default"]();
  11064. for ( const item of range.getItems() ) {
  11065. consumable.add( item, type );
  11066. }
  11067. return consumable;
  11068. }
  11069. /**
  11070. * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with selection consumable values.
  11071. *
  11072. * @private
  11073. * @param {module:engine/model/selection~Selection} selection The selection to create the consumable from.
  11074. * @param {Iterable.<module:engine/model/markercollection~Marker>} markers Markers that contain the selection.
  11075. * @returns {module:engine/conversion/modelconsumable~ModelConsumable} The values to consume.
  11076. */
  11077. _createSelectionConsumable( selection, markers ) {
  11078. const consumable = new _modelconsumable__WEBPACK_IMPORTED_MODULE_0__["default"]();
  11079. consumable.add( selection, 'selection' );
  11080. for ( const marker of markers ) {
  11081. consumable.add( selection, 'addMarker:' + marker.name );
  11082. }
  11083. for ( const key of selection.getAttributeKeys() ) {
  11084. consumable.add( selection, 'attribute:' + key );
  11085. }
  11086. return consumable;
  11087. }
  11088. /**
  11089. * Tests passed `consumable` to check whether given event can be fired and if so, fires it.
  11090. *
  11091. * @private
  11092. * @fires insert
  11093. * @fires attribute
  11094. * @param {String} type Event type.
  11095. * @param {Object} data Event data.
  11096. */
  11097. _testAndFire( type, data ) {
  11098. if ( !this.conversionApi.consumable.test( data.item, type ) ) {
  11099. // Do not fire event if the item was consumed.
  11100. return;
  11101. }
  11102. this.fire( getEventName( type, data ), data, this.conversionApi );
  11103. }
  11104. /**
  11105. * Clears the conversion API object.
  11106. *
  11107. * @private
  11108. */
  11109. _clearConversionApi() {
  11110. delete this.conversionApi.writer;
  11111. delete this.conversionApi.consumable;
  11112. }
  11113. /**
  11114. * Internal method for converting element insertion. It will fire events for the inserted element and events for its attributes.
  11115. *
  11116. * @private
  11117. * @fires insert
  11118. * @fires attribute
  11119. * @param {Object} data Event data.
  11120. */
  11121. _convertInsertWithAttributes( data ) {
  11122. this._testAndFire( 'insert', data );
  11123. // Fire a separate addAttribute event for each attribute that was set on inserted items.
  11124. // This is important because most attributes converters will listen only to add/change/removeAttribute events.
  11125. // If we would not add this part, attributes on inserted nodes would not be converted.
  11126. for ( const key of data.item.getAttributeKeys() ) {
  11127. data.attributeKey = key;
  11128. data.attributeOldValue = null;
  11129. data.attributeNewValue = data.item.getAttribute( key );
  11130. this._testAndFire( `attribute:${ key }`, data );
  11131. }
  11132. }
  11133. /**
  11134. * Returns differ changes together with added "reconvert" type changes for {@link #reconvertElement}. These are defined by
  11135. * a the `triggerBy()` configuration for the
  11136. * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`} conversion helper.
  11137. *
  11138. * This method will remove every mapped insert or remove change with a single "reconvert" change.
  11139. *
  11140. * For instance: Having a `triggerBy()` configuration defined for the `<complex>` element that issues this element reconversion on
  11141. * `foo` and `bar` attributes change, and a set of changes for this element:
  11142. *
  11143. * const differChanges = [
  11144. * { type: 'attribute', attributeKey: 'foo', ... },
  11145. * { type: 'attribute', attributeKey: 'bar', ... },
  11146. * { type: 'attribute', attributeKey: 'baz', ... }
  11147. * ];
  11148. *
  11149. * This method will return:
  11150. *
  11151. * const updatedChanges = [
  11152. * { type: 'reconvert', element: complexElementInstance },
  11153. * { type: 'attribute', attributeKey: 'baz', ... }
  11154. * ];
  11155. *
  11156. * In the example above, the `'baz'` attribute change will fire an {@link #event:attribute attribute event}
  11157. *
  11158. * @param {module:engine/model/differ~Differ} differ The differ object with buffered changes.
  11159. * @returns {Array.<Object>} Updated set of changes.
  11160. * @private
  11161. */
  11162. _mapChangesWithAutomaticReconversion( differ ) {
  11163. const itemsToReconvert = new Set();
  11164. const updated = [];
  11165. for ( const entry of differ.getChanges() ) {
  11166. const position = entry.position || entry.range.start;
  11167. // Cached parent - just in case. See https://github.com/ckeditor/ckeditor5/issues/6579.
  11168. const positionParent = position.parent;
  11169. const textNode = Object(_model_position__WEBPACK_IMPORTED_MODULE_2__["getTextNodeAtPosition"])( position, positionParent );
  11170. // Reconversion is done only on elements so skip text changes.
  11171. if ( textNode ) {
  11172. updated.push( entry );
  11173. continue;
  11174. }
  11175. const element = entry.type === 'attribute' ? Object(_model_position__WEBPACK_IMPORTED_MODULE_2__["getNodeAfterPosition"])( position, positionParent, null ) : positionParent;
  11176. // Case of text node set directly in root. For now used only in tests but can be possible when enabled in paragraph-like roots.
  11177. // See: https://github.com/ckeditor/ckeditor5/issues/762.
  11178. if ( element.is( '$text' ) ) {
  11179. updated.push( entry );
  11180. continue;
  11181. }
  11182. let eventName;
  11183. if ( entry.type === 'attribute' ) {
  11184. eventName = `attribute:${ entry.attributeKey }:${ element.name }`;
  11185. } else {
  11186. eventName = `${ entry.type }:${ entry.name }`;
  11187. }
  11188. if ( this._isReconvertTriggerEvent( eventName, element.name ) ) {
  11189. if ( itemsToReconvert.has( element ) ) {
  11190. // Element is already reconverted, so skip this change.
  11191. continue;
  11192. }
  11193. itemsToReconvert.add( element );
  11194. // Add special "reconvert" change.
  11195. updated.push( { type: 'reconvert', element } );
  11196. } else {
  11197. updated.push( entry );
  11198. }
  11199. }
  11200. return updated;
  11201. }
  11202. /**
  11203. * Checks if the resulting change should trigger element reconversion.
  11204. *
  11205. * These are defined by a `triggerBy()` configuration for the
  11206. * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`} conversion helper.
  11207. *
  11208. * @private
  11209. * @param {String} eventName The event name to check.
  11210. * @param {String} elementName The element name to check.
  11211. * @returns {Boolean}
  11212. */
  11213. _isReconvertTriggerEvent( eventName, elementName ) {
  11214. return this._reconversionEventsMapping.get( eventName ) === elementName;
  11215. }
  11216. /**
  11217. * Fired for inserted nodes.
  11218. *
  11219. * `insert` is a namespace for a class of events. Names of actually called events follow this pattern:
  11220. * `insert:name`. `name` is either `'$text'`, when {@link module:engine/model/text~Text a text node} has been inserted,
  11221. * or {@link module:engine/model/element~Element#name name} of inserted element.
  11222. *
  11223. * This way listeners can either listen to a general `insert` event or specific event (for example `insert:paragraph`).
  11224. *
  11225. * @event insert
  11226. * @param {Object} data Additional information about the change.
  11227. * @param {module:engine/model/item~Item} data.item Inserted item.
  11228. * @param {module:engine/model/range~Range} data.range Range spanning over inserted item.
  11229. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  11230. * to be used by callback, passed in `DowncastDispatcher` constructor.
  11231. */
  11232. /**
  11233. * Fired for removed nodes.
  11234. *
  11235. * `remove` is a namespace for a class of events. Names of actually called events follow this pattern:
  11236. * `remove:name`. `name` is either `'$text'`, when {@link module:engine/model/text~Text a text node} has been removed,
  11237. * or the {@link module:engine/model/element~Element#name name} of removed element.
  11238. *
  11239. * This way listeners can either listen to a general `remove` event or specific event (for example `remove:paragraph`).
  11240. *
  11241. * @event remove
  11242. * @param {Object} data Additional information about the change.
  11243. * @param {module:engine/model/position~Position} data.position Position from which the node has been removed.
  11244. * @param {Number} data.length Offset size of the removed node.
  11245. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  11246. * to be used by callback, passed in `DowncastDispatcher` constructor.
  11247. */
  11248. /**
  11249. * Fired in the following cases:
  11250. *
  11251. * * when an attribute has been added, changed, or removed from a node,
  11252. * * when a node with an attribute is inserted,
  11253. * * when collapsed model selection attribute is converted.
  11254. *
  11255. * `attribute` is a namespace for a class of events. Names of actually called events follow this pattern:
  11256. * `attribute:attributeKey:name`. `attributeKey` is the key of added/changed/removed attribute.
  11257. * `name` is either `'$text'` if change was on {@link module:engine/model/text~Text a text node},
  11258. * or the {@link module:engine/model/element~Element#name name} of element which attribute has changed.
  11259. *
  11260. * This way listeners can either listen to a general `attribute:bold` event or specific event (for example `attribute:src:imageBlock`).
  11261. *
  11262. * @event attribute
  11263. * @param {Object} data Additional information about the change.
  11264. * @param {module:engine/model/item~Item|module:engine/model/documentselection~DocumentSelection} data.item Changed item
  11265. * or converted selection.
  11266. * @param {module:engine/model/range~Range} data.range Range spanning over changed item or selection range.
  11267. * @param {String} data.attributeKey Attribute key.
  11268. * @param {*} data.attributeOldValue Attribute value before the change. This is `null` when selection attribute is converted.
  11269. * @param {*} data.attributeNewValue New attribute value.
  11270. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  11271. * to be used by callback, passed in `DowncastDispatcher` constructor.
  11272. */
  11273. /**
  11274. * Fired for {@link module:engine/model/selection~Selection selection} changes.
  11275. *
  11276. * @event selection
  11277. * @param {module:engine/model/selection~Selection} selection Selection that is converted.
  11278. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  11279. * to be used by callback, passed in `DowncastDispatcher` constructor.
  11280. */
  11281. /**
  11282. * Fired when a new marker is added to the model. Also fired when a collapsed model selection that is inside a marker is converted.
  11283. *
  11284. * `addMarker` is a namespace for a class of events. Names of actually called events follow this pattern:
  11285. * `addMarker:markerName`. By specifying certain marker names, you can make the events even more gradual. For example,
  11286. * if markers are named `foo:abc`, `foo:bar`, then it is possible to listen to `addMarker:foo` or `addMarker:foo:abc` and
  11287. * `addMarker:foo:bar` events.
  11288. *
  11289. * If the marker range is not collapsed:
  11290. *
  11291. * * the event is fired for each item in the marker range one by one,
  11292. * * `conversionApi.consumable` includes each item of the marker range and the consumable value is same as the event name.
  11293. *
  11294. * If the marker range is collapsed:
  11295. *
  11296. * * there is only one event,
  11297. * * `conversionApi.consumable` includes marker range with the event name.
  11298. *
  11299. * If the selection inside a marker is converted:
  11300. *
  11301. * * there is only one event,
  11302. * * `conversionApi.consumable` includes the selection instance with the event name.
  11303. *
  11304. * @event addMarker
  11305. * @param {Object} data Additional information about the change.
  11306. * @param {module:engine/model/item~Item|module:engine/model/selection~Selection} data.item Item inside the new marker or
  11307. * the selection that is being converted.
  11308. * @param {module:engine/model/range~Range} [data.range] Range spanning over converted item. Available only in marker conversion, if
  11309. * the marker range was not collapsed.
  11310. * @param {module:engine/model/range~Range} data.markerRange Marker range.
  11311. * @param {String} data.markerName Marker name.
  11312. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  11313. * to be used by callback, passed in `DowncastDispatcher` constructor.
  11314. */
  11315. /**
  11316. * Fired when a marker is removed from the model.
  11317. *
  11318. * `removeMarker` is a namespace for a class of events. Names of actually called events follow this pattern:
  11319. * `removeMarker:markerName`. By specifying certain marker names, you can make the events even more gradual. For example,
  11320. * if markers are named `foo:abc`, `foo:bar`, then it is possible to listen to `removeMarker:foo` or `removeMarker:foo:abc` and
  11321. * `removeMarker:foo:bar` events.
  11322. *
  11323. * @event removeMarker
  11324. * @param {Object} data Additional information about the change.
  11325. * @param {module:engine/model/range~Range} data.markerRange Marker range.
  11326. * @param {String} data.markerName Marker name.
  11327. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  11328. * to be used by callback, passed in `DowncastDispatcher` constructor.
  11329. */
  11330. }
  11331. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_4__["default"])( DowncastDispatcher, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  11332. // Helper function, checks whether change of `marker` at `modelPosition` should be converted. Marker changes are not
  11333. // converted if they happen inside an element with custom conversion method.
  11334. //
  11335. // @param {module:engine/model/position~Position} modelPosition
  11336. // @param {module:engine/model/markercollection~Marker} marker
  11337. // @param {module:engine/conversion/mapper~Mapper} mapper
  11338. // @returns {Boolean}
  11339. function shouldMarkerChangeBeConverted( modelPosition, marker, mapper ) {
  11340. const range = marker.getRange();
  11341. const ancestors = Array.from( modelPosition.getAncestors() );
  11342. ancestors.shift(); // Remove root element. It cannot be passed to `model.Range#containsItem`.
  11343. ancestors.reverse();
  11344. const hasCustomHandling = ancestors.some( element => {
  11345. if ( range.containsItem( element ) ) {
  11346. const viewElement = mapper.toViewElement( element );
  11347. return !!viewElement.getCustomProperty( 'addHighlight' );
  11348. }
  11349. } );
  11350. return !hasCustomHandling;
  11351. }
  11352. function getEventName( type, data ) {
  11353. const name = data.item.name || '$text';
  11354. return `${ type }:${ name }`;
  11355. }
  11356. function walkerValueToEventData( value ) {
  11357. const item = value.item;
  11358. const itemRange = _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( value.previousPosition, value.length );
  11359. return {
  11360. item,
  11361. range: itemRange
  11362. };
  11363. }
  11364. function elementOrTextProxyToView( item, mapper ) {
  11365. if ( item.is( 'textProxy' ) ) {
  11366. const mappedPosition = mapper.toViewPosition( _model_position__WEBPACK_IMPORTED_MODULE_2__["default"]._createBefore( item ) );
  11367. const positionParent = mappedPosition.parent;
  11368. return positionParent.is( '$text' ) ? positionParent : null;
  11369. }
  11370. return mapper.toViewElement( item );
  11371. }
  11372. /**
  11373. * Conversion interface that is registered for given {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}
  11374. * and is passed as one of parameters when {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher dispatcher}
  11375. * fires its events.
  11376. *
  11377. * @interface module:engine/conversion/downcastdispatcher~DowncastConversionApi
  11378. */
  11379. /**
  11380. * The {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} instance.
  11381. *
  11382. * @member {module:engine/conversion/downcastdispatcher~DowncastDispatcher} #dispatcher
  11383. */
  11384. /**
  11385. * Stores the information about what parts of a processed model item are still waiting to be handled. After a piece of a model item was
  11386. * converted, an appropriate consumable value should be {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed}.
  11387. *
  11388. * @member {module:engine/conversion/modelconsumable~ModelConsumable} #consumable
  11389. */
  11390. /**
  11391. * The {@link module:engine/conversion/mapper~Mapper} instance.
  11392. *
  11393. * @member {module:engine/conversion/mapper~Mapper} #mapper
  11394. */
  11395. /**
  11396. * The {@link module:engine/model/schema~Schema} instance set for the model that is downcast.
  11397. *
  11398. * @member {module:engine/model/schema~Schema} #schema
  11399. */
  11400. /**
  11401. * The {@link module:engine/view/downcastwriter~DowncastWriter} instance used to manipulate the data during conversion.
  11402. *
  11403. * @member {module:engine/view/downcastwriter~DowncastWriter} #writer
  11404. */
  11405. /**
  11406. * An object with an additional configuration which can be used during the conversion process. Available only for data downcast conversion.
  11407. *
  11408. * @member {Object} #options
  11409. */
  11410. /***/ }),
  11411. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js":
  11412. /*!***********************************************************************************!*\
  11413. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js ***!
  11414. \***********************************************************************************/
  11415. /*! exports provided: default, insertText, remove, createViewElementFromHighlightDescriptor, convertRangeSelection, convertCollapsedSelection, clearAttributes, wrap, insertElement, insertUIElement */
  11416. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11417. "use strict";
  11418. __webpack_require__.r(__webpack_exports__);
  11419. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DowncastHelpers; });
  11420. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertText", function() { return insertText; });
  11421. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return remove; });
  11422. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createViewElementFromHighlightDescriptor", function() { return createViewElementFromHighlightDescriptor; });
  11423. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertRangeSelection", function() { return convertRangeSelection; });
  11424. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertCollapsedSelection", function() { return convertCollapsedSelection; });
  11425. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clearAttributes", function() { return clearAttributes; });
  11426. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return wrap; });
  11427. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertElement", function() { return insertElement; });
  11428. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertUIElement", function() { return insertUIElement; });
  11429. /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  11430. /* harmony import */ var _model_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../model/selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js");
  11431. /* harmony import */ var _model_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model/element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  11432. /* harmony import */ var _view_attributeelement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../view/attributeelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js");
  11433. /* harmony import */ var _model_documentselection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../model/documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  11434. /* harmony import */ var _conversionhelpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./conversionhelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js");
  11435. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  11436. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  11437. /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
  11438. /**
  11439. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  11440. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  11441. */
  11442. /**
  11443. * Contains downcast (model-to-view) converters for {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}.
  11444. *
  11445. * @module engine/conversion/downcasthelpers
  11446. */
  11447. /**
  11448. * Downcast conversion helper functions.
  11449. *
  11450. * @extends module:engine/conversion/conversionhelpers~ConversionHelpers
  11451. */
  11452. class DowncastHelpers extends _conversionhelpers__WEBPACK_IMPORTED_MODULE_5__["default"] {
  11453. /**
  11454. * Model element to view element conversion helper.
  11455. *
  11456. * This conversion results in creating a view element. For example, model `<paragraph>Foo</paragraph>` becomes `<p>Foo</p>` in the view.
  11457. *
  11458. * editor.conversion.for( 'downcast' ).elementToElement( {
  11459. * model: 'paragraph',
  11460. * view: 'p'
  11461. * } );
  11462. *
  11463. * editor.conversion.for( 'downcast' ).elementToElement( {
  11464. * model: 'paragraph',
  11465. * view: 'div',
  11466. * converterPriority: 'high'
  11467. * } );
  11468. *
  11469. * editor.conversion.for( 'downcast' ).elementToElement( {
  11470. * model: 'fancyParagraph',
  11471. * view: {
  11472. * name: 'p',
  11473. * classes: 'fancy'
  11474. * }
  11475. * } );
  11476. *
  11477. * editor.conversion.for( 'downcast' ).elementToElement( {
  11478. * model: 'heading',
  11479. * view: ( modelElement, conversionApi ) => {
  11480. * const { writer } = conversionApi;
  11481. *
  11482. * return writer.createContainerElement( 'h' + modelElement.getAttribute( 'level' ) );
  11483. * }
  11484. * } );
  11485. *
  11486. * The element-to-element conversion supports the reconversion mechanism. This is helpful in the conversion to complex view structures
  11487. * where multiple atomic element-to-element and attribute-to-attribute or attribute-to-element could be used. By specifying
  11488. * `triggerBy()` events you can trigger reconverting the model to full view tree structures at once.
  11489. *
  11490. * editor.conversion.for( 'downcast' ).elementToElement( {
  11491. * model: 'complex',
  11492. * view: ( modelElement, conversionApi ) => createComplexViewFromModel( modelElement, conversionApi ),
  11493. * triggerBy: {
  11494. * attributes: [ 'foo', 'bar' ],
  11495. * children: [ 'slot' ]
  11496. * }
  11497. * } );
  11498. *
  11499. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  11500. * to the conversion process.
  11501. *
  11502. * You can read more about element-to-element conversion in the
  11503. * {@glink framework/guides/deep-dive/conversion/custom-element-conversion Custom element conversion} guide.
  11504. *
  11505. * @method #elementToElement
  11506. * @param {Object} config Conversion configuration.
  11507. * @param {String} config.model The name of the model element to convert.
  11508. * @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function
  11509. * that takes the model element and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
  11510. * as parameters and returns a view container element.
  11511. * @param {Object} [config.triggerBy] Reconversion triggers. At least one trigger must be defined.
  11512. * @param {Array.<String>} config.triggerBy.attributes The name of the element's attributes whose change will trigger element
  11513. * reconversion.
  11514. * @param {Array.<String>} config.triggerBy.children The name of direct children whose adding or removing will trigger element
  11515. * reconversion.
  11516. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  11517. */
  11518. elementToElement( config ) {
  11519. return this.add( downcastElementToElement( config ) );
  11520. }
  11521. /**
  11522. * Model attribute to view element conversion helper.
  11523. *
  11524. * This conversion results in wrapping view nodes with a view attribute element. For example, a model text node with
  11525. * `"Foo"` as data and the `bold` attribute becomes `<strong>Foo</strong>` in the view.
  11526. *
  11527. * editor.conversion.for( 'downcast' ).attributeToElement( {
  11528. * model: 'bold',
  11529. * view: 'strong'
  11530. * } );
  11531. *
  11532. * editor.conversion.for( 'downcast' ).attributeToElement( {
  11533. * model: 'bold',
  11534. * view: 'b',
  11535. * converterPriority: 'high'
  11536. * } );
  11537. *
  11538. * editor.conversion.for( 'downcast' ).attributeToElement( {
  11539. * model: 'invert',
  11540. * view: {
  11541. * name: 'span',
  11542. * classes: [ 'font-light', 'bg-dark' ]
  11543. * }
  11544. * } );
  11545. *
  11546. * editor.conversion.for( 'downcast' ).attributeToElement( {
  11547. * model: {
  11548. * key: 'fontSize',
  11549. * values: [ 'big', 'small' ]
  11550. * },
  11551. * view: {
  11552. * big: {
  11553. * name: 'span',
  11554. * styles: {
  11555. * 'font-size': '1.2em'
  11556. * }
  11557. * },
  11558. * small: {
  11559. * name: 'span',
  11560. * styles: {
  11561. * 'font-size': '0.8em'
  11562. * }
  11563. * }
  11564. * }
  11565. * } );
  11566. *
  11567. * editor.conversion.for( 'downcast' ).attributeToElement( {
  11568. * model: 'bold',
  11569. * view: ( modelAttributeValue, conversionApi ) => {
  11570. * const { writer } = conversionApi;
  11571. *
  11572. * return writer.createAttributeElement( 'span', {
  11573. * style: 'font-weight:' + modelAttributeValue
  11574. * } );
  11575. * }
  11576. * } );
  11577. *
  11578. * editor.conversion.for( 'downcast' ).attributeToElement( {
  11579. * model: {
  11580. * key: 'color',
  11581. * name: '$text'
  11582. * },
  11583. * view: ( modelAttributeValue, conversionApi ) => {
  11584. * const { writer } = conversionApi;
  11585. *
  11586. * return writer.createAttributeElement( 'span', {
  11587. * style: 'color:' + modelAttributeValue
  11588. * } );
  11589. * }
  11590. * } );
  11591. *
  11592. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  11593. * to the conversion process.
  11594. *
  11595. * @method #attributeToElement
  11596. * @param {Object} config Conversion configuration.
  11597. * @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values }` object. `values` is an array
  11598. * of `String`s with possible values if the model attribute is an enumerable.
  11599. * @param {module:engine/view/elementdefinition~ElementDefinition|Function|Object} config.view A view element definition or a function
  11600. * that takes the model attribute value and
  11601. * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as parameters and returns a view
  11602. * attribute element. If `config.model.values` is given, `config.view` should be an object assigning values from `config.model.values`
  11603. * to view element definitions or functions.
  11604. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  11605. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  11606. */
  11607. attributeToElement( config ) {
  11608. return this.add( downcastAttributeToElement( config ) );
  11609. }
  11610. /**
  11611. * Model attribute to view attribute conversion helper.
  11612. *
  11613. * This conversion results in adding an attribute to a view node, basing on an attribute from a model node. For example,
  11614. * `<imageInline src='foo.jpg'></imageInline>` is converted to `<img src='foo.jpg'></img>`.
  11615. *
  11616. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  11617. * model: 'source',
  11618. * view: 'src'
  11619. * } );
  11620. *
  11621. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  11622. * model: 'source',
  11623. * view: 'href',
  11624. * converterPriority: 'high'
  11625. * } );
  11626. *
  11627. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  11628. * model: {
  11629. * name: 'imageInline',
  11630. * key: 'source'
  11631. * },
  11632. * view: 'src'
  11633. * } );
  11634. *
  11635. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  11636. * model: {
  11637. * name: 'styled',
  11638. * values: [ 'dark', 'light' ]
  11639. * },
  11640. * view: {
  11641. * dark: {
  11642. * key: 'class',
  11643. * value: [ 'styled', 'styled-dark' ]
  11644. * },
  11645. * light: {
  11646. * key: 'class',
  11647. * value: [ 'styled', 'styled-light' ]
  11648. * }
  11649. * }
  11650. * } );
  11651. *
  11652. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  11653. * model: 'styled',
  11654. * view: modelAttributeValue => ( {
  11655. * key: 'class',
  11656. * value: 'styled-' + modelAttributeValue
  11657. * } )
  11658. * } );
  11659. *
  11660. * **Note**: Downcasting to a style property requires providing `value` as an object:
  11661. *
  11662. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  11663. * model: 'lineHeight',
  11664. * view: modelAttributeValue => ( {
  11665. * key: 'style',
  11666. * value: {
  11667. * 'line-height': modelAttributeValue,
  11668. * 'border-bottom': '1px dotted #ba2'
  11669. * }
  11670. * } )
  11671. * } );
  11672. *
  11673. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  11674. * to the conversion process.
  11675. *
  11676. * @method #attributeToAttribute
  11677. * @param {Object} config Conversion configuration.
  11678. * @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values, [ name ] }` object describing
  11679. * the attribute key, possible values and, optionally, an element name to convert from.
  11680. * @param {String|Object|Function} config.view A view attribute key, or a `{ key, value }` object or a function that takes
  11681. * the model attribute value and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
  11682. * as parameters and returns a `{ key, value }` object. If `key` is `'class'`, `value` can be a `String` or an
  11683. * array of `String`s. If `key` is `'style'`, `value` is an object with key-value pairs. In other cases, `value` is a `String`.
  11684. * If `config.model.values` is set, `config.view` should be an object assigning values from `config.model.values` to
  11685. * `{ key, value }` objects or a functions.
  11686. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  11687. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  11688. */
  11689. attributeToAttribute( config ) {
  11690. return this.add( downcastAttributeToAttribute( config ) );
  11691. }
  11692. /**
  11693. * Model marker to view element conversion helper.
  11694. *
  11695. * **Note**: This method should be used mainly for editing downcast and it is recommended
  11696. * to use {@link #markerToData `#markerToData()`} helper instead.
  11697. *
  11698. * This helper may produce invalid HTML code (e.g. a span between table cells).
  11699. * It should be used only when you are sure that the produced HTML will be semantically correct.
  11700. *
  11701. * This conversion results in creating a view element on the boundaries of the converted marker. If the converted marker
  11702. * is collapsed, only one element is created. For example, model marker set like this: `<paragraph>F[oo b]ar</paragraph>`
  11703. * becomes `<p>F<span data-marker="search"></span>oo b<span data-marker="search"></span>ar</p>` in the view.
  11704. *
  11705. * editor.conversion.for( 'editingDowncast' ).markerToElement( {
  11706. * model: 'search',
  11707. * view: 'marker-search'
  11708. * } );
  11709. *
  11710. * editor.conversion.for( 'editingDowncast' ).markerToElement( {
  11711. * model: 'search',
  11712. * view: 'search-result',
  11713. * converterPriority: 'high'
  11714. * } );
  11715. *
  11716. * editor.conversion.for( 'editingDowncast' ).markerToElement( {
  11717. * model: 'search',
  11718. * view: {
  11719. * name: 'span',
  11720. * attributes: {
  11721. * 'data-marker': 'search'
  11722. * }
  11723. * }
  11724. * } );
  11725. *
  11726. * editor.conversion.for( 'editingDowncast' ).markerToElement( {
  11727. * model: 'search',
  11728. * view: ( markerData, conversionApi ) => {
  11729. * const { writer } = conversionApi;
  11730. *
  11731. * return writer.createUIElement( 'span', {
  11732. * 'data-marker': 'search',
  11733. * 'data-start': markerData.isOpening
  11734. * } );
  11735. * }
  11736. * } );
  11737. *
  11738. * If a function is passed as the `config.view` parameter, it will be used to generate both boundary elements. The function
  11739. * receives the `data` object and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
  11740. * as a parameters and should return an instance of the
  11741. * {@link module:engine/view/uielement~UIElement view UI element}. The `data` object and
  11742. * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi `conversionApi`} are passed from
  11743. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}. Additionally,
  11744. * the `data.isOpening` parameter is passed, which is set to `true` for the marker start boundary element, and `false` to
  11745. * the marker end boundary element.
  11746. *
  11747. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  11748. * to the conversion process.
  11749. *
  11750. * @method #markerToElement
  11751. * @param {Object} config Conversion configuration.
  11752. * @param {String} config.model The name of the model marker (or model marker group) to convert.
  11753. * @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function that
  11754. * takes the model marker data and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
  11755. * as a parameters and returns a view UI element.
  11756. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  11757. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  11758. */
  11759. markerToElement( config ) {
  11760. return this.add( downcastMarkerToElement( config ) );
  11761. }
  11762. /**
  11763. * Model marker to highlight conversion helper.
  11764. *
  11765. * This conversion results in creating a highlight on view nodes. For this kind of conversion,
  11766. * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor} should be provided.
  11767. *
  11768. * For text nodes, a `<span>` {@link module:engine/view/attributeelement~AttributeElement} is created and it wraps all text nodes
  11769. * in the converted marker range. For example, a model marker set like this: `<paragraph>F[oo b]ar</paragraph>` becomes
  11770. * `<p>F<span class="comment">oo b</span>ar</p>` in the view.
  11771. *
  11772. * {@link module:engine/view/containerelement~ContainerElement} may provide a custom way of handling highlight. Most often,
  11773. * the element itself is given classes and attributes described in the highlight descriptor (instead of being wrapped in `<span>`).
  11774. * For example, a model marker set like this:
  11775. * `[<imageInline src="foo.jpg"></imageInline>]` becomes `<img src="foo.jpg" class="comment"></img>` in the view.
  11776. *
  11777. * For container elements, the conversion is two-step. While the converter processes the highlight descriptor and passes it
  11778. * to a container element, it is the container element instance itself that applies values from the highlight descriptor.
  11779. * So, in a sense, the converter takes care of stating what should be applied on what, while the element decides how to apply that.
  11780. *
  11781. * editor.conversion.for( 'downcast' ).markerToHighlight( { model: 'comment', view: { classes: 'comment' } } );
  11782. *
  11783. * editor.conversion.for( 'downcast' ).markerToHighlight( {
  11784. * model: 'comment',
  11785. * view: { classes: 'comment' },
  11786. * converterPriority: 'high'
  11787. * } );
  11788. *
  11789. * editor.conversion.for( 'downcast' ).markerToHighlight( {
  11790. * model: 'comment',
  11791. * view: ( data, conversionApi ) => {
  11792. * // Assuming that the marker name is in a form of comment:commentType:commentId.
  11793. * const [ , commentType, commentId ] = data.markerName.split( ':' );
  11794. *
  11795. * return {
  11796. * classes: [ 'comment', 'comment-' + commentType ],
  11797. * attributes: { 'data-comment-id': commentId }
  11798. * };
  11799. * }
  11800. * } );
  11801. *
  11802. * If a function is passed as the `config.view` parameter, it will be used to generate the highlight descriptor. The function
  11803. * receives the `data` object and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
  11804. * as a parameters and should return a
  11805. * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor highlight descriptor}.
  11806. * The `data` object properties are passed from {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}.
  11807. *
  11808. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  11809. * to the conversion process.
  11810. *
  11811. * @method #markerToHighlight
  11812. * @param {Object} config Conversion configuration.
  11813. * @param {String} config.model The name of the model marker (or model marker group) to convert.
  11814. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} config.view A highlight descriptor
  11815. * that will be used for highlighting or a function that takes the model marker data and
  11816. * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as a parameters
  11817. * and returns a highlight descriptor.
  11818. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  11819. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  11820. */
  11821. markerToHighlight( config ) {
  11822. return this.add( downcastMarkerToHighlight( config ) );
  11823. }
  11824. /**
  11825. * Model marker converter for data downcast.
  11826. *
  11827. * This conversion creates a representation for model marker boundaries in the view:
  11828. *
  11829. * * If the marker boundary is before or after a model element, a view attribute is set on a corresponding view element.
  11830. * * In other cases, a view element with the specified tag name is inserted at the corresponding view position.
  11831. *
  11832. * Typically, the marker names use the `group:uniqueId:otherData` convention. For example: `comment:e34zfk9k2n459df53sjl34:zx32c`.
  11833. * The default configuration for this conversion is that the first part is the `group` part and the rest of
  11834. * the marker name becomes the `name` part.
  11835. *
  11836. * Tag and attribute names and values are generated from the marker name:
  11837. *
  11838. * * The templates for attributes are `data-[group]-start-before="[name]"`, `data-[group]-start-after="[name]"`,
  11839. * `data-[group]-end-before="[name]"` and `data-[group]-end-after="[name]"`.
  11840. * * The templates for view elements are `<[group]-start name="[name]">` and `<[group]-end name="[name]">`.
  11841. *
  11842. * Attributes mark whether the given marker's start or end boundary is before or after the given element.
  11843. * The `data-[group]-start-before` and `data-[group]-end-after` attributes are favored.
  11844. * The other two are used when the former two cannot be used.
  11845. *
  11846. * The conversion configuration can take a function that will generate different group and name parts.
  11847. * If such a function is set as the `config.view` parameter, it is passed a marker name and it is expected to return an object with two
  11848. * properties: `group` and `name`. If the function returns a falsy value, the conversion will not take place.
  11849. *
  11850. * Basic usage:
  11851. *
  11852. * // Using the default conversion.
  11853. * // In this case, all markers with names starting with 'comment:' will be converted.
  11854. * // The `group` parameter will be set to `comment`.
  11855. * // The `name` parameter will be the rest of the marker name (without the `:`).
  11856. * editor.conversion.for( 'dataDowncast' ).markerToData( {
  11857. * model: 'comment'
  11858. * } );
  11859. *
  11860. * An example of a view that may be generated by this conversion (assuming a marker with the name `comment:commentId:uid` marked
  11861. * by `[]`):
  11862. *
  11863. * // Model:
  11864. * <paragraph>Foo[bar</paragraph>
  11865. * <imageBlock src="abc.jpg"></imageBlock>]
  11866. *
  11867. * // View:
  11868. * <p>Foo<comment-start name="commentId:uid"></comment-start>bar</p>
  11869. * <figure data-comment-end-after="commentId:uid" class="image"><img src="abc.jpg" /></figure>
  11870. *
  11871. * In the example above, the comment starts before "bar" and ends after the image.
  11872. *
  11873. * If the `name` part is empty, the following view may be generated:
  11874. *
  11875. * <p>Foo <myMarker-start></myMarker-start>bar</p>
  11876. * <figure data-myMarker-end-after="" class="image"><img src="abc.jpg" /></figure>
  11877. *
  11878. * **Note:** A situation where some markers have the `name` part and some do not, is incorrect and should be avoided.
  11879. *
  11880. * Examples where `data-group-start-after` and `data-group-end-before` are used:
  11881. *
  11882. * // Model:
  11883. * <blockQuote>[]<paragraph>Foo</paragraph></blockQuote>
  11884. *
  11885. * // View:
  11886. * <blockquote><p data-group-end-before="name" data-group-start-before="name">Foo</p></blockquote>
  11887. *
  11888. * Similarly, when a marker is collapsed after the last element:
  11889. *
  11890. * // Model:
  11891. * <blockQuote><paragraph>Foo</paragraph>[]</blockQuote>
  11892. *
  11893. * // View:
  11894. * <blockquote><p data-group-end-after="name" data-group-start-after="name">Foo</p></blockquote>
  11895. *
  11896. * When there are multiple markers from the same group stored in the same attribute of the same element, their
  11897. * name parts are put together in the attribute value, for example: `data-group-start-before="name1,name2,name3"`.
  11898. *
  11899. * Other examples of usage:
  11900. *
  11901. * // Using a custom function which is the same as the default conversion:
  11902. * editor.conversion.for( 'dataDowncast' ).markerToData( {
  11903. * model: 'comment'
  11904. * view: markerName => ( {
  11905. * group: 'comment',
  11906. * name: markerName.substr( 8 ) // Removes 'comment:' part.
  11907. * } )
  11908. * } );
  11909. *
  11910. * // Using the converter priority:
  11911. * editor.conversion.for( 'dataDowncast' ).markerToData( {
  11912. * model: 'comment'
  11913. * view: markerName => ( {
  11914. * group: 'comment',
  11915. * name: markerName.substr( 8 ) // Removes 'comment:' part.
  11916. * } ),
  11917. * converterPriority: 'high'
  11918. * } );
  11919. *
  11920. * This kind of conversion is useful for saving data into the database, so it should be used in the data conversion pipeline.
  11921. *
  11922. * See the {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} API guide to learn how to
  11923. * add a converter to the conversion process.
  11924. *
  11925. * @method #markerToData
  11926. * @param {Object} config Conversion configuration.
  11927. * @param {String} config.model The name of the model marker (or the model marker group) to convert.
  11928. * @param {Function} [config.view] A function that takes the model marker name and
  11929. * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as the parameters
  11930. * and returns an object with the `group` and `name` properties.
  11931. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  11932. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  11933. */
  11934. markerToData( config ) {
  11935. return this.add( downcastMarkerToData( config ) );
  11936. }
  11937. }
  11938. /**
  11939. * Function factory that creates a default downcast converter for text insertion changes.
  11940. *
  11941. * The converter automatically consumes the corresponding value from the consumables list and stops the event (see
  11942. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).
  11943. *
  11944. * modelDispatcher.on( 'insert:$text', insertText() );
  11945. *
  11946. * @returns {Function} Insert text event converter.
  11947. */
  11948. function insertText() {
  11949. return ( evt, data, conversionApi ) => {
  11950. if ( !conversionApi.consumable.consume( data.item, 'insert' ) ) {
  11951. return;
  11952. }
  11953. const viewWriter = conversionApi.writer;
  11954. const viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
  11955. const viewText = viewWriter.createText( data.item.data );
  11956. viewWriter.insert( viewPosition, viewText );
  11957. };
  11958. }
  11959. /**
  11960. * Function factory that creates a default downcast converter for node remove changes.
  11961. *
  11962. * modelDispatcher.on( 'remove', remove() );
  11963. *
  11964. * @returns {Function} Remove event converter.
  11965. */
  11966. function remove() {
  11967. return ( evt, data, conversionApi ) => {
  11968. // Find the view range start position by mapping the model position at which the remove happened.
  11969. const viewStart = conversionApi.mapper.toViewPosition( data.position );
  11970. const modelEnd = data.position.getShiftedBy( data.length );
  11971. const viewEnd = conversionApi.mapper.toViewPosition( modelEnd, { isPhantom: true } );
  11972. const viewRange = conversionApi.writer.createRange( viewStart, viewEnd );
  11973. // Trim the range to remove in case some UI elements are on the view range boundaries.
  11974. const removed = conversionApi.writer.remove( viewRange.getTrimmed() );
  11975. // After the range is removed, unbind all view elements from the model.
  11976. // Range inside view document fragment is used to unbind deeply.
  11977. for ( const child of conversionApi.writer.createRangeIn( removed ).getItems() ) {
  11978. conversionApi.mapper.unbindViewElement( child );
  11979. }
  11980. };
  11981. }
  11982. /**
  11983. * Creates a `<span>` {@link module:engine/view/attributeelement~AttributeElement view attribute element} from the information
  11984. * provided by the {@link module:engine/conversion/downcasthelpers~HighlightDescriptor highlight descriptor} object. If the priority
  11985. * is not provided in the descriptor, the default priority will be used.
  11986. *
  11987. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  11988. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
  11989. * @returns {module:engine/view/attributeelement~AttributeElement}
  11990. */
  11991. function createViewElementFromHighlightDescriptor( writer, descriptor ) {
  11992. const viewElement = writer.createAttributeElement( 'span', descriptor.attributes );
  11993. if ( descriptor.classes ) {
  11994. viewElement._addClass( descriptor.classes );
  11995. }
  11996. if ( typeof descriptor.priority === 'number' ) {
  11997. viewElement._priority = descriptor.priority;
  11998. }
  11999. viewElement._id = descriptor.id;
  12000. return viewElement;
  12001. }
  12002. /**
  12003. * Function factory that creates a converter which converts a non-collapsed {@link module:engine/model/selection~Selection model selection}
  12004. * to a {@link module:engine/view/documentselection~DocumentSelection view selection}. The converter consumes appropriate
  12005. * value from the `consumable` object and maps model positions from the selection to view positions.
  12006. *
  12007. * modelDispatcher.on( 'selection', convertRangeSelection() );
  12008. *
  12009. * @returns {Function} Selection converter.
  12010. */
  12011. function convertRangeSelection() {
  12012. return ( evt, data, conversionApi ) => {
  12013. const selection = data.selection;
  12014. if ( selection.isCollapsed ) {
  12015. return;
  12016. }
  12017. if ( !conversionApi.consumable.consume( selection, 'selection' ) ) {
  12018. return;
  12019. }
  12020. const viewRanges = [];
  12021. for ( const range of selection.getRanges() ) {
  12022. const viewRange = conversionApi.mapper.toViewRange( range );
  12023. viewRanges.push( viewRange );
  12024. }
  12025. conversionApi.writer.setSelection( viewRanges, { backward: selection.isBackward } );
  12026. };
  12027. }
  12028. /**
  12029. * Function factory that creates a converter which converts a collapsed {@link module:engine/model/selection~Selection model selection} to
  12030. * a {@link module:engine/view/documentselection~DocumentSelection view selection}. The converter consumes appropriate
  12031. * value from the `consumable` object, maps the model selection position to the view position and breaks
  12032. * {@link module:engine/view/attributeelement~AttributeElement attribute elements} at the selection position.
  12033. *
  12034. * modelDispatcher.on( 'selection', convertCollapsedSelection() );
  12035. *
  12036. * An example of the view state before and after converting the collapsed selection:
  12037. *
  12038. * <p><strong>f^oo<strong>bar</p>
  12039. * -> <p><strong>f</strong>^<strong>oo</strong>bar</p>
  12040. *
  12041. * By breaking attribute elements like `<strong>`, the selection is in a correct element. Then, when the selection attribute is
  12042. * converted, broken attributes might be merged again, or the position where the selection is may be wrapped
  12043. * with different, appropriate attribute elements.
  12044. *
  12045. * See also {@link module:engine/conversion/downcasthelpers~clearAttributes} which does a clean-up
  12046. * by merging attributes.
  12047. *
  12048. * @returns {Function} Selection converter.
  12049. */
  12050. function convertCollapsedSelection() {
  12051. return ( evt, data, conversionApi ) => {
  12052. const selection = data.selection;
  12053. if ( !selection.isCollapsed ) {
  12054. return;
  12055. }
  12056. if ( !conversionApi.consumable.consume( selection, 'selection' ) ) {
  12057. return;
  12058. }
  12059. const viewWriter = conversionApi.writer;
  12060. const modelPosition = selection.getFirstPosition();
  12061. const viewPosition = conversionApi.mapper.toViewPosition( modelPosition );
  12062. const brokenPosition = viewWriter.breakAttributes( viewPosition );
  12063. viewWriter.setSelection( brokenPosition );
  12064. };
  12065. }
  12066. /**
  12067. * Function factory that creates a converter which clears artifacts after the previous
  12068. * {@link module:engine/model/selection~Selection model selection} conversion. It removes all empty
  12069. * {@link module:engine/view/attributeelement~AttributeElement view attribute elements} and merges sibling attributes at all start and end
  12070. * positions of all ranges.
  12071. *
  12072. * <p><strong>^</strong></p>
  12073. * -> <p>^</p>
  12074. *
  12075. * <p><strong>foo</strong>^<strong>bar</strong>bar</p>
  12076. * -> <p><strong>foo^bar<strong>bar</p>
  12077. *
  12078. * <p><strong>foo</strong><em>^</em><strong>bar</strong>bar</p>
  12079. * -> <p><strong>foo^bar<strong>bar</p>
  12080. *
  12081. * This listener should be assigned before any converter for the new selection:
  12082. *
  12083. * modelDispatcher.on( 'selection', clearAttributes() );
  12084. *
  12085. * See {@link module:engine/conversion/downcasthelpers~convertCollapsedSelection}
  12086. * which does the opposite by breaking attributes in the selection position.
  12087. *
  12088. * @returns {Function} Selection converter.
  12089. */
  12090. function clearAttributes() {
  12091. return ( evt, data, conversionApi ) => {
  12092. const viewWriter = conversionApi.writer;
  12093. const viewSelection = viewWriter.document.selection;
  12094. for ( const range of viewSelection.getRanges() ) {
  12095. // Not collapsed selection should not have artifacts.
  12096. if ( range.isCollapsed ) {
  12097. // Position might be in the node removed by the view writer.
  12098. if ( range.end.parent.isAttached() ) {
  12099. conversionApi.writer.mergeAttributes( range.start );
  12100. }
  12101. }
  12102. }
  12103. viewWriter.setSelection( null );
  12104. };
  12105. }
  12106. /**
  12107. * Function factory that creates a converter which converts set/change/remove attribute changes from the model to the view.
  12108. * It can also be used to convert selection attributes. In that case, an empty attribute element will be created and the
  12109. * selection will be put inside it.
  12110. *
  12111. * Attributes from the model are converted to a view element that will be wrapping these view nodes that are bound to
  12112. * model elements having the given attribute. This is useful for attributes like `bold` that may be set on text nodes in the model
  12113. * but are represented as an element in the view:
  12114. *
  12115. * [paragraph] MODEL ====> VIEW <p>
  12116. * |- a {bold: true} |- <b>
  12117. * |- b {bold: true} | |- ab
  12118. * |- c |- c
  12119. *
  12120. * Passed `Function` will be provided with the attribute value and then all the parameters of the
  12121. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute` event}.
  12122. * It is expected that the function returns an {@link module:engine/view/element~Element}.
  12123. * The result of the function will be the wrapping element.
  12124. * When the provided `Function` does not return any element, no conversion will take place.
  12125. *
  12126. * The converter automatically consumes the corresponding value from the consumables list and stops the event (see
  12127. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).
  12128. *
  12129. * modelDispatcher.on( 'attribute:bold', wrap( ( modelAttributeValue, { writer } ) => {
  12130. * return writer.createAttributeElement( 'strong' );
  12131. * } );
  12132. *
  12133. * @protected
  12134. * @param {Function} elementCreator Function returning a view element that will be used for wrapping.
  12135. * @returns {Function} Set/change attribute converter.
  12136. */
  12137. function wrap( elementCreator ) {
  12138. return ( evt, data, conversionApi ) => {
  12139. // Recreate current wrapping node. It will be used to unwrap view range if the attribute value has changed
  12140. // or the attribute was removed.
  12141. const oldViewElement = elementCreator( data.attributeOldValue, conversionApi );
  12142. // Create node to wrap with.
  12143. const newViewElement = elementCreator( data.attributeNewValue, conversionApi );
  12144. if ( !oldViewElement && !newViewElement ) {
  12145. return;
  12146. }
  12147. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  12148. return;
  12149. }
  12150. const viewWriter = conversionApi.writer;
  12151. const viewSelection = viewWriter.document.selection;
  12152. if ( data.item instanceof _model_selection__WEBPACK_IMPORTED_MODULE_1__["default"] || data.item instanceof _model_documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  12153. // Selection attribute conversion.
  12154. viewWriter.wrap( viewSelection.getFirstRange(), newViewElement );
  12155. } else {
  12156. // Node attribute conversion.
  12157. let viewRange = conversionApi.mapper.toViewRange( data.range );
  12158. // First, unwrap the range from current wrapper.
  12159. if ( data.attributeOldValue !== null && oldViewElement ) {
  12160. viewRange = viewWriter.unwrap( viewRange, oldViewElement );
  12161. }
  12162. if ( data.attributeNewValue !== null && newViewElement ) {
  12163. viewWriter.wrap( viewRange, newViewElement );
  12164. }
  12165. }
  12166. };
  12167. }
  12168. /**
  12169. * Function factory that creates a converter which converts node insertion changes from the model to the view.
  12170. * The function passed will be provided with all the parameters of the dispatcher's
  12171. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert` event}.
  12172. * It is expected that the function returns an {@link module:engine/view/element~Element}.
  12173. * The result of the function will be inserted into the view.
  12174. *
  12175. * The converter automatically consumes the corresponding value from the consumables list, stops the event (see
  12176. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}) and binds the model and view elements.
  12177. *
  12178. * downcastDispatcher.on(
  12179. * 'insert:myElem',
  12180. * insertElement( ( modelItem, { writer } ) => {
  12181. * const text = writer.createText( 'myText' );
  12182. * const myElem = writer.createElement( 'myElem', { myAttr: 'my-' + modelItem.getAttribute( 'myAttr' ) }, text );
  12183. *
  12184. * // Do something fancy with `myElem` using `modelItem` or other parameters.
  12185. *
  12186. * return myElem;
  12187. * }
  12188. * ) );
  12189. *
  12190. * @protected
  12191. * @param {Function} elementCreator Function returning a view element, which will be inserted.
  12192. * @returns {Function} Insert element event converter.
  12193. */
  12194. function insertElement( elementCreator ) {
  12195. return ( evt, data, conversionApi ) => {
  12196. const viewElement = elementCreator( data.item, conversionApi );
  12197. if ( !viewElement ) {
  12198. return;
  12199. }
  12200. if ( !conversionApi.consumable.consume( data.item, 'insert' ) ) {
  12201. return;
  12202. }
  12203. const viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
  12204. conversionApi.mapper.bindElements( data.item, viewElement );
  12205. conversionApi.writer.insert( viewPosition, viewElement );
  12206. };
  12207. }
  12208. /**
  12209. * Function factory that creates a converter which converts marker adding change to the
  12210. * {@link module:engine/view/uielement~UIElement view UI element}.
  12211. *
  12212. * The view UI element that will be added to the view depends on the passed parameter. See {@link ~insertElement}.
  12213. * In case of a non-collapsed range, the UI element will not wrap nodes but separate elements will be placed at the beginning
  12214. * and at the end of the range.
  12215. *
  12216. * This converter binds created UI elements with the marker name using {@link module:engine/conversion/mapper~Mapper#bindElementToMarker}.
  12217. *
  12218. * @protected
  12219. * @param {module:engine/view/uielement~UIElement|Function} elementCreator A view UI element or a function returning the view element
  12220. * that will be inserted.
  12221. * @returns {Function} Insert element event converter.
  12222. */
  12223. function insertUIElement( elementCreator ) {
  12224. return ( evt, data, conversionApi ) => {
  12225. // Create two view elements. One will be inserted at the beginning of marker, one at the end.
  12226. // If marker is collapsed, only "opening" element will be inserted.
  12227. data.isOpening = true;
  12228. const viewStartElement = elementCreator( data, conversionApi );
  12229. data.isOpening = false;
  12230. const viewEndElement = elementCreator( data, conversionApi );
  12231. if ( !viewStartElement || !viewEndElement ) {
  12232. return;
  12233. }
  12234. const markerRange = data.markerRange;
  12235. // Marker that is collapsed has consumable build differently that non-collapsed one.
  12236. // For more information see `addMarker` event description.
  12237. // If marker's range is collapsed - check if it can be consumed.
  12238. if ( markerRange.isCollapsed && !conversionApi.consumable.consume( markerRange, evt.name ) ) {
  12239. return;
  12240. }
  12241. // If marker's range is not collapsed - consume all items inside.
  12242. for ( const value of markerRange ) {
  12243. if ( !conversionApi.consumable.consume( value.item, evt.name ) ) {
  12244. return;
  12245. }
  12246. }
  12247. const mapper = conversionApi.mapper;
  12248. const viewWriter = conversionApi.writer;
  12249. // Add "opening" element.
  12250. viewWriter.insert( mapper.toViewPosition( markerRange.start ), viewStartElement );
  12251. conversionApi.mapper.bindElementToMarker( viewStartElement, data.markerName );
  12252. // Add "closing" element only if range is not collapsed.
  12253. if ( !markerRange.isCollapsed ) {
  12254. viewWriter.insert( mapper.toViewPosition( markerRange.end ), viewEndElement );
  12255. conversionApi.mapper.bindElementToMarker( viewEndElement, data.markerName );
  12256. }
  12257. evt.stop();
  12258. };
  12259. }
  12260. // Function factory that returns a default downcast converter for removing a {@link module:engine/view/uielement~UIElement UI element}
  12261. // based on marker remove change.
  12262. //
  12263. // This converter unbinds elements from the marker name.
  12264. //
  12265. // @returns {Function} Removed UI element converter.
  12266. function removeUIElement() {
  12267. return ( evt, data, conversionApi ) => {
  12268. const elements = conversionApi.mapper.markerNameToElements( data.markerName );
  12269. if ( !elements ) {
  12270. return;
  12271. }
  12272. for ( const element of elements ) {
  12273. conversionApi.mapper.unbindElementFromMarkerName( element, data.markerName );
  12274. conversionApi.writer.clear( conversionApi.writer.createRangeOn( element ), element );
  12275. }
  12276. conversionApi.writer.clearClonedElementsGroup( data.markerName );
  12277. evt.stop();
  12278. };
  12279. }
  12280. // Function factory that creates a default converter for model markers.
  12281. //
  12282. // See {@link DowncastHelpers#markerToData} for more information what type of view is generated.
  12283. //
  12284. // This converter binds created UI elements and affected view elements with the marker name
  12285. // using {@link module:engine/conversion/mapper~Mapper#bindElementToMarker}.
  12286. //
  12287. // @returns {Function} Add marker converter.
  12288. function insertMarkerData( viewCreator ) {
  12289. return ( evt, data, conversionApi ) => {
  12290. const viewMarkerData = viewCreator( data.markerName, conversionApi );
  12291. if ( !viewMarkerData ) {
  12292. return;
  12293. }
  12294. const markerRange = data.markerRange;
  12295. if ( !conversionApi.consumable.consume( markerRange, evt.name ) ) {
  12296. return;
  12297. }
  12298. // Adding closing data first to keep the proper order in the view.
  12299. handleMarkerBoundary( markerRange, false, conversionApi, data, viewMarkerData );
  12300. handleMarkerBoundary( markerRange, true, conversionApi, data, viewMarkerData );
  12301. evt.stop();
  12302. };
  12303. }
  12304. // Helper function for `insertMarkerData()` that marks a marker boundary at the beginning or end of given `range`.
  12305. function handleMarkerBoundary( range, isStart, conversionApi, data, viewMarkerData ) {
  12306. const modelPosition = isStart ? range.start : range.end;
  12307. const elementAfter = modelPosition.nodeAfter && modelPosition.nodeAfter.is( 'element' ) ? modelPosition.nodeAfter : null;
  12308. const elementBefore = modelPosition.nodeBefore && modelPosition.nodeBefore.is( 'element' ) ? modelPosition.nodeBefore : null;
  12309. if ( elementAfter || elementBefore ) {
  12310. let modelElement;
  12311. let isBefore;
  12312. // If possible, we want to add `data-group-start-before` and `data-group-end-after` attributes.
  12313. if ( isStart && elementAfter || !isStart && !elementBefore ) {
  12314. // [<elementAfter>...</elementAfter> -> <elementAfter data-group-start-before="...">...</elementAfter>
  12315. // <parent>]<elementAfter> -> <parent><elementAfter data-group-end-before="...">
  12316. modelElement = elementAfter;
  12317. isBefore = true;
  12318. } else {
  12319. // <elementBefore>...</elementBefore>] -> <elementBefore data-group-end-after="...">...</elementBefore>
  12320. // </elementBefore>[</parent> -> </elementBefore data-group-start-after="..."></parent>
  12321. modelElement = elementBefore;
  12322. isBefore = false;
  12323. }
  12324. const viewElement = conversionApi.mapper.toViewElement( modelElement );
  12325. // In rare circumstances, the model element may be not mapped to any view element and that would cause an error.
  12326. // One of those situations is a soft break inside code block.
  12327. if ( viewElement ) {
  12328. insertMarkerAsAttribute( viewElement, isStart, isBefore, conversionApi, data, viewMarkerData );
  12329. return;
  12330. }
  12331. }
  12332. const viewPosition = conversionApi.mapper.toViewPosition( modelPosition );
  12333. insertMarkerAsElement( viewPosition, isStart, conversionApi, data, viewMarkerData );
  12334. }
  12335. // Helper function for `insertMarkerData()` that marks a marker boundary in the view as an attribute on a view element.
  12336. function insertMarkerAsAttribute( viewElement, isStart, isBefore, conversionApi, data, viewMarkerData ) {
  12337. const attributeName = `data-${ viewMarkerData.group }-${ isStart ? 'start' : 'end' }-${ isBefore ? 'before' : 'after' }`;
  12338. const markerNames = viewElement.hasAttribute( attributeName ) ? viewElement.getAttribute( attributeName ).split( ',' ) : [];
  12339. // Adding marker name at the beginning to have the same order in the attribute as there is with marker elements.
  12340. markerNames.unshift( viewMarkerData.name );
  12341. conversionApi.writer.setAttribute( attributeName, markerNames.join( ',' ), viewElement );
  12342. conversionApi.mapper.bindElementToMarker( viewElement, data.markerName );
  12343. }
  12344. // Helper function for `insertMarkerData()` that marks a marker boundary in the view as a separate view ui element.
  12345. function insertMarkerAsElement( position, isStart, conversionApi, data, viewMarkerData ) {
  12346. const viewElementName = `${ viewMarkerData.group }-${ isStart ? 'start' : 'end' }`;
  12347. const attrs = viewMarkerData.name ? { 'name': viewMarkerData.name } : null;
  12348. const viewElement = conversionApi.writer.createUIElement( viewElementName, attrs );
  12349. conversionApi.writer.insert( position, viewElement );
  12350. conversionApi.mapper.bindElementToMarker( viewElement, data.markerName );
  12351. }
  12352. // Function factory that creates a converter for removing a model marker data added by the {@link #insertMarkerData} converter.
  12353. //
  12354. // @returns {Function} Remove marker converter.
  12355. function removeMarkerData( viewCreator ) {
  12356. return ( evt, data, conversionApi ) => {
  12357. const viewData = viewCreator( data.markerName, conversionApi );
  12358. if ( !viewData ) {
  12359. return;
  12360. }
  12361. const elements = conversionApi.mapper.markerNameToElements( data.markerName );
  12362. if ( !elements ) {
  12363. return;
  12364. }
  12365. for ( const element of elements ) {
  12366. conversionApi.mapper.unbindElementFromMarkerName( element, data.markerName );
  12367. if ( element.is( 'containerElement' ) ) {
  12368. removeMarkerFromAttribute( `data-${ viewData.group }-start-before`, element );
  12369. removeMarkerFromAttribute( `data-${ viewData.group }-start-after`, element );
  12370. removeMarkerFromAttribute( `data-${ viewData.group }-end-before`, element );
  12371. removeMarkerFromAttribute( `data-${ viewData.group }-end-after`, element );
  12372. } else {
  12373. conversionApi.writer.clear( conversionApi.writer.createRangeOn( element ), element );
  12374. }
  12375. }
  12376. conversionApi.writer.clearClonedElementsGroup( data.markerName );
  12377. evt.stop();
  12378. function removeMarkerFromAttribute( attributeName, element ) {
  12379. if ( element.hasAttribute( attributeName ) ) {
  12380. const markerNames = new Set( element.getAttribute( attributeName ).split( ',' ) );
  12381. markerNames.delete( viewData.name );
  12382. if ( markerNames.size == 0 ) {
  12383. conversionApi.writer.removeAttribute( attributeName, element );
  12384. } else {
  12385. conversionApi.writer.setAttribute( attributeName, Array.from( markerNames ).join( ',' ), element );
  12386. }
  12387. }
  12388. }
  12389. };
  12390. }
  12391. // Function factory that creates a converter which converts set/change/remove attribute changes from the model to the view.
  12392. //
  12393. // Attributes from the model are converted to the view element attributes in the view. You may provide a custom function to generate
  12394. // a key-value attribute pair to add/change/remove. If not provided, model attributes will be converted to view element
  12395. // attributes on a one-to-one basis.
  12396. //
  12397. // *Note:** The provided attribute creator should always return the same `key` for a given attribute from the model.
  12398. //
  12399. // The converter automatically consumes the corresponding value from the consumables list and stops the event (see
  12400. // {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).
  12401. //
  12402. // modelDispatcher.on( 'attribute:customAttr:myElem', changeAttribute( ( value, data ) => {
  12403. // // Change attribute key from `customAttr` to `class` in the view.
  12404. // const key = 'class';
  12405. // let value = data.attributeNewValue;
  12406. //
  12407. // // Force attribute value to 'empty' if the model element is empty.
  12408. // if ( data.item.childCount === 0 ) {
  12409. // value = 'empty';
  12410. // }
  12411. //
  12412. // // Return the key-value pair.
  12413. // return { key, value };
  12414. // } ) );
  12415. //
  12416. // @param {Function} [attributeCreator] Function returning an object with two properties: `key` and `value`, which
  12417. // represent the attribute key and attribute value to be set on a {@link module:engine/view/element~Element view element}.
  12418. // The function is passed the model attribute value as the first parameter and additional data about the change as the second parameter.
  12419. // @returns {Function} Set/change attribute converter.
  12420. function changeAttribute( attributeCreator ) {
  12421. return ( evt, data, conversionApi ) => {
  12422. const oldAttribute = attributeCreator( data.attributeOldValue, conversionApi );
  12423. const newAttribute = attributeCreator( data.attributeNewValue, conversionApi );
  12424. if ( !oldAttribute && !newAttribute ) {
  12425. return;
  12426. }
  12427. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  12428. return;
  12429. }
  12430. const viewElement = conversionApi.mapper.toViewElement( data.item );
  12431. const viewWriter = conversionApi.writer;
  12432. // If model item cannot be mapped to a view element, it means item is not an `Element` instance but a `TextProxy` node.
  12433. // Only elements can have attributes in a view so do not proceed for anything else (#1587).
  12434. if ( !viewElement ) {
  12435. /**
  12436. * This error occurs when a {@link module:engine/model/textproxy~TextProxy text node's} attribute is to be downcasted
  12437. * by {@link module:engine/conversion/conversion~Conversion#attributeToAttribute `Attribute to Attribute converter`}.
  12438. * In most cases it is caused by converters misconfiguration when only "generic" converter is defined:
  12439. *
  12440. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  12441. * model: 'attribute-name',
  12442. * view: 'attribute-name'
  12443. * } ) );
  12444. *
  12445. * and given attribute is used on text node, for example:
  12446. *
  12447. * model.change( writer => {
  12448. * writer.insertText( 'Foo', { 'attribute-name': 'bar' }, parent, 0 );
  12449. * } );
  12450. *
  12451. * In such cases, to convert the same attribute for both {@link module:engine/model/element~Element}
  12452. * and {@link module:engine/model/textproxy~TextProxy `Text`} nodes, text specific
  12453. * {@link module:engine/conversion/conversion~Conversion#attributeToElement `Attribute to Element converter`}
  12454. * with higher {@link module:utils/priorities~PriorityString priority} must also be defined:
  12455. *
  12456. * editor.conversion.for( 'downcast' ).attributeToElement( {
  12457. * model: {
  12458. * key: 'attribute-name',
  12459. * name: '$text'
  12460. * },
  12461. * view: ( value, { writer } ) => {
  12462. * return writer.createAttributeElement( 'span', { 'attribute-name': value } );
  12463. * },
  12464. * converterPriority: 'high'
  12465. * } ) );
  12466. *
  12467. * @error conversion-attribute-to-attribute-on-text
  12468. */
  12469. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_7__["default"](
  12470. 'conversion-attribute-to-attribute-on-text',
  12471. [ data, conversionApi ]
  12472. );
  12473. }
  12474. // First remove the old attribute if there was one.
  12475. if ( data.attributeOldValue !== null && oldAttribute ) {
  12476. if ( oldAttribute.key == 'class' ) {
  12477. const classes = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_8__["default"])( oldAttribute.value );
  12478. for ( const className of classes ) {
  12479. viewWriter.removeClass( className, viewElement );
  12480. }
  12481. } else if ( oldAttribute.key == 'style' ) {
  12482. const keys = Object.keys( oldAttribute.value );
  12483. for ( const key of keys ) {
  12484. viewWriter.removeStyle( key, viewElement );
  12485. }
  12486. } else {
  12487. viewWriter.removeAttribute( oldAttribute.key, viewElement );
  12488. }
  12489. }
  12490. // Then set the new attribute.
  12491. if ( data.attributeNewValue !== null && newAttribute ) {
  12492. if ( newAttribute.key == 'class' ) {
  12493. const classes = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_8__["default"])( newAttribute.value );
  12494. for ( const className of classes ) {
  12495. viewWriter.addClass( className, viewElement );
  12496. }
  12497. } else if ( newAttribute.key == 'style' ) {
  12498. const keys = Object.keys( newAttribute.value );
  12499. for ( const key of keys ) {
  12500. viewWriter.setStyle( key, newAttribute.value[ key ], viewElement );
  12501. }
  12502. } else {
  12503. viewWriter.setAttribute( newAttribute.key, newAttribute.value, viewElement );
  12504. }
  12505. }
  12506. };
  12507. }
  12508. // Function factory that creates a converter which converts the text inside marker's range. The converter wraps the text with
  12509. // {@link module:engine/view/attributeelement~AttributeElement} created from the provided descriptor.
  12510. // See {link module:engine/conversion/downcasthelpers~createViewElementFromHighlightDescriptor}.
  12511. //
  12512. // It can also be used to convert the selection that is inside a marker. In that case, an empty attribute element will be
  12513. // created and the selection will be put inside it.
  12514. //
  12515. // If the highlight descriptor does not provide the `priority` property, `10` will be used.
  12516. //
  12517. // If the highlight descriptor does not provide the `id` property, the name of the marker will be used.
  12518. //
  12519. // This converter binds the created {@link module:engine/view/attributeelement~AttributeElement attribute elemens} with the marker name
  12520. // using the {@link module:engine/conversion/mapper~Mapper#bindElementToMarker} method.
  12521. //
  12522. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor
  12523. // @returns {Function}
  12524. function highlightText( highlightDescriptor ) {
  12525. return ( evt, data, conversionApi ) => {
  12526. if ( !data.item ) {
  12527. return;
  12528. }
  12529. if ( !( data.item instanceof _model_selection__WEBPACK_IMPORTED_MODULE_1__["default"] || data.item instanceof _model_documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) && !data.item.is( '$textProxy' ) ) {
  12530. return;
  12531. }
  12532. const descriptor = prepareDescriptor( highlightDescriptor, data, conversionApi );
  12533. if ( !descriptor ) {
  12534. return;
  12535. }
  12536. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  12537. return;
  12538. }
  12539. const viewWriter = conversionApi.writer;
  12540. const viewElement = createViewElementFromHighlightDescriptor( viewWriter, descriptor );
  12541. const viewSelection = viewWriter.document.selection;
  12542. if ( data.item instanceof _model_selection__WEBPACK_IMPORTED_MODULE_1__["default"] || data.item instanceof _model_documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  12543. viewWriter.wrap( viewSelection.getFirstRange(), viewElement, viewSelection );
  12544. } else {
  12545. const viewRange = conversionApi.mapper.toViewRange( data.range );
  12546. const rangeAfterWrap = viewWriter.wrap( viewRange, viewElement );
  12547. for ( const element of rangeAfterWrap.getItems() ) {
  12548. if ( element.is( 'attributeElement' ) && element.isSimilar( viewElement ) ) {
  12549. conversionApi.mapper.bindElementToMarker( element, data.markerName );
  12550. // One attribute element is enough, because all of them are bound together by the view writer.
  12551. // Mapper uses this binding to get all the elements no matter how many of them are registered in the mapper.
  12552. break;
  12553. }
  12554. }
  12555. }
  12556. };
  12557. }
  12558. // Converter function factory. It creates a function which applies the marker's highlight to an element inside the marker's range.
  12559. //
  12560. // The converter checks if an element has the `addHighlight` function stored as a
  12561. // {@link module:engine/view/element~Element#_setCustomProperty custom property} and, if so, uses it to apply the highlight.
  12562. // In such case the converter will consume all element's children, assuming that they were handled by the element itself.
  12563. //
  12564. // When the `addHighlight` custom property is not present, the element is not converted in any special way.
  12565. // This means that converters will proceed to convert the element's child nodes.
  12566. //
  12567. // If the highlight descriptor does not provide the `priority` property, `10` will be used.
  12568. //
  12569. // If the highlight descriptor does not provide the `id` property, the name of the marker will be used.
  12570. //
  12571. // This converter binds altered {@link module:engine/view/containerelement~ContainerElement container elements} with the marker name using
  12572. // the {@link module:engine/conversion/mapper~Mapper#bindElementToMarker} method.
  12573. //
  12574. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor
  12575. // @returns {Function}
  12576. function highlightElement( highlightDescriptor ) {
  12577. return ( evt, data, conversionApi ) => {
  12578. if ( !data.item ) {
  12579. return;
  12580. }
  12581. if ( !( data.item instanceof _model_element__WEBPACK_IMPORTED_MODULE_2__["default"] ) ) {
  12582. return;
  12583. }
  12584. const descriptor = prepareDescriptor( highlightDescriptor, data, conversionApi );
  12585. if ( !descriptor ) {
  12586. return;
  12587. }
  12588. if ( !conversionApi.consumable.test( data.item, evt.name ) ) {
  12589. return;
  12590. }
  12591. const viewElement = conversionApi.mapper.toViewElement( data.item );
  12592. if ( viewElement && viewElement.getCustomProperty( 'addHighlight' ) ) {
  12593. // Consume element itself.
  12594. conversionApi.consumable.consume( data.item, evt.name );
  12595. // Consume all children nodes.
  12596. for ( const value of _model_range__WEBPACK_IMPORTED_MODULE_0__["default"]._createIn( data.item ) ) {
  12597. conversionApi.consumable.consume( value.item, evt.name );
  12598. }
  12599. viewElement.getCustomProperty( 'addHighlight' )( viewElement, descriptor, conversionApi.writer );
  12600. conversionApi.mapper.bindElementToMarker( viewElement, data.markerName );
  12601. }
  12602. };
  12603. }
  12604. // Function factory that creates a converter which converts the removing model marker to the view.
  12605. //
  12606. // Both text nodes and elements are handled by this converter but they are handled a bit differently.
  12607. //
  12608. // Text nodes are unwrapped using the {@link module:engine/view/attributeelement~AttributeElement attribute element} created from the
  12609. // provided highlight descriptor. See {link module:engine/conversion/downcasthelpers~HighlightDescriptor}.
  12610. //
  12611. // For elements, the converter checks if an element has the `removeHighlight` function stored as a
  12612. // {@link module:engine/view/element~Element#_setCustomProperty custom property}. If so, it uses it to remove the highlight.
  12613. // In such case, the children of that element will not be converted.
  12614. //
  12615. // When `removeHighlight` is not present, the element is not converted in any special way.
  12616. // The converter will proceed to convert the element's child nodes instead.
  12617. //
  12618. // If the highlight descriptor does not provide the `priority` property, `10` will be used.
  12619. //
  12620. // If the highlight descriptor does not provide the `id` property, the name of the marker will be used.
  12621. //
  12622. // This converter unbinds elements from the marker name.
  12623. //
  12624. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor
  12625. // @returns {Function}
  12626. function removeHighlight( highlightDescriptor ) {
  12627. return ( evt, data, conversionApi ) => {
  12628. // This conversion makes sense only for non-collapsed range.
  12629. if ( data.markerRange.isCollapsed ) {
  12630. return;
  12631. }
  12632. const descriptor = prepareDescriptor( highlightDescriptor, data, conversionApi );
  12633. if ( !descriptor ) {
  12634. return;
  12635. }
  12636. // View element that will be used to unwrap `AttributeElement`s.
  12637. const viewHighlightElement = createViewElementFromHighlightDescriptor( conversionApi.writer, descriptor );
  12638. // Get all elements bound with given marker name.
  12639. const elements = conversionApi.mapper.markerNameToElements( data.markerName );
  12640. if ( !elements ) {
  12641. return;
  12642. }
  12643. for ( const element of elements ) {
  12644. conversionApi.mapper.unbindElementFromMarkerName( element, data.markerName );
  12645. if ( element.is( 'attributeElement' ) ) {
  12646. conversionApi.writer.unwrap( conversionApi.writer.createRangeOn( element ), viewHighlightElement );
  12647. } else {
  12648. // if element.is( 'containerElement' ).
  12649. element.getCustomProperty( 'removeHighlight' )( element, descriptor.id, conversionApi.writer );
  12650. }
  12651. }
  12652. conversionApi.writer.clearClonedElementsGroup( data.markerName );
  12653. evt.stop();
  12654. };
  12655. }
  12656. // Model element to view element conversion helper.
  12657. //
  12658. // See {@link ~DowncastHelpers#elementToElement `.elementToElement()` downcast helper} for examples and config params description.
  12659. //
  12660. // @param {Object} config Conversion configuration.
  12661. // @param {String} config.model
  12662. // @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view
  12663. // @param {Object} [config.triggerBy]
  12664. // @param {Array.<String>} [config.triggerBy.attributes]
  12665. // @param {Array.<String>} [config.triggerBy.children]
  12666. // @returns {Function} Conversion helper.
  12667. function downcastElementToElement( config ) {
  12668. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
  12669. config.view = normalizeToElementConfig( config.view, 'container' );
  12670. return dispatcher => {
  12671. dispatcher.on( 'insert:' + config.model, insertElement( config.view ), { priority: config.converterPriority || 'normal' } );
  12672. if ( config.triggerBy ) {
  12673. if ( config.triggerBy.attributes ) {
  12674. for ( const attributeKey of config.triggerBy.attributes ) {
  12675. dispatcher._mapReconversionTriggerEvent( config.model, `attribute:${ attributeKey }:${ config.model }` );
  12676. }
  12677. }
  12678. if ( config.triggerBy.children ) {
  12679. for ( const childName of config.triggerBy.children ) {
  12680. dispatcher._mapReconversionTriggerEvent( config.model, `insert:${ childName }` );
  12681. dispatcher._mapReconversionTriggerEvent( config.model, `remove:${ childName }` );
  12682. }
  12683. }
  12684. }
  12685. };
  12686. }
  12687. // Model attribute to view element conversion helper.
  12688. //
  12689. // See {@link ~DowncastHelpers#attributeToElement `.attributeToElement()` downcast helper} for examples.
  12690. //
  12691. // @param {Object} config Conversion configuration.
  12692. // @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values }` object. `values` is an array
  12693. // of `String`s with possible values if the model attribute is an enumerable.
  12694. // @param {module:engine/view/elementdefinition~ElementDefinition|Function|Object} config.view A view element definition or a function
  12695. // that takes the model attribute value and {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer}
  12696. // as parameters and returns a view attribute element. If `config.model.values` is
  12697. // given, `config.view` should be an object assigning values from `config.model.values` to view element definitions or functions.
  12698. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  12699. // @returns {Function} Conversion helper.
  12700. function downcastAttributeToElement( config ) {
  12701. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
  12702. const modelKey = config.model.key ? config.model.key : config.model;
  12703. let eventName = 'attribute:' + modelKey;
  12704. if ( config.model.name ) {
  12705. eventName += ':' + config.model.name;
  12706. }
  12707. if ( config.model.values ) {
  12708. for ( const modelValue of config.model.values ) {
  12709. config.view[ modelValue ] = normalizeToElementConfig( config.view[ modelValue ], 'attribute' );
  12710. }
  12711. } else {
  12712. config.view = normalizeToElementConfig( config.view, 'attribute' );
  12713. }
  12714. const elementCreator = getFromAttributeCreator( config );
  12715. return dispatcher => {
  12716. dispatcher.on( eventName, wrap( elementCreator ), { priority: config.converterPriority || 'normal' } );
  12717. };
  12718. }
  12719. // Model attribute to view attribute conversion helper.
  12720. //
  12721. // See {@link ~DowncastHelpers#attributeToAttribute `.attributeToAttribute()` downcast helper} for examples.
  12722. //
  12723. // @param {Object} config Conversion configuration.
  12724. // @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values, [ name ] }` object describing
  12725. // the attribute key, possible values and, optionally, an element name to convert from.
  12726. // @param {String|Object|Function} config.view A view attribute key, or a `{ key, value }` object or a function that takes
  12727. // the model attribute value and returns a `{ key, value }` object. If `key` is `'class'`, `value` can be a `String` or an
  12728. // array of `String`s. If `key` is `'style'`, `value` is an object with key-value pairs. In other cases, `value` is a `String`.
  12729. // If `config.model.values` is set, `config.view` should be an object assigning values from `config.model.values` to
  12730. // `{ key, value }` objects or a functions.
  12731. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  12732. // @returns {Function} Conversion helper.
  12733. function downcastAttributeToAttribute( config ) {
  12734. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
  12735. const modelKey = config.model.key ? config.model.key : config.model;
  12736. let eventName = 'attribute:' + modelKey;
  12737. if ( config.model.name ) {
  12738. eventName += ':' + config.model.name;
  12739. }
  12740. if ( config.model.values ) {
  12741. for ( const modelValue of config.model.values ) {
  12742. config.view[ modelValue ] = normalizeToAttributeConfig( config.view[ modelValue ] );
  12743. }
  12744. } else {
  12745. config.view = normalizeToAttributeConfig( config.view );
  12746. }
  12747. const elementCreator = getFromAttributeCreator( config );
  12748. return dispatcher => {
  12749. dispatcher.on( eventName, changeAttribute( elementCreator ), { priority: config.converterPriority || 'normal' } );
  12750. };
  12751. }
  12752. // Model marker to view element conversion helper.
  12753. //
  12754. // See {@link ~DowncastHelpers#markerToElement `.markerToElement()` downcast helper} for examples.
  12755. //
  12756. // @param {Object} config Conversion configuration.
  12757. // @param {String} config.model The name of the model marker (or model marker group) to convert.
  12758. // @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function
  12759. // that takes the model marker data as a parameter and returns a view UI element.
  12760. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  12761. // @returns {Function} Conversion helper.
  12762. function downcastMarkerToElement( config ) {
  12763. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
  12764. config.view = normalizeToElementConfig( config.view, 'ui' );
  12765. return dispatcher => {
  12766. dispatcher.on( 'addMarker:' + config.model, insertUIElement( config.view ), { priority: config.converterPriority || 'normal' } );
  12767. dispatcher.on( 'removeMarker:' + config.model, removeUIElement( config.view ), { priority: config.converterPriority || 'normal' } );
  12768. };
  12769. }
  12770. // Model marker to view data conversion helper.
  12771. //
  12772. // See {@link ~DowncastHelpers#markerToData `markerToData()` downcast helper} to learn more.
  12773. //
  12774. // @param {Object} config
  12775. // @param {String} config.model
  12776. // @param {Function} [config.view]
  12777. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal']
  12778. // @returns {Function} Conversion helper.
  12779. function downcastMarkerToData( config ) {
  12780. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
  12781. const group = config.model;
  12782. // Default conversion.
  12783. if ( !config.view ) {
  12784. config.view = markerName => ( {
  12785. group,
  12786. name: markerName.substr( config.model.length + 1 )
  12787. } );
  12788. }
  12789. return dispatcher => {
  12790. dispatcher.on( 'addMarker:' + group, insertMarkerData( config.view ), { priority: config.converterPriority || 'normal' } );
  12791. dispatcher.on( 'removeMarker:' + group, removeMarkerData( config.view ), { priority: config.converterPriority || 'normal' } );
  12792. };
  12793. }
  12794. // Model marker to highlight conversion helper.
  12795. //
  12796. // See {@link ~DowncastHelpers#markerToElement `.markerToElement()` downcast helper} for examples.
  12797. //
  12798. // @param {Object} config Conversion configuration.
  12799. // @param {String} config.model The name of the model marker (or model marker group) to convert.
  12800. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} config.view A highlight descriptor
  12801. // that will be used for highlighting or a function that takes the model marker data as a parameter and returns a highlight descriptor.
  12802. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  12803. // @returns {Function} Conversion helper.
  12804. function downcastMarkerToHighlight( config ) {
  12805. return dispatcher => {
  12806. dispatcher.on( 'addMarker:' + config.model, highlightText( config.view ), { priority: config.converterPriority || 'normal' } );
  12807. dispatcher.on( 'addMarker:' + config.model, highlightElement( config.view ), { priority: config.converterPriority || 'normal' } );
  12808. dispatcher.on( 'removeMarker:' + config.model, removeHighlight( config.view ), { priority: config.converterPriority || 'normal' } );
  12809. };
  12810. }
  12811. // Takes `config.view`, and if it is an {@link module:engine/view/elementdefinition~ElementDefinition}, converts it
  12812. // to a function (because lower level converters accept only element creator functions).
  12813. //
  12814. // @param {module:engine/view/elementdefinition~ElementDefinition|Function} view View configuration.
  12815. // @param {'container'|'attribute'|'ui'} viewElementType View element type to create.
  12816. // @returns {Function} Element creator function to use in lower level converters.
  12817. function normalizeToElementConfig( view, viewElementType ) {
  12818. if ( typeof view == 'function' ) {
  12819. // If `view` is already a function, don't do anything.
  12820. return view;
  12821. }
  12822. return ( modelData, conversionApi ) => createViewElementFromDefinition( view, conversionApi, viewElementType );
  12823. }
  12824. // Creates a view element instance from the provided {@link module:engine/view/elementdefinition~ElementDefinition} and class.
  12825. //
  12826. // @param {module:engine/view/elementdefinition~ElementDefinition} viewElementDefinition
  12827. // @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter
  12828. // @param {'container'|'attribute'|'ui'} viewElementType
  12829. // @returns {module:engine/view/element~Element}
  12830. function createViewElementFromDefinition( viewElementDefinition, conversionApi, viewElementType ) {
  12831. if ( typeof viewElementDefinition == 'string' ) {
  12832. // If `viewElementDefinition` is given as a `String`, normalize it to an object with `name` property.
  12833. viewElementDefinition = { name: viewElementDefinition };
  12834. }
  12835. let element;
  12836. const viewWriter = conversionApi.writer;
  12837. const attributes = Object.assign( {}, viewElementDefinition.attributes );
  12838. if ( viewElementType == 'container' ) {
  12839. element = viewWriter.createContainerElement( viewElementDefinition.name, attributes );
  12840. } else if ( viewElementType == 'attribute' ) {
  12841. const options = {
  12842. priority: viewElementDefinition.priority || _view_attributeelement__WEBPACK_IMPORTED_MODULE_3__["default"].DEFAULT_PRIORITY
  12843. };
  12844. element = viewWriter.createAttributeElement( viewElementDefinition.name, attributes, options );
  12845. } else {
  12846. // 'ui'.
  12847. element = viewWriter.createUIElement( viewElementDefinition.name, attributes );
  12848. }
  12849. if ( viewElementDefinition.styles ) {
  12850. const keys = Object.keys( viewElementDefinition.styles );
  12851. for ( const key of keys ) {
  12852. viewWriter.setStyle( key, viewElementDefinition.styles[ key ], element );
  12853. }
  12854. }
  12855. if ( viewElementDefinition.classes ) {
  12856. const classes = viewElementDefinition.classes;
  12857. if ( typeof classes == 'string' ) {
  12858. viewWriter.addClass( classes, element );
  12859. } else {
  12860. for ( const className of classes ) {
  12861. viewWriter.addClass( className, element );
  12862. }
  12863. }
  12864. }
  12865. return element;
  12866. }
  12867. function getFromAttributeCreator( config ) {
  12868. if ( config.model.values ) {
  12869. return ( modelAttributeValue, conversionApi ) => {
  12870. const view = config.view[ modelAttributeValue ];
  12871. if ( view ) {
  12872. return view( modelAttributeValue, conversionApi );
  12873. }
  12874. return null;
  12875. };
  12876. } else {
  12877. return config.view;
  12878. }
  12879. }
  12880. // Takes the configuration, adds default parameters if they do not exist and normalizes other parameters to be used in downcast converters
  12881. // for generating a view attribute.
  12882. //
  12883. // @param {Object} view View configuration.
  12884. function normalizeToAttributeConfig( view ) {
  12885. if ( typeof view == 'string' ) {
  12886. return modelAttributeValue => ( { key: view, value: modelAttributeValue } );
  12887. } else if ( typeof view == 'object' ) {
  12888. // { key, value, ... }
  12889. if ( view.value ) {
  12890. return () => view;
  12891. }
  12892. // { key, ... }
  12893. else {
  12894. return modelAttributeValue => ( { key: view.key, value: modelAttributeValue } );
  12895. }
  12896. } else {
  12897. // function.
  12898. return view;
  12899. }
  12900. }
  12901. // Helper function for `highlight`. Prepares the actual descriptor object using value passed to the converter.
  12902. function prepareDescriptor( highlightDescriptor, data, conversionApi ) {
  12903. // If passed descriptor is a creator function, call it. If not, just use passed value.
  12904. const descriptor = typeof highlightDescriptor == 'function' ?
  12905. highlightDescriptor( data, conversionApi ) :
  12906. highlightDescriptor;
  12907. if ( !descriptor ) {
  12908. return null;
  12909. }
  12910. // Apply default descriptor priority.
  12911. if ( !descriptor.priority ) {
  12912. descriptor.priority = 10;
  12913. }
  12914. // Default descriptor id is marker name.
  12915. if ( !descriptor.id ) {
  12916. descriptor.id = data.markerName;
  12917. }
  12918. return descriptor;
  12919. }
  12920. /**
  12921. * An object describing how the marker highlight should be represented in the view.
  12922. *
  12923. * Each text node contained in a highlighted range will be wrapped in a `<span>`
  12924. * {@link module:engine/view/attributeelement~AttributeElement view attribute element} with CSS class(es), attributes and a priority
  12925. * described by this object.
  12926. *
  12927. * Additionally, each {@link module:engine/view/containerelement~ContainerElement container element} can handle displaying the highlight
  12928. * separately by providing the `addHighlight` and `removeHighlight` custom properties. In this case:
  12929. *
  12930. * * The `HighlightDescriptor` object is passed to the `addHighlight` function upon conversion and should be used to apply the highlight to
  12931. * the element.
  12932. * * The descriptor `id` is passed to the `removeHighlight` function upon conversion and should be used to remove the highlight with the
  12933. * given ID from the element.
  12934. *
  12935. * @typedef {Object} module:engine/conversion/downcasthelpers~HighlightDescriptor
  12936. *
  12937. * @property {String|Array.<String>} classes A CSS class or an array of classes to set. If the descriptor is used to
  12938. * create an {@link module:engine/view/attributeelement~AttributeElement attribute element} over text nodes, these classes will be set
  12939. * on that attribute element. If the descriptor is applied to an element, usually these classes will be set on that element, however,
  12940. * this depends on how the element converts the descriptor.
  12941. *
  12942. * @property {String} [id] Descriptor identifier. If not provided, it defaults to the converted marker's name.
  12943. *
  12944. * @property {Number} [priority] Descriptor priority. If not provided, it defaults to `10`. If the descriptor is used to create
  12945. * an {@link module:engine/view/attributeelement~AttributeElement attribute element}, it will be that element's
  12946. * {@link module:engine/view/attributeelement~AttributeElement#priority priority}. If the descriptor is applied to an element,
  12947. * the priority will be used to determine which descriptor is more important.
  12948. *
  12949. * @property {Object} [attributes] Attributes to set. If the descriptor is used to create
  12950. * an {@link module:engine/view/attributeelement~AttributeElement attribute element} over text nodes, these attributes will be set on that
  12951. * attribute element. If the descriptor is applied to an element, usually these attributes will be set on that element, however,
  12952. * this depends on how the element converts the descriptor.
  12953. */
  12954. /***/ }),
  12955. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js":
  12956. /*!**************************************************************************!*\
  12957. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js ***!
  12958. \**************************************************************************/
  12959. /*! exports provided: default */
  12960. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12961. "use strict";
  12962. __webpack_require__.r(__webpack_exports__);
  12963. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Mapper; });
  12964. /* harmony import */ var _model_position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../model/position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  12965. /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  12966. /* harmony import */ var _view_position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../view/position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  12967. /* harmony import */ var _view_range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../view/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  12968. /* harmony import */ var _view_text__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../view/text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  12969. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  12970. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  12971. /**
  12972. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  12973. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  12974. */
  12975. /**
  12976. * @module engine/conversion/mapper
  12977. */
  12978. /**
  12979. * Maps elements, positions and markers between {@link module:engine/view/document~Document the view} and
  12980. * {@link module:engine/model/model the model}.
  12981. *
  12982. * The instance of the Mapper used for the editing pipeline is available in
  12983. * {@link module:engine/controller/editingcontroller~EditingController#mapper `editor.editing.mapper`}.
  12984. *
  12985. * Mapper uses bound elements to find corresponding elements and positions, so, to get proper results,
  12986. * all model elements should be {@link module:engine/conversion/mapper~Mapper#bindElements bound}.
  12987. *
  12988. * To map complex model to/from view relations, you may provide custom callbacks for
  12989. * {@link module:engine/conversion/mapper~Mapper#event:modelToViewPosition modelToViewPosition event} and
  12990. * {@link module:engine/conversion/mapper~Mapper#event:viewToModelPosition viewToModelPosition event} that are fired whenever
  12991. * a position mapping request occurs.
  12992. * Those events are fired by {@link module:engine/conversion/mapper~Mapper#toViewPosition toViewPosition}
  12993. * and {@link module:engine/conversion/mapper~Mapper#toModelPosition toModelPosition} methods. `Mapper` adds it's own default callbacks
  12994. * with `'lowest'` priority. To override default `Mapper` mapping, add custom callback with higher priority and
  12995. * stop the event.
  12996. * @mixes module:utils/emittermixin~EmitterMixin
  12997. */
  12998. class Mapper {
  12999. /**
  13000. * Creates an instance of the mapper.
  13001. */
  13002. constructor() {
  13003. /**
  13004. * Model element to view element mapping.
  13005. *
  13006. * @private
  13007. * @member {WeakMap}
  13008. */
  13009. this._modelToViewMapping = new WeakMap();
  13010. /**
  13011. * View element to model element mapping.
  13012. *
  13013. * @private
  13014. * @member {WeakMap}
  13015. */
  13016. this._viewToModelMapping = new WeakMap();
  13017. /**
  13018. * A map containing callbacks between view element names and functions evaluating length of view elements
  13019. * in model.
  13020. *
  13021. * @private
  13022. * @member {Map}
  13023. */
  13024. this._viewToModelLengthCallbacks = new Map();
  13025. /**
  13026. * Model marker name to view elements mapping.
  13027. *
  13028. * Keys are `String`s while values are `Set`s with {@link module:engine/view/element~Element view elements}.
  13029. * One marker (name) can be mapped to multiple elements.
  13030. *
  13031. * @private
  13032. * @member {Map}
  13033. */
  13034. this._markerNameToElements = new Map();
  13035. /**
  13036. * View element to model marker names mapping.
  13037. *
  13038. * This is reverse to {@link ~Mapper#_markerNameToElements} map.
  13039. *
  13040. * @private
  13041. * @member {Map}
  13042. */
  13043. this._elementToMarkerNames = new Map();
  13044. /**
  13045. * Stores marker names of markers which has changed due to unbinding a view element (so it is assumed that the view element
  13046. * has been removed, moved or renamed).
  13047. *
  13048. * @private
  13049. * @member {Set.<module:engine/model/markercollection~Marker>}
  13050. */
  13051. this._unboundMarkerNames = new Set();
  13052. // Default mapper algorithm for mapping model position to view position.
  13053. this.on( 'modelToViewPosition', ( evt, data ) => {
  13054. if ( data.viewPosition ) {
  13055. return;
  13056. }
  13057. const viewContainer = this._modelToViewMapping.get( data.modelPosition.parent );
  13058. data.viewPosition = this.findPositionIn( viewContainer, data.modelPosition.offset );
  13059. }, { priority: 'low' } );
  13060. // Default mapper algorithm for mapping view position to model position.
  13061. this.on( 'viewToModelPosition', ( evt, data ) => {
  13062. if ( data.modelPosition ) {
  13063. return;
  13064. }
  13065. const viewBlock = this.findMappedViewAncestor( data.viewPosition );
  13066. const modelParent = this._viewToModelMapping.get( viewBlock );
  13067. const modelOffset = this._toModelOffset( data.viewPosition.parent, data.viewPosition.offset, viewBlock );
  13068. data.modelPosition = _model_position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( modelParent, modelOffset );
  13069. }, { priority: 'low' } );
  13070. }
  13071. /**
  13072. * Marks model and view elements as corresponding. Corresponding elements can be retrieved by using
  13073. * the {@link module:engine/conversion/mapper~Mapper#toModelElement toModelElement} and
  13074. * {@link module:engine/conversion/mapper~Mapper#toViewElement toViewElement} methods.
  13075. * The information that elements are bound is also used to translate positions.
  13076. *
  13077. * @param {module:engine/model/element~Element} modelElement Model element.
  13078. * @param {module:engine/view/element~Element} viewElement View element.
  13079. */
  13080. bindElements( modelElement, viewElement ) {
  13081. this._modelToViewMapping.set( modelElement, viewElement );
  13082. this._viewToModelMapping.set( viewElement, modelElement );
  13083. }
  13084. /**
  13085. * Unbinds given {@link module:engine/view/element~Element view element} from the map.
  13086. *
  13087. * **Note:** view-to-model binding will be removed, if it existed. However, corresponding model-to-view binding
  13088. * will be removed only if model element is still bound to passed `viewElement`.
  13089. *
  13090. * This behavior lets for re-binding model element to another view element without fear of losing the new binding
  13091. * when the previously bound view element is unbound.
  13092. *
  13093. * @param {module:engine/view/element~Element} viewElement View element to unbind.
  13094. */
  13095. unbindViewElement( viewElement ) {
  13096. const modelElement = this.toModelElement( viewElement );
  13097. this._viewToModelMapping.delete( viewElement );
  13098. if ( this._elementToMarkerNames.has( viewElement ) ) {
  13099. for ( const markerName of this._elementToMarkerNames.get( viewElement ) ) {
  13100. this._unboundMarkerNames.add( markerName );
  13101. }
  13102. }
  13103. if ( this._modelToViewMapping.get( modelElement ) == viewElement ) {
  13104. this._modelToViewMapping.delete( modelElement );
  13105. }
  13106. }
  13107. /**
  13108. * Unbinds given {@link module:engine/model/element~Element model element} from the map.
  13109. *
  13110. * **Note:** model-to-view binding will be removed, if it existed. However, corresponding view-to-model binding
  13111. * will be removed only if view element is still bound to passed `modelElement`.
  13112. *
  13113. * This behavior lets for re-binding view element to another model element without fear of losing the new binding
  13114. * when the previously bound model element is unbound.
  13115. *
  13116. * @param {module:engine/model/element~Element} modelElement Model element to unbind.
  13117. */
  13118. unbindModelElement( modelElement ) {
  13119. const viewElement = this.toViewElement( modelElement );
  13120. this._modelToViewMapping.delete( modelElement );
  13121. if ( this._viewToModelMapping.get( viewElement ) == modelElement ) {
  13122. this._viewToModelMapping.delete( viewElement );
  13123. }
  13124. }
  13125. /**
  13126. * Binds given marker name with given {@link module:engine/view/element~Element view element}. The element
  13127. * will be added to the current set of elements bound with given marker name.
  13128. *
  13129. * @param {module:engine/view/element~Element} element Element to bind.
  13130. * @param {String} name Marker name.
  13131. */
  13132. bindElementToMarker( element, name ) {
  13133. const elements = this._markerNameToElements.get( name ) || new Set();
  13134. elements.add( element );
  13135. const names = this._elementToMarkerNames.get( element ) || new Set();
  13136. names.add( name );
  13137. this._markerNameToElements.set( name, elements );
  13138. this._elementToMarkerNames.set( element, names );
  13139. }
  13140. /**
  13141. * Unbinds an element from given marker name.
  13142. *
  13143. * @param {module:engine/view/element~Element} element Element to unbind.
  13144. * @param {String} name Marker name.
  13145. */
  13146. unbindElementFromMarkerName( element, name ) {
  13147. const nameToElements = this._markerNameToElements.get( name );
  13148. if ( nameToElements ) {
  13149. nameToElements.delete( element );
  13150. if ( nameToElements.size == 0 ) {
  13151. this._markerNameToElements.delete( name );
  13152. }
  13153. }
  13154. const elementToNames = this._elementToMarkerNames.get( element );
  13155. if ( elementToNames ) {
  13156. elementToNames.delete( name );
  13157. if ( elementToNames.size == 0 ) {
  13158. this._elementToMarkerNames.delete( element );
  13159. }
  13160. }
  13161. }
  13162. /**
  13163. * Returns all marker names of markers which has changed due to unbinding a view element (so it is assumed that the view element
  13164. * has been removed, moved or renamed) since the last flush. After returning, the marker names list is cleared.
  13165. *
  13166. * @returns {Array.<String>}
  13167. */
  13168. flushUnboundMarkerNames() {
  13169. const markerNames = Array.from( this._unboundMarkerNames );
  13170. this._unboundMarkerNames.clear();
  13171. return markerNames;
  13172. }
  13173. /**
  13174. * Removes all model to view and view to model bindings.
  13175. */
  13176. clearBindings() {
  13177. this._modelToViewMapping = new WeakMap();
  13178. this._viewToModelMapping = new WeakMap();
  13179. this._markerNameToElements = new Map();
  13180. this._elementToMarkerNames = new Map();
  13181. this._unboundMarkerNames = new Set();
  13182. }
  13183. /**
  13184. * Gets the corresponding model element.
  13185. *
  13186. * **Note:** {@link module:engine/view/uielement~UIElement} does not have corresponding element in model.
  13187. *
  13188. * @param {module:engine/view/element~Element} viewElement View element.
  13189. * @returns {module:engine/model/element~Element|undefined} Corresponding model element or `undefined` if not found.
  13190. */
  13191. toModelElement( viewElement ) {
  13192. return this._viewToModelMapping.get( viewElement );
  13193. }
  13194. /**
  13195. * Gets the corresponding view element.
  13196. *
  13197. * @param {module:engine/model/element~Element} modelElement Model element.
  13198. * @returns {module:engine/view/element~Element|undefined} Corresponding view element or `undefined` if not found.
  13199. */
  13200. toViewElement( modelElement ) {
  13201. return this._modelToViewMapping.get( modelElement );
  13202. }
  13203. /**
  13204. * Gets the corresponding model range.
  13205. *
  13206. * @param {module:engine/view/range~Range} viewRange View range.
  13207. * @returns {module:engine/model/range~Range} Corresponding model range.
  13208. */
  13209. toModelRange( viewRange ) {
  13210. return new _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]( this.toModelPosition( viewRange.start ), this.toModelPosition( viewRange.end ) );
  13211. }
  13212. /**
  13213. * Gets the corresponding view range.
  13214. *
  13215. * @param {module:engine/model/range~Range} modelRange Model range.
  13216. * @returns {module:engine/view/range~Range} Corresponding view range.
  13217. */
  13218. toViewRange( modelRange ) {
  13219. return new _view_range__WEBPACK_IMPORTED_MODULE_3__["default"]( this.toViewPosition( modelRange.start ), this.toViewPosition( modelRange.end ) );
  13220. }
  13221. /**
  13222. * Gets the corresponding model position.
  13223. *
  13224. * @fires viewToModelPosition
  13225. * @param {module:engine/view/position~Position} viewPosition View position.
  13226. * @returns {module:engine/model/position~Position} Corresponding model position.
  13227. */
  13228. toModelPosition( viewPosition ) {
  13229. const data = {
  13230. viewPosition,
  13231. mapper: this
  13232. };
  13233. this.fire( 'viewToModelPosition', data );
  13234. return data.modelPosition;
  13235. }
  13236. /**
  13237. * Gets the corresponding view position.
  13238. *
  13239. * @fires modelToViewPosition
  13240. * @param {module:engine/model/position~Position} modelPosition Model position.
  13241. * @param {Object} [options] Additional options for position mapping process.
  13242. * @param {Boolean} [options.isPhantom=false] Should be set to `true` if the model position to map is pointing to a place
  13243. * in model tree which no longer exists. For example, it could be an end of a removed model range.
  13244. * @returns {module:engine/view/position~Position} Corresponding view position.
  13245. */
  13246. toViewPosition( modelPosition, options = { isPhantom: false } ) {
  13247. const data = {
  13248. modelPosition,
  13249. mapper: this,
  13250. isPhantom: options.isPhantom
  13251. };
  13252. this.fire( 'modelToViewPosition', data );
  13253. return data.viewPosition;
  13254. }
  13255. /**
  13256. * Gets all view elements bound to the given marker name.
  13257. *
  13258. * @param {String} name Marker name.
  13259. * @returns {Set.<module:engine/view/element~Element>|null} View elements bound with given marker name or `null`
  13260. * if no elements are bound to given marker name.
  13261. */
  13262. markerNameToElements( name ) {
  13263. const boundElements = this._markerNameToElements.get( name );
  13264. if ( !boundElements ) {
  13265. return null;
  13266. }
  13267. const elements = new Set();
  13268. for ( const element of boundElements ) {
  13269. if ( element.is( 'attributeElement' ) ) {
  13270. for ( const clone of element.getElementsWithSameId() ) {
  13271. elements.add( clone );
  13272. }
  13273. } else {
  13274. elements.add( element );
  13275. }
  13276. }
  13277. return elements;
  13278. }
  13279. /**
  13280. * Registers a callback that evaluates the length in the model of a view element with given name.
  13281. *
  13282. * The callback is fired with one argument, which is a view element instance. The callback is expected to return
  13283. * a number representing the length of view element in model.
  13284. *
  13285. * // List item in view may contain nested list, which have other list items. In model though,
  13286. * // the lists are represented by flat structure. Because of those differences, length of list view element
  13287. * // may be greater than one. In the callback it's checked how many nested list items are in evaluated list item.
  13288. *
  13289. * function getViewListItemLength( element ) {
  13290. * let length = 1;
  13291. *
  13292. * for ( let child of element.getChildren() ) {
  13293. * if ( child.name == 'ul' || child.name == 'ol' ) {
  13294. * for ( let item of child.getChildren() ) {
  13295. * length += getViewListItemLength( item );
  13296. * }
  13297. * }
  13298. * }
  13299. *
  13300. * return length;
  13301. * }
  13302. *
  13303. * mapper.registerViewToModelLength( 'li', getViewListItemLength );
  13304. *
  13305. * @param {String} viewElementName Name of view element for which callback is registered.
  13306. * @param {Function} lengthCallback Function return a length of view element instance in model.
  13307. */
  13308. registerViewToModelLength( viewElementName, lengthCallback ) {
  13309. this._viewToModelLengthCallbacks.set( viewElementName, lengthCallback );
  13310. }
  13311. /**
  13312. * For given `viewPosition`, finds and returns the closest ancestor of this position that has a mapping to
  13313. * the model.
  13314. *
  13315. * @param {module:engine/view/position~Position} viewPosition Position for which mapped ancestor should be found.
  13316. * @returns {module:engine/view/element~Element}
  13317. */
  13318. findMappedViewAncestor( viewPosition ) {
  13319. let parent = viewPosition.parent;
  13320. while ( !this._viewToModelMapping.has( parent ) ) {
  13321. parent = parent.parent;
  13322. }
  13323. return parent;
  13324. }
  13325. /**
  13326. * Calculates model offset based on the view position and the block element.
  13327. *
  13328. * Example:
  13329. *
  13330. * <p>foo<b>ba|r</b></p> // _toModelOffset( b, 2, p ) -> 5
  13331. *
  13332. * Is a sum of:
  13333. *
  13334. * <p>foo|<b>bar</b></p> // _toModelOffset( p, 3, p ) -> 3
  13335. * <p>foo<b>ba|r</b></p> // _toModelOffset( b, 2, b ) -> 2
  13336. *
  13337. * @private
  13338. * @param {module:engine/view/element~Element} viewParent Position parent.
  13339. * @param {Number} viewOffset Position offset.
  13340. * @param {module:engine/view/element~Element} viewBlock Block used as a base to calculate offset.
  13341. * @returns {Number} Offset in the model.
  13342. */
  13343. _toModelOffset( viewParent, viewOffset, viewBlock ) {
  13344. if ( viewBlock != viewParent ) {
  13345. // See example.
  13346. const offsetToParentStart = this._toModelOffset( viewParent.parent, viewParent.index, viewBlock );
  13347. const offsetInParent = this._toModelOffset( viewParent, viewOffset, viewParent );
  13348. return offsetToParentStart + offsetInParent;
  13349. }
  13350. // viewBlock == viewParent, so we need to calculate the offset in the parent element.
  13351. // If the position is a text it is simple ("ba|r" -> 2).
  13352. if ( viewParent.is( '$text' ) ) {
  13353. return viewOffset;
  13354. }
  13355. // If the position is in an element we need to sum lengths of siblings ( <b> bar </b> foo | -> 3 + 3 = 6 ).
  13356. let modelOffset = 0;
  13357. for ( let i = 0; i < viewOffset; i++ ) {
  13358. modelOffset += this.getModelLength( viewParent.getChild( i ) );
  13359. }
  13360. return modelOffset;
  13361. }
  13362. /**
  13363. * Gets the length of the view element in the model.
  13364. *
  13365. * The length is calculated as follows:
  13366. * * if {@link #registerViewToModelLength length mapping callback} is provided for given `viewNode` it is used to
  13367. * evaluate model length (`viewNode` is used as first and only parameter passed to the callback),
  13368. * * length of a {@link module:engine/view/text~Text text node} is equal to the length of it's
  13369. * {@link module:engine/view/text~Text#data data},
  13370. * * length of a {@link module:engine/view/uielement~UIElement ui element} is equal to 0,
  13371. * * length of a mapped {@link module:engine/view/element~Element element} is equal to 1,
  13372. * * length of a not-mapped {@link module:engine/view/element~Element element} is equal to the length of it's children.
  13373. *
  13374. * Examples:
  13375. *
  13376. * foo -> 3 // Text length is equal to it's data length.
  13377. * <p>foo</p> -> 1 // Length of an element which is mapped is by default equal to 1.
  13378. * <b>foo</b> -> 3 // Length of an element which is not mapped is a length of its children.
  13379. * <div><p>x</p><p>y</p></div> -> 2 // Assuming that <div> is not mapped and <p> are mapped.
  13380. *
  13381. * @param {module:engine/view/element~Element} viewNode View node.
  13382. * @returns {Number} Length of the node in the tree model.
  13383. */
  13384. getModelLength( viewNode ) {
  13385. if ( this._viewToModelLengthCallbacks.get( viewNode.name ) ) {
  13386. const callback = this._viewToModelLengthCallbacks.get( viewNode.name );
  13387. return callback( viewNode );
  13388. } else if ( this._viewToModelMapping.has( viewNode ) ) {
  13389. return 1;
  13390. } else if ( viewNode.is( '$text' ) ) {
  13391. return viewNode.data.length;
  13392. } else if ( viewNode.is( 'uiElement' ) ) {
  13393. return 0;
  13394. } else {
  13395. let len = 0;
  13396. for ( const child of viewNode.getChildren() ) {
  13397. len += this.getModelLength( child );
  13398. }
  13399. return len;
  13400. }
  13401. }
  13402. /**
  13403. * Finds the position in the view node (or its children) with the expected model offset.
  13404. *
  13405. * Example:
  13406. *
  13407. * <p>fo<b>bar</b>bom</p> -> expected offset: 4
  13408. *
  13409. * findPositionIn( p, 4 ):
  13410. * <p>|fo<b>bar</b>bom</p> -> expected offset: 4, actual offset: 0
  13411. * <p>fo|<b>bar</b>bom</p> -> expected offset: 4, actual offset: 2
  13412. * <p>fo<b>bar</b>|bom</p> -> expected offset: 4, actual offset: 5 -> we are too far
  13413. *
  13414. * findPositionIn( b, 4 - ( 5 - 3 ) ):
  13415. * <p>fo<b>|bar</b>bom</p> -> expected offset: 2, actual offset: 0
  13416. * <p>fo<b>bar|</b>bom</p> -> expected offset: 2, actual offset: 3 -> we are too far
  13417. *
  13418. * findPositionIn( bar, 2 - ( 3 - 3 ) ):
  13419. * We are in the text node so we can simple find the offset.
  13420. * <p>fo<b>ba|r</b>bom</p> -> expected offset: 2, actual offset: 2 -> position found
  13421. *
  13422. * @param {module:engine/view/element~Element} viewParent Tree view element in which we are looking for the position.
  13423. * @param {Number} expectedOffset Expected offset.
  13424. * @returns {module:engine/view/position~Position} Found position.
  13425. */
  13426. findPositionIn( viewParent, expectedOffset ) {
  13427. // Last scanned view node.
  13428. let viewNode;
  13429. // Length of the last scanned view node.
  13430. let lastLength = 0;
  13431. let modelOffset = 0;
  13432. let viewOffset = 0;
  13433. // In the text node it is simple: offset in the model equals offset in the text.
  13434. if ( viewParent.is( '$text' ) ) {
  13435. return new _view_position__WEBPACK_IMPORTED_MODULE_2__["default"]( viewParent, expectedOffset );
  13436. }
  13437. // In other cases we add lengths of child nodes to find the proper offset.
  13438. // If it is smaller we add the length.
  13439. while ( modelOffset < expectedOffset ) {
  13440. viewNode = viewParent.getChild( viewOffset );
  13441. lastLength = this.getModelLength( viewNode );
  13442. modelOffset += lastLength;
  13443. viewOffset++;
  13444. }
  13445. // If it equals we found the position.
  13446. if ( modelOffset == expectedOffset ) {
  13447. return this._moveViewPositionToTextNode( new _view_position__WEBPACK_IMPORTED_MODULE_2__["default"]( viewParent, viewOffset ) );
  13448. }
  13449. // If it is higher we need to enter last child.
  13450. else {
  13451. // ( modelOffset - lastLength ) is the offset to the child we enter,
  13452. // so we subtract it from the expected offset to fine the offset in the child.
  13453. return this.findPositionIn( viewNode, expectedOffset - ( modelOffset - lastLength ) );
  13454. }
  13455. }
  13456. /**
  13457. * Because we prefer positions in text nodes over positions next to text node moves view position to the text node
  13458. * if it was next to it.
  13459. *
  13460. * <p>[]<b>foo</b></p> -> <p>[]<b>foo</b></p> // do not touch if position is not directly next to text
  13461. * <p>foo[]<b>foo</b></p> -> <p>foo{}<b>foo</b></p> // move to text node
  13462. * <p><b>[]foo</b></p> -> <p><b>{}foo</b></p> // move to text node
  13463. *
  13464. * @private
  13465. * @param {module:engine/view/position~Position} viewPosition Position potentially next to text node.
  13466. * @returns {module:engine/view/position~Position} Position in text node if possible.
  13467. */
  13468. _moveViewPositionToTextNode( viewPosition ) {
  13469. // If the position is just after text node, put it at the end of that text node.
  13470. // If the position is just before text node, put it at the beginning of that text node.
  13471. const nodeBefore = viewPosition.nodeBefore;
  13472. const nodeAfter = viewPosition.nodeAfter;
  13473. if ( nodeBefore instanceof _view_text__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  13474. return new _view_position__WEBPACK_IMPORTED_MODULE_2__["default"]( nodeBefore, nodeBefore.data.length );
  13475. } else if ( nodeAfter instanceof _view_text__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  13476. return new _view_position__WEBPACK_IMPORTED_MODULE_2__["default"]( nodeAfter, 0 );
  13477. }
  13478. // Otherwise, just return the given position.
  13479. return viewPosition;
  13480. }
  13481. /**
  13482. * Fired for each model-to-view position mapping request. The purpose of this event is to enable custom model-to-view position
  13483. * mapping. Callbacks added to this event take {@link module:engine/model/position~Position model position} and are expected to
  13484. * calculate {@link module:engine/view/position~Position view position}. Calculated view position should be added as `viewPosition`
  13485. * value in `data` object that is passed as one of parameters to the event callback.
  13486. *
  13487. * // Assume that "captionedImage" model element is converted to <img> and following <span> elements in view,
  13488. * // and the model element is bound to <img> element. Force mapping model positions inside "captionedImage" to that
  13489. * // <span> element.
  13490. * mapper.on( 'modelToViewPosition', ( evt, data ) => {
  13491. * const positionParent = modelPosition.parent;
  13492. *
  13493. * if ( positionParent.name == 'captionedImage' ) {
  13494. * const viewImg = data.mapper.toViewElement( positionParent );
  13495. * const viewCaption = viewImg.nextSibling; // The <span> element.
  13496. *
  13497. * data.viewPosition = new ViewPosition( viewCaption, modelPosition.offset );
  13498. *
  13499. * // Stop the event if other callbacks should not modify calculated value.
  13500. * evt.stop();
  13501. * }
  13502. * } );
  13503. *
  13504. * **Note:** keep in mind that sometimes a "phantom" model position is being converted. "Phantom" model position is
  13505. * a position that points to a non-existing place in model. Such position might still be valid for conversion, though
  13506. * (it would point to a correct place in view when converted). One example of such situation is when a range is
  13507. * removed from model, there may be a need to map the range's end (which is no longer valid model position). To
  13508. * handle such situation, check `data.isPhantom` flag:
  13509. *
  13510. * // Assume that there is "customElement" model element and whenever position is before it, we want to move it
  13511. * // to the inside of the view element bound to "customElement".
  13512. * mapper.on( 'modelToViewPosition', ( evt, data ) => {
  13513. * if ( data.isPhantom ) {
  13514. * return;
  13515. * }
  13516. *
  13517. * // Below line might crash for phantom position that does not exist in model.
  13518. * const sibling = data.modelPosition.nodeBefore;
  13519. *
  13520. * // Check if this is the element we are interested in.
  13521. * if ( !sibling.is( 'element', 'customElement' ) ) {
  13522. * return;
  13523. * }
  13524. *
  13525. * const viewElement = data.mapper.toViewElement( sibling );
  13526. *
  13527. * data.viewPosition = new ViewPosition( sibling, 0 );
  13528. *
  13529. * evt.stop();
  13530. * } );
  13531. *
  13532. * **Note:** default mapping callback is provided with `low` priority setting and does not cancel the event, so it is possible to
  13533. * attach a custom callback after default callback and also use `data.viewPosition` calculated by default callback
  13534. * (for example to fix it).
  13535. *
  13536. * **Note:** default mapping callback will not fire if `data.viewPosition` is already set.
  13537. *
  13538. * **Note:** these callbacks are called **very often**. For efficiency reasons, it is advised to use them only when position
  13539. * mapping between given model and view elements is unsolvable using just elements mapping and default algorithm. Also,
  13540. * the condition that checks if special case scenario happened should be as simple as possible.
  13541. *
  13542. * @event modelToViewPosition
  13543. * @param {Object} data Data pipeline object that can store and pass data between callbacks. The callback should add
  13544. * `viewPosition` value to that object with calculated {@link module:engine/view/position~Position view position}.
  13545. * @param {module:engine/conversion/mapper~Mapper} data.mapper Mapper instance that fired the event.
  13546. */
  13547. /**
  13548. * Fired for each view-to-model position mapping request. See {@link module:engine/conversion/mapper~Mapper#event:modelToViewPosition}.
  13549. *
  13550. * // See example in `modelToViewPosition` event description.
  13551. * // This custom mapping will map positions from <span> element next to <img> to the "captionedImage" element.
  13552. * mapper.on( 'viewToModelPosition', ( evt, data ) => {
  13553. * const positionParent = viewPosition.parent;
  13554. *
  13555. * if ( positionParent.hasClass( 'image-caption' ) ) {
  13556. * const viewImg = positionParent.previousSibling;
  13557. * const modelImg = data.mapper.toModelElement( viewImg );
  13558. *
  13559. * data.modelPosition = new ModelPosition( modelImg, viewPosition.offset );
  13560. * evt.stop();
  13561. * }
  13562. * } );
  13563. *
  13564. * **Note:** default mapping callback is provided with `low` priority setting and does not cancel the event, so it is possible to
  13565. * attach a custom callback after default callback and also use `data.modelPosition` calculated by default callback
  13566. * (for example to fix it).
  13567. *
  13568. * **Note:** default mapping callback will not fire if `data.modelPosition` is already set.
  13569. *
  13570. * **Note:** these callbacks are called **very often**. For efficiency reasons, it is advised to use them only when position
  13571. * mapping between given model and view elements is unsolvable using just elements mapping and default algorithm. Also,
  13572. * the condition that checks if special case scenario happened should be as simple as possible.
  13573. *
  13574. * @event viewToModelPosition
  13575. * @param {Object} data Data pipeline object that can store and pass data between callbacks. The callback should add
  13576. * `modelPosition` value to that object with calculated {@link module:engine/model/position~Position model position}.
  13577. * @param {module:engine/conversion/mapper~Mapper} data.mapper Mapper instance that fired the event.
  13578. */
  13579. }
  13580. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( Mapper, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_5__["default"] );
  13581. /***/ }),
  13582. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/modelconsumable.js":
  13583. /*!***********************************************************************************!*\
  13584. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/modelconsumable.js ***!
  13585. \***********************************************************************************/
  13586. /*! exports provided: default */
  13587. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13588. "use strict";
  13589. __webpack_require__.r(__webpack_exports__);
  13590. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ModelConsumable; });
  13591. /* harmony import */ var _model_textproxy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../model/textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  13592. /**
  13593. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  13594. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  13595. */
  13596. /**
  13597. * @module engine/conversion/modelconsumable
  13598. */
  13599. /**
  13600. * Manages a list of consumable values for {@link module:engine/model/item~Item model items}.
  13601. *
  13602. * Consumables are various aspects of the model. A model item can be broken down into singular properties that might be
  13603. * taken into consideration when converting that item.
  13604. *
  13605. * `ModelConsumable` is used by {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} while analyzing changed
  13606. * parts of {@link module:engine/model/document~Document the document}. The added / changed / removed model items are broken down
  13607. * into singular properties (the item itself and it's attributes). All those parts are saved in `ModelConsumable`. Then,
  13608. * during conversion, when given part of model item is converted (i.e. the view element has been inserted into the view,
  13609. * but without attributes), consumable value is removed from `ModelConsumable`.
  13610. *
  13611. * For model items, `ModelConsumable` stores consumable values of one of following types: `insert`, `addattribute:<attributeKey>`,
  13612. * `changeattributes:<attributeKey>`, `removeattributes:<attributeKey>`.
  13613. *
  13614. * In most cases, it is enough to let {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}
  13615. * gather consumable values, so there is no need to use
  13616. * {@link module:engine/conversion/modelconsumable~ModelConsumable#add add method} directly.
  13617. * However, it is important to understand how consumable values can be
  13618. * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed}.
  13619. * See {@link module:engine/conversion/downcasthelpers default downcast converters} for more information.
  13620. *
  13621. * Keep in mind, that one conversion event may have multiple callbacks (converters) attached to it. Each of those is
  13622. * able to convert one or more parts of the model. However, when one of those callbacks actually converts
  13623. * something, other should not, because they would duplicate the results. Using `ModelConsumable` helps avoiding
  13624. * this situation, because callbacks should only convert those values, which were not yet consumed from `ModelConsumable`.
  13625. *
  13626. * Consuming multiple values in a single callback:
  13627. *
  13628. * // Converter for custom `imageBlock` element that might have a `caption` element inside which changes
  13629. * // how the image is displayed in the view:
  13630. * //
  13631. * // Model:
  13632. * //
  13633. * // [imageBlock]
  13634. * // └─ [caption]
  13635. * // └─ foo
  13636. * //
  13637. * // View:
  13638. * //
  13639. * // <figure>
  13640. * // ├─ <img />
  13641. * // └─ <caption>
  13642. * // └─ foo
  13643. * modelConversionDispatcher.on( 'insert:imageBlock', ( evt, data, conversionApi ) => {
  13644. * // First, consume the `imageBlock` element.
  13645. * conversionApi.consumable.consume( data.item, 'insert' );
  13646. *
  13647. * // Just create normal image element for the view.
  13648. * // Maybe it will be "decorated" later.
  13649. * const viewImage = new ViewElement( 'img' );
  13650. * const insertPosition = conversionApi.mapper.toViewPosition( data.range.start );
  13651. * const viewWriter = conversionApi.writer;
  13652. *
  13653. * // Check if the `imageBlock` element has children.
  13654. * if ( data.item.childCount > 0 ) {
  13655. * const modelCaption = data.item.getChild( 0 );
  13656. *
  13657. * // `modelCaption` insertion change is consumed from consumable values.
  13658. * // It will not be converted by other converters, but it's children (probably some text) will be.
  13659. * // Through mapping, converters for text will know where to insert contents of `modelCaption`.
  13660. * if ( conversionApi.consumable.consume( modelCaption, 'insert' ) ) {
  13661. * const viewCaption = new ViewElement( 'figcaption' );
  13662. *
  13663. * const viewImageHolder = new ViewElement( 'figure', null, [ viewImage, viewCaption ] );
  13664. *
  13665. * conversionApi.mapper.bindElements( modelCaption, viewCaption );
  13666. * conversionApi.mapper.bindElements( data.item, viewImageHolder );
  13667. * viewWriter.insert( insertPosition, viewImageHolder );
  13668. * }
  13669. * } else {
  13670. * conversionApi.mapper.bindElements( data.item, viewImage );
  13671. * viewWriter.insert( insertPosition, viewImage );
  13672. * }
  13673. *
  13674. * evt.stop();
  13675. * } );
  13676. */
  13677. class ModelConsumable {
  13678. /**
  13679. * Creates an empty consumables list.
  13680. */
  13681. constructor() {
  13682. /**
  13683. * Contains list of consumable values.
  13684. *
  13685. * @private
  13686. * @member {Map} module:engine/conversion/modelconsumable~ModelConsumable#_consumable
  13687. */
  13688. this._consumable = new Map();
  13689. /**
  13690. * For each {@link module:engine/model/textproxy~TextProxy} added to `ModelConsumable`, this registry holds parent
  13691. * of that `TextProxy` and start and end indices of that `TextProxy`. This allows identification of `TextProxy`
  13692. * instances that points to the same part of the model but are different instances. Each distinct `TextProxy`
  13693. * is given unique `Symbol` which is then registered as consumable. This process is transparent for `ModelConsumable`
  13694. * API user because whenever `TextProxy` is added, tested, consumed or reverted, internal mechanisms of
  13695. * `ModelConsumable` translates `TextProxy` to that unique `Symbol`.
  13696. *
  13697. * @private
  13698. * @member {Map} module:engine/conversion/modelconsumable~ModelConsumable#_textProxyRegistry
  13699. */
  13700. this._textProxyRegistry = new Map();
  13701. }
  13702. /**
  13703. * Adds a consumable value to the consumables list and links it with given model item.
  13704. *
  13705. * modelConsumable.add( modelElement, 'insert' ); // Add `modelElement` insertion change to consumable values.
  13706. * modelConsumable.add( modelElement, 'addAttribute:bold' ); // Add `bold` attribute insertion on `modelElement` change.
  13707. * modelConsumable.add( modelElement, 'removeAttribute:bold' ); // Add `bold` attribute removal on `modelElement` change.
  13708. * modelConsumable.add( modelSelection, 'selection' ); // Add `modelSelection` to consumable values.
  13709. * modelConsumable.add( modelRange, 'range' ); // Add `modelRange` to consumable values.
  13710. *
  13711. * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item
  13712. * Model item, range or selection that has the consumable.
  13713. * @param {String} type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.
  13714. * Second colon and everything after will be cut. Passing event name is a safe and good practice.
  13715. */
  13716. add( item, type ) {
  13717. type = _normalizeConsumableType( type );
  13718. if ( item instanceof _model_textproxy__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  13719. item = this._getSymbolForTextProxy( item );
  13720. }
  13721. if ( !this._consumable.has( item ) ) {
  13722. this._consumable.set( item, new Map() );
  13723. }
  13724. this._consumable.get( item ).set( type, true );
  13725. }
  13726. /**
  13727. * Removes given consumable value from given model item.
  13728. *
  13729. * modelConsumable.consume( modelElement, 'insert' ); // Remove `modelElement` insertion change from consumable values.
  13730. * modelConsumable.consume( modelElement, 'addAttribute:bold' ); // Remove `bold` attribute insertion on `modelElement` change.
  13731. * modelConsumable.consume( modelElement, 'removeAttribute:bold' ); // Remove `bold` attribute removal on `modelElement` change.
  13732. * modelConsumable.consume( modelSelection, 'selection' ); // Remove `modelSelection` from consumable values.
  13733. * modelConsumable.consume( modelRange, 'range' ); // Remove 'modelRange' from consumable values.
  13734. *
  13735. * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item
  13736. * Model item, range or selection from which consumable will be consumed.
  13737. * @param {String} type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.
  13738. * Second colon and everything after will be cut. Passing event name is a safe and good practice.
  13739. * @returns {Boolean} `true` if consumable value was available and was consumed, `false` otherwise.
  13740. */
  13741. consume( item, type ) {
  13742. type = _normalizeConsumableType( type );
  13743. if ( item instanceof _model_textproxy__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  13744. item = this._getSymbolForTextProxy( item );
  13745. }
  13746. if ( this.test( item, type ) ) {
  13747. this._consumable.get( item ).set( type, false );
  13748. return true;
  13749. } else {
  13750. return false;
  13751. }
  13752. }
  13753. /**
  13754. * Tests whether there is a consumable value of given type connected with given model item.
  13755. *
  13756. * modelConsumable.test( modelElement, 'insert' ); // Check for `modelElement` insertion change.
  13757. * modelConsumable.test( modelElement, 'addAttribute:bold' ); // Check for `bold` attribute insertion on `modelElement` change.
  13758. * modelConsumable.test( modelElement, 'removeAttribute:bold' ); // Check for `bold` attribute removal on `modelElement` change.
  13759. * modelConsumable.test( modelSelection, 'selection' ); // Check if `modelSelection` is consumable.
  13760. * modelConsumable.test( modelRange, 'range' ); // Check if `modelRange` is consumable.
  13761. *
  13762. * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item
  13763. * Model item, range or selection to be tested.
  13764. * @param {String} type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.
  13765. * Second colon and everything after will be cut. Passing event name is a safe and good practice.
  13766. * @returns {null|Boolean} `null` if such consumable was never added, `false` if the consumable values was
  13767. * already consumed or `true` if it was added and not consumed yet.
  13768. */
  13769. test( item, type ) {
  13770. type = _normalizeConsumableType( type );
  13771. if ( item instanceof _model_textproxy__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  13772. item = this._getSymbolForTextProxy( item );
  13773. }
  13774. const itemConsumables = this._consumable.get( item );
  13775. if ( itemConsumables === undefined ) {
  13776. return null;
  13777. }
  13778. const value = itemConsumables.get( type );
  13779. if ( value === undefined ) {
  13780. return null;
  13781. }
  13782. return value;
  13783. }
  13784. /**
  13785. * Reverts consuming of consumable value.
  13786. *
  13787. * modelConsumable.revert( modelElement, 'insert' ); // Revert consuming `modelElement` insertion change.
  13788. * modelConsumable.revert( modelElement, 'addAttribute:bold' ); // Revert consuming `bold` attribute insert from `modelElement`.
  13789. * modelConsumable.revert( modelElement, 'removeAttribute:bold' ); // Revert consuming `bold` attribute remove from `modelElement`.
  13790. * modelConsumable.revert( modelSelection, 'selection' ); // Revert consuming `modelSelection`.
  13791. * modelConsumable.revert( modelRange, 'range' ); // Revert consuming `modelRange`.
  13792. *
  13793. * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item
  13794. * Model item, range or selection to be reverted.
  13795. * @param {String} type Consumable type.
  13796. * @returns {null|Boolean} `true` if consumable has been reversed, `false` otherwise. `null` if the consumable has
  13797. * never been added.
  13798. */
  13799. revert( item, type ) {
  13800. type = _normalizeConsumableType( type );
  13801. if ( item instanceof _model_textproxy__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  13802. item = this._getSymbolForTextProxy( item );
  13803. }
  13804. const test = this.test( item, type );
  13805. if ( test === false ) {
  13806. this._consumable.get( item ).set( type, true );
  13807. return true;
  13808. } else if ( test === true ) {
  13809. return false;
  13810. }
  13811. return null;
  13812. }
  13813. /**
  13814. * Gets a unique symbol for passed {@link module:engine/model/textproxy~TextProxy} instance. All `TextProxy` instances that
  13815. * have same parent, same start index and same end index will get the same symbol.
  13816. *
  13817. * Used internally to correctly consume `TextProxy` instances.
  13818. *
  13819. * @private
  13820. * @param {module:engine/model/textproxy~TextProxy} textProxy `TextProxy` instance to get a symbol for.
  13821. * @returns {Symbol} Symbol representing all equal instances of `TextProxy`.
  13822. */
  13823. _getSymbolForTextProxy( textProxy ) {
  13824. let symbol = null;
  13825. const startMap = this._textProxyRegistry.get( textProxy.startOffset );
  13826. if ( startMap ) {
  13827. const endMap = startMap.get( textProxy.endOffset );
  13828. if ( endMap ) {
  13829. symbol = endMap.get( textProxy.parent );
  13830. }
  13831. }
  13832. if ( !symbol ) {
  13833. symbol = this._addSymbolForTextProxy( textProxy.startOffset, textProxy.endOffset, textProxy.parent );
  13834. }
  13835. return symbol;
  13836. }
  13837. /**
  13838. * Adds a symbol for given properties that characterizes a {@link module:engine/model/textproxy~TextProxy} instance.
  13839. *
  13840. * Used internally to correctly consume `TextProxy` instances.
  13841. *
  13842. * @private
  13843. * @param {Number} startIndex Text proxy start index in it's parent.
  13844. * @param {Number} endIndex Text proxy end index in it's parent.
  13845. * @param {module:engine/model/element~Element} parent Text proxy parent.
  13846. * @returns {Symbol} Symbol generated for given properties.
  13847. */
  13848. _addSymbolForTextProxy( start, end, parent ) {
  13849. const symbol = Symbol( 'textProxySymbol' );
  13850. let startMap, endMap;
  13851. startMap = this._textProxyRegistry.get( start );
  13852. if ( !startMap ) {
  13853. startMap = new Map();
  13854. this._textProxyRegistry.set( start, startMap );
  13855. }
  13856. endMap = startMap.get( end );
  13857. if ( !endMap ) {
  13858. endMap = new Map();
  13859. startMap.set( end, endMap );
  13860. }
  13861. endMap.set( parent, symbol );
  13862. return symbol;
  13863. }
  13864. }
  13865. // Returns a normalized consumable type name from given string. A normalized consumable type name is a string that has
  13866. // at most one colon, for example: `insert` or `addMarker:highlight`. If string to normalize has more "parts" (more colons),
  13867. // the other parts are dropped, for example: `addattribute:bold:$text` -> `addattributes:bold`.
  13868. //
  13869. // @param {String} type Consumable type.
  13870. // @returns {String} Normalized consumable type.
  13871. function _normalizeConsumableType( type ) {
  13872. const parts = type.split( ':' );
  13873. // Markers are identified by the whole name (otherwise we would consume the whole markers group).
  13874. if ( parts[ 0 ] == 'addMarker' || parts[ 0 ] == 'removeMarker' ) {
  13875. return type;
  13876. }
  13877. return parts.length > 1 ? parts[ 0 ] + ':' + parts[ 1 ] : parts[ 0 ];
  13878. }
  13879. /***/ }),
  13880. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcastdispatcher.js":
  13881. /*!************************************************************************************!*\
  13882. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcastdispatcher.js ***!
  13883. \************************************************************************************/
  13884. /*! exports provided: default */
  13885. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13886. "use strict";
  13887. __webpack_require__.r(__webpack_exports__);
  13888. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UpcastDispatcher; });
  13889. /* harmony import */ var _viewconsumable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./viewconsumable */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/viewconsumable.js");
  13890. /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  13891. /* harmony import */ var _model_position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model/position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  13892. /* harmony import */ var _model_schema__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../model/schema */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js");
  13893. /* harmony import */ var _model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../model/utils/autoparagraphing */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js");
  13894. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  13895. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  13896. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  13897. /**
  13898. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  13899. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  13900. */
  13901. /**
  13902. * @module engine/conversion/upcastdispatcher
  13903. */
  13904. /**
  13905. * Upcast dispatcher is a central point of the view-to-model conversion, which is a process of
  13906. * converting a given {@link module:engine/view/documentfragment~DocumentFragment view document fragment} or
  13907. * {@link module:engine/view/element~Element view element} into a correct model structure.
  13908. *
  13909. * During the conversion process, the dispatcher fires events for all {@link module:engine/view/node~Node view nodes}
  13910. * from the converted view document fragment.
  13911. * Special callbacks called "converters" should listen to these events in order to convert the view nodes.
  13912. *
  13913. * The second parameter of the callback is the `data` object with the following properties:
  13914. *
  13915. * * `data.viewItem` contains a {@link module:engine/view/node~Node view node} or a
  13916. * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}
  13917. * that is converted at the moment and might be handled by the callback.
  13918. * * `data.modelRange` is used to point to the result
  13919. * of the current conversion (e.g. the element that is being inserted)
  13920. * and is always a {@link module:engine/model/range~Range} when the conversion succeeds.
  13921. * * `data.modelCursor` is a {@link module:engine/model/position~Position position} on which the converter should insert
  13922. * the newly created items.
  13923. *
  13924. * The third parameter of the callback is an instance of {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi}
  13925. * which provides additional tools for converters.
  13926. *
  13927. * You can read more about conversion in the following guides:
  13928. *
  13929. * * {@glink framework/guides/deep-dive/conversion/conversion-introduction Advanced conversion concepts &mdash; attributes}
  13930. * * {@glink framework/guides/deep-dive/conversion/custom-element-conversion Custom element conversion}
  13931. *
  13932. * Examples of event-based converters:
  13933. *
  13934. * // A converter for links (<a>).
  13935. * editor.data.upcastDispatcher.on( 'element:a', ( evt, data, conversionApi ) => {
  13936. * if ( conversionApi.consumable.consume( data.viewItem, { name: true, attributes: [ 'href' ] } ) ) {
  13937. * // The <a> element is inline and is represented by an attribute in the model.
  13938. * // This is why you need to convert only children.
  13939. * const { modelRange } = conversionApi.convertChildren( data.viewItem, data.modelCursor );
  13940. *
  13941. * for ( let item of modelRange.getItems() ) {
  13942. * if ( conversionApi.schema.checkAttribute( item, 'linkHref' ) ) {
  13943. * conversionApi.writer.setAttribute( 'linkHref', data.viewItem.getAttribute( 'href' ), item );
  13944. * }
  13945. * }
  13946. * }
  13947. * } );
  13948. *
  13949. * // Convert <p> element's font-size style.
  13950. * // Note: You should use a low-priority observer in order to ensure that
  13951. * // it is executed after the element-to-element converter.
  13952. * editor.data.upcastDispatcher.on( 'element:p', ( evt, data, conversionApi ) => {
  13953. * const { consumable, schema, writer } = conversionApi;
  13954. *
  13955. * if ( !consumable.consume( data.viewItem, { style: 'font-size' } ) ) {
  13956. * return;
  13957. * }
  13958. *
  13959. * const fontSize = data.viewItem.getStyle( 'font-size' );
  13960. *
  13961. * // Do not go for the model element after data.modelCursor because it might happen
  13962. * // that a single view element was converted to multiple model elements. Get all of them.
  13963. * for ( const item of data.modelRange.getItems( { shallow: true } ) ) {
  13964. * if ( schema.checkAttribute( item, 'fontSize' ) ) {
  13965. * writer.setAttribute( 'fontSize', fontSize, item );
  13966. * }
  13967. * }
  13968. * }, { priority: 'low' } );
  13969. *
  13970. * // Convert all elements which have no custom converter into a paragraph (autoparagraphing).
  13971. * editor.data.upcastDispatcher.on( 'element', ( evt, data, conversionApi ) => {
  13972. * // Check if an element can be converted.
  13973. * if ( !conversionApi.consumable.test( data.viewItem, { name: data.viewItem.name } ) ) {
  13974. * // When an element is already consumed by higher priority converters, do nothing.
  13975. * return;
  13976. * }
  13977. *
  13978. * const paragraph = conversionApi.writer.createElement( 'paragraph' );
  13979. *
  13980. * // Try to safely insert a paragraph at the model cursor - it will find an allowed parent for the current element.
  13981. * if ( !conversionApi.safeInsert( paragraph, data.modelCursor ) ) {
  13982. * // When an element was not inserted, it means that you cannot insert a paragraph at this position.
  13983. * return;
  13984. * }
  13985. *
  13986. * // Consume the inserted element.
  13987. * conversionApi.consumable.consume( data.viewItem, { name: data.viewItem.name } ) );
  13988. *
  13989. * // Convert the children to a paragraph.
  13990. * const { modelRange } = conversionApi.convertChildren( data.viewItem, paragraph ) );
  13991. *
  13992. * // Update `modelRange` and `modelCursor` in the `data` as a conversion result.
  13993. * conversionApi.updateConversionResult( paragraph, data );
  13994. * }, { priority: 'low' } );
  13995. *
  13996. * @mixes module:utils/emittermixin~EmitterMixin
  13997. * @fires viewCleanup
  13998. * @fires element
  13999. * @fires text
  14000. * @fires documentFragment
  14001. */
  14002. class UpcastDispatcher {
  14003. /**
  14004. * Creates an upcast dispatcher that operates using the passed API.
  14005. *
  14006. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi
  14007. * @param {Object} [conversionApi] Additional properties for an interface that will be passed to events fired
  14008. * by the upcast dispatcher.
  14009. */
  14010. constructor( conversionApi = {} ) {
  14011. /**
  14012. * The list of elements that were created during splitting.
  14013. *
  14014. * After the conversion process the list is cleared.
  14015. *
  14016. * @private
  14017. * @type {Map.<module:engine/model/element~Element,Array.<module:engine/model/element~Element>>}
  14018. */
  14019. this._splitParts = new Map();
  14020. /**
  14021. * The list of cursor parent elements that were created during splitting.
  14022. *
  14023. * After the conversion process the list is cleared.
  14024. *
  14025. * @private
  14026. * @type {Map.<module:engine/model/element~Element,Array.<module:engine/model/element~Element>>}
  14027. */
  14028. this._cursorParents = new Map();
  14029. /**
  14030. * The position in the temporary structure where the converted content is inserted. The structure reflects the context of
  14031. * the target position where the content will be inserted. This property is built based on the context parameter of the
  14032. * convert method.
  14033. *
  14034. * @private
  14035. * @type {module:engine/model/position~Position|null}
  14036. */
  14037. this._modelCursor = null;
  14038. /**
  14039. * An interface passed by the dispatcher to the event callbacks.
  14040. *
  14041. * @member {module:engine/conversion/upcastdispatcher~UpcastConversionApi}
  14042. */
  14043. this.conversionApi = Object.assign( {}, conversionApi );
  14044. // The below methods are bound to this `UpcastDispatcher` instance and set on `conversionApi`.
  14045. // This way only a part of `UpcastDispatcher` API is exposed.
  14046. this.conversionApi.convertItem = this._convertItem.bind( this );
  14047. this.conversionApi.convertChildren = this._convertChildren.bind( this );
  14048. this.conversionApi.safeInsert = this._safeInsert.bind( this );
  14049. this.conversionApi.updateConversionResult = this._updateConversionResult.bind( this );
  14050. // Advanced API - use only if custom position handling is needed.
  14051. this.conversionApi.splitToAllowedParent = this._splitToAllowedParent.bind( this );
  14052. this.conversionApi.getSplitParts = this._getSplitParts.bind( this );
  14053. }
  14054. /**
  14055. * Starts the conversion process. The entry point for the conversion.
  14056. *
  14057. * @fires element
  14058. * @fires text
  14059. * @fires documentFragment
  14060. * @param {module:engine/view/documentfragment~DocumentFragment|module:engine/view/element~Element} viewItem
  14061. * The part of the view to be converted.
  14062. * @param {module:engine/model/writer~Writer} writer An instance of the model writer.
  14063. * @param {module:engine/model/schema~SchemaContextDefinition} [context=['$root']] Elements will be converted according to this context.
  14064. * @returns {module:engine/model/documentfragment~DocumentFragment} Model data that is the result of the conversion process
  14065. * wrapped in `DocumentFragment`. Converted marker elements will be set as the document fragment's
  14066. * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.
  14067. */
  14068. convert( viewItem, writer, context = [ '$root' ] ) {
  14069. this.fire( 'viewCleanup', viewItem );
  14070. // Create context tree and set position in the top element.
  14071. // Items will be converted according to this position.
  14072. this._modelCursor = createContextTree( context, writer );
  14073. // Store writer in conversion as a conversion API
  14074. // to be sure that conversion process will use the same batch.
  14075. this.conversionApi.writer = writer;
  14076. // Create consumable values list for conversion process.
  14077. this.conversionApi.consumable = _viewconsumable__WEBPACK_IMPORTED_MODULE_0__["default"].createFrom( viewItem );
  14078. // Custom data stored by converter for conversion process.
  14079. this.conversionApi.store = {};
  14080. // Do the conversion.
  14081. const { modelRange } = this._convertItem( viewItem, this._modelCursor );
  14082. // Conversion result is always a document fragment so let's create it.
  14083. const documentFragment = writer.createDocumentFragment();
  14084. // When there is a conversion result.
  14085. if ( modelRange ) {
  14086. // Remove all empty elements that were create while splitting.
  14087. this._removeEmptyElements();
  14088. // Move all items that were converted in context tree to the document fragment.
  14089. for ( const item of Array.from( this._modelCursor.parent.getChildren() ) ) {
  14090. writer.append( item, documentFragment );
  14091. }
  14092. // Extract temporary markers elements from model and set as static markers collection.
  14093. documentFragment.markers = extractMarkersFromModelFragment( documentFragment, writer );
  14094. }
  14095. // Clear context position.
  14096. this._modelCursor = null;
  14097. // Clear split elements & parents lists.
  14098. this._splitParts.clear();
  14099. this._cursorParents.clear();
  14100. // Clear conversion API.
  14101. this.conversionApi.writer = null;
  14102. this.conversionApi.store = null;
  14103. // Return fragment as conversion result.
  14104. return documentFragment;
  14105. }
  14106. /**
  14107. * @private
  14108. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#convertItem
  14109. */
  14110. _convertItem( viewItem, modelCursor ) {
  14111. const data = Object.assign( { viewItem, modelCursor, modelRange: null } );
  14112. if ( viewItem.is( 'element' ) ) {
  14113. this.fire( 'element:' + viewItem.name, data, this.conversionApi );
  14114. } else if ( viewItem.is( '$text' ) ) {
  14115. this.fire( 'text', data, this.conversionApi );
  14116. } else {
  14117. this.fire( 'documentFragment', data, this.conversionApi );
  14118. }
  14119. // Handle incorrect conversion result.
  14120. if ( data.modelRange && !( data.modelRange instanceof _model_range__WEBPACK_IMPORTED_MODULE_1__["default"] ) ) {
  14121. /**
  14122. * Incorrect conversion result was dropped.
  14123. *
  14124. * {@link module:engine/model/range~Range Model range} should be a conversion result.
  14125. *
  14126. * @error view-conversion-dispatcher-incorrect-result
  14127. */
  14128. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'view-conversion-dispatcher-incorrect-result', this );
  14129. }
  14130. return { modelRange: data.modelRange, modelCursor: data.modelCursor };
  14131. }
  14132. /**
  14133. * @private
  14134. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#convertChildren
  14135. */
  14136. _convertChildren( viewItem, elementOrModelCursor ) {
  14137. let nextModelCursor = elementOrModelCursor.is( 'position' ) ?
  14138. elementOrModelCursor : _model_position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( elementOrModelCursor, 0 );
  14139. const modelRange = new _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]( nextModelCursor );
  14140. for ( const viewChild of Array.from( viewItem.getChildren() ) ) {
  14141. const result = this._convertItem( viewChild, nextModelCursor );
  14142. if ( result.modelRange instanceof _model_range__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  14143. modelRange.end = result.modelRange.end;
  14144. nextModelCursor = result.modelCursor;
  14145. }
  14146. }
  14147. return { modelRange, modelCursor: nextModelCursor };
  14148. }
  14149. /**
  14150. * @private
  14151. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#safeInsert
  14152. */
  14153. _safeInsert( modelElement, position ) {
  14154. // Find allowed parent for element that we are going to insert.
  14155. // If current parent does not allow to insert element but one of the ancestors does
  14156. // then split nodes to allowed parent.
  14157. const splitResult = this._splitToAllowedParent( modelElement, position );
  14158. // When there is no split result it means that we can't insert element to model tree, so let's skip it.
  14159. if ( !splitResult ) {
  14160. return false;
  14161. }
  14162. // Insert element on allowed position.
  14163. this.conversionApi.writer.insert( modelElement, splitResult.position );
  14164. return true;
  14165. }
  14166. /**
  14167. * @private
  14168. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#updateConversionResult
  14169. */
  14170. _updateConversionResult( modelElement, data ) {
  14171. const parts = this._getSplitParts( modelElement );
  14172. const writer = this.conversionApi.writer;
  14173. // Set conversion result range - only if not set already.
  14174. if ( !data.modelRange ) {
  14175. data.modelRange = writer.createRange(
  14176. writer.createPositionBefore( modelElement ),
  14177. writer.createPositionAfter( parts[ parts.length - 1 ] )
  14178. );
  14179. }
  14180. const savedCursorParent = this._cursorParents.get( modelElement );
  14181. // Now we need to check where the `modelCursor` should be.
  14182. if ( savedCursorParent ) {
  14183. // If we split parent to insert our element then we want to continue conversion in the new part of the split parent.
  14184. //
  14185. // before: <allowed><notAllowed>foo[]</notAllowed></allowed>
  14186. // after: <allowed><notAllowed>foo</notAllowed> <converted></converted> <notAllowed>[]</notAllowed></allowed>
  14187. data.modelCursor = writer.createPositionAt( savedCursorParent, 0 );
  14188. } else {
  14189. // Otherwise just continue after inserted element.
  14190. data.modelCursor = data.modelRange.end;
  14191. }
  14192. }
  14193. /**
  14194. * @private
  14195. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#splitToAllowedParent
  14196. */
  14197. _splitToAllowedParent( node, modelCursor ) {
  14198. const { schema, writer } = this.conversionApi;
  14199. // Try to find allowed parent.
  14200. let allowedParent = schema.findAllowedParent( modelCursor, node );
  14201. if ( allowedParent ) {
  14202. // When current position parent allows to insert node then return this position.
  14203. if ( allowedParent === modelCursor.parent ) {
  14204. return { position: modelCursor };
  14205. }
  14206. // When allowed parent is in context tree (it's outside the converted tree).
  14207. if ( this._modelCursor.parent.getAncestors().includes( allowedParent ) ) {
  14208. allowedParent = null;
  14209. }
  14210. }
  14211. if ( !allowedParent ) {
  14212. // Check if the node wrapped with a paragraph would be accepted by the schema.
  14213. if ( !Object(_model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_4__["isParagraphable"])( modelCursor, node, schema ) ) {
  14214. return null;
  14215. }
  14216. return {
  14217. position: Object(_model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_4__["wrapInParagraph"])( modelCursor, writer )
  14218. };
  14219. }
  14220. // Split element to allowed parent.
  14221. const splitResult = this.conversionApi.writer.split( modelCursor, allowedParent );
  14222. // Using the range returned by `model.Writer#split`, we will pair original elements with their split parts.
  14223. //
  14224. // The range returned from the writer spans "over the split" or, precisely saying, from the end of the original element (the one
  14225. // that got split) to the beginning of the other part of that element:
  14226. //
  14227. // <limit><a><b><c>X[]Y</c></b><a></limit> ->
  14228. // <limit><a><b><c>X[</c></b></a><a><b><c>]Y</c></b></a>
  14229. //
  14230. // After the split there cannot be any full node between the positions in `splitRange`. The positions are touching.
  14231. // Also, because of how splitting works, it is easy to notice, that "closing tags" are in the reverse order than "opening tags".
  14232. // Also, since we split all those elements, each of them has to have the other part.
  14233. //
  14234. // With those observations in mind, we will pair the original elements with their split parts by saving "closing tags" and matching
  14235. // them with "opening tags" in the reverse order. For that we can use a stack.
  14236. const stack = [];
  14237. for ( const treeWalkerValue of splitResult.range.getWalker() ) {
  14238. if ( treeWalkerValue.type == 'elementEnd' ) {
  14239. stack.push( treeWalkerValue.item );
  14240. } else {
  14241. // There should not be any text nodes after the element is split, so the only other value is `elementStart`.
  14242. const originalPart = stack.pop();
  14243. const splitPart = treeWalkerValue.item;
  14244. this._registerSplitPair( originalPart, splitPart );
  14245. }
  14246. }
  14247. const cursorParent = splitResult.range.end.parent;
  14248. this._cursorParents.set( node, cursorParent );
  14249. return {
  14250. position: splitResult.position,
  14251. cursorParent
  14252. };
  14253. }
  14254. /**
  14255. * Registers that a `splitPart` element is a split part of the `originalPart` element.
  14256. *
  14257. * The data set by this method is used by {@link #_getSplitParts} and {@link #_removeEmptyElements}.
  14258. *
  14259. * @private
  14260. * @param {module:engine/model/element~Element} originalPart
  14261. * @param {module:engine/model/element~Element} splitPart
  14262. */
  14263. _registerSplitPair( originalPart, splitPart ) {
  14264. if ( !this._splitParts.has( originalPart ) ) {
  14265. this._splitParts.set( originalPart, [ originalPart ] );
  14266. }
  14267. const list = this._splitParts.get( originalPart );
  14268. this._splitParts.set( splitPart, list );
  14269. list.push( splitPart );
  14270. }
  14271. /**
  14272. * @private
  14273. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#getSplitParts
  14274. */
  14275. _getSplitParts( element ) {
  14276. let parts;
  14277. if ( !this._splitParts.has( element ) ) {
  14278. parts = [ element ];
  14279. } else {
  14280. parts = this._splitParts.get( element );
  14281. }
  14282. return parts;
  14283. }
  14284. /**
  14285. * Checks if there are any empty elements created while splitting and removes them.
  14286. *
  14287. * This method works recursively to re-check empty elements again after at least one element was removed in the initial call,
  14288. * as some elements might have become empty after other empty elements were removed from them.
  14289. *
  14290. * @private
  14291. */
  14292. _removeEmptyElements() {
  14293. let anyRemoved = false;
  14294. for ( const element of this._splitParts.keys() ) {
  14295. if ( element.isEmpty ) {
  14296. this.conversionApi.writer.remove( element );
  14297. this._splitParts.delete( element );
  14298. anyRemoved = true;
  14299. }
  14300. }
  14301. if ( anyRemoved ) {
  14302. this._removeEmptyElements();
  14303. }
  14304. }
  14305. /**
  14306. * Fired before the first conversion event, at the beginning of the upcast (view-to-model conversion) process.
  14307. *
  14308. * @event viewCleanup
  14309. * @param {module:engine/view/documentfragment~DocumentFragment|module:engine/view/element~Element}
  14310. * viewItem A part of the view to be converted.
  14311. */
  14312. /**
  14313. * Fired when an {@link module:engine/view/element~Element} is converted.
  14314. *
  14315. * `element` is a namespace event for a class of events. Names of actually called events follow the pattern of
  14316. * `element:<elementName>` where `elementName` is the name of the converted element. This way listeners may listen to
  14317. * a conversion of all or just specific elements.
  14318. *
  14319. * @event element
  14320. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionData} data The conversion data. Keep in mind that this object is
  14321. * shared by reference between all callbacks that will be called. This means that callbacks can override values if needed, and these
  14322. * values will be available in other callbacks.
  14323. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion utilities to be used by the
  14324. * callback.
  14325. */
  14326. /**
  14327. * Fired when a {@link module:engine/view/text~Text} is converted.
  14328. *
  14329. * @event text
  14330. * @see #event:element
  14331. */
  14332. /**
  14333. * Fired when a {@link module:engine/view/documentfragment~DocumentFragment} is converted.
  14334. *
  14335. * @event documentFragment
  14336. * @see #event:element
  14337. */
  14338. }
  14339. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_7__["default"])( UpcastDispatcher, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_6__["default"] );
  14340. // Traverses given model item and searches elements which marks marker range. Found element is removed from
  14341. // DocumentFragment but path of this element is stored in a Map which is then returned.
  14342. //
  14343. // @param {module:engine/view/documentfragment~DocumentFragment|module:engine/view/node~Node} modelItem Fragment of model.
  14344. // @returns {Map<String, module:engine/model/range~Range>} List of static markers.
  14345. function extractMarkersFromModelFragment( modelItem, writer ) {
  14346. const markerElements = new Set();
  14347. const markers = new Map();
  14348. // Create ModelTreeWalker.
  14349. const range = _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( modelItem ).getItems();
  14350. // Walk through DocumentFragment and collect marker elements.
  14351. for ( const item of range ) {
  14352. // Check if current element is a marker.
  14353. if ( item.name == '$marker' ) {
  14354. markerElements.add( item );
  14355. }
  14356. }
  14357. // Walk through collected marker elements store its path and remove its from the DocumentFragment.
  14358. for ( const markerElement of markerElements ) {
  14359. const markerName = markerElement.getAttribute( 'data-name' );
  14360. const currentPosition = writer.createPositionBefore( markerElement );
  14361. // When marker of given name is not stored it means that we have found the beginning of the range.
  14362. if ( !markers.has( markerName ) ) {
  14363. markers.set( markerName, new _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]( currentPosition.clone() ) );
  14364. // Otherwise is means that we have found end of the marker range.
  14365. } else {
  14366. markers.get( markerName ).end = currentPosition.clone();
  14367. }
  14368. // Remove marker element from DocumentFragment.
  14369. writer.remove( markerElement );
  14370. }
  14371. return markers;
  14372. }
  14373. // Creates model fragment according to given context and returns position in the bottom (the deepest) element.
  14374. function createContextTree( contextDefinition, writer ) {
  14375. let position;
  14376. for ( const item of new _model_schema__WEBPACK_IMPORTED_MODULE_3__["SchemaContext"]( contextDefinition ) ) {
  14377. const attributes = {};
  14378. for ( const key of item.getAttributeKeys() ) {
  14379. attributes[ key ] = item.getAttribute( key );
  14380. }
  14381. const current = writer.createElement( item.name, attributes );
  14382. if ( position ) {
  14383. writer.append( current, position );
  14384. }
  14385. position = _model_position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( current, 0 );
  14386. }
  14387. return position;
  14388. }
  14389. /**
  14390. * A set of conversion utilities available as the third parameter of the
  14391. * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher upcast dispatcher}'s events.
  14392. *
  14393. * @interface module:engine/conversion/upcastdispatcher~UpcastConversionApi
  14394. */
  14395. /**
  14396. * Starts the conversion of a given item by firing an appropriate event.
  14397. *
  14398. * Every fired event is passed (as the first parameter) an object with the `modelRange` property. Every event may set and/or
  14399. * modify that property. When all callbacks are done, the final value of the `modelRange` property is returned by this method.
  14400. * The `modelRange` must be a {@link module:engine/model/range~Range model range} or `null` (as set by default).
  14401. *
  14402. * @method #convertItem
  14403. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
  14404. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:text
  14405. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:documentFragment
  14406. * @param {module:engine/view/item~Item} viewItem Item to convert.
  14407. * @param {module:engine/model/position~Position} modelCursor The conversion position.
  14408. * @returns {Object} result The conversion result.
  14409. * @returns {module:engine/model/range~Range|null} result.modelRange The model range containing the result of the item conversion,
  14410. * created and modified by callbacks attached to the fired event, or `null` if the conversion result was incorrect.
  14411. * @returns {module:engine/model/position~Position} result.modelCursor The position where the conversion should be continued.
  14412. */
  14413. /**
  14414. * Starts the conversion of all children of a given item by firing appropriate events for all the children.
  14415. *
  14416. * @method #convertChildren
  14417. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
  14418. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:text
  14419. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:documentFragment
  14420. * @param {module:engine/view/item~Item} viewItem An element whose children should be converted.
  14421. * @param {module:engine/model/position~Position|module:engine/model/element~Element} positionOrElement A position or an element of
  14422. * the conversion.
  14423. * @returns {Object} result The conversion result.
  14424. * @returns {module:engine/model/range~Range} result.modelRange The model range containing the results of the conversion of all children
  14425. * of the given item. When no child was converted, the range is collapsed.
  14426. * @returns {module:engine/model/position~Position} result.modelCursor The position where the conversion should be continued.
  14427. */
  14428. /**
  14429. * Safely inserts an element to the document, checking the {@link module:engine/model/schema~Schema schema} to find an allowed parent for
  14430. * an element that you are going to insert, starting from the given position. If the current parent does not allow to insert the element
  14431. * but one of the ancestors does, then splits the nodes to allowed parent.
  14432. *
  14433. * If the schema allows to insert the node in a given position, nothing is split.
  14434. *
  14435. * If it was not possible to find an allowed parent, `false` is returned and nothing is split.
  14436. *
  14437. * Otherwise, ancestors are split.
  14438. *
  14439. * For instance, if `<imageBlock>` is not allowed in `<paragraph>` but is allowed in `$root`:
  14440. *
  14441. * <paragraph>foo[]bar</paragraph>
  14442. *
  14443. * -> safe insert for `<imageBlock>` will split ->
  14444. *
  14445. * <paragraph>foo</paragraph>[]<paragraph>bar</paragraph>
  14446. *
  14447. * Example usage:
  14448. *
  14449. * const myElement = conversionApi.writer.createElement( 'myElement' );
  14450. *
  14451. * if ( !conversionApi.safeInsert( myElement, data.modelCursor ) ) {
  14452. * return;
  14453. * }
  14454. *
  14455. * The split result is saved and {@link #updateConversionResult} should be used to update the
  14456. * {@link module:engine/conversion/upcastdispatcher~UpcastConversionData conversion data}.
  14457. *
  14458. * @method #safeInsert
  14459. * @param {module:engine/model/node~Node} node The node to insert.
  14460. * @param {module:engine/model/position~Position} position The position where an element is going to be inserted.
  14461. * @returns {Boolean} The split result. If it was not possible to find an allowed position, `false` is returned.
  14462. */
  14463. /**
  14464. * Updates the conversion result and sets a proper {@link module:engine/conversion/upcastdispatcher~UpcastConversionData#modelRange} and
  14465. * the next {@link module:engine/conversion/upcastdispatcher~UpcastConversionData#modelCursor} after the conversion.
  14466. * Used together with {@link #safeInsert}, it enables you to easily convert elements without worrying if the node was split
  14467. * during the conversion of its children.
  14468. *
  14469. * A usage example in converter code:
  14470. *
  14471. * const myElement = conversionApi.writer.createElement( 'myElement' );
  14472. *
  14473. * if ( !conversionApi.safeInsert( myElement, data.modelCursor ) ) {
  14474. * return;
  14475. * }
  14476. *
  14477. * // Children conversion may split `myElement`.
  14478. * conversionApi.convertChildren( data.viewItem, myElement );
  14479. *
  14480. * conversionApi.updateConversionResult( myElement, data );
  14481. *
  14482. * @method #updateConversionResult
  14483. * @param {module:engine/model/element~Element} element
  14484. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionData} data Conversion data.
  14485. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion utilities to be used by the callback.
  14486. */
  14487. /**
  14488. * Checks the {@link module:engine/model/schema~Schema schema} to find an allowed parent for an element that is going to be inserted
  14489. * starting from the given position. If the current parent does not allow inserting an element but one of the ancestors does, the method
  14490. * splits nodes to allowed parent.
  14491. *
  14492. * If the schema allows inserting the node in the given position, nothing is split and an object with that position is returned.
  14493. *
  14494. * If it was not possible to find an allowed parent, `null` is returned and nothing is split.
  14495. *
  14496. * Otherwise, ancestors are split and an object with a position and the copy of the split element is returned.
  14497. *
  14498. * For instance, if `<imageBlock>` is not allowed in `<paragraph>` but is allowed in `$root`:
  14499. *
  14500. * <paragraph>foo[]bar</paragraph>
  14501. *
  14502. * -> split for `<imageBlock>` ->
  14503. *
  14504. * <paragraph>foo</paragraph>[]<paragraph>bar</paragraph>
  14505. *
  14506. * In the example above, the position between `<paragraph>` elements will be returned as `position` and the second `paragraph`
  14507. * as `cursorParent`.
  14508. *
  14509. * **Note:** This is an advanced method. For most cases {@link #safeInsert} and {@link #updateConversionResult} should be used.
  14510. *
  14511. * @method #splitToAllowedParent
  14512. * @param {module:engine/model/position~Position} position The position where the element is going to be inserted.
  14513. * @param {module:engine/model/node~Node} node The node to insert.
  14514. * @returns {Object|null} The split result. If it was not possible to find an allowed position, `null` is returned.
  14515. * @returns {module:engine/model/position~Position} The position between split elements.
  14516. * @returns {module:engine/model/element~Element} [cursorParent] The element inside which the cursor should be placed to
  14517. * continue the conversion. When the element is not defined it means that there was no split.
  14518. */
  14519. /**
  14520. * Returns all the split parts of the given `element` that were created during upcasting through using {@link #splitToAllowedParent}.
  14521. * It enables you to easily track these elements and continue processing them after they are split during the conversion of their children.
  14522. *
  14523. * <paragraph>Foo<imageBlock />bar<imageBlock />baz</paragraph> ->
  14524. * <paragraph>Foo</paragraph><imageBlock /><paragraph>bar</paragraph><imageBlock /><paragraph>baz</paragraph>
  14525. *
  14526. * For a reference to any of above paragraphs, the function will return all three paragraphs (the original element included),
  14527. * sorted in the order of their creation (the original element is the first one).
  14528. *
  14529. * If the given `element` was not split, an array with a single element is returned.
  14530. *
  14531. * A usage example in the converter code:
  14532. *
  14533. * const myElement = conversionApi.writer.createElement( 'myElement' );
  14534. *
  14535. * // Children conversion may split `myElement`.
  14536. * conversionApi.convertChildren( data.viewItem, data.modelCursor );
  14537. *
  14538. * const splitParts = conversionApi.getSplitParts( myElement );
  14539. * const lastSplitPart = splitParts[ splitParts.length - 1 ];
  14540. *
  14541. * // Setting `data.modelRange` basing on split parts:
  14542. * data.modelRange = conversionApi.writer.createRange(
  14543. * conversionApi.writer.createPositionBefore( myElement ),
  14544. * conversionApi.writer.createPositionAfter( lastSplitPart )
  14545. * );
  14546. *
  14547. * // Setting `data.modelCursor` to continue after the last split element:
  14548. * data.modelCursor = conversionApi.writer.createPositionAfter( lastSplitPart );
  14549. *
  14550. * **Tip:** If you are unable to get a reference to the original element (for example because the code is split into multiple converters
  14551. * or even classes) but it has already been converted, you may want to check the first element in `data.modelRange`. This is a common
  14552. * situation if an attribute converter is separated from an element converter.
  14553. *
  14554. * **Note:** This is an advanced method. For most cases {@link #safeInsert} and {@link #updateConversionResult} should be used.
  14555. *
  14556. * @method #getSplitParts
  14557. * @param {module:engine/model/element~Element} element
  14558. * @returns {Array.<module:engine/model/element~Element>}
  14559. */
  14560. /**
  14561. * Stores information about what parts of the processed view item are still waiting to be handled. After a piece of view item
  14562. * was converted, an appropriate consumable value should be
  14563. * {@link module:engine/conversion/viewconsumable~ViewConsumable#consume consumed}.
  14564. *
  14565. * @member {module:engine/conversion/viewconsumable~ViewConsumable} #consumable
  14566. */
  14567. /**
  14568. * Custom data stored by converters for the conversion process. Custom properties of this object can be defined and use to
  14569. * pass parameters between converters.
  14570. *
  14571. * The difference between this property and the `data` parameter of
  14572. * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element} is that the `data` parameters allow you
  14573. * to pass parameters within a single event and `store` within the whole conversion.
  14574. *
  14575. * @member {Object} #store
  14576. */
  14577. /**
  14578. * The model's schema instance.
  14579. *
  14580. * @member {module:engine/model/schema~Schema} #schema
  14581. */
  14582. /**
  14583. * The {@link module:engine/model/writer~Writer} instance used to manipulate the data during conversion.
  14584. *
  14585. * @member {module:engine/model/writer~Writer} #writer
  14586. */
  14587. /**
  14588. * Conversion data.
  14589. *
  14590. * **Note:** Keep in mind that this object is shared by reference between all conversion callbacks that will be called.
  14591. * This means that callbacks can override values if needed, and these values will be available in other callbacks.
  14592. *
  14593. * @typedef {Object} module:engine/conversion/upcastdispatcher~UpcastConversionData
  14594. *
  14595. * @property {module:engine/view/item~Item} viewItem The converted item.
  14596. * @property {module:engine/model/position~Position} modelCursor The position where the converter should start changes.
  14597. * Change this value for the next converter to tell where the conversion should continue.
  14598. * @property {module:engine/model/range~Range} [modelRange] The current state of conversion result. Every change to
  14599. * the converted element should be reflected by setting or modifying this property.
  14600. */
  14601. /***/ }),
  14602. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js":
  14603. /*!*********************************************************************************!*\
  14604. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js ***!
  14605. \*********************************************************************************/
  14606. /*! exports provided: default, convertToModelFragment, convertText, convertSelectionChange */
  14607. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14608. "use strict";
  14609. __webpack_require__.r(__webpack_exports__);
  14610. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UpcastHelpers; });
  14611. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToModelFragment", function() { return convertToModelFragment; });
  14612. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertText", function() { return convertText; });
  14613. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertSelectionChange", function() { return convertSelectionChange; });
  14614. /* harmony import */ var _view_matcher__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view/matcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js");
  14615. /* harmony import */ var _conversionhelpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./conversionhelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js");
  14616. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  14617. /* harmony import */ var _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/priorities */ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js");
  14618. /* harmony import */ var _model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../model/utils/autoparagraphing */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js");
  14619. /**
  14620. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  14621. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  14622. */
  14623. /**
  14624. * Contains {@link module:engine/view/view view} to {@link module:engine/model/model model} converters for
  14625. * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}.
  14626. *
  14627. * @module engine/conversion/upcasthelpers
  14628. */
  14629. /**
  14630. * Upcast conversion helper functions.
  14631. *
  14632. * @extends module:engine/conversion/conversionhelpers~ConversionHelpers
  14633. */
  14634. class UpcastHelpers extends _conversionhelpers__WEBPACK_IMPORTED_MODULE_1__["default"] {
  14635. /**
  14636. * View element to model element conversion helper.
  14637. *
  14638. * This conversion results in creating a model element. For example,
  14639. * view `<p>Foo</p>` becomes `<paragraph>Foo</paragraph>` in the model.
  14640. *
  14641. * Keep in mind that the element will be inserted only if it is allowed
  14642. * by {@link module:engine/model/schema~Schema schema} configuration.
  14643. *
  14644. * editor.conversion.for( 'upcast' ).elementToElement( {
  14645. * view: 'p',
  14646. * model: 'paragraph'
  14647. * } );
  14648. *
  14649. * editor.conversion.for( 'upcast' ).elementToElement( {
  14650. * view: 'p',
  14651. * model: 'paragraph',
  14652. * converterPriority: 'high'
  14653. * } );
  14654. *
  14655. * editor.conversion.for( 'upcast' ).elementToElement( {
  14656. * view: {
  14657. * name: 'p',
  14658. * classes: 'fancy'
  14659. * },
  14660. * model: 'fancyParagraph'
  14661. * } );
  14662. *
  14663. * editor.conversion.for( 'upcast' ).elementToElement( {
  14664. * view: {
  14665. * name: 'p',
  14666. * classes: 'heading'
  14667. * },
  14668. * model: ( viewElement, conversionApi ) => {
  14669. * const modelWriter = conversionApi.writer;
  14670. *
  14671. * return modelWriter.createElement( 'heading', { level: viewElement.getAttribute( 'data-level' ) } );
  14672. * }
  14673. * } );
  14674. *
  14675. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  14676. * to the conversion process.
  14677. *
  14678. * @method #elementToElement
  14679. * @param {Object} config Conversion configuration.
  14680. * @param {module:engine/view/matcher~MatcherPattern} [config.view] Pattern matching all view elements which should be converted. If not
  14681. * set, the converter will fire for every view element.
  14682. * @param {String|module:engine/model/element~Element|Function} config.model Name of the model element, a model element instance or a
  14683. * function that takes a view element and {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API}
  14684. * and returns a model element. The model element will be inserted in the model.
  14685. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  14686. * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
  14687. */
  14688. elementToElement( config ) {
  14689. return this.add( upcastElementToElement( config ) );
  14690. }
  14691. /**
  14692. * View element to model attribute conversion helper.
  14693. *
  14694. * This conversion results in setting an attribute on a model node. For example, view `<strong>Foo</strong>` becomes
  14695. * `Foo` {@link module:engine/model/text~Text model text node} with `bold` attribute set to `true`.
  14696. *
  14697. * This helper is meant to set a model attribute on all the elements that are inside the converted element:
  14698. *
  14699. * <strong>Foo</strong> --> <strong><p>Foo</p></strong> --> <paragraph><$text bold="true">Foo</$text></paragraph>
  14700. *
  14701. * Above is a sample of HTML code, that goes through autoparagraphing (first step) and then is converted (second step).
  14702. * Even though `<strong>` is over `<p>` element, `bold="true"` was added to the text. See
  14703. * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute} for comparison.
  14704. *
  14705. * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.
  14706. *
  14707. * editor.conversion.for( 'upcast' ).elementToAttribute( {
  14708. * view: 'strong',
  14709. * model: 'bold'
  14710. * } );
  14711. *
  14712. * editor.conversion.for( 'upcast' ).elementToAttribute( {
  14713. * view: 'strong',
  14714. * model: 'bold',
  14715. * converterPriority: 'high'
  14716. * } );
  14717. *
  14718. * editor.conversion.for( 'upcast' ).elementToAttribute( {
  14719. * view: {
  14720. * name: 'span',
  14721. * classes: 'bold'
  14722. * },
  14723. * model: 'bold'
  14724. * } );
  14725. *
  14726. * editor.conversion.for( 'upcast' ).elementToAttribute( {
  14727. * view: {
  14728. * name: 'span',
  14729. * classes: [ 'styled', 'styled-dark' ]
  14730. * },
  14731. * model: {
  14732. * key: 'styled',
  14733. * value: 'dark'
  14734. * }
  14735. * } );
  14736. *
  14737. * editor.conversion.for( 'upcast' ).elementToAttribute( {
  14738. * view: {
  14739. * name: 'span',
  14740. * styles: {
  14741. * 'font-size': /[\s\S]+/
  14742. * }
  14743. * },
  14744. * model: {
  14745. * key: 'fontSize',
  14746. * value: ( viewElement, conversionApi ) => {
  14747. * const fontSize = viewElement.getStyle( 'font-size' );
  14748. * const value = fontSize.substr( 0, fontSize.length - 2 );
  14749. *
  14750. * if ( value <= 10 ) {
  14751. * return 'small';
  14752. * } else if ( value > 12 ) {
  14753. * return 'big';
  14754. * }
  14755. *
  14756. * return null;
  14757. * }
  14758. * }
  14759. * } );
  14760. *
  14761. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  14762. * to the conversion process.
  14763. *
  14764. * @method #elementToAttribute
  14765. * @param {Object} config Conversion configuration.
  14766. * @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.
  14767. * @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing
  14768. * the model attribute. `value` property may be set as a function that takes a view element and
  14769. * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the value.
  14770. * If `String` is given, the model attribute value will be set to `true`.
  14771. * @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.
  14772. * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
  14773. */
  14774. elementToAttribute( config ) {
  14775. return this.add( upcastElementToAttribute( config ) );
  14776. }
  14777. /**
  14778. * View attribute to model attribute conversion helper.
  14779. *
  14780. * This conversion results in setting an attribute on a model node. For example, view `<img src="foo.jpg"></img>` becomes
  14781. * `<imageBlock source="foo.jpg"></imageBlock>` in the model.
  14782. *
  14783. * This helper is meant to convert view attributes from view elements which got converted to the model, so the view attribute
  14784. * is set only on the corresponding model node:
  14785. *
  14786. * <div class="dark"><div>foo</div></div> --> <div dark="true"><div>foo</div></div>
  14787. *
  14788. * Above, `class="dark"` attribute is added only to the `<div>` elements that has it. This is in contrary to
  14789. * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToAttribute} which sets attributes for
  14790. * all the children in the model:
  14791. *
  14792. * <strong>Foo</strong> --> <strong><p>Foo</p></strong> --> <paragraph><$text bold="true">Foo</$text></paragraph>
  14793. *
  14794. * Above is a sample of HTML code, that goes through autoparagraphing (first step) and then is converted (second step).
  14795. * Even though `<strong>` is over `<p>` element, `bold="true"` was added to the text.
  14796. *
  14797. * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.
  14798. *
  14799. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  14800. * view: 'src',
  14801. * model: 'source'
  14802. * } );
  14803. *
  14804. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  14805. * view: { key: 'src' },
  14806. * model: 'source'
  14807. * } );
  14808. *
  14809. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  14810. * view: { key: 'src' },
  14811. * model: 'source',
  14812. * converterPriority: 'normal'
  14813. * } );
  14814. *
  14815. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  14816. * view: {
  14817. * key: 'data-style',
  14818. * value: /[\s\S]+/
  14819. * },
  14820. * model: 'styled'
  14821. * } );
  14822. *
  14823. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  14824. * view: {
  14825. * name: 'img',
  14826. * key: 'class',
  14827. * value: 'styled-dark'
  14828. * },
  14829. * model: {
  14830. * key: 'styled',
  14831. * value: 'dark'
  14832. * }
  14833. * } );
  14834. *
  14835. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  14836. * view: {
  14837. * key: 'class',
  14838. * value: /styled-[\S]+/
  14839. * },
  14840. * model: {
  14841. * key: 'styled'
  14842. * value: ( viewElement, conversionApi ) => {
  14843. * const regexp = /styled-([\S]+)/;
  14844. * const match = viewElement.getAttribute( 'class' ).match( regexp );
  14845. *
  14846. * return match[ 1 ];
  14847. * }
  14848. * }
  14849. * } );
  14850. *
  14851. * Converting styles works a bit differently as it requires `view.styles` to be an object and by default
  14852. * a model attribute will be set to `true` by such a converter. You can set the model attribute to any value by providing the `value`
  14853. * callback that returns the desired value.
  14854. *
  14855. * // Default conversion of font-weight style will result in setting bold attribute to true.
  14856. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  14857. * view: {
  14858. * styles: {
  14859. * 'font-weight': 'bold'
  14860. * }
  14861. * },
  14862. * model: 'bold'
  14863. * } );
  14864. *
  14865. * // This converter will pass any style value to the `lineHeight` model attribute.
  14866. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  14867. * view: {
  14868. * styles: {
  14869. * 'line-height': /[\s\S]+/
  14870. * }
  14871. * },
  14872. * model: {
  14873. * key: 'lineHeight',
  14874. * value: ( viewElement, conversionApi ) => viewElement.getStyle( 'line-height' )
  14875. * }
  14876. * } );
  14877. *
  14878. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  14879. * to the conversion process.
  14880. *
  14881. * @method #attributeToAttribute
  14882. * @param {Object} config Conversion configuration.
  14883. * @param {String|Object} config.view Specifies which view attribute will be converted. If a `String` is passed,
  14884. * attributes with given key will be converted. If an `Object` is passed, it must have a required `key` property,
  14885. * specifying view attribute key, and may have an optional `value` property, specifying view attribute value and optional `name`
  14886. * property specifying a view element name from/on which the attribute should be converted. `value` can be given as a `String`,
  14887. * a `RegExp` or a function callback, that takes view attribute value as the only parameter and returns `Boolean`.
  14888. * @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing
  14889. * the model attribute. `value` property may be set as a function that takes a view element and
  14890. * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the value.
  14891. * If `String` is given, the model attribute value will be same as view attribute value.
  14892. * @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.
  14893. * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
  14894. */
  14895. attributeToAttribute( config ) {
  14896. return this.add( upcastAttributeToAttribute( config ) );
  14897. }
  14898. /**
  14899. * View element to model marker conversion helper.
  14900. *
  14901. * This conversion results in creating a model marker. For example, if the marker was stored in a view as an element:
  14902. * `<p>Fo<span data-marker="comment" data-comment-id="7"></span>o</p><p>B<span data-marker="comment" data-comment-id="7"></span>ar</p>`,
  14903. * after the conversion is done, the marker will be available in
  14904. * {@link module:engine/model/model~Model#markers model document markers}.
  14905. *
  14906. * **Note**: When this helper is used in the data upcast in combination with
  14907. * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToData `#markerToData()`} in the data downcast,
  14908. * then invalid HTML code (e.g. a span between table cells) may be produced by the latter converter.
  14909. *
  14910. * In most of the cases, the {@link #dataToMarker} should be used instead.
  14911. *
  14912. * editor.conversion.for( 'upcast' ).elementToMarker( {
  14913. * view: 'marker-search',
  14914. * model: 'search'
  14915. * } );
  14916. *
  14917. * editor.conversion.for( 'upcast' ).elementToMarker( {
  14918. * view: 'marker-search',
  14919. * model: 'search',
  14920. * converterPriority: 'high'
  14921. * } );
  14922. *
  14923. * editor.conversion.for( 'upcast' ).elementToMarker( {
  14924. * view: 'marker-search',
  14925. * model: ( viewElement, conversionApi ) => 'comment:' + viewElement.getAttribute( 'data-comment-id' )
  14926. * } );
  14927. *
  14928. * editor.conversion.for( 'upcast' ).elementToMarker( {
  14929. * view: {
  14930. * name: 'span',
  14931. * attributes: {
  14932. * 'data-marker': 'search'
  14933. * }
  14934. * },
  14935. * model: 'search'
  14936. * } );
  14937. *
  14938. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  14939. * to the conversion process.
  14940. *
  14941. * @method #elementToMarker
  14942. * @param {Object} config Conversion configuration.
  14943. * @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.
  14944. * @param {String|Function} config.model Name of the model marker, or a function that takes a view element and returns
  14945. * a model marker name.
  14946. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  14947. * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
  14948. */
  14949. elementToMarker( config ) {
  14950. return this.add( upcastElementToMarker( config ) );
  14951. }
  14952. /**
  14953. * View-to-model marker conversion helper.
  14954. *
  14955. * Converts view data created by {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToData `#markerToData()`}
  14956. * back to a model marker.
  14957. *
  14958. * This converter looks for specific view elements and view attributes that mark marker boundaries. See
  14959. * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToData `#markerToData()`} to learn what view data
  14960. * is expected by this converter.
  14961. *
  14962. * The `config.view` property is equal to the marker group name to convert.
  14963. *
  14964. * By default, this converter creates markers with the `group:name` name convention (to match the default `markerToData` conversion).
  14965. *
  14966. * The conversion configuration can take a function that will generate a marker name.
  14967. * If such function is set as the `config.model` parameter, it is passed the `name` part from the view element or attribute and it is
  14968. * expected to return a string with the marker name.
  14969. *
  14970. * Basic usage:
  14971. *
  14972. * // Using the default conversion.
  14973. * // In this case, all markers from the `comment` group will be converted.
  14974. * // The conversion will look for `<comment-start>` and `<comment-end>` tags and
  14975. * // `data-comment-start-before`, `data-comment-start-after`,
  14976. * // `data-comment-end-before` and `data-comment-end-after` attributes.
  14977. * editor.conversion.for( 'upcast' ).dataToMarker( {
  14978. * view: 'comment'
  14979. * } );
  14980. *
  14981. * An example of a model that may be generated by this conversion:
  14982. *
  14983. * // View:
  14984. * <p>Foo<comment-start name="commentId:uid"></comment-start>bar</p>
  14985. * <figure data-comment-end-after="commentId:uid" class="image"><img src="abc.jpg" /></figure>
  14986. *
  14987. * // Model:
  14988. * <paragraph>Foo[bar</paragraph>
  14989. * <imageBlock src="abc.jpg"></imageBlock>]
  14990. *
  14991. * Where `[]` are boundaries of a marker that will receive the `comment:commentId:uid` name.
  14992. *
  14993. * Other examples of usage:
  14994. *
  14995. * // Using a custom function which is the same as the default conversion:
  14996. * editor.conversion.for( 'upcast' ).dataToMarker( {
  14997. * view: 'comment',
  14998. * model: ( name, conversionApi ) => 'comment:' + name,
  14999. * } );
  15000. *
  15001. * // Using the converter priority:
  15002. * editor.conversion.for( 'upcast' ).dataToMarker( {
  15003. * view: 'comment',
  15004. * model: ( name, conversionApi ) => 'comment:' + name,
  15005. * converterPriority: 'high'
  15006. * } );
  15007. *
  15008. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  15009. * to the conversion process.
  15010. *
  15011. * @method #dataToMarker
  15012. * @param {Object} config Conversion configuration.
  15013. * @param {String} config.view The marker group name to convert.
  15014. * @param {Function} [config.model] A function that takes the `name` part from the view element or attribute and
  15015. * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the marker name.
  15016. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  15017. * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
  15018. */
  15019. dataToMarker( config ) {
  15020. return this.add( upcastDataToMarker( config ) );
  15021. }
  15022. }
  15023. /**
  15024. * Function factory, creates a converter that converts {@link module:engine/view/documentfragment~DocumentFragment view document fragment}
  15025. * or all children of {@link module:engine/view/element~Element} into
  15026. * {@link module:engine/model/documentfragment~DocumentFragment model document fragment}.
  15027. * This is the "entry-point" converter for upcast (view to model conversion). This converter starts the conversion of all children
  15028. * of passed view document fragment. Those children {@link module:engine/view/node~Node view nodes} are then handled by other converters.
  15029. *
  15030. * This also a "default", last resort converter for all view elements that has not been converted by other converters.
  15031. * When a view element is being converted to the model but it does not have converter specified, that view element
  15032. * will be converted to {@link module:engine/model/documentfragment~DocumentFragment model document fragment} and returned.
  15033. *
  15034. * @returns {Function} Universal converter for view {@link module:engine/view/documentfragment~DocumentFragment fragments} and
  15035. * {@link module:engine/view/element~Element elements} that returns
  15036. * {@link module:engine/model/documentfragment~DocumentFragment model fragment} with children of converted view item.
  15037. */
  15038. function convertToModelFragment() {
  15039. return ( evt, data, conversionApi ) => {
  15040. // Second argument in `consumable.consume` is discarded for ViewDocumentFragment but is needed for ViewElement.
  15041. if ( !data.modelRange && conversionApi.consumable.consume( data.viewItem, { name: true } ) ) {
  15042. const { modelRange, modelCursor } = conversionApi.convertChildren( data.viewItem, data.modelCursor );
  15043. data.modelRange = modelRange;
  15044. data.modelCursor = modelCursor;
  15045. }
  15046. };
  15047. }
  15048. /**
  15049. * Function factory, creates a converter that converts {@link module:engine/view/text~Text} to {@link module:engine/model/text~Text}.
  15050. *
  15051. * @returns {Function} {@link module:engine/view/text~Text View text} converter.
  15052. */
  15053. function convertText() {
  15054. return ( evt, data, { schema, consumable, writer } ) => {
  15055. let position = data.modelCursor;
  15056. // When node is already converted then do nothing.
  15057. if ( !consumable.test( data.viewItem ) ) {
  15058. return;
  15059. }
  15060. if ( !schema.checkChild( position, '$text' ) ) {
  15061. if ( !Object(_model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_4__["isParagraphable"])( position, '$text', schema ) ) {
  15062. return;
  15063. }
  15064. position = Object(_model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_4__["wrapInParagraph"])( position, writer );
  15065. }
  15066. consumable.consume( data.viewItem );
  15067. const text = writer.createText( data.viewItem.data );
  15068. writer.insert( text, position );
  15069. data.modelRange = writer.createRange(
  15070. position,
  15071. position.getShiftedBy( text.offsetSize )
  15072. );
  15073. data.modelCursor = data.modelRange.end;
  15074. };
  15075. }
  15076. /**
  15077. * Function factory, creates a callback function which converts a {@link module:engine/view/selection~Selection
  15078. * view selection} taken from the {@link module:engine/view/document~Document#event:selectionChange} event
  15079. * and sets in on the {@link module:engine/model/document~Document#selection model}.
  15080. *
  15081. * **Note**: because there is no view selection change dispatcher nor any other advanced view selection to model
  15082. * conversion mechanism, the callback should be set directly on view document.
  15083. *
  15084. * view.document.on( 'selectionChange', convertSelectionChange( modelDocument, mapper ) );
  15085. *
  15086. * @param {module:engine/model/model~Model} model Data model.
  15087. * @param {module:engine/conversion/mapper~Mapper} mapper Conversion mapper.
  15088. * @returns {Function} {@link module:engine/view/document~Document#event:selectionChange} callback function.
  15089. */
  15090. function convertSelectionChange( model, mapper ) {
  15091. return ( evt, data ) => {
  15092. const viewSelection = data.newSelection;
  15093. const ranges = [];
  15094. for ( const viewRange of viewSelection.getRanges() ) {
  15095. ranges.push( mapper.toModelRange( viewRange ) );
  15096. }
  15097. const modelSelection = model.createSelection( ranges, { backward: viewSelection.isBackward } );
  15098. if ( !modelSelection.isEqual( model.document.selection ) ) {
  15099. model.change( writer => {
  15100. writer.setSelection( modelSelection );
  15101. } );
  15102. }
  15103. };
  15104. }
  15105. // View element to model element conversion helper.
  15106. //
  15107. // See {@link ~UpcastHelpers#elementToElement `.elementToElement()` upcast helper} for examples.
  15108. //
  15109. // @param {Object} config Conversion configuration.
  15110. // @param {module:engine/view/matcher~MatcherPattern} [config.view] Pattern matching all view elements which should be converted. If not
  15111. // set, the converter will fire for every view element.
  15112. // @param {String|module:engine/model/element~Element|Function} config.model Name of the model element, a model element
  15113. // instance or a function that takes a view element and returns a model element. The model element will be inserted in the model.
  15114. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  15115. // @returns {Function} Conversion helper.
  15116. function upcastElementToElement( config ) {
  15117. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
  15118. const converter = prepareToElementConverter( config );
  15119. const elementName = getViewElementNameFromConfig( config.view );
  15120. const eventName = elementName ? 'element:' + elementName : 'element';
  15121. return dispatcher => {
  15122. dispatcher.on( eventName, converter, { priority: config.converterPriority || 'normal' } );
  15123. };
  15124. }
  15125. // View element to model attribute conversion helper.
  15126. //
  15127. // See {@link ~UpcastHelpers#elementToAttribute `.elementToAttribute()` upcast helper} for examples.
  15128. //
  15129. // @param {Object} config Conversion configuration.
  15130. // @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.
  15131. // @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing
  15132. // the model attribute. `value` property may be set as a function that takes a view element and returns the value.
  15133. // If `String` is given, the model attribute value will be set to `true`.
  15134. // @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.
  15135. // @returns {Function} Conversion helper.
  15136. function upcastElementToAttribute( config ) {
  15137. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
  15138. normalizeModelAttributeConfig( config );
  15139. const converter = prepareToAttributeConverter( config, false );
  15140. const elementName = getViewElementNameFromConfig( config.view );
  15141. const eventName = elementName ? 'element:' + elementName : 'element';
  15142. return dispatcher => {
  15143. dispatcher.on( eventName, converter, { priority: config.converterPriority || 'low' } );
  15144. };
  15145. }
  15146. // View attribute to model attribute conversion helper.
  15147. //
  15148. // See {@link ~UpcastHelpers#attributeToAttribute `.attributeToAttribute()` upcast helper} for examples.
  15149. //
  15150. // @param {Object} config Conversion configuration.
  15151. // @param {String|Object} config.view Specifies which view attribute will be converted. If a `String` is passed,
  15152. // attributes with given key will be converted. If an `Object` is passed, it must have a required `key` property,
  15153. // specifying view attribute key, and may have an optional `value` property, specifying view attribute value and optional `name`
  15154. // property specifying a view element name from/on which the attribute should be converted. `value` can be given as a `String`,
  15155. // a `RegExp` or a function callback, that takes view attribute value as the only parameter and returns `Boolean`.
  15156. // @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing
  15157. // the model attribute. `value` property may be set as a function that takes a view element and returns the value.
  15158. // If `String` is given, the model attribute value will be same as view attribute value.
  15159. // @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.
  15160. // @returns {Function} Conversion helper.
  15161. function upcastAttributeToAttribute( config ) {
  15162. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
  15163. let viewKey = null;
  15164. if ( typeof config.view == 'string' || config.view.key ) {
  15165. viewKey = normalizeViewAttributeKeyValueConfig( config );
  15166. }
  15167. normalizeModelAttributeConfig( config, viewKey );
  15168. const converter = prepareToAttributeConverter( config, true );
  15169. return dispatcher => {
  15170. dispatcher.on( 'element', converter, { priority: config.converterPriority || 'low' } );
  15171. };
  15172. }
  15173. // View element to model marker conversion helper.
  15174. //
  15175. // See {@link ~UpcastHelpers#elementToMarker `.elementToMarker()` upcast helper} for examples.
  15176. //
  15177. // @param {Object} config Conversion configuration.
  15178. // @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.
  15179. // @param {String|Function} config.model Name of the model marker, or a function that takes a view element and returns
  15180. // a model marker name.
  15181. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  15182. // @returns {Function} Conversion helper.
  15183. function upcastElementToMarker( config ) {
  15184. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
  15185. normalizeElementToMarkerConfig( config );
  15186. return upcastElementToElement( config );
  15187. }
  15188. // View data to model marker conversion helper.
  15189. //
  15190. // See {@link ~UpcastHelpers#dataToMarker} to learn more.
  15191. //
  15192. // @param {Object} config
  15193. // @param {String} config.view
  15194. // @param {Function} [config.model]
  15195. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal']
  15196. // @returns {Function} Conversion helper.
  15197. function upcastDataToMarker( config ) {
  15198. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
  15199. // Default conversion.
  15200. if ( !config.model ) {
  15201. config.model = name => {
  15202. return name ? config.view + ':' + name : config.view;
  15203. };
  15204. }
  15205. const converterStart = prepareToElementConverter( normalizeDataToMarkerConfig( config, 'start' ) );
  15206. const converterEnd = prepareToElementConverter( normalizeDataToMarkerConfig( config, 'end' ) );
  15207. return dispatcher => {
  15208. dispatcher.on( 'element:' + config.view + '-start', converterStart, { priority: config.converterPriority || 'normal' } );
  15209. dispatcher.on( 'element:' + config.view + '-end', converterEnd, { priority: config.converterPriority || 'normal' } );
  15210. // Below is a hack that is needed to properly handle `converterPriority` for both elements and attributes.
  15211. // Attribute conversion needs to be performed *after* element conversion.
  15212. // This converter handles both element conversion and attribute conversion, which means that if a single
  15213. // `config.converterPriority` is used, it will lead to problems. For example, if the `'high'` priority is used,
  15214. // the attribute conversion will be performed before a lot of element upcast converters.
  15215. // On the other hand, we want to support `config.converterPriority` and converter overwriting.
  15216. //
  15217. // To make it work, we need to do some extra processing for priority for attribute converter.
  15218. // Priority `'low'` value should be the base value and then we will change it depending on `config.converterPriority` value.
  15219. //
  15220. // This hack probably would not be needed if attributes are upcasted separately.
  15221. //
  15222. const basePriority = _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_3__["default"].get( 'low' );
  15223. const maxPriority = _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_3__["default"].get( 'highest' );
  15224. const priorityFactor = _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_3__["default"].get( config.converterPriority ) / maxPriority; // Number in range [ -1, 1 ].
  15225. dispatcher.on( 'element', upcastAttributeToMarker( config ), { priority: basePriority + priorityFactor } );
  15226. };
  15227. }
  15228. // Function factory, returns a callback function which converts view attributes to a model marker.
  15229. //
  15230. // The converter looks for elements with `data-group-start-before`, `data-group-start-after`, `data-group-end-before`
  15231. // and `data-group-end-after` attributes and inserts `$marker` model elements before/after those elements.
  15232. // `group` part is specified in `config.view`.
  15233. //
  15234. // @param {Object} config
  15235. // @param {String} config.view
  15236. // @param {Function} [config.model]
  15237. // @returns {Function} Marker converter.
  15238. function upcastAttributeToMarker( config ) {
  15239. return ( evt, data, conversionApi ) => {
  15240. const attrName = `data-${ config.view }`;
  15241. // Check if any attribute for the given view item can be consumed before changing the conversion data
  15242. // and consuming view items with these attributes.
  15243. if (
  15244. !conversionApi.consumable.test( data.viewItem, { attributes: attrName + '-end-after' } ) &&
  15245. !conversionApi.consumable.test( data.viewItem, { attributes: attrName + '-start-after' } ) &&
  15246. !conversionApi.consumable.test( data.viewItem, { attributes: attrName + '-end-before' } ) &&
  15247. !conversionApi.consumable.test( data.viewItem, { attributes: attrName + '-start-before' } )
  15248. ) {
  15249. return;
  15250. }
  15251. // This converter wants to add a model element, marking a marker, before/after an element (or maybe even group of elements).
  15252. // To do that, we can use `data.modelRange` which is set on an element (or a group of elements) that has been upcasted.
  15253. // But, if the processed view element has not been upcasted yet (it does not have been converted), we need to
  15254. // fire conversion for its children first, then we will have `data.modelRange` available.
  15255. if ( !data.modelRange ) {
  15256. Object.assign( data, conversionApi.convertChildren( data.viewItem, data.modelCursor ) );
  15257. }
  15258. if ( conversionApi.consumable.consume( data.viewItem, { attributes: attrName + '-end-after' } ) ) {
  15259. addMarkerElements( data.modelRange.end, data.viewItem.getAttribute( attrName + '-end-after' ).split( ',' ) );
  15260. }
  15261. if ( conversionApi.consumable.consume( data.viewItem, { attributes: attrName + '-start-after' } ) ) {
  15262. addMarkerElements( data.modelRange.end, data.viewItem.getAttribute( attrName + '-start-after' ).split( ',' ) );
  15263. }
  15264. if ( conversionApi.consumable.consume( data.viewItem, { attributes: attrName + '-end-before' } ) ) {
  15265. addMarkerElements( data.modelRange.start, data.viewItem.getAttribute( attrName + '-end-before' ).split( ',' ) );
  15266. }
  15267. if ( conversionApi.consumable.consume( data.viewItem, { attributes: attrName + '-start-before' } ) ) {
  15268. addMarkerElements( data.modelRange.start, data.viewItem.getAttribute( attrName + '-start-before' ).split( ',' ) );
  15269. }
  15270. function addMarkerElements( position, markerViewNames ) {
  15271. for ( const markerViewName of markerViewNames ) {
  15272. const markerName = config.model( markerViewName, conversionApi );
  15273. const element = conversionApi.writer.createElement( '$marker', { 'data-name': markerName } );
  15274. conversionApi.writer.insert( element, position );
  15275. if ( data.modelCursor.isEqual( position ) ) {
  15276. data.modelCursor = data.modelCursor.getShiftedBy( 1 );
  15277. } else {
  15278. data.modelCursor = data.modelCursor._getTransformedByInsertion( position, 1 );
  15279. }
  15280. data.modelRange = data.modelRange._getTransformedByInsertion( position, 1 )[ 0 ];
  15281. }
  15282. }
  15283. };
  15284. }
  15285. // Helper function for from-view-element conversion. Checks if `config.view` directly specifies converted view element's name
  15286. // and if so, returns it.
  15287. //
  15288. // @param {Object} config Conversion view config.
  15289. // @returns {String|null} View element name or `null` if name is not directly set.
  15290. function getViewElementNameFromConfig( viewConfig ) {
  15291. if ( typeof viewConfig == 'string' ) {
  15292. return viewConfig;
  15293. }
  15294. if ( typeof viewConfig == 'object' && typeof viewConfig.name == 'string' ) {
  15295. return viewConfig.name;
  15296. }
  15297. return null;
  15298. }
  15299. // Helper for to-model-element conversion. Takes a config object and returns a proper converter function.
  15300. //
  15301. // @param {Object} config Conversion configuration.
  15302. // @returns {Function} View to model converter.
  15303. function prepareToElementConverter( config ) {
  15304. const matcher = new _view_matcher__WEBPACK_IMPORTED_MODULE_0__["default"]( config.view );
  15305. return ( evt, data, conversionApi ) => {
  15306. const matcherResult = matcher.match( data.viewItem );
  15307. if ( !matcherResult ) {
  15308. return;
  15309. }
  15310. const match = matcherResult.match;
  15311. // Force consuming element's name.
  15312. match.name = true;
  15313. if ( !conversionApi.consumable.test( data.viewItem, match ) ) {
  15314. return;
  15315. }
  15316. const modelElement = getModelElement( config.model, data.viewItem, conversionApi );
  15317. if ( !modelElement ) {
  15318. return;
  15319. }
  15320. if ( !conversionApi.safeInsert( modelElement, data.modelCursor ) ) {
  15321. return;
  15322. }
  15323. conversionApi.consumable.consume( data.viewItem, match );
  15324. conversionApi.convertChildren( data.viewItem, modelElement );
  15325. conversionApi.updateConversionResult( modelElement, data );
  15326. };
  15327. }
  15328. // Helper function for upcasting-to-element converter. Takes the model configuration, the converted view element
  15329. // and a writer instance and returns a model element instance to be inserted in the model.
  15330. //
  15331. // @param {String|Function|module:engine/model/element~Element} model Model conversion configuration.
  15332. // @param {module:engine/view/node~Node} input The converted view node.
  15333. // @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi The upcast conversion API.
  15334. function getModelElement( model, input, conversionApi ) {
  15335. if ( model instanceof Function ) {
  15336. return model( input, conversionApi );
  15337. } else {
  15338. return conversionApi.writer.createElement( model );
  15339. }
  15340. }
  15341. // Helper function view-attribute-to-model-attribute helper. Normalizes `config.view` which was set as `String` or
  15342. // as an `Object` with `key`, `value` and `name` properties. Normalized `config.view` has is compatible with
  15343. // {@link module:engine/view/matcher~MatcherPattern}.
  15344. //
  15345. // @param {Object} config Conversion config.
  15346. // @returns {String} Key of the converted view attribute.
  15347. function normalizeViewAttributeKeyValueConfig( config ) {
  15348. if ( typeof config.view == 'string' ) {
  15349. config.view = { key: config.view };
  15350. }
  15351. const key = config.view.key;
  15352. let normalized;
  15353. if ( key == 'class' || key == 'style' ) {
  15354. const keyName = key == 'class' ? 'classes' : 'styles';
  15355. normalized = {
  15356. [ keyName ]: config.view.value
  15357. };
  15358. } else {
  15359. const value = typeof config.view.value == 'undefined' ? /[\s\S]*/ : config.view.value;
  15360. normalized = {
  15361. attributes: {
  15362. [ key ]: value
  15363. }
  15364. };
  15365. }
  15366. if ( config.view.name ) {
  15367. normalized.name = config.view.name;
  15368. }
  15369. config.view = normalized;
  15370. return key;
  15371. }
  15372. // Helper function that normalizes `config.model` in from-model-attribute conversion. `config.model` can be set
  15373. // as a `String`, an `Object` with only `key` property or an `Object` with `key` and `value` properties. Normalized
  15374. // `config.model` is an `Object` with `key` and `value` properties.
  15375. //
  15376. // @param {Object} config Conversion config.
  15377. // @param {String} viewAttributeKeyToCopy Key of the converted view attribute. If it is set, model attribute value
  15378. // will be equal to view attribute value.
  15379. function normalizeModelAttributeConfig( config, viewAttributeKeyToCopy = null ) {
  15380. const defaultModelValue = viewAttributeKeyToCopy === null ? true : viewElement => viewElement.getAttribute( viewAttributeKeyToCopy );
  15381. const key = typeof config.model != 'object' ? config.model : config.model.key;
  15382. const value = typeof config.model != 'object' || typeof config.model.value == 'undefined' ? defaultModelValue : config.model.value;
  15383. config.model = { key, value };
  15384. }
  15385. // Helper for to-model-attribute conversion. Takes the model attribute name and conversion configuration and returns
  15386. // a proper converter function.
  15387. //
  15388. // @param {String} modelAttributeKey The key of the model attribute to set on a model node.
  15389. // @param {Object|Array.<Object>} config Conversion configuration. It is possible to provide multiple configurations in an array.
  15390. // @param {Boolean} shallow If set to `true` the attribute will be set only on top-level nodes. Otherwise, it will be set
  15391. // on all elements in the range.
  15392. function prepareToAttributeConverter( config, shallow ) {
  15393. const matcher = new _view_matcher__WEBPACK_IMPORTED_MODULE_0__["default"]( config.view );
  15394. return ( evt, data, conversionApi ) => {
  15395. const match = matcher.match( data.viewItem );
  15396. // If there is no match, this callback should not do anything.
  15397. if ( !match ) {
  15398. return;
  15399. }
  15400. if ( onlyViewNameIsDefined( config.view, data.viewItem ) ) {
  15401. match.match.name = true;
  15402. } else {
  15403. // Do not test or consume `name` consumable.
  15404. delete match.match.name;
  15405. }
  15406. // Try to consume appropriate values from consumable values list.
  15407. if ( !conversionApi.consumable.test( data.viewItem, match.match ) ) {
  15408. return;
  15409. }
  15410. const modelKey = config.model.key;
  15411. const modelValue = typeof config.model.value == 'function' ?
  15412. config.model.value( data.viewItem, conversionApi ) : config.model.value;
  15413. // Do not convert if attribute building function returned falsy value.
  15414. if ( modelValue === null ) {
  15415. return;
  15416. }
  15417. // Since we are converting to attribute we need a range on which we will set the attribute.
  15418. // If the range is not created yet, let's create it by converting children of the current node first.
  15419. if ( !data.modelRange ) {
  15420. // Convert children and set conversion result as a current data.
  15421. Object.assign( data, conversionApi.convertChildren( data.viewItem, data.modelCursor ) );
  15422. }
  15423. // Set attribute on current `output`. `Schema` is checked inside this helper function.
  15424. const attributeWasSet = setAttributeOn( data.modelRange, { key: modelKey, value: modelValue }, shallow, conversionApi );
  15425. // It may happen that a converter will try to set an attribute that is not allowed in the given context.
  15426. // In such a situation we cannot consume the attribute. See: https://github.com/ckeditor/ckeditor5/pull/9249#issuecomment-815658459.
  15427. if ( attributeWasSet ) {
  15428. conversionApi.consumable.consume( data.viewItem, match.match );
  15429. }
  15430. };
  15431. }
  15432. // Helper function that checks if element name should be consumed in attribute converters.
  15433. //
  15434. // @param {Object} config Conversion view config.
  15435. // @returns {Boolean}
  15436. function onlyViewNameIsDefined( viewConfig, viewItem ) {
  15437. // https://github.com/ckeditor/ckeditor5-engine/issues/1786
  15438. const configToTest = typeof viewConfig == 'function' ? viewConfig( viewItem ) : viewConfig;
  15439. if ( typeof configToTest == 'object' && !getViewElementNameFromConfig( configToTest ) ) {
  15440. return false;
  15441. }
  15442. return !configToTest.classes && !configToTest.attributes && !configToTest.styles;
  15443. }
  15444. // Helper function for to-model-attribute converter. Sets model attribute on given range. Checks {@link module:engine/model/schema~Schema}
  15445. // to ensure proper model structure.
  15446. //
  15447. // If any node on the given range has already defined an attribute with the same name, its value will not be updated.
  15448. //
  15449. // @param {module:engine/model/range~Range} modelRange Model range on which attribute should be set.
  15450. // @param {Object} modelAttribute Model attribute to set.
  15451. // @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion API.
  15452. // @param {Boolean} shallow If set to `true` the attribute will be set only on top-level nodes. Otherwise, it will be set
  15453. // on all elements in the range.
  15454. // @returns {Boolean} `true` if attribute was set on at least one node from given `modelRange`.
  15455. function setAttributeOn( modelRange, modelAttribute, shallow, conversionApi ) {
  15456. let result = false;
  15457. // Set attribute on each item in range according to Schema.
  15458. for ( const node of Array.from( modelRange.getItems( { shallow } ) ) ) {
  15459. // Skip if not allowed.
  15460. if ( !conversionApi.schema.checkAttribute( node, modelAttribute.key ) ) {
  15461. continue;
  15462. }
  15463. // Mark the node as consumed even if the attribute will not be updated because it's in a valid context (schema)
  15464. // and would be converted if the attribute wouldn't be present. See #8921.
  15465. result = true;
  15466. // Do not override the attribute if it's already present.
  15467. if ( node.hasAttribute( modelAttribute.key ) ) {
  15468. continue;
  15469. }
  15470. conversionApi.writer.setAttribute( modelAttribute.key, modelAttribute.value, node );
  15471. }
  15472. return result;
  15473. }
  15474. // Helper function for upcasting-to-marker conversion. Takes the config in a format requested by `upcastElementToMarker()`
  15475. // function and converts it to a format that is supported by `upcastElementToElement()` function.
  15476. //
  15477. // @param {Object} config Conversion configuration.
  15478. function normalizeElementToMarkerConfig( config ) {
  15479. const oldModel = config.model;
  15480. config.model = ( viewElement, conversionApi ) => {
  15481. const markerName = typeof oldModel == 'string' ? oldModel : oldModel( viewElement, conversionApi );
  15482. return conversionApi.writer.createElement( '$marker', { 'data-name': markerName } );
  15483. };
  15484. }
  15485. // Helper function for upcasting-to-marker conversion. Takes the config in a format requested by `upcastDataToMarker()`
  15486. // function and converts it to a format that is supported by `upcastElementToElement()` function.
  15487. //
  15488. // @param {Object} config Conversion configuration.
  15489. function normalizeDataToMarkerConfig( config, type ) {
  15490. const configForElements = {};
  15491. // Upcast <markerGroup-start> and <markerGroup-end> elements.
  15492. configForElements.view = config.view + '-' + type;
  15493. configForElements.model = ( viewElement, conversionApi ) => {
  15494. const viewName = viewElement.getAttribute( 'name' );
  15495. const markerName = config.model( viewName, conversionApi );
  15496. return conversionApi.writer.createElement( '$marker', { 'data-name': markerName } );
  15497. };
  15498. return configForElements;
  15499. }
  15500. /***/ }),
  15501. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/viewconsumable.js":
  15502. /*!**********************************************************************************!*\
  15503. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/viewconsumable.js ***!
  15504. \**********************************************************************************/
  15505. /*! exports provided: default */
  15506. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15507. "use strict";
  15508. __webpack_require__.r(__webpack_exports__);
  15509. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ViewConsumable; });
  15510. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  15511. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  15512. /**
  15513. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  15514. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  15515. */
  15516. /**
  15517. * @module engine/conversion/viewconsumable
  15518. */
  15519. /**
  15520. * Class used for handling consumption of view {@link module:engine/view/element~Element elements},
  15521. * {@link module:engine/view/text~Text text nodes} and {@link module:engine/view/documentfragment~DocumentFragment document fragments}.
  15522. * Element's name and its parts (attributes, classes and styles) can be consumed separately. Consuming an element's name
  15523. * does not consume its attributes, classes and styles.
  15524. * To add items for consumption use {@link module:engine/conversion/viewconsumable~ViewConsumable#add add method}.
  15525. * To test items use {@link module:engine/conversion/viewconsumable~ViewConsumable#test test method}.
  15526. * To consume items use {@link module:engine/conversion/viewconsumable~ViewConsumable#consume consume method}.
  15527. * To revert already consumed items use {@link module:engine/conversion/viewconsumable~ViewConsumable#revert revert method}.
  15528. *
  15529. * viewConsumable.add( element, { name: true } ); // Adds element's name as ready to be consumed.
  15530. * viewConsumable.add( textNode ); // Adds text node for consumption.
  15531. * viewConsumable.add( docFragment ); // Adds document fragment for consumption.
  15532. * viewConsumable.test( element, { name: true } ); // Tests if element's name can be consumed.
  15533. * viewConsumable.test( textNode ); // Tests if text node can be consumed.
  15534. * viewConsumable.test( docFragment ); // Tests if document fragment can be consumed.
  15535. * viewConsumable.consume( element, { name: true } ); // Consume element's name.
  15536. * viewConsumable.consume( textNode ); // Consume text node.
  15537. * viewConsumable.consume( docFragment ); // Consume document fragment.
  15538. * viewConsumable.revert( element, { name: true } ); // Revert already consumed element's name.
  15539. * viewConsumable.revert( textNode ); // Revert already consumed text node.
  15540. * viewConsumable.revert( docFragment ); // Revert already consumed document fragment.
  15541. */
  15542. class ViewConsumable {
  15543. /**
  15544. * Creates new ViewConsumable.
  15545. */
  15546. constructor() {
  15547. /**
  15548. * Map of consumable elements. If {@link module:engine/view/element~Element element} is used as a key,
  15549. * {@link module:engine/conversion/viewconsumable~ViewElementConsumables ViewElementConsumables} instance is stored as value.
  15550. * For {@link module:engine/view/text~Text text nodes} and
  15551. * {@link module:engine/view/documentfragment~DocumentFragment document fragments} boolean value is stored as value.
  15552. *
  15553. * @protected
  15554. * @member {Map.<module:engine/conversion/viewconsumable~ViewElementConsumables|Boolean>}
  15555. */
  15556. this._consumables = new Map();
  15557. }
  15558. /**
  15559. * Adds {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
  15560. * {@link module:engine/view/documentfragment~DocumentFragment document fragment} as ready to be consumed.
  15561. *
  15562. * viewConsumable.add( p, { name: true } ); // Adds element's name to consume.
  15563. * viewConsumable.add( p, { attributes: 'name' } ); // Adds element's attribute.
  15564. * viewConsumable.add( p, { classes: 'foobar' } ); // Adds element's class.
  15565. * viewConsumable.add( p, { styles: 'color' } ); // Adds element's style
  15566. * viewConsumable.add( p, { attributes: 'name', styles: 'color' } ); // Adds attribute and style.
  15567. * viewConsumable.add( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be provided.
  15568. * viewConsumable.add( textNode ); // Adds text node to consume.
  15569. * viewConsumable.add( docFragment ); // Adds document fragment to consume.
  15570. *
  15571. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`
  15572. * attribute is provided - it should be handled separately by providing actual style/class.
  15573. *
  15574. * viewConsumable.add( p, { attributes: 'style' } ); // This call will throw an exception.
  15575. * viewConsumable.add( p, { styles: 'color' } ); // This is properly handled style.
  15576. *
  15577. * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element
  15578. * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
  15579. * @param {Boolean} consumables.name If set to true element's name will be included.
  15580. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names.
  15581. * @param {String|Array.<String>} consumables.classes Class name or array of class names.
  15582. * @param {String|Array.<String>} consumables.styles Style name or array of style names.
  15583. */
  15584. add( element, consumables ) {
  15585. let elementConsumables;
  15586. // For text nodes and document fragments just mark them as consumable.
  15587. if ( element.is( '$text' ) || element.is( 'documentFragment' ) ) {
  15588. this._consumables.set( element, true );
  15589. return;
  15590. }
  15591. // For elements create new ViewElementConsumables or update already existing one.
  15592. if ( !this._consumables.has( element ) ) {
  15593. elementConsumables = new ViewElementConsumables( element );
  15594. this._consumables.set( element, elementConsumables );
  15595. } else {
  15596. elementConsumables = this._consumables.get( element );
  15597. }
  15598. elementConsumables.add( consumables );
  15599. }
  15600. /**
  15601. * Tests if {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
  15602. * {@link module:engine/view/documentfragment~DocumentFragment document fragment} can be consumed.
  15603. * It returns `true` when all items included in method's call can be consumed. Returns `false` when
  15604. * first already consumed item is found and `null` when first non-consumable item is found.
  15605. *
  15606. * viewConsumable.test( p, { name: true } ); // Tests element's name.
  15607. * viewConsumable.test( p, { attributes: 'name' } ); // Tests attribute.
  15608. * viewConsumable.test( p, { classes: 'foobar' } ); // Tests class.
  15609. * viewConsumable.test( p, { styles: 'color' } ); // Tests style.
  15610. * viewConsumable.test( p, { attributes: 'name', styles: 'color' } ); // Tests attribute and style.
  15611. * viewConsumable.test( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be tested.
  15612. * viewConsumable.test( textNode ); // Tests text node.
  15613. * viewConsumable.test( docFragment ); // Tests document fragment.
  15614. *
  15615. * Testing classes and styles as attribute will test if all added classes/styles can be consumed.
  15616. *
  15617. * viewConsumable.test( p, { attributes: 'class' } ); // Tests if all added classes can be consumed.
  15618. * viewConsumable.test( p, { attributes: 'style' } ); // Tests if all added styles can be consumed.
  15619. *
  15620. * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element
  15621. * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
  15622. * @param {Boolean} consumables.name If set to true element's name will be included.
  15623. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names.
  15624. * @param {String|Array.<String>} consumables.classes Class name or array of class names.
  15625. * @param {String|Array.<String>} consumables.styles Style name or array of style names.
  15626. * @returns {Boolean|null} Returns `true` when all items included in method's call can be consumed. Returns `false`
  15627. * when first already consumed item is found and `null` when first non-consumable item is found.
  15628. */
  15629. test( element, consumables ) {
  15630. const elementConsumables = this._consumables.get( element );
  15631. if ( elementConsumables === undefined ) {
  15632. return null;
  15633. }
  15634. // For text nodes and document fragments return stored boolean value.
  15635. if ( element.is( '$text' ) || element.is( 'documentFragment' ) ) {
  15636. return elementConsumables;
  15637. }
  15638. // For elements test consumables object.
  15639. return elementConsumables.test( consumables );
  15640. }
  15641. /**
  15642. * Consumes {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
  15643. * {@link module:engine/view/documentfragment~DocumentFragment document fragment}.
  15644. * It returns `true` when all items included in method's call can be consumed, otherwise returns `false`.
  15645. *
  15646. * viewConsumable.consume( p, { name: true } ); // Consumes element's name.
  15647. * viewConsumable.consume( p, { attributes: 'name' } ); // Consumes element's attribute.
  15648. * viewConsumable.consume( p, { classes: 'foobar' } ); // Consumes element's class.
  15649. * viewConsumable.consume( p, { styles: 'color' } ); // Consumes element's style.
  15650. * viewConsumable.consume( p, { attributes: 'name', styles: 'color' } ); // Consumes attribute and style.
  15651. * viewConsumable.consume( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be consumed.
  15652. * viewConsumable.consume( textNode ); // Consumes text node.
  15653. * viewConsumable.consume( docFragment ); // Consumes document fragment.
  15654. *
  15655. * Consuming classes and styles as attribute will test if all added classes/styles can be consumed.
  15656. *
  15657. * viewConsumable.consume( p, { attributes: 'class' } ); // Consume only if all added classes can be consumed.
  15658. * viewConsumable.consume( p, { attributes: 'style' } ); // Consume only if all added styles can be consumed.
  15659. *
  15660. * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element
  15661. * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
  15662. * @param {Boolean} consumables.name If set to true element's name will be included.
  15663. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names.
  15664. * @param {String|Array.<String>} consumables.classes Class name or array of class names.
  15665. * @param {String|Array.<String>} consumables.styles Style name or array of style names.
  15666. * @returns {Boolean} Returns `true` when all items included in method's call can be consumed,
  15667. * otherwise returns `false`.
  15668. */
  15669. consume( element, consumables ) {
  15670. if ( this.test( element, consumables ) ) {
  15671. if ( element.is( '$text' ) || element.is( 'documentFragment' ) ) {
  15672. // For text nodes and document fragments set value to false.
  15673. this._consumables.set( element, false );
  15674. } else {
  15675. // For elements - consume consumables object.
  15676. this._consumables.get( element ).consume( consumables );
  15677. }
  15678. return true;
  15679. }
  15680. return false;
  15681. }
  15682. /**
  15683. * Reverts {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
  15684. * {@link module:engine/view/documentfragment~DocumentFragment document fragment} so they can be consumed once again.
  15685. * Method does not revert items that were never previously added for consumption, even if they are included in
  15686. * method's call.
  15687. *
  15688. * viewConsumable.revert( p, { name: true } ); // Reverts element's name.
  15689. * viewConsumable.revert( p, { attributes: 'name' } ); // Reverts element's attribute.
  15690. * viewConsumable.revert( p, { classes: 'foobar' } ); // Reverts element's class.
  15691. * viewConsumable.revert( p, { styles: 'color' } ); // Reverts element's style.
  15692. * viewConsumable.revert( p, { attributes: 'name', styles: 'color' } ); // Reverts attribute and style.
  15693. * viewConsumable.revert( p, { classes: [ 'baz', 'bar' ] } ); // Multiple names can be reverted.
  15694. * viewConsumable.revert( textNode ); // Reverts text node.
  15695. * viewConsumable.revert( docFragment ); // Reverts document fragment.
  15696. *
  15697. * Reverting classes and styles as attribute will revert all classes/styles that were previously added for
  15698. * consumption.
  15699. *
  15700. * viewConsumable.revert( p, { attributes: 'class' } ); // Reverts all classes added for consumption.
  15701. * viewConsumable.revert( p, { attributes: 'style' } ); // Reverts all styles added for consumption.
  15702. *
  15703. * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element
  15704. * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
  15705. * @param {Boolean} consumables.name If set to true element's name will be included.
  15706. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names.
  15707. * @param {String|Array.<String>} consumables.classes Class name or array of class names.
  15708. * @param {String|Array.<String>} consumables.styles Style name or array of style names.
  15709. */
  15710. revert( element, consumables ) {
  15711. const elementConsumables = this._consumables.get( element );
  15712. if ( elementConsumables !== undefined ) {
  15713. if ( element.is( '$text' ) || element.is( 'documentFragment' ) ) {
  15714. // For text nodes and document fragments - set consumable to true.
  15715. this._consumables.set( element, true );
  15716. } else {
  15717. // For elements - revert items from consumables object.
  15718. elementConsumables.revert( consumables );
  15719. }
  15720. }
  15721. }
  15722. /**
  15723. * Creates consumable object from {@link module:engine/view/element~Element view element}. Consumable object will include
  15724. * element's name and all its attributes, classes and styles.
  15725. *
  15726. * @static
  15727. * @param {module:engine/view/element~Element} element
  15728. * @returns {Object} consumables
  15729. */
  15730. static consumablesFromElement( element ) {
  15731. const consumables = {
  15732. element,
  15733. name: true,
  15734. attributes: [],
  15735. classes: [],
  15736. styles: []
  15737. };
  15738. const attributes = element.getAttributeKeys();
  15739. for ( const attribute of attributes ) {
  15740. // Skip classes and styles - will be added separately.
  15741. if ( attribute == 'style' || attribute == 'class' ) {
  15742. continue;
  15743. }
  15744. consumables.attributes.push( attribute );
  15745. }
  15746. const classes = element.getClassNames();
  15747. for ( const className of classes ) {
  15748. consumables.classes.push( className );
  15749. }
  15750. const styles = element.getStyleNames();
  15751. for ( const style of styles ) {
  15752. consumables.styles.push( style );
  15753. }
  15754. return consumables;
  15755. }
  15756. /**
  15757. * Creates {@link module:engine/conversion/viewconsumable~ViewConsumable ViewConsumable} instance from
  15758. * {@link module:engine/view/node~Node node} or {@link module:engine/view/documentfragment~DocumentFragment document fragment}.
  15759. * Instance will contain all elements, child nodes, attributes, styles and classes added for consumption.
  15760. *
  15761. * @static
  15762. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} from View node or document fragment
  15763. * from which `ViewConsumable` will be created.
  15764. * @param {module:engine/conversion/viewconsumable~ViewConsumable} [instance] If provided, given `ViewConsumable` instance will be used
  15765. * to add all consumables. It will be returned instead of a new instance.
  15766. */
  15767. static createFrom( from, instance ) {
  15768. if ( !instance ) {
  15769. instance = new ViewConsumable( from );
  15770. }
  15771. if ( from.is( '$text' ) ) {
  15772. instance.add( from );
  15773. return instance;
  15774. }
  15775. // Add `from` itself, if it is an element.
  15776. if ( from.is( 'element' ) ) {
  15777. instance.add( from, ViewConsumable.consumablesFromElement( from ) );
  15778. }
  15779. if ( from.is( 'documentFragment' ) ) {
  15780. instance.add( from );
  15781. }
  15782. for ( const child of from.getChildren() ) {
  15783. instance = ViewConsumable.createFrom( child, instance );
  15784. }
  15785. return instance;
  15786. }
  15787. }
  15788. /**
  15789. * This is a private helper-class for {@link module:engine/conversion/viewconsumable~ViewConsumable}.
  15790. * It represents and manipulates consumable parts of a single {@link module:engine/view/element~Element}.
  15791. *
  15792. * @private
  15793. */
  15794. class ViewElementConsumables {
  15795. /**
  15796. * Creates ViewElementConsumables instance.
  15797. *
  15798. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} from View node or document fragment
  15799. * from which `ViewElementConsumables` is being created.
  15800. */
  15801. constructor( from ) {
  15802. /**
  15803. * @readonly
  15804. * @member {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
  15805. */
  15806. this.element = from;
  15807. /**
  15808. * Flag indicating if name of the element can be consumed.
  15809. *
  15810. * @private
  15811. * @member {Boolean}
  15812. */
  15813. this._canConsumeName = null;
  15814. /**
  15815. * Contains maps of element's consumables: attributes, classes and styles.
  15816. *
  15817. * @private
  15818. * @member {Object}
  15819. */
  15820. this._consumables = {
  15821. attributes: new Map(),
  15822. styles: new Map(),
  15823. classes: new Map()
  15824. };
  15825. }
  15826. /**
  15827. * Adds consumable parts of the {@link module:engine/view/element~Element view element}.
  15828. * Element's name itself can be marked to be consumed (when element's name is consumed its attributes, classes and
  15829. * styles still could be consumed):
  15830. *
  15831. * consumables.add( { name: true } );
  15832. *
  15833. * Attributes classes and styles:
  15834. *
  15835. * consumables.add( { attributes: 'title', classes: 'foo', styles: 'color' } );
  15836. * consumables.add( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );
  15837. *
  15838. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`
  15839. * attribute is provided - it should be handled separately by providing `style` and `class` in consumables object.
  15840. *
  15841. * @param {Object} consumables Object describing which parts of the element can be consumed.
  15842. * @param {Boolean} consumables.name If set to `true` element's name will be added as consumable.
  15843. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names to add as consumable.
  15844. * @param {String|Array.<String>} consumables.classes Class name or array of class names to add as consumable.
  15845. * @param {String|Array.<String>} consumables.styles Style name or array of style names to add as consumable.
  15846. */
  15847. add( consumables ) {
  15848. if ( consumables.name ) {
  15849. this._canConsumeName = true;
  15850. }
  15851. for ( const type in this._consumables ) {
  15852. if ( type in consumables ) {
  15853. this._add( type, consumables[ type ] );
  15854. }
  15855. }
  15856. }
  15857. /**
  15858. * Tests if parts of the {@link module:engine/view/node~Node view node} can be consumed.
  15859. *
  15860. * Element's name can be tested:
  15861. *
  15862. * consumables.test( { name: true } );
  15863. *
  15864. * Attributes classes and styles:
  15865. *
  15866. * consumables.test( { attributes: 'title', classes: 'foo', styles: 'color' } );
  15867. * consumables.test( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );
  15868. *
  15869. * @param {Object} consumables Object describing which parts of the element should be tested.
  15870. * @param {Boolean} consumables.name If set to `true` element's name will be tested.
  15871. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names to test.
  15872. * @param {String|Array.<String>} consumables.classes Class name or array of class names to test.
  15873. * @param {String|Array.<String>} consumables.styles Style name or array of style names to test.
  15874. * @returns {Boolean|null} `true` when all tested items can be consumed, `null` when even one of the items
  15875. * was never marked for consumption and `false` when even one of the items was already consumed.
  15876. */
  15877. test( consumables ) {
  15878. // Check if name can be consumed.
  15879. if ( consumables.name && !this._canConsumeName ) {
  15880. return this._canConsumeName;
  15881. }
  15882. for ( const type in this._consumables ) {
  15883. if ( type in consumables ) {
  15884. const value = this._test( type, consumables[ type ] );
  15885. if ( value !== true ) {
  15886. return value;
  15887. }
  15888. }
  15889. }
  15890. // Return true only if all can be consumed.
  15891. return true;
  15892. }
  15893. /**
  15894. * Consumes parts of {@link module:engine/view/element~Element view element}. This function does not check if consumable item
  15895. * is already consumed - it consumes all consumable items provided.
  15896. * Element's name can be consumed:
  15897. *
  15898. * consumables.consume( { name: true } );
  15899. *
  15900. * Attributes classes and styles:
  15901. *
  15902. * consumables.consume( { attributes: 'title', classes: 'foo', styles: 'color' } );
  15903. * consumables.consume( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );
  15904. *
  15905. * @param {Object} consumables Object describing which parts of the element should be consumed.
  15906. * @param {Boolean} consumables.name If set to `true` element's name will be consumed.
  15907. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names to consume.
  15908. * @param {String|Array.<String>} consumables.classes Class name or array of class names to consume.
  15909. * @param {String|Array.<String>} consumables.styles Style name or array of style names to consume.
  15910. */
  15911. consume( consumables ) {
  15912. if ( consumables.name ) {
  15913. this._canConsumeName = false;
  15914. }
  15915. for ( const type in this._consumables ) {
  15916. if ( type in consumables ) {
  15917. this._consume( type, consumables[ type ] );
  15918. }
  15919. }
  15920. }
  15921. /**
  15922. * Revert already consumed parts of {@link module:engine/view/element~Element view Element}, so they can be consumed once again.
  15923. * Element's name can be reverted:
  15924. *
  15925. * consumables.revert( { name: true } );
  15926. *
  15927. * Attributes classes and styles:
  15928. *
  15929. * consumables.revert( { attributes: 'title', classes: 'foo', styles: 'color' } );
  15930. * consumables.revert( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );
  15931. *
  15932. * @param {Object} consumables Object describing which parts of the element should be reverted.
  15933. * @param {Boolean} consumables.name If set to `true` element's name will be reverted.
  15934. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names to revert.
  15935. * @param {String|Array.<String>} consumables.classes Class name or array of class names to revert.
  15936. * @param {String|Array.<String>} consumables.styles Style name or array of style names to revert.
  15937. */
  15938. revert( consumables ) {
  15939. if ( consumables.name ) {
  15940. this._canConsumeName = true;
  15941. }
  15942. for ( const type in this._consumables ) {
  15943. if ( type in consumables ) {
  15944. this._revert( type, consumables[ type ] );
  15945. }
  15946. }
  15947. }
  15948. /**
  15949. * Helper method that adds consumables of a given type: attribute, class or style.
  15950. *
  15951. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`
  15952. * type is provided - it should be handled separately by providing actual style/class type.
  15953. *
  15954. * @private
  15955. * @param {String} type Type of the consumable item: `attributes`, `classes` or `styles`.
  15956. * @param {String|Array.<String>} item Consumable item or array of items.
  15957. */
  15958. _add( type, item ) {
  15959. const items = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isArray"])( item ) ? item : [ item ];
  15960. const consumables = this._consumables[ type ];
  15961. for ( const name of items ) {
  15962. if ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {
  15963. /**
  15964. * Class and style attributes should be handled separately in
  15965. * {@link module:engine/conversion/viewconsumable~ViewConsumable#add `ViewConsumable#add()`}.
  15966. *
  15967. * What you have done is trying to use:
  15968. *
  15969. * consumables.add( { attributes: [ 'class', 'style' ] } );
  15970. *
  15971. * While each class and style should be registered separately:
  15972. *
  15973. * consumables.add( { classes: 'some-class', styles: 'font-weight' } );
  15974. *
  15975. * @error viewconsumable-invalid-attribute
  15976. */
  15977. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'viewconsumable-invalid-attribute', this );
  15978. }
  15979. consumables.set( name, true );
  15980. if ( type === 'styles' ) {
  15981. for ( const alsoName of this.element.document.stylesProcessor.getRelatedStyles( name ) ) {
  15982. consumables.set( alsoName, true );
  15983. }
  15984. }
  15985. }
  15986. }
  15987. /**
  15988. * Helper method that tests consumables of a given type: attribute, class or style.
  15989. *
  15990. * @private
  15991. * @param {String} type Type of the consumable item: `attributes`, `classes` or `styles`.
  15992. * @param {String|Array.<String>} item Consumable item or array of items.
  15993. * @returns {Boolean|null} Returns `true` if all items can be consumed, `null` when one of the items cannot be
  15994. * consumed and `false` when one of the items is already consumed.
  15995. */
  15996. _test( type, item ) {
  15997. const items = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isArray"])( item ) ? item : [ item ];
  15998. const consumables = this._consumables[ type ];
  15999. for ( const name of items ) {
  16000. if ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {
  16001. const consumableName = name == 'class' ? 'classes' : 'styles';
  16002. // Check all classes/styles if class/style attribute is tested.
  16003. const value = this._test( consumableName, [ ...this._consumables[ consumableName ].keys() ] );
  16004. if ( value !== true ) {
  16005. return value;
  16006. }
  16007. } else {
  16008. const value = consumables.get( name );
  16009. // Return null if attribute is not found.
  16010. if ( value === undefined ) {
  16011. return null;
  16012. }
  16013. if ( !value ) {
  16014. return false;
  16015. }
  16016. }
  16017. }
  16018. return true;
  16019. }
  16020. /**
  16021. * Helper method that consumes items of a given type: attribute, class or style.
  16022. *
  16023. * @private
  16024. * @param {String} type Type of the consumable item: `attributes`, `classes` or `styles`.
  16025. * @param {String|Array.<String>} item Consumable item or array of items.
  16026. */
  16027. _consume( type, item ) {
  16028. const items = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isArray"])( item ) ? item : [ item ];
  16029. const consumables = this._consumables[ type ];
  16030. for ( const name of items ) {
  16031. if ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {
  16032. const consumableName = name == 'class' ? 'classes' : 'styles';
  16033. // If class or style is provided for consumption - consume them all.
  16034. this._consume( consumableName, [ ...this._consumables[ consumableName ].keys() ] );
  16035. } else {
  16036. consumables.set( name, false );
  16037. if ( type == 'styles' ) {
  16038. for ( const toConsume of this.element.document.stylesProcessor.getRelatedStyles( name ) ) {
  16039. consumables.set( toConsume, false );
  16040. }
  16041. }
  16042. }
  16043. }
  16044. }
  16045. /**
  16046. * Helper method that reverts items of a given type: attribute, class or style.
  16047. *
  16048. * @private
  16049. * @param {String} type Type of the consumable item: `attributes`, `classes` or , `styles`.
  16050. * @param {String|Array.<String>} item Consumable item or array of items.
  16051. */
  16052. _revert( type, item ) {
  16053. const items = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isArray"])( item ) ? item : [ item ];
  16054. const consumables = this._consumables[ type ];
  16055. for ( const name of items ) {
  16056. if ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {
  16057. const consumableName = name == 'class' ? 'classes' : 'styles';
  16058. // If class or style is provided for reverting - revert them all.
  16059. this._revert( consumableName, [ ...this._consumables[ consumableName ].keys() ] );
  16060. } else {
  16061. const value = consumables.get( name );
  16062. if ( value === false ) {
  16063. consumables.set( name, true );
  16064. }
  16065. }
  16066. }
  16067. }
  16068. }
  16069. /***/ }),
  16070. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/basichtmlwriter.js":
  16071. /*!**************************************************************************************!*\
  16072. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/basichtmlwriter.js ***!
  16073. \**************************************************************************************/
  16074. /*! exports provided: default */
  16075. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16076. "use strict";
  16077. __webpack_require__.r(__webpack_exports__);
  16078. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BasicHtmlWriter; });
  16079. /**
  16080. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  16081. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  16082. */
  16083. /**
  16084. * @module engine/dataprocessor/basichtmlwriter
  16085. */
  16086. /* globals document */
  16087. /**
  16088. * Basic HTML writer. It uses the native `innerHTML` property for basic conversion
  16089. * from a document fragment to an HTML string.
  16090. *
  16091. * @implements module:engine/dataprocessor/htmlwriter~HtmlWriter
  16092. */
  16093. class BasicHtmlWriter {
  16094. /**
  16095. * Returns an HTML string created from the document fragment.
  16096. *
  16097. * @param {DocumentFragment} fragment
  16098. * @returns {String}
  16099. */
  16100. getHtml( fragment ) {
  16101. const doc = document.implementation.createHTMLDocument( '' );
  16102. const container = doc.createElement( 'div' );
  16103. container.appendChild( fragment );
  16104. return container.innerHTML;
  16105. }
  16106. }
  16107. /***/ }),
  16108. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js":
  16109. /*!****************************************************************************************!*\
  16110. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js ***!
  16111. \****************************************************************************************/
  16112. /*! exports provided: default */
  16113. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16114. "use strict";
  16115. __webpack_require__.r(__webpack_exports__);
  16116. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HtmlDataProcessor; });
  16117. /* harmony import */ var _basichtmlwriter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basichtmlwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/basichtmlwriter.js");
  16118. /* harmony import */ var _view_domconverter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../view/domconverter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js");
  16119. /**
  16120. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  16121. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  16122. */
  16123. /**
  16124. * @module engine/dataprocessor/htmldataprocessor
  16125. */
  16126. /* globals document, DOMParser, Node */
  16127. /**
  16128. * The HTML data processor class.
  16129. * This data processor implementation uses HTML as input and output data.
  16130. *
  16131. * @implements module:engine/dataprocessor/dataprocessor~DataProcessor
  16132. */
  16133. class HtmlDataProcessor {
  16134. /**
  16135. * Creates a new instance of the HTML data processor class.
  16136. *
  16137. * @param {module:engine/view/document~Document} document The view document instance.
  16138. */
  16139. constructor( document ) {
  16140. /**
  16141. * A DOM parser instance used to parse an HTML string to an HTML document.
  16142. *
  16143. * @member {DOMParser}
  16144. */
  16145. this.domParser = new DOMParser();
  16146. /**
  16147. * A DOM converter used to convert DOM elements to view elements.
  16148. *
  16149. * @member {module:engine/view/domconverter~DomConverter}
  16150. */
  16151. this.domConverter = new _view_domconverter__WEBPACK_IMPORTED_MODULE_1__["default"]( document, { renderingMode: 'data' } );
  16152. /**
  16153. * A basic HTML writer instance used to convert DOM elements to an HTML string.
  16154. *
  16155. * @member {module:engine/dataprocessor/htmlwriter~HtmlWriter}
  16156. */
  16157. this.htmlWriter = new _basichtmlwriter__WEBPACK_IMPORTED_MODULE_0__["default"]();
  16158. }
  16159. /**
  16160. * Converts a provided {@link module:engine/view/documentfragment~DocumentFragment document fragment}
  16161. * to data format &mdash; in this case to an HTML string.
  16162. *
  16163. * @param {module:engine/view/documentfragment~DocumentFragment} viewFragment
  16164. * @returns {String} HTML string.
  16165. */
  16166. toData( viewFragment ) {
  16167. // Convert view DocumentFragment to DOM DocumentFragment.
  16168. const domFragment = this.domConverter.viewToDom( viewFragment, document );
  16169. // Convert DOM DocumentFragment to HTML output.
  16170. return this.htmlWriter.getHtml( domFragment );
  16171. }
  16172. /**
  16173. * Converts the provided HTML string to a view tree.
  16174. *
  16175. * @param {String} data An HTML string.
  16176. * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null} A converted view element.
  16177. */
  16178. toView( data ) {
  16179. // Convert input HTML data to DOM DocumentFragment.
  16180. const domFragment = this._toDom( data );
  16181. // Convert DOM DocumentFragment to view DocumentFragment.
  16182. return this.domConverter.domToView( domFragment );
  16183. }
  16184. /**
  16185. * Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data
  16186. * and not processed during the conversion from the DOM to the view elements.
  16187. *
  16188. * The raw data can be later accessed by a
  16189. * {@link module:engine/view/element~Element#getCustomProperty custom property of a view element} called `"$rawContent"`.
  16190. *
  16191. * @param {module:engine/view/matcher~MatcherPattern} pattern Pattern matching all view elements whose content should
  16192. * be treated as raw data.
  16193. */
  16194. registerRawContentMatcher( pattern ) {
  16195. this.domConverter.registerRawContentMatcher( pattern );
  16196. }
  16197. /**
  16198. * If the processor is set to use marked fillers, it will insert `&nbsp;` fillers wrapped in `<span>` elements
  16199. * (`<span data-cke-filler="true">&nbsp;</span>`) instead of regular `&nbsp;` characters.
  16200. *
  16201. * This mode allows for a more precise handling of the block fillers (so they do not leak into the editor content) but
  16202. * bloats the editor data with additional markup.
  16203. *
  16204. * This mode may be required by some features and will be turned on by them automatically.
  16205. *
  16206. * @param {'default'|'marked'} type Whether to use the default or the marked `&nbsp;` block fillers.
  16207. */
  16208. useFillerType( type ) {
  16209. this.domConverter.blockFillerMode = type == 'marked' ? 'markedNbsp' : 'nbsp';
  16210. }
  16211. /**
  16212. * Converts an HTML string to its DOM representation. Returns a document fragment containing nodes parsed from
  16213. * the provided data.
  16214. *
  16215. * @private
  16216. * @param {String} data
  16217. * @returns {DocumentFragment}
  16218. */
  16219. _toDom( data ) {
  16220. const document = this.domParser.parseFromString( data, 'text/html' );
  16221. const fragment = document.createDocumentFragment();
  16222. // The rules for parsing an HTML string can be read on https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inhtml.
  16223. //
  16224. // In short, parsing tokens in an HTML string starts with the so-called "initial" insertion mode. When a DOM parser is in this
  16225. // state and encounters a comment node, it inserts this comment node as the last child of the newly-created `HTMLDocument` object.
  16226. // The parser then proceeds to successive insertion modes during parsing subsequent tokens and appends in the `HTMLDocument` object
  16227. // other nodes (like <html>, <head>, <body>). This causes that the first leading comments from HTML string become the first nodes
  16228. // in the `HTMLDocument` object, but not in the <body> collection, because they are ultimately located before the <html> element.
  16229. //
  16230. // Therefore, so that such leading comments do not disappear, they all are moved from the `HTMLDocument` object to the document
  16231. // fragment, until the <html> element is encountered.
  16232. //
  16233. // See: https://github.com/ckeditor/ckeditor5/issues/9861.
  16234. let documentChildNode = document.firstChild;
  16235. while ( !documentChildNode.isSameNode( document.documentElement ) ) {
  16236. const node = documentChildNode;
  16237. documentChildNode = documentChildNode.nextSibling;
  16238. // It seems that `DOMParser#parseFromString()` adds only comment nodes directly to the `HTMLDocument` object, before the <html>
  16239. // node. The condition below is just to be sure we are moving only comment nodes.
  16240. /* istanbul ignore else */
  16241. if ( node.nodeType == Node.COMMENT_NODE ) {
  16242. fragment.appendChild( node );
  16243. }
  16244. }
  16245. const bodyChildNodes = document.body.childNodes;
  16246. while ( bodyChildNodes.length > 0 ) {
  16247. fragment.appendChild( bodyChildNodes[ 0 ] );
  16248. }
  16249. return fragment;
  16250. }
  16251. }
  16252. /***/ }),
  16253. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/index.js":
  16254. /*!**************************************************************!*\
  16255. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/index.js ***!
  16256. \**************************************************************/
  16257. /*! exports provided: enablePlaceholder, disablePlaceholder, showPlaceholder, hidePlaceholder, needsPlaceholder, EditingController, DataController, Conversion, HtmlDataProcessor, InsertOperation, MarkerOperation, OperationFactory, transformSets, DocumentSelection, Range, LiveRange, LivePosition, Model, TreeWalker, Element, DomConverter, Renderer, ViewDocument, getFillerOffset, Observer, ClickObserver, DomEventObserver, MouseObserver, DowncastWriter, UpcastWriter, Matcher, DomEventData, StylesProcessor, addBackgroundRules, addBorderRules, addMarginRules, addPaddingRules, isColor, isLineStyle, isLength, isPercentage, isRepeat, isPosition, isAttachment, isURL, getBoxSidesValues, getBoxSidesValueReducer, getBoxSidesShorthandValue, getPositionShorthandNormalizer, getShorthandValues */
  16258. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16259. "use strict";
  16260. __webpack_require__.r(__webpack_exports__);
  16261. /* harmony import */ var _view_placeholder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./view/placeholder */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.js");
  16262. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "enablePlaceholder", function() { return _view_placeholder__WEBPACK_IMPORTED_MODULE_0__["enablePlaceholder"]; });
  16263. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "disablePlaceholder", function() { return _view_placeholder__WEBPACK_IMPORTED_MODULE_0__["disablePlaceholder"]; });
  16264. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "showPlaceholder", function() { return _view_placeholder__WEBPACK_IMPORTED_MODULE_0__["showPlaceholder"]; });
  16265. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hidePlaceholder", function() { return _view_placeholder__WEBPACK_IMPORTED_MODULE_0__["hidePlaceholder"]; });
  16266. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "needsPlaceholder", function() { return _view_placeholder__WEBPACK_IMPORTED_MODULE_0__["needsPlaceholder"]; });
  16267. /* harmony import */ var _controller_editingcontroller__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./controller/editingcontroller */ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js");
  16268. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditingController", function() { return _controller_editingcontroller__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  16269. /* harmony import */ var _controller_datacontroller__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./controller/datacontroller */ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js");
  16270. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataController", function() { return _controller_datacontroller__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  16271. /* harmony import */ var _conversion_conversion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conversion/conversion */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.js");
  16272. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Conversion", function() { return _conversion_conversion__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  16273. /* harmony import */ var _dataprocessor_htmldataprocessor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dataprocessor/htmldataprocessor */ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js");
  16274. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HtmlDataProcessor", function() { return _dataprocessor_htmldataprocessor__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  16275. /* harmony import */ var _model_operation_insertoperation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./model/operation/insertoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js");
  16276. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InsertOperation", function() { return _model_operation_insertoperation__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  16277. /* harmony import */ var _model_operation_markeroperation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./model/operation/markeroperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js");
  16278. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkerOperation", function() { return _model_operation_markeroperation__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  16279. /* harmony import */ var _model_operation_operationfactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./model/operation/operationfactory */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js");
  16280. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OperationFactory", function() { return _model_operation_operationfactory__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  16281. /* harmony import */ var _model_operation_transform__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./model/operation/transform */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.js");
  16282. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transformSets", function() { return _model_operation_transform__WEBPACK_IMPORTED_MODULE_8__["transformSets"]; });
  16283. /* harmony import */ var _model_documentselection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./model/documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  16284. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentSelection", function() { return _model_documentselection__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  16285. /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  16286. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return _model_range__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  16287. /* harmony import */ var _model_liverange__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./model/liverange */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js");
  16288. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LiveRange", function() { return _model_liverange__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  16289. /* harmony import */ var _model_liveposition__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./model/liveposition */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js");
  16290. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LivePosition", function() { return _model_liveposition__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  16291. /* harmony import */ var _model_model__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./model/model */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/model.js");
  16292. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Model", function() { return _model_model__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  16293. /* harmony import */ var _model_treewalker__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./model/treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
  16294. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TreeWalker", function() { return _model_treewalker__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  16295. /* harmony import */ var _model_element__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./model/element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  16296. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Element", function() { return _model_element__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  16297. /* harmony import */ var _view_domconverter__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./view/domconverter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js");
  16298. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomConverter", function() { return _view_domconverter__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  16299. /* harmony import */ var _view_renderer__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./view/renderer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/renderer.js");
  16300. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Renderer", function() { return _view_renderer__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  16301. /* harmony import */ var _view_document__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./view/document */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js");
  16302. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewDocument", function() { return _view_document__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  16303. /* harmony import */ var _view_containerelement__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./view/containerelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js");
  16304. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFillerOffset", function() { return _view_containerelement__WEBPACK_IMPORTED_MODULE_19__["getFillerOffset"]; });
  16305. /* harmony import */ var _view_observer_observer__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./view/observer/observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  16306. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Observer", function() { return _view_observer_observer__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  16307. /* harmony import */ var _view_observer_clickobserver__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./view/observer/clickobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.js");
  16308. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClickObserver", function() { return _view_observer_clickobserver__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  16309. /* harmony import */ var _view_observer_domeventobserver__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./view/observer/domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  16310. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEventObserver", function() { return _view_observer_domeventobserver__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  16311. /* harmony import */ var _view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./view/observer/mouseobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js");
  16312. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MouseObserver", function() { return _view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  16313. /* harmony import */ var _view_downcastwriter__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./view/downcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js");
  16314. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DowncastWriter", function() { return _view_downcastwriter__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  16315. /* harmony import */ var _view_upcastwriter__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./view/upcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js");
  16316. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UpcastWriter", function() { return _view_upcastwriter__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  16317. /* harmony import */ var _view_matcher__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./view/matcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js");
  16318. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Matcher", function() { return _view_matcher__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  16319. /* harmony import */ var _view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./view/observer/domeventdata */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js");
  16320. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEventData", function() { return _view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  16321. /* harmony import */ var _view_stylesmap__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./view/stylesmap */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js");
  16322. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StylesProcessor", function() { return _view_stylesmap__WEBPACK_IMPORTED_MODULE_28__["StylesProcessor"]; });
  16323. /* harmony import */ var _view_styles_background__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./view/styles/background */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/background.js");
  16324. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBackgroundRules", function() { return _view_styles_background__WEBPACK_IMPORTED_MODULE_29__["addBackgroundRules"]; });
  16325. /* harmony import */ var _view_styles_border__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./view/styles/border */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/border.js");
  16326. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBorderRules", function() { return _view_styles_border__WEBPACK_IMPORTED_MODULE_30__["addBorderRules"]; });
  16327. /* harmony import */ var _view_styles_margin__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./view/styles/margin */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/margin.js");
  16328. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addMarginRules", function() { return _view_styles_margin__WEBPACK_IMPORTED_MODULE_31__["addMarginRules"]; });
  16329. /* harmony import */ var _view_styles_padding__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./view/styles/padding */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/padding.js");
  16330. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addPaddingRules", function() { return _view_styles_padding__WEBPACK_IMPORTED_MODULE_32__["addPaddingRules"]; });
  16331. /* harmony import */ var _view_styles_utils__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./view/styles/utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js");
  16332. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isColor", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_33__["isColor"]; });
  16333. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLineStyle", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_33__["isLineStyle"]; });
  16334. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_33__["isLength"]; });
  16335. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPercentage", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_33__["isPercentage"]; });
  16336. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRepeat", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_33__["isRepeat"]; });
  16337. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPosition", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_33__["isPosition"]; });
  16338. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isAttachment", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_33__["isAttachment"]; });
  16339. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isURL", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_33__["isURL"]; });
  16340. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValues", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_33__["getBoxSidesValues"]; });
  16341. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValueReducer", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_33__["getBoxSidesValueReducer"]; });
  16342. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesShorthandValue", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_33__["getBoxSidesShorthandValue"]; });
  16343. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getPositionShorthandNormalizer", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_33__["getPositionShorthandNormalizer"]; });
  16344. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getShorthandValues", function() { return _view_styles_utils__WEBPACK_IMPORTED_MODULE_33__["getShorthandValues"]; });
  16345. /**
  16346. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  16347. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  16348. */
  16349. /**
  16350. * @module engine
  16351. */
  16352. /***/ }),
  16353. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/batch.js":
  16354. /*!********************************************************************!*\
  16355. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/batch.js ***!
  16356. \********************************************************************/
  16357. /*! exports provided: default */
  16358. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16359. "use strict";
  16360. __webpack_require__.r(__webpack_exports__);
  16361. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Batch; });
  16362. /**
  16363. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  16364. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  16365. */
  16366. /**
  16367. * @module engine/model/batch
  16368. */
  16369. /**
  16370. * A batch instance groups model changes ({@link module:engine/model/operation/operation~Operation operations}). All operations
  16371. * grouped in a single batch can be reverted together, so you can also think about a batch as of a single undo step. If you want
  16372. * to extend a given undo step, you can add more changes to the batch using {@link module:engine/model/model~Model#enqueueChange}:
  16373. *
  16374. * model.enqueueChange( batch, writer => {
  16375. * writer.insertText( 'foo', paragraph, 'end' );
  16376. * } );
  16377. *
  16378. * @see module:engine/model/model~Model#enqueueChange
  16379. * @see module:engine/model/model~Model#change
  16380. */
  16381. class Batch {
  16382. /**
  16383. * Creates a batch instance.
  16384. *
  16385. * @see module:engine/model/model~Model#enqueueChange
  16386. * @see module:engine/model/model~Model#change
  16387. * @param {'transparent'|'default'} [type='default'] The type of the batch.
  16388. */
  16389. constructor( type = 'default' ) {
  16390. /**
  16391. * An array of operations that compose this batch.
  16392. *
  16393. * @readonly
  16394. * @type {Array.<module:engine/model/operation/operation~Operation>}
  16395. */
  16396. this.operations = [];
  16397. /**
  16398. * The type of the batch.
  16399. *
  16400. * It can be one of the following values:
  16401. * * `'default'` &ndash; All "normal" batches. This is the most commonly used type.
  16402. * * `'transparent'` &ndash; A batch that should be ignored by other features, i.e. an initial batch or collaborative editing
  16403. * changes.
  16404. *
  16405. * @readonly
  16406. * @type {'transparent'|'default'}
  16407. */
  16408. this.type = type;
  16409. }
  16410. /**
  16411. * Returns the base version of this batch, which is equal to the base version of the first operation in the batch.
  16412. * If there are no operations in the batch or neither operation has the base version set, it returns `null`.
  16413. *
  16414. * @readonly
  16415. * @type {Number|null}
  16416. */
  16417. get baseVersion() {
  16418. for ( const op of this.operations ) {
  16419. if ( op.baseVersion !== null ) {
  16420. return op.baseVersion;
  16421. }
  16422. }
  16423. return null;
  16424. }
  16425. /**
  16426. * Adds an operation to the batch instance.
  16427. *
  16428. * @param {module:engine/model/operation/operation~Operation} operation An operation to add.
  16429. * @returns {module:engine/model/operation/operation~Operation} The added operation.
  16430. */
  16431. addOperation( operation ) {
  16432. operation.batch = this;
  16433. this.operations.push( operation );
  16434. return operation;
  16435. }
  16436. }
  16437. /***/ }),
  16438. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/differ.js":
  16439. /*!*********************************************************************!*\
  16440. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/differ.js ***!
  16441. \*********************************************************************/
  16442. /*! exports provided: default */
  16443. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16444. "use strict";
  16445. __webpack_require__.r(__webpack_exports__);
  16446. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Differ; });
  16447. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  16448. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  16449. /**
  16450. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  16451. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  16452. */
  16453. /**
  16454. * @module engine/model/differ
  16455. */
  16456. /**
  16457. * Calculates the difference between two model states.
  16458. *
  16459. * Receives operations that are to be applied on the model document. Marks parts of the model document tree which
  16460. * are changed and saves the state of these elements before the change. Then, it compares saved elements with the
  16461. * changed elements, after all changes are applied on the model document. Calculates the diff between saved
  16462. * elements and new ones and returns a change set.
  16463. */
  16464. class Differ {
  16465. /**
  16466. * Creates a `Differ` instance.
  16467. *
  16468. * @param {module:engine/model/markercollection~MarkerCollection} markerCollection Model's marker collection.
  16469. */
  16470. constructor( markerCollection ) {
  16471. /**
  16472. * Reference to the model's marker collection.
  16473. *
  16474. * @private
  16475. * @type {module:engine/model/markercollection~MarkerCollection}
  16476. */
  16477. this._markerCollection = markerCollection;
  16478. /**
  16479. * A map that stores changes that happened in a given element.
  16480. *
  16481. * The keys of the map are references to the model elements.
  16482. * The values of the map are arrays with changes that were done on this element.
  16483. *
  16484. * @private
  16485. * @type {Map}
  16486. */
  16487. this._changesInElement = new Map();
  16488. /**
  16489. * A map that stores "element's children snapshots". A snapshot is representing children of a given element before
  16490. * the first change was applied on that element. Snapshot items are objects with two properties: `name`,
  16491. * containing the element name (or `'$text'` for a text node) and `attributes` which is a map of the node's attributes.
  16492. *
  16493. * @private
  16494. * @type {Map}
  16495. */
  16496. this._elementSnapshots = new Map();
  16497. /**
  16498. * A map that stores all changed markers.
  16499. *
  16500. * The keys of the map are marker names.
  16501. * The values of the map are objects with the `oldRange` and `newRange` properties. They store the marker range
  16502. * state before and after the change.
  16503. *
  16504. * @private
  16505. * @type {Map}
  16506. */
  16507. this._changedMarkers = new Map();
  16508. /**
  16509. * Stores the number of changes that were processed. Used to order the changes chronologically. It is important
  16510. * when changes are sorted.
  16511. *
  16512. * @private
  16513. * @type {Number}
  16514. */
  16515. this._changeCount = 0;
  16516. /**
  16517. * For efficiency purposes, `Differ` stores the change set returned by the differ after {@link #getChanges} call.
  16518. * Cache is reset each time a new operation is buffered. If the cache has not been reset, {@link #getChanges} will
  16519. * return the cached value instead of calculating it again.
  16520. *
  16521. * This property stores those changes that did not take place in graveyard root.
  16522. *
  16523. * @private
  16524. * @type {Array.<Object>|null}
  16525. */
  16526. this._cachedChanges = null;
  16527. /**
  16528. * For efficiency purposes, `Differ` stores the change set returned by the differ after the {@link #getChanges} call.
  16529. * The cache is reset each time a new operation is buffered. If the cache has not been reset, {@link #getChanges} will
  16530. * return the cached value instead of calculating it again.
  16531. *
  16532. * This property stores all changes evaluated by `Differ`, including those that took place in the graveyard.
  16533. *
  16534. * @private
  16535. * @type {Array.<Object>|null}
  16536. */
  16537. this._cachedChangesWithGraveyard = null;
  16538. }
  16539. /**
  16540. * Informs whether there are any changes buffered in `Differ`.
  16541. *
  16542. * @readonly
  16543. * @type {Boolean}
  16544. */
  16545. get isEmpty() {
  16546. return this._changesInElement.size == 0 && this._changedMarkers.size == 0;
  16547. }
  16548. /**
  16549. * Marks given `item` in differ to be "refreshed". It means that the item will be marked as removed and inserted in the differ changes
  16550. * set, so it will be effectively re-converted when differ changes will be handled by a dispatcher.
  16551. *
  16552. * @param {module:engine/model/item~Item} item Item to refresh.
  16553. */
  16554. refreshItem( item ) {
  16555. if ( this._isInInsertedElement( item.parent ) ) {
  16556. return;
  16557. }
  16558. this._markRemove( item.parent, item.startOffset, item.offsetSize );
  16559. this._markInsert( item.parent, item.startOffset, item.offsetSize );
  16560. const range = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( item );
  16561. for ( const marker of this._markerCollection.getMarkersIntersectingRange( range ) ) {
  16562. const markerRange = marker.getRange();
  16563. this.bufferMarkerChange( marker.name, markerRange, markerRange, marker.affectsData );
  16564. }
  16565. // Clear cache after each buffered operation as it is no longer valid.
  16566. this._cachedChanges = null;
  16567. }
  16568. /**
  16569. * Buffers the given operation. An operation has to be buffered before it is executed.
  16570. *
  16571. * Operation type is checked and it is checked which nodes it will affect. These nodes are then stored in `Differ`
  16572. * in the state before the operation is executed.
  16573. *
  16574. * @param {module:engine/model/operation/operation~Operation} operation An operation to buffer.
  16575. */
  16576. bufferOperation( operation ) {
  16577. // Below we take an operation, check its type, then use its parameters in marking (private) methods.
  16578. // The general rule is to not mark elements inside inserted element. All inserted elements are re-rendered.
  16579. // Marking changes in them would cause a "double" changing then.
  16580. //
  16581. switch ( operation.type ) {
  16582. case 'insert': {
  16583. if ( this._isInInsertedElement( operation.position.parent ) ) {
  16584. return;
  16585. }
  16586. this._markInsert( operation.position.parent, operation.position.offset, operation.nodes.maxOffset );
  16587. break;
  16588. }
  16589. case 'addAttribute':
  16590. case 'removeAttribute':
  16591. case 'changeAttribute': {
  16592. for ( const item of operation.range.getItems( { shallow: true } ) ) {
  16593. if ( this._isInInsertedElement( item.parent ) ) {
  16594. continue;
  16595. }
  16596. this._markAttribute( item );
  16597. }
  16598. break;
  16599. }
  16600. case 'remove':
  16601. case 'move':
  16602. case 'reinsert': {
  16603. // When range is moved to the same position then not mark it as a change.
  16604. // See: https://github.com/ckeditor/ckeditor5-engine/issues/1664.
  16605. if (
  16606. operation.sourcePosition.isEqual( operation.targetPosition ) ||
  16607. operation.sourcePosition.getShiftedBy( operation.howMany ).isEqual( operation.targetPosition )
  16608. ) {
  16609. return;
  16610. }
  16611. const sourceParentInserted = this._isInInsertedElement( operation.sourcePosition.parent );
  16612. const targetParentInserted = this._isInInsertedElement( operation.targetPosition.parent );
  16613. if ( !sourceParentInserted ) {
  16614. this._markRemove( operation.sourcePosition.parent, operation.sourcePosition.offset, operation.howMany );
  16615. }
  16616. if ( !targetParentInserted ) {
  16617. this._markInsert( operation.targetPosition.parent, operation.getMovedRangeStart().offset, operation.howMany );
  16618. }
  16619. break;
  16620. }
  16621. case 'rename': {
  16622. if ( this._isInInsertedElement( operation.position.parent ) ) {
  16623. return;
  16624. }
  16625. this._markRemove( operation.position.parent, operation.position.offset, 1 );
  16626. this._markInsert( operation.position.parent, operation.position.offset, 1 );
  16627. const range = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( operation.position, 1 );
  16628. for ( const marker of this._markerCollection.getMarkersIntersectingRange( range ) ) {
  16629. const markerRange = marker.getRange();
  16630. this.bufferMarkerChange( marker.name, markerRange, markerRange, marker.affectsData );
  16631. }
  16632. break;
  16633. }
  16634. case 'split': {
  16635. const splitElement = operation.splitPosition.parent;
  16636. // Mark that children of the split element were removed.
  16637. if ( !this._isInInsertedElement( splitElement ) ) {
  16638. this._markRemove( splitElement, operation.splitPosition.offset, operation.howMany );
  16639. }
  16640. // Mark that the new element (split copy) was inserted.
  16641. if ( !this._isInInsertedElement( operation.insertionPosition.parent ) ) {
  16642. this._markInsert( operation.insertionPosition.parent, operation.insertionPosition.offset, 1 );
  16643. }
  16644. // If the split took the element from the graveyard, mark that the element from the graveyard was removed.
  16645. if ( operation.graveyardPosition ) {
  16646. this._markRemove( operation.graveyardPosition.parent, operation.graveyardPosition.offset, 1 );
  16647. }
  16648. break;
  16649. }
  16650. case 'merge': {
  16651. // Mark that the merged element was removed.
  16652. const mergedElement = operation.sourcePosition.parent;
  16653. if ( !this._isInInsertedElement( mergedElement.parent ) ) {
  16654. this._markRemove( mergedElement.parent, mergedElement.startOffset, 1 );
  16655. }
  16656. // Mark that the merged element was inserted into graveyard.
  16657. const graveyardParent = operation.graveyardPosition.parent;
  16658. this._markInsert( graveyardParent, operation.graveyardPosition.offset, 1 );
  16659. // Mark that children of merged element were inserted at new parent.
  16660. const mergedIntoElement = operation.targetPosition.parent;
  16661. if ( !this._isInInsertedElement( mergedIntoElement ) ) {
  16662. this._markInsert( mergedIntoElement, operation.targetPosition.offset, mergedElement.maxOffset );
  16663. }
  16664. break;
  16665. }
  16666. }
  16667. // Clear cache after each buffered operation as it is no longer valid.
  16668. this._cachedChanges = null;
  16669. }
  16670. /**
  16671. * Buffers a marker change.
  16672. *
  16673. * @param {String} markerName The name of the marker that changed.
  16674. * @param {module:engine/model/range~Range|null} oldRange Marker range before the change or `null` if the marker has just
  16675. * been created.
  16676. * @param {module:engine/model/range~Range|null} newRange Marker range after the change or `null` if the marker was removed.
  16677. * @param {Boolean} affectsData Flag indicating whether marker affects the editor data.
  16678. */
  16679. bufferMarkerChange( markerName, oldRange, newRange, affectsData ) {
  16680. const buffered = this._changedMarkers.get( markerName );
  16681. if ( !buffered ) {
  16682. this._changedMarkers.set( markerName, {
  16683. oldRange,
  16684. newRange,
  16685. affectsData
  16686. } );
  16687. } else {
  16688. buffered.newRange = newRange;
  16689. buffered.affectsData = affectsData;
  16690. if ( buffered.oldRange == null && buffered.newRange == null ) {
  16691. // The marker is going to be removed (`newRange == null`) but it did not exist before the first buffered change
  16692. // (`buffered.oldRange == null`). In this case, do not keep the marker in buffer at all.
  16693. this._changedMarkers.delete( markerName );
  16694. }
  16695. }
  16696. }
  16697. /**
  16698. * Returns all markers that should be removed as a result of buffered changes.
  16699. *
  16700. * @returns {Array.<Object>} Markers to remove. Each array item is an object containing the `name` and `range` properties.
  16701. */
  16702. getMarkersToRemove() {
  16703. const result = [];
  16704. for ( const [ name, change ] of this._changedMarkers ) {
  16705. if ( change.oldRange != null ) {
  16706. result.push( { name, range: change.oldRange } );
  16707. }
  16708. }
  16709. return result;
  16710. }
  16711. /**
  16712. * Returns all markers which should be added as a result of buffered changes.
  16713. *
  16714. * @returns {Array.<Object>} Markers to add. Each array item is an object containing the `name` and `range` properties.
  16715. */
  16716. getMarkersToAdd() {
  16717. const result = [];
  16718. for ( const [ name, change ] of this._changedMarkers ) {
  16719. if ( change.newRange != null ) {
  16720. result.push( { name, range: change.newRange } );
  16721. }
  16722. }
  16723. return result;
  16724. }
  16725. /**
  16726. * Returns all markers which changed.
  16727. *
  16728. * @returns {Array.<Object>}
  16729. */
  16730. getChangedMarkers() {
  16731. return Array.from( this._changedMarkers ).map( item => (
  16732. {
  16733. name: item[ 0 ],
  16734. data: {
  16735. oldRange: item[ 1 ].oldRange,
  16736. newRange: item[ 1 ].newRange
  16737. }
  16738. }
  16739. ) );
  16740. }
  16741. /**
  16742. * Checks whether some of the buffered changes affect the editor data.
  16743. *
  16744. * Types of changes which affect the editor data:
  16745. *
  16746. * * model structure changes,
  16747. * * attribute changes,
  16748. * * changes of markers which were defined as `affectingData`.
  16749. *
  16750. * @returns {Boolean}
  16751. */
  16752. hasDataChanges() {
  16753. for ( const [ , change ] of this._changedMarkers ) {
  16754. if ( change.affectsData ) {
  16755. return true;
  16756. }
  16757. }
  16758. // If markers do not affect the data, check whether there are some changes in elements.
  16759. return this._changesInElement.size > 0;
  16760. }
  16761. /**
  16762. * Calculates the diff between the old model tree state (the state before the first buffered operations since the last {@link #reset}
  16763. * call) and the new model tree state (actual one). It should be called after all buffered operations are executed.
  16764. *
  16765. * The diff set is returned as an array of {@link module:engine/model/differ~DiffItem diff items}, each describing a change done
  16766. * on the model. The items are sorted by the position on which the change happened. If a position
  16767. * {@link module:engine/model/position~Position#isBefore is before} another one, it will be on an earlier index in the diff set.
  16768. *
  16769. * **Note**: Elements inside inserted element will not have a separate diff item, only the top most element change will be reported.
  16770. *
  16771. * Because calculating the diff is a costly operation, the result is cached. If no new operation was buffered since the
  16772. * previous {@link #getChanges} call, the next call will return the cached value.
  16773. *
  16774. * @param {Object} options Additional options.
  16775. * @param {Boolean} [options.includeChangesInGraveyard=false] If set to `true`, also changes that happened
  16776. * in the graveyard root will be returned. By default, changes in the graveyard root are not returned.
  16777. * @returns {Array.<module:engine/model/differ~DiffItem>} Diff between the old and the new model tree state.
  16778. */
  16779. getChanges( options = { includeChangesInGraveyard: false } ) {
  16780. // If there are cached changes, just return them instead of calculating changes again.
  16781. if ( this._cachedChanges ) {
  16782. if ( options.includeChangesInGraveyard ) {
  16783. return this._cachedChangesWithGraveyard.slice();
  16784. } else {
  16785. return this._cachedChanges.slice();
  16786. }
  16787. }
  16788. // Will contain returned results.
  16789. let diffSet = [];
  16790. // Check all changed elements.
  16791. for ( const element of this._changesInElement.keys() ) {
  16792. // Get changes for this element and sort them.
  16793. const changes = this._changesInElement.get( element ).sort( ( a, b ) => {
  16794. if ( a.offset === b.offset ) {
  16795. if ( a.type != b.type ) {
  16796. // If there are multiple changes at the same position, "remove" change should be first.
  16797. // If the order is different, for example, we would first add some nodes and then removed them
  16798. // (instead of the nodes that we should remove).
  16799. return a.type == 'remove' ? -1 : 1;
  16800. }
  16801. return 0;
  16802. }
  16803. return a.offset < b.offset ? -1 : 1;
  16804. } );
  16805. // Get children of this element before any change was applied on it.
  16806. const snapshotChildren = this._elementSnapshots.get( element );
  16807. // Get snapshot of current element's children.
  16808. const elementChildren = _getChildrenSnapshot( element.getChildren() );
  16809. // Generate actions basing on changes done on element.
  16810. const actions = _generateActionsFromChanges( snapshotChildren.length, changes );
  16811. let i = 0; // Iterator in `elementChildren` array -- iterates through current children of element.
  16812. let j = 0; // Iterator in `snapshotChildren` array -- iterates through old children of element.
  16813. // Process every action.
  16814. for ( const action of actions ) {
  16815. if ( action === 'i' ) {
  16816. // Generate diff item for this element and insert it into the diff set.
  16817. diffSet.push( this._getInsertDiff( element, i, elementChildren[ i ].name ) );
  16818. i++;
  16819. } else if ( action === 'r' ) {
  16820. // Generate diff item for this element and insert it into the diff set.
  16821. diffSet.push( this._getRemoveDiff( element, i, snapshotChildren[ j ].name ) );
  16822. j++;
  16823. } else if ( action === 'a' ) {
  16824. // Take attributes from saved and current children.
  16825. const elementAttributes = elementChildren[ i ].attributes;
  16826. const snapshotAttributes = snapshotChildren[ j ].attributes;
  16827. let range;
  16828. if ( elementChildren[ i ].name == '$text' ) {
  16829. range = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, i ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, i + 1 ) );
  16830. } else {
  16831. const index = element.offsetToIndex( i );
  16832. range = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, i ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element.getChild( index ), 0 ) );
  16833. }
  16834. // Generate diff items for this change (there might be multiple attributes changed and
  16835. // there is a single diff for each of them) and insert them into the diff set.
  16836. diffSet.push( ...this._getAttributesDiff( range, snapshotAttributes, elementAttributes ) );
  16837. i++;
  16838. j++;
  16839. } else {
  16840. // `action` is 'equal'. Child not changed.
  16841. i++;
  16842. j++;
  16843. }
  16844. }
  16845. }
  16846. // Then, sort the changes by the position (change at position before other changes is first).
  16847. diffSet.sort( ( a, b ) => {
  16848. // If the change is in different root, we don't care much, but we'd like to have all changes in given
  16849. // root "together" in the array. So let's just sort them by the root name. It does not matter which root
  16850. // will be processed first.
  16851. if ( a.position.root != b.position.root ) {
  16852. return a.position.root.rootName < b.position.root.rootName ? -1 : 1;
  16853. }
  16854. // If change happens at the same position...
  16855. if ( a.position.isEqual( b.position ) ) {
  16856. // Keep chronological order of operations.
  16857. return a.changeCount - b.changeCount;
  16858. }
  16859. // If positions differ, position "on the left" should be earlier in the result.
  16860. return a.position.isBefore( b.position ) ? -1 : 1;
  16861. } );
  16862. // Glue together multiple changes (mostly on text nodes).
  16863. for ( let i = 1, prevIndex = 0; i < diffSet.length; i++ ) {
  16864. const prevDiff = diffSet[ prevIndex ];
  16865. const thisDiff = diffSet[ i ];
  16866. // Glue remove changes if they happen on text on same position.
  16867. const isConsecutiveTextRemove =
  16868. prevDiff.type == 'remove' && thisDiff.type == 'remove' &&
  16869. prevDiff.name == '$text' && thisDiff.name == '$text' &&
  16870. prevDiff.position.isEqual( thisDiff.position );
  16871. // Glue insert changes if they happen on text on consecutive fragments.
  16872. const isConsecutiveTextAdd =
  16873. prevDiff.type == 'insert' && thisDiff.type == 'insert' &&
  16874. prevDiff.name == '$text' && thisDiff.name == '$text' &&
  16875. prevDiff.position.parent == thisDiff.position.parent &&
  16876. prevDiff.position.offset + prevDiff.length == thisDiff.position.offset;
  16877. // Glue attribute changes if they happen on consecutive fragments and have same key, old value and new value.
  16878. const isConsecutiveAttributeChange =
  16879. prevDiff.type == 'attribute' && thisDiff.type == 'attribute' &&
  16880. prevDiff.position.parent == thisDiff.position.parent &&
  16881. prevDiff.range.isFlat && thisDiff.range.isFlat &&
  16882. prevDiff.position.offset + prevDiff.length == thisDiff.position.offset &&
  16883. prevDiff.attributeKey == thisDiff.attributeKey &&
  16884. prevDiff.attributeOldValue == thisDiff.attributeOldValue &&
  16885. prevDiff.attributeNewValue == thisDiff.attributeNewValue;
  16886. if ( isConsecutiveTextRemove || isConsecutiveTextAdd || isConsecutiveAttributeChange ) {
  16887. prevDiff.length++;
  16888. if ( isConsecutiveAttributeChange ) {
  16889. prevDiff.range.end = prevDiff.range.end.getShiftedBy( 1 );
  16890. }
  16891. diffSet[ i ] = null;
  16892. } else {
  16893. prevIndex = i;
  16894. }
  16895. }
  16896. diffSet = diffSet.filter( v => v );
  16897. // Remove `changeCount` property from diff items. It is used only for sorting and is internal thing.
  16898. for ( const item of diffSet ) {
  16899. delete item.changeCount;
  16900. if ( item.type == 'attribute' ) {
  16901. delete item.position;
  16902. delete item.length;
  16903. }
  16904. }
  16905. this._changeCount = 0;
  16906. // Cache changes.
  16907. this._cachedChangesWithGraveyard = diffSet.slice();
  16908. this._cachedChanges = diffSet.filter( _changesInGraveyardFilter );
  16909. if ( options.includeChangesInGraveyard ) {
  16910. return this._cachedChangesWithGraveyard;
  16911. } else {
  16912. return this._cachedChanges;
  16913. }
  16914. }
  16915. /**
  16916. * Resets `Differ`. Removes all buffered changes.
  16917. */
  16918. reset() {
  16919. this._changesInElement.clear();
  16920. this._elementSnapshots.clear();
  16921. this._changedMarkers.clear();
  16922. this._cachedChanges = null;
  16923. }
  16924. /**
  16925. * Saves and handles an insert change.
  16926. *
  16927. * @private
  16928. * @param {module:engine/model/element~Element} parent
  16929. * @param {Number} offset
  16930. * @param {Number} howMany
  16931. */
  16932. _markInsert( parent, offset, howMany ) {
  16933. const changeItem = { type: 'insert', offset, howMany, count: this._changeCount++ };
  16934. this._markChange( parent, changeItem );
  16935. }
  16936. /**
  16937. * Saves and handles a remove change.
  16938. *
  16939. * @private
  16940. * @param {module:engine/model/element~Element} parent
  16941. * @param {Number} offset
  16942. * @param {Number} howMany
  16943. */
  16944. _markRemove( parent, offset, howMany ) {
  16945. const changeItem = { type: 'remove', offset, howMany, count: this._changeCount++ };
  16946. this._markChange( parent, changeItem );
  16947. this._removeAllNestedChanges( parent, offset, howMany );
  16948. }
  16949. /**
  16950. * Saves and handles an attribute change.
  16951. *
  16952. * @private
  16953. * @param {module:engine/model/item~Item} item
  16954. */
  16955. _markAttribute( item ) {
  16956. const changeItem = { type: 'attribute', offset: item.startOffset, howMany: item.offsetSize, count: this._changeCount++ };
  16957. this._markChange( item.parent, changeItem );
  16958. }
  16959. /**
  16960. * Saves and handles a model change.
  16961. *
  16962. * @private
  16963. * @param {module:engine/model/element~Element} parent
  16964. * @param {Object} changeItem
  16965. */
  16966. _markChange( parent, changeItem ) {
  16967. // First, make a snapshot of this parent's children (it will be made only if it was not made before).
  16968. this._makeSnapshot( parent );
  16969. // Then, get all changes that already were done on the element (empty array if this is the first change).
  16970. const changes = this._getChangesForElement( parent );
  16971. // Then, look through all the changes, and transform them or the new change.
  16972. this._handleChange( changeItem, changes );
  16973. // Add the new change.
  16974. changes.push( changeItem );
  16975. // Remove incorrect changes. During transformation some change might be, for example, included in another.
  16976. // In that case, the change will have `howMany` property set to `0` or less. We need to remove those changes.
  16977. for ( let i = 0; i < changes.length; i++ ) {
  16978. if ( changes[ i ].howMany < 1 ) {
  16979. changes.splice( i, 1 );
  16980. i--;
  16981. }
  16982. }
  16983. }
  16984. /**
  16985. * Gets an array of changes that have already been saved for a given element.
  16986. *
  16987. * @private
  16988. * @param {module:engine/model/element~Element} element
  16989. * @returns {Array.<Object>}
  16990. */
  16991. _getChangesForElement( element ) {
  16992. let changes;
  16993. if ( this._changesInElement.has( element ) ) {
  16994. changes = this._changesInElement.get( element );
  16995. } else {
  16996. changes = [];
  16997. this._changesInElement.set( element, changes );
  16998. }
  16999. return changes;
  17000. }
  17001. /**
  17002. * Saves a children snapshot for a given element.
  17003. *
  17004. * @private
  17005. * @param {module:engine/model/element~Element} element
  17006. */
  17007. _makeSnapshot( element ) {
  17008. if ( !this._elementSnapshots.has( element ) ) {
  17009. this._elementSnapshots.set( element, _getChildrenSnapshot( element.getChildren() ) );
  17010. }
  17011. }
  17012. /**
  17013. * For a given newly saved change, compares it with a change already done on the element and modifies the incoming
  17014. * change and/or the old change.
  17015. *
  17016. * @private
  17017. * @param {Object} inc Incoming (new) change.
  17018. * @param {Array.<Object>} changes An array containing all the changes done on that element.
  17019. */
  17020. _handleChange( inc, changes ) {
  17021. // We need a helper variable that will store how many nodes are to be still handled for this change item.
  17022. // `nodesToHandle` (how many nodes still need to be handled) and `howMany` (how many nodes were affected)
  17023. // needs to be differentiated.
  17024. //
  17025. // This comes up when there are multiple changes that are affected by `inc` change item.
  17026. //
  17027. // For example: assume two insert changes: `{ offset: 2, howMany: 1 }` and `{ offset: 5, howMany: 1 }`.
  17028. // Assume that `inc` change is remove `{ offset: 2, howMany: 2, nodesToHandle: 2 }`.
  17029. //
  17030. // Then, we:
  17031. // - "forget" about first insert change (it is "eaten" by remove),
  17032. // - because of that, at the end we will want to remove only one node (`nodesToHandle = 1`),
  17033. // - but still we have to change offset of the second insert change from `5` to `3`!
  17034. //
  17035. // So, `howMany` does not change throughout items transformation and keeps information about how many nodes were affected,
  17036. // while `nodesToHandle` means how many nodes need to be handled after the change item is transformed by other changes.
  17037. inc.nodesToHandle = inc.howMany;
  17038. for ( const old of changes ) {
  17039. const incEnd = inc.offset + inc.howMany;
  17040. const oldEnd = old.offset + old.howMany;
  17041. if ( inc.type == 'insert' ) {
  17042. if ( old.type == 'insert' ) {
  17043. if ( inc.offset <= old.offset ) {
  17044. old.offset += inc.howMany;
  17045. } else if ( inc.offset < oldEnd ) {
  17046. old.howMany += inc.nodesToHandle;
  17047. inc.nodesToHandle = 0;
  17048. }
  17049. }
  17050. if ( old.type == 'remove' ) {
  17051. if ( inc.offset < old.offset ) {
  17052. old.offset += inc.howMany;
  17053. }
  17054. }
  17055. if ( old.type == 'attribute' ) {
  17056. if ( inc.offset <= old.offset ) {
  17057. old.offset += inc.howMany;
  17058. } else if ( inc.offset < oldEnd ) {
  17059. // This case is more complicated, because attribute change has to be split into two.
  17060. // Example (assume that uppercase and lowercase letters mean different attributes):
  17061. //
  17062. // initial state: abcxyz
  17063. // attribute change: aBCXYz
  17064. // incoming insert: aBCfooXYz
  17065. //
  17066. // Change ranges cannot intersect because each item has to be described exactly (it was either
  17067. // not changed, inserted, removed, or its attribute was changed). That's why old attribute
  17068. // change has to be split and both parts has to be handled separately from now on.
  17069. const howMany = old.howMany;
  17070. old.howMany = inc.offset - old.offset;
  17071. // Add the second part of attribute change to the beginning of processed array so it won't
  17072. // be processed again in this loop.
  17073. changes.unshift( {
  17074. type: 'attribute',
  17075. offset: incEnd,
  17076. howMany: howMany - old.howMany,
  17077. count: this._changeCount++
  17078. } );
  17079. }
  17080. }
  17081. }
  17082. if ( inc.type == 'remove' ) {
  17083. if ( old.type == 'insert' ) {
  17084. if ( incEnd <= old.offset ) {
  17085. old.offset -= inc.howMany;
  17086. } else if ( incEnd <= oldEnd ) {
  17087. if ( inc.offset < old.offset ) {
  17088. const intersectionLength = incEnd - old.offset;
  17089. old.offset = inc.offset;
  17090. old.howMany -= intersectionLength;
  17091. inc.nodesToHandle -= intersectionLength;
  17092. } else {
  17093. old.howMany -= inc.nodesToHandle;
  17094. inc.nodesToHandle = 0;
  17095. }
  17096. } else {
  17097. if ( inc.offset <= old.offset ) {
  17098. inc.nodesToHandle -= old.howMany;
  17099. old.howMany = 0;
  17100. } else if ( inc.offset < oldEnd ) {
  17101. const intersectionLength = oldEnd - inc.offset;
  17102. old.howMany -= intersectionLength;
  17103. inc.nodesToHandle -= intersectionLength;
  17104. }
  17105. }
  17106. }
  17107. if ( old.type == 'remove' ) {
  17108. if ( incEnd <= old.offset ) {
  17109. old.offset -= inc.howMany;
  17110. } else if ( inc.offset < old.offset ) {
  17111. inc.nodesToHandle += old.howMany;
  17112. old.howMany = 0;
  17113. }
  17114. }
  17115. if ( old.type == 'attribute' ) {
  17116. if ( incEnd <= old.offset ) {
  17117. old.offset -= inc.howMany;
  17118. } else if ( inc.offset < old.offset ) {
  17119. const intersectionLength = incEnd - old.offset;
  17120. old.offset = inc.offset;
  17121. old.howMany -= intersectionLength;
  17122. } else if ( inc.offset < oldEnd ) {
  17123. if ( incEnd <= oldEnd ) {
  17124. // On first sight in this case we don't need to split attribute operation into two.
  17125. // However the changes set is later converted to actions (see `_generateActionsFromChanges`).
  17126. // For that reason, no two changes may intersect.
  17127. // So we cannot have an attribute change that "contains" remove change.
  17128. // Attribute change needs to be split.
  17129. const howMany = old.howMany;
  17130. old.howMany = inc.offset - old.offset;
  17131. const howManyAfter = howMany - old.howMany - inc.nodesToHandle;
  17132. // Add the second part of attribute change to the beginning of processed array so it won't
  17133. // be processed again in this loop.
  17134. changes.unshift( {
  17135. type: 'attribute',
  17136. offset: inc.offset,
  17137. howMany: howManyAfter,
  17138. count: this._changeCount++
  17139. } );
  17140. } else {
  17141. old.howMany -= oldEnd - inc.offset;
  17142. }
  17143. }
  17144. }
  17145. }
  17146. if ( inc.type == 'attribute' ) {
  17147. // In case of attribute change, `howMany` should be kept same as `nodesToHandle`. It's not an error.
  17148. if ( old.type == 'insert' ) {
  17149. if ( inc.offset < old.offset && incEnd > old.offset ) {
  17150. if ( incEnd > oldEnd ) {
  17151. // This case is similar to a case described when incoming change was insert and old change was attribute.
  17152. // See comment above.
  17153. //
  17154. // This time incoming change is attribute. We need to split incoming change in this case too.
  17155. // However this time, the second part of the attribute change needs to be processed further
  17156. // because there might be other changes that it collides with.
  17157. const attributePart = {
  17158. type: 'attribute',
  17159. offset: oldEnd,
  17160. howMany: incEnd - oldEnd,
  17161. count: this._changeCount++
  17162. };
  17163. this._handleChange( attributePart, changes );
  17164. changes.push( attributePart );
  17165. }
  17166. inc.nodesToHandle = old.offset - inc.offset;
  17167. inc.howMany = inc.nodesToHandle;
  17168. } else if ( inc.offset >= old.offset && inc.offset < oldEnd ) {
  17169. if ( incEnd > oldEnd ) {
  17170. inc.nodesToHandle = incEnd - oldEnd;
  17171. inc.offset = oldEnd;
  17172. } else {
  17173. inc.nodesToHandle = 0;
  17174. }
  17175. }
  17176. }
  17177. if ( old.type == 'remove' ) {
  17178. // This is a case when attribute change "contains" remove change.
  17179. // The attribute change needs to be split into two because changes cannot intersect.
  17180. if ( inc.offset < old.offset && incEnd > old.offset ) {
  17181. const attributePart = {
  17182. type: 'attribute',
  17183. offset: old.offset,
  17184. howMany: incEnd - old.offset,
  17185. count: this._changeCount++
  17186. };
  17187. this._handleChange( attributePart, changes );
  17188. changes.push( attributePart );
  17189. inc.nodesToHandle = old.offset - inc.offset;
  17190. inc.howMany = inc.nodesToHandle;
  17191. }
  17192. }
  17193. if ( old.type == 'attribute' ) {
  17194. // There are only two conflicting scenarios possible here:
  17195. if ( inc.offset >= old.offset && incEnd <= oldEnd ) {
  17196. // `old` change includes `inc` change, or they are the same.
  17197. inc.nodesToHandle = 0;
  17198. inc.howMany = 0;
  17199. inc.offset = 0;
  17200. } else if ( inc.offset <= old.offset && incEnd >= oldEnd ) {
  17201. // `inc` change includes `old` change.
  17202. old.howMany = 0;
  17203. }
  17204. }
  17205. }
  17206. }
  17207. inc.howMany = inc.nodesToHandle;
  17208. delete inc.nodesToHandle;
  17209. }
  17210. /**
  17211. * Returns an object with a single insert change description.
  17212. *
  17213. * @private
  17214. * @param {module:engine/model/element~Element} parent The element in which the change happened.
  17215. * @param {Number} offset The offset at which change happened.
  17216. * @param {String} name The name of the removed element or `'$text'` for a character.
  17217. * @returns {Object} The diff item.
  17218. */
  17219. _getInsertDiff( parent, offset, name ) {
  17220. return {
  17221. type: 'insert',
  17222. position: _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( parent, offset ),
  17223. name,
  17224. length: 1,
  17225. changeCount: this._changeCount++
  17226. };
  17227. }
  17228. /**
  17229. * Returns an object with a single remove change description.
  17230. *
  17231. * @private
  17232. * @param {module:engine/model/element~Element} parent The element in which change happened.
  17233. * @param {Number} offset The offset at which change happened.
  17234. * @param {String} name The name of the removed element or `'$text'` for a character.
  17235. * @returns {Object} The diff item.
  17236. */
  17237. _getRemoveDiff( parent, offset, name ) {
  17238. return {
  17239. type: 'remove',
  17240. position: _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( parent, offset ),
  17241. name,
  17242. length: 1,
  17243. changeCount: this._changeCount++
  17244. };
  17245. }
  17246. /**
  17247. * Returns an array of objects where each one is a single attribute change description.
  17248. *
  17249. * @private
  17250. * @param {module:engine/model/range~Range} range The range where the change happened.
  17251. * @param {Map} oldAttributes A map, map iterator or compatible object that contains attributes before the change.
  17252. * @param {Map} newAttributes A map, map iterator or compatible object that contains attributes after the change.
  17253. * @returns {Array.<Object>} An array containing one or more diff items.
  17254. */
  17255. _getAttributesDiff( range, oldAttributes, newAttributes ) {
  17256. // Results holder.
  17257. const diffs = [];
  17258. // Clone new attributes as we will be performing changes on this object.
  17259. newAttributes = new Map( newAttributes );
  17260. // Look through old attributes.
  17261. for ( const [ key, oldValue ] of oldAttributes ) {
  17262. // Check what is the new value of the attribute (or if it was removed).
  17263. const newValue = newAttributes.has( key ) ? newAttributes.get( key ) : null;
  17264. // If values are different (or attribute was removed)...
  17265. if ( newValue !== oldValue ) {
  17266. // Add diff item.
  17267. diffs.push( {
  17268. type: 'attribute',
  17269. position: range.start,
  17270. range: range.clone(),
  17271. length: 1,
  17272. attributeKey: key,
  17273. attributeOldValue: oldValue,
  17274. attributeNewValue: newValue,
  17275. changeCount: this._changeCount++
  17276. } );
  17277. }
  17278. // Prevent returning two diff items for the same change.
  17279. newAttributes.delete( key );
  17280. }
  17281. // Look through new attributes that weren't handled above.
  17282. for ( const [ key, newValue ] of newAttributes ) {
  17283. // Each of them is a new attribute. Add diff item.
  17284. diffs.push( {
  17285. type: 'attribute',
  17286. position: range.start,
  17287. range: range.clone(),
  17288. length: 1,
  17289. attributeKey: key,
  17290. attributeOldValue: null,
  17291. attributeNewValue: newValue,
  17292. changeCount: this._changeCount++
  17293. } );
  17294. }
  17295. return diffs;
  17296. }
  17297. /**
  17298. * Checks whether given element or any of its parents is an element that is buffered as an inserted element.
  17299. *
  17300. * @private
  17301. * @param {module:engine/model/element~Element} element Element to check.
  17302. * @returns {Boolean}
  17303. */
  17304. _isInInsertedElement( element ) {
  17305. const parent = element.parent;
  17306. if ( !parent ) {
  17307. return false;
  17308. }
  17309. const changes = this._changesInElement.get( parent );
  17310. const offset = element.startOffset;
  17311. if ( changes ) {
  17312. for ( const change of changes ) {
  17313. if ( change.type == 'insert' && offset >= change.offset && offset < change.offset + change.howMany ) {
  17314. return true;
  17315. }
  17316. }
  17317. }
  17318. return this._isInInsertedElement( parent );
  17319. }
  17320. /**
  17321. * Removes deeply all buffered changes that are registered in elements from range specified by `parent`, `offset`
  17322. * and `howMany`.
  17323. *
  17324. * @private
  17325. * @param {module:engine/model/element~Element} parent
  17326. * @param {Number} offset
  17327. * @param {Number} howMany
  17328. */
  17329. _removeAllNestedChanges( parent, offset, howMany ) {
  17330. const range = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( parent, offset ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( parent, offset + howMany ) );
  17331. for ( const item of range.getItems( { shallow: true } ) ) {
  17332. if ( item.is( 'element' ) ) {
  17333. this._elementSnapshots.delete( item );
  17334. this._changesInElement.delete( item );
  17335. this._removeAllNestedChanges( item, 0, item.maxOffset );
  17336. }
  17337. }
  17338. }
  17339. }
  17340. // Returns an array that is a copy of passed child list with the exception that text nodes are split to one or more
  17341. // objects, each representing one character and attributes set on that character.
  17342. function _getChildrenSnapshot( children ) {
  17343. const snapshot = [];
  17344. for ( const child of children ) {
  17345. if ( child.is( '$text' ) ) {
  17346. for ( let i = 0; i < child.data.length; i++ ) {
  17347. snapshot.push( {
  17348. name: '$text',
  17349. attributes: new Map( child.getAttributes() )
  17350. } );
  17351. }
  17352. } else {
  17353. snapshot.push( {
  17354. name: child.name,
  17355. attributes: new Map( child.getAttributes() )
  17356. } );
  17357. }
  17358. }
  17359. return snapshot;
  17360. }
  17361. // Generates array of actions for given changes set.
  17362. // It simulates what `diff` function does.
  17363. // Generated actions are:
  17364. // - 'e' for 'equal' - when item at that position did not change,
  17365. // - 'i' for 'insert' - when item at that position was inserted,
  17366. // - 'r' for 'remove' - when item at that position was removed,
  17367. // - 'a' for 'attribute' - when item at that position has it attributes changed.
  17368. //
  17369. // Example (assume that uppercase letters have bold attribute, compare with function code):
  17370. //
  17371. // children before: fooBAR
  17372. // children after: foxybAR
  17373. //
  17374. // changes: type: remove, offset: 1, howMany: 1
  17375. // type: insert, offset: 2, howMany: 2
  17376. // type: attribute, offset: 4, howMany: 1
  17377. //
  17378. // expected actions: equal (f), remove (o), equal (o), insert (x), insert (y), attribute (b), equal (A), equal (R)
  17379. //
  17380. // steps taken by th script:
  17381. //
  17382. // 1. change = "type: remove, offset: 1, howMany: 1"; offset = 0; oldChildrenHandled = 0
  17383. // 1.1 between this change and the beginning is one not-changed node, fill with one equal action, one old child has been handled
  17384. // 1.2 this change removes one node, add one remove action
  17385. // 1.3 change last visited `offset` to 1
  17386. // 1.4 since an old child has been removed, one more old child has been handled
  17387. // 1.5 actions at this point are: equal, remove
  17388. //
  17389. // 2. change = "type: insert, offset: 2, howMany: 2"; offset = 1; oldChildrenHandled = 2
  17390. // 2.1 between this change and previous change is one not-changed node, add equal action, another one old children has been handled
  17391. // 2.2 this change inserts two nodes, add two insert actions
  17392. // 2.3 change last visited offset to the end of the inserted range, that is 4
  17393. // 2.4 actions at this point are: equal, remove, equal, insert, insert
  17394. //
  17395. // 3. change = "type: attribute, offset: 4, howMany: 1"; offset = 4, oldChildrenHandled = 3
  17396. // 3.1 between this change and previous change are no not-changed nodes
  17397. // 3.2 this change changes one node, add one attribute action
  17398. // 3.3 change last visited `offset` to the end of change range, that is 5
  17399. // 3.4 since an old child has been changed, one more old child has been handled
  17400. // 3.5 actions at this point are: equal, remove, equal, insert, insert, attribute
  17401. //
  17402. // 4. after loop oldChildrenHandled = 4, oldChildrenLength = 6 (fooBAR is 6 characters)
  17403. // 4.1 fill up with two equal actions
  17404. //
  17405. // The result actions are: equal, remove, equal, insert, insert, attribute, equal, equal.
  17406. function _generateActionsFromChanges( oldChildrenLength, changes ) {
  17407. const actions = [];
  17408. let offset = 0;
  17409. let oldChildrenHandled = 0;
  17410. // Go through all buffered changes.
  17411. for ( const change of changes ) {
  17412. // First, fill "holes" between changes with "equal" actions.
  17413. if ( change.offset > offset ) {
  17414. for ( let i = 0; i < change.offset - offset; i++ ) {
  17415. actions.push( 'e' );
  17416. }
  17417. oldChildrenHandled += change.offset - offset;
  17418. }
  17419. // Then, fill up actions accordingly to change type.
  17420. if ( change.type == 'insert' ) {
  17421. for ( let i = 0; i < change.howMany; i++ ) {
  17422. actions.push( 'i' );
  17423. }
  17424. // The last handled offset is after inserted range.
  17425. offset = change.offset + change.howMany;
  17426. } else if ( change.type == 'remove' ) {
  17427. for ( let i = 0; i < change.howMany; i++ ) {
  17428. actions.push( 'r' );
  17429. }
  17430. // The last handled offset is at the position where the nodes were removed.
  17431. offset = change.offset;
  17432. // We removed `howMany` old nodes, update `oldChildrenHandled`.
  17433. oldChildrenHandled += change.howMany;
  17434. } else {
  17435. actions.push( ...'a'.repeat( change.howMany ).split( '' ) );
  17436. // The last handled offset is at the position after the changed range.
  17437. offset = change.offset + change.howMany;
  17438. // We changed `howMany` old nodes, update `oldChildrenHandled`.
  17439. oldChildrenHandled += change.howMany;
  17440. }
  17441. }
  17442. // Fill "equal" actions at the end of actions set. Use `oldChildrenHandled` to see how many children
  17443. // has not been changed / removed at the end of their parent.
  17444. if ( oldChildrenHandled < oldChildrenLength ) {
  17445. for ( let i = 0; i < oldChildrenLength - oldChildrenHandled - offset; i++ ) {
  17446. actions.push( 'e' );
  17447. }
  17448. }
  17449. return actions;
  17450. }
  17451. // Filter callback for Array.filter that filters out change entries that are in graveyard.
  17452. function _changesInGraveyardFilter( entry ) {
  17453. const posInGy = entry.position && entry.position.root.rootName == '$graveyard';
  17454. const rangeInGy = entry.range && entry.range.root.rootName == '$graveyard';
  17455. return !posInGy && !rangeInGy;
  17456. }
  17457. /**
  17458. * The single diff item.
  17459. *
  17460. * Could be one of:
  17461. *
  17462. * * {@link module:engine/model/differ~DiffItemInsert `DiffItemInsert`},
  17463. * * {@link module:engine/model/differ~DiffItemRemove `DiffItemRemove`},
  17464. * * {@link module:engine/model/differ~DiffItemAttribute `DiffItemAttribute`}.
  17465. *
  17466. * @interface DiffItem
  17467. */
  17468. /**
  17469. * The single diff item for inserted nodes.
  17470. *
  17471. * @class DiffItemInsert
  17472. * @implements module:engine/model/differ~DiffItem
  17473. */
  17474. /**
  17475. * The type of diff item.
  17476. *
  17477. * @member {'insert'} module:engine/model/differ~DiffItemInsert#type
  17478. */
  17479. /**
  17480. * The name of the inserted elements or `'$text'` for a text node.
  17481. *
  17482. * @member {String} module:engine/model/differ~DiffItemInsert#name
  17483. */
  17484. /**
  17485. * The position where the node was inserted.
  17486. *
  17487. * @member {module:engine/model/position~Position} module:engine/model/differ~DiffItemInsert#position
  17488. */
  17489. /**
  17490. * The length of an inserted text node. For elements it is always 1 as each inserted element is counted as a one.
  17491. *
  17492. * @member {Number} module:engine/model/differ~DiffItemInsert#length
  17493. */
  17494. /**
  17495. * The single diff item for removed nodes.
  17496. *
  17497. * @class DiffItemRemove
  17498. * @implements module:engine/model/differ~DiffItem
  17499. */
  17500. /**
  17501. * The type of diff item.
  17502. *
  17503. * @member {'remove'} module:engine/model/differ~DiffItemRemove#type
  17504. */
  17505. /**
  17506. * The name of the removed element or `'$text'` for a text node.
  17507. *
  17508. * @member {String} module:engine/model/differ~DiffItemRemove#name
  17509. */
  17510. /**
  17511. * The position where the node was removed.
  17512. *
  17513. * @member {module:engine/model/position~Position} module:engine/model/differ~DiffItemRemove#position
  17514. */
  17515. /**
  17516. * The length of a removed text node. For elements it is always 1 as each removed element is counted as a one.
  17517. *
  17518. * @member {Number} module:engine/model/differ~DiffItemRemove#length
  17519. */
  17520. /**
  17521. * The single diff item for attribute change.
  17522. *
  17523. * @class DiffItemAttribute
  17524. * @implements module:engine/model/differ~DiffItem
  17525. */
  17526. /**
  17527. * The type of diff item.
  17528. *
  17529. * @member {'attribute'} module:engine/model/differ~DiffItemAttribute#type
  17530. */
  17531. /**
  17532. * The name of the changed attribute.
  17533. *
  17534. * @member {String} module:engine/model/differ~DiffItemAttribute#attributeKey
  17535. */
  17536. /**
  17537. * An attribute previous value (before change).
  17538. *
  17539. * @member {String} module:engine/model/differ~DiffItemAttribute#attributeOldValue
  17540. */
  17541. /**
  17542. * An attribute new value (after change).
  17543. *
  17544. * @member {String} module:engine/model/differ~DiffItemAttribute#attributeNewValue
  17545. */
  17546. /**
  17547. * The range where the change happened.
  17548. *
  17549. * @member {module:engine/model/range~Range} module:engine/model/differ~DiffItemAttribute#range
  17550. */
  17551. /***/ }),
  17552. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/document.js":
  17553. /*!***********************************************************************!*\
  17554. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/document.js ***!
  17555. \***********************************************************************/
  17556. /*! exports provided: default */
  17557. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17558. "use strict";
  17559. __webpack_require__.r(__webpack_exports__);
  17560. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Document; });
  17561. /* harmony import */ var _differ__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./differ */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/differ.js");
  17562. /* harmony import */ var _rootelement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rootelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js");
  17563. /* harmony import */ var _history__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./history */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/history.js");
  17564. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  17565. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  17566. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  17567. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  17568. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  17569. /* harmony import */ var _ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/unicode */ "./node_modules/@ckeditor/ckeditor5-utils/src/unicode.js");
  17570. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  17571. /**
  17572. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  17573. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  17574. */
  17575. /**
  17576. * @module engine/model/document
  17577. */
  17578. // @if CK_DEBUG_ENGINE // const { logDocument } = require( '../dev-utils/utils' );
  17579. const graveyardName = '$graveyard';
  17580. /**
  17581. * Data model's document. It contains the model's structure, its selection and the history of changes.
  17582. *
  17583. * Read more about working with the model in
  17584. * {@glink framework/guides/architecture/editing-engine#model introduction to the the editing engine's architecture}.
  17585. *
  17586. * Usually, the document contains just one {@link module:engine/model/document~Document#roots root element}, so
  17587. * you can retrieve it by just calling {@link module:engine/model/document~Document#getRoot} without specifying its name:
  17588. *
  17589. * model.document.getRoot(); // -> returns the main root
  17590. *
  17591. * However, the document may contain multiple roots – e.g. when the editor has multiple editable areas
  17592. * (e.g. a title and a body of a message).
  17593. *
  17594. * @mixes module:utils/emittermixin~EmitterMixin
  17595. */
  17596. class Document {
  17597. /**
  17598. * Creates an empty document instance with no {@link #roots} (other than
  17599. * the {@link #graveyard graveyard root}).
  17600. */
  17601. constructor( model ) {
  17602. /**
  17603. * The {@link module:engine/model/model~Model model} that the document is a part of.
  17604. *
  17605. * @readonly
  17606. * @type {module:engine/model/model~Model}
  17607. */
  17608. this.model = model;
  17609. /**
  17610. * The document version. It starts from `0` and every operation increases the version number. It is used to ensure that
  17611. * operations are applied on a proper document version.
  17612. *
  17613. * If the {@link module:engine/model/operation/operation~Operation#baseVersion base version} does not match the document version,
  17614. * a {@link module:utils/ckeditorerror~CKEditorError model-document-applyoperation-wrong-version} error is thrown.
  17615. *
  17616. * @type {Number}
  17617. */
  17618. this.version = 0;
  17619. /**
  17620. * The document's history.
  17621. *
  17622. * @readonly
  17623. * @type {module:engine/model/history~History}
  17624. */
  17625. this.history = new _history__WEBPACK_IMPORTED_MODULE_2__["default"]( this );
  17626. /**
  17627. * The selection in this document.
  17628. *
  17629. * @readonly
  17630. * @type {module:engine/model/documentselection~DocumentSelection}
  17631. */
  17632. this.selection = new _documentselection__WEBPACK_IMPORTED_MODULE_3__["default"]( this );
  17633. /**
  17634. * A list of roots that are owned and managed by this document. Use {@link #createRoot} and
  17635. * {@link #getRoot} to manipulate it.
  17636. *
  17637. * @readonly
  17638. * @type {module:utils/collection~Collection}
  17639. */
  17640. this.roots = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__["default"]( { idProperty: 'rootName' } );
  17641. /**
  17642. * The model differ object. Its role is to buffer changes done on the model document and then calculate a diff of those changes.
  17643. *
  17644. * @readonly
  17645. * @type {module:engine/model/differ~Differ}
  17646. */
  17647. this.differ = new _differ__WEBPACK_IMPORTED_MODULE_0__["default"]( model.markers );
  17648. /**
  17649. * Post-fixer callbacks registered to the model document.
  17650. *
  17651. * @private
  17652. * @type {Set.<Function>}
  17653. */
  17654. this._postFixers = new Set();
  17655. /**
  17656. * A boolean indicates whether the selection has changed until
  17657. *
  17658. * @private
  17659. * @type {Boolean}
  17660. */
  17661. this._hasSelectionChangedFromTheLastChangeBlock = false;
  17662. // Graveyard tree root. Document always have a graveyard root, which stores removed nodes.
  17663. this.createRoot( '$root', graveyardName );
  17664. // First, if the operation is a document operation check if it's base version is correct.
  17665. this.listenTo( model, 'applyOperation', ( evt, args ) => {
  17666. const operation = args[ 0 ];
  17667. if ( operation.isDocumentOperation && operation.baseVersion !== this.version ) {
  17668. /**
  17669. * Only operations with matching versions can be applied.
  17670. *
  17671. * @error model-document-applyoperation-wrong-version
  17672. * @param {module:engine/model/operation/operation~Operation} operation
  17673. */
  17674. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"]( 'model-document-applyoperation-wrong-version', this, { operation } );
  17675. }
  17676. }, { priority: 'highest' } );
  17677. // Then, still before an operation is applied on model, buffer the change in differ.
  17678. this.listenTo( model, 'applyOperation', ( evt, args ) => {
  17679. const operation = args[ 0 ];
  17680. if ( operation.isDocumentOperation ) {
  17681. this.differ.bufferOperation( operation );
  17682. }
  17683. }, { priority: 'high' } );
  17684. // After the operation is applied, bump document's version and add the operation to the history.
  17685. this.listenTo( model, 'applyOperation', ( evt, args ) => {
  17686. const operation = args[ 0 ];
  17687. if ( operation.isDocumentOperation ) {
  17688. this.version++;
  17689. this.history.addOperation( operation );
  17690. }
  17691. }, { priority: 'low' } );
  17692. // Listen to selection changes. If selection changed, mark it.
  17693. this.listenTo( this.selection, 'change', () => {
  17694. this._hasSelectionChangedFromTheLastChangeBlock = true;
  17695. } );
  17696. // Buffer marker changes.
  17697. // This is not covered in buffering operations because markers may change outside of them (when they
  17698. // are modified using `model.markers` collection, not through `MarkerOperation`).
  17699. this.listenTo( model.markers, 'update', ( evt, marker, oldRange, newRange ) => {
  17700. // Whenever marker is updated, buffer that change.
  17701. this.differ.bufferMarkerChange( marker.name, oldRange, newRange, marker.affectsData );
  17702. if ( oldRange === null ) {
  17703. // If this is a new marker, add a listener that will buffer change whenever marker changes.
  17704. marker.on( 'change', ( evt, oldRange ) => {
  17705. this.differ.bufferMarkerChange( marker.name, oldRange, marker.getRange(), marker.affectsData );
  17706. } );
  17707. }
  17708. } );
  17709. }
  17710. /**
  17711. * The graveyard tree root. A document always has a graveyard root that stores removed nodes.
  17712. *
  17713. * @readonly
  17714. * @member {module:engine/model/rootelement~RootElement}
  17715. */
  17716. get graveyard() {
  17717. return this.getRoot( graveyardName );
  17718. }
  17719. /**
  17720. * Creates a new root.
  17721. *
  17722. * @param {String} [elementName='$root'] The element name. Defaults to `'$root'` which also has some basic schema defined
  17723. * (`$block`s are allowed inside the `$root`). Make sure to define a proper schema if you use a different name.
  17724. * @param {String} [rootName='main'] A unique root name.
  17725. * @returns {module:engine/model/rootelement~RootElement} The created root.
  17726. */
  17727. createRoot( elementName = '$root', rootName = 'main' ) {
  17728. if ( this.roots.get( rootName ) ) {
  17729. /**
  17730. * A root with the specified name already exists.
  17731. *
  17732. * @error model-document-createroot-name-exists
  17733. * @param {module:engine/model/document~Document} doc
  17734. * @param {String} name
  17735. */
  17736. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"]( 'model-document-createroot-name-exists', this, { name: rootName } );
  17737. }
  17738. const root = new _rootelement__WEBPACK_IMPORTED_MODULE_1__["default"]( this, elementName, rootName );
  17739. this.roots.add( root );
  17740. return root;
  17741. }
  17742. /**
  17743. * Removes all event listeners set by the document instance.
  17744. */
  17745. destroy() {
  17746. this.selection.destroy();
  17747. this.stopListening();
  17748. }
  17749. /**
  17750. * Returns a root by its name.
  17751. *
  17752. * @param {String} [name='main'] A unique root name.
  17753. * @returns {module:engine/model/rootelement~RootElement|null} The root registered under a given name or `null` when
  17754. * there is no root with the given name.
  17755. */
  17756. getRoot( name = 'main' ) {
  17757. return this.roots.get( name );
  17758. }
  17759. /**
  17760. * Returns an array with names of all roots (without the {@link #graveyard}) added to the document.
  17761. *
  17762. * @returns {Array.<String>} Roots names.
  17763. */
  17764. getRootNames() {
  17765. return Array.from( this.roots, root => root.rootName ).filter( name => name != graveyardName );
  17766. }
  17767. /**
  17768. * Used to register a post-fixer callback. A post-fixer mechanism guarantees that the features
  17769. * will operate on a correct model state.
  17770. *
  17771. * An execution of a feature may lead to an incorrect document tree state. The callbacks are used to fix the document tree after
  17772. * it has changed. Post-fixers are fired just after all changes from the outermost change block were applied but
  17773. * before the {@link module:engine/model/document~Document#event:change change event} is fired. If a post-fixer callback made
  17774. * a change, it should return `true`. When this happens, all post-fixers are fired again to check if something else should
  17775. * not be fixed in the new document tree state.
  17776. *
  17777. * As a parameter, a post-fixer callback receives a {@link module:engine/model/writer~Writer writer} instance connected with the
  17778. * executed changes block. Thanks to that, all changes done by the callback will be added to the same
  17779. * {@link module:engine/model/batch~Batch batch} (and undo step) as the original changes. This makes post-fixer changes transparent
  17780. * for the user.
  17781. *
  17782. * An example of a post-fixer is a callback that checks if all the data were removed from the editor. If so, the
  17783. * callback should add an empty paragraph so that the editor is never empty:
  17784. *
  17785. * document.registerPostFixer( writer => {
  17786. * const changes = document.differ.getChanges();
  17787. *
  17788. * // Check if the changes lead to an empty root in the editor.
  17789. * for ( const entry of changes ) {
  17790. * if ( entry.type == 'remove' && entry.position.root.isEmpty ) {
  17791. * writer.insertElement( 'paragraph', entry.position.root, 0 );
  17792. *
  17793. * // It is fine to return early, even if multiple roots would need to be fixed.
  17794. * // All post-fixers will be fired again, so if there are more empty roots, those will be fixed, too.
  17795. * return true;
  17796. * }
  17797. * }
  17798. * } );
  17799. *
  17800. * @param {Function} postFixer
  17801. */
  17802. registerPostFixer( postFixer ) {
  17803. this._postFixers.add( postFixer );
  17804. }
  17805. /**
  17806. * A custom `toJSON()` method to solve child-parent circular dependencies.
  17807. *
  17808. * @returns {Object} A clone of this object with the document property changed to a string.
  17809. */
  17810. toJSON() {
  17811. const json = Object(lodash_es__WEBPACK_IMPORTED_MODULE_9__["clone"])( this );
  17812. // Due to circular references we need to remove parent reference.
  17813. json.selection = '[engine.model.DocumentSelection]';
  17814. json.model = '[engine.model.Model]';
  17815. return json;
  17816. }
  17817. /**
  17818. * Check if there were any changes done on document, and if so, call post-fixers,
  17819. * fire `change` event for features and conversion and then reset the differ.
  17820. * Fire `change:data` event when at least one operation or buffered marker changes the data.
  17821. *
  17822. * @protected
  17823. * @fires change
  17824. * @fires change:data
  17825. * @param {module:engine/model/writer~Writer} writer The writer on which post-fixers will be called.
  17826. */
  17827. _handleChangeBlock( writer ) {
  17828. if ( this._hasDocumentChangedFromTheLastChangeBlock() ) {
  17829. this._callPostFixers( writer );
  17830. // Refresh selection attributes according to the final position in the model after the change.
  17831. this.selection.refresh();
  17832. if ( this.differ.hasDataChanges() ) {
  17833. this.fire( 'change:data', writer.batch );
  17834. } else {
  17835. this.fire( 'change', writer.batch );
  17836. }
  17837. // Theoretically, it is not necessary to refresh selection after change event because
  17838. // post-fixers are the last who should change the model, but just in case...
  17839. this.selection.refresh();
  17840. this.differ.reset();
  17841. }
  17842. this._hasSelectionChangedFromTheLastChangeBlock = false;
  17843. }
  17844. /**
  17845. * Returns whether there is a buffered change or if the selection has changed from the last
  17846. * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()` block}
  17847. * or {@link module:engine/model/model~Model#change `change()` block}.
  17848. *
  17849. * @protected
  17850. * @returns {Boolean} Returns `true` if document has changed from the last `change()` or `enqueueChange()` block.
  17851. */
  17852. _hasDocumentChangedFromTheLastChangeBlock() {
  17853. return !this.differ.isEmpty || this._hasSelectionChangedFromTheLastChangeBlock;
  17854. }
  17855. /**
  17856. * Returns the default root for this document which is either the first root that was added to the document using
  17857. * {@link #createRoot} or the {@link #graveyard graveyard root} if no other roots were created.
  17858. *
  17859. * @protected
  17860. * @returns {module:engine/model/rootelement~RootElement} The default root for this document.
  17861. */
  17862. _getDefaultRoot() {
  17863. for ( const root of this.roots ) {
  17864. if ( root !== this.graveyard ) {
  17865. return root;
  17866. }
  17867. }
  17868. return this.graveyard;
  17869. }
  17870. /**
  17871. * Returns the default range for this selection. The default range is a collapsed range that starts and ends
  17872. * at the beginning of this selection's document {@link #_getDefaultRoot default root}.
  17873. *
  17874. * @protected
  17875. * @returns {module:engine/model/range~Range}
  17876. */
  17877. _getDefaultRange() {
  17878. const defaultRoot = this._getDefaultRoot();
  17879. const model = this.model;
  17880. const schema = model.schema;
  17881. // Find the first position where the selection can be put.
  17882. const position = model.createPositionFromPath( defaultRoot, [ 0 ] );
  17883. const nearestRange = schema.getNearestSelectionRange( position );
  17884. // If valid selection range is not found - return range collapsed at the beginning of the root.
  17885. return nearestRange || model.createRange( position );
  17886. }
  17887. /**
  17888. * Checks whether a given {@link module:engine/model/range~Range range} is a valid range for
  17889. * the {@link #selection document's selection}.
  17890. *
  17891. * @private
  17892. * @param {module:engine/model/range~Range} range A range to check.
  17893. * @returns {Boolean} `true` if `range` is valid, `false` otherwise.
  17894. */
  17895. _validateSelectionRange( range ) {
  17896. return validateTextNodePosition( range.start ) && validateTextNodePosition( range.end );
  17897. }
  17898. /**
  17899. * Performs post-fixer loops. Executes post-fixer callbacks as long as none of them has done any changes to the model.
  17900. *
  17901. * @private
  17902. * @param {module:engine/model/writer~Writer} writer The writer on which post-fixer callbacks will be called.
  17903. */
  17904. _callPostFixers( writer ) {
  17905. let wasFixed = false;
  17906. do {
  17907. for ( const callback of this._postFixers ) {
  17908. // Ensure selection attributes are up to date before each post-fixer.
  17909. // https://github.com/ckeditor/ckeditor5-engine/issues/1673.
  17910. //
  17911. // It might be good to refresh the selection after each operation but at the moment it leads
  17912. // to losing attributes for composition or and spell checking
  17913. // https://github.com/ckeditor/ckeditor5-typing/issues/188
  17914. this.selection.refresh();
  17915. wasFixed = callback( writer );
  17916. if ( wasFixed ) {
  17917. break;
  17918. }
  17919. }
  17920. } while ( wasFixed );
  17921. }
  17922. /**
  17923. * Fired after each {@link module:engine/model/model~Model#enqueueChange `enqueueChange()` block} or the outermost
  17924. * {@link module:engine/model/model~Model#change `change()` block} was executed and the document was changed
  17925. * during that block's execution.
  17926. *
  17927. * The changes which this event will cover include:
  17928. *
  17929. * * document structure changes,
  17930. * * selection changes,
  17931. * * marker changes.
  17932. *
  17933. * If you want to be notified about all these changes, then simply listen to this event like this:
  17934. *
  17935. * model.document.on( 'change', () => {
  17936. * console.log( 'The document has changed!' );
  17937. * } );
  17938. *
  17939. * If, however, you only want to be notified about the data changes, then use the
  17940. * {@link module:engine/model/document~Document#event:change:data change:data} event,
  17941. * which is fired for document structure changes and marker changes (which affects the data).
  17942. *
  17943. * model.document.on( 'change:data', () => {
  17944. * console.log( 'The data has changed!' );
  17945. * } );
  17946. *
  17947. * @event change
  17948. * @param {module:engine/model/batch~Batch} batch The batch that was used in the executed changes block.
  17949. */
  17950. /**
  17951. * It is a narrower version of the {@link #event:change} event. It is fired for changes which
  17952. * affect the editor data. This is:
  17953. *
  17954. * * document structure changes,
  17955. * * marker changes (which affects the data).
  17956. *
  17957. * If you want to be notified about the data changes, then listen to this event:
  17958. *
  17959. * model.document.on( 'change:data', () => {
  17960. * console.log( 'The data has changed!' );
  17961. * } );
  17962. *
  17963. * If you would like to listen to all document changes, then check out the
  17964. * {@link module:engine/model/document~Document#event:change change} event.
  17965. *
  17966. * @event change:data
  17967. * @param {module:engine/model/batch~Batch} batch The batch that was used in the executed changes block.
  17968. */
  17969. // @if CK_DEBUG_ENGINE // log( version = null ) {
  17970. // @if CK_DEBUG_ENGINE // version = version === null ? this.version : version;
  17971. // @if CK_DEBUG_ENGINE // logDocument( this, version );
  17972. // @if CK_DEBUG_ENGINE // }
  17973. }
  17974. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_7__["default"])( Document, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_5__["default"] );
  17975. // Checks whether given range boundary position is valid for document selection, meaning that is not between
  17976. // unicode surrogate pairs or base character and combining marks.
  17977. function validateTextNodePosition( rangeBoundary ) {
  17978. const textNode = rangeBoundary.textNode;
  17979. if ( textNode ) {
  17980. const data = textNode.data;
  17981. const offset = rangeBoundary.offset - textNode.startOffset;
  17982. return !Object(_ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_8__["isInsideSurrogatePair"])( data, offset ) && !Object(_ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_8__["isInsideCombinedSymbol"])( data, offset );
  17983. }
  17984. return true;
  17985. }
  17986. /***/ }),
  17987. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js":
  17988. /*!*******************************************************************************!*\
  17989. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js ***!
  17990. \*******************************************************************************/
  17991. /*! exports provided: default */
  17992. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17993. "use strict";
  17994. __webpack_require__.r(__webpack_exports__);
  17995. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentFragment; });
  17996. /* harmony import */ var _nodelist__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./nodelist */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js");
  17997. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  17998. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  17999. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  18000. /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  18001. /**
  18002. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  18003. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  18004. */
  18005. /**
  18006. * @module module:engine/model/documentfragment
  18007. */
  18008. // @if CK_DEBUG_ENGINE // const { stringifyMap } = require( '../dev-utils/utils' );
  18009. /**
  18010. * DocumentFragment represents a part of model which does not have a common root but its top-level nodes
  18011. * can be seen as siblings. In other words, it is a detached part of model tree, without a root.
  18012. *
  18013. * DocumentFragment has own {@link module:engine/model/markercollection~MarkerCollection}. Markers from this collection
  18014. * will be set to the {@link module:engine/model/model~Model#markers model markers} by a
  18015. * {@link module:engine/model/writer~Writer#insert} function.
  18016. */
  18017. class DocumentFragment {
  18018. /**
  18019. * Creates an empty `DocumentFragment`.
  18020. *
  18021. * **Note:** Constructor of this class shouldn't be used directly in the code.
  18022. * Use the {@link module:engine/model/writer~Writer#createDocumentFragment} method instead.
  18023. *
  18024. * @protected
  18025. * @param {module:engine/model/node~Node|Iterable.<module:engine/model/node~Node>} [children]
  18026. * Nodes to be contained inside the `DocumentFragment`.
  18027. */
  18028. constructor( children ) {
  18029. /**
  18030. * DocumentFragment static markers map. This is a list of names and {@link module:engine/model/range~Range ranges}
  18031. * which will be set as Markers to {@link module:engine/model/model~Model#markers model markers collection}
  18032. * when DocumentFragment will be inserted to the document.
  18033. *
  18034. * @readonly
  18035. * @member {Map<String,module:engine/model/range~Range>} module:engine/model/documentfragment~DocumentFragment#markers
  18036. */
  18037. this.markers = new Map();
  18038. /**
  18039. * List of nodes contained inside the document fragment.
  18040. *
  18041. * @private
  18042. * @member {module:engine/model/nodelist~NodeList} module:engine/model/documentfragment~DocumentFragment#_children
  18043. */
  18044. this._children = new _nodelist__WEBPACK_IMPORTED_MODULE_0__["default"]();
  18045. if ( children ) {
  18046. this._insertChild( 0, children );
  18047. }
  18048. }
  18049. /**
  18050. * Returns an iterator that iterates over all nodes contained inside this document fragment.
  18051. *
  18052. * @returns {Iterable.<module:engine/model/node~Node>}
  18053. */
  18054. [ Symbol.iterator ]() {
  18055. return this.getChildren();
  18056. }
  18057. /**
  18058. * Number of this document fragment's children.
  18059. *
  18060. * @readonly
  18061. * @type {Number}
  18062. */
  18063. get childCount() {
  18064. return this._children.length;
  18065. }
  18066. /**
  18067. * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all of this document fragment's children.
  18068. *
  18069. * @readonly
  18070. * @type {Number}
  18071. */
  18072. get maxOffset() {
  18073. return this._children.maxOffset;
  18074. }
  18075. /**
  18076. * Is `true` if there are no nodes inside this document fragment, `false` otherwise.
  18077. *
  18078. * @readonly
  18079. * @type {Boolean}
  18080. */
  18081. get isEmpty() {
  18082. return this.childCount === 0;
  18083. }
  18084. /**
  18085. * Artificial root of `DocumentFragment`. Returns itself. Added for compatibility reasons.
  18086. *
  18087. * @readonly
  18088. * @type {module:engine/model/documentfragment~DocumentFragment}
  18089. */
  18090. get root() {
  18091. return this;
  18092. }
  18093. /**
  18094. * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.
  18095. *
  18096. * @readonly
  18097. * @type {null}
  18098. */
  18099. get parent() {
  18100. return null;
  18101. }
  18102. /**
  18103. * Checks whether this object is of the given type.
  18104. *
  18105. * docFrag.is( 'documentFragment' ); // -> true
  18106. * docFrag.is( 'model:documentFragment' ); // -> true
  18107. *
  18108. * docFrag.is( 'view:documentFragment' ); // -> false
  18109. * docFrag.is( 'element' ); // -> false
  18110. * docFrag.is( 'node' ); // -> false
  18111. *
  18112. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  18113. *
  18114. * @param {String} type
  18115. * @returns {Boolean}
  18116. */
  18117. is( type ) {
  18118. return type === 'documentFragment' || type === 'model:documentFragment';
  18119. }
  18120. /**
  18121. * Gets the child at the given index. Returns `null` if incorrect index was passed.
  18122. *
  18123. * @param {Number} index Index of child.
  18124. * @returns {module:engine/model/node~Node|null} Child node.
  18125. */
  18126. getChild( index ) {
  18127. return this._children.getNode( index );
  18128. }
  18129. /**
  18130. * Returns an iterator that iterates over all of this document fragment's children.
  18131. *
  18132. * @returns {Iterable.<module:engine/model/node~Node>}
  18133. */
  18134. getChildren() {
  18135. return this._children[ Symbol.iterator ]();
  18136. }
  18137. /**
  18138. * Returns an index of the given child node. Returns `null` if given node is not a child of this document fragment.
  18139. *
  18140. * @param {module:engine/model/node~Node} node Child node to look for.
  18141. * @returns {Number|null} Child node's index.
  18142. */
  18143. getChildIndex( node ) {
  18144. return this._children.getNodeIndex( node );
  18145. }
  18146. /**
  18147. * Returns the starting offset of given child. Starting offset is equal to the sum of
  18148. * {@link module:engine/model/node~Node#offsetSize offset sizes} of all node's siblings that are before it. Returns `null` if
  18149. * given node is not a child of this document fragment.
  18150. *
  18151. * @param {module:engine/model/node~Node} node Child node to look for.
  18152. * @returns {Number|null} Child node's starting offset.
  18153. */
  18154. getChildStartOffset( node ) {
  18155. return this._children.getNodeStartOffset( node );
  18156. }
  18157. /**
  18158. * Returns path to a `DocumentFragment`, which is an empty array. Added for compatibility reasons.
  18159. *
  18160. * @returns {Array}
  18161. */
  18162. getPath() {
  18163. return [];
  18164. }
  18165. /**
  18166. * Returns a descendant node by its path relative to this element.
  18167. *
  18168. * // <this>a<b>c</b></this>
  18169. * this.getNodeByPath( [ 0 ] ); // -> "a"
  18170. * this.getNodeByPath( [ 1 ] ); // -> <b>
  18171. * this.getNodeByPath( [ 1, 0 ] ); // -> "c"
  18172. *
  18173. * @param {Array.<Number>} relativePath Path of the node to find, relative to this element.
  18174. * @returns {module:engine/model/node~Node|module:engine/model/documentfragment~DocumentFragment}
  18175. */
  18176. getNodeByPath( relativePath ) {
  18177. let node = this; // eslint-disable-line consistent-this
  18178. for ( const index of relativePath ) {
  18179. node = node.getChild( node.offsetToIndex( index ) );
  18180. }
  18181. return node;
  18182. }
  18183. /**
  18184. * Converts offset "position" to index "position".
  18185. *
  18186. * Returns index of a node that occupies given offset. If given offset is too low, returns `0`. If given offset is
  18187. * too high, returns index after last child}.
  18188. *
  18189. * const textNode = new Text( 'foo' );
  18190. * const pElement = new Element( 'p' );
  18191. * const docFrag = new DocumentFragment( [ textNode, pElement ] );
  18192. * docFrag.offsetToIndex( -1 ); // Returns 0, because offset is too low.
  18193. * docFrag.offsetToIndex( 0 ); // Returns 0, because offset 0 is taken by `textNode` which is at index 0.
  18194. * docFrag.offsetToIndex( 1 ); // Returns 0, because `textNode` has `offsetSize` equal to 3, so it occupies offset 1 too.
  18195. * docFrag.offsetToIndex( 2 ); // Returns 0.
  18196. * docFrag.offsetToIndex( 3 ); // Returns 1.
  18197. * docFrag.offsetToIndex( 4 ); // Returns 2. There are no nodes at offset 4, so last available index is returned.
  18198. *
  18199. * @param {Number} offset Offset to look for.
  18200. * @returns {Number} Index of a node that occupies given offset.
  18201. */
  18202. offsetToIndex( offset ) {
  18203. return this._children.offsetToIndex( offset );
  18204. }
  18205. /**
  18206. * Converts `DocumentFragment` instance to plain object and returns it.
  18207. * Takes care of converting all of this document fragment's children.
  18208. *
  18209. * @returns {Object} `DocumentFragment` instance converted to plain object.
  18210. */
  18211. toJSON() {
  18212. const json = [];
  18213. for ( const node of this._children ) {
  18214. json.push( node.toJSON() );
  18215. }
  18216. return json;
  18217. }
  18218. /**
  18219. * Creates a `DocumentFragment` instance from given plain object (i.e. parsed JSON string).
  18220. * Converts `DocumentFragment` children to proper nodes.
  18221. *
  18222. * @param {Object} json Plain object to be converted to `DocumentFragment`.
  18223. * @returns {module:engine/model/documentfragment~DocumentFragment} `DocumentFragment` instance created using given plain object.
  18224. */
  18225. static fromJSON( json ) {
  18226. const children = [];
  18227. for ( const child of json ) {
  18228. if ( child.name ) {
  18229. // If child has name property, it is an Element.
  18230. children.push( _element__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( child ) );
  18231. } else {
  18232. // Otherwise, it is a Text node.
  18233. children.push( _text__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( child ) );
  18234. }
  18235. }
  18236. return new DocumentFragment( children );
  18237. }
  18238. /**
  18239. * {@link #_insertChild Inserts} one or more nodes at the end of this document fragment.
  18240. *
  18241. * @protected
  18242. * @param {module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>} items Items to be inserted.
  18243. */
  18244. _appendChild( items ) {
  18245. this._insertChild( this.childCount, items );
  18246. }
  18247. /**
  18248. * Inserts one or more nodes at the given index and sets {@link module:engine/model/node~Node#parent parent} of these nodes
  18249. * to this document fragment.
  18250. *
  18251. * @protected
  18252. * @param {Number} index Index at which nodes should be inserted.
  18253. * @param {module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>} items Items to be inserted.
  18254. */
  18255. _insertChild( index, items ) {
  18256. const nodes = normalize( items );
  18257. for ( const node of nodes ) {
  18258. // If node that is being added to this element is already inside another element, first remove it from the old parent.
  18259. if ( node.parent !== null ) {
  18260. node._remove();
  18261. }
  18262. node.parent = this;
  18263. }
  18264. this._children._insertNodes( index, nodes );
  18265. }
  18266. /**
  18267. * Removes one or more nodes starting at the given index
  18268. * and sets {@link module:engine/model/node~Node#parent parent} of these nodes to `null`.
  18269. *
  18270. * @protected
  18271. * @param {Number} index Index of the first node to remove.
  18272. * @param {Number} [howMany=1] Number of nodes to remove.
  18273. * @returns {Array.<module:engine/model/node~Node>} Array containing removed nodes.
  18274. */
  18275. _removeChildren( index, howMany = 1 ) {
  18276. const nodes = this._children._removeNodes( index, howMany );
  18277. for ( const node of nodes ) {
  18278. node.parent = null;
  18279. }
  18280. return nodes;
  18281. }
  18282. // @if CK_DEBUG_ENGINE // toString() {
  18283. // @if CK_DEBUG_ENGINE // return 'documentFragment';
  18284. // @if CK_DEBUG_ENGINE // }
  18285. // @if CK_DEBUG_ENGINE // log() {
  18286. // @if CK_DEBUG_ENGINE // console.log( 'ModelDocumentFragment: ' + this );
  18287. // @if CK_DEBUG_ENGINE // }
  18288. // @if CK_DEBUG_ENGINE // printTree() {
  18289. // @if CK_DEBUG_ENGINE // let string = 'ModelDocumentFragment: [';
  18290. // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
  18291. // @if CK_DEBUG_ENGINE // string += '\n';
  18292. // @if CK_DEBUG_ENGINE // if ( child.is( '$text' ) ) {
  18293. // @if CK_DEBUG_ENGINE // const textAttrs = stringifyMap( child._attrs );
  18294. // @if CK_DEBUG_ENGINE // string += '\t'.repeat( 1 );
  18295. // @if CK_DEBUG_ENGINE // if ( textAttrs !== '' ) {
  18296. // @if CK_DEBUG_ENGINE // string += `<$text${ textAttrs }>` + child.data + '</$text>';
  18297. // @if CK_DEBUG_ENGINE // } else {
  18298. // @if CK_DEBUG_ENGINE // string += child.data;
  18299. // @if CK_DEBUG_ENGINE // }
  18300. // @if CK_DEBUG_ENGINE // } else {
  18301. // @if CK_DEBUG_ENGINE // string += child.printTree( 1 );
  18302. // @if CK_DEBUG_ENGINE // }
  18303. // @if CK_DEBUG_ENGINE // }
  18304. // @if CK_DEBUG_ENGINE // string += '\n]';
  18305. // @if CK_DEBUG_ENGINE // return string;
  18306. // @if CK_DEBUG_ENGINE // }
  18307. // @if CK_DEBUG_ENGINE // logTree() {
  18308. // @if CK_DEBUG_ENGINE // console.log( this.printTree() );
  18309. // @if CK_DEBUG_ENGINE // }
  18310. }
  18311. // Converts strings to Text and non-iterables to arrays.
  18312. //
  18313. // @param {String|module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>}
  18314. // @returns {Iterable.<module:engine/model/node~Node>}
  18315. function normalize( nodes ) {
  18316. // Separate condition because string is iterable.
  18317. if ( typeof nodes == 'string' ) {
  18318. return [ new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( nodes ) ];
  18319. }
  18320. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_4__["default"])( nodes ) ) {
  18321. nodes = [ nodes ];
  18322. }
  18323. // Array.from to enable .map() on non-arrays.
  18324. return Array.from( nodes )
  18325. .map( node => {
  18326. if ( typeof node == 'string' ) {
  18327. return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( node );
  18328. }
  18329. if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_3__["default"] ) {
  18330. return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( node.data, node.getAttributes() );
  18331. }
  18332. return node;
  18333. } );
  18334. }
  18335. /***/ }),
  18336. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js":
  18337. /*!********************************************************************************!*\
  18338. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js ***!
  18339. \********************************************************************************/
  18340. /*! exports provided: default */
  18341. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18342. "use strict";
  18343. __webpack_require__.r(__webpack_exports__);
  18344. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentSelection; });
  18345. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  18346. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  18347. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js");
  18348. /* harmony import */ var _liverange__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./liverange */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js");
  18349. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  18350. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  18351. /* harmony import */ var _ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
  18352. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  18353. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  18354. /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  18355. /**
  18356. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  18357. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  18358. */
  18359. /**
  18360. * @module engine/model/documentselection
  18361. */
  18362. const storePrefix = 'selection:';
  18363. /**
  18364. * `DocumentSelection` is a special selection which is used as the
  18365. * {@link module:engine/model/document~Document#selection document's selection}.
  18366. * There can be only one instance of `DocumentSelection` per document.
  18367. *
  18368. * Document selection can only be changed by using the {@link module:engine/model/writer~Writer} instance
  18369. * inside the {@link module:engine/model/model~Model#change `change()`} block, as it provides a secure way to modify model.
  18370. *
  18371. * `DocumentSelection` is automatically updated upon changes in the {@link module:engine/model/document~Document document}
  18372. * to always contain valid ranges. Its attributes are inherited from the text unless set explicitly.
  18373. *
  18374. * Differences between {@link module:engine/model/selection~Selection} and `DocumentSelection` are:
  18375. * * there is always a range in `DocumentSelection` - even if no ranges were added there is a "default range"
  18376. * present in the selection,
  18377. * * ranges added to this selection updates automatically when the document changes,
  18378. * * attributes of `DocumentSelection` are updated automatically according to selection ranges.
  18379. *
  18380. * Since `DocumentSelection` uses {@link module:engine/model/liverange~LiveRange live ranges}
  18381. * and is updated when {@link module:engine/model/document~Document document}
  18382. * changes, it cannot be set on {@link module:engine/model/node~Node nodes}
  18383. * that are inside {@link module:engine/model/documentfragment~DocumentFragment document fragment}.
  18384. * If you need to represent a selection in document fragment,
  18385. * use {@link module:engine/model/selection~Selection Selection class} instead.
  18386. *
  18387. * @mixes module:utils/emittermixin~EmitterMixin
  18388. */
  18389. class DocumentSelection {
  18390. /**
  18391. * Creates an empty live selection for given {@link module:engine/model/document~Document}.
  18392. *
  18393. * @param {module:engine/model/document~Document} doc Document which owns this selection.
  18394. */
  18395. constructor( doc ) {
  18396. /**
  18397. * Selection used internally by that class (`DocumentSelection` is a proxy to that selection).
  18398. *
  18399. * @protected
  18400. */
  18401. this._selection = new LiveSelection( doc );
  18402. this._selection.delegate( 'change:range' ).to( this );
  18403. this._selection.delegate( 'change:attribute' ).to( this );
  18404. this._selection.delegate( 'change:marker' ).to( this );
  18405. }
  18406. /**
  18407. * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is
  18408. * collapsed.
  18409. *
  18410. * @readonly
  18411. * @type {Boolean}
  18412. */
  18413. get isCollapsed() {
  18414. return this._selection.isCollapsed;
  18415. }
  18416. /**
  18417. * Selection anchor. Anchor may be described as a position where the most recent part of the selection starts.
  18418. * Together with {@link #focus} they define the direction of selection, which is important
  18419. * when expanding/shrinking selection. Anchor is always {@link module:engine/model/range~Range#start start} or
  18420. * {@link module:engine/model/range~Range#end end} position of the most recently added range.
  18421. *
  18422. * Is set to `null` if there are no ranges in selection.
  18423. *
  18424. * @see #focus
  18425. * @readonly
  18426. * @type {module:engine/model/position~Position|null}
  18427. */
  18428. get anchor() {
  18429. return this._selection.anchor;
  18430. }
  18431. /**
  18432. * Selection focus. Focus is a position where the selection ends.
  18433. *
  18434. * Is set to `null` if there are no ranges in selection.
  18435. *
  18436. * @see #anchor
  18437. * @readonly
  18438. * @type {module:engine/model/position~Position|null}
  18439. */
  18440. get focus() {
  18441. return this._selection.focus;
  18442. }
  18443. /**
  18444. * Returns number of ranges in selection.
  18445. *
  18446. * @readonly
  18447. * @type {Number}
  18448. */
  18449. get rangeCount() {
  18450. return this._selection.rangeCount;
  18451. }
  18452. /**
  18453. * Describes whether `Documentselection` has own range(s) set, or if it is defaulted to
  18454. * {@link module:engine/model/document~Document#_getDefaultRange document's default range}.
  18455. *
  18456. * @readonly
  18457. * @type {Boolean}
  18458. */
  18459. get hasOwnRange() {
  18460. return this._selection.hasOwnRange;
  18461. }
  18462. /**
  18463. * Specifies whether the {@link #focus}
  18464. * precedes {@link #anchor}.
  18465. *
  18466. * @readonly
  18467. * @type {Boolean}
  18468. */
  18469. get isBackward() {
  18470. return this._selection.isBackward;
  18471. }
  18472. /**
  18473. * Describes whether the gravity is overridden (using {@link module:engine/model/writer~Writer#overrideSelectionGravity}) or not.
  18474. *
  18475. * Note that the gravity remains overridden as long as will not be restored the same number of times as it was overridden.
  18476. *
  18477. * @readonly
  18478. * @returns {Boolean}
  18479. */
  18480. get isGravityOverridden() {
  18481. return this._selection.isGravityOverridden;
  18482. }
  18483. /**
  18484. * A collection of selection {@link module:engine/model/markercollection~Marker markers}.
  18485. * Marker is a selection marker when selection range is inside the marker range.
  18486. *
  18487. * **Note**: Only markers from {@link ~DocumentSelection#observeMarkers observed markers groups} are collected.
  18488. *
  18489. * @readonly
  18490. * @type {module:utils/collection~Collection}
  18491. */
  18492. get markers() {
  18493. return this._selection.markers;
  18494. }
  18495. /**
  18496. * Used for the compatibility with the {@link module:engine/model/selection~Selection#isEqual} method.
  18497. *
  18498. * @protected
  18499. */
  18500. get _ranges() {
  18501. return this._selection._ranges;
  18502. }
  18503. /**
  18504. * Returns an iterable that iterates over copies of selection ranges.
  18505. *
  18506. * @returns {Iterable.<module:engine/model/range~Range>}
  18507. */
  18508. getRanges() {
  18509. return this._selection.getRanges();
  18510. }
  18511. /**
  18512. * Returns the first position in the selection.
  18513. * First position is the position that {@link module:engine/model/position~Position#isBefore is before}
  18514. * any other position in the selection.
  18515. *
  18516. * Returns `null` if there are no ranges in selection.
  18517. *
  18518. * @returns {module:engine/model/position~Position|null}
  18519. */
  18520. getFirstPosition() {
  18521. return this._selection.getFirstPosition();
  18522. }
  18523. /**
  18524. * Returns the last position in the selection.
  18525. * Last position is the position that {@link module:engine/model/position~Position#isAfter is after}
  18526. * any other position in the selection.
  18527. *
  18528. * Returns `null` if there are no ranges in selection.
  18529. *
  18530. * @returns {module:engine/model/position~Position|null}
  18531. */
  18532. getLastPosition() {
  18533. return this._selection.getLastPosition();
  18534. }
  18535. /**
  18536. * Returns a copy of the first range in the selection.
  18537. * First range is the one which {@link module:engine/model/range~Range#start start} position
  18538. * {@link module:engine/model/position~Position#isBefore is before} start position of all other ranges
  18539. * (not to confuse with the first range added to the selection).
  18540. *
  18541. * Returns `null` if there are no ranges in selection.
  18542. *
  18543. * @returns {module:engine/model/range~Range|null}
  18544. */
  18545. getFirstRange() {
  18546. return this._selection.getFirstRange();
  18547. }
  18548. /**
  18549. * Returns a copy of the last range in the selection.
  18550. * Last range is the one which {@link module:engine/model/range~Range#end end} position
  18551. * {@link module:engine/model/position~Position#isAfter is after} end position of all other ranges (not to confuse with the range most
  18552. * recently added to the selection).
  18553. *
  18554. * Returns `null` if there are no ranges in selection.
  18555. *
  18556. * @returns {module:engine/model/range~Range|null}
  18557. */
  18558. getLastRange() {
  18559. return this._selection.getLastRange();
  18560. }
  18561. /**
  18562. * Gets elements of type {@link module:engine/model/schema~Schema#isBlock "block"} touched by the selection.
  18563. *
  18564. * This method's result can be used for example to apply block styling to all blocks covered by this selection.
  18565. *
  18566. * **Note:** `getSelectedBlocks()` returns blocks that are nested in other non-block elements
  18567. * but will not return blocks nested in other blocks.
  18568. *
  18569. * In this case the function will return exactly all 3 paragraphs (note: `<blockQuote>` is not a block itself):
  18570. *
  18571. * <paragraph>[a</paragraph>
  18572. * <blockQuote>
  18573. * <paragraph>b</paragraph>
  18574. * </blockQuote>
  18575. * <paragraph>c]d</paragraph>
  18576. *
  18577. * In this case the paragraph will also be returned, despite the collapsed selection:
  18578. *
  18579. * <paragraph>[]a</paragraph>
  18580. *
  18581. * In such a scenario, however, only blocks A, B & E will be returned as blocks C & D are nested in block B:
  18582. *
  18583. * [<blockA></blockA>
  18584. * <blockB>
  18585. * <blockC></blockC>
  18586. * <blockD></blockD>
  18587. * </blockB>
  18588. * <blockE></blockE>]
  18589. *
  18590. * If the selection is inside a block all the inner blocks (A & B) are returned:
  18591. *
  18592. * <block>
  18593. * <blockA>[a</blockA>
  18594. * <blockB>b]</blockB>
  18595. * </block>
  18596. *
  18597. * **Special case**: If a selection ends at the beginning of a block, that block is not returned as from user perspective
  18598. * this block wasn't selected. See [#984](https://github.com/ckeditor/ckeditor5-engine/issues/984) for more details.
  18599. *
  18600. * <paragraph>[a</paragraph>
  18601. * <paragraph>b</paragraph>
  18602. * <paragraph>]c</paragraph> // this block will not be returned
  18603. *
  18604. * @returns {Iterable.<module:engine/model/element~Element>}
  18605. */
  18606. getSelectedBlocks() {
  18607. return this._selection.getSelectedBlocks();
  18608. }
  18609. /**
  18610. * Returns the selected element. {@link module:engine/model/element~Element Element} is considered as selected if there is only
  18611. * one range in the selection, and that range contains exactly one element.
  18612. * Returns `null` if there is no selected element.
  18613. *
  18614. * @returns {module:engine/model/element~Element|null}
  18615. */
  18616. getSelectedElement() {
  18617. return this._selection.getSelectedElement();
  18618. }
  18619. /**
  18620. * Checks whether the selection contains the entire content of the given element. This means that selection must start
  18621. * at a position {@link module:engine/model/position~Position#isTouching touching} the element's start and ends at position
  18622. * touching the element's end.
  18623. *
  18624. * By default, this method will check whether the entire content of the selection's current root is selected.
  18625. * Useful to check if e.g. the user has just pressed <kbd>Ctrl</kbd> + <kbd>A</kbd>.
  18626. *
  18627. * @param {module:engine/model/element~Element} [element=this.anchor.root]
  18628. * @returns {Boolean}
  18629. */
  18630. containsEntireContent( element ) {
  18631. return this._selection.containsEntireContent( element );
  18632. }
  18633. /**
  18634. * Unbinds all events previously bound by document selection.
  18635. */
  18636. destroy() {
  18637. this._selection.destroy();
  18638. }
  18639. /**
  18640. * Returns iterable that iterates over this selection's attribute keys.
  18641. *
  18642. * @returns {Iterable.<String>}
  18643. */
  18644. getAttributeKeys() {
  18645. return this._selection.getAttributeKeys();
  18646. }
  18647. /**
  18648. * Returns iterable that iterates over this selection's attributes.
  18649. *
  18650. * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.
  18651. * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
  18652. *
  18653. * @returns {Iterable.<*>}
  18654. */
  18655. getAttributes() {
  18656. return this._selection.getAttributes();
  18657. }
  18658. /**
  18659. * Gets an attribute value for given key or `undefined` if that attribute is not set on the selection.
  18660. *
  18661. * @param {String} key Key of attribute to look for.
  18662. * @returns {*} Attribute value or `undefined`.
  18663. */
  18664. getAttribute( key ) {
  18665. return this._selection.getAttribute( key );
  18666. }
  18667. /**
  18668. * Checks if the selection has an attribute for given key.
  18669. *
  18670. * @param {String} key Key of attribute to check.
  18671. * @returns {Boolean} `true` if attribute with given key is set on selection, `false` otherwise.
  18672. */
  18673. hasAttribute( key ) {
  18674. return this._selection.hasAttribute( key );
  18675. }
  18676. /**
  18677. * Refreshes selection attributes and markers according to the current position in the model.
  18678. */
  18679. refresh() {
  18680. this._selection._updateMarkers();
  18681. this._selection._updateAttributes( false );
  18682. }
  18683. /**
  18684. * Registers a marker group prefix or a marker name to be collected in the
  18685. * {@link ~DocumentSelection#markers selection markers collection}.
  18686. *
  18687. * See also {@link module:engine/model/markercollection~MarkerCollection#getMarkersGroup `MarkerCollection#getMarkersGroup()`}.
  18688. *
  18689. * @param {String} prefixOrName The marker group prefix or marker name.
  18690. */
  18691. observeMarkers( prefixOrName ) {
  18692. this._selection.observeMarkers( prefixOrName );
  18693. }
  18694. /**
  18695. * Checks whether this object is of the given type.
  18696. *
  18697. * selection.is( 'selection' ); // -> true
  18698. * selection.is( 'documentSelection' ); // -> true
  18699. * selection.is( 'model:selection' ); // -> true
  18700. * selection.is( 'model:documentSelection' ); // -> true
  18701. *
  18702. * selection.is( 'view:selection' ); // -> false
  18703. * selection.is( 'element' ); // -> false
  18704. * selection.is( 'node' ); // -> false
  18705. *
  18706. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  18707. *
  18708. * @param {String} type
  18709. * @returns {Boolean}
  18710. */
  18711. is( type ) {
  18712. return type === 'selection' ||
  18713. type == 'model:selection' ||
  18714. type == 'documentSelection' ||
  18715. type == 'model:documentSelection';
  18716. }
  18717. /**
  18718. * Moves {@link module:engine/model/documentselection~DocumentSelection#focus} to the specified location.
  18719. * Should be used only within the {@link module:engine/model/writer~Writer#setSelectionFocus} method.
  18720. *
  18721. * The location can be specified in the same form as
  18722. * {@link module:engine/model/writer~Writer#createPositionAt writer.createPositionAt()} parameters.
  18723. *
  18724. * @see module:engine/model/writer~Writer#setSelectionFocus
  18725. * @protected
  18726. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  18727. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  18728. * first parameter is a {@link module:engine/model/item~Item model item}.
  18729. */
  18730. _setFocus( itemOrPosition, offset ) {
  18731. this._selection.setFocus( itemOrPosition, offset );
  18732. }
  18733. /**
  18734. * Sets this selection's ranges and direction to the specified location based on the given
  18735. * {@link module:engine/model/selection~Selectable selectable}.
  18736. * Should be used only within the {@link module:engine/model/writer~Writer#setSelection} method.
  18737. *
  18738. * @see module:engine/model/writer~Writer#setSelection
  18739. * @protected
  18740. * @param {module:engine/model/selection~Selectable} selectable
  18741. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  18742. * @param {Object} [options]
  18743. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  18744. */
  18745. _setTo( selectable, placeOrOffset, options ) {
  18746. this._selection.setTo( selectable, placeOrOffset, options );
  18747. }
  18748. /**
  18749. * Sets attribute on the selection. If attribute with the same key already is set, it's value is overwritten.
  18750. * Should be used only within the {@link module:engine/model/writer~Writer#setSelectionAttribute} method.
  18751. *
  18752. * @see module:engine/model/writer~Writer#setSelectionAttribute
  18753. * @protected
  18754. * @param {String} key Key of the attribute to set.
  18755. * @param {*} value Attribute value.
  18756. */
  18757. _setAttribute( key, value ) {
  18758. this._selection.setAttribute( key, value );
  18759. }
  18760. /**
  18761. * Removes an attribute with given key from the selection.
  18762. * If the given attribute was set on the selection, fires the {@link module:engine/model/selection~Selection#event:change:range}
  18763. * event with removed attribute key.
  18764. * Should be used only within the {@link module:engine/model/writer~Writer#removeSelectionAttribute} method.
  18765. *
  18766. * @see module:engine/model/writer~Writer#removeSelectionAttribute
  18767. * @protected
  18768. * @param {String} key Key of the attribute to remove.
  18769. */
  18770. _removeAttribute( key ) {
  18771. this._selection.removeAttribute( key );
  18772. }
  18773. /**
  18774. * Returns an iterable that iterates through all selection attributes stored in current selection's parent.
  18775. *
  18776. * @protected
  18777. * @returns {Iterable.<*>}
  18778. */
  18779. _getStoredAttributes() {
  18780. return this._selection._getStoredAttributes();
  18781. }
  18782. /**
  18783. * Temporarily changes the gravity of the selection from the left to the right.
  18784. *
  18785. * The gravity defines from which direction the selection inherits its attributes. If it's the default left
  18786. * gravity, the selection (after being moved by the the user) inherits attributes from its left hand side.
  18787. * This method allows to temporarily override this behavior by forcing the gravity to the right.
  18788. *
  18789. * It returns an unique identifier which is required to restore the gravity. It guarantees the symmetry
  18790. * of the process.
  18791. *
  18792. * @see module:engine/model/writer~Writer#overrideSelectionGravity
  18793. * @protected
  18794. * @returns {String} The unique id which allows restoring the gravity.
  18795. */
  18796. _overrideGravity() {
  18797. return this._selection.overrideGravity();
  18798. }
  18799. /**
  18800. * Restores the {@link ~DocumentSelection#_overrideGravity overridden gravity}.
  18801. *
  18802. * Restoring the gravity is only possible using the unique identifier returned by
  18803. * {@link ~DocumentSelection#_overrideGravity}. Note that the gravity remains overridden as long as won't be restored
  18804. * the same number of times it was overridden.
  18805. *
  18806. * @see module:engine/model/writer~Writer#restoreSelectionGravity
  18807. * @protected
  18808. * @param {String} uid The unique id returned by {@link #_overrideGravity}.
  18809. */
  18810. _restoreGravity( uid ) {
  18811. this._selection.restoreGravity( uid );
  18812. }
  18813. /**
  18814. * Generates and returns an attribute key for selection attributes store, basing on original attribute key.
  18815. *
  18816. * @protected
  18817. * @param {String} key Attribute key to convert.
  18818. * @returns {String} Converted attribute key, applicable for selection store.
  18819. */
  18820. static _getStoreAttributeKey( key ) {
  18821. return storePrefix + key;
  18822. }
  18823. /**
  18824. * Checks whether the given attribute key is an attribute stored on an element.
  18825. *
  18826. * @protected
  18827. * @param {String} key
  18828. * @returns {Boolean}
  18829. */
  18830. static _isStoreAttributeKey( key ) {
  18831. return key.startsWith( storePrefix );
  18832. }
  18833. }
  18834. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( DocumentSelection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  18835. /**
  18836. * Fired when selection range(s) changed.
  18837. *
  18838. * @event change:range
  18839. * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set
  18840. * to `true` which indicates that the selection change was caused by a direct use of selection's API.
  18841. * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its position
  18842. * was directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was
  18843. * changed because the structure of the model has been changed (which means an indirect change).
  18844. * The indirect change does not occur in case of normal (detached) selections because they are "static" (as "not live")
  18845. * which mean that they are not updated once the document changes.
  18846. */
  18847. /**
  18848. * Fired when selection attribute changed.
  18849. *
  18850. * @event change:attribute
  18851. * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set
  18852. * to `true` which indicates that the selection change was caused by a direct use of selection's API.
  18853. * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its attributes
  18854. * were directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was
  18855. * changed in the model and its attributes were refreshed (which means an indirect change).
  18856. * The indirect change does not occur in case of normal (detached) selections because they are "static" (as "not live")
  18857. * which mean that they are not updated once the document changes.
  18858. * @param {Array.<String>} attributeKeys Array containing keys of attributes that changed.
  18859. */
  18860. /**
  18861. * Fired when selection marker(s) changed.
  18862. *
  18863. * @event change:marker
  18864. * @param {Boolean} directChange This is always set to `false` in case of `change:marker` event as there is no possibility
  18865. * to change markers directly through {@link module:engine/model/documentselection~DocumentSelection} API.
  18866. * See also {@link module:engine/model/documentselection~DocumentSelection#event:change:range} and
  18867. * {@link module:engine/model/documentselection~DocumentSelection#event:change:attribute}.
  18868. * @param {Array.<module:engine/model/markercollection~Marker>} oldMarkers Markers in which the selection was before the change.
  18869. */
  18870. // `LiveSelection` is used internally by {@link module:engine/model/documentselection~DocumentSelection} and shouldn't be used directly.
  18871. //
  18872. // LiveSelection` is automatically updated upon changes in the {@link module:engine/model/document~Document document}
  18873. // to always contain valid ranges. Its attributes are inherited from the text unless set explicitly.
  18874. //
  18875. // Differences between {@link module:engine/model/selection~Selection} and `LiveSelection` are:
  18876. // * there is always a range in `LiveSelection` - even if no ranges were added there is a "default range"
  18877. // present in the selection,
  18878. // * ranges added to this selection updates automatically when the document changes,
  18879. // * attributes of `LiveSelection` are updated automatically according to selection ranges.
  18880. //
  18881. // @extends module:engine/model/selection~Selection
  18882. //
  18883. class LiveSelection extends _selection__WEBPACK_IMPORTED_MODULE_2__["default"] {
  18884. // Creates an empty live selection for given {@link module:engine/model/document~Document}.
  18885. // @param {module:engine/model/document~Document} doc Document which owns this selection.
  18886. constructor( doc ) {
  18887. super();
  18888. // List of selection markers.
  18889. // Marker is a selection marker when selection range is inside the marker range.
  18890. //
  18891. // @type {module:utils/collection~Collection}
  18892. this.markers = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_7__["default"]( { idProperty: 'name' } );
  18893. // Document which owns this selection.
  18894. //
  18895. // @protected
  18896. // @member {module:engine/model/model~Model}
  18897. this._model = doc.model;
  18898. // Document which owns this selection.
  18899. //
  18900. // @protected
  18901. // @member {module:engine/model/document~Document}
  18902. this._document = doc;
  18903. // Keeps mapping of attribute name to priority with which the attribute got modified (added/changed/removed)
  18904. // last time. Possible values of priority are: `'low'` and `'normal'`.
  18905. //
  18906. // Priorities are used by internal `LiveSelection` mechanisms. All attributes set using `LiveSelection`
  18907. // attributes API are set with `'normal'` priority.
  18908. //
  18909. // @private
  18910. // @member {Map} module:engine/model/liveselection~LiveSelection#_attributePriority
  18911. this._attributePriority = new Map();
  18912. // Position to which the selection should be set if the last selection range was moved to the graveyard.
  18913. // @private
  18914. // @member {module:engine/model/position~Position} module:engine/model/liveselection~LiveSelection#_selectionRestorePosition
  18915. this._selectionRestorePosition = null;
  18916. // Flag that informs whether the selection ranges have changed. It is changed on true when `LiveRange#change:range` event is fired.
  18917. // @private
  18918. // @member {Array} module:engine/model/liveselection~LiveSelection#_hasChangedRange
  18919. this._hasChangedRange = false;
  18920. // Each overriding gravity adds an UID to the set and each removal removes it.
  18921. // Gravity is overridden when there's at least one UID in the set.
  18922. // Gravity is restored when the set is empty.
  18923. // This is to prevent conflicts when gravity is overridden by more than one feature at the same time.
  18924. // @private
  18925. // @type {Set}
  18926. this._overriddenGravityRegister = new Set();
  18927. // Prefixes of marker names that should affect `LiveSelection#markers` collection.
  18928. // @private
  18929. // @type {Set}
  18930. this._observedMarkers = new Set();
  18931. // Ensure selection is correct after each operation.
  18932. this.listenTo( this._model, 'applyOperation', ( evt, args ) => {
  18933. const operation = args[ 0 ];
  18934. if ( !operation.isDocumentOperation || operation.type == 'marker' || operation.type == 'rename' || operation.type == 'noop' ) {
  18935. return;
  18936. }
  18937. // Fix selection if the last range was removed from it and we have a position to which we can restore the selection.
  18938. if ( this._ranges.length == 0 && this._selectionRestorePosition ) {
  18939. this._fixGraveyardSelection( this._selectionRestorePosition );
  18940. }
  18941. // "Forget" the restore position even if it was not "used".
  18942. this._selectionRestorePosition = null;
  18943. if ( this._hasChangedRange ) {
  18944. this._hasChangedRange = false;
  18945. this.fire( 'change:range', { directChange: false } );
  18946. }
  18947. }, { priority: 'lowest' } );
  18948. // Ensure selection is correct and up to date after each range change.
  18949. this.on( 'change:range', () => {
  18950. for ( const range of this.getRanges() ) {
  18951. if ( !this._document._validateSelectionRange( range ) ) {
  18952. /**
  18953. * Range from {@link module:engine/model/documentselection~DocumentSelection document selection}
  18954. * starts or ends at incorrect position.
  18955. *
  18956. * @error document-selection-wrong-position
  18957. * @param {module:engine/model/range~Range} range
  18958. */
  18959. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
  18960. 'document-selection-wrong-position',
  18961. this,
  18962. { range }
  18963. );
  18964. }
  18965. }
  18966. } );
  18967. // Update markers data stored by the selection after each marker change.
  18968. // This handles only marker changes done through marker operations (not model tree changes).
  18969. this.listenTo( this._model.markers, 'update', ( evt, marker, oldRange, newRange ) => {
  18970. this._updateMarker( marker, newRange );
  18971. } );
  18972. // Ensure selection is up to date after each change block.
  18973. this.listenTo( this._document, 'change', ( evt, batch ) => {
  18974. clearAttributesStoredInElement( this._model, batch );
  18975. } );
  18976. }
  18977. get isCollapsed() {
  18978. const length = this._ranges.length;
  18979. return length === 0 ? this._document._getDefaultRange().isCollapsed : super.isCollapsed;
  18980. }
  18981. get anchor() {
  18982. return super.anchor || this._document._getDefaultRange().start;
  18983. }
  18984. get focus() {
  18985. return super.focus || this._document._getDefaultRange().end;
  18986. }
  18987. get rangeCount() {
  18988. return this._ranges.length ? this._ranges.length : 1;
  18989. }
  18990. // Describes whether `LiveSelection` has own range(s) set, or if it is defaulted to
  18991. // {@link module:engine/model/document~Document#_getDefaultRange document's default range}.
  18992. //
  18993. // @readonly
  18994. // @type {Boolean}
  18995. get hasOwnRange() {
  18996. return this._ranges.length > 0;
  18997. }
  18998. // When set to `true` then selection attributes on node before the caret won't be taken
  18999. // into consideration while updating selection attributes.
  19000. //
  19001. // @protected
  19002. // @type {Boolean}
  19003. get isGravityOverridden() {
  19004. return !!this._overriddenGravityRegister.size;
  19005. }
  19006. // Unbinds all events previously bound by live selection.
  19007. destroy() {
  19008. for ( let i = 0; i < this._ranges.length; i++ ) {
  19009. this._ranges[ i ].detach();
  19010. }
  19011. this.stopListening();
  19012. }
  19013. * getRanges() {
  19014. if ( this._ranges.length ) {
  19015. yield* super.getRanges();
  19016. } else {
  19017. yield this._document._getDefaultRange();
  19018. }
  19019. }
  19020. getFirstRange() {
  19021. return super.getFirstRange() || this._document._getDefaultRange();
  19022. }
  19023. getLastRange() {
  19024. return super.getLastRange() || this._document._getDefaultRange();
  19025. }
  19026. setTo( selectable, optionsOrPlaceOrOffset, options ) {
  19027. super.setTo( selectable, optionsOrPlaceOrOffset, options );
  19028. this._updateAttributes( true );
  19029. this._updateMarkers();
  19030. }
  19031. setFocus( itemOrPosition, offset ) {
  19032. super.setFocus( itemOrPosition, offset );
  19033. this._updateAttributes( true );
  19034. this._updateMarkers();
  19035. }
  19036. setAttribute( key, value ) {
  19037. if ( this._setAttribute( key, value ) ) {
  19038. // Fire event with exact data.
  19039. const attributeKeys = [ key ];
  19040. this.fire( 'change:attribute', { attributeKeys, directChange: true } );
  19041. }
  19042. }
  19043. removeAttribute( key ) {
  19044. if ( this._removeAttribute( key ) ) {
  19045. // Fire event with exact data.
  19046. const attributeKeys = [ key ];
  19047. this.fire( 'change:attribute', { attributeKeys, directChange: true } );
  19048. }
  19049. }
  19050. overrideGravity() {
  19051. const overrideUid = Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_9__["default"])();
  19052. // Remember that another overriding has been requested. It will need to be removed
  19053. // before the gravity is to be restored.
  19054. this._overriddenGravityRegister.add( overrideUid );
  19055. if ( this._overriddenGravityRegister.size === 1 ) {
  19056. this._updateAttributes( true );
  19057. }
  19058. return overrideUid;
  19059. }
  19060. restoreGravity( uid ) {
  19061. if ( !this._overriddenGravityRegister.has( uid ) ) {
  19062. /**
  19063. * Restoring gravity for an unknown UID is not possible. Make sure you are using a correct
  19064. * UID obtained from the {@link module:engine/model/writer~Writer#overrideSelectionGravity} to restore.
  19065. *
  19066. * @error document-selection-gravity-wrong-restore
  19067. * @param {String} uid The unique identifier returned by
  19068. * {@link module:engine/model/documentselection~DocumentSelection#_overrideGravity}.
  19069. */
  19070. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
  19071. 'document-selection-gravity-wrong-restore',
  19072. this,
  19073. { uid }
  19074. );
  19075. }
  19076. this._overriddenGravityRegister.delete( uid );
  19077. // Restore gravity only when all overriding have been restored.
  19078. if ( !this.isGravityOverridden ) {
  19079. this._updateAttributes( true );
  19080. }
  19081. }
  19082. observeMarkers( prefixOrName ) {
  19083. this._observedMarkers.add( prefixOrName );
  19084. this._updateMarkers();
  19085. }
  19086. _popRange() {
  19087. this._ranges.pop().detach();
  19088. }
  19089. _pushRange( range ) {
  19090. const liveRange = this._prepareRange( range );
  19091. // `undefined` is returned when given `range` is in graveyard root.
  19092. if ( liveRange ) {
  19093. this._ranges.push( liveRange );
  19094. }
  19095. }
  19096. // Prepares given range to be added to selection. Checks if it is correct,
  19097. // converts it to {@link module:engine/model/liverange~LiveRange LiveRange}
  19098. // and sets listeners listening to the range's change event.
  19099. //
  19100. // @private
  19101. // @param {module:engine/model/range~Range} range
  19102. _prepareRange( range ) {
  19103. this._checkRange( range );
  19104. if ( range.root == this._document.graveyard ) {
  19105. // @if CK_DEBUG // console.warn( 'Trying to add a Range that is in the graveyard root. Range rejected.' );
  19106. return;
  19107. }
  19108. const liveRange = _liverange__WEBPACK_IMPORTED_MODULE_3__["default"].fromRange( range );
  19109. // If selection range is moved to the graveyard remove it from the selection object.
  19110. // Also, save some data that can be used to restore selection later, on `Model#applyOperation` event.
  19111. liveRange.on( 'change:range', ( evt, oldRange, data ) => {
  19112. this._hasChangedRange = true;
  19113. if ( liveRange.root == this._document.graveyard ) {
  19114. this._selectionRestorePosition = data.deletionPosition;
  19115. const index = this._ranges.indexOf( liveRange );
  19116. this._ranges.splice( index, 1 );
  19117. liveRange.detach();
  19118. }
  19119. } );
  19120. return liveRange;
  19121. }
  19122. _updateMarkers() {
  19123. if ( !this._observedMarkers.size ) {
  19124. return;
  19125. }
  19126. const markers = [];
  19127. let changed = false;
  19128. for ( const marker of this._model.markers ) {
  19129. const markerGroup = marker.name.split( ':', 1 )[ 0 ];
  19130. if ( !this._observedMarkers.has( markerGroup ) ) {
  19131. continue;
  19132. }
  19133. const markerRange = marker.getRange();
  19134. for ( const selectionRange of this.getRanges() ) {
  19135. if ( markerRange.containsRange( selectionRange, !selectionRange.isCollapsed ) ) {
  19136. markers.push( marker );
  19137. }
  19138. }
  19139. }
  19140. const oldMarkers = Array.from( this.markers );
  19141. for ( const marker of markers ) {
  19142. if ( !this.markers.has( marker ) ) {
  19143. this.markers.add( marker );
  19144. changed = true;
  19145. }
  19146. }
  19147. for ( const marker of Array.from( this.markers ) ) {
  19148. if ( !markers.includes( marker ) ) {
  19149. this.markers.remove( marker );
  19150. changed = true;
  19151. }
  19152. }
  19153. if ( changed ) {
  19154. this.fire( 'change:marker', { oldMarkers, directChange: false } );
  19155. }
  19156. }
  19157. _updateMarker( marker, markerRange ) {
  19158. const markerGroup = marker.name.split( ':', 1 )[ 0 ];
  19159. if ( !this._observedMarkers.has( markerGroup ) ) {
  19160. return;
  19161. }
  19162. let changed = false;
  19163. const oldMarkers = Array.from( this.markers );
  19164. const hasMarker = this.markers.has( marker );
  19165. if ( !markerRange ) {
  19166. if ( hasMarker ) {
  19167. this.markers.remove( marker );
  19168. changed = true;
  19169. }
  19170. } else {
  19171. let contained = false;
  19172. for ( const selectionRange of this.getRanges() ) {
  19173. if ( markerRange.containsRange( selectionRange, !selectionRange.isCollapsed ) ) {
  19174. contained = true;
  19175. break;
  19176. }
  19177. }
  19178. if ( contained && !hasMarker ) {
  19179. this.markers.add( marker );
  19180. changed = true;
  19181. } else if ( !contained && hasMarker ) {
  19182. this.markers.remove( marker );
  19183. changed = true;
  19184. }
  19185. }
  19186. if ( changed ) {
  19187. this.fire( 'change:marker', { oldMarkers, directChange: false } );
  19188. }
  19189. }
  19190. // Updates this selection attributes according to its ranges and the {@link module:engine/model/document~Document model document}.
  19191. //
  19192. // @protected
  19193. // @param {Boolean} clearAll
  19194. // @fires change:attribute
  19195. _updateAttributes( clearAll ) {
  19196. const newAttributes = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_6__["default"])( this._getSurroundingAttributes() );
  19197. const oldAttributes = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_6__["default"])( this.getAttributes() );
  19198. if ( clearAll ) {
  19199. // If `clearAll` remove all attributes and reset priorities.
  19200. this._attributePriority = new Map();
  19201. this._attrs = new Map();
  19202. } else {
  19203. // If not, remove only attributes added with `low` priority.
  19204. for ( const [ key, priority ] of this._attributePriority ) {
  19205. if ( priority == 'low' ) {
  19206. this._attrs.delete( key );
  19207. this._attributePriority.delete( key );
  19208. }
  19209. }
  19210. }
  19211. this._setAttributesTo( newAttributes );
  19212. // Let's evaluate which attributes really changed.
  19213. const changed = [];
  19214. // First, loop through all attributes that are set on selection right now.
  19215. // Check which of them are different than old attributes.
  19216. for ( const [ newKey, newValue ] of this.getAttributes() ) {
  19217. if ( !oldAttributes.has( newKey ) || oldAttributes.get( newKey ) !== newValue ) {
  19218. changed.push( newKey );
  19219. }
  19220. }
  19221. // Then, check which of old attributes got removed.
  19222. for ( const [ oldKey ] of oldAttributes ) {
  19223. if ( !this.hasAttribute( oldKey ) ) {
  19224. changed.push( oldKey );
  19225. }
  19226. }
  19227. // Fire event with exact data (fire only if anything changed).
  19228. if ( changed.length > 0 ) {
  19229. this.fire( 'change:attribute', { attributeKeys: changed, directChange: false } );
  19230. }
  19231. }
  19232. // Internal method for setting `LiveSelection` attribute. Supports attribute priorities (through `directChange`
  19233. // parameter).
  19234. //
  19235. // @private
  19236. // @param {String} key Attribute key.
  19237. // @param {*} value Attribute value.
  19238. // @param {Boolean} [directChange=true] `true` if the change is caused by `Selection` API, `false` if change
  19239. // is caused by `Batch` API.
  19240. // @returns {Boolean} Whether value has changed.
  19241. _setAttribute( key, value, directChange = true ) {
  19242. const priority = directChange ? 'normal' : 'low';
  19243. if ( priority == 'low' && this._attributePriority.get( key ) == 'normal' ) {
  19244. // Priority too low.
  19245. return false;
  19246. }
  19247. const oldValue = super.getAttribute( key );
  19248. // Don't do anything if value has not changed.
  19249. if ( oldValue === value ) {
  19250. return false;
  19251. }
  19252. this._attrs.set( key, value );
  19253. // Update priorities map.
  19254. this._attributePriority.set( key, priority );
  19255. return true;
  19256. }
  19257. // Internal method for removing `LiveSelection` attribute. Supports attribute priorities (through `directChange`
  19258. // parameter).
  19259. //
  19260. // NOTE: Even if attribute is not present in the selection but is provided to this method, it's priority will
  19261. // be changed according to `directChange` parameter.
  19262. //
  19263. // @private
  19264. // @param {String} key Attribute key.
  19265. // @param {Boolean} [directChange=true] `true` if the change is caused by `Selection` API, `false` if change
  19266. // is caused by `Batch` API.
  19267. // @returns {Boolean} Whether attribute was removed. May not be true if such attributes didn't exist or the
  19268. // existing attribute had higher priority.
  19269. _removeAttribute( key, directChange = true ) {
  19270. const priority = directChange ? 'normal' : 'low';
  19271. if ( priority == 'low' && this._attributePriority.get( key ) == 'normal' ) {
  19272. // Priority too low.
  19273. return false;
  19274. }
  19275. // Update priorities map.
  19276. this._attributePriority.set( key, priority );
  19277. // Don't do anything if value has not changed.
  19278. if ( !super.hasAttribute( key ) ) {
  19279. return false;
  19280. }
  19281. this._attrs.delete( key );
  19282. return true;
  19283. }
  19284. // Internal method for setting multiple `LiveSelection` attributes. Supports attribute priorities (through
  19285. // `directChange` parameter).
  19286. //
  19287. // @private
  19288. // @param {Map.<String,*>} attrs Iterable object containing attributes to be set.
  19289. // @returns {Set.<String>} Changed attribute keys.
  19290. _setAttributesTo( attrs ) {
  19291. const changed = new Set();
  19292. for ( const [ oldKey, oldValue ] of this.getAttributes() ) {
  19293. // Do not remove attribute if attribute with same key and value is about to be set.
  19294. if ( attrs.get( oldKey ) === oldValue ) {
  19295. continue;
  19296. }
  19297. // All rest attributes will be removed so changed attributes won't change .
  19298. this._removeAttribute( oldKey, false );
  19299. }
  19300. for ( const [ key, value ] of attrs ) {
  19301. // Attribute may not be set because of attributes or because same key/value is already added.
  19302. const gotAdded = this._setAttribute( key, value, false );
  19303. if ( gotAdded ) {
  19304. changed.add( key );
  19305. }
  19306. }
  19307. return changed;
  19308. }
  19309. // Returns an iterable that iterates through all selection attributes stored in current selection's parent.
  19310. //
  19311. // @protected
  19312. // @returns {Iterable.<*>}
  19313. * _getStoredAttributes() {
  19314. const selectionParent = this.getFirstPosition().parent;
  19315. if ( this.isCollapsed && selectionParent.isEmpty ) {
  19316. for ( const key of selectionParent.getAttributeKeys() ) {
  19317. if ( key.startsWith( storePrefix ) ) {
  19318. const realKey = key.substr( storePrefix.length );
  19319. yield [ realKey, selectionParent.getAttribute( key ) ];
  19320. }
  19321. }
  19322. }
  19323. }
  19324. // Checks model text nodes that are closest to the selection's first position and returns attributes of first
  19325. // found element. If there are no text nodes in selection's first position parent, it returns selection
  19326. // attributes stored in that parent.
  19327. //
  19328. // @private
  19329. // @returns {Iterable.<*>} Collection of attributes.
  19330. _getSurroundingAttributes() {
  19331. const position = this.getFirstPosition();
  19332. const schema = this._model.schema;
  19333. let attrs = null;
  19334. if ( !this.isCollapsed ) {
  19335. // 1. If selection is a range...
  19336. const range = this.getFirstRange();
  19337. // ...look for a first character node in that range and take attributes from it.
  19338. for ( const value of range ) {
  19339. // If the item is an object, we don't want to get attributes from its children.
  19340. if ( value.item.is( 'element' ) && schema.isObject( value.item ) ) {
  19341. break;
  19342. }
  19343. if ( value.type == 'text' ) {
  19344. attrs = value.item.getAttributes();
  19345. break;
  19346. }
  19347. }
  19348. } else {
  19349. // 2. If the selection is a caret or the range does not contain a character node...
  19350. const nodeBefore = position.textNode ? position.textNode : position.nodeBefore;
  19351. const nodeAfter = position.textNode ? position.textNode : position.nodeAfter;
  19352. // When gravity is overridden then don't take node before into consideration.
  19353. if ( !this.isGravityOverridden ) {
  19354. // ...look at the node before caret and take attributes from it if it is a character node.
  19355. attrs = getAttrsIfCharacter( nodeBefore );
  19356. }
  19357. // 3. If not, look at the node after caret...
  19358. if ( !attrs ) {
  19359. attrs = getAttrsIfCharacter( nodeAfter );
  19360. }
  19361. // 4. If not, try to find the first character on the left, that is in the same node.
  19362. // When gravity is overridden then don't take node before into consideration.
  19363. if ( !this.isGravityOverridden && !attrs ) {
  19364. let node = nodeBefore;
  19365. while ( node && !schema.isInline( node ) && !attrs ) {
  19366. node = node.previousSibling;
  19367. attrs = getAttrsIfCharacter( node );
  19368. }
  19369. }
  19370. // 5. If not found, try to find the first character on the right, that is in the same node.
  19371. if ( !attrs ) {
  19372. let node = nodeAfter;
  19373. while ( node && !schema.isInline( node ) && !attrs ) {
  19374. node = node.nextSibling;
  19375. attrs = getAttrsIfCharacter( node );
  19376. }
  19377. }
  19378. // 6. If not found, selection should retrieve attributes from parent.
  19379. if ( !attrs ) {
  19380. attrs = this._getStoredAttributes();
  19381. }
  19382. }
  19383. return attrs;
  19384. }
  19385. // Fixes the selection after all its ranges got removed.
  19386. //
  19387. // @private
  19388. // @param {module:engine/model/position~Position} deletionPosition Position where the deletion happened.
  19389. _fixGraveyardSelection( deletionPosition ) {
  19390. // Find a range that is a correct selection range and is closest to the position where the deletion happened.
  19391. const selectionRange = this._model.schema.getNearestSelectionRange( deletionPosition );
  19392. // If nearest valid selection range has been found - add it in the place of old range.
  19393. if ( selectionRange ) {
  19394. // Check the range, convert it to live range, bind events, etc.
  19395. this._pushRange( selectionRange );
  19396. }
  19397. // If nearest valid selection range cannot be found don't add any range. Selection will be set to the default range.
  19398. }
  19399. }
  19400. // Helper function for {@link module:engine/model/liveselection~LiveSelection#_updateAttributes}.
  19401. //
  19402. // It takes model item, checks whether it is a text node (or text proxy) and, if so, returns it's attributes. If not, returns `null`.
  19403. //
  19404. // @param {module:engine/model/item~Item|null} node
  19405. // @returns {Boolean}
  19406. function getAttrsIfCharacter( node ) {
  19407. if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_5__["default"] || node instanceof _text__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  19408. return node.getAttributes();
  19409. }
  19410. return null;
  19411. }
  19412. // Removes selection attributes from element which is not empty anymore.
  19413. //
  19414. // @param {module:engine/model/model~Model} model
  19415. // @param {module:engine/model/batch~Batch} batch
  19416. function clearAttributesStoredInElement( model, batch ) {
  19417. const differ = model.document.differ;
  19418. for ( const entry of differ.getChanges() ) {
  19419. if ( entry.type != 'insert' ) {
  19420. continue;
  19421. }
  19422. const changeParent = entry.position.parent;
  19423. const isNoLongerEmpty = entry.length === changeParent.maxOffset;
  19424. if ( isNoLongerEmpty ) {
  19425. model.enqueueChange( batch, writer => {
  19426. const storedAttributes = Array.from( changeParent.getAttributeKeys() )
  19427. .filter( key => key.startsWith( storePrefix ) );
  19428. for ( const key of storedAttributes ) {
  19429. writer.removeAttribute( key, changeParent );
  19430. }
  19431. } );
  19432. }
  19433. }
  19434. }
  19435. /***/ }),
  19436. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js":
  19437. /*!**********************************************************************!*\
  19438. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js ***!
  19439. \**********************************************************************/
  19440. /*! exports provided: default */
  19441. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19442. "use strict";
  19443. __webpack_require__.r(__webpack_exports__);
  19444. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Element; });
  19445. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
  19446. /* harmony import */ var _nodelist__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./nodelist */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js");
  19447. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  19448. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  19449. /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  19450. /**
  19451. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  19452. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  19453. */
  19454. /**
  19455. * @module engine/model/element
  19456. */
  19457. // @if CK_DEBUG_ENGINE // const { stringifyMap, convertMapToStringifiedObject, convertMapToTags } = require( '../dev-utils/utils' );
  19458. /**
  19459. * Model element. Type of {@link module:engine/model/node~Node node} that has a {@link module:engine/model/element~Element#name name} and
  19460. * {@link module:engine/model/element~Element#getChildren child nodes}.
  19461. *
  19462. * **Important**: see {@link module:engine/model/node~Node} to read about restrictions using `Element` and `Node` API.
  19463. *
  19464. * @extends module:engine/model/node~Node
  19465. */
  19466. class Element extends _node__WEBPACK_IMPORTED_MODULE_0__["default"] {
  19467. /**
  19468. * Creates a model element.
  19469. *
  19470. * **Note:** Constructor of this class shouldn't be used directly in the code.
  19471. * Use the {@link module:engine/model/writer~Writer#createElement} method instead.
  19472. *
  19473. * @protected
  19474. * @param {String} name Element's name.
  19475. * @param {Object} [attrs] Element's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.
  19476. * @param {module:engine/model/node~Node|Iterable.<module:engine/model/node~Node>} [children]
  19477. * One or more nodes to be inserted as children of created element.
  19478. */
  19479. constructor( name, attrs, children ) {
  19480. super( attrs );
  19481. /**
  19482. * Element name.
  19483. *
  19484. * @readonly
  19485. * @member {String} module:engine/model/element~Element#name
  19486. */
  19487. this.name = name;
  19488. /**
  19489. * List of children nodes.
  19490. *
  19491. * @private
  19492. * @member {module:engine/model/nodelist~NodeList} module:engine/model/element~Element#_children
  19493. */
  19494. this._children = new _nodelist__WEBPACK_IMPORTED_MODULE_1__["default"]();
  19495. if ( children ) {
  19496. this._insertChild( 0, children );
  19497. }
  19498. }
  19499. /**
  19500. * Number of this element's children.
  19501. *
  19502. * @readonly
  19503. * @type {Number}
  19504. */
  19505. get childCount() {
  19506. return this._children.length;
  19507. }
  19508. /**
  19509. * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all of this element's children.
  19510. *
  19511. * @readonly
  19512. * @type {Number}
  19513. */
  19514. get maxOffset() {
  19515. return this._children.maxOffset;
  19516. }
  19517. /**
  19518. * Is `true` if there are no nodes inside this element, `false` otherwise.
  19519. *
  19520. * @readonly
  19521. * @type {Boolean}
  19522. */
  19523. get isEmpty() {
  19524. return this.childCount === 0;
  19525. }
  19526. /**
  19527. * Checks whether this object is of the given.
  19528. *
  19529. * element.is( 'element' ); // -> true
  19530. * element.is( 'node' ); // -> true
  19531. * element.is( 'model:element' ); // -> true
  19532. * element.is( 'model:node' ); // -> true
  19533. *
  19534. * element.is( 'view:element' ); // -> false
  19535. * element.is( 'documentSelection' ); // -> false
  19536. *
  19537. * Assuming that the object being checked is an element, you can also check its
  19538. * {@link module:engine/model/element~Element#name name}:
  19539. *
  19540. * element.is( 'element', 'imageBlock' ); // -> true if this is an <imageBlock> element
  19541. * element.is( 'element', 'imageBlock' ); // -> same as above
  19542. * text.is( 'element', 'imageBlock' ); -> false
  19543. *
  19544. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  19545. *
  19546. * @param {String} type Type to check.
  19547. * @param {String} [name] Element name.
  19548. * @returns {Boolean}
  19549. */
  19550. is( type, name = null ) {
  19551. if ( !name ) {
  19552. return type === 'element' || type === 'model:element' ||
  19553. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  19554. type === 'node' || type === 'model:node';
  19555. }
  19556. return name === this.name && ( type === 'element' || type === 'model:element' );
  19557. }
  19558. /**
  19559. * Gets the child at the given index.
  19560. *
  19561. * @param {Number} index Index of child.
  19562. * @returns {module:engine/model/node~Node} Child node.
  19563. */
  19564. getChild( index ) {
  19565. return this._children.getNode( index );
  19566. }
  19567. /**
  19568. * Returns an iterator that iterates over all of this element's children.
  19569. *
  19570. * @returns {Iterable.<module:engine/model/node~Node>}
  19571. */
  19572. getChildren() {
  19573. return this._children[ Symbol.iterator ]();
  19574. }
  19575. /**
  19576. * Returns an index of the given child node. Returns `null` if given node is not a child of this element.
  19577. *
  19578. * @param {module:engine/model/node~Node} node Child node to look for.
  19579. * @returns {Number} Child node's index in this element.
  19580. */
  19581. getChildIndex( node ) {
  19582. return this._children.getNodeIndex( node );
  19583. }
  19584. /**
  19585. * Returns the starting offset of given child. Starting offset is equal to the sum of
  19586. * {@link module:engine/model/node~Node#offsetSize offset sizes} of all node's siblings that are before it. Returns `null` if
  19587. * given node is not a child of this element.
  19588. *
  19589. * @param {module:engine/model/node~Node} node Child node to look for.
  19590. * @returns {Number} Child node's starting offset.
  19591. */
  19592. getChildStartOffset( node ) {
  19593. return this._children.getNodeStartOffset( node );
  19594. }
  19595. /**
  19596. * Returns index of a node that occupies given offset. If given offset is too low, returns `0`. If given offset is
  19597. * too high, returns {@link module:engine/model/element~Element#getChildIndex index after last child}.
  19598. *
  19599. * const textNode = new Text( 'foo' );
  19600. * const pElement = new Element( 'p' );
  19601. * const divElement = new Element( [ textNode, pElement ] );
  19602. * divElement.offsetToIndex( -1 ); // Returns 0, because offset is too low.
  19603. * divElement.offsetToIndex( 0 ); // Returns 0, because offset 0 is taken by `textNode` which is at index 0.
  19604. * divElement.offsetToIndex( 1 ); // Returns 0, because `textNode` has `offsetSize` equal to 3, so it occupies offset 1 too.
  19605. * divElement.offsetToIndex( 2 ); // Returns 0.
  19606. * divElement.offsetToIndex( 3 ); // Returns 1.
  19607. * divElement.offsetToIndex( 4 ); // Returns 2. There are no nodes at offset 4, so last available index is returned.
  19608. *
  19609. * @param {Number} offset Offset to look for.
  19610. * @returns {Number}
  19611. */
  19612. offsetToIndex( offset ) {
  19613. return this._children.offsetToIndex( offset );
  19614. }
  19615. /**
  19616. * Returns a descendant node by its path relative to this element.
  19617. *
  19618. * // <this>a<b>c</b></this>
  19619. * this.getNodeByPath( [ 0 ] ); // -> "a"
  19620. * this.getNodeByPath( [ 1 ] ); // -> <b>
  19621. * this.getNodeByPath( [ 1, 0 ] ); // -> "c"
  19622. *
  19623. * @param {Array.<Number>} relativePath Path of the node to find, relative to this element.
  19624. * @returns {module:engine/model/node~Node}
  19625. */
  19626. getNodeByPath( relativePath ) {
  19627. let node = this; // eslint-disable-line consistent-this
  19628. for ( const index of relativePath ) {
  19629. node = node.getChild( node.offsetToIndex( index ) );
  19630. }
  19631. return node;
  19632. }
  19633. /**
  19634. * Returns the parent element of the given name. Returns null if the element is not inside the desired parent.
  19635. *
  19636. * @param {String} parentName The name of the parent element to find.
  19637. * @param {Object} [options] Options object.
  19638. * @param {Boolean} [options.includeSelf=false] When set to `true` this node will be also included while searching.
  19639. * @returns {module:engine/model/element~Element|null}
  19640. */
  19641. findAncestor( parentName, options = { includeSelf: false } ) {
  19642. let parent = options.includeSelf ? this : this.parent;
  19643. while ( parent ) {
  19644. if ( parent.name === parentName ) {
  19645. return parent;
  19646. }
  19647. parent = parent.parent;
  19648. }
  19649. return null;
  19650. }
  19651. /**
  19652. * Converts `Element` instance to plain object and returns it. Takes care of converting all of this element's children.
  19653. *
  19654. * @returns {Object} `Element` instance converted to plain object.
  19655. */
  19656. toJSON() {
  19657. const json = super.toJSON();
  19658. json.name = this.name;
  19659. if ( this._children.length > 0 ) {
  19660. json.children = [];
  19661. for ( const node of this._children ) {
  19662. json.children.push( node.toJSON() );
  19663. }
  19664. }
  19665. return json;
  19666. }
  19667. /**
  19668. * Creates a copy of this element and returns it. Created element has the same name and attributes as the original element.
  19669. * If clone is deep, the original element's children are also cloned. If not, then empty element is returned.
  19670. *
  19671. * @protected
  19672. * @param {Boolean} [deep=false] If set to `true` clones element and all its children recursively. When set to `false`,
  19673. * element will be cloned without any child.
  19674. */
  19675. _clone( deep = false ) {
  19676. const children = deep ? Array.from( this._children ).map( node => node._clone( true ) ) : null;
  19677. return new Element( this.name, this.getAttributes(), children );
  19678. }
  19679. /**
  19680. * {@link module:engine/model/element~Element#_insertChild Inserts} one or more nodes at the end of this element.
  19681. *
  19682. * @see module:engine/model/writer~Writer#append
  19683. * @protected
  19684. * @param {module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>} nodes Nodes to be inserted.
  19685. */
  19686. _appendChild( nodes ) {
  19687. this._insertChild( this.childCount, nodes );
  19688. }
  19689. /**
  19690. * Inserts one or more nodes at the given index and sets {@link module:engine/model/node~Node#parent parent} of these nodes
  19691. * to this element.
  19692. *
  19693. * @see module:engine/model/writer~Writer#insert
  19694. * @protected
  19695. * @param {Number} index Index at which nodes should be inserted.
  19696. * @param {module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>} items Items to be inserted.
  19697. */
  19698. _insertChild( index, items ) {
  19699. const nodes = normalize( items );
  19700. for ( const node of nodes ) {
  19701. // If node that is being added to this element is already inside another element, first remove it from the old parent.
  19702. if ( node.parent !== null ) {
  19703. node._remove();
  19704. }
  19705. node.parent = this;
  19706. }
  19707. this._children._insertNodes( index, nodes );
  19708. }
  19709. /**
  19710. * Removes one or more nodes starting at the given index and sets
  19711. * {@link module:engine/model/node~Node#parent parent} of these nodes to `null`.
  19712. *
  19713. * @see module:engine/model/writer~Writer#remove
  19714. * @protected
  19715. * @param {Number} index Index of the first node to remove.
  19716. * @param {Number} [howMany=1] Number of nodes to remove.
  19717. * @returns {Array.<module:engine/model/node~Node>} Array containing removed nodes.
  19718. */
  19719. _removeChildren( index, howMany = 1 ) {
  19720. const nodes = this._children._removeNodes( index, howMany );
  19721. for ( const node of nodes ) {
  19722. node.parent = null;
  19723. }
  19724. return nodes;
  19725. }
  19726. /**
  19727. * Creates an `Element` instance from given plain object (i.e. parsed JSON string).
  19728. * Converts `Element` children to proper nodes.
  19729. *
  19730. * @param {Object} json Plain object to be converted to `Element`.
  19731. * @returns {module:engine/model/element~Element} `Element` instance created using given plain object.
  19732. */
  19733. static fromJSON( json ) {
  19734. let children = null;
  19735. if ( json.children ) {
  19736. children = [];
  19737. for ( const child of json.children ) {
  19738. if ( child.name ) {
  19739. // If child has name property, it is an Element.
  19740. children.push( Element.fromJSON( child ) );
  19741. } else {
  19742. // Otherwise, it is a Text node.
  19743. children.push( _text__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( child ) );
  19744. }
  19745. }
  19746. }
  19747. return new Element( json.name, json.attributes, children );
  19748. }
  19749. // @if CK_DEBUG_ENGINE // toString() {
  19750. // @if CK_DEBUG_ENGINE // return `<${ this.rootName || this.name }>`;
  19751. // @if CK_DEBUG_ENGINE // }
  19752. // @if CK_DEBUG_ENGINE // log() {
  19753. // @if CK_DEBUG_ENGINE // console.log( 'ModelElement: ' + this );
  19754. // @if CK_DEBUG_ENGINE // }
  19755. // @if CK_DEBUG_ENGINE // logExtended() {
  19756. // @if CK_DEBUG_ENGINE // console.log( `ModelElement: ${ this }, ${ this.childCount } children,
  19757. // @if CK_DEBUG_ENGINE // attrs: ${ convertMapToStringifiedObject( this.getAttributes() ) }` );
  19758. // @if CK_DEBUG_ENGINE // }
  19759. // @if CK_DEBUG_ENGINE // logAll() {
  19760. // @if CK_DEBUG_ENGINE // console.log( '--------------------' );
  19761. // @if CK_DEBUG_ENGINE //
  19762. // @if CK_DEBUG_ENGINE // this.logExtended();
  19763. // @if CK_DEBUG_ENGINE // console.log( 'List of children:' );
  19764. // @if CK_DEBUG_ENGINE //
  19765. // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
  19766. // @if CK_DEBUG_ENGINE // child.log();
  19767. // @if CK_DEBUG_ENGINE // }
  19768. // @if CK_DEBUG_ENGINE // }
  19769. // @if CK_DEBUG_ENGINE // printTree( level = 0) {
  19770. // @if CK_DEBUG_ENGINE // let string = '';
  19771. // @if CK_DEBUG_ENGINE // string += '\t'.repeat( level );
  19772. // @if CK_DEBUG_ENGINE // string += `<${ this.rootName || this.name }${ convertMapToTags( this.getAttributes() ) }>`;
  19773. // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
  19774. // @if CK_DEBUG_ENGINE // string += '\n';
  19775. // @if CK_DEBUG_ENGINE // if ( child.is( '$text' ) ) {
  19776. // @if CK_DEBUG_ENGINE // const textAttrs = convertMapToTags( child._attrs );
  19777. // @if CK_DEBUG_ENGINE // string += '\t'.repeat( level + 1 );
  19778. // @if CK_DEBUG_ENGINE // if ( textAttrs !== '' ) {
  19779. // @if CK_DEBUG_ENGINE // string += `<$text${ textAttrs }>` + child.data + '</$text>';
  19780. // @if CK_DEBUG_ENGINE // } else {
  19781. // @if CK_DEBUG_ENGINE // string += child.data;
  19782. // @if CK_DEBUG_ENGINE // }
  19783. // @if CK_DEBUG_ENGINE // } else {
  19784. // @if CK_DEBUG_ENGINE // string += child.printTree( level + 1 );
  19785. // @if CK_DEBUG_ENGINE // }
  19786. // @if CK_DEBUG_ENGINE // }
  19787. // @if CK_DEBUG_ENGINE // if ( this.childCount ) {
  19788. // @if CK_DEBUG_ENGINE // string += '\n' + '\t'.repeat( level );
  19789. // @if CK_DEBUG_ENGINE // }
  19790. // @if CK_DEBUG_ENGINE // string += `</${ this.rootName || this.name }>`;
  19791. // @if CK_DEBUG_ENGINE // return string;
  19792. // @if CK_DEBUG_ENGINE // }
  19793. // @if CK_DEBUG_ENGINE // logTree() {
  19794. // @if CK_DEBUG_ENGINE // console.log( this.printTree() );
  19795. // @if CK_DEBUG_ENGINE // }
  19796. }
  19797. // Converts strings to Text and non-iterables to arrays.
  19798. //
  19799. // @param {String|module:engine/model/item~Item|Iterable.<String|module:engine/model/item~Item>}
  19800. // @returns {Iterable.<module:engine/model/node~Node>}
  19801. function normalize( nodes ) {
  19802. // Separate condition because string is iterable.
  19803. if ( typeof nodes == 'string' ) {
  19804. return [ new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( nodes ) ];
  19805. }
  19806. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_4__["default"])( nodes ) ) {
  19807. nodes = [ nodes ];
  19808. }
  19809. // Array.from to enable .map() on non-arrays.
  19810. return Array.from( nodes )
  19811. .map( node => {
  19812. if ( typeof node == 'string' ) {
  19813. return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( node );
  19814. }
  19815. if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_3__["default"] ) {
  19816. return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( node.data, node.getAttributes() );
  19817. }
  19818. return node;
  19819. } );
  19820. }
  19821. /***/ }),
  19822. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/history.js":
  19823. /*!**********************************************************************!*\
  19824. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/history.js ***!
  19825. \**********************************************************************/
  19826. /*! exports provided: default */
  19827. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19828. "use strict";
  19829. __webpack_require__.r(__webpack_exports__);
  19830. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return History; });
  19831. /**
  19832. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  19833. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  19834. */
  19835. /**
  19836. * @module engine/model/history
  19837. */
  19838. /**
  19839. * `History` keeps the track of all the operations applied to the {@link module:engine/model/document~Document document}.
  19840. */
  19841. class History {
  19842. /**
  19843. * Creates an empty History instance.
  19844. */
  19845. constructor() {
  19846. /**
  19847. * Operations added to the history.
  19848. *
  19849. * @protected
  19850. * @member {Array.<module:engine/model/operation/operation~Operation>} module:engine/model/history~History#_operations
  19851. */
  19852. this._operations = [];
  19853. /**
  19854. * Holds an information which {@link module:engine/model/operation/operation~Operation operation} undoes which
  19855. * {@link module:engine/model/operation/operation~Operation operation}.
  19856. *
  19857. * Keys of the map are "undoing operations", that is operations that undone some other operations. For each key, the
  19858. * value is an operation that has been undone by the "undoing operation".
  19859. *
  19860. * @private
  19861. * @member {Map} module:engine/model/history~History#_undoPairs
  19862. */
  19863. this._undoPairs = new Map();
  19864. /**
  19865. * Holds all undone operations.
  19866. *
  19867. * @private
  19868. * @member {Set.<module:engine/model/operation/operation~Operation>} module:engine/model/history~History#_undoneOperations
  19869. */
  19870. this._undoneOperations = new Set();
  19871. }
  19872. /**
  19873. * Adds an operation to the history.
  19874. *
  19875. * @param {module:engine/model/operation/operation~Operation} operation Operation to add.
  19876. */
  19877. addOperation( operation ) {
  19878. if ( this._operations.includes( operation ) ) {
  19879. return;
  19880. }
  19881. this._operations.push( operation );
  19882. }
  19883. /**
  19884. * Returns operations added to the history.
  19885. *
  19886. * @param {Number} [from=Number.NEGATIVE_INFINITY] Base version from which operations should be returned (inclusive).
  19887. * Defaults to `Number.NEGATIVE_INFINITY`, which means that operations from the first one will be returned.
  19888. * @param {Number} [to=Number.POSITIVE_INFINITY] Base version up to which operations should be returned (exclusive).
  19889. * Defaults to `Number.POSITIVE_INFINITY` which means that operations up to the last one will be returned.
  19890. * @returns {Array.<module:engine/model/operation/operation~Operation>} Operations added to the history.
  19891. */
  19892. getOperations( from = Number.NEGATIVE_INFINITY, to = Number.POSITIVE_INFINITY ) {
  19893. const operations = [];
  19894. for ( const operation of this._operations ) {
  19895. if ( operation.baseVersion >= from && operation.baseVersion < to ) {
  19896. operations.push( operation );
  19897. }
  19898. }
  19899. return operations;
  19900. }
  19901. /**
  19902. * Returns operation from the history that bases on given `baseVersion`.
  19903. *
  19904. * @param {Number} baseVersion Base version of the operation to get.
  19905. * @returns {module:engine/model/operation/operation~Operation|undefined} Operation with given base version or `undefined` if
  19906. * there is no such operation in history.
  19907. */
  19908. getOperation( baseVersion ) {
  19909. for ( const operation of this._operations ) {
  19910. if ( operation.baseVersion == baseVersion ) {
  19911. return operation;
  19912. }
  19913. }
  19914. }
  19915. /**
  19916. * Marks in history that one operation is an operation that is undoing the other operation. By marking operation this way,
  19917. * history is keeping more context information about operations, which helps in operational transformation.
  19918. *
  19919. * @param {module:engine/model/operation/operation~Operation} undoneOperation Operation which is undone by `undoingOperation`.
  19920. * @param {module:engine/model/operation/operation~Operation} undoingOperation Operation which undoes `undoneOperation`.
  19921. */
  19922. setOperationAsUndone( undoneOperation, undoingOperation ) {
  19923. this._undoPairs.set( undoingOperation, undoneOperation );
  19924. this._undoneOperations.add( undoneOperation );
  19925. }
  19926. /**
  19927. * Checks whether given `operation` is undoing any other operation.
  19928. *
  19929. * @param {module:engine/model/operation/operation~Operation} operation Operation to check.
  19930. * @returns {Boolean} `true` if given `operation` is undoing any other operation, `false` otherwise.
  19931. */
  19932. isUndoingOperation( operation ) {
  19933. return this._undoPairs.has( operation );
  19934. }
  19935. /**
  19936. * Checks whether given `operation` has been undone by any other operation.
  19937. *
  19938. * @param {module:engine/model/operation/operation~Operation} operation Operation to check.
  19939. * @returns {Boolean} `true` if given `operation` has been undone any other operation, `false` otherwise.
  19940. */
  19941. isUndoneOperation( operation ) {
  19942. return this._undoneOperations.has( operation );
  19943. }
  19944. /**
  19945. * For given `undoingOperation`, returns the operation which has been undone by it.
  19946. *
  19947. * @param {module:engine/model/operation/operation~Operation} undoingOperation
  19948. * @returns {module:engine/model/operation/operation~Operation|undefined} Operation that has been undone by given
  19949. * `undoingOperation` or `undefined` if given `undoingOperation` is not undoing any other operation.
  19950. */
  19951. getUndoneOperation( undoingOperation ) {
  19952. return this._undoPairs.get( undoingOperation );
  19953. }
  19954. }
  19955. /***/ }),
  19956. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js":
  19957. /*!***************************************************************************!*\
  19958. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js ***!
  19959. \***************************************************************************/
  19960. /*! exports provided: default */
  19961. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19962. "use strict";
  19963. __webpack_require__.r(__webpack_exports__);
  19964. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LivePosition; });
  19965. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  19966. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  19967. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  19968. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  19969. /**
  19970. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  19971. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  19972. */
  19973. /**
  19974. * @module engine/model/liveposition
  19975. */
  19976. /**
  19977. * `LivePosition` is a type of {@link module:engine/model/position~Position Position}
  19978. * that updates itself as {@link module:engine/model/document~Document document}
  19979. * is changed through operations. It may be used as a bookmark.
  19980. *
  19981. * **Note:** Contrary to {@link module:engine/model/position~Position}, `LivePosition` works only in roots that are
  19982. * {@link module:engine/model/rootelement~RootElement}.
  19983. * If {@link module:engine/model/documentfragment~DocumentFragment} is passed, error will be thrown.
  19984. *
  19985. * **Note:** Be very careful when dealing with `LivePosition`. Each `LivePosition` instance bind events that might
  19986. * have to be unbound.
  19987. * Use {@link module:engine/model/liveposition~LivePosition#detach} whenever you don't need `LivePosition` anymore.
  19988. *
  19989. * @extends module:engine/model/position~Position
  19990. */
  19991. class LivePosition extends _position__WEBPACK_IMPORTED_MODULE_0__["default"] {
  19992. /**
  19993. * Creates a live position.
  19994. *
  19995. * @see module:engine/model/position~Position
  19996. * @param {module:engine/model/rootelement~RootElement} root
  19997. * @param {Array.<Number>} path
  19998. * @param {module:engine/model/position~PositionStickiness} [stickiness]
  19999. */
  20000. constructor( root, path, stickiness = 'toNone' ) {
  20001. super( root, path, stickiness );
  20002. if ( !this.root.is( 'rootElement' ) ) {
  20003. /**
  20004. * LivePosition's root has to be an instance of RootElement.
  20005. *
  20006. * @error model-liveposition-root-not-rootelement
  20007. */
  20008. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"]( 'model-liveposition-root-not-rootelement', root );
  20009. }
  20010. bindWithDocument.call( this );
  20011. }
  20012. /**
  20013. * Unbinds all events previously bound by `LivePosition`. Use it whenever you don't need `LivePosition` instance
  20014. * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was
  20015. * referring to it).
  20016. */
  20017. detach() {
  20018. this.stopListening();
  20019. }
  20020. /**
  20021. * Checks whether this object is of the given.
  20022. *
  20023. * livePosition.is( 'position' ); // -> true
  20024. * livePosition.is( 'model:position' ); // -> true
  20025. * livePosition.is( 'liveposition' ); // -> true
  20026. * livePosition.is( 'model:livePosition' ); // -> true
  20027. *
  20028. * livePosition.is( 'view:position' ); // -> false
  20029. * livePosition.is( 'documentSelection' ); // -> false
  20030. *
  20031. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  20032. *
  20033. * @param {String} type
  20034. * @returns {Boolean}
  20035. */
  20036. is( type ) {
  20037. return type === 'livePosition' || type === 'model:livePosition' ||
  20038. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  20039. type == 'position' || type === 'model:position';
  20040. }
  20041. /**
  20042. * Creates a {@link module:engine/model/position~Position position instance}, which is equal to this live position.
  20043. *
  20044. * @returns {module:engine/model/position~Position}
  20045. */
  20046. toPosition() {
  20047. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( this.root, this.path.slice(), this.stickiness );
  20048. }
  20049. /**
  20050. * Creates a `LivePosition` instance that is equal to position.
  20051. *
  20052. * @param {module:engine/model/position~Position} position
  20053. * @param {module:engine/model/position~PositionStickiness} [stickiness]
  20054. * @returns {module:engine/model/liveposition~LivePosition}
  20055. */
  20056. static fromPosition( position, stickiness ) {
  20057. return new this( position.root, position.path.slice(), stickiness ? stickiness : position.stickiness );
  20058. }
  20059. /**
  20060. * @static
  20061. * @protected
  20062. * @method module:engine/model/liveposition~LivePosition._createAfter
  20063. * @see module:engine/model/position~Position._createAfter
  20064. * @param {module:engine/model/node~Node} node
  20065. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone']
  20066. * @returns {module:engine/model/liveposition~LivePosition}
  20067. */
  20068. /**
  20069. * @static
  20070. * @protected
  20071. * @method module:engine/model/liveposition~LivePosition._createBefore
  20072. * @see module:engine/model/position~Position._createBefore
  20073. * @param {module:engine/model/node~Node} node
  20074. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone']
  20075. * @returns {module:engine/model/liveposition~LivePosition}
  20076. */
  20077. /**
  20078. * @static
  20079. * @protected
  20080. * @method module:engine/model/liveposition~LivePosition._createAt
  20081. * @see module:engine/model/position~Position._createAt
  20082. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  20083. * @param {Number|'end'|'before'|'after'} [offset]
  20084. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone']
  20085. * @returns {module:engine/model/liveposition~LivePosition}
  20086. */
  20087. /**
  20088. * Fired when `LivePosition` instance is changed due to changes on {@link module:engine/model/document~Document}.
  20089. *
  20090. * @event module:engine/model/liveposition~LivePosition#change
  20091. * @param {module:engine/model/position~Position} oldPosition Position equal to this live position before it got changed.
  20092. */
  20093. }
  20094. // Binds this `LivePosition` to the {@link module:engine/model/document~Document document} that owns
  20095. // this position's {@link module:engine/model/position~Position#root root}.
  20096. //
  20097. // @private
  20098. function bindWithDocument() {
  20099. this.listenTo(
  20100. this.root.document.model,
  20101. 'applyOperation',
  20102. ( event, args ) => {
  20103. const operation = args[ 0 ];
  20104. if ( !operation.isDocumentOperation ) {
  20105. return;
  20106. }
  20107. transform.call( this, operation );
  20108. },
  20109. { priority: 'low' }
  20110. );
  20111. }
  20112. // Updates this position accordingly to the updates applied to the model. Bases on change events.
  20113. //
  20114. // @private
  20115. // @param {module:engine/model/operation/operation~Operation} operation Executed operation.
  20116. function transform( operation ) {
  20117. const result = this.getTransformedByOperation( operation );
  20118. if ( !this.isEqual( result ) ) {
  20119. const oldPosition = this.toPosition();
  20120. this.path = result.path;
  20121. this.root = result.root;
  20122. this.fire( 'change', oldPosition );
  20123. }
  20124. }
  20125. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( LivePosition, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  20126. /***/ }),
  20127. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js":
  20128. /*!************************************************************************!*\
  20129. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js ***!
  20130. \************************************************************************/
  20131. /*! exports provided: default */
  20132. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20133. "use strict";
  20134. __webpack_require__.r(__webpack_exports__);
  20135. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LiveRange; });
  20136. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  20137. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  20138. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  20139. /**
  20140. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  20141. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  20142. */
  20143. /**
  20144. * @module engine/model/liverange
  20145. */
  20146. /**
  20147. * `LiveRange` is a type of {@link module:engine/model/range~Range Range}
  20148. * that updates itself as {@link module:engine/model/document~Document document}
  20149. * is changed through operations. It may be used as a bookmark.
  20150. *
  20151. * **Note:** Be very careful when dealing with `LiveRange`. Each `LiveRange` instance bind events that might
  20152. * have to be unbound. Use {@link module:engine/model/liverange~LiveRange#detach detach} whenever you don't need `LiveRange` anymore.
  20153. */
  20154. class LiveRange extends _range__WEBPACK_IMPORTED_MODULE_0__["default"] {
  20155. /**
  20156. * Creates a live range.
  20157. *
  20158. * @see module:engine/model/range~Range
  20159. */
  20160. constructor( start, end ) {
  20161. super( start, end );
  20162. bindWithDocument.call( this );
  20163. }
  20164. /**
  20165. * Unbinds all events previously bound by `LiveRange`. Use it whenever you don't need `LiveRange` instance
  20166. * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was
  20167. * referring to it).
  20168. */
  20169. detach() {
  20170. this.stopListening();
  20171. }
  20172. /**
  20173. * Checks whether this object is of the given.
  20174. *
  20175. * liveRange.is( 'range' ); // -> true
  20176. * liveRange.is( 'model:range' ); // -> true
  20177. * liveRange.is( 'liveRange' ); // -> true
  20178. * liveRange.is( 'model:liveRange' ); // -> true
  20179. *
  20180. * liveRange.is( 'view:range' ); // -> false
  20181. * liveRange.is( 'documentSelection' ); // -> false
  20182. *
  20183. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  20184. *
  20185. * @param {String} type
  20186. * @returns {Boolean}
  20187. */
  20188. is( type ) {
  20189. return type === 'liveRange' || type === 'model:liveRange' ||
  20190. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  20191. type == 'range' || type === 'model:range';
  20192. }
  20193. /**
  20194. * Creates a {@link module:engine/model/range~Range range instance} that is equal to this live range.
  20195. *
  20196. * @returns {module:engine/model/range~Range}
  20197. */
  20198. toRange() {
  20199. return new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( this.start, this.end );
  20200. }
  20201. /**
  20202. * Creates a `LiveRange` instance that is equal to the given range.
  20203. *
  20204. * @param {module:engine/model/range~Range} range
  20205. * @returns {module:engine/model/liverange~LiveRange}
  20206. */
  20207. static fromRange( range ) {
  20208. return new LiveRange( range.start, range.end );
  20209. }
  20210. /**
  20211. * @see module:engine/model/range~Range._createIn
  20212. * @static
  20213. * @protected
  20214. * @method module:engine/model/liverange~LiveRange._createIn
  20215. * @param {module:engine/model/element~Element} element
  20216. * @returns {module:engine/model/liverange~LiveRange}
  20217. */
  20218. /**
  20219. * @see module:engine/model/range~Range._createOn
  20220. * @static
  20221. * @protected
  20222. * @method module:engine/model/liverange~LiveRange._createOn
  20223. * @param {module:engine/model/element~Element} element
  20224. * @returns {module:engine/model/liverange~LiveRange}
  20225. */
  20226. /**
  20227. * @see module:engine/model/range~Range._createFromPositionAndShift
  20228. * @static
  20229. * @protected
  20230. * @method module:engine/model/liverange~LiveRange._createFromPositionAndShift
  20231. * @param {module:engine/model/position~Position} position
  20232. * @param {Number} shift
  20233. * @returns {module:engine/model/liverange~LiveRange}
  20234. */
  20235. /**
  20236. * Fired when `LiveRange` instance boundaries have changed due to changes in the
  20237. * {@link module:engine/model/document~Document document}.
  20238. *
  20239. * @event change:range
  20240. * @param {module:engine/model/range~Range} oldRange Range with start and end position equal to start and end position of this live
  20241. * range before it got changed.
  20242. * @param {Object} data Object with additional information about the change.
  20243. * @param {module:engine/model/position~Position|null} data.deletionPosition Source position for remove and merge changes.
  20244. * Available if the range was moved to the graveyard root, `null` otherwise.
  20245. */
  20246. /**
  20247. * Fired when `LiveRange` instance boundaries have not changed after a change in {@link module:engine/model/document~Document document}
  20248. * but the change took place inside the range, effectively changing its content.
  20249. *
  20250. * @event change:content
  20251. * @param {module:engine/model/range~Range} range Range with start and end position equal to start and end position of
  20252. * change range.
  20253. * @param {Object} data Object with additional information about the change.
  20254. * @param {null} data.deletionPosition Due to the nature of this event, this property is always set to `null`. It is passed
  20255. * for compatibility with the {@link module:engine/model/liverange~LiveRange#event:change:range} event.
  20256. */
  20257. }
  20258. // Binds this `LiveRange` to the {@link module:engine/model/document~Document document}
  20259. // that owns this range's {@link module:engine/model/range~Range#root root}.
  20260. //
  20261. // @private
  20262. function bindWithDocument() {
  20263. this.listenTo(
  20264. this.root.document.model,
  20265. 'applyOperation',
  20266. ( event, args ) => {
  20267. const operation = args[ 0 ];
  20268. if ( !operation.isDocumentOperation ) {
  20269. return;
  20270. }
  20271. transform.call( this, operation );
  20272. },
  20273. { priority: 'low' }
  20274. );
  20275. }
  20276. // Updates this range accordingly to the updates applied to the model. Bases on change events.
  20277. //
  20278. // @private
  20279. // @param {module:engine/model/operation/operation~Operation} operation Executed operation.
  20280. function transform( operation ) {
  20281. // Transform the range by the operation. Join the result ranges if needed.
  20282. const ranges = this.getTransformedByOperation( operation );
  20283. const result = _range__WEBPACK_IMPORTED_MODULE_0__["default"]._createFromRanges( ranges );
  20284. const boundariesChanged = !result.isEqual( this );
  20285. const contentChanged = doesOperationChangeRangeContent( this, operation );
  20286. let deletionPosition = null;
  20287. if ( boundariesChanged ) {
  20288. // If range boundaries have changed, fire `change:range` event.
  20289. //
  20290. if ( result.root.rootName == '$graveyard' ) {
  20291. // If the range was moved to the graveyard root, set `deletionPosition`.
  20292. if ( operation.type == 'remove' ) {
  20293. deletionPosition = operation.sourcePosition;
  20294. } else {
  20295. // Merge operation.
  20296. deletionPosition = operation.deletionPosition;
  20297. }
  20298. }
  20299. const oldRange = this.toRange();
  20300. this.start = result.start;
  20301. this.end = result.end;
  20302. this.fire( 'change:range', oldRange, { deletionPosition } );
  20303. } else if ( contentChanged ) {
  20304. // If range boundaries have not changed, but there was change inside the range, fire `change:content` event.
  20305. this.fire( 'change:content', this.toRange(), { deletionPosition } );
  20306. }
  20307. }
  20308. // Checks whether given operation changes something inside the range (even if it does not change boundaries).
  20309. //
  20310. // @private
  20311. // @param {module:engine/model/range~Range} range Range to check.
  20312. // @param {module:engine/model/operation/operation~Operation} operation Executed operation.
  20313. // @returns {Boolean}
  20314. function doesOperationChangeRangeContent( range, operation ) {
  20315. switch ( operation.type ) {
  20316. case 'insert':
  20317. return range.containsPosition( operation.position );
  20318. case 'move':
  20319. case 'remove':
  20320. case 'reinsert':
  20321. case 'merge':
  20322. return range.containsPosition( operation.sourcePosition ) ||
  20323. range.start.isEqual( operation.sourcePosition ) ||
  20324. range.containsPosition( operation.targetPosition );
  20325. case 'split':
  20326. return range.containsPosition( operation.splitPosition ) || range.containsPosition( operation.insertionPosition );
  20327. }
  20328. return false;
  20329. }
  20330. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( LiveRange, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  20331. /***/ }),
  20332. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/markercollection.js":
  20333. /*!*******************************************************************************!*\
  20334. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/markercollection.js ***!
  20335. \*******************************************************************************/
  20336. /*! exports provided: default */
  20337. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20338. "use strict";
  20339. __webpack_require__.r(__webpack_exports__);
  20340. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MarkerCollection; });
  20341. /* harmony import */ var _liverange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./liverange */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js");
  20342. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  20343. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  20344. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  20345. /**
  20346. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  20347. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  20348. */
  20349. /**
  20350. * @module engine/model/markercollection
  20351. */
  20352. /**
  20353. * The collection of all {@link module:engine/model/markercollection~Marker markers} attached to the document.
  20354. * It lets you {@link module:engine/model/markercollection~MarkerCollection#get get} markers or track them using
  20355. * {@link module:engine/model/markercollection~MarkerCollection#event:update} event.
  20356. *
  20357. * To create, change or remove makers use {@link module:engine/model/writer~Writer model writers'} methods:
  20358. * {@link module:engine/model/writer~Writer#addMarker} or {@link module:engine/model/writer~Writer#removeMarker}. Since
  20359. * the writer is the only proper way to change the data model it is not possible to change markers directly using this
  20360. * collection. All markers created by the writer will be automatically added to this collection.
  20361. *
  20362. * By default there is one marker collection available as {@link module:engine/model/model~Model#markers model property}.
  20363. *
  20364. * @see module:engine/model/markercollection~Marker
  20365. */
  20366. class MarkerCollection {
  20367. /**
  20368. * Creates a markers collection.
  20369. */
  20370. constructor() {
  20371. /**
  20372. * Stores {@link ~Marker markers} added to the collection.
  20373. *
  20374. * @private
  20375. * @member {Map} #_markers
  20376. */
  20377. this._markers = new Map();
  20378. }
  20379. /**
  20380. * Iterable interface.
  20381. *
  20382. * Iterates over all {@link ~Marker markers} added to the collection.
  20383. *
  20384. * @returns {Iterable}
  20385. */
  20386. [ Symbol.iterator ]() {
  20387. return this._markers.values();
  20388. }
  20389. /**
  20390. * Checks if given {@link ~Marker marker} or marker name is in the collection.
  20391. *
  20392. * @param {String|module:engine/model/markercollection~Marker} markerOrName Name of marker or marker instance to check.
  20393. * @returns {Boolean} `true` if marker is in the collection, `false` otherwise.
  20394. */
  20395. has( markerOrName ) {
  20396. const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;
  20397. return this._markers.has( markerName );
  20398. }
  20399. /**
  20400. * Returns {@link ~Marker marker} with given `markerName`.
  20401. *
  20402. * @param {String} markerName Name of marker to get.
  20403. * @returns {module:engine/model/markercollection~Marker|null} Marker with given name or `null` if such marker was
  20404. * not added to the collection.
  20405. */
  20406. get( markerName ) {
  20407. return this._markers.get( markerName ) || null;
  20408. }
  20409. /**
  20410. * Creates and adds a {@link ~Marker marker} to the `MarkerCollection` with given name on given
  20411. * {@link module:engine/model/range~Range range}.
  20412. *
  20413. * If `MarkerCollection` already had a marker with given name (or {@link ~Marker marker} was passed), the marker in
  20414. * collection is updated and {@link module:engine/model/markercollection~MarkerCollection#event:update} event is fired
  20415. * but only if there was a change (marker range or {@link module:engine/model/markercollection~Marker#managedUsingOperations}
  20416. * flag has changed.
  20417. *
  20418. * @protected
  20419. * @fires module:engine/model/markercollection~MarkerCollection#event:update
  20420. * @param {String|module:engine/model/markercollection~Marker} markerOrName Name of marker to set or marker instance to update.
  20421. * @param {module:engine/model/range~Range} range Marker range.
  20422. * @param {Boolean} [managedUsingOperations=false] Specifies whether the marker is managed using operations.
  20423. * @param {Boolean} [affectsData=false] Specifies whether the marker affects the data produced by the data pipeline
  20424. * (is persisted in the editor's data).
  20425. * @returns {module:engine/model/markercollection~Marker} `Marker` instance which was added or updated.
  20426. */
  20427. _set( markerOrName, range, managedUsingOperations = false, affectsData = false ) {
  20428. const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;
  20429. if ( markerName.includes( ',' ) ) {
  20430. /**
  20431. * Marker name cannot contain the "," character.
  20432. *
  20433. * @error markercollection-incorrect-marker-name
  20434. */
  20435. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'markercollection-incorrect-marker-name', this );
  20436. }
  20437. const oldMarker = this._markers.get( markerName );
  20438. if ( oldMarker ) {
  20439. const oldRange = oldMarker.getRange();
  20440. let hasChanged = false;
  20441. if ( !oldRange.isEqual( range ) ) {
  20442. oldMarker._attachLiveRange( _liverange__WEBPACK_IMPORTED_MODULE_0__["default"].fromRange( range ) );
  20443. hasChanged = true;
  20444. }
  20445. if ( managedUsingOperations != oldMarker.managedUsingOperations ) {
  20446. oldMarker._managedUsingOperations = managedUsingOperations;
  20447. hasChanged = true;
  20448. }
  20449. if ( typeof affectsData === 'boolean' && affectsData != oldMarker.affectsData ) {
  20450. oldMarker._affectsData = affectsData;
  20451. hasChanged = true;
  20452. }
  20453. if ( hasChanged ) {
  20454. this.fire( 'update:' + markerName, oldMarker, oldRange, range );
  20455. }
  20456. return oldMarker;
  20457. }
  20458. const liveRange = _liverange__WEBPACK_IMPORTED_MODULE_0__["default"].fromRange( range );
  20459. const marker = new Marker( markerName, liveRange, managedUsingOperations, affectsData );
  20460. this._markers.set( markerName, marker );
  20461. this.fire( 'update:' + markerName, marker, null, range );
  20462. return marker;
  20463. }
  20464. /**
  20465. * Removes given {@link ~Marker marker} or a marker with given name from the `MarkerCollection`.
  20466. *
  20467. * @protected
  20468. * @fires module:engine/model/markercollection~MarkerCollection#event:update
  20469. * @param {String} markerOrName Marker or name of a marker to remove.
  20470. * @returns {Boolean} `true` if marker was found and removed, `false` otherwise.
  20471. */
  20472. _remove( markerOrName ) {
  20473. const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;
  20474. const oldMarker = this._markers.get( markerName );
  20475. if ( oldMarker ) {
  20476. this._markers.delete( markerName );
  20477. this.fire( 'update:' + markerName, oldMarker, oldMarker.getRange(), null );
  20478. this._destroyMarker( oldMarker );
  20479. return true;
  20480. }
  20481. return false;
  20482. }
  20483. /**
  20484. * Fires an {@link module:engine/model/markercollection~MarkerCollection#event:update} event for the given {@link ~Marker marker}
  20485. * but does not change the marker. Useful to force {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast
  20486. * conversion} for the marker.
  20487. *
  20488. * @protected
  20489. * @fires module:engine/model/markercollection~MarkerCollection#event:update
  20490. * @param {String} markerOrName Marker or name of a marker to refresh.
  20491. */
  20492. _refresh( markerOrName ) {
  20493. const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;
  20494. const marker = this._markers.get( markerName );
  20495. if ( !marker ) {
  20496. /**
  20497. * Marker with provided name does not exists.
  20498. *
  20499. * @error markercollection-refresh-marker-not-exists
  20500. */
  20501. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'markercollection-refresh-marker-not-exists', this );
  20502. }
  20503. const range = marker.getRange();
  20504. this.fire( 'update:' + markerName, marker, range, range, marker.managedUsingOperations, marker.affectsData );
  20505. }
  20506. /**
  20507. * Returns iterator that iterates over all markers, which ranges contain given {@link module:engine/model/position~Position position}.
  20508. *
  20509. * @param {module:engine/model/position~Position} position
  20510. * @returns {Iterable.<module:engine/model/markercollection~Marker>}
  20511. */
  20512. * getMarkersAtPosition( position ) {
  20513. for ( const marker of this ) {
  20514. if ( marker.getRange().containsPosition( position ) ) {
  20515. yield marker;
  20516. }
  20517. }
  20518. }
  20519. /**
  20520. * Returns iterator that iterates over all markers, which intersects with given {@link module:engine/model/range~Range range}.
  20521. *
  20522. * @param {module:engine/model/range~Range} range
  20523. * @returns {Iterable.<module:engine/model/markercollection~Marker>}
  20524. */
  20525. * getMarkersIntersectingRange( range ) {
  20526. for ( const marker of this ) {
  20527. if ( marker.getRange().getIntersection( range ) !== null ) {
  20528. yield marker;
  20529. }
  20530. }
  20531. }
  20532. /**
  20533. * Destroys marker collection and all markers inside it.
  20534. */
  20535. destroy() {
  20536. for ( const marker of this._markers.values() ) {
  20537. this._destroyMarker( marker );
  20538. }
  20539. this._markers = null;
  20540. this.stopListening();
  20541. }
  20542. /**
  20543. * Iterates over all markers that starts with given `prefix`.
  20544. *
  20545. * const markerFooA = markersCollection.set( 'foo:a', rangeFooA );
  20546. * const markerFooB = markersCollection.set( 'foo:b', rangeFooB );
  20547. * const markerBarA = markersCollection.set( 'bar:a', rangeBarA );
  20548. * const markerFooBarA = markersCollection.set( 'foobar:a', rangeFooBarA );
  20549. * Array.from( markersCollection.getMarkersGroup( 'foo' ) ); // [ markerFooA, markerFooB ]
  20550. * Array.from( markersCollection.getMarkersGroup( 'a' ) ); // []
  20551. *
  20552. * @param prefix
  20553. * @returns {Iterable.<module:engine/model/markercollection~Marker>}
  20554. */
  20555. * getMarkersGroup( prefix ) {
  20556. for ( const marker of this._markers.values() ) {
  20557. if ( marker.name.startsWith( prefix + ':' ) ) {
  20558. yield marker;
  20559. }
  20560. }
  20561. }
  20562. /**
  20563. * Destroys the marker.
  20564. *
  20565. * @private
  20566. * @param {module:engine/model/markercollection~Marker} marker Marker to destroy.
  20567. */
  20568. _destroyMarker( marker ) {
  20569. marker.stopListening();
  20570. marker._detachLiveRange();
  20571. }
  20572. /**
  20573. * Fired whenever marker is added, updated or removed from `MarkerCollection`.
  20574. *
  20575. * @event update
  20576. * @param {module:engine/model/markercollection~Marker} marker Updated Marker.
  20577. * @param {module:engine/model/range~Range|null} oldRange Marker range before the update. When is not defined it
  20578. * means that marker is just added.
  20579. * @param {module:engine/model/range~Range|null} newRange Marker range after update. When is not defined it
  20580. * means that marker is just removed.
  20581. */
  20582. }
  20583. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( MarkerCollection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  20584. /**
  20585. * `Marker` is a continuous parts of model (like a range), is named and represent some kind of information about marked
  20586. * part of model document. In contrary to {@link module:engine/model/node~Node nodes}, which are building blocks of
  20587. * model document tree, markers are not stored directly in document tree but in
  20588. * {@link module:engine/model/model~Model#markers model markers' collection}. Still, they are document data, by giving
  20589. * additional meaning to the part of a model document between marker start and marker end.
  20590. *
  20591. * In this sense, markers are similar to adding and converting attributes on nodes. The difference is that attribute is
  20592. * connected with a given node (e.g. a character is bold no matter if it gets moved or content around it changes).
  20593. * Markers on the other hand are continuous ranges and are characterized by their start and end position. This means that
  20594. * any character in the marker is marked by the marker. For example, if a character is moved outside of marker it stops being
  20595. * "special" and the marker is shrunk. Similarly, when a character is moved into the marker from other place in document
  20596. * model, it starts being "special" and the marker is enlarged.
  20597. *
  20598. * Another upside of markers is that finding marked part of document is fast and easy. Using attributes to mark some nodes
  20599. * and then trying to find that part of document would require traversing whole document tree. Marker gives instant access
  20600. * to the range which it is marking at the moment.
  20601. *
  20602. * Markers are built from a name and a range.
  20603. *
  20604. * Range of the marker is updated automatically when document changes, using
  20605. * {@link module:engine/model/liverange~LiveRange live range} mechanism.
  20606. *
  20607. * Name is used to group and identify markers. Names have to be unique, but markers can be grouped by
  20608. * using common prefixes, separated with `:`, for example: `user:john` or `search:3`. That's useful in term of creating
  20609. * namespaces for custom elements (e.g. comments, highlights). You can use this prefixes in
  20610. * {@link module:engine/model/markercollection~MarkerCollection#event:update} listeners to listen on changes in a group of markers.
  20611. * For instance: `model.markers.on( 'update:user', callback );` will be called whenever any `user:*` markers changes.
  20612. *
  20613. * There are two types of markers.
  20614. *
  20615. * 1. Markers managed directly, without using operations. They are added directly by {@link module:engine/model/writer~Writer}
  20616. * to the {@link module:engine/model/markercollection~MarkerCollection} without any additional mechanism. They can be used
  20617. * as bookmarks or visual markers. They are great for showing results of the find, or select link when the focus is in the input.
  20618. *
  20619. * 1. Markers managed using operations. These markers are also stored in {@link module:engine/model/markercollection~MarkerCollection}
  20620. * but changes in these markers is managed the same way all other changes in the model structure - using operations.
  20621. * Therefore, they are handled in the undo stack and synchronized between clients if the collaboration plugin is enabled.
  20622. * This type of markers is useful for solutions like spell checking or comments.
  20623. *
  20624. * Both type of them should be added / updated by {@link module:engine/model/writer~Writer#addMarker}
  20625. * and removed by {@link module:engine/model/writer~Writer#removeMarker} methods.
  20626. *
  20627. * model.change( ( writer ) => {
  20628. * const marker = writer.addMarker( name, { range, usingOperation: true } );
  20629. *
  20630. * // ...
  20631. *
  20632. * writer.removeMarker( marker );
  20633. * } );
  20634. *
  20635. * See {@link module:engine/model/writer~Writer} to find more examples.
  20636. *
  20637. * Since markers need to track change in the document, for efficiency reasons, it is best to create and keep as little
  20638. * markers as possible and remove them as soon as they are not needed anymore.
  20639. *
  20640. * Markers can be downcasted and upcasted.
  20641. *
  20642. * Markers downcast happens on {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker} and
  20643. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:removeMarker} events.
  20644. * Use {@link module:engine/conversion/downcasthelpers downcast converters} or attach a custom converter to mentioned events.
  20645. * For {@link module:engine/controller/datacontroller~DataController data pipeline}, marker should be downcasted to an element.
  20646. * Then, it can be upcasted back to a marker. Again, use {@link module:engine/conversion/upcasthelpers upcast converters} or
  20647. * attach a custom converter to {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element}.
  20648. *
  20649. * `Marker` instances are created and destroyed only by {@link ~MarkerCollection MarkerCollection}.
  20650. */
  20651. class Marker {
  20652. /**
  20653. * Creates a marker instance.
  20654. *
  20655. * @param {String} name Marker name.
  20656. * @param {module:engine/model/liverange~LiveRange} liveRange Range marked by the marker.
  20657. * @param {Boolean} managedUsingOperations Specifies whether the marker is managed using operations.
  20658. * @param {Boolean} affectsData Specifies whether the marker affects the data produced by the data pipeline
  20659. * (is persisted in the editor's data).
  20660. */
  20661. constructor( name, liveRange, managedUsingOperations, affectsData ) {
  20662. /**
  20663. * Marker's name.
  20664. *
  20665. * @readonly
  20666. * @type {String}
  20667. */
  20668. this.name = name;
  20669. /**
  20670. * Range marked by the marker.
  20671. *
  20672. * @protected
  20673. * @member {module:engine/model/liverange~LiveRange}
  20674. */
  20675. this._liveRange = this._attachLiveRange( liveRange );
  20676. /**
  20677. * Flag indicates if the marker is managed using operations or not.
  20678. *
  20679. * @private
  20680. * @member {Boolean}
  20681. */
  20682. this._managedUsingOperations = managedUsingOperations;
  20683. /**
  20684. * Specifies whether the marker affects the data produced by the data pipeline
  20685. * (is persisted in the editor's data).
  20686. *
  20687. * @private
  20688. * @member {Boolean}
  20689. */
  20690. this._affectsData = affectsData;
  20691. }
  20692. /**
  20693. * A value indicating if the marker is managed using operations.
  20694. * See {@link ~Marker marker class description} to learn more about marker types.
  20695. * See {@link module:engine/model/writer~Writer#addMarker}.
  20696. *
  20697. * @returns {Boolean}
  20698. */
  20699. get managedUsingOperations() {
  20700. if ( !this._liveRange ) {
  20701. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
  20702. }
  20703. return this._managedUsingOperations;
  20704. }
  20705. /**
  20706. * A value indicating if the marker changes the data.
  20707. *
  20708. * @returns {Boolean}
  20709. */
  20710. get affectsData() {
  20711. if ( !this._liveRange ) {
  20712. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
  20713. }
  20714. return this._affectsData;
  20715. }
  20716. /**
  20717. * Returns current marker start position.
  20718. *
  20719. * @returns {module:engine/model/position~Position}
  20720. */
  20721. getStart() {
  20722. if ( !this._liveRange ) {
  20723. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
  20724. }
  20725. return this._liveRange.start.clone();
  20726. }
  20727. /**
  20728. * Returns current marker end position.
  20729. *
  20730. * @returns {module:engine/model/position~Position}
  20731. */
  20732. getEnd() {
  20733. if ( !this._liveRange ) {
  20734. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
  20735. }
  20736. return this._liveRange.end.clone();
  20737. }
  20738. /**
  20739. * Returns a range that represents the current state of the marker.
  20740. *
  20741. * Keep in mind that returned value is a {@link module:engine/model/range~Range Range}, not a
  20742. * {@link module:engine/model/liverange~LiveRange LiveRange}. This means that it is up-to-date and relevant only
  20743. * until next model document change. Do not store values returned by this method. Instead, store {@link ~Marker#name}
  20744. * and get `Marker` instance from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection} every
  20745. * time there is a need to read marker properties. This will guarantee that the marker has not been removed and
  20746. * that it's data is up-to-date.
  20747. *
  20748. * @returns {module:engine/model/range~Range}
  20749. */
  20750. getRange() {
  20751. if ( !this._liveRange ) {
  20752. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
  20753. }
  20754. return this._liveRange.toRange();
  20755. }
  20756. /**
  20757. * Checks whether this object is of the given.
  20758. *
  20759. * marker.is( 'marker' ); // -> true
  20760. * marker.is( 'model:marker' ); // -> true
  20761. *
  20762. * marker.is( 'view:element' ); // -> false
  20763. * marker.is( 'documentSelection' ); // -> false
  20764. *
  20765. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  20766. *
  20767. * @param {String} type
  20768. * @returns {Boolean}
  20769. */
  20770. is( type ) {
  20771. return type === 'marker' || type === 'model:marker';
  20772. }
  20773. /**
  20774. * Binds new live range to the marker and detach the old one if is attached.
  20775. *
  20776. * @protected
  20777. * @param {module:engine/model/liverange~LiveRange} liveRange Live range to attach
  20778. * @returns {module:engine/model/liverange~LiveRange} Attached live range.
  20779. */
  20780. _attachLiveRange( liveRange ) {
  20781. if ( this._liveRange ) {
  20782. this._detachLiveRange();
  20783. }
  20784. // Delegating does not work with namespaces. Alternatively, we could delegate all events (using `*`).
  20785. liveRange.delegate( 'change:range' ).to( this );
  20786. liveRange.delegate( 'change:content' ).to( this );
  20787. this._liveRange = liveRange;
  20788. return liveRange;
  20789. }
  20790. /**
  20791. * Unbinds and destroys currently attached live range.
  20792. *
  20793. * @protected
  20794. */
  20795. _detachLiveRange() {
  20796. this._liveRange.stopDelegating( 'change:range', this );
  20797. this._liveRange.stopDelegating( 'change:content', this );
  20798. this._liveRange.detach();
  20799. this._liveRange = null;
  20800. }
  20801. /**
  20802. * Fired whenever {@link ~Marker#_liveRange marker range} is changed due to changes on {@link module:engine/model/document~Document}.
  20803. * This is a delegated {@link module:engine/model/liverange~LiveRange#event:change:range LiveRange change:range event}.
  20804. *
  20805. * When marker is removed from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection},
  20806. * all event listeners listening to it should be removed. It is best to do it on
  20807. * {@link module:engine/model/markercollection~MarkerCollection#event:update MarkerCollection update event}.
  20808. *
  20809. * @see module:engine/model/liverange~LiveRange#event:change:range
  20810. * @event change:range
  20811. * @param {module:engine/model/range~Range} oldRange
  20812. * @param {Object} data
  20813. */
  20814. /**
  20815. * Fired whenever change on {@link module:engine/model/document~Document} is done inside {@link ~Marker#_liveRange marker range}.
  20816. * This is a delegated {@link module:engine/model/liverange~LiveRange#event:change:content LiveRange change:content event}.
  20817. *
  20818. * When marker is removed from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection},
  20819. * all event listeners listening to it should be removed. It is best to do it on
  20820. * {@link module:engine/model/markercollection~MarkerCollection#event:update MarkerCollection update event}.
  20821. *
  20822. * @see module:engine/model/liverange~LiveRange#event:change:content
  20823. * @event change:content
  20824. * @param {module:engine/model/range~Range} oldRange
  20825. * @param {Object} data
  20826. */
  20827. }
  20828. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( Marker, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  20829. /**
  20830. * Cannot use a {@link module:engine/model/markercollection~MarkerCollection#destroy destroyed marker} instance.
  20831. *
  20832. * @error marker-destroyed
  20833. */
  20834. /***/ }),
  20835. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/model.js":
  20836. /*!********************************************************************!*\
  20837. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/model.js ***!
  20838. \********************************************************************/
  20839. /*! exports provided: default */
  20840. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20841. "use strict";
  20842. __webpack_require__.r(__webpack_exports__);
  20843. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Model; });
  20844. /* harmony import */ var _batch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./batch */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/batch.js");
  20845. /* harmony import */ var _writer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./writer */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/writer.js");
  20846. /* harmony import */ var _schema__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./schema */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js");
  20847. /* harmony import */ var _document__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./document */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/document.js");
  20848. /* harmony import */ var _markercollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./markercollection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/markercollection.js");
  20849. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  20850. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  20851. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  20852. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  20853. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  20854. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js");
  20855. /* harmony import */ var _operation_operationfactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./operation/operationfactory */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js");
  20856. /* harmony import */ var _utils_insertcontent__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/insertcontent */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertcontent.js");
  20857. /* harmony import */ var _utils_deletecontent__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils/deletecontent */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/deletecontent.js");
  20858. /* harmony import */ var _utils_modifyselection__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils/modifyselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/modifyselection.js");
  20859. /* harmony import */ var _utils_getselectedcontent__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./utils/getselectedcontent */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/getselectedcontent.js");
  20860. /* harmony import */ var _utils_selection_post_fixer__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./utils/selection-post-fixer */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/selection-post-fixer.js");
  20861. /* harmony import */ var _utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./utils/autoparagraphing */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js");
  20862. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  20863. /**
  20864. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  20865. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  20866. */
  20867. /**
  20868. * @module engine/model/model
  20869. */
  20870. // @if CK_DEBUG_ENGINE // const { dumpTrees } = require( '../dev-utils/utils' );
  20871. // @if CK_DEBUG_ENGINE // const { OperationReplayer } = require( '../dev-utils/operationreplayer' ).default;
  20872. /**
  20873. * Editor's data model. Read about the model in the
  20874. * {@glink framework/guides/architecture/editing-engine engine architecture guide}.
  20875. *
  20876. * @mixes module:utils/observablemixin~ObservableMixin
  20877. */
  20878. class Model {
  20879. constructor() {
  20880. /**
  20881. * Model's marker collection.
  20882. *
  20883. * @readonly
  20884. * @member {module:engine/model/markercollection~MarkerCollection}
  20885. */
  20886. this.markers = new _markercollection__WEBPACK_IMPORTED_MODULE_4__["default"]();
  20887. /**
  20888. * Model's document.
  20889. *
  20890. * @readonly
  20891. * @member {module:engine/model/document~Document}
  20892. */
  20893. this.document = new _document__WEBPACK_IMPORTED_MODULE_3__["default"]( this );
  20894. /**
  20895. * Model's schema.
  20896. *
  20897. * @readonly
  20898. * @member {module:engine/model/schema~Schema}
  20899. */
  20900. this.schema = new _schema__WEBPACK_IMPORTED_MODULE_2__["default"]();
  20901. /**
  20902. * All callbacks added by {@link module:engine/model/model~Model#change} or
  20903. * {@link module:engine/model/model~Model#enqueueChange} methods waiting to be executed.
  20904. *
  20905. * @private
  20906. * @type {Array.<Function>}
  20907. */
  20908. this._pendingChanges = [];
  20909. /**
  20910. * The last created and currently used writer instance.
  20911. *
  20912. * @private
  20913. * @member {module:engine/model/writer~Writer}
  20914. */
  20915. this._currentWriter = null;
  20916. [ 'insertContent', 'deleteContent', 'modifySelection', 'getSelectedContent', 'applyOperation' ]
  20917. .forEach( methodName => this.decorate( methodName ) );
  20918. // Adding operation validation with `highest` priority, so it is called before any other feature would like
  20919. // to do anything with the operation. If the operation has incorrect parameters it should throw on the earliest occasion.
  20920. this.on( 'applyOperation', ( evt, args ) => {
  20921. const operation = args[ 0 ];
  20922. operation._validate();
  20923. }, { priority: 'highest' } );
  20924. // Register some default abstract entities.
  20925. this.schema.register( '$root', {
  20926. isLimit: true
  20927. } );
  20928. this.schema.register( '$block', {
  20929. allowIn: '$root',
  20930. isBlock: true
  20931. } );
  20932. this.schema.register( '$text', {
  20933. allowIn: '$block',
  20934. isInline: true,
  20935. isContent: true
  20936. } );
  20937. this.schema.register( '$clipboardHolder', {
  20938. allowContentOf: '$root',
  20939. allowChildren: '$text',
  20940. isLimit: true
  20941. } );
  20942. this.schema.register( '$documentFragment', {
  20943. allowContentOf: '$root',
  20944. allowChildren: '$text',
  20945. isLimit: true
  20946. } );
  20947. // An element needed by the `upcastElementToMarker` converter.
  20948. // This element temporarily represents a marker boundary during the conversion process and is removed
  20949. // at the end of the conversion. `UpcastDispatcher` or at least `Conversion` class looks like a
  20950. // better place for this registration but both know nothing about `Schema`.
  20951. this.schema.register( '$marker' );
  20952. this.schema.addChildCheck( ( context, childDefinition ) => {
  20953. if ( childDefinition.name === '$marker' ) {
  20954. return true;
  20955. }
  20956. } );
  20957. Object(_utils_selection_post_fixer__WEBPACK_IMPORTED_MODULE_16__["injectSelectionPostFixer"])( this );
  20958. // Post-fixer which takes care of adding empty paragraph elements to the empty roots.
  20959. this.document.registerPostFixer( _utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_17__["autoParagraphEmptyRoots"] );
  20960. // @if CK_DEBUG_ENGINE // this.on( 'applyOperation', () => {
  20961. // @if CK_DEBUG_ENGINE // dumpTrees( this.document, this.document.version );
  20962. // @if CK_DEBUG_ENGINE // }, { priority: 'lowest' } );
  20963. }
  20964. /**
  20965. * The `change()` method is the primary way of changing the model. You should use it to modify all document nodes
  20966. * (including detached nodes – i.e. nodes not added to the {@link module:engine/model/model~Model#document model document}),
  20967. * the {@link module:engine/model/document~Document#selection document's selection}, and
  20968. * {@link module:engine/model/model~Model#markers model markers}.
  20969. *
  20970. * model.change( writer => {
  20971. * writer.insertText( 'foo', paragraph, 'end' );
  20972. * } );
  20973. *
  20974. * All changes inside the change block use the same {@link module:engine/model/batch~Batch} so they are combined
  20975. * into a single undo step.
  20976. *
  20977. * model.change( writer => {
  20978. * writer.insertText( 'foo', paragraph, 'end' ); // foo.
  20979. *
  20980. * model.change( writer => {
  20981. * writer.insertText( 'bar', paragraph, 'end' ); // foobar.
  20982. * } );
  20983. *
  20984. * writer.insertText( 'bom', paragraph, 'end' ); // foobarbom.
  20985. * } );
  20986. *
  20987. * The callback of the `change()` block is executed synchronously.
  20988. *
  20989. * You can also return a value from the change block.
  20990. *
  20991. * const img = model.change( writer => {
  20992. * return writer.createElement( 'img' );
  20993. * } );
  20994. *
  20995. * @see #enqueueChange
  20996. * @param {Function} callback Callback function which may modify the model.
  20997. * @returns {*} Value returned by the callback.
  20998. */
  20999. change( callback ) {
  21000. try {
  21001. if ( this._pendingChanges.length === 0 ) {
  21002. // If this is the outermost block, create a new batch and start `_runPendingChanges` execution flow.
  21003. this._pendingChanges.push( { batch: new _batch__WEBPACK_IMPORTED_MODULE_0__["default"](), callback } );
  21004. return this._runPendingChanges()[ 0 ];
  21005. } else {
  21006. // If this is not the outermost block, just execute the callback.
  21007. return callback( this._currentWriter );
  21008. }
  21009. } catch ( err ) {
  21010. // @if CK_DEBUG // throw err;
  21011. /* istanbul ignore next */
  21012. _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_18__["default"].rethrowUnexpectedError( err, this );
  21013. }
  21014. }
  21015. /**
  21016. * The `enqueueChange()` method performs similar task as the {@link #change `change()` method}, with two major differences.
  21017. *
  21018. * First, the callback of `enqueueChange()` is executed when all other enqueued changes are done. It might be executed
  21019. * immediately if it is not nested in any other change block, but if it is nested in another (enqueue)change block,
  21020. * it will be delayed and executed after the outermost block.
  21021. *
  21022. * model.change( writer => {
  21023. * console.log( 1 );
  21024. *
  21025. * model.enqueueChange( writer => {
  21026. * console.log( 2 );
  21027. * } );
  21028. *
  21029. * console.log( 3 );
  21030. * } ); // Will log: 1, 3, 2.
  21031. *
  21032. * In addition to that, the changes enqueued with `enqueueChange()` will be converted separately from the changes
  21033. * done in the outer `change()` block.
  21034. *
  21035. * Second, it lets you define the {@link module:engine/model/batch~Batch} into which you want to add your changes.
  21036. * By default, a new batch is created. In the sample above, `change` and `enqueueChange` blocks use a different
  21037. * batch (and different {@link module:engine/model/writer~Writer} since each of them operates on the separate batch).
  21038. *
  21039. * When using the `enqueueChange()` block you can also add some changes to the batch you used before.
  21040. *
  21041. * model.enqueueChange( batch, writer => {
  21042. * writer.insertText( 'foo', paragraph, 'end' );
  21043. * } );
  21044. *
  21045. * In order to make a nested `enqueueChange()` create a single undo step together with the changes done in the outer `change()`
  21046. * block, you can obtain the batch instance from the {@link module:engine/model/writer~Writer#batch writer} of the outer block.
  21047. *
  21048. * @param {module:engine/model/batch~Batch|'transparent'|'default'} batchOrType Batch or batch type should be used in the callback.
  21049. * If not defined, a new batch will be created.
  21050. * @param {Function} callback Callback function which may modify the model.
  21051. */
  21052. enqueueChange( batchOrType, callback ) {
  21053. try {
  21054. if ( typeof batchOrType === 'string' ) {
  21055. batchOrType = new _batch__WEBPACK_IMPORTED_MODULE_0__["default"]( batchOrType );
  21056. } else if ( typeof batchOrType == 'function' ) {
  21057. callback = batchOrType;
  21058. batchOrType = new _batch__WEBPACK_IMPORTED_MODULE_0__["default"]();
  21059. }
  21060. this._pendingChanges.push( { batch: batchOrType, callback } );
  21061. if ( this._pendingChanges.length == 1 ) {
  21062. this._runPendingChanges();
  21063. }
  21064. } catch ( err ) {
  21065. // @if CK_DEBUG // throw err;
  21066. /* istanbul ignore next */
  21067. _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_18__["default"].rethrowUnexpectedError( err, this );
  21068. }
  21069. }
  21070. /**
  21071. * {@link module:utils/observablemixin~ObservableMixin#decorate Decorated} function for applying
  21072. * {@link module:engine/model/operation/operation~Operation operations} to the model.
  21073. *
  21074. * This is a low-level way of changing the model. It is exposed for very specific use cases (like the undo feature).
  21075. * Normally, to modify the model, you will want to use {@link module:engine/model/writer~Writer `Writer`}.
  21076. * See also {@glink framework/guides/architecture/editing-engine#changing-the-model Changing the model} section
  21077. * of the {@glink framework/guides/architecture/editing-engine Editing architecture} guide.
  21078. *
  21079. * @param {module:engine/model/operation/operation~Operation} operation The operation to apply.
  21080. */
  21081. applyOperation( operation ) {
  21082. // @if CK_DEBUG_ENGINE // console.log( 'Applying ' + operation );
  21083. // @if CK_DEBUG_ENGINE // if ( !this._operationLogs ) {
  21084. // @if CK_DEBUG_ENGINE // this._operationLogs = [];
  21085. // @if CK_DEBUG_ENGINE // }
  21086. // @if CK_DEBUG_ENGINE // this._operationLogs.push( JSON.stringify( operation ) );
  21087. // @if CK_DEBUG_ENGINE //if ( !this._appliedOperations ) {
  21088. // @if CK_DEBUG_ENGINE // this._appliedOperations = [];
  21089. // @if CK_DEBUG_ENGINE //}
  21090. // @if CK_DEBUG_ENGINE //this._appliedOperations.push( operation );
  21091. operation._execute();
  21092. }
  21093. // @if CK_DEBUG_ENGINE // getAppliedOperation() {
  21094. // @if CK_DEBUG_ENGINE // if ( !this._appliedOperations ) {
  21095. // @if CK_DEBUG_ENGINE // return '';
  21096. // @if CK_DEBUG_ENGINE // }
  21097. // @if CK_DEBUG_ENGINE // return this._appliedOperations.map( JSON.stringify ).join( '-------' );
  21098. // @if CK_DEBUG_ENGINE // }
  21099. // @if CK_DEBUG_ENGINE // createReplayer( stringifiedOperations ) {
  21100. // @if CK_DEBUG_ENGINE // return new OperationReplayer( this, '-------', stringifiedOperations );
  21101. // @if CK_DEBUG_ENGINE // }
  21102. /**
  21103. * Inserts content at the position in the editor specified by the selection, as one would expect the paste
  21104. * functionality to work.
  21105. *
  21106. * This is a high-level method. It takes the {@link #schema schema} into consideration when inserting
  21107. * the content, clears the given selection's content before inserting nodes and moves the selection
  21108. * to its target position at the end of the process.
  21109. * It can split elements, merge them, wrap bare text nodes with paragraphs, etc. &mdash; just like the
  21110. * pasting feature should do.
  21111. *
  21112. * For lower-level methods see {@link module:engine/model/writer~Writer `Writer`}.
  21113. *
  21114. * This method, unlike {@link module:engine/model/writer~Writer `Writer`}'s methods, does not have to be used
  21115. * inside a {@link #change `change()` block}.
  21116. *
  21117. * # Conversion and schema
  21118. *
  21119. * Inserting elements and text nodes into the model is not enough to make CKEditor 5 render that content
  21120. * to the user. CKEditor 5 implements a model-view-controller architecture and what `model.insertContent()` does
  21121. * is only adding nodes to the model. Additionally, you need to define
  21122. * {@glink framework/guides/architecture/editing-engine#conversion converters} between the model and view
  21123. * and define those nodes in the {@glink framework/guides/architecture/editing-engine#schema schema}.
  21124. *
  21125. * So, while this method may seem similar to CKEditor 4 `editor.insertHtml()` (in fact, both methods
  21126. * are used for paste-like content insertion), the CKEditor 5 method cannot be use to insert arbitrary HTML
  21127. * unless converters are defined for all elements and attributes in that HTML.
  21128. *
  21129. * # Examples
  21130. *
  21131. * Using `insertContent()` with a manually created model structure:
  21132. *
  21133. * // Let's create a document fragment containing such content as:
  21134. * //
  21135. * // <paragraph>foo</paragraph>
  21136. * // <blockQuote>
  21137. * // <paragraph>bar</paragraph>
  21138. * // </blockQuote>
  21139. * const docFrag = editor.model.change( writer => {
  21140. * const p1 = writer.createElement( 'paragraph' );
  21141. * const p2 = writer.createElement( 'paragraph' );
  21142. * const blockQuote = writer.createElement( 'blockQuote' );
  21143. * const docFrag = writer.createDocumentFragment();
  21144. *
  21145. * writer.append( p1, docFrag );
  21146. * writer.append( blockQuote, docFrag );
  21147. * writer.append( p2, blockQuote );
  21148. * writer.insertText( 'foo', p1 );
  21149. * writer.insertText( 'bar', p2 );
  21150. *
  21151. * return docFrag;
  21152. * } );
  21153. *
  21154. * // insertContent() does not have to be used in a change() block. It can, though,
  21155. * // so this code could be moved to the callback defined above.
  21156. * editor.model.insertContent( docFrag );
  21157. *
  21158. * Using `insertContent()` with an HTML string converted to a model document fragment (similar to the pasting mechanism):
  21159. *
  21160. * // You can create your own HtmlDataProcessor instance or use editor.data.processor
  21161. * // if you have not overridden the default one (which is the HtmlDataProcessor instance).
  21162. * const htmlDP = new HtmlDataProcessor( viewDocument );
  21163. *
  21164. * // Convert an HTML string to a view document fragment:
  21165. * const viewFragment = htmlDP.toView( htmlString );
  21166. *
  21167. * // Convert the view document fragment to a model document fragment
  21168. * // in the context of $root. This conversion takes the schema into
  21169. * // account so if, for example, the view document fragment contained a bare text node,
  21170. * // this text node cannot be a child of $root, so it will be automatically
  21171. * // wrapped with a <paragraph>. You can define the context yourself (in the second parameter),
  21172. * // and e.g. convert the content like it would happen in a <paragraph>.
  21173. * // Note: The clipboard feature uses a custom context called $clipboardHolder
  21174. * // which has a loosened schema.
  21175. * const modelFragment = editor.data.toModel( viewFragment );
  21176. *
  21177. * editor.model.insertContent( modelFragment );
  21178. *
  21179. * By default this method will use the document selection but it can also be used with a position, range or selection instance.
  21180. *
  21181. * // Insert text at the current document selection position.
  21182. * editor.model.change( writer => {
  21183. * editor.model.insertContent( writer.createText( 'x' ) );
  21184. * } );
  21185. *
  21186. * // Insert text at a given position - the document selection will not be modified.
  21187. * editor.model.change( writer => {
  21188. * editor.model.insertContent( writer.createText( 'x' ), doc.getRoot(), 2 );
  21189. *
  21190. * // Which is a shorthand for:
  21191. * editor.model.insertContent( writer.createText( 'x' ), writer.createPositionAt( doc.getRoot(), 2 ) );
  21192. * } );
  21193. *
  21194. * If you want the document selection to be moved to the inserted content, use the
  21195. * {@link module:engine/model/writer~Writer#setSelection `setSelection()`} method of the writer after inserting
  21196. * the content:
  21197. *
  21198. * editor.model.change( writer => {
  21199. * const paragraph = writer.createElement( 'paragraph' );
  21200. *
  21201. * // Insert an empty paragraph at the beginning of the root.
  21202. * editor.model.insertContent( paragraph, writer.createPositionAt( editor.model.document.getRoot(), 0 ) );
  21203. *
  21204. * // Move the document selection to the inserted paragraph.
  21205. * writer.setSelection( paragraph, 'in' );
  21206. * } );
  21207. *
  21208. * If an instance of the {@link module:engine/model/selection~Selection model selection} is passed as `selectable`,
  21209. * the new content will be inserted at the passed selection (instead of document selection):
  21210. *
  21211. * editor.model.change( writer => {
  21212. * // Create a selection in a paragraph that will be used as a place of insertion.
  21213. * const selection = writer.createSelection( paragraph, 'in' );
  21214. *
  21215. * // Insert the new text at the created selection.
  21216. * editor.model.insertContent( writer.createText( 'x' ), selection );
  21217. *
  21218. * // insertContent() modifies the passed selection instance so it can be used to set the document selection.
  21219. * // Note: This is not necessary when you passed the document selection to insertContent().
  21220. * writer.setSelection( selection );
  21221. * } );
  21222. *
  21223. * @fires insertContent
  21224. * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
  21225. * @param {module:engine/model/selection~Selectable} [selectable=model.document.selection]
  21226. * The selection into which the content should be inserted. If not provided the current model document selection will be used.
  21227. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] To be used when a model item was passed as `selectable`.
  21228. * This param defines a position in relation to that item.
  21229. * @returns {module:engine/model/range~Range} Range which contains all the performed changes. This is a range that, if removed,
  21230. * would return the model to the state before the insertion. If no changes were preformed by `insertContent`, returns a range collapsed
  21231. * at the insertion position.
  21232. */
  21233. insertContent( content, selectable, placeOrOffset ) {
  21234. return Object(_utils_insertcontent__WEBPACK_IMPORTED_MODULE_12__["default"])( this, content, selectable, placeOrOffset );
  21235. }
  21236. /**
  21237. * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.
  21238. *
  21239. * **Note:** For the sake of predictability, the resulting selection should always be collapsed.
  21240. * In cases where a feature wants to modify deleting behavior so selection isn't collapsed
  21241. * (e.g. a table feature may want to keep row selection after pressing <kbd>Backspace</kbd>),
  21242. * then that behavior should be implemented in the view's listener. At the same time, the table feature
  21243. * will need to modify this method's behavior too, e.g. to "delete contents and then collapse
  21244. * the selection inside the last selected cell" or "delete the row and collapse selection somewhere near".
  21245. * That needs to be done in order to ensure that other features which use `deleteContent()` will work well with tables.
  21246. *
  21247. * @fires deleteContent
  21248. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  21249. * Selection of which the content should be deleted.
  21250. * @param {Object} [options]
  21251. * @param {Boolean} [options.leaveUnmerged=false] Whether to merge elements after removing the content of the selection.
  21252. *
  21253. * For example `<heading1>x[x</heading1><paragraph>y]y</paragraph>` will become:
  21254. *
  21255. * * `<heading1>x^y</heading1>` with the option disabled (`leaveUnmerged == false`)
  21256. * * `<heading1>x^</heading1><paragraph>y</paragraph>` with enabled (`leaveUnmerged == true`).
  21257. *
  21258. * Note: {@link module:engine/model/schema~Schema#isObject object} and {@link module:engine/model/schema~Schema#isLimit limit}
  21259. * elements will not be merged.
  21260. *
  21261. * @param {Boolean} [options.doNotResetEntireContent=false] Whether to skip replacing the entire content with a
  21262. * paragraph when the entire content was selected.
  21263. *
  21264. * For example `<heading1>[x</heading1><paragraph>y]</paragraph>` will become:
  21265. *
  21266. * * `<paragraph>^</paragraph>` with the option disabled (`doNotResetEntireContent == false`)
  21267. * * `<heading1>^</heading1>` with enabled (`doNotResetEntireContent == true`)
  21268. *
  21269. * @param {Boolean} [options.doNotAutoparagraph=false] Whether to create a paragraph if after content deletion selection is moved
  21270. * to a place where text cannot be inserted.
  21271. *
  21272. * For example `<paragraph>x</paragraph>[<imageBlock src="foo.jpg"></imageBlock>]` will become:
  21273. *
  21274. * * `<paragraph>x</paragraph><paragraph>[]</paragraph>` with the option disabled (`doNotAutoparagraph == false`)
  21275. * * `<paragraph>x[]</paragraph>` with the option enabled (`doNotAutoparagraph == true`).
  21276. *
  21277. * **Note:** if there is no valid position for the selection, the paragraph will always be created:
  21278. *
  21279. * `[<imageBlock src="foo.jpg"></imageBlock>]` -> `<paragraph>[]</paragraph>`.
  21280. *
  21281. * @param {'forward'|'backward'} [options.direction='backward'] The direction in which the content is being consumed.
  21282. * Deleting backward corresponds to using the <kbd>Backspace</kbd> key, while deleting content forward corresponds to
  21283. * the <kbd>Shift</kbd>+<kbd>Backspace</kbd> keystroke.
  21284. */
  21285. deleteContent( selection, options ) {
  21286. Object(_utils_deletecontent__WEBPACK_IMPORTED_MODULE_13__["default"])( this, selection, options );
  21287. }
  21288. /**
  21289. * Modifies the selection. Currently, the supported modifications are:
  21290. *
  21291. * * Extending. The selection focus is moved in the specified `options.direction` with a step specified in `options.unit`.
  21292. * Possible values for `unit` are:
  21293. * * `'character'` (default) - moves selection by one user-perceived character. In most cases this means moving by one
  21294. * character in `String` sense. However, unicode also defines "combing marks". These are special symbols, that combines
  21295. * with a symbol before it ("base character") to create one user-perceived character. For example, `q̣̇` is a normal
  21296. * letter `q` with two "combining marks": upper dot (`Ux0307`) and lower dot (`Ux0323`). For most actions, i.e. extending
  21297. * selection by one position, it is correct to include both "base character" and all of it's "combining marks". That is
  21298. * why `'character'` value is most natural and common method of modifying selection.
  21299. * * `'codePoint'` - moves selection by one unicode code point. In contrary to, `'character'` unit, this will insert
  21300. * selection between "base character" and "combining mark", because "combining marks" have their own unicode code points.
  21301. * However, for technical reasons, unicode code points with values above `UxFFFF` are represented in native `String` by
  21302. * two characters, called "surrogate pairs". Halves of "surrogate pairs" have a meaning only when placed next to each other.
  21303. * For example `𨭎` is represented in `String` by `\uD862\uDF4E`. Both `\uD862` and `\uDF4E` do not have any meaning
  21304. * outside the pair (are rendered as ? when alone). Position between them would be incorrect. In this case, selection
  21305. * extension will include whole "surrogate pair".
  21306. * * `'word'` - moves selection by a whole word.
  21307. *
  21308. * **Note:** if you extend a forward selection in a backward direction you will in fact shrink it.
  21309. *
  21310. * @fires modifySelection
  21311. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  21312. * The selection to modify.
  21313. * @param {Object} [options]
  21314. * @param {'forward'|'backward'} [options.direction='forward'] The direction in which the selection should be modified.
  21315. * @param {'character'|'codePoint'|'word'} [options.unit='character'] The unit by which selection should be modified.
  21316. */
  21317. modifySelection( selection, options ) {
  21318. Object(_utils_modifyselection__WEBPACK_IMPORTED_MODULE_14__["default"])( this, selection, options );
  21319. }
  21320. /**
  21321. * Gets a clone of the selected content.
  21322. *
  21323. * For example, for the following selection:
  21324. *
  21325. * ```html
  21326. * <paragraph>x</paragraph>
  21327. * <blockQuote>
  21328. * <paragraph>y</paragraph>
  21329. * <heading1>fir[st</heading1>
  21330. * </blockQuote>
  21331. * <paragraph>se]cond</paragraph>
  21332. * <paragraph>z</paragraph>
  21333. * ```
  21334. *
  21335. * It will return a document fragment with such a content:
  21336. *
  21337. * ```html
  21338. * <blockQuote>
  21339. * <heading1>st</heading1>
  21340. * </blockQuote>
  21341. * <paragraph>se</paragraph>
  21342. * ```
  21343. *
  21344. * @fires getSelectedContent
  21345. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  21346. * The selection of which content will be returned.
  21347. * @returns {module:engine/model/documentfragment~DocumentFragment}
  21348. */
  21349. getSelectedContent( selection ) {
  21350. return Object(_utils_getselectedcontent__WEBPACK_IMPORTED_MODULE_15__["default"])( this, selection );
  21351. }
  21352. /**
  21353. * Checks whether the given {@link module:engine/model/range~Range range} or
  21354. * {@link module:engine/model/element~Element element} has any meaningful content.
  21355. *
  21356. * Meaningful content is:
  21357. *
  21358. * * any text node (`options.ignoreWhitespaces` allows controlling whether this text node must also contain
  21359. * any non-whitespace characters),
  21360. * * or any {@link module:engine/model/schema~Schema#isContent content element},
  21361. * * or any {@link module:engine/model/markercollection~Marker marker} which
  21362. * {@link module:engine/model/markercollection~Marker#_affectsData affects data}.
  21363. *
  21364. * This means that a range containing an empty `<paragraph></paragraph>` is not considered to have a meaningful content.
  21365. * However, a range containing an `<imageBlock></imageBlock>` (which would normally be marked in the schema as an object element)
  21366. * is considered non-empty.
  21367. *
  21368. * @param {module:engine/model/range~Range|module:engine/model/element~Element} rangeOrElement Range or element to check.
  21369. * @param {Object} [options]
  21370. * @param {Boolean} [options.ignoreWhitespaces] Whether text node with whitespaces only should be considered empty.
  21371. * @param {Boolean} [options.ignoreMarkers] Whether markers should be ignored.
  21372. * @returns {Boolean}
  21373. */
  21374. hasContent( rangeOrElement, options = {} ) {
  21375. const range = rangeOrElement instanceof _element__WEBPACK_IMPORTED_MODULE_7__["default"] ? _range__WEBPACK_IMPORTED_MODULE_8__["default"]._createIn( rangeOrElement ) : rangeOrElement;
  21376. if ( range.isCollapsed ) {
  21377. return false;
  21378. }
  21379. const { ignoreWhitespaces = false, ignoreMarkers = false } = options;
  21380. // Check if there are any markers which affects data in this given range.
  21381. if ( !ignoreMarkers ) {
  21382. for ( const intersectingMarker of this.markers.getMarkersIntersectingRange( range ) ) {
  21383. if ( intersectingMarker.affectsData ) {
  21384. return true;
  21385. }
  21386. }
  21387. }
  21388. for ( const item of range.getItems() ) {
  21389. if ( this.schema.isContent( item ) ) {
  21390. if ( item.is( '$textProxy' ) ) {
  21391. if ( !ignoreWhitespaces ) {
  21392. return true;
  21393. } else if ( item.data.search( /\S/ ) !== -1 ) {
  21394. return true;
  21395. }
  21396. } else {
  21397. return true;
  21398. }
  21399. }
  21400. }
  21401. return false;
  21402. }
  21403. /**
  21404. * Creates a position from the given root and path in that root.
  21405. *
  21406. * Note: This method is also available as
  21407. * {@link module:engine/model/writer~Writer#createPositionFromPath `Writer#createPositionFromPath()`}.
  21408. *
  21409. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} root Root of the position.
  21410. * @param {Array.<Number>} path Position path. See {@link module:engine/model/position~Position#path}.
  21411. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
  21412. * See {@link module:engine/model/position~PositionStickiness}.
  21413. * @returns {module:engine/model/position~Position}
  21414. */
  21415. createPositionFromPath( root, path, stickiness ) {
  21416. return new _position__WEBPACK_IMPORTED_MODULE_9__["default"]( root, path, stickiness );
  21417. }
  21418. /**
  21419. * Creates position at the given location. The location can be specified as:
  21420. *
  21421. * * a {@link module:engine/model/position~Position position},
  21422. * * a parent element and offset in that element,
  21423. * * a parent element and `'end'` (the position will be set at the end of that element),
  21424. * * a {@link module:engine/model/item~Item model item} and `'before'` or `'after'`
  21425. * (the position will be set before or after the given model item).
  21426. *
  21427. * This method is a shortcut to other factory methods such as:
  21428. *
  21429. * * {@link module:engine/model/model~Model#createPositionBefore `createPositionBefore()`},
  21430. * * {@link module:engine/model/model~Model#createPositionAfter `createPositionAfter()`}.
  21431. *
  21432. * Note: This method is also available as
  21433. * {@link module:engine/model/writer~Writer#createPositionAt `Writer#createPositionAt()`},
  21434. *
  21435. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  21436. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  21437. * first parameter is a {@link module:engine/model/item~Item model item}.
  21438. */
  21439. createPositionAt( itemOrPosition, offset ) {
  21440. return _position__WEBPACK_IMPORTED_MODULE_9__["default"]._createAt( itemOrPosition, offset );
  21441. }
  21442. /**
  21443. * Creates a new position after the given {@link module:engine/model/item~Item model item}.
  21444. *
  21445. * Note: This method is also available as
  21446. * {@link module:engine/model/writer~Writer#createPositionAfter `Writer#createPositionAfter()`}.
  21447. *
  21448. * @param {module:engine/model/item~Item} item Item after which the position should be placed.
  21449. * @returns {module:engine/model/position~Position}
  21450. */
  21451. createPositionAfter( item ) {
  21452. return _position__WEBPACK_IMPORTED_MODULE_9__["default"]._createAfter( item );
  21453. }
  21454. /**
  21455. * Creates a new position before the given {@link module:engine/model/item~Item model item}.
  21456. *
  21457. * Note: This method is also available as
  21458. * {@link module:engine/model/writer~Writer#createPositionBefore `Writer#createPositionBefore()`}.
  21459. *
  21460. * @param {module:engine/model/item~Item} item Item before which the position should be placed.
  21461. * @returns {module:engine/model/position~Position}
  21462. */
  21463. createPositionBefore( item ) {
  21464. return _position__WEBPACK_IMPORTED_MODULE_9__["default"]._createBefore( item );
  21465. }
  21466. /**
  21467. * Creates a range spanning from the `start` position to the `end` position.
  21468. *
  21469. * Note: This method is also available as
  21470. * {@link module:engine/model/writer~Writer#createRange `Writer#createRange()`}:
  21471. *
  21472. * model.change( writer => {
  21473. * const range = writer.createRange( start, end );
  21474. * } );
  21475. *
  21476. * @param {module:engine/model/position~Position} start Start position.
  21477. * @param {module:engine/model/position~Position} [end] End position. If not set, the range will be collapsed
  21478. * to the `start` position.
  21479. * @returns {module:engine/model/range~Range}
  21480. */
  21481. createRange( start, end ) {
  21482. return new _range__WEBPACK_IMPORTED_MODULE_8__["default"]( start, end );
  21483. }
  21484. /**
  21485. * Creates a range inside the given element which starts before the first child of
  21486. * that element and ends after the last child of that element.
  21487. *
  21488. * Note: This method is also available as
  21489. * {@link module:engine/model/writer~Writer#createRangeIn `Writer#createRangeIn()`}:
  21490. *
  21491. * model.change( writer => {
  21492. * const range = writer.createRangeIn( paragraph );
  21493. * } );
  21494. *
  21495. * @param {module:engine/model/element~Element} element Element which is a parent for the range.
  21496. * @returns {module:engine/model/range~Range}
  21497. */
  21498. createRangeIn( element ) {
  21499. return _range__WEBPACK_IMPORTED_MODULE_8__["default"]._createIn( element );
  21500. }
  21501. /**
  21502. * Creates a range that starts before the given {@link module:engine/model/item~Item model item} and ends after it.
  21503. *
  21504. * Note: This method is also available on `writer` instance as
  21505. * {@link module:engine/model/writer~Writer#createRangeOn `Writer.createRangeOn()`}:
  21506. *
  21507. * model.change( writer => {
  21508. * const range = writer.createRangeOn( paragraph );
  21509. * } );
  21510. *
  21511. * @param {module:engine/model/item~Item} item
  21512. * @returns {module:engine/model/range~Range}
  21513. */
  21514. createRangeOn( item ) {
  21515. return _range__WEBPACK_IMPORTED_MODULE_8__["default"]._createOn( item );
  21516. }
  21517. /**
  21518. * Creates a new selection instance based on the given {@link module:engine/model/selection~Selectable selectable}
  21519. * or creates an empty selection if no arguments were passed.
  21520. *
  21521. * Note: This method is also available as
  21522. * {@link module:engine/model/writer~Writer#createSelection `Writer#createSelection()`}.
  21523. *
  21524. * // Creates empty selection without ranges.
  21525. * const selection = writer.createSelection();
  21526. *
  21527. * // Creates selection at the given range.
  21528. * const range = writer.createRange( start, end );
  21529. * const selection = writer.createSelection( range );
  21530. *
  21531. * // Creates selection at the given ranges
  21532. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  21533. * const selection = writer.createSelection( ranges );
  21534. *
  21535. * // Creates selection from the other selection.
  21536. * // Note: It doesn't copies selection attributes.
  21537. * const otherSelection = writer.createSelection();
  21538. * const selection = writer.createSelection( otherSelection );
  21539. *
  21540. * // Creates selection from the given document selection.
  21541. * // Note: It doesn't copies selection attributes.
  21542. * const documentSelection = model.document.selection;
  21543. * const selection = writer.createSelection( documentSelection );
  21544. *
  21545. * // Creates selection at the given position.
  21546. * const position = writer.createPositionFromPath( root, path );
  21547. * const selection = writer.createSelection( position );
  21548. *
  21549. * // Creates selection at the given offset in the given element.
  21550. * const paragraph = writer.createElement( 'paragraph' );
  21551. * const selection = writer.createSelection( paragraph, offset );
  21552. *
  21553. * // Creates a range inside an {@link module:engine/model/element~Element element} which starts before the
  21554. * // first child of that element and ends after the last child of that element.
  21555. * const selection = writer.createSelection( paragraph, 'in' );
  21556. *
  21557. * // Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends
  21558. * // just after the item.
  21559. * const selection = writer.createSelection( paragraph, 'on' );
  21560. *
  21561. * // Additional options (`'backward'`) can be specified as the last argument.
  21562. *
  21563. * // Creates backward selection.
  21564. * const selection = writer.createSelection( range, { backward: true } );
  21565. *
  21566. * @param {module:engine/model/selection~Selectable} selectable
  21567. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  21568. * @param {Object} [options]
  21569. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  21570. * @returns {module:engine/model/selection~Selection}
  21571. */
  21572. createSelection( selectable, placeOrOffset, options ) {
  21573. return new _selection__WEBPACK_IMPORTED_MODULE_10__["default"]( selectable, placeOrOffset, options );
  21574. }
  21575. /**
  21576. * Creates a {@link module:engine/model/batch~Batch} instance.
  21577. *
  21578. * **Note:** In most cases creating a batch instance is not necessary as they are created when using:
  21579. *
  21580. * * {@link #change `change()`},
  21581. * * {@link #enqueueChange `enqueueChange()`}.
  21582. *
  21583. * @param {'transparent'|'default'} [type='default'] The type of the batch.
  21584. * @returns {module:engine/model/batch~Batch}
  21585. */
  21586. createBatch( type ) {
  21587. return new _batch__WEBPACK_IMPORTED_MODULE_0__["default"]( type );
  21588. }
  21589. /**
  21590. * Creates an operation instance from a JSON object (parsed JSON string).
  21591. *
  21592. * This is an alias for {@link module:engine/model/operation/operationfactory~OperationFactory.fromJSON `OperationFactory.fromJSON()`}.
  21593. *
  21594. * @param {Object} json Deserialized JSON object.
  21595. * @returns {module:engine/model/operation/operation~Operation}
  21596. */
  21597. createOperationFromJSON( json ) {
  21598. return _operation_operationfactory__WEBPACK_IMPORTED_MODULE_11__["default"].fromJSON( json, this.document );
  21599. }
  21600. /**
  21601. * Removes all events listeners set by model instance and destroys {@link module:engine/model/document~Document}.
  21602. */
  21603. destroy() {
  21604. this.document.destroy();
  21605. this.stopListening();
  21606. }
  21607. /**
  21608. * Common part of {@link module:engine/model/model~Model#change} and {@link module:engine/model/model~Model#enqueueChange}
  21609. * which calls callbacks and returns array of values returned by these callbacks.
  21610. *
  21611. * @private
  21612. * @returns {Array.<*>} Array of values returned by callbacks.
  21613. */
  21614. _runPendingChanges() {
  21615. const ret = [];
  21616. this.fire( '_beforeChanges' );
  21617. while ( this._pendingChanges.length ) {
  21618. // Create a new writer using batch instance created for this chain of changes.
  21619. const currentBatch = this._pendingChanges[ 0 ].batch;
  21620. this._currentWriter = new _writer__WEBPACK_IMPORTED_MODULE_1__["default"]( this, currentBatch );
  21621. // Execute changes callback and gather the returned value.
  21622. const callbackReturnValue = this._pendingChanges[ 0 ].callback( this._currentWriter );
  21623. ret.push( callbackReturnValue );
  21624. this.document._handleChangeBlock( this._currentWriter );
  21625. this._pendingChanges.shift();
  21626. this._currentWriter = null;
  21627. }
  21628. this.fire( '_afterChanges' );
  21629. return ret;
  21630. }
  21631. /**
  21632. * Fired when entering the outermost {@link module:engine/model/model~Model#enqueueChange} or
  21633. * {@link module:engine/model/model~Model#change} block.
  21634. *
  21635. * @protected
  21636. * @event _beforeChanges
  21637. */
  21638. /**
  21639. * Fired when leaving the outermost {@link module:engine/model/model~Model#enqueueChange} or
  21640. * {@link module:engine/model/model~Model#change} block.
  21641. *
  21642. * @protected
  21643. * @event _afterChanges
  21644. */
  21645. /**
  21646. * Fired every time any {@link module:engine/model/operation/operation~Operation operation} is applied on the model
  21647. * using {@link #applyOperation}.
  21648. *
  21649. * Note that this event is suitable only for very specific use-cases. Use it if you need to listen to every single operation
  21650. * applied on the document. However, in most cases {@link module:engine/model/document~Document#event:change} should
  21651. * be used.
  21652. *
  21653. * A few callbacks are already added to this event by engine internal classes:
  21654. *
  21655. * * with `highest` priority operation is validated,
  21656. * * with `normal` priority operation is executed,
  21657. * * with `low` priority the {@link module:engine/model/document~Document} updates its version,
  21658. * * with `low` priority {@link module:engine/model/liveposition~LivePosition} and {@link module:engine/model/liverange~LiveRange}
  21659. * update themselves.
  21660. *
  21661. * @event applyOperation
  21662. * @param {Array} args Arguments of the `applyOperation` which is an array with a single element - applied
  21663. * {@link module:engine/model/operation/operation~Operation operation}.
  21664. */
  21665. /**
  21666. * Event fired when {@link #insertContent} method is called.
  21667. *
  21668. * The {@link #insertContent default action of that method} is implemented as a
  21669. * listener to this event so it can be fully customized by the features.
  21670. *
  21671. * **Note** The `selectable` parameter for the {@link #insertContent} is optional. When `undefined` value is passed the method uses
  21672. * `model.document.selection`.
  21673. *
  21674. * @event insertContent
  21675. * @param {Array} args The arguments passed to the original method.
  21676. */
  21677. /**
  21678. * Event fired when {@link #deleteContent} method is called.
  21679. *
  21680. * The {@link #deleteContent default action of that method} is implemented as a
  21681. * listener to this event so it can be fully customized by the features.
  21682. *
  21683. * @event deleteContent
  21684. * @param {Array} args The arguments passed to the original method.
  21685. */
  21686. /**
  21687. * Event fired when {@link #modifySelection} method is called.
  21688. *
  21689. * The {@link #modifySelection default action of that method} is implemented as a
  21690. * listener to this event so it can be fully customized by the features.
  21691. *
  21692. * @event modifySelection
  21693. * @param {Array} args The arguments passed to the original method.
  21694. */
  21695. /**
  21696. * Event fired when {@link #getSelectedContent} method is called.
  21697. *
  21698. * The {@link #getSelectedContent default action of that method} is implemented as a
  21699. * listener to this event so it can be fully customized by the features.
  21700. *
  21701. * @event getSelectedContent
  21702. * @param {Array} args The arguments passed to the original method.
  21703. */
  21704. }
  21705. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( Model, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_5__["default"] );
  21706. /***/ }),
  21707. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js":
  21708. /*!*******************************************************************!*\
  21709. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js ***!
  21710. \*******************************************************************/
  21711. /*! exports provided: default */
  21712. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21713. "use strict";
  21714. __webpack_require__.r(__webpack_exports__);
  21715. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Node; });
  21716. /* harmony import */ var _ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
  21717. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  21718. /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
  21719. /* harmony import */ var _ckeditor_ckeditor5_utils_src_version__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
  21720. /**
  21721. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  21722. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  21723. */
  21724. /**
  21725. * @module engine/model/node
  21726. */
  21727. // To check if component is loaded more than once.
  21728. /**
  21729. * Model node. Most basic structure of model tree.
  21730. *
  21731. * This is an abstract class that is a base for other classes representing different nodes in model.
  21732. *
  21733. * **Note:** If a node is detached from the model tree, you can manipulate it using it's API.
  21734. * However, it is **very important** that nodes already attached to model tree should be only changed through
  21735. * {@link module:engine/model/writer~Writer Writer API}.
  21736. *
  21737. * Changes done by `Node` methods, like {@link module:engine/model/element~Element#_insertChild _insertChild} or
  21738. * {@link module:engine/model/node~Node#_setAttribute _setAttribute}
  21739. * do not generate {@link module:engine/model/operation/operation~Operation operations}
  21740. * which are essential for correct editor work if you modify nodes in {@link module:engine/model/document~Document document} root.
  21741. *
  21742. * The flow of working on `Node` (and classes that inherits from it) is as such:
  21743. * 1. You can create a `Node` instance, modify it using it's API.
  21744. * 2. Add `Node` to the model using `Batch` API.
  21745. * 3. Change `Node` that was already added to the model using `Batch` API.
  21746. *
  21747. * Similarly, you cannot use `Batch` API on a node that has not been added to the model tree, with the exception
  21748. * of {@link module:engine/model/writer~Writer#insert inserting} that node to the model tree.
  21749. *
  21750. * Be aware that using {@link module:engine/model/writer~Writer#remove remove from Batch API} does not allow to use `Node` API because
  21751. * the information about `Node` is still kept in model document.
  21752. *
  21753. * In case of {@link module:engine/model/element~Element element node}, adding and removing children also counts as changing a node and
  21754. * follows same rules.
  21755. */
  21756. class Node {
  21757. /**
  21758. * Creates a model node.
  21759. *
  21760. * This is an abstract class, so this constructor should not be used directly.
  21761. *
  21762. * @abstract
  21763. * @param {Object} [attrs] Node's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.
  21764. */
  21765. constructor( attrs ) {
  21766. /**
  21767. * Parent of this node. It could be {@link module:engine/model/element~Element}
  21768. * or {@link module:engine/model/documentfragment~DocumentFragment}.
  21769. * Equals to `null` if the node has no parent.
  21770. *
  21771. * @readonly
  21772. * @member {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
  21773. */
  21774. this.parent = null;
  21775. /**
  21776. * Attributes set on this node.
  21777. *
  21778. * @private
  21779. * @member {Map} module:engine/model/node~Node#_attrs
  21780. */
  21781. this._attrs = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_0__["default"])( attrs );
  21782. }
  21783. /**
  21784. * Index of this node in it's parent or `null` if the node has no parent.
  21785. *
  21786. * Accessing this property throws an error if this node's parent element does not contain it.
  21787. * This means that model tree got broken.
  21788. *
  21789. * @readonly
  21790. * @type {Number|null}
  21791. */
  21792. get index() {
  21793. let pos;
  21794. if ( !this.parent ) {
  21795. return null;
  21796. }
  21797. if ( ( pos = this.parent.getChildIndex( this ) ) === null ) {
  21798. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-node-not-found-in-parent', this );
  21799. }
  21800. return pos;
  21801. }
  21802. /**
  21803. * Offset at which this node starts in it's parent. It is equal to the sum of {@link #offsetSize offsetSize}
  21804. * of all it's previous siblings. Equals to `null` if node has no parent.
  21805. *
  21806. * Accessing this property throws an error if this node's parent element does not contain it.
  21807. * This means that model tree got broken.
  21808. *
  21809. * @readonly
  21810. * @type {Number|null}
  21811. */
  21812. get startOffset() {
  21813. let pos;
  21814. if ( !this.parent ) {
  21815. return null;
  21816. }
  21817. if ( ( pos = this.parent.getChildStartOffset( this ) ) === null ) {
  21818. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-node-not-found-in-parent', this );
  21819. }
  21820. return pos;
  21821. }
  21822. /**
  21823. * Offset size of this node. Represents how much "offset space" is occupied by the node in it's parent.
  21824. * It is important for {@link module:engine/model/position~Position position}. When node has `offsetSize` greater than `1`, position
  21825. * can be placed between that node start and end. `offsetSize` greater than `1` is for nodes that represents more
  21826. * than one entity, i.e. {@link module:engine/model/text~Text text node}.
  21827. *
  21828. * @readonly
  21829. * @type {Number}
  21830. */
  21831. get offsetSize() {
  21832. return 1;
  21833. }
  21834. /**
  21835. * Offset at which this node ends in it's parent. It is equal to the sum of this node's
  21836. * {@link module:engine/model/node~Node#startOffset start offset} and {@link #offsetSize offset size}.
  21837. * Equals to `null` if the node has no parent.
  21838. *
  21839. * @readonly
  21840. * @type {Number|null}
  21841. */
  21842. get endOffset() {
  21843. if ( !this.parent ) {
  21844. return null;
  21845. }
  21846. return this.startOffset + this.offsetSize;
  21847. }
  21848. /**
  21849. * Node's next sibling or `null` if the node is a last child of it's parent or if the node has no parent.
  21850. *
  21851. * @readonly
  21852. * @type {module:engine/model/node~Node|null}
  21853. */
  21854. get nextSibling() {
  21855. const index = this.index;
  21856. return ( index !== null && this.parent.getChild( index + 1 ) ) || null;
  21857. }
  21858. /**
  21859. * Node's previous sibling or `null` if the node is a first child of it's parent or if the node has no parent.
  21860. *
  21861. * @readonly
  21862. * @type {module:engine/model/node~Node|null}
  21863. */
  21864. get previousSibling() {
  21865. const index = this.index;
  21866. return ( index !== null && this.parent.getChild( index - 1 ) ) || null;
  21867. }
  21868. /**
  21869. * The top-most ancestor of the node. If node has no parent it is the root itself. If the node is a part
  21870. * of {@link module:engine/model/documentfragment~DocumentFragment}, it's `root` is equal to that `DocumentFragment`.
  21871. *
  21872. * @readonly
  21873. * @type {module:engine/model/node~Node|module:engine/model/documentfragment~DocumentFragment}
  21874. */
  21875. get root() {
  21876. let root = this; // eslint-disable-line consistent-this
  21877. while ( root.parent ) {
  21878. root = root.parent;
  21879. }
  21880. return root;
  21881. }
  21882. /**
  21883. * Returns true if the node is in a tree rooted in the document (is a descendant of one of its roots).
  21884. *
  21885. * @returns {Boolean}
  21886. */
  21887. isAttached() {
  21888. return this.root.is( 'rootElement' );
  21889. }
  21890. /**
  21891. * Gets path to the node. The path is an array containing starting offsets of consecutive ancestors of this node,
  21892. * beginning from {@link module:engine/model/node~Node#root root}, down to this node's starting offset. The path can be used to
  21893. * create {@link module:engine/model/position~Position Position} instance.
  21894. *
  21895. * const abc = new Text( 'abc' );
  21896. * const foo = new Text( 'foo' );
  21897. * const h1 = new Element( 'h1', null, new Text( 'header' ) );
  21898. * const p = new Element( 'p', null, [ abc, foo ] );
  21899. * const div = new Element( 'div', null, [ h1, p ] );
  21900. * foo.getPath(); // Returns [ 1, 3 ]. `foo` is in `p` which is in `div`. `p` starts at offset 1, while `foo` at 3.
  21901. * h1.getPath(); // Returns [ 0 ].
  21902. * div.getPath(); // Returns [].
  21903. *
  21904. * @returns {Array.<Number>} The path.
  21905. */
  21906. getPath() {
  21907. const path = [];
  21908. let node = this; // eslint-disable-line consistent-this
  21909. while ( node.parent ) {
  21910. path.unshift( node.startOffset );
  21911. node = node.parent;
  21912. }
  21913. return path;
  21914. }
  21915. /**
  21916. * Returns ancestors array of this node.
  21917. *
  21918. * @param {Object} options Options object.
  21919. * @param {Boolean} [options.includeSelf=false] When set to `true` this node will be also included in parent's array.
  21920. * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from node's parent to root element,
  21921. * otherwise root element will be the first item in the array.
  21922. * @returns {Array} Array with ancestors.
  21923. */
  21924. getAncestors( options = { includeSelf: false, parentFirst: false } ) {
  21925. const ancestors = [];
  21926. let parent = options.includeSelf ? this : this.parent;
  21927. while ( parent ) {
  21928. ancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );
  21929. parent = parent.parent;
  21930. }
  21931. return ancestors;
  21932. }
  21933. /**
  21934. * Returns a {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}
  21935. * which is a common ancestor of both nodes.
  21936. *
  21937. * @param {module:engine/model/node~Node} node The second node.
  21938. * @param {Object} options Options object.
  21939. * @param {Boolean} [options.includeSelf=false] When set to `true` both nodes will be considered "ancestors" too.
  21940. * Which means that if e.g. node A is inside B, then their common ancestor will be B.
  21941. * @returns {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
  21942. */
  21943. getCommonAncestor( node, options = {} ) {
  21944. const ancestorsA = this.getAncestors( options );
  21945. const ancestorsB = node.getAncestors( options );
  21946. let i = 0;
  21947. while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
  21948. i++;
  21949. }
  21950. return i === 0 ? null : ancestorsA[ i - 1 ];
  21951. }
  21952. /**
  21953. * Returns whether this node is before given node. `false` is returned if nodes are in different trees (for example,
  21954. * in different {@link module:engine/model/documentfragment~DocumentFragment}s).
  21955. *
  21956. * @param {module:engine/model/node~Node} node Node to compare with.
  21957. * @returns {Boolean}
  21958. */
  21959. isBefore( node ) {
  21960. // Given node is not before this node if they are same.
  21961. if ( this == node ) {
  21962. return false;
  21963. }
  21964. // Return `false` if it is impossible to compare nodes.
  21965. if ( this.root !== node.root ) {
  21966. return false;
  21967. }
  21968. const thisPath = this.getPath();
  21969. const nodePath = node.getPath();
  21970. const result = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_2__["default"])( thisPath, nodePath );
  21971. switch ( result ) {
  21972. case 'prefix':
  21973. return true;
  21974. case 'extension':
  21975. return false;
  21976. default:
  21977. return thisPath[ result ] < nodePath[ result ];
  21978. }
  21979. }
  21980. /**
  21981. * Returns whether this node is after given node. `false` is returned if nodes are in different trees (for example,
  21982. * in different {@link module:engine/model/documentfragment~DocumentFragment}s).
  21983. *
  21984. * @param {module:engine/model/node~Node} node Node to compare with.
  21985. * @returns {Boolean}
  21986. */
  21987. isAfter( node ) {
  21988. // Given node is not before this node if they are same.
  21989. if ( this == node ) {
  21990. return false;
  21991. }
  21992. // Return `false` if it is impossible to compare nodes.
  21993. if ( this.root !== node.root ) {
  21994. return false;
  21995. }
  21996. // In other cases, just check if the `node` is before, and return the opposite.
  21997. return !this.isBefore( node );
  21998. }
  21999. /**
  22000. * Checks if the node has an attribute with given key.
  22001. *
  22002. * @param {String} key Key of attribute to check.
  22003. * @returns {Boolean} `true` if attribute with given key is set on node, `false` otherwise.
  22004. */
  22005. hasAttribute( key ) {
  22006. return this._attrs.has( key );
  22007. }
  22008. /**
  22009. * Gets an attribute value for given key or `undefined` if that attribute is not set on node.
  22010. *
  22011. * @param {String} key Key of attribute to look for.
  22012. * @returns {*} Attribute value or `undefined`.
  22013. */
  22014. getAttribute( key ) {
  22015. return this._attrs.get( key );
  22016. }
  22017. /**
  22018. * Returns iterator that iterates over this node's attributes.
  22019. *
  22020. * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.
  22021. * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
  22022. *
  22023. * @returns {Iterable.<*>}
  22024. */
  22025. getAttributes() {
  22026. return this._attrs.entries();
  22027. }
  22028. /**
  22029. * Returns iterator that iterates over this node's attribute keys.
  22030. *
  22031. * @returns {Iterable.<String>}
  22032. */
  22033. getAttributeKeys() {
  22034. return this._attrs.keys();
  22035. }
  22036. /**
  22037. * Converts `Node` to plain object and returns it.
  22038. *
  22039. * @returns {Object} `Node` converted to plain object.
  22040. */
  22041. toJSON() {
  22042. const json = {};
  22043. // Serializes attributes to the object.
  22044. // attributes = { a: 'foo', b: 1, c: true }.
  22045. if ( this._attrs.size ) {
  22046. json.attributes = Array.from( this._attrs ).reduce( ( result, attr ) => {
  22047. result[ attr[ 0 ] ] = attr[ 1 ];
  22048. return result;
  22049. }, {} );
  22050. }
  22051. return json;
  22052. }
  22053. /**
  22054. * Checks whether this object is of the given type.
  22055. *
  22056. * This method is useful when processing model objects that are of unknown type. For example, a function
  22057. * may return a {@link module:engine/model/documentfragment~DocumentFragment} or a {@link module:engine/model/node~Node}
  22058. * that can be either a text node or an element. This method can be used to check what kind of object is returned.
  22059. *
  22060. * someObject.is( 'element' ); // -> true if this is an element
  22061. * someObject.is( 'node' ); // -> true if this is a node (a text node or an element)
  22062. * someObject.is( 'documentFragment' ); // -> true if this is a document fragment
  22063. *
  22064. * Since this method is also available on a range of view objects, you can prefix the type of the object with
  22065. * `model:` or `view:` to check, for example, if this is the model's or view's element:
  22066. *
  22067. * modelElement.is( 'model:element' ); // -> true
  22068. * modelElement.is( 'view:element' ); // -> false
  22069. *
  22070. * By using this method it is also possible to check a name of an element:
  22071. *
  22072. * imageElement.is( 'element', 'imageBlock' ); // -> true
  22073. * imageElement.is( 'element', 'imageBlock' ); // -> same as above
  22074. * imageElement.is( 'model:element', 'imageBlock' ); // -> same as above, but more precise
  22075. *
  22076. * The list of model objects which implement the `is()` method:
  22077. *
  22078. * * {@link module:engine/model/node~Node#is `Node#is()`}
  22079. * * {@link module:engine/model/text~Text#is `Text#is()`}
  22080. * * {@link module:engine/model/element~Element#is `Element#is()`}
  22081. * * {@link module:engine/model/rootelement~RootElement#is `RootElement#is()`}
  22082. * * {@link module:engine/model/position~Position#is `Position#is()`}
  22083. * * {@link module:engine/model/liveposition~LivePosition#is `LivePosition#is()`}
  22084. * * {@link module:engine/model/range~Range#is `Range#is()`}
  22085. * * {@link module:engine/model/liverange~LiveRange#is `LiveRange#is()`}
  22086. * * {@link module:engine/model/documentfragment~DocumentFragment#is `DocumentFragment#is()`}
  22087. * * {@link module:engine/model/selection~Selection#is `Selection#is()`}
  22088. * * {@link module:engine/model/documentselection~DocumentSelection#is `DocumentSelection#is()`}
  22089. * * {@link module:engine/model/markercollection~Marker#is `Marker#is()`}
  22090. * * {@link module:engine/model/textproxy~TextProxy#is `TextProxy#is()`}
  22091. *
  22092. * @method #is
  22093. * @param {String} type Type to check.
  22094. * @returns {Boolean}
  22095. */
  22096. is( type ) {
  22097. return type === 'node' || type === 'model:node';
  22098. }
  22099. /**
  22100. * Creates a copy of this node, that is a node with exactly same attributes, and returns it.
  22101. *
  22102. * @protected
  22103. * @returns {module:engine/model/node~Node} Node with same attributes as this node.
  22104. */
  22105. _clone() {
  22106. return new Node( this._attrs );
  22107. }
  22108. /**
  22109. * Removes this node from it's parent.
  22110. *
  22111. * @see module:engine/model/writer~Writer#remove
  22112. * @protected
  22113. */
  22114. _remove() {
  22115. this.parent._removeChildren( this.index );
  22116. }
  22117. /**
  22118. * Sets attribute on the node. If attribute with the same key already is set, it's value is overwritten.
  22119. *
  22120. * @see module:engine/model/writer~Writer#setAttribute
  22121. * @protected
  22122. * @param {String} key Key of attribute to set.
  22123. * @param {*} value Attribute value.
  22124. */
  22125. _setAttribute( key, value ) {
  22126. this._attrs.set( key, value );
  22127. }
  22128. /**
  22129. * Removes all attributes from the node and sets given attributes.
  22130. *
  22131. * @see module:engine/model/writer~Writer#setAttributes
  22132. * @protected
  22133. * @param {Object} [attrs] Attributes to set. See {@link module:utils/tomap~toMap} for a list of accepted values.
  22134. */
  22135. _setAttributesTo( attrs ) {
  22136. this._attrs = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_0__["default"])( attrs );
  22137. }
  22138. /**
  22139. * Removes an attribute with given key from the node.
  22140. *
  22141. * @see module:engine/model/writer~Writer#removeAttribute
  22142. * @protected
  22143. * @param {String} key Key of attribute to remove.
  22144. * @returns {Boolean} `true` if the attribute was set on the element, `false` otherwise.
  22145. */
  22146. _removeAttribute( key ) {
  22147. return this._attrs.delete( key );
  22148. }
  22149. /**
  22150. * Removes all attributes from the node.
  22151. *
  22152. * @see module:engine/model/writer~Writer#clearAttributes
  22153. * @protected
  22154. */
  22155. _clearAttributes() {
  22156. this._attrs.clear();
  22157. }
  22158. }
  22159. /**
  22160. * The node's parent does not contain this node.
  22161. *
  22162. * @error model-node-not-found-in-parent
  22163. */
  22164. /***/ }),
  22165. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js":
  22166. /*!***********************************************************************!*\
  22167. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js ***!
  22168. \***********************************************************************/
  22169. /*! exports provided: default */
  22170. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22171. "use strict";
  22172. __webpack_require__.r(__webpack_exports__);
  22173. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return NodeList; });
  22174. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
  22175. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  22176. /**
  22177. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  22178. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  22179. */
  22180. /**
  22181. * @module engine/model/nodelist
  22182. */
  22183. /**
  22184. * Provides an interface to operate on a list of {@link module:engine/model/node~Node nodes}. `NodeList` is used internally
  22185. * in classes like {@link module:engine/model/element~Element Element}
  22186. * or {@link module:engine/model/documentfragment~DocumentFragment DocumentFragment}.
  22187. */
  22188. class NodeList {
  22189. /**
  22190. * Creates an empty node list.
  22191. *
  22192. * @protected
  22193. * @param {Iterable.<module:engine/model/node~Node>} nodes Nodes contained in this node list.
  22194. */
  22195. constructor( nodes ) {
  22196. /**
  22197. * Nodes contained in this node list.
  22198. *
  22199. * @private
  22200. * @member {Array.<module:engine/model/node~Node>}
  22201. */
  22202. this._nodes = [];
  22203. if ( nodes ) {
  22204. this._insertNodes( 0, nodes );
  22205. }
  22206. }
  22207. /**
  22208. * Iterable interface.
  22209. *
  22210. * Iterates over all nodes contained inside this node list.
  22211. *
  22212. * @returns {Iterable.<module:engine/model/node~Node>}
  22213. */
  22214. [ Symbol.iterator ]() {
  22215. return this._nodes[ Symbol.iterator ]();
  22216. }
  22217. /**
  22218. * Number of nodes contained inside this node list.
  22219. *
  22220. * @readonly
  22221. * @type {Number}
  22222. */
  22223. get length() {
  22224. return this._nodes.length;
  22225. }
  22226. /**
  22227. * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all nodes contained inside this node list.
  22228. *
  22229. * @readonly
  22230. * @type {Number}
  22231. */
  22232. get maxOffset() {
  22233. return this._nodes.reduce( ( sum, node ) => sum + node.offsetSize, 0 );
  22234. }
  22235. /**
  22236. * Gets the node at the given index. Returns `null` if incorrect index was passed.
  22237. *
  22238. * @param {Number} index Index of node.
  22239. * @returns {module:engine/model/node~Node|null} Node at given index.
  22240. */
  22241. getNode( index ) {
  22242. return this._nodes[ index ] || null;
  22243. }
  22244. /**
  22245. * Returns an index of the given node. Returns `null` if given node is not inside this node list.
  22246. *
  22247. * @param {module:engine/model/node~Node} node Child node to look for.
  22248. * @returns {Number|null} Child node's index.
  22249. */
  22250. getNodeIndex( node ) {
  22251. const index = this._nodes.indexOf( node );
  22252. return index == -1 ? null : index;
  22253. }
  22254. /**
  22255. * Returns the starting offset of given node. Starting offset is equal to the sum of
  22256. * {@link module:engine/model/node~Node#offsetSize offset sizes} of all nodes that are before this node in this node list.
  22257. *
  22258. * @param {module:engine/model/node~Node} node Node to look for.
  22259. * @returns {Number|null} Node's starting offset.
  22260. */
  22261. getNodeStartOffset( node ) {
  22262. const index = this.getNodeIndex( node );
  22263. return index === null ? null : this._nodes.slice( 0, index ).reduce( ( sum, node ) => sum + node.offsetSize, 0 );
  22264. }
  22265. /**
  22266. * Converts index to offset in node list.
  22267. *
  22268. * Returns starting offset of a node that is at given index. Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
  22269. * `model-nodelist-index-out-of-bounds` if given index is less than `0` or more than {@link #length}.
  22270. *
  22271. * @param {Number} index Node's index.
  22272. * @returns {Number} Node's starting offset.
  22273. */
  22274. indexToOffset( index ) {
  22275. if ( index == this._nodes.length ) {
  22276. return this.maxOffset;
  22277. }
  22278. const node = this._nodes[ index ];
  22279. if ( !node ) {
  22280. /**
  22281. * Given index cannot be found in the node list.
  22282. *
  22283. * @error model-nodelist-index-out-of-bounds
  22284. */
  22285. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-nodelist-index-out-of-bounds', this );
  22286. }
  22287. return this.getNodeStartOffset( node );
  22288. }
  22289. /**
  22290. * Converts offset in node list to index.
  22291. *
  22292. * Returns index of a node that occupies given offset. Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
  22293. * `model-nodelist-offset-out-of-bounds` if given offset is less than `0` or more than {@link #maxOffset}.
  22294. *
  22295. * @param {Number} offset Offset to look for.
  22296. * @returns {Number} Index of a node that occupies given offset.
  22297. */
  22298. offsetToIndex( offset ) {
  22299. let totalOffset = 0;
  22300. for ( const node of this._nodes ) {
  22301. if ( offset >= totalOffset && offset < totalOffset + node.offsetSize ) {
  22302. return this.getNodeIndex( node );
  22303. }
  22304. totalOffset += node.offsetSize;
  22305. }
  22306. if ( totalOffset != offset ) {
  22307. /**
  22308. * Given offset cannot be found in the node list.
  22309. *
  22310. * @error model-nodelist-offset-out-of-bounds
  22311. * @param {Number} offset
  22312. * @param {module:engine/model/nodelist~NodeList} nodeList Stringified node list.
  22313. */
  22314. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-nodelist-offset-out-of-bounds',
  22315. this,
  22316. {
  22317. offset,
  22318. nodeList: this
  22319. }
  22320. );
  22321. }
  22322. return this.length;
  22323. }
  22324. /**
  22325. * Inserts given nodes at given index.
  22326. *
  22327. * @protected
  22328. * @param {Number} index Index at which nodes should be inserted.
  22329. * @param {Iterable.<module:engine/model/node~Node>} nodes Nodes to be inserted.
  22330. */
  22331. _insertNodes( index, nodes ) {
  22332. // Validation.
  22333. for ( const node of nodes ) {
  22334. if ( !( node instanceof _node__WEBPACK_IMPORTED_MODULE_0__["default"] ) ) {
  22335. /**
  22336. * Trying to insert an object which is not a Node instance.
  22337. *
  22338. * @error model-nodelist-insertnodes-not-node
  22339. */
  22340. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-nodelist-insertnodes-not-node', this );
  22341. }
  22342. }
  22343. this._nodes.splice( index, 0, ...nodes );
  22344. }
  22345. /**
  22346. * Removes one or more nodes starting at the given index.
  22347. *
  22348. * @protected
  22349. * @param {Number} indexStart Index of the first node to remove.
  22350. * @param {Number} [howMany=1] Number of nodes to remove.
  22351. * @returns {Array.<module:engine/model/node~Node>} Array containing removed nodes.
  22352. */
  22353. _removeNodes( indexStart, howMany = 1 ) {
  22354. return this._nodes.splice( indexStart, howMany );
  22355. }
  22356. /**
  22357. * Converts `NodeList` instance to an array containing nodes that were inserted in the node list. Nodes
  22358. * are also converted to their plain object representation.
  22359. *
  22360. * @returns {Array.<module:engine/model/node~Node>} `NodeList` instance converted to `Array`.
  22361. */
  22362. toJSON() {
  22363. return this._nodes.map( node => node.toJSON() );
  22364. }
  22365. }
  22366. /***/ }),
  22367. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js":
  22368. /*!*******************************************************************************************!*\
  22369. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js ***!
  22370. \*******************************************************************************************/
  22371. /*! exports provided: default */
  22372. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22373. "use strict";
  22374. __webpack_require__.r(__webpack_exports__);
  22375. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AttributeOperation; });
  22376. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  22377. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  22378. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  22379. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  22380. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  22381. /**
  22382. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  22383. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  22384. */
  22385. /**
  22386. * @module engine/model/operation/attributeoperation
  22387. */
  22388. /**
  22389. * Operation to change nodes' attribute.
  22390. *
  22391. * Using this class you can add, remove or change value of the attribute.
  22392. *
  22393. * @extends module:engine/model/operation/operation~Operation
  22394. */
  22395. class AttributeOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  22396. /**
  22397. * Creates an operation that changes, removes or adds attributes.
  22398. *
  22399. * If only `newValue` is set, attribute will be added on a node. Note that all nodes in operation's range must not
  22400. * have an attribute with the same key as the added attribute.
  22401. *
  22402. * If only `oldValue` is set, then attribute with given key will be removed. Note that all nodes in operation's range
  22403. * must have an attribute with that key added.
  22404. *
  22405. * If both `newValue` and `oldValue` are set, then the operation will change the attribute value. Note that all nodes in
  22406. * operation's ranges must already have an attribute with given key and `oldValue` as value
  22407. *
  22408. * @param {module:engine/model/range~Range} range Range on which the operation should be applied. Must be a flat range.
  22409. * @param {String} key Key of an attribute to change or remove.
  22410. * @param {*} oldValue Old value of the attribute with given key or `null`, if attribute was not set before.
  22411. * @param {*} newValue New value of the attribute with given key or `null`, if operation should remove attribute.
  22412. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  22413. * can be applied or `null` if the operation operates on detached (non-document) tree.
  22414. */
  22415. constructor( range, key, oldValue, newValue, baseVersion ) {
  22416. super( baseVersion );
  22417. /**
  22418. * Range on which operation should be applied.
  22419. *
  22420. * @readonly
  22421. * @member {module:engine/model/range~Range}
  22422. */
  22423. this.range = range.clone();
  22424. /**
  22425. * Key of an attribute to change or remove.
  22426. *
  22427. * @readonly
  22428. * @member {String}
  22429. */
  22430. this.key = key;
  22431. /**
  22432. * Old value of the attribute with given key or `null`, if attribute was not set before.
  22433. *
  22434. * @readonly
  22435. * @member {*}
  22436. */
  22437. this.oldValue = oldValue === undefined ? null : oldValue;
  22438. /**
  22439. * New value of the attribute with given key or `null`, if operation should remove attribute.
  22440. *
  22441. * @readonly
  22442. * @member {*}
  22443. */
  22444. this.newValue = newValue === undefined ? null : newValue;
  22445. }
  22446. /**
  22447. * @inheritDoc
  22448. */
  22449. get type() {
  22450. if ( this.oldValue === null ) {
  22451. return 'addAttribute';
  22452. } else if ( this.newValue === null ) {
  22453. return 'removeAttribute';
  22454. } else {
  22455. return 'changeAttribute';
  22456. }
  22457. }
  22458. /**
  22459. * Creates and returns an operation that has the same parameters as this operation.
  22460. *
  22461. * @returns {module:engine/model/operation/attributeoperation~AttributeOperation} Clone of this operation.
  22462. */
  22463. clone() {
  22464. return new AttributeOperation( this.range, this.key, this.oldValue, this.newValue, this.baseVersion );
  22465. }
  22466. /**
  22467. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  22468. *
  22469. * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}
  22470. */
  22471. getReversed() {
  22472. return new AttributeOperation( this.range, this.key, this.newValue, this.oldValue, this.baseVersion + 1 );
  22473. }
  22474. /**
  22475. * @inheritDoc
  22476. */
  22477. toJSON() {
  22478. const json = super.toJSON();
  22479. json.range = this.range.toJSON();
  22480. return json;
  22481. }
  22482. /**
  22483. * @inheritDoc
  22484. */
  22485. _validate() {
  22486. if ( !this.range.isFlat ) {
  22487. /**
  22488. * The range to change is not flat.
  22489. *
  22490. * @error attribute-operation-range-not-flat
  22491. */
  22492. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'attribute-operation-range-not-flat', this );
  22493. }
  22494. for ( const item of this.range.getItems( { shallow: true } ) ) {
  22495. if ( this.oldValue !== null && !Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isEqual"])( item.getAttribute( this.key ), this.oldValue ) ) {
  22496. /**
  22497. * Changed node has different attribute value than operation's old attribute value.
  22498. *
  22499. * @error attribute-operation-wrong-old-value
  22500. * @param {module:engine/model/item~Item} item
  22501. * @param {String} key
  22502. * @param {*} value
  22503. */
  22504. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  22505. 'attribute-operation-wrong-old-value',
  22506. this,
  22507. { item, key: this.key, value: this.oldValue }
  22508. );
  22509. }
  22510. if ( this.oldValue === null && this.newValue !== null && item.hasAttribute( this.key ) ) {
  22511. /**
  22512. * The attribute with given key already exists for the given node.
  22513. *
  22514. * @error attribute-operation-attribute-exists
  22515. * @param {module:engine/model/node~Node} node
  22516. * @param {String} key
  22517. */
  22518. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  22519. 'attribute-operation-attribute-exists',
  22520. this,
  22521. { node: item, key: this.key }
  22522. );
  22523. }
  22524. }
  22525. }
  22526. /**
  22527. * @inheritDoc
  22528. */
  22529. _execute() {
  22530. // If value to set is same as old value, don't do anything.
  22531. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isEqual"])( this.oldValue, this.newValue ) ) {
  22532. // Execution.
  22533. Object(_utils__WEBPACK_IMPORTED_MODULE_3__["_setAttribute"])( this.range, this.key, this.newValue );
  22534. }
  22535. }
  22536. /**
  22537. * @inheritDoc
  22538. */
  22539. static get className() {
  22540. return 'AttributeOperation';
  22541. }
  22542. /**
  22543. * Creates `AttributeOperation` object from deserilized object, i.e. from parsed JSON string.
  22544. *
  22545. * @param {Object} json Deserialized JSON object.
  22546. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  22547. * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}
  22548. */
  22549. static fromJSON( json, document ) {
  22550. return new AttributeOperation( _range__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.range, document ), json.key, json.oldValue, json.newValue, json.baseVersion );
  22551. }
  22552. // @if CK_DEBUG_ENGINE // toString() {
  22553. // @if CK_DEBUG_ENGINE // return `AttributeOperation( ${ this.baseVersion } ): ` +
  22554. // @if CK_DEBUG_ENGINE // `"${ this.key }": ${ JSON.stringify( this.oldValue ) }` +
  22555. // @if CK_DEBUG_ENGINE // ` -> ${ JSON.stringify( this.newValue ) }, ${ this.range }`;
  22556. // @if CK_DEBUG_ENGINE // }
  22557. }
  22558. /***/ }),
  22559. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/detachoperation.js":
  22560. /*!****************************************************************************************!*\
  22561. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/detachoperation.js ***!
  22562. \****************************************************************************************/
  22563. /*! exports provided: default */
  22564. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22565. "use strict";
  22566. __webpack_require__.r(__webpack_exports__);
  22567. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DetachOperation; });
  22568. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  22569. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  22570. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  22571. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  22572. /**
  22573. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  22574. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  22575. */
  22576. /**
  22577. * @module engine/model/operation/detachoperation
  22578. */
  22579. // @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;
  22580. /**
  22581. * Operation to permanently remove node from detached root.
  22582. * Note this operation is only a local operation and won't be send to the other clients.
  22583. *
  22584. * @extends module:engine/model/operation/operation~Operation
  22585. */
  22586. class DetachOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  22587. /**
  22588. * Creates an insert operation.
  22589. *
  22590. * @param {module:engine/model/position~Position} sourcePosition
  22591. * Position before the first {@link module:engine/model/item~Item model item} to move.
  22592. * @param {Number} howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at
  22593. * `sourcePosition` with offset shifted by `howMany`.
  22594. */
  22595. constructor( sourcePosition, howMany ) {
  22596. super( null );
  22597. /**
  22598. * Position before the first {@link module:engine/model/item~Item model item} to detach.
  22599. *
  22600. * @member {module:engine/model/position~Position} #sourcePosition
  22601. */
  22602. this.sourcePosition = sourcePosition.clone();
  22603. /**
  22604. * Offset size of moved range.
  22605. *
  22606. * @member {Number} #howMany
  22607. */
  22608. this.howMany = howMany;
  22609. }
  22610. /**
  22611. * @inheritDoc
  22612. */
  22613. get type() {
  22614. return 'detach';
  22615. }
  22616. /**
  22617. * @inheritDoc
  22618. */
  22619. toJSON() {
  22620. const json = super.toJSON();
  22621. json.sourcePosition = this.sourcePosition.toJSON();
  22622. return json;
  22623. }
  22624. /**
  22625. * @inheritDoc
  22626. */
  22627. _validate() {
  22628. if ( this.sourcePosition.root.document ) {
  22629. /**
  22630. * Cannot detach document node.
  22631. *
  22632. * @error detach-operation-on-document-node
  22633. */
  22634. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"]( 'detach-operation-on-document-node', this );
  22635. }
  22636. }
  22637. /**
  22638. * @inheritDoc
  22639. */
  22640. _execute() {
  22641. Object(_utils__WEBPACK_IMPORTED_MODULE_2__["_remove"])( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( this.sourcePosition, this.howMany ) );
  22642. }
  22643. /**
  22644. * @inheritDoc
  22645. */
  22646. static get className() {
  22647. return 'DetachOperation';
  22648. }
  22649. // @if CK_DEBUG_ENGINE // toString() {
  22650. // @if CK_DEBUG_ENGINE // const range = ModelRange._createFromPositionAndShift( this.sourcePosition, this.howMany );
  22651. // @if CK_DEBUG_ENGINE // const nodes = Array.from( range.getItems() );
  22652. // @if CK_DEBUG_ENGINE // const nodeString = nodes.length > 1 ? `[ ${ nodes.length } ]` : nodes[ 0 ];
  22653. // @if CK_DEBUG_ENGINE // return `DetachOperation( ${ this.baseVersion } ): ${ nodeString } -> ${ range }`;
  22654. // @if CK_DEBUG_ENGINE // }
  22655. }
  22656. /***/ }),
  22657. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js":
  22658. /*!****************************************************************************************!*\
  22659. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js ***!
  22660. \****************************************************************************************/
  22661. /*! exports provided: default */
  22662. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22663. "use strict";
  22664. __webpack_require__.r(__webpack_exports__);
  22665. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertOperation; });
  22666. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  22667. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  22668. /* harmony import */ var _nodelist__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../nodelist */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js");
  22669. /* harmony import */ var _moveoperation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./moveoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js");
  22670. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  22671. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  22672. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  22673. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  22674. /**
  22675. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  22676. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  22677. */
  22678. /**
  22679. * @module engine/model/operation/insertoperation
  22680. */
  22681. /**
  22682. * Operation to insert one or more nodes at given position in the model.
  22683. *
  22684. * @extends module:engine/model/operation/operation~Operation
  22685. */
  22686. class InsertOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  22687. /**
  22688. * Creates an insert operation.
  22689. *
  22690. * @param {module:engine/model/position~Position} position Position of insertion.
  22691. * @param {module:engine/model/node~NodeSet} nodes The list of nodes to be inserted.
  22692. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  22693. * can be applied or `null` if the operation operates on detached (non-document) tree.
  22694. */
  22695. constructor( position, nodes, baseVersion ) {
  22696. super( baseVersion );
  22697. /**
  22698. * Position of insertion.
  22699. *
  22700. * @readonly
  22701. * @member {module:engine/model/position~Position} module:engine/model/operation/insertoperation~InsertOperation#position
  22702. */
  22703. this.position = position.clone();
  22704. this.position.stickiness = 'toNone';
  22705. /**
  22706. * List of nodes to insert.
  22707. *
  22708. * @readonly
  22709. * @member {module:engine/model/nodelist~NodeList} module:engine/model/operation/insertoperation~InsertOperation#nodeList
  22710. */
  22711. this.nodes = new _nodelist__WEBPACK_IMPORTED_MODULE_2__["default"]( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_normalizeNodes"])( nodes ) );
  22712. /**
  22713. * Flag deciding how the operation should be transformed. If set to `true`, nodes might get additional attributes
  22714. * during operational transformation. This happens when the operation insertion position is inside of a range
  22715. * where attributes have changed.
  22716. *
  22717. * @member {Boolean} module:engine/model/operation/insertoperation~InsertOperation#shouldReceiveAttributes
  22718. */
  22719. this.shouldReceiveAttributes = false;
  22720. }
  22721. /**
  22722. * @inheritDoc
  22723. */
  22724. get type() {
  22725. return 'insert';
  22726. }
  22727. /**
  22728. * Total offset size of inserted nodes.
  22729. *
  22730. * @returns {Number}
  22731. */
  22732. get howMany() {
  22733. return this.nodes.maxOffset;
  22734. }
  22735. /**
  22736. * Creates and returns an operation that has the same parameters as this operation.
  22737. *
  22738. * @returns {module:engine/model/operation/insertoperation~InsertOperation} Clone of this operation.
  22739. */
  22740. clone() {
  22741. const nodes = new _nodelist__WEBPACK_IMPORTED_MODULE_2__["default"]( [ ...this.nodes ].map( node => node._clone( true ) ) );
  22742. const insert = new InsertOperation( this.position, nodes, this.baseVersion );
  22743. insert.shouldReceiveAttributes = this.shouldReceiveAttributes;
  22744. return insert;
  22745. }
  22746. /**
  22747. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  22748. *
  22749. * @returns {module:engine/model/operation/moveoperation~MoveOperation}
  22750. */
  22751. getReversed() {
  22752. const graveyard = this.position.root.document.graveyard;
  22753. const gyPosition = new _position__WEBPACK_IMPORTED_MODULE_1__["default"]( graveyard, [ 0 ] );
  22754. return new _moveoperation__WEBPACK_IMPORTED_MODULE_3__["default"]( this.position, this.nodes.maxOffset, gyPosition, this.baseVersion + 1 );
  22755. }
  22756. /**
  22757. * @inheritDoc
  22758. */
  22759. _validate() {
  22760. const targetElement = this.position.parent;
  22761. if ( !targetElement || targetElement.maxOffset < this.position.offset ) {
  22762. /**
  22763. * Insertion position is invalid.
  22764. *
  22765. * @error insert-operation-position-invalid
  22766. */
  22767. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_7__["default"](
  22768. 'insert-operation-position-invalid',
  22769. this
  22770. );
  22771. }
  22772. }
  22773. /**
  22774. * @inheritDoc
  22775. */
  22776. _execute() {
  22777. // What happens here is that we want original nodes be passed to writer because we want original nodes
  22778. // to be inserted to the model. But in InsertOperation, we want to keep those nodes as they were added
  22779. // to the operation, not modified. For example, text nodes can get merged or cropped while Elements can
  22780. // get children. It is important that InsertOperation has the copy of original nodes in intact state.
  22781. const originalNodes = this.nodes;
  22782. this.nodes = new _nodelist__WEBPACK_IMPORTED_MODULE_2__["default"]( [ ...originalNodes ].map( node => node._clone( true ) ) );
  22783. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_insert"])( this.position, originalNodes );
  22784. }
  22785. /**
  22786. * @inheritDoc
  22787. */
  22788. toJSON() {
  22789. const json = super.toJSON();
  22790. json.position = this.position.toJSON();
  22791. json.nodes = this.nodes.toJSON();
  22792. return json;
  22793. }
  22794. /**
  22795. * @inheritDoc
  22796. */
  22797. static get className() {
  22798. return 'InsertOperation';
  22799. }
  22800. /**
  22801. * Creates `InsertOperation` object from deserilized object, i.e. from parsed JSON string.
  22802. *
  22803. * @param {Object} json Deserialized JSON object.
  22804. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  22805. * @returns {module:engine/model/operation/insertoperation~InsertOperation}
  22806. */
  22807. static fromJSON( json, document ) {
  22808. const children = [];
  22809. for ( const child of json.nodes ) {
  22810. if ( child.name ) {
  22811. // If child has name property, it is an Element.
  22812. children.push( _element__WEBPACK_IMPORTED_MODULE_6__["default"].fromJSON( child ) );
  22813. } else {
  22814. // Otherwise, it is a Text node.
  22815. children.push( _text__WEBPACK_IMPORTED_MODULE_5__["default"].fromJSON( child ) );
  22816. }
  22817. }
  22818. const insert = new InsertOperation( _position__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.position, document ), children, json.baseVersion );
  22819. insert.shouldReceiveAttributes = json.shouldReceiveAttributes;
  22820. return insert;
  22821. }
  22822. // @if CK_DEBUG_ENGINE // toString() {
  22823. // @if CK_DEBUG_ENGINE // const nodeString = this.nodes.length > 1 ? `[ ${ this.nodes.length } ]` : this.nodes.getNode( 0 );
  22824. // @if CK_DEBUG_ENGINE // return `InsertOperation( ${ this.baseVersion } ): ${ nodeString } -> ${ this.position }`;
  22825. // @if CK_DEBUG_ENGINE // }
  22826. }
  22827. /***/ }),
  22828. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js":
  22829. /*!****************************************************************************************!*\
  22830. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js ***!
  22831. \****************************************************************************************/
  22832. /*! exports provided: default */
  22833. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22834. "use strict";
  22835. __webpack_require__.r(__webpack_exports__);
  22836. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MarkerOperation; });
  22837. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  22838. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  22839. /**
  22840. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  22841. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  22842. */
  22843. /**
  22844. * @module engine/model/operation/markeroperation
  22845. */
  22846. /**
  22847. * @extends module:engine/model/operation/operation~Operation
  22848. */
  22849. class MarkerOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  22850. /**
  22851. * @param {String} name Marker name.
  22852. * @param {module:engine/model/range~Range} oldRange Marker range before the change.
  22853. * @param {module:engine/model/range~Range} newRange Marker range after the change.
  22854. * @param {module:engine/model/markercollection~MarkerCollection} markers Marker collection on which change should be executed.
  22855. * @param {Boolean} affectsData Specifies whether the marker operation affects the data produced by the data pipeline
  22856. * (is persisted in the editor's data).
  22857. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  22858. * can be applied or `null` if the operation operates on detached (non-document) tree.
  22859. */
  22860. constructor( name, oldRange, newRange, markers, affectsData, baseVersion ) {
  22861. super( baseVersion );
  22862. /**
  22863. * Marker name.
  22864. *
  22865. * @readonly
  22866. * @member {String}
  22867. */
  22868. this.name = name;
  22869. /**
  22870. * Marker range before the change.
  22871. *
  22872. * @readonly
  22873. * @member {module:engine/model/range~Range}
  22874. */
  22875. this.oldRange = oldRange ? oldRange.clone() : null;
  22876. /**
  22877. * Marker range after the change.
  22878. *
  22879. * @readonly
  22880. * @member {module:engine/model/range~Range}
  22881. */
  22882. this.newRange = newRange ? newRange.clone() : null;
  22883. /**
  22884. * Specifies whether the marker operation affects the data produced by the data pipeline
  22885. * (is persisted in the editor's data).
  22886. *
  22887. * @readonly
  22888. * @member {Boolean}
  22889. */
  22890. this.affectsData = affectsData;
  22891. /**
  22892. * Marker collection on which change should be executed.
  22893. *
  22894. * @private
  22895. * @member {module:engine/model/markercollection~MarkerCollection}
  22896. */
  22897. this._markers = markers;
  22898. }
  22899. /**
  22900. * @inheritDoc
  22901. */
  22902. get type() {
  22903. return 'marker';
  22904. }
  22905. /**
  22906. * Creates and returns an operation that has the same parameters as this operation.
  22907. *
  22908. * @returns {module:engine/model/operation/markeroperation~MarkerOperation} Clone of this operation.
  22909. */
  22910. clone() {
  22911. return new MarkerOperation( this.name, this.oldRange, this.newRange, this._markers, this.affectsData, this.baseVersion );
  22912. }
  22913. /**
  22914. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  22915. *
  22916. * @returns {module:engine/model/operation/markeroperation~MarkerOperation}
  22917. */
  22918. getReversed() {
  22919. return new MarkerOperation( this.name, this.newRange, this.oldRange, this._markers, this.affectsData, this.baseVersion + 1 );
  22920. }
  22921. /**
  22922. * @inheritDoc
  22923. */
  22924. _execute() {
  22925. const type = this.newRange ? '_set' : '_remove';
  22926. this._markers[ type ]( this.name, this.newRange, true, this.affectsData );
  22927. }
  22928. /**
  22929. * @inheritDoc
  22930. */
  22931. toJSON() {
  22932. const json = super.toJSON();
  22933. if ( this.oldRange ) {
  22934. json.oldRange = this.oldRange.toJSON();
  22935. }
  22936. if ( this.newRange ) {
  22937. json.newRange = this.newRange.toJSON();
  22938. }
  22939. delete json._markers;
  22940. return json;
  22941. }
  22942. /**
  22943. * @inheritDoc
  22944. */
  22945. static get className() {
  22946. return 'MarkerOperation';
  22947. }
  22948. /**
  22949. * Creates `MarkerOperation` object from deserialized object, i.e. from parsed JSON string.
  22950. *
  22951. * @param {Object} json Deserialized JSON object.
  22952. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  22953. * @returns {module:engine/model/operation/markeroperation~MarkerOperation}
  22954. */
  22955. static fromJSON( json, document ) {
  22956. return new MarkerOperation(
  22957. json.name,
  22958. json.oldRange ? _range__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.oldRange, document ) : null,
  22959. json.newRange ? _range__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.newRange, document ) : null,
  22960. document.model.markers,
  22961. json.affectsData,
  22962. json.baseVersion
  22963. );
  22964. }
  22965. // @if CK_DEBUG_ENGINE // toString() {
  22966. // @if CK_DEBUG_ENGINE // return `MarkerOperation( ${ this.baseVersion } ): ` +
  22967. // @if CK_DEBUG_ENGINE // `"${ this.name }": ${ this.oldRange } -> ${ this.newRange }`;
  22968. // @if CK_DEBUG_ENGINE // }
  22969. }
  22970. /***/ }),
  22971. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js":
  22972. /*!***************************************************************************************!*\
  22973. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js ***!
  22974. \***************************************************************************************/
  22975. /*! exports provided: default */
  22976. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22977. "use strict";
  22978. __webpack_require__.r(__webpack_exports__);
  22979. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MergeOperation; });
  22980. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  22981. /* harmony import */ var _splitoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./splitoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js");
  22982. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  22983. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  22984. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  22985. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  22986. /**
  22987. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  22988. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  22989. */
  22990. /**
  22991. * @module engine/model/operation/mergeoperation
  22992. */
  22993. /**
  22994. * Operation to merge two {@link module:engine/model/element~Element elements}.
  22995. *
  22996. * The merged element is the parent of {@link ~MergeOperation#sourcePosition} and it is merged into the parent of
  22997. * {@link ~MergeOperation#targetPosition}. All nodes from the merged element are moved to {@link ~MergeOperation#targetPosition}.
  22998. *
  22999. * The merged element is moved to the graveyard at {@link ~MergeOperation#graveyardPosition}.
  23000. *
  23001. * @extends module:engine/model/operation/operation~Operation
  23002. */
  23003. class MergeOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  23004. /**
  23005. * Creates a merge operation.
  23006. *
  23007. * @param {module:engine/model/position~Position} sourcePosition Position inside the merged element. All nodes from that
  23008. * element after that position will be moved to {@link ~#targetPosition}.
  23009. * @param {Number} howMany Summary offset size of nodes which will be moved from the merged element to the new parent.
  23010. * @param {module:engine/model/position~Position} targetPosition Position which the nodes from the merged elements will be moved to.
  23011. * @param {module:engine/model/position~Position} graveyardPosition Position in graveyard to which the merged element will be moved.
  23012. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  23013. * can be applied or `null` if the operation operates on detached (non-document) tree.
  23014. */
  23015. constructor( sourcePosition, howMany, targetPosition, graveyardPosition, baseVersion ) {
  23016. super( baseVersion );
  23017. /**
  23018. * Position inside the merged element. All nodes from that element after that position will be moved to {@link ~#targetPosition}.
  23019. *
  23020. * @member {module:engine/model/position~Position} module:engine/model/operation/mergeoperation~MergeOperation#sourcePosition
  23021. */
  23022. this.sourcePosition = sourcePosition.clone();
  23023. // This is, and should always remain, the first position in its parent.
  23024. this.sourcePosition.stickiness = 'toPrevious';
  23025. /**
  23026. * Summary offset size of nodes which will be moved from the merged element to the new parent.
  23027. *
  23028. * @member {Number} module:engine/model/operation/mergeoperation~MergeOperation#howMany
  23029. */
  23030. this.howMany = howMany;
  23031. /**
  23032. * Position which the nodes from the merged elements will be moved to.
  23033. *
  23034. * @member {module:engine/model/position~Position} module:engine/model/operation/mergeoperation~MergeOperation#targetPosition
  23035. */
  23036. this.targetPosition = targetPosition.clone();
  23037. // Except of a rare scenario in `MergeOperation` x `MergeOperation` transformation,
  23038. // this is, and should always remain, the last position in its parent.
  23039. this.targetPosition.stickiness = 'toNext';
  23040. /**
  23041. * Position in graveyard to which the merged element will be moved.
  23042. *
  23043. * @member {module:engine/model/position~Position} module:engine/model/operation/mergeoperation~MergeOperation#graveyardPosition
  23044. */
  23045. this.graveyardPosition = graveyardPosition.clone();
  23046. }
  23047. /**
  23048. * @inheritDoc
  23049. */
  23050. get type() {
  23051. return 'merge';
  23052. }
  23053. /**
  23054. * Position before the merged element (which will be deleted).
  23055. *
  23056. * @readonly
  23057. * @type {module:engine/model/position~Position}
  23058. */
  23059. get deletionPosition() {
  23060. return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( this.sourcePosition.root, this.sourcePosition.path.slice( 0, -1 ) );
  23061. }
  23062. /**
  23063. * Artificial range that contains all the nodes from the merged element that will be moved to {@link ~MergeOperation#sourcePosition}.
  23064. * The range starts at {@link ~MergeOperation#sourcePosition} and ends in the same parent, at `POSITIVE_INFINITY` offset.
  23065. *
  23066. * @readonly
  23067. * @type {module:engine/model/range~Range}
  23068. */
  23069. get movedRange() {
  23070. const end = this.sourcePosition.getShiftedBy( Number.POSITIVE_INFINITY );
  23071. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( this.sourcePosition, end );
  23072. }
  23073. /**
  23074. * Creates and returns an operation that has the same parameters as this operation.
  23075. *
  23076. * @returns {module:engine/model/operation/mergeoperation~MergeOperation} Clone of this operation.
  23077. */
  23078. clone() {
  23079. return new this.constructor( this.sourcePosition, this.howMany, this.targetPosition, this.graveyardPosition, this.baseVersion );
  23080. }
  23081. /**
  23082. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  23083. *
  23084. * @returns {module:engine/model/operation/splitoperation~SplitOperation}
  23085. */
  23086. getReversed() {
  23087. // Positions in this method are transformed by this merge operation because the split operation bases on
  23088. // the context after this merge operation happened (because split operation reverses it).
  23089. // So we need to acknowledge that the merge operation happened and those positions changed a little.
  23090. const targetPosition = this.targetPosition._getTransformedByMergeOperation( this );
  23091. const path = this.sourcePosition.path.slice( 0, -1 );
  23092. const insertionPosition = new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( this.sourcePosition.root, path )._getTransformedByMergeOperation( this );
  23093. return new _splitoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( targetPosition, this.howMany, insertionPosition, this.graveyardPosition, this.baseVersion + 1 );
  23094. }
  23095. /**
  23096. * @inheritDoc
  23097. */
  23098. _validate() {
  23099. const sourceElement = this.sourcePosition.parent;
  23100. const targetElement = this.targetPosition.parent;
  23101. // Validate whether merge operation has correct parameters.
  23102. if ( !sourceElement.parent ) {
  23103. /**
  23104. * Merge source position is invalid. The element to be merged must have a parent node.
  23105. *
  23106. * @error merge-operation-source-position-invalid
  23107. */
  23108. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'merge-operation-source-position-invalid', this );
  23109. } else if ( !targetElement.parent ) {
  23110. /**
  23111. * Merge target position is invalid. The element to be merged must have a parent node.
  23112. *
  23113. * @error merge-operation-target-position-invalid
  23114. */
  23115. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'merge-operation-target-position-invalid', this );
  23116. } else if ( this.howMany != sourceElement.maxOffset ) {
  23117. /**
  23118. * Merge operation specifies wrong number of nodes to move.
  23119. *
  23120. * @error merge-operation-how-many-invalid
  23121. */
  23122. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'merge-operation-how-many-invalid', this );
  23123. }
  23124. }
  23125. /**
  23126. * @inheritDoc
  23127. */
  23128. _execute() {
  23129. const mergedElement = this.sourcePosition.parent;
  23130. const sourceRange = _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( mergedElement );
  23131. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_move"])( sourceRange, this.targetPosition );
  23132. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_move"])( _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createOn( mergedElement ), this.graveyardPosition );
  23133. }
  23134. /**
  23135. * @inheritDoc
  23136. */
  23137. toJSON() {
  23138. const json = super.toJSON();
  23139. json.sourcePosition = json.sourcePosition.toJSON();
  23140. json.targetPosition = json.targetPosition.toJSON();
  23141. json.graveyardPosition = json.graveyardPosition.toJSON();
  23142. return json;
  23143. }
  23144. /**
  23145. * @inheritDoc
  23146. */
  23147. static get className() {
  23148. return 'MergeOperation';
  23149. }
  23150. /**
  23151. * Creates `MergeOperation` object from deserilized object, i.e. from parsed JSON string.
  23152. *
  23153. * @param {Object} json Deserialized JSON object.
  23154. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  23155. * @returns {module:engine/model/operation/mergeoperation~MergeOperation}
  23156. */
  23157. static fromJSON( json, document ) {
  23158. const sourcePosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.sourcePosition, document );
  23159. const targetPosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.targetPosition, document );
  23160. const graveyardPosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.graveyardPosition, document );
  23161. return new this( sourcePosition, json.howMany, targetPosition, graveyardPosition, json.baseVersion );
  23162. }
  23163. // @if CK_DEBUG_ENGINE // toString() {
  23164. // @if CK_DEBUG_ENGINE // return `MergeOperation( ${ this.baseVersion } ): ` +
  23165. // @if CK_DEBUG_ENGINE // `${ this.sourcePosition } -> ${ this.targetPosition }` +
  23166. // @if CK_DEBUG_ENGINE // ` ( ${ this.howMany } ), ${ this.graveyardPosition }`;
  23167. // @if CK_DEBUG_ENGINE // }
  23168. }
  23169. /***/ }),
  23170. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js":
  23171. /*!**************************************************************************************!*\
  23172. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js ***!
  23173. \**************************************************************************************/
  23174. /*! exports provided: default */
  23175. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23176. "use strict";
  23177. __webpack_require__.r(__webpack_exports__);
  23178. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MoveOperation; });
  23179. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  23180. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  23181. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  23182. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  23183. /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
  23184. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  23185. /**
  23186. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  23187. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  23188. */
  23189. /**
  23190. * @module engine/model/operation/moveoperation
  23191. */
  23192. // @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;
  23193. /**
  23194. * Operation to move a range of {@link module:engine/model/item~Item model items}
  23195. * to given {@link module:engine/model/position~Position target position}.
  23196. *
  23197. * @extends module:engine/model/operation/operation~Operation
  23198. */
  23199. class MoveOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  23200. /**
  23201. * Creates a move operation.
  23202. *
  23203. * @param {module:engine/model/position~Position} sourcePosition
  23204. * Position before the first {@link module:engine/model/item~Item model item} to move.
  23205. * @param {Number} howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at
  23206. * `sourcePosition` with offset shifted by `howMany`.
  23207. * @param {module:engine/model/position~Position} targetPosition Position at which moved nodes will be inserted.
  23208. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  23209. * can be applied or `null` if the operation operates on detached (non-document) tree.
  23210. */
  23211. constructor( sourcePosition, howMany, targetPosition, baseVersion ) {
  23212. super( baseVersion );
  23213. /**
  23214. * Position before the first {@link module:engine/model/item~Item model item} to move.
  23215. *
  23216. * @member {module:engine/model/position~Position} module:engine/model/operation/moveoperation~MoveOperation#sourcePosition
  23217. */
  23218. this.sourcePosition = sourcePosition.clone();
  23219. // `'toNext'` because `sourcePosition` is a bit like a start of the moved range.
  23220. this.sourcePosition.stickiness = 'toNext';
  23221. /**
  23222. * Offset size of moved range.
  23223. *
  23224. * @member {Number} module:engine/model/operation/moveoperation~MoveOperation#howMany
  23225. */
  23226. this.howMany = howMany;
  23227. /**
  23228. * Position at which moved nodes will be inserted.
  23229. *
  23230. * @member {module:engine/model/position~Position} module:engine/model/operation/moveoperation~MoveOperation#targetPosition
  23231. */
  23232. this.targetPosition = targetPosition.clone();
  23233. this.targetPosition.stickiness = 'toNone';
  23234. }
  23235. /**
  23236. * @inheritDoc
  23237. */
  23238. get type() {
  23239. if ( this.targetPosition.root.rootName == '$graveyard' ) {
  23240. return 'remove';
  23241. } else if ( this.sourcePosition.root.rootName == '$graveyard' ) {
  23242. return 'reinsert';
  23243. }
  23244. return 'move';
  23245. }
  23246. /**
  23247. * Creates and returns an operation that has the same parameters as this operation.
  23248. *
  23249. * @returns {module:engine/model/operation/moveoperation~MoveOperation} Clone of this operation.
  23250. */
  23251. clone() {
  23252. return new this.constructor( this.sourcePosition, this.howMany, this.targetPosition, this.baseVersion );
  23253. }
  23254. /**
  23255. * Returns the start position of the moved range after it got moved. This may be different than
  23256. * {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition} in some cases, i.e. when a range is moved
  23257. * inside the same parent but {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition targetPosition}
  23258. * is after {@link module:engine/model/operation/moveoperation~MoveOperation#sourcePosition sourcePosition}.
  23259. *
  23260. * vv vv
  23261. * abcdefg ===> adefbcg
  23262. * ^ ^
  23263. * targetPos movedRangeStart
  23264. * offset 6 offset 4
  23265. *
  23266. * @returns {module:engine/model/position~Position}
  23267. */
  23268. getMovedRangeStart() {
  23269. return this.targetPosition._getTransformedByDeletion( this.sourcePosition, this.howMany );
  23270. }
  23271. /**
  23272. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  23273. *
  23274. * @returns {module:engine/model/operation/moveoperation~MoveOperation}
  23275. */
  23276. getReversed() {
  23277. const newTargetPosition = this.sourcePosition._getTransformedByInsertion( this.targetPosition, this.howMany );
  23278. return new this.constructor( this.getMovedRangeStart(), this.howMany, newTargetPosition, this.baseVersion + 1 );
  23279. }
  23280. /**
  23281. * @inheritDoc
  23282. */
  23283. _validate() {
  23284. const sourceElement = this.sourcePosition.parent;
  23285. const targetElement = this.targetPosition.parent;
  23286. const sourceOffset = this.sourcePosition.offset;
  23287. const targetOffset = this.targetPosition.offset;
  23288. // Validate whether move operation has correct parameters.
  23289. // Validation is pretty complex but move operation is one of the core ways to manipulate the document state.
  23290. // We expect that many errors might be connected with one of scenarios described below.
  23291. if ( sourceOffset + this.howMany > sourceElement.maxOffset ) {
  23292. /**
  23293. * The nodes which should be moved do not exist.
  23294. *
  23295. * @error move-operation-nodes-do-not-exist
  23296. */
  23297. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"](
  23298. 'move-operation-nodes-do-not-exist', this
  23299. );
  23300. } else if ( sourceElement === targetElement && sourceOffset < targetOffset && targetOffset < sourceOffset + this.howMany ) {
  23301. /**
  23302. * Trying to move a range of nodes into the middle of that range.
  23303. *
  23304. * @error move-operation-range-into-itself
  23305. */
  23306. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"](
  23307. 'move-operation-range-into-itself', this
  23308. );
  23309. } else if ( this.sourcePosition.root == this.targetPosition.root ) {
  23310. if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_4__["default"])( this.sourcePosition.getParentPath(), this.targetPosition.getParentPath() ) == 'prefix' ) {
  23311. const i = this.sourcePosition.path.length - 1;
  23312. if ( this.targetPosition.path[ i ] >= sourceOffset && this.targetPosition.path[ i ] < sourceOffset + this.howMany ) {
  23313. /**
  23314. * Trying to move a range of nodes into one of nodes from that range.
  23315. *
  23316. * @error move-operation-node-into-itself
  23317. */
  23318. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"](
  23319. 'move-operation-node-into-itself', this
  23320. );
  23321. }
  23322. }
  23323. }
  23324. }
  23325. /**
  23326. * @inheritDoc
  23327. */
  23328. _execute() {
  23329. Object(_utils__WEBPACK_IMPORTED_MODULE_5__["_move"])( _range__WEBPACK_IMPORTED_MODULE_2__["default"]._createFromPositionAndShift( this.sourcePosition, this.howMany ), this.targetPosition );
  23330. }
  23331. /**
  23332. * @inheritDoc
  23333. */
  23334. toJSON() {
  23335. const json = super.toJSON();
  23336. json.sourcePosition = this.sourcePosition.toJSON();
  23337. json.targetPosition = this.targetPosition.toJSON();
  23338. return json;
  23339. }
  23340. /**
  23341. * @inheritDoc
  23342. */
  23343. static get className() {
  23344. return 'MoveOperation';
  23345. }
  23346. /**
  23347. * Creates `MoveOperation` object from deserilized object, i.e. from parsed JSON string.
  23348. *
  23349. * @param {Object} json Deserialized JSON object.
  23350. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  23351. * @returns {module:engine/model/operation/moveoperation~MoveOperation}
  23352. */
  23353. static fromJSON( json, document ) {
  23354. const sourcePosition = _position__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.sourcePosition, document );
  23355. const targetPosition = _position__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.targetPosition, document );
  23356. return new this( sourcePosition, json.howMany, targetPosition, json.baseVersion );
  23357. }
  23358. // @if CK_DEBUG_ENGINE // toString() {
  23359. // @if CK_DEBUG_ENGINE // const range = ModelRange._createFromPositionAndShift( this.sourcePosition, this.howMany );
  23360. // @if CK_DEBUG_ENGINE // return `MoveOperation( ${ this.baseVersion } ): ${ range } -> ${ this.targetPosition }`;
  23361. // @if CK_DEBUG_ENGINE // }
  23362. }
  23363. /***/ }),
  23364. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js":
  23365. /*!************************************************************************************!*\
  23366. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js ***!
  23367. \************************************************************************************/
  23368. /*! exports provided: default */
  23369. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23370. "use strict";
  23371. __webpack_require__.r(__webpack_exports__);
  23372. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return NoOperation; });
  23373. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  23374. /**
  23375. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  23376. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  23377. */
  23378. /**
  23379. * @module engine/model/operation/nooperation
  23380. */
  23381. /**
  23382. * Operation which is doing nothing ("empty operation", "do-nothing operation", "noop"). This is an operation,
  23383. * which when executed does not change the tree model. It still has some parameters defined for transformation purposes.
  23384. *
  23385. * In most cases this operation is a result of transforming operations. When transformation returns
  23386. * {@link module:engine/model/operation/nooperation~NoOperation} it means that changes done by the transformed operation
  23387. * have already been applied.
  23388. *
  23389. * @extends module:engine/model/operation/operation~Operation
  23390. */
  23391. class NoOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  23392. get type() {
  23393. return 'noop';
  23394. }
  23395. /**
  23396. * Creates and returns an operation that has the same parameters as this operation.
  23397. *
  23398. * @returns {module:engine/model/operation/nooperation~NoOperation} Clone of this operation.
  23399. */
  23400. clone() {
  23401. return new NoOperation( this.baseVersion );
  23402. }
  23403. /**
  23404. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  23405. *
  23406. * @returns {module:engine/model/operation/nooperation~NoOperation}
  23407. */
  23408. getReversed() {
  23409. return new NoOperation( this.baseVersion + 1 );
  23410. }
  23411. _execute() {
  23412. }
  23413. /**
  23414. * @inheritDoc
  23415. */
  23416. static get className() {
  23417. return 'NoOperation';
  23418. }
  23419. // @if CK_DEBUG_ENGINE // toString() {
  23420. // @if CK_DEBUG_ENGINE // return `NoOperation( ${ this.baseVersion } )`;
  23421. // @if CK_DEBUG_ENGINE // }
  23422. }
  23423. /***/ }),
  23424. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js":
  23425. /*!**********************************************************************************!*\
  23426. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js ***!
  23427. \**********************************************************************************/
  23428. /*! exports provided: default */
  23429. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23430. "use strict";
  23431. __webpack_require__.r(__webpack_exports__);
  23432. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Operation; });
  23433. /**
  23434. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  23435. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  23436. */
  23437. /**
  23438. * @module engine/model/operation/operation
  23439. */
  23440. /**
  23441. * Abstract base operation class.
  23442. *
  23443. * @abstract
  23444. */
  23445. class Operation {
  23446. /**
  23447. * Base operation constructor.
  23448. *
  23449. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  23450. * can be applied or `null` if the operation operates on detached (non-document) tree.
  23451. */
  23452. constructor( baseVersion ) {
  23453. /**
  23454. * {@link module:engine/model/document~Document#version} on which operation can be applied. If you try to
  23455. * {@link module:engine/model/model~Model#applyOperation apply} operation with different base version than the
  23456. * {@link module:engine/model/document~Document#version document version} the
  23457. * {@link module:utils/ckeditorerror~CKEditorError model-document-applyOperation-wrong-version} error is thrown.
  23458. *
  23459. * @member {Number}
  23460. */
  23461. this.baseVersion = baseVersion;
  23462. /**
  23463. * Defines whether operation is executed on attached or detached {@link module:engine/model/item~Item items}.
  23464. *
  23465. * @readonly
  23466. * @member {Boolean} #isDocumentOperation
  23467. */
  23468. this.isDocumentOperation = this.baseVersion !== null;
  23469. /**
  23470. * {@link module:engine/model/batch~Batch Batch} to which the operation is added or `null` if the operation is not
  23471. * added to any batch yet.
  23472. *
  23473. * @member {module:engine/model/batch~Batch|null} #batch
  23474. */
  23475. this.batch = null;
  23476. /**
  23477. * Operation type.
  23478. *
  23479. * @readonly
  23480. * @member {String} #type
  23481. */
  23482. /**
  23483. * Creates and returns an operation that has the same parameters as this operation.
  23484. *
  23485. * @method #clone
  23486. * @returns {module:engine/model/operation/operation~Operation} Clone of this operation.
  23487. */
  23488. /**
  23489. * Creates and returns a reverse operation. Reverse operation when executed right after
  23490. * the original operation will bring back tree model state to the point before the original
  23491. * operation execution. In other words, it reverses changes done by the original operation.
  23492. *
  23493. * Keep in mind that tree model state may change since executing the original operation,
  23494. * so reverse operation will be "outdated". In that case you will need to transform it by
  23495. * all operations that were executed after the original operation.
  23496. *
  23497. * @method #getReversed
  23498. * @returns {module:engine/model/operation/operation~Operation} Reversed operation.
  23499. */
  23500. /**
  23501. * Executes the operation - modifications described by the operation properties will be applied to the model tree.
  23502. *
  23503. * @protected
  23504. * @method #_execute
  23505. */
  23506. }
  23507. /**
  23508. * Checks whether the operation's parameters are correct and the operation can be correctly executed. Throws
  23509. * an error if operation is not valid.
  23510. *
  23511. * @protected
  23512. * @method #_validate
  23513. */
  23514. _validate() {
  23515. }
  23516. /**
  23517. * Custom toJSON method to solve child-parent circular dependencies.
  23518. *
  23519. * @method #toJSON
  23520. * @returns {Object} Clone of this object with the operation property replaced with string.
  23521. */
  23522. toJSON() {
  23523. // This method creates only a shallow copy, all nested objects should be defined separately.
  23524. // See https://github.com/ckeditor/ckeditor5-engine/issues/1477.
  23525. const json = Object.assign( {}, this );
  23526. json.__className = this.constructor.className;
  23527. // Remove reference to the parent `Batch` to avoid circular dependencies.
  23528. delete json.batch;
  23529. // Only document operations are shared with other clients so it is not necessary to keep this information.
  23530. delete json.isDocumentOperation;
  23531. return json;
  23532. }
  23533. /**
  23534. * Name of the operation class used for serialization.
  23535. *
  23536. * @type {String}
  23537. */
  23538. static get className() {
  23539. return 'Operation';
  23540. }
  23541. /**
  23542. * Creates Operation object from deserilized object, i.e. from parsed JSON string.
  23543. *
  23544. * @param {Object} json Deserialized JSON object.
  23545. * @param {module:engine/model/document~Document} doc Document on which this operation will be applied.
  23546. * @returns {module:engine/model/operation/operation~Operation}
  23547. */
  23548. static fromJSON( json ) {
  23549. return new this( json.baseVersion );
  23550. }
  23551. // @if CK_DEBUG_ENGINE // log() {
  23552. // @if CK_DEBUG_ENGINE // console.log( this.toString() );
  23553. // @if CK_DEBUG_ENGINE // }
  23554. }
  23555. /***/ }),
  23556. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js":
  23557. /*!*****************************************************************************************!*\
  23558. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js ***!
  23559. \*****************************************************************************************/
  23560. /*! exports provided: default */
  23561. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23562. "use strict";
  23563. __webpack_require__.r(__webpack_exports__);
  23564. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return OperationFactory; });
  23565. /* harmony import */ var _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../operation/attributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js");
  23566. /* harmony import */ var _operation_insertoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../operation/insertoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js");
  23567. /* harmony import */ var _operation_markeroperation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operation/markeroperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js");
  23568. /* harmony import */ var _operation_moveoperation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../operation/moveoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js");
  23569. /* harmony import */ var _operation_nooperation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../operation/nooperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js");
  23570. /* harmony import */ var _operation_operation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../operation/operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  23571. /* harmony import */ var _operation_renameoperation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../operation/renameoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js");
  23572. /* harmony import */ var _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../operation/rootattributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js");
  23573. /* harmony import */ var _operation_splitoperation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../operation/splitoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js");
  23574. /* harmony import */ var _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../operation/mergeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js");
  23575. /**
  23576. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  23577. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  23578. */
  23579. /**
  23580. * @module engine/model/operation/operationfactory
  23581. */
  23582. const operations = {};
  23583. operations[ _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__["default"].className ] = _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__["default"];
  23584. operations[ _operation_insertoperation__WEBPACK_IMPORTED_MODULE_1__["default"].className ] = _operation_insertoperation__WEBPACK_IMPORTED_MODULE_1__["default"];
  23585. operations[ _operation_markeroperation__WEBPACK_IMPORTED_MODULE_2__["default"].className ] = _operation_markeroperation__WEBPACK_IMPORTED_MODULE_2__["default"];
  23586. operations[ _operation_moveoperation__WEBPACK_IMPORTED_MODULE_3__["default"].className ] = _operation_moveoperation__WEBPACK_IMPORTED_MODULE_3__["default"];
  23587. operations[ _operation_nooperation__WEBPACK_IMPORTED_MODULE_4__["default"].className ] = _operation_nooperation__WEBPACK_IMPORTED_MODULE_4__["default"];
  23588. operations[ _operation_operation__WEBPACK_IMPORTED_MODULE_5__["default"].className ] = _operation_operation__WEBPACK_IMPORTED_MODULE_5__["default"];
  23589. operations[ _operation_renameoperation__WEBPACK_IMPORTED_MODULE_6__["default"].className ] = _operation_renameoperation__WEBPACK_IMPORTED_MODULE_6__["default"];
  23590. operations[ _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_7__["default"].className ] = _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_7__["default"];
  23591. operations[ _operation_splitoperation__WEBPACK_IMPORTED_MODULE_8__["default"].className ] = _operation_splitoperation__WEBPACK_IMPORTED_MODULE_8__["default"];
  23592. operations[ _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_9__["default"].className ] = _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_9__["default"];
  23593. /**
  23594. * A factory class for creating operations.
  23595. *
  23596. * @abstract
  23597. */
  23598. class OperationFactory {
  23599. /**
  23600. * Creates an operation instance from a JSON object (parsed JSON string).
  23601. *
  23602. * @param {Object} json Deserialized JSON object.
  23603. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  23604. * @returns {module:engine/model/operation/operation~Operation}
  23605. */
  23606. static fromJSON( json, document ) {
  23607. return operations[ json.__className ].fromJSON( json, document );
  23608. }
  23609. }
  23610. /***/ }),
  23611. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js":
  23612. /*!****************************************************************************************!*\
  23613. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js ***!
  23614. \****************************************************************************************/
  23615. /*! exports provided: default */
  23616. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23617. "use strict";
  23618. __webpack_require__.r(__webpack_exports__);
  23619. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RenameOperation; });
  23620. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  23621. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  23622. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  23623. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  23624. /**
  23625. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  23626. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  23627. */
  23628. /**
  23629. * @module engine/model/operation/renameoperation
  23630. */
  23631. /**
  23632. * Operation to change element's name.
  23633. *
  23634. * Using this class you can change element's name.
  23635. *
  23636. * @extends module:engine/model/operation/operation~Operation
  23637. */
  23638. class RenameOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  23639. /**
  23640. * Creates an operation that changes element's name.
  23641. *
  23642. * @param {module:engine/model/position~Position} position Position before an element to change.
  23643. * @param {String} oldName Current name of the element.
  23644. * @param {String} newName New name for the element.
  23645. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  23646. * can be applied or `null` if the operation operates on detached (non-document) tree.
  23647. */
  23648. constructor( position, oldName, newName, baseVersion ) {
  23649. super( baseVersion );
  23650. /**
  23651. * Position before an element to change.
  23652. *
  23653. * @member {module:engine/model/position~Position} module:engine/model/operation/renameoperation~RenameOperation#position
  23654. */
  23655. this.position = position;
  23656. // This position sticks to the next node because it is a position before the node that we want to change.
  23657. this.position.stickiness = 'toNext';
  23658. /**
  23659. * Current name of the element.
  23660. *
  23661. * @member {String} module:engine/model/operation/renameoperation~RenameOperation#oldName
  23662. */
  23663. this.oldName = oldName;
  23664. /**
  23665. * New name for the element.
  23666. *
  23667. * @member {String} module:engine/model/operation/renameoperation~RenameOperation#newName
  23668. */
  23669. this.newName = newName;
  23670. }
  23671. /**
  23672. * @inheritDoc
  23673. */
  23674. get type() {
  23675. return 'rename';
  23676. }
  23677. /**
  23678. * Creates and returns an operation that has the same parameters as this operation.
  23679. *
  23680. * @returns {module:engine/model/operation/renameoperation~RenameOperation} Clone of this operation.
  23681. */
  23682. clone() {
  23683. return new RenameOperation( this.position.clone(), this.oldName, this.newName, this.baseVersion );
  23684. }
  23685. /**
  23686. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  23687. *
  23688. * @returns {module:engine/model/operation/renameoperation~RenameOperation}
  23689. */
  23690. getReversed() {
  23691. return new RenameOperation( this.position.clone(), this.newName, this.oldName, this.baseVersion + 1 );
  23692. }
  23693. /**
  23694. * @inheritDoc
  23695. */
  23696. _validate() {
  23697. const element = this.position.nodeAfter;
  23698. if ( !( element instanceof _element__WEBPACK_IMPORTED_MODULE_1__["default"] ) ) {
  23699. /**
  23700. * Given position is invalid or node after it is not instance of Element.
  23701. *
  23702. * @error rename-operation-wrong-position
  23703. */
  23704. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  23705. 'rename-operation-wrong-position',
  23706. this
  23707. );
  23708. } else if ( element.name !== this.oldName ) {
  23709. /**
  23710. * Element to change has different name than operation's old name.
  23711. *
  23712. * @error rename-operation-wrong-name
  23713. */
  23714. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  23715. 'rename-operation-wrong-name',
  23716. this
  23717. );
  23718. }
  23719. }
  23720. /**
  23721. * @inheritDoc
  23722. */
  23723. _execute() {
  23724. const element = this.position.nodeAfter;
  23725. element.name = this.newName;
  23726. }
  23727. /**
  23728. * @inheritDoc
  23729. */
  23730. toJSON() {
  23731. const json = super.toJSON();
  23732. json.position = this.position.toJSON();
  23733. return json;
  23734. }
  23735. /**
  23736. * @inheritDoc
  23737. */
  23738. static get className() {
  23739. return 'RenameOperation';
  23740. }
  23741. /**
  23742. * Creates `RenameOperation` object from deserialized object, i.e. from parsed JSON string.
  23743. *
  23744. * @param {Object} json Deserialized JSON object.
  23745. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  23746. * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}
  23747. */
  23748. static fromJSON( json, document ) {
  23749. return new RenameOperation( _position__WEBPACK_IMPORTED_MODULE_3__["default"].fromJSON( json.position, document ), json.oldName, json.newName, json.baseVersion );
  23750. }
  23751. // @if CK_DEBUG_ENGINE // toString() {
  23752. // @if CK_DEBUG_ENGINE // return `RenameOperation( ${ this.baseVersion } ): ` +
  23753. // @if CK_DEBUG_ENGINE // `${ this.position }: "${ this.oldName }" -> "${ this.newName }"`;
  23754. // @if CK_DEBUG_ENGINE // }
  23755. }
  23756. /***/ }),
  23757. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js":
  23758. /*!***********************************************************************************************!*\
  23759. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js ***!
  23760. \***********************************************************************************************/
  23761. /*! exports provided: default */
  23762. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23763. "use strict";
  23764. __webpack_require__.r(__webpack_exports__);
  23765. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RootAttributeOperation; });
  23766. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  23767. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  23768. /**
  23769. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  23770. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  23771. */
  23772. /**
  23773. * @module engine/model/operation/rootattributeoperation
  23774. */
  23775. /**
  23776. * Operation to change root element's attribute. Using this class you can add, remove or change value of the attribute.
  23777. *
  23778. * This operation is needed, because root elements can't be changed through
  23779. * @link module:engine/model/operation/attributeoperation~AttributeOperation}.
  23780. * It is because {@link module:engine/model/operation/attributeoperation~AttributeOperation}
  23781. * requires a range to change and root element can't
  23782. * be a part of range because every {@link module:engine/model/position~Position} has to be inside a root.
  23783. * {@link module:engine/model/position~Position} can't be created before a root element.
  23784. *
  23785. * @extends module:engine/model/operation/operation~Operation
  23786. */
  23787. class RootAttributeOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  23788. /**
  23789. * Creates an operation that changes, removes or adds attributes on root element.
  23790. *
  23791. * @see module:engine/model/operation/attributeoperation~AttributeOperation
  23792. * @param {module:engine/model/rootelement~RootElement} root Root element to change.
  23793. * @param {String} key Key of an attribute to change or remove.
  23794. * @param {*} oldValue Old value of the attribute with given key or `null` if adding a new attribute.
  23795. * @param {*} newValue New value to set for the attribute. If `null`, then the operation just removes the attribute.
  23796. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  23797. * can be applied or `null` if the operation operates on detached (non-document) tree.
  23798. */
  23799. constructor( root, key, oldValue, newValue, baseVersion ) {
  23800. super( baseVersion );
  23801. /**
  23802. * Root element to change.
  23803. *
  23804. * @readonly
  23805. * @member {module:engine/model/rootelement~RootElement}
  23806. */
  23807. this.root = root;
  23808. /**
  23809. * Key of an attribute to change or remove.
  23810. *
  23811. * @readonly
  23812. * @member {String}
  23813. */
  23814. this.key = key;
  23815. /**
  23816. * Old value of the attribute with given key or `null` if adding a new attribute.
  23817. *
  23818. * @readonly
  23819. * @member {*}
  23820. */
  23821. this.oldValue = oldValue;
  23822. /**
  23823. * New value to set for the attribute. If `null`, then the operation just removes the attribute.
  23824. *
  23825. * @readonly
  23826. * @member {*}
  23827. */
  23828. this.newValue = newValue;
  23829. }
  23830. /**
  23831. * @inheritDoc
  23832. */
  23833. get type() {
  23834. if ( this.oldValue === null ) {
  23835. return 'addRootAttribute';
  23836. } else if ( this.newValue === null ) {
  23837. return 'removeRootAttribute';
  23838. } else {
  23839. return 'changeRootAttribute';
  23840. }
  23841. }
  23842. /**
  23843. * Creates and returns an operation that has the same parameters as this operation.
  23844. *
  23845. * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation} Clone of this operation.
  23846. */
  23847. clone() {
  23848. return new RootAttributeOperation( this.root, this.key, this.oldValue, this.newValue, this.baseVersion );
  23849. }
  23850. /**
  23851. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  23852. *
  23853. * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation}
  23854. */
  23855. getReversed() {
  23856. return new RootAttributeOperation( this.root, this.key, this.newValue, this.oldValue, this.baseVersion + 1 );
  23857. }
  23858. /**
  23859. * @inheritDoc
  23860. */
  23861. _validate() {
  23862. if ( this.root != this.root.root || this.root.is( 'documentFragment' ) ) {
  23863. /**
  23864. * The element to change is not a root element.
  23865. *
  23866. * @error rootattribute-operation-not-a-root
  23867. * @param {module:engine/model/rootelement~RootElement} root
  23868. * @param {String} key
  23869. * @param {*} value
  23870. */
  23871. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  23872. 'rootattribute-operation-not-a-root',
  23873. this,
  23874. { root: this.root, key: this.key }
  23875. );
  23876. }
  23877. if ( this.oldValue !== null && this.root.getAttribute( this.key ) !== this.oldValue ) {
  23878. /**
  23879. * The attribute which should be removed does not exists for the given node.
  23880. *
  23881. * @error rootattribute-operation-wrong-old-value
  23882. * @param {module:engine/model/rootelement~RootElement} root
  23883. * @param {String} key
  23884. * @param {*} value
  23885. */
  23886. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  23887. 'rootattribute-operation-wrong-old-value',
  23888. this,
  23889. { root: this.root, key: this.key }
  23890. );
  23891. }
  23892. if ( this.oldValue === null && this.newValue !== null && this.root.hasAttribute( this.key ) ) {
  23893. /**
  23894. * The attribute with given key already exists for the given node.
  23895. *
  23896. * @error rootattribute-operation-attribute-exists
  23897. * @param {module:engine/model/rootelement~RootElement} root
  23898. * @param {String} key
  23899. */
  23900. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  23901. 'rootattribute-operation-attribute-exists',
  23902. this,
  23903. { root: this.root, key: this.key }
  23904. );
  23905. }
  23906. }
  23907. /**
  23908. * @inheritDoc
  23909. */
  23910. _execute() {
  23911. if ( this.newValue !== null ) {
  23912. this.root._setAttribute( this.key, this.newValue );
  23913. } else {
  23914. this.root._removeAttribute( this.key );
  23915. }
  23916. }
  23917. /**
  23918. * @inheritDoc
  23919. */
  23920. toJSON() {
  23921. const json = super.toJSON();
  23922. json.root = this.root.toJSON();
  23923. return json;
  23924. }
  23925. /**
  23926. * @inheritDoc
  23927. */
  23928. static get className() {
  23929. return 'RootAttributeOperation';
  23930. }
  23931. /**
  23932. * Creates RootAttributeOperation object from deserilized object, i.e. from parsed JSON string.
  23933. *
  23934. * @param {Object} json Deserialized JSON object.
  23935. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  23936. * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation}
  23937. */
  23938. static fromJSON( json, document ) {
  23939. if ( !document.getRoot( json.root ) ) {
  23940. /**
  23941. * Cannot create RootAttributeOperation for document. Root with specified name does not exist.
  23942. *
  23943. * @error rootattribute-operation-fromjson-no-root
  23944. * @param {String} rootName
  23945. */
  23946. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'rootattribute-operation-fromjson-no-root', this, { rootName: json.root } );
  23947. }
  23948. return new RootAttributeOperation( document.getRoot( json.root ), json.key, json.oldValue, json.newValue, json.baseVersion );
  23949. }
  23950. // @if CK_DEBUG_ENGINE // toString() {
  23951. // @if CK_DEBUG_ENGINE // return `RootAttributeOperation( ${ this.baseVersion } ): ` +
  23952. // @if CK_DEBUG_ENGINE // `"${ this.key }": ${ JSON.stringify( this.oldValue ) }` +
  23953. // @if CK_DEBUG_ENGINE // ` -> ${ JSON.stringify( this.newValue ) }, ${ this.root.rootName }`;
  23954. // @if CK_DEBUG_ENGINE // }
  23955. }
  23956. /***/ }),
  23957. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js":
  23958. /*!***************************************************************************************!*\
  23959. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js ***!
  23960. \***************************************************************************************/
  23961. /*! exports provided: default */
  23962. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23963. "use strict";
  23964. __webpack_require__.r(__webpack_exports__);
  23965. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SplitOperation; });
  23966. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  23967. /* harmony import */ var _mergeoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mergeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js");
  23968. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  23969. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  23970. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  23971. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  23972. /**
  23973. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  23974. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  23975. */
  23976. /**
  23977. * @module engine/model/operation/splitoperation
  23978. */
  23979. /**
  23980. * Operation to split {@link module:engine/model/element~Element an element} at given
  23981. * {@link module:engine/model/operation/splitoperation~SplitOperation#splitPosition split position} into two elements,
  23982. * both containing a part of the element's original content.
  23983. *
  23984. * @extends module:engine/model/operation/operation~Operation
  23985. */
  23986. class SplitOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  23987. /**
  23988. * Creates a split operation.
  23989. *
  23990. * @param {module:engine/model/position~Position} splitPosition Position at which an element should be split.
  23991. * @param {Number} howMany Total offset size of elements that are in the split element after `position`.
  23992. * @param {module:engine/model/position~Position} insertionPosition Position at which the clone of split element
  23993. * (or element from graveyard) will be inserted.
  23994. * @param {module:engine/model/position~Position|null} graveyardPosition Position in the graveyard root before the element which
  23995. * should be used as a parent of the nodes after `position`. If it is not set, a copy of the the `position` parent will be used.
  23996. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  23997. * can be applied or `null` if the operation operates on detached (non-document) tree.
  23998. */
  23999. constructor( splitPosition, howMany, insertionPosition, graveyardPosition, baseVersion ) {
  24000. super( baseVersion );
  24001. /**
  24002. * Position at which an element should be split.
  24003. *
  24004. * @member {module:engine/model/position~Position} module:engine/model/operation/splitoperation~SplitOperation#splitPosition
  24005. */
  24006. this.splitPosition = splitPosition.clone();
  24007. // Keep position sticking to the next node. This way any new content added at the place where the element is split
  24008. // will be left in the original element.
  24009. this.splitPosition.stickiness = 'toNext';
  24010. /**
  24011. * Total offset size of elements that are in the split element after `position`.
  24012. *
  24013. * @member {Number} module:engine/model/operation/splitoperation~SplitOperation#howMany
  24014. */
  24015. this.howMany = howMany;
  24016. /**
  24017. * Position at which the clone of split element (or element from graveyard) will be inserted.
  24018. *
  24019. * @member {module:engine/model/position~Position} module:engine/model/operation/splitoperation~SplitOperation#insertionPosition
  24020. */
  24021. this.insertionPosition = insertionPosition;
  24022. /**
  24023. * Position in the graveyard root before the element which should be used as a parent of the nodes after `position`.
  24024. * If it is not set, a copy of the the `position` parent will be used.
  24025. *
  24026. * The default behavior is to clone the split element. Element from graveyard is used during undo.
  24027. *
  24028. * @member {module:engine/model/position~Position|null} #graveyardPosition
  24029. */
  24030. this.graveyardPosition = graveyardPosition ? graveyardPosition.clone() : null;
  24031. if ( this.graveyardPosition ) {
  24032. this.graveyardPosition.stickiness = 'toNext';
  24033. }
  24034. }
  24035. /**
  24036. * @inheritDoc
  24037. */
  24038. get type() {
  24039. return 'split';
  24040. }
  24041. /**
  24042. * Position inside the new clone of a split element.
  24043. *
  24044. * This is a position where nodes that are after the split position will be moved to.
  24045. *
  24046. * @readonly
  24047. * @type {module:engine/model/position~Position}
  24048. */
  24049. get moveTargetPosition() {
  24050. const path = this.insertionPosition.path.slice();
  24051. path.push( 0 );
  24052. return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( this.insertionPosition.root, path );
  24053. }
  24054. /**
  24055. * Artificial range that contains all the nodes from the split element that will be moved to the new element.
  24056. * The range starts at {@link ~#splitPosition} and ends in the same parent, at `POSITIVE_INFINITY` offset.
  24057. *
  24058. * @readonly
  24059. * @type {module:engine/model/range~Range}
  24060. */
  24061. get movedRange() {
  24062. const end = this.splitPosition.getShiftedBy( Number.POSITIVE_INFINITY );
  24063. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( this.splitPosition, end );
  24064. }
  24065. /**
  24066. * Creates and returns an operation that has the same parameters as this operation.
  24067. *
  24068. * @returns {module:engine/model/operation/splitoperation~SplitOperation} Clone of this operation.
  24069. */
  24070. clone() {
  24071. return new this.constructor( this.splitPosition, this.howMany, this.insertionPosition, this.graveyardPosition, this.baseVersion );
  24072. }
  24073. /**
  24074. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  24075. *
  24076. * @returns {module:engine/model/operation/mergeoperation~MergeOperation}
  24077. */
  24078. getReversed() {
  24079. const graveyard = this.splitPosition.root.document.graveyard;
  24080. const graveyardPosition = new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( graveyard, [ 0 ] );
  24081. return new _mergeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( this.moveTargetPosition, this.howMany, this.splitPosition, graveyardPosition, this.baseVersion + 1 );
  24082. }
  24083. /**
  24084. * @inheritDoc
  24085. */
  24086. _validate() {
  24087. const element = this.splitPosition.parent;
  24088. const offset = this.splitPosition.offset;
  24089. // Validate whether split operation has correct parameters.
  24090. if ( !element || element.maxOffset < offset ) {
  24091. /**
  24092. * Split position is invalid.
  24093. *
  24094. * @error split-operation-position-invalid
  24095. */
  24096. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'split-operation-position-invalid', this );
  24097. } else if ( !element.parent ) {
  24098. /**
  24099. * Cannot split root element.
  24100. *
  24101. * @error split-operation-split-in-root
  24102. */
  24103. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'split-operation-split-in-root', this );
  24104. } else if ( this.howMany != element.maxOffset - this.splitPosition.offset ) {
  24105. /**
  24106. * Split operation specifies wrong number of nodes to move.
  24107. *
  24108. * @error split-operation-how-many-invalid
  24109. */
  24110. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'split-operation-how-many-invalid', this );
  24111. } else if ( this.graveyardPosition && !this.graveyardPosition.nodeAfter ) {
  24112. /**
  24113. * Graveyard position invalid.
  24114. *
  24115. * @error split-operation-graveyard-position-invalid
  24116. */
  24117. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'split-operation-graveyard-position-invalid', this );
  24118. }
  24119. }
  24120. /**
  24121. * @inheritDoc
  24122. */
  24123. _execute() {
  24124. const splitElement = this.splitPosition.parent;
  24125. if ( this.graveyardPosition ) {
  24126. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_move"])( _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createFromPositionAndShift( this.graveyardPosition, 1 ), this.insertionPosition );
  24127. } else {
  24128. const newElement = splitElement._clone();
  24129. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_insert"])( this.insertionPosition, newElement );
  24130. }
  24131. const sourceRange = new _range__WEBPACK_IMPORTED_MODULE_3__["default"](
  24132. _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( splitElement, this.splitPosition.offset ),
  24133. _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( splitElement, splitElement.maxOffset )
  24134. );
  24135. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_move"])( sourceRange, this.moveTargetPosition );
  24136. }
  24137. /**
  24138. * @inheritDoc
  24139. */
  24140. toJSON() {
  24141. const json = super.toJSON();
  24142. json.splitPosition = this.splitPosition.toJSON();
  24143. json.insertionPosition = this.insertionPosition.toJSON();
  24144. if ( this.graveyardPosition ) {
  24145. json.graveyardPosition = this.graveyardPosition.toJSON();
  24146. }
  24147. return json;
  24148. }
  24149. /**
  24150. * @inheritDoc
  24151. */
  24152. static get className() {
  24153. return 'SplitOperation';
  24154. }
  24155. /**
  24156. * Helper function that returns a default insertion position basing on given `splitPosition`. The default insertion
  24157. * position is after the split element.
  24158. *
  24159. * @param {module:engine/model/position~Position} splitPosition
  24160. * @returns {module:engine/model/position~Position}
  24161. */
  24162. static getInsertionPosition( splitPosition ) {
  24163. const path = splitPosition.path.slice( 0, -1 );
  24164. path[ path.length - 1 ]++;
  24165. return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( splitPosition.root, path, 'toPrevious' );
  24166. }
  24167. /**
  24168. * Creates `SplitOperation` object from deserilized object, i.e. from parsed JSON string.
  24169. *
  24170. * @param {Object} json Deserialized JSON object.
  24171. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  24172. * @returns {module:engine/model/operation/splitoperation~SplitOperation}
  24173. */
  24174. static fromJSON( json, document ) {
  24175. const splitPosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.splitPosition, document );
  24176. const insertionPosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.insertionPosition, document );
  24177. const graveyardPosition = json.graveyardPosition ? _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.graveyardPosition, document ) : null;
  24178. return new this( splitPosition, json.howMany, insertionPosition, graveyardPosition, json.baseVersion );
  24179. }
  24180. // @if CK_DEBUG_ENGINE // toString() {
  24181. // @if CK_DEBUG_ENGINE // return `SplitOperation( ${ this.baseVersion } ): ${ this.splitPosition } ` +
  24182. // @if CK_DEBUG_ENGINE // `( ${ this.howMany } ) -> ${ this.insertionPosition }` +
  24183. // @if CK_DEBUG_ENGINE // `${ this.graveyardPosition ? ' with ' + this.graveyardPosition : '' }`;
  24184. // @if CK_DEBUG_ENGINE // }
  24185. }
  24186. /***/ }),
  24187. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.js":
  24188. /*!**********************************************************************************!*\
  24189. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.js ***!
  24190. \**********************************************************************************/
  24191. /*! exports provided: transform, transformSets */
  24192. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  24193. "use strict";
  24194. __webpack_require__.r(__webpack_exports__);
  24195. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transform", function() { return transform; });
  24196. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformSets", function() { return transformSets; });
  24197. /* harmony import */ var _insertoperation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./insertoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js");
  24198. /* harmony import */ var _attributeoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./attributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js");
  24199. /* harmony import */ var _renameoperation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./renameoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js");
  24200. /* harmony import */ var _markeroperation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./markeroperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js");
  24201. /* harmony import */ var _moveoperation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./moveoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js");
  24202. /* harmony import */ var _rootattributeoperation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./rootattributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js");
  24203. /* harmony import */ var _mergeoperation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mergeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js");
  24204. /* harmony import */ var _splitoperation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./splitoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js");
  24205. /* harmony import */ var _nooperation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./nooperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js");
  24206. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  24207. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  24208. /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
  24209. /**
  24210. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  24211. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  24212. */
  24213. const transformations = new Map();
  24214. /**
  24215. * @module engine/model/operation/transform
  24216. */
  24217. /**
  24218. * Sets a transformation function to be be used to transform instances of class `OperationA` by instances of class `OperationB`.
  24219. *
  24220. * The `transformationFunction` is passed three parameters:
  24221. *
  24222. * * `a` - operation to be transformed, an instance of `OperationA`,
  24223. * * `b` - operation to be transformed by, an instance of `OperationB`,
  24224. * * {@link module:engine/model/operation/transform~TransformationContext `context`} - object with additional information about
  24225. * transformation context.
  24226. *
  24227. * The `transformationFunction` should return transformation result, which is an array with one or multiple
  24228. * {@link module:engine/model/operation/operation~Operation operation} instances.
  24229. *
  24230. * @protected
  24231. * @param {Function} OperationA
  24232. * @param {Function} OperationB
  24233. * @param {Function} transformationFunction Function to use for transforming.
  24234. */
  24235. function setTransformation( OperationA, OperationB, transformationFunction ) {
  24236. let aGroup = transformations.get( OperationA );
  24237. if ( !aGroup ) {
  24238. aGroup = new Map();
  24239. transformations.set( OperationA, aGroup );
  24240. }
  24241. aGroup.set( OperationB, transformationFunction );
  24242. }
  24243. /**
  24244. * Returns a previously set transformation function for transforming an instance of `OperationA` by an instance of `OperationB`.
  24245. *
  24246. * If no transformation was set for given pair of operations, {@link module:engine/model/operation/transform~noUpdateTransformation}
  24247. * is returned. This means that if no transformation was set, the `OperationA` instance will not change when transformed
  24248. * by the `OperationB` instance.
  24249. *
  24250. * @private
  24251. * @param {Function} OperationA
  24252. * @param {Function} OperationB
  24253. * @returns {Function} Function set to transform an instance of `OperationA` by an instance of `OperationB`.
  24254. */
  24255. function getTransformation( OperationA, OperationB ) {
  24256. const aGroup = transformations.get( OperationA );
  24257. if ( aGroup && aGroup.has( OperationB ) ) {
  24258. return aGroup.get( OperationB );
  24259. }
  24260. return noUpdateTransformation;
  24261. }
  24262. /**
  24263. * A transformation function that only clones operation to transform, without changing it.
  24264. *
  24265. * @private
  24266. * @param {module:engine/model/operation/operation~Operation} a Operation to transform.
  24267. * @returns {Array.<module:engine/model/operation/operation~Operation>}
  24268. */
  24269. function noUpdateTransformation( a ) {
  24270. return [ a ];
  24271. }
  24272. /**
  24273. * Transforms operation `a` by operation `b`.
  24274. *
  24275. * @param {module:engine/model/operation/operation~Operation} a Operation to be transformed.
  24276. * @param {module:engine/model/operation/operation~Operation} b Operation to transform by.
  24277. * @param {module:engine/model/operation/transform~TransformationContext} context Transformation context for this transformation.
  24278. * @returns {Array.<module:engine/model/operation/operation~Operation>} Transformation result.
  24279. */
  24280. function transform( a, b, context = {} ) {
  24281. const transformationFunction = getTransformation( a.constructor, b.constructor );
  24282. /* eslint-disable no-useless-catch */
  24283. try {
  24284. a = a.clone();
  24285. return transformationFunction( a, b, context );
  24286. } catch ( e ) {
  24287. // @if CK_DEBUG // console.warn( 'Error during operation transformation!', e.message );
  24288. // @if CK_DEBUG // console.warn( 'Transformed operation', a );
  24289. // @if CK_DEBUG // console.warn( 'Operation transformed by', b );
  24290. // @if CK_DEBUG // console.warn( 'context.aIsStrong', context.aIsStrong );
  24291. // @if CK_DEBUG // console.warn( 'context.aWasUndone', context.aWasUndone );
  24292. // @if CK_DEBUG // console.warn( 'context.bWasUndone', context.bWasUndone );
  24293. // @if CK_DEBUG // console.warn( 'context.abRelation', context.abRelation );
  24294. // @if CK_DEBUG // console.warn( 'context.baRelation', context.baRelation );
  24295. throw e;
  24296. }
  24297. /* eslint-enable no-useless-catch */
  24298. }
  24299. /**
  24300. * Performs a transformation of two sets of operations - `operationsA` and `operationsB`. The transformation is two-way -
  24301. * both transformed `operationsA` and transformed `operationsB` are returned.
  24302. *
  24303. * Note, that the first operation in each set should base on the same document state (
  24304. * {@link module:engine/model/document~Document#version document version}).
  24305. *
  24306. * It is assumed that `operationsA` are "more important" during conflict resolution between two operations.
  24307. *
  24308. * New copies of both passed arrays and operations inside them are returned. Passed arguments are not altered.
  24309. *
  24310. * Base versions of the transformed operations sets are updated accordingly. For example, assume that base versions are `4`
  24311. * and there are `3` operations in `operationsA` and `5` operations in `operationsB`. Then:
  24312. *
  24313. * * transformed `operationsA` will start from base version `9` (`4` base version + `5` operations B),
  24314. * * transformed `operationsB` will start from base version `7` (`4` base version + `3` operations A).
  24315. *
  24316. * If no operation was broken into two during transformation, then both sets will end up with an operation that bases on version `11`:
  24317. *
  24318. * * transformed `operationsA` start from `9` and there are `3` of them, so the last will have `baseVersion` equal to `11`,
  24319. * * transformed `operationsB` start from `7` and there are `5` of them, so the last will have `baseVersion` equal to `11`.
  24320. *
  24321. * @param {Array.<module:engine/model/operation/operation~Operation>} operationsA
  24322. * @param {Array.<module:engine/model/operation/operation~Operation>} operationsB
  24323. * @param {Object} options Additional transformation options.
  24324. * @param {module:engine/model/document~Document|null} options.document Document which the operations change.
  24325. * @param {Boolean} [options.useRelations=false] Whether during transformation relations should be used (used during undo for
  24326. * better conflict resolution).
  24327. * @param {Boolean} [options.padWithNoOps=false] Whether additional {@link module:engine/model/operation/nooperation~NoOperation}s
  24328. * should be added to the transformation results to force the same last base version for both transformed sets (in case
  24329. * if some operations got broken into multiple operations during transformation).
  24330. * @returns {Object} Transformation result.
  24331. * @returns {Array.<module:engine/model/operation/operation~Operation>} return.operationsA Transformed `operationsA`.
  24332. * @returns {Array.<module:engine/model/operation/operation~Operation>} return.operationsB Transformed `operationsB`.
  24333. * @returns {Map} return.originalOperations A map that links transformed operations to original operations. The keys are the transformed
  24334. * operations and the values are the original operations from the input (`operationsA` and `operationsB`).
  24335. */
  24336. function transformSets( operationsA, operationsB, options ) {
  24337. // Create new arrays so the originally passed arguments are not changed.
  24338. // No need to clone operations, they are cloned as they are transformed.
  24339. operationsA = operationsA.slice();
  24340. operationsB = operationsB.slice();
  24341. const contextFactory = new ContextFactory( options.document, options.useRelations, options.forceWeakRemove );
  24342. contextFactory.setOriginalOperations( operationsA );
  24343. contextFactory.setOriginalOperations( operationsB );
  24344. const originalOperations = contextFactory.originalOperations;
  24345. // If one of sets is empty there is simply nothing to transform, so return sets as they are.
  24346. if ( operationsA.length == 0 || operationsB.length == 0 ) {
  24347. return { operationsA, operationsB, originalOperations };
  24348. }
  24349. //
  24350. // Following is a description of transformation process:
  24351. //
  24352. // There are `operationsA` and `operationsB` to be transformed, both by both.
  24353. //
  24354. // So, suppose we have sets of two operations each: `operationsA` = `[ a1, a2 ]`, `operationsB` = `[ b1, b2 ]`.
  24355. //
  24356. // Remember, that we can only transform operations that base on the same context. We assert that `a1` and `b1` base on
  24357. // the same context and we transform them. Then, we get `a1'` and `b1'`. `a2` bases on a context with `a1` -- `a2`
  24358. // is an operation that followed `a1`. Similarly, `b2` bases on a context with `b1`.
  24359. //
  24360. // However, since `a1'` is a result of transformation by `b1`, `a1'` now also has a context with `b1`. This means that
  24361. // we can safely transform `a1'` by `b2`. As we finish transforming `a1`, we also transformed all `operationsB`.
  24362. // All `operationsB` also have context including `a1`. Now, we can properly transform `a2` by those operations.
  24363. //
  24364. // The transformation process can be visualized on a transformation diagram ("diamond diagram"):
  24365. //
  24366. // [the initial state]
  24367. // [common for a1 and b1]
  24368. //
  24369. // *
  24370. // / \
  24371. // / \
  24372. // b1 a1
  24373. // / \
  24374. // / \
  24375. // * *
  24376. // / \ / \
  24377. // / \ / \
  24378. // b2 a1' b1' a2
  24379. // / \ / \
  24380. // / \ / \
  24381. // * * *
  24382. // \ / \ /
  24383. // \ / \ /
  24384. // a1'' b2' a2' b1''
  24385. // \ / \ /
  24386. // \ / \ /
  24387. // * *
  24388. // \ /
  24389. // \ /
  24390. // a2'' b2''
  24391. // \ /
  24392. // \ /
  24393. // *
  24394. //
  24395. // [the final state]
  24396. //
  24397. // The final state can be reached from the initial state by applying `a1`, `a2`, `b1''` and `b2''`, as well as by
  24398. // applying `b1`, `b2`, `a1''`, `a2''`. Note how the operations get to a proper common state before each pair is
  24399. // transformed.
  24400. //
  24401. // Another thing to consider is that an operation during transformation can be broken into multiple operations.
  24402. // Suppose that `a1` * `b1` = `[ a11', a12' ]` (instead of `a1'` that we considered previously).
  24403. //
  24404. // In that case, we leave `a12'` for later and we continue transforming `a11'` until it is transformed by all `operationsB`
  24405. // (in our case it is just `b2`). At this point, `b1` is transformed by "whole" `a1`, while `b2` is only transformed
  24406. // by `a11'`. Similarly, `a12'` is only transformed by `b1`. This leads to a conclusion that we need to start transforming `a12'`
  24407. // from the moment just after it was broken. So, `a12'` is transformed by `b2`. Now, "the whole" `a1` is transformed
  24408. // by `operationsB`, while all `operationsB` are transformed by "the whole" `a1`. This means that we can continue with
  24409. // following `operationsA` (in our case it is just `a2`).
  24410. //
  24411. // Of course, also `operationsB` can be broken. However, since we focus on transforming operation `a` to the end,
  24412. // the only thing to do is to store both pieces of operation `b`, so that the next transformed operation `a` will
  24413. // be transformed by both of them.
  24414. //
  24415. // *
  24416. // / \
  24417. // / \
  24418. // / \
  24419. // b1 a1
  24420. // / \
  24421. // / \
  24422. // / \
  24423. // * *
  24424. // / \ / \
  24425. // / a11' / \
  24426. // / \ / \
  24427. // b2 * b1' a2
  24428. // / / \ / \
  24429. // / / a12' / \
  24430. // / / \ / \
  24431. // * b2' * *
  24432. // \ / / \ /
  24433. // a11'' / b21'' \ /
  24434. // \ / / \ /
  24435. // * * a2' b1''
  24436. // \ / \ \ /
  24437. // a12'' b22''\ \ /
  24438. // \ / \ \ /
  24439. // * a2'' *
  24440. // \ \ /
  24441. // \ \ b21'''
  24442. // \ \ /
  24443. // a2''' *
  24444. // \ /
  24445. // \ b22'''
  24446. // \ /
  24447. // *
  24448. //
  24449. // Note, how `a1` is broken and transformed into `a11'` and `a12'`, while `b2'` got broken and transformed into `b21''` and `b22''`.
  24450. //
  24451. // Having all that on mind, here is an outline for the transformation process algorithm:
  24452. //
  24453. // 1. We have `operationsA` and `operationsB` array, which we dynamically update as the transformation process goes.
  24454. //
  24455. // 2. We take next (or first) operation from `operationsA` and check from which operation `b` we need to start transforming it.
  24456. // All original `operationsA` are set to be transformed starting from the first operation `b`.
  24457. //
  24458. // 3. We take operations from `operationsB`, one by one, starting from the correct one, and transform operation `a`
  24459. // by operation `b` (and vice versa). We update `operationsA` and `operationsB` by replacing the original operations
  24460. // with the transformation results.
  24461. //
  24462. // 4. If operation is broken into multiple operations, we save all the new operations in the place of the
  24463. // original operation.
  24464. //
  24465. // 5. Additionally, if operation `a` was broken, for the "new" operation, we remember from which operation `b` it should
  24466. // be transformed by.
  24467. //
  24468. // 6. We continue transforming "current" operation `a` until it is transformed by all `operationsB`. Then, go to 2.
  24469. // unless the last operation `a` was transformed.
  24470. //
  24471. // The actual implementation of the above algorithm is slightly different, as only one loop (while) is used.
  24472. // The difference is that we have "current" `a` operation to transform and we store the index of the next `b` operation
  24473. // to transform by. Each loop operates on two indexes then: index pointing to currently processed `a` operation and
  24474. // index pointing to next `b` operation. Each loop is just one `a * b` + `b * a` transformation. After each loop
  24475. // operation `b` index is updated. If all `b` operations were visited for the current `a` operation, we change
  24476. // current `a` operation index to the next one.
  24477. //
  24478. // For each operation `a`, keeps information what is the index in `operationsB` from which the transformation should start.
  24479. const nextTransformIndex = new WeakMap();
  24480. // For all the original `operationsA`, set that they should be transformed starting from the first of `operationsB`.
  24481. for ( const op of operationsA ) {
  24482. nextTransformIndex.set( op, 0 );
  24483. }
  24484. // Additional data that is used for some postprocessing after the main transformation process is done.
  24485. const data = {
  24486. nextBaseVersionA: operationsA[ operationsA.length - 1 ].baseVersion + 1,
  24487. nextBaseVersionB: operationsB[ operationsB.length - 1 ].baseVersion + 1,
  24488. originalOperationsACount: operationsA.length,
  24489. originalOperationsBCount: operationsB.length
  24490. };
  24491. // Index of currently transformed operation `a`.
  24492. let i = 0;
  24493. // While not all `operationsA` are transformed...
  24494. while ( i < operationsA.length ) {
  24495. // Get "current" operation `a`.
  24496. const opA = operationsA[ i ];
  24497. // For the "current" operation `a`, get the index of the next operation `b` to transform by.
  24498. const indexB = nextTransformIndex.get( opA );
  24499. // If operation `a` was already transformed by every operation `b`, change "current" operation `a` to the next one.
  24500. if ( indexB == operationsB.length ) {
  24501. i++;
  24502. continue;
  24503. }
  24504. const opB = operationsB[ indexB ];
  24505. // Transform `a` by `b` and `b` by `a`.
  24506. const newOpsA = transform( opA, opB, contextFactory.getContext( opA, opB, true ) );
  24507. const newOpsB = transform( opB, opA, contextFactory.getContext( opB, opA, false ) );
  24508. // As a result we get one or more `newOpsA` and one or more `newOpsB` operations.
  24509. // Update contextual information about operations.
  24510. contextFactory.updateRelation( opA, opB );
  24511. contextFactory.setOriginalOperations( newOpsA, opA );
  24512. contextFactory.setOriginalOperations( newOpsB, opB );
  24513. // For new `a` operations, update their index of the next operation `b` to transform them by.
  24514. //
  24515. // This is needed even if there was only one result (`a` was not broken) because that information is used
  24516. // at the beginning of this loop every time.
  24517. for ( const newOpA of newOpsA ) {
  24518. // Acknowledge, that operation `b` also might be broken into multiple operations.
  24519. //
  24520. // This is why we raise `indexB` not just by 1. If `newOpsB` are multiple operations, they will be
  24521. // spliced in the place of `opB`. So we need to change `transformBy` accordingly, so that an operation won't
  24522. // be transformed by the same operation (part of it) again.
  24523. nextTransformIndex.set( newOpA, indexB + newOpsB.length );
  24524. }
  24525. // Update `operationsA` and `operationsB` with the transformed versions.
  24526. operationsA.splice( i, 1, ...newOpsA );
  24527. operationsB.splice( indexB, 1, ...newOpsB );
  24528. }
  24529. if ( options.padWithNoOps ) {
  24530. // If no-operations padding is enabled, count how many extra `a` and `b` operations were generated.
  24531. const brokenOperationsACount = operationsA.length - data.originalOperationsACount;
  24532. const brokenOperationsBCount = operationsB.length - data.originalOperationsBCount;
  24533. // Then, if that number is not the same, pad `operationsA` or `operationsB` with correct number of no-ops so
  24534. // that the base versions are equalled.
  24535. //
  24536. // Note that only one array will be updated, as only one of those subtractions can be greater than zero.
  24537. padWithNoOps( operationsA, brokenOperationsBCount - brokenOperationsACount );
  24538. padWithNoOps( operationsB, brokenOperationsACount - brokenOperationsBCount );
  24539. }
  24540. // Finally, update base versions of transformed operations.
  24541. updateBaseVersions( operationsA, data.nextBaseVersionB );
  24542. updateBaseVersions( operationsB, data.nextBaseVersionA );
  24543. return { operationsA, operationsB, originalOperations };
  24544. }
  24545. // Gathers additional data about operations processed during transformation. Can be used to obtain contextual information
  24546. // about two operations that are about to be transformed. This contextual information can be used for better conflict resolution.
  24547. class ContextFactory {
  24548. // Creates `ContextFactory` instance.
  24549. //
  24550. // @param {module:engine/model/document~Document} document Document which the operations change.
  24551. // @param {Boolean} useRelations Whether during transformation relations should be used (used during undo for
  24552. // better conflict resolution).
  24553. // @param {Boolean} [forceWeakRemove=false] If set to `false`, remove operation will be always stronger than move operation,
  24554. // so the removed nodes won't end up back in the document root. When set to `true`, context data will be used.
  24555. constructor( document, useRelations, forceWeakRemove = false ) {
  24556. // For each operation that is created during transformation process, we keep a reference to the original operation
  24557. // which it comes from. The original operation works as a kind of "identifier". Every contextual information
  24558. // gathered during transformation that we want to save for given operation, is actually saved for the original operation.
  24559. // This way no matter if operation `a` is cloned, then transformed, even breaks, we still have access to the previously
  24560. // gathered data through original operation reference.
  24561. this.originalOperations = new Map();
  24562. // `model.History` instance which information about undone operations will be taken from.
  24563. this._history = document.history;
  24564. // Whether additional context should be used.
  24565. this._useRelations = useRelations;
  24566. this._forceWeakRemove = !!forceWeakRemove;
  24567. // Relations is a double-map structure (maps in map) where for two operations we store how those operations were related
  24568. // to each other. Those relations are evaluated during transformation process. For every transformated pair of operations
  24569. // we keep relations between them.
  24570. this._relations = new Map();
  24571. }
  24572. // Sets "original operation" for given operations.
  24573. //
  24574. // During transformation process, operations are cloned, then changed, then processed again, sometimes broken into two
  24575. // or multiple operations. When gathering additional data it is important that all operations can be somehow linked
  24576. // so a cloned and transformed "version" still kept track of the data assigned earlier to it.
  24577. //
  24578. // The original operation object will be used as such an universal linking id. Throughout the transformation process
  24579. // all cloned operations will refer to "the original operation" when storing and reading additional data.
  24580. //
  24581. // If `takeFrom` is not set, each operation from `operations` array will be assigned itself as "the original operation".
  24582. // This should be used as an initialization step.
  24583. //
  24584. // If `takeFrom` is set, each operation from `operations` will be assigned the same original operation as assigned
  24585. // for `takeFrom` operation. This should be used to update original operations. It should be used in a way that
  24586. // `operations` are the result of `takeFrom` transformation to ensure proper "original operation propagation".
  24587. //
  24588. // @param {Array.<module:engine/model/operation/operation~Operation>} operations
  24589. // @param {module:engine/model/operation/operation~Operation|null} [takeFrom=null]
  24590. setOriginalOperations( operations, takeFrom = null ) {
  24591. const originalOperation = takeFrom ? this.originalOperations.get( takeFrom ) : null;
  24592. for ( const operation of operations ) {
  24593. this.originalOperations.set( operation, originalOperation || operation );
  24594. }
  24595. }
  24596. // Saves a relation between operations `opA` and `opB`.
  24597. //
  24598. // Relations are then later used to help solve conflicts when operations are transformed.
  24599. //
  24600. // @param {module:engine/model/operation/operation~Operation} opA
  24601. // @param {module:engine/model/operation/operation~Operation} opB
  24602. updateRelation( opA, opB ) {
  24603. // The use of relations is described in a bigger detail in transformation functions.
  24604. //
  24605. // In brief, this function, for specified pairs of operation types, checks how positions defined in those operations relate.
  24606. // Then those relations are saved. For example, for two move operations, it is saved if one of those operations target
  24607. // position is before the other operation source position. This kind of information gives contextual information when
  24608. // transformation is used during undo. Similar checks are done for other pairs of operations.
  24609. //
  24610. switch ( opA.constructor ) {
  24611. case _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]: {
  24612. switch ( opB.constructor ) {
  24613. case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
  24614. if ( opA.targetPosition.isEqual( opB.sourcePosition ) || opB.movedRange.containsPosition( opA.targetPosition ) ) {
  24615. this._setRelation( opA, opB, 'insertAtSource' );
  24616. } else if ( opA.targetPosition.isEqual( opB.deletionPosition ) ) {
  24617. this._setRelation( opA, opB, 'insertBetween' );
  24618. } else if ( opA.targetPosition.isAfter( opB.sourcePosition ) ) {
  24619. this._setRelation( opA, opB, 'moveTargetAfter' );
  24620. }
  24621. break;
  24622. }
  24623. case _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]: {
  24624. if ( opA.targetPosition.isEqual( opB.sourcePosition ) || opA.targetPosition.isBefore( opB.sourcePosition ) ) {
  24625. this._setRelation( opA, opB, 'insertBefore' );
  24626. } else {
  24627. this._setRelation( opA, opB, 'insertAfter' );
  24628. }
  24629. break;
  24630. }
  24631. }
  24632. break;
  24633. }
  24634. case _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"]: {
  24635. switch ( opB.constructor ) {
  24636. case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
  24637. if ( opA.splitPosition.isBefore( opB.sourcePosition ) ) {
  24638. this._setRelation( opA, opB, 'splitBefore' );
  24639. }
  24640. break;
  24641. }
  24642. case _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]: {
  24643. if ( opA.splitPosition.isEqual( opB.sourcePosition ) || opA.splitPosition.isBefore( opB.sourcePosition ) ) {
  24644. this._setRelation( opA, opB, 'splitBefore' );
  24645. } else {
  24646. const range = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( opB.sourcePosition, opB.howMany );
  24647. if ( opA.splitPosition.hasSameParentAs( opB.sourcePosition ) && range.containsPosition( opA.splitPosition ) ) {
  24648. const howMany = range.end.offset - opA.splitPosition.offset;
  24649. const offset = opA.splitPosition.offset - range.start.offset;
  24650. this._setRelation( opA, opB, { howMany, offset } );
  24651. }
  24652. }
  24653. }
  24654. }
  24655. break;
  24656. }
  24657. case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
  24658. switch ( opB.constructor ) {
  24659. case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
  24660. if ( !opA.targetPosition.isEqual( opB.sourcePosition ) ) {
  24661. this._setRelation( opA, opB, 'mergeTargetNotMoved' );
  24662. }
  24663. if ( opA.sourcePosition.isEqual( opB.targetPosition ) ) {
  24664. this._setRelation( opA, opB, 'mergeSourceNotMoved' );
  24665. }
  24666. if ( opA.sourcePosition.isEqual( opB.sourcePosition ) ) {
  24667. this._setRelation( opA, opB, 'mergeSameElement' );
  24668. }
  24669. break;
  24670. }
  24671. case _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"]: {
  24672. if ( opA.sourcePosition.isEqual( opB.splitPosition ) ) {
  24673. this._setRelation( opA, opB, 'splitAtSource' );
  24674. }
  24675. }
  24676. }
  24677. break;
  24678. }
  24679. case _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"]: {
  24680. const markerRange = opA.newRange;
  24681. if ( !markerRange ) {
  24682. return;
  24683. }
  24684. switch ( opB.constructor ) {
  24685. case _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]: {
  24686. const movedRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( opB.sourcePosition, opB.howMany );
  24687. const affectedLeft = movedRange.containsPosition( markerRange.start ) ||
  24688. movedRange.start.isEqual( markerRange.start );
  24689. const affectedRight = movedRange.containsPosition( markerRange.end ) ||
  24690. movedRange.end.isEqual( markerRange.end );
  24691. if ( ( affectedLeft || affectedRight ) && !movedRange.containsRange( markerRange ) ) {
  24692. this._setRelation( opA, opB, {
  24693. side: affectedLeft ? 'left' : 'right',
  24694. path: affectedLeft ? markerRange.start.path.slice() : markerRange.end.path.slice()
  24695. } );
  24696. }
  24697. break;
  24698. }
  24699. case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
  24700. const wasInLeftElement = markerRange.start.isEqual( opB.targetPosition );
  24701. const wasStartBeforeMergedElement = markerRange.start.isEqual( opB.deletionPosition );
  24702. const wasEndBeforeMergedElement = markerRange.end.isEqual( opB.deletionPosition );
  24703. const wasInRightElement = markerRange.end.isEqual( opB.sourcePosition );
  24704. if ( wasInLeftElement || wasStartBeforeMergedElement || wasEndBeforeMergedElement || wasInRightElement ) {
  24705. this._setRelation( opA, opB, {
  24706. wasInLeftElement,
  24707. wasStartBeforeMergedElement,
  24708. wasEndBeforeMergedElement,
  24709. wasInRightElement
  24710. } );
  24711. }
  24712. break;
  24713. }
  24714. }
  24715. break;
  24716. }
  24717. }
  24718. }
  24719. // Evaluates and returns contextual information about two given operations `opA` and `opB` which are about to be transformed.
  24720. //
  24721. // @param {module:engine/model/operation/operation~Operation} opA
  24722. // @param {module:engine/model/operation/operation~Operation} opB
  24723. // @returns {module:engine/model/operation/transform~TransformationContext}
  24724. getContext( opA, opB, aIsStrong ) {
  24725. return {
  24726. aIsStrong,
  24727. aWasUndone: this._wasUndone( opA ),
  24728. bWasUndone: this._wasUndone( opB ),
  24729. abRelation: this._useRelations ? this._getRelation( opA, opB ) : null,
  24730. baRelation: this._useRelations ? this._getRelation( opB, opA ) : null,
  24731. forceWeakRemove: this._forceWeakRemove
  24732. };
  24733. }
  24734. // Returns whether given operation `op` has already been undone.
  24735. //
  24736. // Information whether an operation was undone gives more context when making a decision when two operations are in conflict.
  24737. //
  24738. // @param {module:engine/model/operation/operation~Operation} op
  24739. // @returns {Boolean}
  24740. _wasUndone( op ) {
  24741. // For `op`, get its original operation. After all, if `op` is a clone (or even transformed clone) of another
  24742. // operation, literally `op` couldn't be undone. It was just generated. If anything, it was the operation it origins
  24743. // from which was undone. So get that original operation.
  24744. const originalOp = this.originalOperations.get( op );
  24745. // And check with the document if the original operation was undone.
  24746. return originalOp.wasUndone || this._history.isUndoneOperation( originalOp );
  24747. }
  24748. // Returns a relation between `opA` and an operation which is undone by `opB`. This can be `String` value if a relation
  24749. // was set earlier or `null` if there was no relation between those operations.
  24750. //
  24751. // This is a little tricky to understand, so let's compare it to `ContextFactory#_wasUndone`.
  24752. //
  24753. // When `wasUndone( opB )` is used, we check if the `opB` has already been undone. It is obvious, that the
  24754. // undoing operation must happen after the undone operation. So, essentially, we have `opB`, we take document history,
  24755. // we look forward in the future and ask if in that future `opB` was undone.
  24756. //
  24757. // Relations is a backward process to `wasUndone()`.
  24758. //
  24759. // Long story short - using relations is asking what happened in the past. Looking back. This time we have an undoing
  24760. // operation `opB` which has undone some other operation. When there is a transformation `opA` x `opB` and there is
  24761. // a conflict to solve and `opB` is an undoing operation, we can look back in the history and see what was a relation
  24762. // between `opA` and the operation which `opB` undone. Basing on that relation from the past, we can now make
  24763. // a better decision when resolving a conflict between two operations, because we know more about the context of
  24764. // those two operations.
  24765. //
  24766. // This is why this function does not return a relation directly between `opA` and `opB` because we need to look
  24767. // back to search for a meaningful contextual information.
  24768. //
  24769. // @param {module:engine/model/operation/operation~Operation} opA
  24770. // @param {module:engine/model/operation/operation~Operation} opB
  24771. // @returns {String|null}
  24772. _getRelation( opA, opB ) {
  24773. // Get the original operation. Similarly as in `wasUndone()` it is used as an universal identifier for stored data.
  24774. const origB = this.originalOperations.get( opB );
  24775. const undoneB = this._history.getUndoneOperation( origB );
  24776. // If `opB` is not undoing any operation, there is no relation.
  24777. if ( !undoneB ) {
  24778. return null;
  24779. }
  24780. const origA = this.originalOperations.get( opA );
  24781. const relationsA = this._relations.get( origA );
  24782. // Get all relations for `opA`, and check if there is a relation with `opB`-undone-counterpart. If so, return it.
  24783. if ( relationsA ) {
  24784. return relationsA.get( undoneB ) || null;
  24785. }
  24786. return null;
  24787. }
  24788. // Helper function for `ContextFactory#updateRelations`.
  24789. //
  24790. // @private
  24791. // @param {module:engine/model/operation/operation~Operation} opA
  24792. // @param {module:engine/model/operation/operation~Operation} opB
  24793. // @param {String} relation
  24794. _setRelation( opA, opB, relation ) {
  24795. // As always, setting is for original operations, not the clones/transformed operations.
  24796. const origA = this.originalOperations.get( opA );
  24797. const origB = this.originalOperations.get( opB );
  24798. let relationsA = this._relations.get( origA );
  24799. if ( !relationsA ) {
  24800. relationsA = new Map();
  24801. this._relations.set( origA, relationsA );
  24802. }
  24803. relationsA.set( origB, relation );
  24804. }
  24805. }
  24806. /**
  24807. * Holds additional contextual information about a transformed pair of operations (`a` and `b`). Those information
  24808. * can be used for better conflict resolving.
  24809. *
  24810. * @typedef {Object} module:engine/model/operation/transform~TransformationContext
  24811. *
  24812. * @property {Boolean} aIsStrong Whether `a` is strong operation in this transformation, or weak.
  24813. * @property {Boolean} aWasUndone Whether `a` operation was undone.
  24814. * @property {Boolean} bWasUndone Whether `b` operation was undone.
  24815. * @property {String|null} abRelation The relation between `a` operation and an operation undone by `b` operation.
  24816. * @property {String|null} baRelation The relation between `b` operation and an operation undone by `a` operation.
  24817. */
  24818. /**
  24819. * An utility function that updates {@link module:engine/model/operation/operation~Operation#baseVersion base versions}
  24820. * of passed operations.
  24821. *
  24822. * The function simply sets `baseVersion` as a base version of the first passed operation and then increments it for
  24823. * each following operation in `operations`.
  24824. *
  24825. * @private
  24826. * @param {Array.<module:engine/model/operation/operation~Operation>} operations Operations to update.
  24827. * @param {Number} baseVersion Base version to set for the first operation in `operations`.
  24828. */
  24829. function updateBaseVersions( operations, baseVersion ) {
  24830. for ( const operation of operations ) {
  24831. operation.baseVersion = baseVersion++;
  24832. }
  24833. }
  24834. /**
  24835. * Adds `howMany` instances of {@link module:engine/model/operation/nooperation~NoOperation} to `operations` set.
  24836. *
  24837. * @private
  24838. * @param {Array.<module:engine/model/operation/operation~Operation>} operations
  24839. * @param {Number} howMany
  24840. */
  24841. function padWithNoOps( operations, howMany ) {
  24842. for ( let i = 0; i < howMany; i++ ) {
  24843. operations.push( new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) );
  24844. }
  24845. }
  24846. // -----------------------
  24847. setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], ( a, b, context ) => {
  24848. // If operations in conflict, check if their ranges intersect and manage them properly.
  24849. //
  24850. // Operations can be in conflict only if:
  24851. //
  24852. // * their key is the same (they change the same attribute), and
  24853. // * they are in the same parent (operations for ranges [ 1 ] - [ 3 ] and [ 2, 0 ] - [ 2, 5 ] change different
  24854. // elements and can't be in conflict).
  24855. if ( a.key === b.key && a.range.start.hasSameParentAs( b.range.start ) ) {
  24856. // First, we want to apply change to the part of a range that has not been changed by the other operation.
  24857. const operations = a.range.getDifference( b.range ).map( range => {
  24858. return new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( range, a.key, a.oldValue, a.newValue, 0 );
  24859. } );
  24860. // Then we take care of the common part of ranges.
  24861. const common = a.range.getIntersection( b.range );
  24862. if ( common ) {
  24863. // If this operation is more important, we also want to apply change to the part of the
  24864. // original range that has already been changed by the other operation. Since that range
  24865. // got changed we also have to update `oldValue`.
  24866. if ( context.aIsStrong ) {
  24867. operations.push( new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( common, b.key, b.newValue, a.newValue, 0 ) );
  24868. }
  24869. }
  24870. if ( operations.length == 0 ) {
  24871. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  24872. }
  24873. return operations;
  24874. } else {
  24875. // If operations don't conflict, simply return an array containing just a clone of this operation.
  24876. return [ a ];
  24877. }
  24878. } );
  24879. setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  24880. // Case 1:
  24881. //
  24882. // The attribute operation range includes the position where nodes were inserted.
  24883. // There are two possible scenarios: the inserted nodes were text and they should receive attributes or
  24884. // the inserted nodes were elements and they should not receive attributes.
  24885. //
  24886. if ( a.range.start.hasSameParentAs( b.position ) && a.range.containsPosition( b.position ) ) {
  24887. // If new nodes should not receive attributes, two separated ranges will be returned.
  24888. // Otherwise, one expanded range will be returned.
  24889. const range = a.range._getTransformedByInsertion( b.position, b.howMany, !b.shouldReceiveAttributes );
  24890. const result = range.map( r => {
  24891. return new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( r, a.key, a.oldValue, a.newValue, a.baseVersion );
  24892. } );
  24893. if ( b.shouldReceiveAttributes ) {
  24894. // `AttributeOperation#range` includes some newly inserted text.
  24895. // The operation should also change the attribute of that text. An example:
  24896. //
  24897. // Bold should be applied on the following range:
  24898. // <p>Fo[zb]ar</p>
  24899. //
  24900. // In meantime, new text is typed:
  24901. // <p>Fozxxbar</p>
  24902. //
  24903. // Bold should be applied also on the new text:
  24904. // <p>Fo[zxxb]ar</p>
  24905. // <p>Fo<$text bold="true">zxxb</$text>ar</p>
  24906. //
  24907. // There is a special case to consider here to consider.
  24908. //
  24909. // Consider setting an attribute with multiple possible values, for example `highlight`. The inserted text might
  24910. // have already an attribute value applied and the `oldValue` property of the attribute operation might be wrong:
  24911. //
  24912. // Attribute `highlight="yellow"` should be applied on the following range:
  24913. // <p>Fo[zb]ar<p>
  24914. //
  24915. // In meantime, character `x` with `highlight="red"` is typed:
  24916. // <p>Fo[z<$text highlight="red">x</$text>b]ar</p>
  24917. //
  24918. // In this case we cannot simply apply operation changing the attribute value from `null` to `"yellow"` for the whole range
  24919. // because that would lead to an exception (`oldValue` is incorrect for `x`).
  24920. //
  24921. // We also cannot break the original range as this would mess up a scenario when there are multiple following
  24922. // insert operations, because then only the first inserted character is included in those ranges:
  24923. // <p>Fo[z][x][b]ar</p> --> <p>Fo[z][x]x[b]ar</p> --> <p>Fo[z][x]xx[b]ar</p>
  24924. //
  24925. // So, the attribute range needs be expanded, no matter what attributes are set on the inserted nodes:
  24926. //
  24927. // <p>Fo[z<$text highlight="red">x</$text>b]ar</p> <--- Change from `null` to `yellow`, throwing an exception.
  24928. //
  24929. // But before that operation would be applied, we will add an additional attribute operation that will change
  24930. // attributes on the inserted nodes in a way which would make the original operation correct:
  24931. //
  24932. // <p>Fo[z{<$text highlight="red">}x</$text>b]ar</p> <--- Change range `{}` from `red` to `null`.
  24933. // <p>Fo[zxb]ar</p> <--- Now change from `null` to `yellow` is completely fine.
  24934. //
  24935. // Generate complementary attribute operation. Be sure to add it before the original operation.
  24936. const op = _getComplementaryAttributeOperations( b, a.key, a.oldValue );
  24937. if ( op ) {
  24938. result.unshift( op );
  24939. }
  24940. }
  24941. // If nodes should not receive new attribute, we are done here.
  24942. return result;
  24943. }
  24944. // If insert operation is not expanding the attribute operation range, simply transform the range.
  24945. a.range = a.range._getTransformedByInsertion( b.position, b.howMany, false )[ 0 ];
  24946. return [ a ];
  24947. } );
  24948. /**
  24949. * Helper function for `AttributeOperation` x `InsertOperation` (and reverse) transformation.
  24950. *
  24951. * For given `insertOperation` it checks the inserted node if it has an attribute `key` set to a value different
  24952. * than `newValue`. If so, it generates an `AttributeOperation` which changes the value of `key` attribute to `newValue`.
  24953. *
  24954. * @private
  24955. * @param {module:engine/model/operation/insertoperation~InsertOperation} insertOperation
  24956. * @param {String} key
  24957. * @param {*} newValue
  24958. * @returns {module:engine/model/operation/attributeoperation~AttributeOperation|null}
  24959. */
  24960. function _getComplementaryAttributeOperations( insertOperation, key, newValue ) {
  24961. const nodes = insertOperation.nodes;
  24962. // At the beginning we store the attribute value from the first node.
  24963. const insertValue = nodes.getNode( 0 ).getAttribute( key );
  24964. if ( insertValue == newValue ) {
  24965. return null;
  24966. }
  24967. const range = new _range__WEBPACK_IMPORTED_MODULE_9__["default"]( insertOperation.position, insertOperation.position.getShiftedBy( insertOperation.howMany ) );
  24968. return new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( range, key, insertValue, newValue, 0 );
  24969. }
  24970. setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b ) => {
  24971. const ranges = [];
  24972. // Case 1:
  24973. //
  24974. // Attribute change on the merged element. In this case, the merged element was moved to the graveyard.
  24975. // An additional attribute operation that will change the (re)moved element needs to be generated.
  24976. //
  24977. if ( a.range.start.hasSameParentAs( b.deletionPosition ) ) {
  24978. if ( a.range.containsPosition( b.deletionPosition ) || a.range.start.isEqual( b.deletionPosition ) ) {
  24979. ranges.push( _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.graveyardPosition, 1 ) );
  24980. }
  24981. }
  24982. const range = a.range._getTransformedByMergeOperation( b );
  24983. // Do not add empty (collapsed) ranges to the result. `range` may be collapsed if it contained only the merged element.
  24984. if ( !range.isCollapsed ) {
  24985. ranges.push( range );
  24986. }
  24987. // Create `AttributeOperation`s out of the ranges.
  24988. return ranges.map( range => {
  24989. return new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( range, a.key, a.oldValue, a.newValue, a.baseVersion );
  24990. } );
  24991. } );
  24992. setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b ) => {
  24993. const ranges = _breakRangeByMoveOperation( a.range, b );
  24994. // Create `AttributeOperation`s out of the ranges.
  24995. return ranges.map( range => new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( range, a.key, a.oldValue, a.newValue, a.baseVersion ) );
  24996. } );
  24997. // Helper function for `AttributeOperation` x `MoveOperation` transformation.
  24998. //
  24999. // Takes the passed `range` and transforms it by move operation `moveOp` in a specific way. Only top-level nodes of `range`
  25000. // are considered to be in the range. If move operation moves nodes deep from inside of the range, those nodes won't
  25001. // be included in the result. In other words, top-level nodes of the ranges from the result are exactly the same as
  25002. // top-level nodes of the original `range`.
  25003. //
  25004. // This is important for `AttributeOperation` because, for its range, it changes only the top-level nodes. So we need to
  25005. // track only how those nodes have been affected by `MoveOperation`.
  25006. //
  25007. // @private
  25008. // @param {module:engine/model/range~Range} range
  25009. // @param {module:engine/model/operation/moveoperation~MoveOperation} moveOp
  25010. // @returns {Array.<module:engine/model/range~Range>}
  25011. function _breakRangeByMoveOperation( range, moveOp ) {
  25012. const moveRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( moveOp.sourcePosition, moveOp.howMany );
  25013. // We are transforming `range` (original range) by `moveRange` (range moved by move operation). As usual when it comes to
  25014. // transforming a ranges, we may have a common part of the ranges and we may have a difference part (zero to two ranges).
  25015. let common = null;
  25016. let difference = [];
  25017. // Let's compare the ranges.
  25018. if ( moveRange.containsRange( range, true ) ) {
  25019. // If the whole original range is moved, treat it whole as a common part. There's also no difference part.
  25020. common = range;
  25021. } else if ( range.start.hasSameParentAs( moveRange.start ) ) {
  25022. // If the ranges are "on the same level" (in the same parent) then move operation may move exactly those nodes
  25023. // that are changed by the attribute operation. In this case we get common part and difference part in the usual way.
  25024. difference = range.getDifference( moveRange );
  25025. common = range.getIntersection( moveRange );
  25026. } else {
  25027. // In any other situation we assume that original range is different than move range, that is that move operation
  25028. // moves other nodes that attribute operation change. Even if the moved range is deep inside in the original range.
  25029. //
  25030. // Note that this is different than in `.getIntersection` (we would get a common part in that case) and different
  25031. // than `.getDifference` (we would get two ranges).
  25032. difference = [ range ];
  25033. }
  25034. const result = [];
  25035. // The default behaviour of `_getTransformedByMove` might get wrong results for difference part, though, so
  25036. // we do it by hand.
  25037. for ( let diff of difference ) {
  25038. // First, transform the range by removing moved nodes. Since this is a difference, this is safe, `null` won't be returned
  25039. // as the range is different than the moved range.
  25040. diff = diff._getTransformedByDeletion( moveOp.sourcePosition, moveOp.howMany );
  25041. // Transform also `targetPosition`.
  25042. const targetPosition = moveOp.getMovedRangeStart();
  25043. // Spread the range only if moved nodes are inserted only between the top-level nodes of the `diff` range.
  25044. const spread = diff.start.hasSameParentAs( targetPosition );
  25045. // Transform by insertion of moved nodes.
  25046. diff = diff._getTransformedByInsertion( targetPosition, moveOp.howMany, spread );
  25047. result.push( ...diff );
  25048. }
  25049. // Common part can be simply transformed by the move operation. This is because move operation will not target to
  25050. // that common part (the operation would have to target inside its own moved range).
  25051. if ( common ) {
  25052. result.push(
  25053. common._getTransformedByMove( moveOp.sourcePosition, moveOp.targetPosition, moveOp.howMany, false )[ 0 ]
  25054. );
  25055. }
  25056. return result;
  25057. }
  25058. setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b ) => {
  25059. // Case 1:
  25060. //
  25061. // Split node is the last node in `AttributeOperation#range`.
  25062. // `AttributeOperation#range` needs to be expanded to include the new (split) node.
  25063. //
  25064. // Attribute `type` to be changed to `numbered` but the `listItem` is split.
  25065. // <listItem type="bulleted">foobar</listItem>
  25066. //
  25067. // After split:
  25068. // <listItem type="bulleted">foo</listItem><listItem type="bulleted">bar</listItem>
  25069. //
  25070. // After attribute change:
  25071. // <listItem type="numbered">foo</listItem><listItem type="numbered">foo</listItem>
  25072. //
  25073. if ( a.range.end.isEqual( b.insertionPosition ) ) {
  25074. if ( !b.graveyardPosition ) {
  25075. a.range.end.offset++;
  25076. }
  25077. return [ a ];
  25078. }
  25079. // Case 2:
  25080. //
  25081. // Split position is inside `AttributeOperation#range`, at the same level, so the nodes to change are
  25082. // not going to make a flat range.
  25083. //
  25084. // Content with range-to-change and split position:
  25085. // <p>Fo[zb^a]r</p>
  25086. //
  25087. // After split:
  25088. // <p>Fozb</p><p>ar</p>
  25089. //
  25090. // Make two separate ranges containing all nodes to change:
  25091. // <p>Fo[zb]</p><p>[a]r</p>
  25092. //
  25093. if ( a.range.start.hasSameParentAs( b.splitPosition ) && a.range.containsPosition( b.splitPosition ) ) {
  25094. const secondPart = a.clone();
  25095. secondPart.range = new _range__WEBPACK_IMPORTED_MODULE_9__["default"](
  25096. b.moveTargetPosition.clone(),
  25097. a.range.end._getCombined( b.splitPosition, b.moveTargetPosition )
  25098. );
  25099. a.range.end = b.splitPosition.clone();
  25100. a.range.end.stickiness = 'toPrevious';
  25101. return [ a, secondPart ];
  25102. }
  25103. // The default case.
  25104. //
  25105. a.range = a.range._getTransformedBySplitOperation( b );
  25106. return [ a ];
  25107. } );
  25108. setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], ( a, b ) => {
  25109. const result = [ a ];
  25110. // Case 1:
  25111. //
  25112. // The attribute operation range includes the position where nodes were inserted.
  25113. // There are two possible scenarios: the inserted nodes were text and they should receive attributes or
  25114. // the inserted nodes were elements and they should not receive attributes.
  25115. //
  25116. // This is a mirror scenario to the one described in `AttributeOperation` x `InsertOperation` transformation,
  25117. // although this case is a little less complicated. In this case we simply need to change attributes of the
  25118. // inserted nodes and that's it.
  25119. //
  25120. if ( a.shouldReceiveAttributes && a.position.hasSameParentAs( b.range.start ) && b.range.containsPosition( a.position ) ) {
  25121. const op = _getComplementaryAttributeOperations( a, b.key, b.newValue );
  25122. if ( op ) {
  25123. result.push( op );
  25124. }
  25125. }
  25126. // The default case is: do nothing.
  25127. // `AttributeOperation` does not change the model tree structure so `InsertOperation` does not need to be changed.
  25128. //
  25129. return result;
  25130. } );
  25131. setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b, context ) => {
  25132. // Case 1:
  25133. //
  25134. // Two insert operations insert nodes at the same position. Since they are the same, it needs to be decided
  25135. // what will be the order of inserted nodes. However, there is no additional information to help in that
  25136. // decision. Also, when `b` will be transformed by `a`, the same order must be maintained.
  25137. //
  25138. // To achieve that, we will check if the operation is strong.
  25139. // If it is, it won't get transformed. If it is not, it will be moved.
  25140. //
  25141. if ( a.position.isEqual( b.position ) && context.aIsStrong ) {
  25142. return [ a ];
  25143. }
  25144. // The default case.
  25145. //
  25146. a.position = a.position._getTransformedByInsertOperation( b );
  25147. return [ a ];
  25148. } );
  25149. setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b ) => {
  25150. // The default case.
  25151. //
  25152. a.position = a.position._getTransformedByMoveOperation( b );
  25153. return [ a ];
  25154. } );
  25155. setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b ) => {
  25156. // The default case.
  25157. //
  25158. a.position = a.position._getTransformedBySplitOperation( b );
  25159. return [ a ];
  25160. } );
  25161. setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b ) => {
  25162. a.position = a.position._getTransformedByMergeOperation( b );
  25163. return [ a ];
  25164. } );
  25165. // -----------------------
  25166. setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  25167. if ( a.oldRange ) {
  25168. a.oldRange = a.oldRange._getTransformedByInsertOperation( b )[ 0 ];
  25169. }
  25170. if ( a.newRange ) {
  25171. a.newRange = a.newRange._getTransformedByInsertOperation( b )[ 0 ];
  25172. }
  25173. return [ a ];
  25174. } );
  25175. setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], ( a, b, context ) => {
  25176. if ( a.name == b.name ) {
  25177. if ( context.aIsStrong ) {
  25178. a.oldRange = b.newRange ? b.newRange.clone() : null;
  25179. } else {
  25180. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  25181. }
  25182. }
  25183. return [ a ];
  25184. } );
  25185. setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b ) => {
  25186. if ( a.oldRange ) {
  25187. a.oldRange = a.oldRange._getTransformedByMergeOperation( b );
  25188. }
  25189. if ( a.newRange ) {
  25190. a.newRange = a.newRange._getTransformedByMergeOperation( b );
  25191. }
  25192. return [ a ];
  25193. } );
  25194. setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b, context ) => {
  25195. if ( a.oldRange ) {
  25196. a.oldRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromRanges( a.oldRange._getTransformedByMoveOperation( b ) );
  25197. }
  25198. if ( a.newRange ) {
  25199. if ( context.abRelation ) {
  25200. const aNewRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromRanges( a.newRange._getTransformedByMoveOperation( b ) );
  25201. if ( context.abRelation.side == 'left' && b.targetPosition.isEqual( a.newRange.start ) ) {
  25202. a.newRange.start.path = context.abRelation.path;
  25203. a.newRange.end = aNewRange.end;
  25204. return [ a ];
  25205. } else if ( context.abRelation.side == 'right' && b.targetPosition.isEqual( a.newRange.end ) ) {
  25206. a.newRange.start = aNewRange.start;
  25207. a.newRange.end.path = context.abRelation.path;
  25208. return [ a ];
  25209. }
  25210. }
  25211. a.newRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromRanges( a.newRange._getTransformedByMoveOperation( b ) );
  25212. }
  25213. return [ a ];
  25214. } );
  25215. setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b, context ) => {
  25216. if ( a.oldRange ) {
  25217. a.oldRange = a.oldRange._getTransformedBySplitOperation( b );
  25218. }
  25219. if ( a.newRange ) {
  25220. if ( context.abRelation ) {
  25221. const aNewRange = a.newRange._getTransformedBySplitOperation( b );
  25222. if ( a.newRange.start.isEqual( b.splitPosition ) && context.abRelation.wasStartBeforeMergedElement ) {
  25223. a.newRange.start = _position__WEBPACK_IMPORTED_MODULE_10__["default"]._createAt( b.insertionPosition );
  25224. } else if ( a.newRange.start.isEqual( b.splitPosition ) && !context.abRelation.wasInLeftElement ) {
  25225. a.newRange.start = _position__WEBPACK_IMPORTED_MODULE_10__["default"]._createAt( b.moveTargetPosition );
  25226. }
  25227. if ( a.newRange.end.isEqual( b.splitPosition ) && context.abRelation.wasInRightElement ) {
  25228. a.newRange.end = _position__WEBPACK_IMPORTED_MODULE_10__["default"]._createAt( b.moveTargetPosition );
  25229. } else if ( a.newRange.end.isEqual( b.splitPosition ) && context.abRelation.wasEndBeforeMergedElement ) {
  25230. a.newRange.end = _position__WEBPACK_IMPORTED_MODULE_10__["default"]._createAt( b.insertionPosition );
  25231. } else {
  25232. a.newRange.end = aNewRange.end;
  25233. }
  25234. return [ a ];
  25235. }
  25236. a.newRange = a.newRange._getTransformedBySplitOperation( b );
  25237. }
  25238. return [ a ];
  25239. } );
  25240. // -----------------------
  25241. setTransformation( _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  25242. if ( a.sourcePosition.hasSameParentAs( b.position ) ) {
  25243. a.howMany += b.howMany;
  25244. }
  25245. a.sourcePosition = a.sourcePosition._getTransformedByInsertOperation( b );
  25246. a.targetPosition = a.targetPosition._getTransformedByInsertOperation( b );
  25247. return [ a ];
  25248. } );
  25249. setTransformation( _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b, context ) => {
  25250. // Case 1:
  25251. //
  25252. // Same merge operations.
  25253. //
  25254. // Both operations have same source and target positions. So the element already got merged and there is
  25255. // theoretically nothing to do.
  25256. //
  25257. if ( a.sourcePosition.isEqual( b.sourcePosition ) && a.targetPosition.isEqual( b.targetPosition ) ) {
  25258. // There are two ways that we can provide a do-nothing operation.
  25259. //
  25260. // First is simply a NoOperation instance. We will use it if `b` operation was not undone.
  25261. //
  25262. // Second is a merge operation that has the source operation in the merged element - in the graveyard -
  25263. // same target position and `howMany` equal to `0`. So it is basically merging an empty element from graveyard
  25264. // which is almost the same as NoOperation.
  25265. //
  25266. // This way the merge operation can be later transformed by split operation
  25267. // to provide correct undo. This will be used if `b` operation was undone (only then it is correct).
  25268. //
  25269. if ( !context.bWasUndone ) {
  25270. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  25271. } else {
  25272. const path = b.graveyardPosition.path.slice();
  25273. path.push( 0 );
  25274. a.sourcePosition = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( b.graveyardPosition.root, path );
  25275. a.howMany = 0;
  25276. return [ a ];
  25277. }
  25278. }
  25279. // Case 2:
  25280. //
  25281. // Same merge source position but different target position.
  25282. //
  25283. // This can happen during collaboration. For example, if one client merged a paragraph to the previous paragraph
  25284. // and the other person removed that paragraph and merged the same paragraph to something before:
  25285. //
  25286. // Client A:
  25287. // <p>Foo</p><p>Bar</p><p>[]Xyz</p>
  25288. // <p>Foo</p><p>BarXyz</p>
  25289. //
  25290. // Client B:
  25291. // <p>Foo</p>[<p>Bar</p>]<p>Xyz</p>
  25292. // <p>Foo</p><p>[]Xyz</p>
  25293. // <p>FooXyz</p>
  25294. //
  25295. // In this case we need to decide where finally "Xyz" will land:
  25296. //
  25297. // <p>FooXyz</p> graveyard: <p>Bar</p>
  25298. // <p>Foo</p> graveyard: <p>BarXyz</p>
  25299. //
  25300. // Let's move it in a way so that a merge operation that does not target to graveyard is more important so that
  25301. // nodes does not end up in the graveyard. It makes sense. Both for Client A and for Client B "Xyz" finally did not
  25302. // end up in the graveyard (see above).
  25303. //
  25304. // If neither or both operations point to graveyard, then let `aIsStrong` decide.
  25305. //
  25306. if (
  25307. a.sourcePosition.isEqual( b.sourcePosition ) && !a.targetPosition.isEqual( b.targetPosition ) &&
  25308. !context.bWasUndone && context.abRelation != 'splitAtSource'
  25309. ) {
  25310. const aToGraveyard = a.targetPosition.root.rootName == '$graveyard';
  25311. const bToGraveyard = b.targetPosition.root.rootName == '$graveyard';
  25312. // If `aIsWeak` it means that `a` points to graveyard while `b` doesn't. Don't move nodes then.
  25313. const aIsWeak = aToGraveyard && !bToGraveyard;
  25314. // If `bIsWeak` it means that `b` points to graveyard while `a` doesn't. Force moving nodes then.
  25315. const bIsWeak = bToGraveyard && !aToGraveyard;
  25316. // Force move if `b` is weak or neither operation is weak but `a` is stronger through `context.aIsStrong`.
  25317. const forceMove = bIsWeak || ( !aIsWeak && context.aIsStrong );
  25318. if ( forceMove ) {
  25319. const sourcePosition = b.targetPosition._getTransformedByMergeOperation( b );
  25320. const targetPosition = a.targetPosition._getTransformedByMergeOperation( b );
  25321. return [ new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( sourcePosition, a.howMany, targetPosition, 0 ) ];
  25322. } else {
  25323. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  25324. }
  25325. }
  25326. // The default case.
  25327. //
  25328. if ( a.sourcePosition.hasSameParentAs( b.targetPosition ) ) {
  25329. a.howMany += b.howMany;
  25330. }
  25331. a.sourcePosition = a.sourcePosition._getTransformedByMergeOperation( b );
  25332. a.targetPosition = a.targetPosition._getTransformedByMergeOperation( b );
  25333. // Handle positions in graveyard.
  25334. // If graveyard positions are same and `a` operation is strong - do not transform.
  25335. if ( !a.graveyardPosition.isEqual( b.graveyardPosition ) || !context.aIsStrong ) {
  25336. a.graveyardPosition = a.graveyardPosition._getTransformedByMergeOperation( b );
  25337. }
  25338. return [ a ];
  25339. } );
  25340. setTransformation( _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b, context ) => {
  25341. // Case 1:
  25342. //
  25343. // The element to merge got removed.
  25344. //
  25345. // Merge operation does support merging elements which are not siblings. So it would not be a problem
  25346. // from technical point of view. However, if the element was removed, the intention of the user deleting it
  25347. // was to have it all deleted, together with its children. From user experience point of view, moving back the
  25348. // removed nodes might be unexpected. This means that in this scenario we will block the merging.
  25349. //
  25350. // The exception of this rule would be if the remove operation was later undone.
  25351. //
  25352. const removedRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.sourcePosition, b.howMany );
  25353. if ( b.type == 'remove' && !context.bWasUndone && !context.forceWeakRemove ) {
  25354. if ( a.deletionPosition.hasSameParentAs( b.sourcePosition ) && removedRange.containsPosition( a.sourcePosition ) ) {
  25355. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  25356. }
  25357. }
  25358. // The default case.
  25359. //
  25360. if ( a.sourcePosition.hasSameParentAs( b.targetPosition ) ) {
  25361. a.howMany += b.howMany;
  25362. }
  25363. if ( a.sourcePosition.hasSameParentAs( b.sourcePosition ) ) {
  25364. a.howMany -= b.howMany;
  25365. }
  25366. a.sourcePosition = a.sourcePosition._getTransformedByMoveOperation( b );
  25367. a.targetPosition = a.targetPosition._getTransformedByMoveOperation( b );
  25368. // `MergeOperation` graveyard position is like `MoveOperation` target position. It is a position where element(s) will
  25369. // be moved. Like in other similar cases, we need to consider the scenario when those positions are same.
  25370. // Here, we will treat `MergeOperation` like it is always strong (see `InsertOperation` x `InsertOperation` for comparison).
  25371. // This means that we won't transform graveyard position if it is equal to move operation target position.
  25372. if ( !a.graveyardPosition.isEqual( b.targetPosition ) ) {
  25373. a.graveyardPosition = a.graveyardPosition._getTransformedByMoveOperation( b );
  25374. }
  25375. return [ a ];
  25376. } );
  25377. setTransformation( _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b, context ) => {
  25378. if ( b.graveyardPosition ) {
  25379. // If `b` operation defines graveyard position, a node from graveyard will be moved. This means that we need to
  25380. // transform `a.graveyardPosition` accordingly.
  25381. a.graveyardPosition = a.graveyardPosition._getTransformedByDeletion( b.graveyardPosition, 1 );
  25382. // This is a scenario foreseen in `MergeOperation` x `MergeOperation`, with two identical merge operations.
  25383. //
  25384. // So, there was `MergeOperation` x `MergeOperation` transformation earlier. Now, `a` is a merge operation which
  25385. // source position is in graveyard. Interestingly, split operation wants to use the node to be merged by `a`. This
  25386. // means that `b` is undoing that merge operation from earlier, which caused `a` to be in graveyard.
  25387. //
  25388. // If that's the case, at this point, we will only "fix" `a.howMany`. It was earlier set to `0` in
  25389. // `MergeOperation` x `MergeOperation` transformation. Later transformations in this function will change other
  25390. // properties.
  25391. //
  25392. if ( a.deletionPosition.isEqual( b.graveyardPosition ) ) {
  25393. a.howMany = b.howMany;
  25394. }
  25395. }
  25396. // Case 1:
  25397. //
  25398. // Merge operation moves nodes to the place where split happens.
  25399. // This is a classic situation when there are two paragraphs, and there is a split (enter) after the first
  25400. // paragraph and there is a merge (delete) at the beginning of the second paragraph:
  25401. //
  25402. // <p>Foo{}</p><p>[]Bar</p>.
  25403. //
  25404. // Split is after `Foo`, while merge is from `Bar` to the end of `Foo`.
  25405. //
  25406. // State after split:
  25407. // <p>Foo</p><p></p><p>Bar</p>
  25408. //
  25409. // Now, `Bar` should be merged to the new paragraph:
  25410. // <p>Foo</p><p>Bar</p>
  25411. //
  25412. // Instead of merging it to the original paragraph:
  25413. // <p>FooBar</p><p></p>
  25414. //
  25415. // This means that `targetPosition` needs to be transformed. This is the default case though.
  25416. // For example, if the split would be after `F`, `targetPosition` should also be transformed.
  25417. //
  25418. // There are three exceptions, though, when we want to keep `targetPosition` as it was.
  25419. //
  25420. // First exception is when the merge target position is inside an element (not at the end, as usual). This
  25421. // happens when the merge operation earlier was transformed by "the same" merge operation. If merge operation
  25422. // targets inside the element we want to keep the original target position (and not transform it) because
  25423. // we have additional context telling us that we want to merge to the original element. We can check if the
  25424. // merge operation points inside element by checking what is `SplitOperation#howMany`. Since merge target position
  25425. // is same as split position, if `howMany` is non-zero, it means that the merge target position is inside an element.
  25426. //
  25427. // Second exception is when the element to merge is in the graveyard and split operation uses it. In that case
  25428. // if target position would be transformed, the merge operation would target at the source position:
  25429. //
  25430. // root: <p>Foo</p> graveyard: <p></p>
  25431. //
  25432. // SplitOperation: root [ 0, 3 ] using graveyard [ 0 ] (howMany = 0)
  25433. // MergeOperation: graveyard [ 0, 0 ] -> root [ 0, 3 ] (howMany = 0)
  25434. //
  25435. // Since split operation moves the graveyard node back to the root, the merge operation source position changes.
  25436. // We would like to merge from the empty <p> to the "Foo" <p>:
  25437. //
  25438. // root: <p>Foo</p><p></p> graveyard:
  25439. //
  25440. // MergeOperation#sourcePosition = root [ 1, 0 ]
  25441. //
  25442. // If `targetPosition` is transformed, it would become root [ 1, 0 ] as well. It has to be kept as it was.
  25443. //
  25444. // Third exception is connected with relations. If this happens during undo and we have explicit information
  25445. // that target position has not been affected by the operation which is undone by this split then this split should
  25446. // not move the target position either.
  25447. //
  25448. if ( a.targetPosition.isEqual( b.splitPosition ) ) {
  25449. const mergeInside = b.howMany != 0;
  25450. const mergeSplittingElement = b.graveyardPosition && a.deletionPosition.isEqual( b.graveyardPosition );
  25451. if ( mergeInside || mergeSplittingElement || context.abRelation == 'mergeTargetNotMoved' ) {
  25452. a.sourcePosition = a.sourcePosition._getTransformedBySplitOperation( b );
  25453. return [ a ];
  25454. }
  25455. }
  25456. // Case 2:
  25457. //
  25458. // Merge source is at the same position as split position. This sometimes happen, mostly during undo.
  25459. // The decision here is mostly to choose whether merge source position should stay where it is (so it will be at the end of the
  25460. // split element) or should be move to the beginning of the new element.
  25461. //
  25462. if ( a.sourcePosition.isEqual( b.splitPosition ) ) {
  25463. // Use context to check if `SplitOperation` is not undoing a merge operation, that didn't change the `a` operation.
  25464. // This scenario happens the undone merge operation moved nodes at the source position of `a` operation.
  25465. // In that case `a` operation source position should stay where it is.
  25466. if ( context.abRelation == 'mergeSourceNotMoved' ) {
  25467. a.howMany = 0;
  25468. a.targetPosition = a.targetPosition._getTransformedBySplitOperation( b );
  25469. return [ a ];
  25470. }
  25471. // This merge operation might have been earlier transformed by a merge operation which both merged the same element.
  25472. // See that case in `MergeOperation` x `MergeOperation` transformation. In that scenario, if the merge operation has been undone,
  25473. // the special case is not applied.
  25474. //
  25475. // Now, the merge operation is transformed by the split which has undone that previous merge operation.
  25476. // So now we are fixing situation which was skipped in `MergeOperation` x `MergeOperation` case.
  25477. //
  25478. if ( context.abRelation == 'mergeSameElement' || a.sourcePosition.offset > 0 ) {
  25479. a.sourcePosition = b.moveTargetPosition.clone();
  25480. a.targetPosition = a.targetPosition._getTransformedBySplitOperation( b );
  25481. return [ a ];
  25482. }
  25483. }
  25484. // The default case.
  25485. //
  25486. if ( a.sourcePosition.hasSameParentAs( b.splitPosition ) ) {
  25487. a.howMany = b.splitPosition.offset;
  25488. }
  25489. a.sourcePosition = a.sourcePosition._getTransformedBySplitOperation( b );
  25490. a.targetPosition = a.targetPosition._getTransformedBySplitOperation( b );
  25491. return [ a ];
  25492. } );
  25493. // -----------------------
  25494. setTransformation( _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  25495. const moveRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
  25496. const transformed = moveRange._getTransformedByInsertOperation( b, false )[ 0 ];
  25497. a.sourcePosition = transformed.start;
  25498. a.howMany = transformed.end.offset - transformed.start.offset;
  25499. // See `InsertOperation` x `MoveOperation` transformation for details on this case.
  25500. //
  25501. // In summary, both operations point to the same place, so the order of nodes needs to be decided.
  25502. // `MoveOperation` is considered weaker, so it is always transformed, unless there was a certain relation
  25503. // between operations.
  25504. //
  25505. if ( !a.targetPosition.isEqual( b.position ) ) {
  25506. a.targetPosition = a.targetPosition._getTransformedByInsertOperation( b );
  25507. }
  25508. return [ a ];
  25509. } );
  25510. setTransformation( _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b, context ) => {
  25511. //
  25512. // Setting and evaluating some variables that will be used in special cases and default algorithm.
  25513. //
  25514. // Create ranges from `MoveOperations` properties.
  25515. const rangeA = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
  25516. const rangeB = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.sourcePosition, b.howMany );
  25517. // Assign `context.aIsStrong` to a different variable, because the value may change during execution of
  25518. // this algorithm and we do not want to override original `context.aIsStrong` that will be used in later transformations.
  25519. let aIsStrong = context.aIsStrong;
  25520. // This will be used to decide the order of nodes if both operations target at the same position.
  25521. // By default, use strong/weak operation mechanism.
  25522. let insertBefore = !context.aIsStrong;
  25523. // If the relation is set, then use it to decide nodes order.
  25524. if ( context.abRelation == 'insertBefore' || context.baRelation == 'insertAfter' ) {
  25525. insertBefore = true;
  25526. } else if ( context.abRelation == 'insertAfter' || context.baRelation == 'insertBefore' ) {
  25527. insertBefore = false;
  25528. }
  25529. // `a.targetPosition` could be affected by the `b` operation. We will transform it.
  25530. let newTargetPosition;
  25531. if ( a.targetPosition.isEqual( b.targetPosition ) && insertBefore ) {
  25532. newTargetPosition = a.targetPosition._getTransformedByDeletion(
  25533. b.sourcePosition,
  25534. b.howMany
  25535. );
  25536. } else {
  25537. newTargetPosition = a.targetPosition._getTransformedByMove(
  25538. b.sourcePosition,
  25539. b.targetPosition,
  25540. b.howMany
  25541. );
  25542. }
  25543. //
  25544. // Special case #1 + mirror.
  25545. //
  25546. // Special case when both move operations' target positions are inside nodes that are
  25547. // being moved by the other move operation. So in other words, we move ranges into inside of each other.
  25548. // This case can't be solved reasonably (on the other hand, it should not happen often).
  25549. if ( _moveTargetIntoMovedRange( a, b ) && _moveTargetIntoMovedRange( b, a ) ) {
  25550. // Instead of transforming operation, we return a reverse of the operation that we transform by.
  25551. // So when the results of this "transformation" will be applied, `b` MoveOperation will get reversed.
  25552. return [ b.getReversed() ];
  25553. }
  25554. //
  25555. // End of special case #1.
  25556. //
  25557. //
  25558. // Special case #2.
  25559. //
  25560. // Check if `b` operation targets inside `rangeA`.
  25561. const bTargetsToA = rangeA.containsPosition( b.targetPosition );
  25562. // If `b` targets to `rangeA` and `rangeA` contains `rangeB`, `b` operation has no influence on `a` operation.
  25563. // You might say that operation `b` is captured inside operation `a`.
  25564. if ( bTargetsToA && rangeA.containsRange( rangeB, true ) ) {
  25565. // There is a mini-special case here, where `rangeB` is on other level than `rangeA`. That's why
  25566. // we need to transform `a` operation anyway.
  25567. rangeA.start = rangeA.start._getTransformedByMove( b.sourcePosition, b.targetPosition, b.howMany );
  25568. rangeA.end = rangeA.end._getTransformedByMove( b.sourcePosition, b.targetPosition, b.howMany );
  25569. return _makeMoveOperationsFromRanges( [ rangeA ], newTargetPosition );
  25570. }
  25571. //
  25572. // Special case #2 mirror.
  25573. //
  25574. const aTargetsToB = rangeB.containsPosition( a.targetPosition );
  25575. if ( aTargetsToB && rangeB.containsRange( rangeA, true ) ) {
  25576. // `a` operation is "moved together" with `b` operation.
  25577. // Here, just move `rangeA` "inside" `rangeB`.
  25578. rangeA.start = rangeA.start._getCombined( b.sourcePosition, b.getMovedRangeStart() );
  25579. rangeA.end = rangeA.end._getCombined( b.sourcePosition, b.getMovedRangeStart() );
  25580. return _makeMoveOperationsFromRanges( [ rangeA ], newTargetPosition );
  25581. }
  25582. //
  25583. // End of special case #2.
  25584. //
  25585. //
  25586. // Special case #3 + mirror.
  25587. //
  25588. // `rangeA` has a node which is an ancestor of `rangeB`. In other words, `rangeB` is inside `rangeA`
  25589. // but not on the same tree level. In such case ranges have common part but we have to treat it
  25590. // differently, because in such case those ranges are not really conflicting and should be treated like
  25591. // two separate ranges. Also we have to discard two difference parts.
  25592. const aCompB = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_11__["default"])( a.sourcePosition.getParentPath(), b.sourcePosition.getParentPath() );
  25593. if ( aCompB == 'prefix' || aCompB == 'extension' ) {
  25594. // Transform `rangeA` by `b` operation and make operation out of it, and that's all.
  25595. // Note that this is a simplified version of default case, but here we treat the common part (whole `rangeA`)
  25596. // like a one difference part.
  25597. rangeA.start = rangeA.start._getTransformedByMove( b.sourcePosition, b.targetPosition, b.howMany );
  25598. rangeA.end = rangeA.end._getTransformedByMove( b.sourcePosition, b.targetPosition, b.howMany );
  25599. return _makeMoveOperationsFromRanges( [ rangeA ], newTargetPosition );
  25600. }
  25601. //
  25602. // End of special case #3.
  25603. //
  25604. //
  25605. // Default case - ranges are on the same level or are not connected with each other.
  25606. //
  25607. // Modifier for default case.
  25608. // Modifies `aIsStrong` flag in certain conditions.
  25609. //
  25610. // If only one of operations is a remove operation, we force remove operation to be the "stronger" one
  25611. // to provide more expected results.
  25612. if ( a.type == 'remove' && b.type != 'remove' && !context.aWasUndone && !context.forceWeakRemove ) {
  25613. aIsStrong = true;
  25614. } else if ( a.type != 'remove' && b.type == 'remove' && !context.bWasUndone && !context.forceWeakRemove ) {
  25615. aIsStrong = false;
  25616. }
  25617. // Handle operation's source ranges - check how `rangeA` is affected by `b` operation.
  25618. // This will aggregate transformed ranges.
  25619. const ranges = [];
  25620. // Get the "difference part" of `a` operation source range.
  25621. // This is an array with one or two ranges. Two ranges if `rangeB` is inside `rangeA`.
  25622. const difference = rangeA.getDifference( rangeB );
  25623. for ( const range of difference ) {
  25624. // Transform those ranges by `b` operation. For example if `b` moved range from before those ranges, fix those ranges.
  25625. range.start = range.start._getTransformedByDeletion( b.sourcePosition, b.howMany );
  25626. range.end = range.end._getTransformedByDeletion( b.sourcePosition, b.howMany );
  25627. // If `b` operation targets into `rangeA` on the same level, spread `rangeA` into two ranges.
  25628. const shouldSpread = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_11__["default"])( range.start.getParentPath(), b.getMovedRangeStart().getParentPath() ) == 'same';
  25629. const newRanges = range._getTransformedByInsertion( b.getMovedRangeStart(), b.howMany, shouldSpread );
  25630. ranges.push( ...newRanges );
  25631. }
  25632. // Then, we have to manage the "common part" of both move ranges.
  25633. const common = rangeA.getIntersection( rangeB );
  25634. if ( common !== null && aIsStrong ) {
  25635. // Calculate the new position of that part of original range.
  25636. common.start = common.start._getCombined( b.sourcePosition, b.getMovedRangeStart() );
  25637. common.end = common.end._getCombined( b.sourcePosition, b.getMovedRangeStart() );
  25638. // Take care of proper range order.
  25639. //
  25640. // Put `common` at appropriate place. Keep in mind that we are interested in original order.
  25641. // Basically there are only three cases: there is zero, one or two difference ranges.
  25642. //
  25643. // If there is zero difference ranges, just push `common` in the array.
  25644. if ( ranges.length === 0 ) {
  25645. ranges.push( common );
  25646. }
  25647. // If there is one difference range, we need to check whether common part was before it or after it.
  25648. else if ( ranges.length == 1 ) {
  25649. if ( rangeB.start.isBefore( rangeA.start ) || rangeB.start.isEqual( rangeA.start ) ) {
  25650. ranges.unshift( common );
  25651. } else {
  25652. ranges.push( common );
  25653. }
  25654. }
  25655. // If there are more ranges (which means two), put common part between them. This is the only scenario
  25656. // where there could be two difference ranges so we don't have to make any comparisons.
  25657. else {
  25658. ranges.splice( 1, 0, common );
  25659. }
  25660. }
  25661. if ( ranges.length === 0 ) {
  25662. // If there are no "source ranges", nothing should be changed.
  25663. // Note that this can happen only if `aIsStrong == false` and `rangeA.isEqual( rangeB )`.
  25664. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( a.baseVersion ) ];
  25665. }
  25666. return _makeMoveOperationsFromRanges( ranges, newTargetPosition );
  25667. } );
  25668. setTransformation( _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b, context ) => {
  25669. let newTargetPosition = a.targetPosition.clone();
  25670. // Do not transform if target position is same as split insertion position and this split comes from undo.
  25671. // This should be done on relations but it is too much work for now as it would require relations working in collaboration.
  25672. // We need to make a decision how we will resolve such conflict and this is less harmful way.
  25673. if ( !a.targetPosition.isEqual( b.insertionPosition ) || !b.graveyardPosition || context.abRelation == 'moveTargetAfter' ) {
  25674. newTargetPosition = a.targetPosition._getTransformedBySplitOperation( b );
  25675. }
  25676. // Case 1:
  25677. //
  25678. // Last element in the moved range got split.
  25679. //
  25680. // In this case the default range transformation will not work correctly as the element created by
  25681. // split operation would be outside the range. The range to move needs to be fixed manually.
  25682. //
  25683. const moveRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
  25684. if ( moveRange.end.isEqual( b.insertionPosition ) ) {
  25685. // Do it only if this is a "natural" split, not a one that comes from undo.
  25686. // If this is undo split, only `targetPosition` needs to be changed (if the move is a remove).
  25687. if ( !b.graveyardPosition ) {
  25688. a.howMany++;
  25689. }
  25690. a.targetPosition = newTargetPosition;
  25691. return [ a ];
  25692. }
  25693. // Case 2:
  25694. //
  25695. // Split happened between the moved nodes. In this case two ranges to move need to be generated.
  25696. //
  25697. // Characters `ozba` are moved to the end of paragraph `Xyz` but split happened.
  25698. // <p>F[oz|ba]r</p><p>Xyz</p>
  25699. //
  25700. // After split:
  25701. // <p>F[oz</p><p>ba]r</p><p>Xyz</p>
  25702. //
  25703. // Correct ranges:
  25704. // <p>F[oz]</p><p>[ba]r</p><p>Xyz</p>
  25705. //
  25706. // After move:
  25707. // <p>F</p><p>r</p><p>Xyzozba</p>
  25708. //
  25709. if ( moveRange.start.hasSameParentAs( b.splitPosition ) && moveRange.containsPosition( b.splitPosition ) ) {
  25710. let rightRange = new _range__WEBPACK_IMPORTED_MODULE_9__["default"]( b.splitPosition, moveRange.end );
  25711. rightRange = rightRange._getTransformedBySplitOperation( b );
  25712. const ranges = [
  25713. new _range__WEBPACK_IMPORTED_MODULE_9__["default"]( moveRange.start, b.splitPosition ),
  25714. rightRange
  25715. ];
  25716. return _makeMoveOperationsFromRanges( ranges, newTargetPosition );
  25717. }
  25718. // Case 3:
  25719. //
  25720. // Move operation targets at the split position. We need to decide if the nodes should be inserted
  25721. // at the end of the split element or at the beginning of the new element.
  25722. //
  25723. if ( a.targetPosition.isEqual( b.splitPosition ) && context.abRelation == 'insertAtSource' ) {
  25724. newTargetPosition = b.moveTargetPosition;
  25725. }
  25726. // Case 4:
  25727. //
  25728. // Move operation targets just after the split element. We need to decide if the nodes should be inserted
  25729. // between two parts of split element, or after the new element.
  25730. //
  25731. // Split at `|`, while move operation moves `<p>Xyz</p>` and targets at `^`:
  25732. // <p>Foo|bar</p>^<p>baz</p>
  25733. // <p>Foo</p>^<p>bar</p><p>baz</p> or <p>Foo</p><p>bar</p>^<p>baz</p>?
  25734. //
  25735. // If there is no contextual information between operations (for example, they come from collaborative
  25736. // editing), we don't want to put some unrelated content (move) between parts of related content (split parts).
  25737. // However, if the split is from undo, in the past, the moved content might be targeting between the
  25738. // split parts, meaning that was exactly user's intention:
  25739. //
  25740. // <p>Foo</p>^<p>bar</p> <--- original situation, in "past".
  25741. // <p>Foobar</p>^ <--- after merge target position is transformed.
  25742. // <p>Foo|bar</p>^ <--- then the merge is undone, and split happens, which leads us to current situation.
  25743. //
  25744. // In this case it is pretty clear that the intention was to put new paragraph between those nodes,
  25745. // so we need to transform accordingly. We can detect this scenario thanks to relations.
  25746. //
  25747. if ( a.targetPosition.isEqual( b.insertionPosition ) && context.abRelation == 'insertBetween' ) {
  25748. newTargetPosition = a.targetPosition;
  25749. }
  25750. // The default case.
  25751. //
  25752. const transformed = moveRange._getTransformedBySplitOperation( b );
  25753. const ranges = [ transformed ];
  25754. // Case 5:
  25755. //
  25756. // Moved range contains graveyard element used by split operation. Add extra move operation to the result.
  25757. //
  25758. if ( b.graveyardPosition ) {
  25759. const movesGraveyardElement = moveRange.start.isEqual( b.graveyardPosition ) || moveRange.containsPosition( b.graveyardPosition );
  25760. if ( a.howMany > 1 && movesGraveyardElement && !context.aWasUndone ) {
  25761. ranges.push( _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.insertionPosition, 1 ) );
  25762. }
  25763. }
  25764. return _makeMoveOperationsFromRanges( ranges, newTargetPosition );
  25765. } );
  25766. setTransformation( _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b, context ) => {
  25767. const movedRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
  25768. if ( b.deletionPosition.hasSameParentAs( a.sourcePosition ) && movedRange.containsPosition( b.sourcePosition ) ) {
  25769. if ( a.type == 'remove' && !context.forceWeakRemove ) {
  25770. // Case 1:
  25771. //
  25772. // The element to remove got merged.
  25773. //
  25774. // Merge operation does support merging elements which are not siblings. So it would not be a problem
  25775. // from technical point of view. However, if the element was removed, the intention of the user
  25776. // deleting it was to have it all deleted. From user experience point of view, moving back the
  25777. // removed nodes might be unexpected. This means that in this scenario we will reverse merging and remove the element.
  25778. //
  25779. if ( !context.aWasUndone ) {
  25780. const results = [];
  25781. let gyMoveSource = b.graveyardPosition.clone();
  25782. let splitNodesMoveSource = b.targetPosition._getTransformedByMergeOperation( b );
  25783. if ( a.howMany > 1 ) {
  25784. results.push( new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( a.sourcePosition, a.howMany - 1, a.targetPosition, 0 ) );
  25785. gyMoveSource = gyMoveSource._getTransformedByMove( a.sourcePosition, a.targetPosition, a.howMany - 1 );
  25786. splitNodesMoveSource = splitNodesMoveSource._getTransformedByMove( a.sourcePosition, a.targetPosition, a.howMany - 1 );
  25787. }
  25788. const gyMoveTarget = b.deletionPosition._getCombined( a.sourcePosition, a.targetPosition );
  25789. const gyMove = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( gyMoveSource, 1, gyMoveTarget, 0 );
  25790. const splitNodesMoveTargetPath = gyMove.getMovedRangeStart().path.slice();
  25791. splitNodesMoveTargetPath.push( 0 );
  25792. const splitNodesMoveTarget = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( gyMove.targetPosition.root, splitNodesMoveTargetPath );
  25793. splitNodesMoveSource = splitNodesMoveSource._getTransformedByMove( gyMoveSource, gyMoveTarget, 1 );
  25794. const splitNodesMove = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( splitNodesMoveSource, b.howMany, splitNodesMoveTarget, 0 );
  25795. results.push( gyMove );
  25796. results.push( splitNodesMove );
  25797. return results;
  25798. }
  25799. } else {
  25800. // Case 2:
  25801. //
  25802. // The element to move got merged and it was the only element to move.
  25803. // In this case just don't do anything, leave the node in the graveyard. Without special case
  25804. // it would be a move operation that moves 0 nodes, so maybe it is better just to return no-op.
  25805. //
  25806. if ( a.howMany == 1 ) {
  25807. if ( !context.bWasUndone ) {
  25808. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  25809. } else {
  25810. a.sourcePosition = b.graveyardPosition.clone();
  25811. a.targetPosition = a.targetPosition._getTransformedByMergeOperation( b );
  25812. return [ a ];
  25813. }
  25814. }
  25815. }
  25816. }
  25817. // The default case.
  25818. //
  25819. const moveRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
  25820. const transformed = moveRange._getTransformedByMergeOperation( b );
  25821. a.sourcePosition = transformed.start;
  25822. a.howMany = transformed.end.offset - transformed.start.offset;
  25823. a.targetPosition = a.targetPosition._getTransformedByMergeOperation( b );
  25824. return [ a ];
  25825. } );
  25826. // -----------------------
  25827. setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  25828. a.position = a.position._getTransformedByInsertOperation( b );
  25829. return [ a ];
  25830. } );
  25831. setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b ) => {
  25832. // Case 1:
  25833. //
  25834. // Element to rename got merged, so it was moved to `b.graveyardPosition`.
  25835. //
  25836. if ( a.position.isEqual( b.deletionPosition ) ) {
  25837. a.position = b.graveyardPosition.clone();
  25838. a.position.stickiness = 'toNext';
  25839. return [ a ];
  25840. }
  25841. a.position = a.position._getTransformedByMergeOperation( b );
  25842. return [ a ];
  25843. } );
  25844. setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b ) => {
  25845. a.position = a.position._getTransformedByMoveOperation( b );
  25846. return [ a ];
  25847. } );
  25848. setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], ( a, b, context ) => {
  25849. if ( a.position.isEqual( b.position ) ) {
  25850. if ( context.aIsStrong ) {
  25851. a.oldName = b.newName;
  25852. } else {
  25853. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  25854. }
  25855. }
  25856. return [ a ];
  25857. } );
  25858. setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b ) => {
  25859. // Case 1:
  25860. //
  25861. // The element to rename has been split. In this case, the new element should be also renamed.
  25862. //
  25863. // User decides to change the paragraph to a list item:
  25864. // <paragraph>Foobar</paragraph>
  25865. //
  25866. // However, in meantime, split happens:
  25867. // <paragraph>Foo</paragraph><paragraph>bar</paragraph>
  25868. //
  25869. // As a result, rename both elements:
  25870. // <listItem>Foo</listItem><listItem>bar</listItem>
  25871. //
  25872. const renamePath = a.position.path;
  25873. const splitPath = b.splitPosition.getParentPath();
  25874. if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_11__["default"])( renamePath, splitPath ) == 'same' && !b.graveyardPosition ) {
  25875. const extraRename = new _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"]( a.position.getShiftedBy( 1 ), a.oldName, a.newName, 0 );
  25876. return [ a, extraRename ];
  25877. }
  25878. // The default case.
  25879. //
  25880. a.position = a.position._getTransformedBySplitOperation( b );
  25881. return [ a ];
  25882. } );
  25883. // -----------------------
  25884. setTransformation( _rootattributeoperation__WEBPACK_IMPORTED_MODULE_5__["default"], _rootattributeoperation__WEBPACK_IMPORTED_MODULE_5__["default"], ( a, b, context ) => {
  25885. if ( a.root === b.root && a.key === b.key ) {
  25886. if ( !context.aIsStrong || a.newValue === b.newValue ) {
  25887. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  25888. } else {
  25889. a.oldValue = b.newValue;
  25890. }
  25891. }
  25892. return [ a ];
  25893. } );
  25894. // -----------------------
  25895. setTransformation( _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  25896. // The default case.
  25897. //
  25898. if ( a.splitPosition.hasSameParentAs( b.position ) && a.splitPosition.offset < b.position.offset ) {
  25899. a.howMany += b.howMany;
  25900. }
  25901. a.splitPosition = a.splitPosition._getTransformedByInsertOperation( b );
  25902. a.insertionPosition = a.insertionPosition._getTransformedByInsertOperation( b );
  25903. return [ a ];
  25904. } );
  25905. setTransformation( _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b, context ) => {
  25906. // Case 1:
  25907. //
  25908. // Split element got merged. If two different elements were merged, clients will have different content.
  25909. //
  25910. // Example. Merge at `{}`, split at `[]`:
  25911. // <heading>Foo</heading>{}<paragraph>B[]ar</paragraph>
  25912. //
  25913. // On merge side it will look like this:
  25914. // <heading>FooB[]ar</heading>
  25915. // <heading>FooB</heading><heading>ar</heading>
  25916. //
  25917. // On split side it will look like this:
  25918. // <heading>Foo</heading>{}<paragraph>B</paragraph><paragraph>ar</paragraph>
  25919. // <heading>FooB</heading><paragraph>ar</paragraph>
  25920. //
  25921. // Clearly, the second element is different for both clients.
  25922. //
  25923. // We could use the removed merge element from graveyard as a split element but then clients would have a different
  25924. // model state (in graveyard), because the split side client would still have an element in graveyard (removed by merge).
  25925. //
  25926. // To overcome this, in `SplitOperation` x `MergeOperation` transformation we will add additional `SplitOperation`
  25927. // in the graveyard, which will actually clone the merged-and-deleted element. Then, that cloned element will be
  25928. // used for splitting. Example below.
  25929. //
  25930. // Original state:
  25931. // <heading>Foo</heading>{}<paragraph>B[]ar</paragraph>
  25932. //
  25933. // Merge side client:
  25934. //
  25935. // After merge:
  25936. // <heading>FooB[]ar</heading> graveyard: <paragraph></paragraph>
  25937. //
  25938. // Extra split:
  25939. // <heading>FooB[]ar</heading> graveyard: <paragraph></paragraph><paragraph></paragraph>
  25940. //
  25941. // Use the "cloned" element from graveyard:
  25942. // <heading>FooB</heading><paragraph>ar</paragraph> graveyard: <paragraph></paragraph>
  25943. //
  25944. // Split side client:
  25945. //
  25946. // After split:
  25947. // <heading>Foo</heading>{}<paragraph>B</paragraph><paragraph>ar</paragraph>
  25948. //
  25949. // After merge:
  25950. // <heading>FooB</heading><paragraph>ar</paragraph> graveyard: <paragraph></paragraph>
  25951. //
  25952. // This special case scenario only applies if the original split operation clones the split element.
  25953. // If the original split operation has `graveyardPosition` set, it all doesn't have sense because split operation
  25954. // knows exactly which element it should use. So there would be no original problem with different contents.
  25955. //
  25956. // Additionally, the special case applies only if the merge wasn't already undone.
  25957. //
  25958. if ( !a.graveyardPosition && !context.bWasUndone && a.splitPosition.hasSameParentAs( b.sourcePosition ) ) {
  25959. const splitPath = b.graveyardPosition.path.slice();
  25960. splitPath.push( 0 );
  25961. const splitPosition = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( b.graveyardPosition.root, splitPath );
  25962. const insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( b.graveyardPosition.root, splitPath ) );
  25963. const additionalSplit = new _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"]( splitPosition, 0, insertionPosition, null, 0 );
  25964. a.splitPosition = a.splitPosition._getTransformedByMergeOperation( b );
  25965. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  25966. a.graveyardPosition = additionalSplit.insertionPosition.clone();
  25967. a.graveyardPosition.stickiness = 'toNext';
  25968. return [ additionalSplit, a ];
  25969. }
  25970. // The default case.
  25971. //
  25972. if ( a.splitPosition.hasSameParentAs( b.deletionPosition ) && !a.splitPosition.isAfter( b.deletionPosition ) ) {
  25973. a.howMany--;
  25974. }
  25975. if ( a.splitPosition.hasSameParentAs( b.targetPosition ) ) {
  25976. a.howMany += b.howMany;
  25977. }
  25978. a.splitPosition = a.splitPosition._getTransformedByMergeOperation( b );
  25979. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  25980. if ( a.graveyardPosition ) {
  25981. a.graveyardPosition = a.graveyardPosition._getTransformedByMergeOperation( b );
  25982. }
  25983. return [ a ];
  25984. } );
  25985. setTransformation( _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b, context ) => {
  25986. const rangeToMove = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.sourcePosition, b.howMany );
  25987. if ( a.graveyardPosition ) {
  25988. // Case 1:
  25989. //
  25990. // Split operation graveyard node was moved. In this case move operation is stronger. Since graveyard element
  25991. // is already moved to the correct position, we need to only move the nodes after the split position.
  25992. // This will be done by `MoveOperation` instead of `SplitOperation`.
  25993. //
  25994. const gyElementMoved = rangeToMove.start.isEqual( a.graveyardPosition ) || rangeToMove.containsPosition( a.graveyardPosition );
  25995. if ( !context.bWasUndone && gyElementMoved ) {
  25996. const sourcePosition = a.splitPosition._getTransformedByMoveOperation( b );
  25997. const newParentPosition = a.graveyardPosition._getTransformedByMoveOperation( b );
  25998. const newTargetPath = newParentPosition.path.slice();
  25999. newTargetPath.push( 0 );
  26000. const newTargetPosition = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( newParentPosition.root, newTargetPath );
  26001. const moveOp = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( sourcePosition, a.howMany, newTargetPosition, 0 );
  26002. return [ moveOp ];
  26003. }
  26004. a.graveyardPosition = a.graveyardPosition._getTransformedByMoveOperation( b );
  26005. }
  26006. // Case 2:
  26007. //
  26008. // Split is at a position where nodes were moved.
  26009. //
  26010. // This is a scenario described in `MoveOperation` x `SplitOperation` transformation but from the
  26011. // "split operation point of view".
  26012. //
  26013. const splitAtTarget = a.splitPosition.isEqual( b.targetPosition );
  26014. if ( splitAtTarget && ( context.baRelation == 'insertAtSource' || context.abRelation == 'splitBefore' ) ) {
  26015. a.howMany += b.howMany;
  26016. a.splitPosition = a.splitPosition._getTransformedByDeletion( b.sourcePosition, b.howMany );
  26017. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  26018. return [ a ];
  26019. }
  26020. if ( splitAtTarget && context.abRelation && context.abRelation.howMany ) {
  26021. const { howMany, offset } = context.abRelation;
  26022. a.howMany += howMany;
  26023. a.splitPosition = a.splitPosition.getShiftedBy( offset );
  26024. return [ a ];
  26025. }
  26026. // Case 3:
  26027. //
  26028. // If the split position is inside the moved range, we need to shift the split position to a proper place.
  26029. // The position cannot be moved together with moved range because that would result in splitting of an incorrect element.
  26030. //
  26031. // Characters `bc` should be moved to the second paragraph while split position is between them:
  26032. // <paragraph>A[b|c]d</paragraph><paragraph>Xyz</paragraph>
  26033. //
  26034. // After move, new split position is incorrect:
  26035. // <paragraph>Ad</paragraph><paragraph>Xb|cyz</paragraph>
  26036. //
  26037. // Correct split position:
  26038. // <paragraph>A|d</paragraph><paragraph>Xbcyz</paragraph>
  26039. //
  26040. // After split:
  26041. // <paragraph>A</paragraph><paragraph>d</paragraph><paragraph>Xbcyz</paragraph>
  26042. //
  26043. if ( a.splitPosition.hasSameParentAs( b.sourcePosition ) && rangeToMove.containsPosition( a.splitPosition ) ) {
  26044. const howManyRemoved = b.howMany - ( a.splitPosition.offset - b.sourcePosition.offset );
  26045. a.howMany -= howManyRemoved;
  26046. if ( a.splitPosition.hasSameParentAs( b.targetPosition ) && a.splitPosition.offset < b.targetPosition.offset ) {
  26047. a.howMany += b.howMany;
  26048. }
  26049. a.splitPosition = b.sourcePosition.clone();
  26050. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  26051. return [ a ];
  26052. }
  26053. // The default case.
  26054. // Don't change `howMany` if move operation does not really move anything.
  26055. //
  26056. if ( !b.sourcePosition.isEqual( b.targetPosition ) ) {
  26057. if ( a.splitPosition.hasSameParentAs( b.sourcePosition ) && a.splitPosition.offset <= b.sourcePosition.offset ) {
  26058. a.howMany -= b.howMany;
  26059. }
  26060. if ( a.splitPosition.hasSameParentAs( b.targetPosition ) && a.splitPosition.offset < b.targetPosition.offset ) {
  26061. a.howMany += b.howMany;
  26062. }
  26063. }
  26064. // Change position stickiness to force a correct transformation.
  26065. a.splitPosition.stickiness = 'toNone';
  26066. a.splitPosition = a.splitPosition._getTransformedByMoveOperation( b );
  26067. a.splitPosition.stickiness = 'toNext';
  26068. if ( a.graveyardPosition ) {
  26069. a.insertionPosition = a.insertionPosition._getTransformedByMoveOperation( b );
  26070. } else {
  26071. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  26072. }
  26073. return [ a ];
  26074. } );
  26075. setTransformation( _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b, context ) => {
  26076. // Case 1:
  26077. //
  26078. // Split at the same position.
  26079. //
  26080. // If there already was a split at the same position as in `a` operation, it means that the intention
  26081. // conveyed by `a` operation has already been fulfilled and `a` should not do anything (to avoid double split).
  26082. //
  26083. // However, there is a difference if these are new splits or splits created by undo. These have different
  26084. // intentions. Also splits moving back different elements from graveyard have different intentions. They
  26085. // are just different operations.
  26086. //
  26087. // So we cancel split operation only if it was really identical.
  26088. //
  26089. // Also, there is additional case, where split operations aren't identical and should not be cancelled, however the
  26090. // default transformation is incorrect too.
  26091. //
  26092. if ( a.splitPosition.isEqual( b.splitPosition ) ) {
  26093. if ( !a.graveyardPosition && !b.graveyardPosition ) {
  26094. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  26095. }
  26096. if ( a.graveyardPosition && b.graveyardPosition && a.graveyardPosition.isEqual( b.graveyardPosition ) ) {
  26097. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  26098. }
  26099. // Use context to know that the `a.splitPosition` should stay where it is.
  26100. // This happens during undo when first a merge operation moved nodes to `a.splitPosition` and now `b` operation undoes that merge.
  26101. if ( context.abRelation == 'splitBefore' ) {
  26102. // Since split is at the same position, there are no nodes left to split.
  26103. a.howMany = 0;
  26104. // Note: there was `if ( a.graveyardPosition )` here but it was uncovered in tests and I couldn't find any scenarios for now.
  26105. // That would have to be a `SplitOperation` that didn't come from undo but is transformed by operations that were undone.
  26106. // It could happen if `context` is enabled in collaboration.
  26107. a.graveyardPosition = a.graveyardPosition._getTransformedBySplitOperation( b );
  26108. return [ a ];
  26109. }
  26110. }
  26111. // Case 2:
  26112. //
  26113. // Same node is using to split different elements. This happens in undo when previously same element was merged to
  26114. // two different elements. This is described in `MergeOperation` x `MergeOperation` transformation.
  26115. //
  26116. // In this case we will follow the same logic. We will assume that `insertionPosition` is same for both
  26117. // split operations. This might not always be true but in the real cases that were experienced it was. After all,
  26118. // if these splits are reverses of merge operations that were merging the same element, then the `insertionPosition`
  26119. // should be same for both of those splits.
  26120. //
  26121. // Again, we will decide which operation is stronger by checking if split happens in graveyard or in non-graveyard root.
  26122. //
  26123. if ( a.graveyardPosition && b.graveyardPosition && a.graveyardPosition.isEqual( b.graveyardPosition ) ) {
  26124. const aInGraveyard = a.splitPosition.root.rootName == '$graveyard';
  26125. const bInGraveyard = b.splitPosition.root.rootName == '$graveyard';
  26126. // If `aIsWeak` it means that `a` points to graveyard while `b` doesn't. Don't move nodes then.
  26127. const aIsWeak = aInGraveyard && !bInGraveyard;
  26128. // If `bIsWeak` it means that `b` points to graveyard while `a` doesn't. Force moving nodes then.
  26129. const bIsWeak = bInGraveyard && !aInGraveyard;
  26130. // Force move if `b` is weak or neither operation is weak but `a` is stronger through `context.aIsStrong`.
  26131. const forceMove = bIsWeak || ( !aIsWeak && context.aIsStrong );
  26132. if ( forceMove ) {
  26133. const result = [];
  26134. // First we need to move any nodes split by `b` back to where they were.
  26135. // Do it only if `b` actually moved something.
  26136. if ( b.howMany ) {
  26137. result.push( new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( b.moveTargetPosition, b.howMany, b.splitPosition, 0 ) );
  26138. }
  26139. // Then we need to move nodes from `a` split position to their new element.
  26140. // Do it only if `a` actually should move something.
  26141. if ( a.howMany ) {
  26142. result.push( new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( a.splitPosition, a.howMany, a.moveTargetPosition, 0 ) );
  26143. }
  26144. return result;
  26145. } else {
  26146. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  26147. }
  26148. }
  26149. if ( a.graveyardPosition ) {
  26150. a.graveyardPosition = a.graveyardPosition._getTransformedBySplitOperation( b );
  26151. }
  26152. // Case 3:
  26153. //
  26154. // Position where operation `b` inserted a new node after split is the same as the operation `a` split position.
  26155. // As in similar cases, there is ambiguity if the split should be before the new node (created by `b`) or after.
  26156. //
  26157. if ( a.splitPosition.isEqual( b.insertionPosition ) && context.abRelation == 'splitBefore' ) {
  26158. a.howMany++;
  26159. return [ a ];
  26160. }
  26161. // Case 4:
  26162. //
  26163. // This is a mirror to the case 2. above.
  26164. //
  26165. if ( b.splitPosition.isEqual( a.insertionPosition ) && context.baRelation == 'splitBefore' ) {
  26166. const newPositionPath = b.insertionPosition.path.slice();
  26167. newPositionPath.push( 0 );
  26168. const newPosition = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( b.insertionPosition.root, newPositionPath );
  26169. const moveOp = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( a.insertionPosition, 1, newPosition, 0 );
  26170. return [ a, moveOp ];
  26171. }
  26172. // The default case.
  26173. //
  26174. if ( a.splitPosition.hasSameParentAs( b.splitPosition ) && a.splitPosition.offset < b.splitPosition.offset ) {
  26175. a.howMany -= b.howMany;
  26176. }
  26177. a.splitPosition = a.splitPosition._getTransformedBySplitOperation( b );
  26178. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  26179. return [ a ];
  26180. } );
  26181. // Checks whether `MoveOperation` `targetPosition` is inside a node from the moved range of the other `MoveOperation`.
  26182. //
  26183. // @private
  26184. // @param {module:engine/model/operation/moveoperation~MoveOperation} a
  26185. // @param {module:engine/model/operation/moveoperation~MoveOperation} b
  26186. // @returns {Boolean}
  26187. function _moveTargetIntoMovedRange( a, b ) {
  26188. return a.targetPosition._getTransformedByDeletion( b.sourcePosition, b.howMany ) === null;
  26189. }
  26190. // Helper function for `MoveOperation` x `MoveOperation` transformation. Converts given ranges and target position to
  26191. // move operations and returns them.
  26192. //
  26193. // Ranges and target position will be transformed on-the-fly when generating operations.
  26194. //
  26195. // Given `ranges` should be in the order of how they were in the original transformed operation.
  26196. //
  26197. // Given `targetPosition` is the target position of the first range from `ranges`.
  26198. //
  26199. // @private
  26200. // @param {Array.<module:engine/model/range~Range>} ranges
  26201. // @param {module:engine/model/position~Position} targetPosition
  26202. // @returns {Array.<module:engine/model/operation/moveoperation~MoveOperation>}
  26203. function _makeMoveOperationsFromRanges( ranges, targetPosition ) {
  26204. // At this moment we have some ranges and a target position, to which those ranges should be moved.
  26205. // Order in `ranges` array is the go-to order of after transformation.
  26206. //
  26207. // We are almost done. We have `ranges` and `targetPosition` to make operations from.
  26208. // Unfortunately, those operations may affect each other. Precisely, first operation after move
  26209. // may affect source range and target position of second and third operation. Same with second
  26210. // operation affecting third.
  26211. //
  26212. // We need to fix those source ranges and target positions once again, before converting `ranges` to operations.
  26213. const operations = [];
  26214. // Keep in mind that nothing will be transformed if there is just one range in `ranges`.
  26215. for ( let i = 0; i < ranges.length; i++ ) {
  26216. // Create new operation out of a range and target position.
  26217. const range = ranges[ i ];
  26218. const op = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"](
  26219. range.start,
  26220. range.end.offset - range.start.offset,
  26221. targetPosition,
  26222. 0
  26223. );
  26224. operations.push( op );
  26225. // Transform other ranges by the generated operation.
  26226. for ( let j = i + 1; j < ranges.length; j++ ) {
  26227. // All ranges in `ranges` array should be:
  26228. //
  26229. // * non-intersecting (these are part of original operation source range), and
  26230. // * `targetPosition` does not target into them (opposite would mean that transformed operation targets "inside itself").
  26231. //
  26232. // This means that the transformation will be "clean" and always return one result.
  26233. ranges[ j ] = ranges[ j ]._getTransformedByMove( op.sourcePosition, op.targetPosition, op.howMany )[ 0 ];
  26234. }
  26235. targetPosition = targetPosition._getTransformedByMove( op.sourcePosition, op.targetPosition, op.howMany );
  26236. }
  26237. return operations;
  26238. }
  26239. /***/ }),
  26240. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js":
  26241. /*!******************************************************************************!*\
  26242. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js ***!
  26243. \******************************************************************************/
  26244. /*! exports provided: _insert, _remove, _move, _setAttribute, _normalizeNodes */
  26245. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  26246. "use strict";
  26247. __webpack_require__.r(__webpack_exports__);
  26248. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_insert", function() { return _insert; });
  26249. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_remove", function() { return _remove; });
  26250. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_move", function() { return _move; });
  26251. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_setAttribute", function() { return _setAttribute; });
  26252. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_normalizeNodes", function() { return _normalizeNodes; });
  26253. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
  26254. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  26255. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  26256. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  26257. /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js");
  26258. /* harmony import */ var _nodelist__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../nodelist */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js");
  26259. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  26260. /**
  26261. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  26262. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  26263. */
  26264. /**
  26265. * @module engine/model/operation/utils
  26266. */
  26267. /**
  26268. * Contains functions used for composing model tree by {@link module:engine/model/operation/operation~Operation operations}.
  26269. * Those functions are built on top of {@link module:engine/model/node~Node node}, and it's child classes', APIs.
  26270. *
  26271. * @protected
  26272. * @namespace utils
  26273. */
  26274. /**
  26275. * Inserts given nodes at given position.
  26276. *
  26277. * @protected
  26278. * @function module:engine/model/operation/utils~utils.insert
  26279. * @param {module:engine/model/position~Position} position Position at which nodes should be inserted.
  26280. * @param {module:engine/model/node~NodeSet} nodes Nodes to insert.
  26281. * @returns {module:engine/model/range~Range} Range spanning over inserted elements.
  26282. */
  26283. function _insert( position, nodes ) {
  26284. nodes = _normalizeNodes( nodes );
  26285. // We have to count offset before inserting nodes because they can get merged and we would get wrong offsets.
  26286. const offset = nodes.reduce( ( sum, node ) => sum + node.offsetSize, 0 );
  26287. const parent = position.parent;
  26288. // Insertion might be in a text node, we should split it if that's the case.
  26289. _splitNodeAtPosition( position );
  26290. const index = position.index;
  26291. // Insert nodes at given index. After splitting we have a proper index and insertion is between nodes,
  26292. // using basic `Element` API.
  26293. parent._insertChild( index, nodes );
  26294. // Merge text nodes, if possible. Merging is needed only at points where inserted nodes "touch" "old" nodes.
  26295. _mergeNodesAtIndex( parent, index + nodes.length );
  26296. _mergeNodesAtIndex( parent, index );
  26297. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( position, position.getShiftedBy( offset ) );
  26298. }
  26299. /**
  26300. * Removed nodes in given range. Only {@link module:engine/model/range~Range#isFlat flat} ranges are accepted.
  26301. *
  26302. * @protected
  26303. * @function module:engine/model/operation/utils~utils._remove
  26304. * @param {module:engine/model/range~Range} range Range containing nodes to remove.
  26305. * @returns {Array.<module:engine/model/node~Node>}
  26306. */
  26307. function _remove( range ) {
  26308. if ( !range.isFlat ) {
  26309. /**
  26310. * Trying to remove a range which starts and ends in different element.
  26311. *
  26312. * @error operation-utils-remove-range-not-flat
  26313. */
  26314. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"](
  26315. 'operation-utils-remove-range-not-flat',
  26316. this
  26317. );
  26318. }
  26319. const parent = range.start.parent;
  26320. // Range may be inside text nodes, we have to split them if that's the case.
  26321. _splitNodeAtPosition( range.start );
  26322. _splitNodeAtPosition( range.end );
  26323. // Remove the text nodes using basic `Element` API.
  26324. const removed = parent._removeChildren( range.start.index, range.end.index - range.start.index );
  26325. // Merge text nodes, if possible. After some nodes were removed, node before and after removed range will be
  26326. // touching at the position equal to the removed range beginning. We check merging possibility there.
  26327. _mergeNodesAtIndex( parent, range.start.index );
  26328. return removed;
  26329. }
  26330. /**
  26331. * Moves nodes in given range to given target position. Only {@link module:engine/model/range~Range#isFlat flat} ranges are accepted.
  26332. *
  26333. * @protected
  26334. * @function module:engine/model/operation/utils~utils.move
  26335. * @param {module:engine/model/range~Range} sourceRange Range containing nodes to move.
  26336. * @param {module:engine/model/position~Position} targetPosition Position to which nodes should be moved.
  26337. * @returns {module:engine/model/range~Range} Range containing moved nodes.
  26338. */
  26339. function _move( sourceRange, targetPosition ) {
  26340. if ( !sourceRange.isFlat ) {
  26341. /**
  26342. * Trying to move a range which starts and ends in different element.
  26343. *
  26344. * @error operation-utils-move-range-not-flat
  26345. */
  26346. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"](
  26347. 'operation-utils-move-range-not-flat',
  26348. this
  26349. );
  26350. }
  26351. const nodes = _remove( sourceRange );
  26352. // We have to fix `targetPosition` because model changed after nodes from `sourceRange` got removed and
  26353. // that change might have an impact on `targetPosition`.
  26354. targetPosition = targetPosition._getTransformedByDeletion( sourceRange.start, sourceRange.end.offset - sourceRange.start.offset );
  26355. return _insert( targetPosition, nodes );
  26356. }
  26357. /**
  26358. * Sets given attribute on nodes in given range. The attributes are only set on top-level nodes of the range, not on its children.
  26359. *
  26360. * @protected
  26361. * @function module:engine/model/operation/utils~utils._setAttribute
  26362. * @param {module:engine/model/range~Range} range Range containing nodes that should have the attribute set. Must be a flat range.
  26363. * @param {String} key Key of attribute to set.
  26364. * @param {*} value Attribute value.
  26365. */
  26366. function _setAttribute( range, key, value ) {
  26367. // Range might start or end in text nodes, so we have to split them.
  26368. _splitNodeAtPosition( range.start );
  26369. _splitNodeAtPosition( range.end );
  26370. // Iterate over all items in the range.
  26371. for ( const item of range.getItems( { shallow: true } ) ) {
  26372. // Iterator will return `TextProxy` instances but we know that those text proxies will
  26373. // always represent full text nodes (this is guaranteed thanks to splitting we did before).
  26374. // So, we can operate on those text proxies' text nodes.
  26375. const node = item.is( '$textProxy' ) ? item.textNode : item;
  26376. if ( value !== null ) {
  26377. node._setAttribute( key, value );
  26378. } else {
  26379. node._removeAttribute( key );
  26380. }
  26381. // After attributes changing it may happen that some text nodes can be merged. Try to merge with previous node.
  26382. _mergeNodesAtIndex( node.parent, node.index );
  26383. }
  26384. // Try to merge last changed node with it's previous sibling (not covered by the loop above).
  26385. _mergeNodesAtIndex( range.end.parent, range.end.index );
  26386. }
  26387. /**
  26388. * Normalizes given object or an array of objects to an array of {@link module:engine/model/node~Node nodes}. See
  26389. * {@link module:engine/model/node~NodeSet NodeSet} for details on how normalization is performed.
  26390. *
  26391. * @protected
  26392. * @function module:engine/model/operation/utils~utils.normalizeNodes
  26393. * @param {module:engine/model/node~NodeSet} nodes Objects to normalize.
  26394. * @returns {Array.<module:engine/model/node~Node>} Normalized nodes.
  26395. */
  26396. function _normalizeNodes( nodes ) {
  26397. const normalized = [];
  26398. if ( !( nodes instanceof Array ) ) {
  26399. nodes = [ nodes ];
  26400. }
  26401. // Convert instances of classes other than Node.
  26402. for ( let i = 0; i < nodes.length; i++ ) {
  26403. if ( typeof nodes[ i ] == 'string' ) {
  26404. normalized.push( new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( nodes[ i ] ) );
  26405. } else if ( nodes[ i ] instanceof _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  26406. normalized.push( new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( nodes[ i ].data, nodes[ i ].getAttributes() ) );
  26407. } else if ( nodes[ i ] instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_4__["default"] || nodes[ i ] instanceof _nodelist__WEBPACK_IMPORTED_MODULE_5__["default"] ) {
  26408. for ( const child of nodes[ i ] ) {
  26409. normalized.push( child );
  26410. }
  26411. } else if ( nodes[ i ] instanceof _node__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  26412. normalized.push( nodes[ i ] );
  26413. }
  26414. // Skip unrecognized type.
  26415. }
  26416. // Merge text nodes.
  26417. for ( let i = 1; i < normalized.length; i++ ) {
  26418. const node = normalized[ i ];
  26419. const prev = normalized[ i - 1 ];
  26420. if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] && prev instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] && _haveSameAttributes( node, prev ) ) {
  26421. // Doing this instead changing `prev.data` because `data` is readonly.
  26422. normalized.splice( i - 1, 2, new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( prev.data + node.data, prev.getAttributes() ) );
  26423. i--;
  26424. }
  26425. }
  26426. return normalized;
  26427. }
  26428. // Checks if nodes before and after given index in given element are {@link module:engine/model/text~Text text nodes} and
  26429. // merges them into one node if they have same attributes.
  26430. //
  26431. // Merging is done by removing two text nodes and inserting a new text node containing data from both merged text nodes.
  26432. //
  26433. // @private
  26434. // @param {module:engine/model/element~Element} element Parent element of nodes to merge.
  26435. // @param {Number} index Index between nodes to merge.
  26436. function _mergeNodesAtIndex( element, index ) {
  26437. const nodeBefore = element.getChild( index - 1 );
  26438. const nodeAfter = element.getChild( index );
  26439. // Check if both of those nodes are text objects with same attributes.
  26440. if ( nodeBefore && nodeAfter && nodeBefore.is( '$text' ) && nodeAfter.is( '$text' ) && _haveSameAttributes( nodeBefore, nodeAfter ) ) {
  26441. // Append text of text node after index to the before one.
  26442. const mergedNode = new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( nodeBefore.data + nodeAfter.data, nodeBefore.getAttributes() );
  26443. // Remove separate text nodes.
  26444. element._removeChildren( index - 1, 2 );
  26445. // Insert merged text node.
  26446. element._insertChild( index - 1, mergedNode );
  26447. }
  26448. }
  26449. // Checks if given position is in a text node, and if so, splits the text node in two text nodes, each of them
  26450. // containing a part of original text node.
  26451. //
  26452. // @private
  26453. // @param {module:engine/model/position~Position} position Position at which node should be split.
  26454. function _splitNodeAtPosition( position ) {
  26455. const textNode = position.textNode;
  26456. const element = position.parent;
  26457. if ( textNode ) {
  26458. const offsetDiff = position.offset - textNode.startOffset;
  26459. const index = textNode.index;
  26460. element._removeChildren( index, 1 );
  26461. const firstPart = new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( textNode.data.substr( 0, offsetDiff ), textNode.getAttributes() );
  26462. const secondPart = new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( textNode.data.substr( offsetDiff ), textNode.getAttributes() );
  26463. element._insertChild( index, [ firstPart, secondPart ] );
  26464. }
  26465. }
  26466. // Checks whether two given nodes have same attributes.
  26467. //
  26468. // @private
  26469. // @param {module:engine/model/node~Node} nodeA Node to check.
  26470. // @param {module:engine/model/node~Node} nodeB Node to check.
  26471. // @returns {Boolean} `true` if nodes have same attributes, `false` otherwise.
  26472. function _haveSameAttributes( nodeA, nodeB ) {
  26473. const iteratorA = nodeA.getAttributes();
  26474. const iteratorB = nodeB.getAttributes();
  26475. for ( const attr of iteratorA ) {
  26476. if ( attr[ 1 ] !== nodeB.getAttribute( attr[ 0 ] ) ) {
  26477. return false;
  26478. }
  26479. iteratorB.next();
  26480. }
  26481. return iteratorB.next().done;
  26482. }
  26483. /**
  26484. * Value that can be normalized to an array of {@link module:engine/model/node~Node nodes}.
  26485. *
  26486. * Non-arrays are normalized as follows:
  26487. * * {@link module:engine/model/node~Node Node} is left as is,
  26488. * * {@link module:engine/model/textproxy~TextProxy TextProxy} and `String` are normalized to {@link module:engine/model/text~Text Text},
  26489. * * {@link module:engine/model/nodelist~NodeList NodeList} is normalized to an array containing all nodes that are in that node list,
  26490. * * {@link module:engine/model/documentfragment~DocumentFragment DocumentFragment} is normalized to an array containing all of it's
  26491. * * children.
  26492. *
  26493. * Arrays are processed item by item like non-array values and flattened to one array. Normalization always results in
  26494. * a flat array of {@link module:engine/model/node~Node nodes}. Consecutive text nodes (or items normalized to text nodes) will be
  26495. * merged if they have same attributes.
  26496. *
  26497. * @typedef {module:engine/model/node~Node|module:engine/model/textproxy~TextProxy|String|
  26498. * module:engine/model/nodelist~NodeList|module:engine/model/documentfragment~DocumentFragment|Iterable}
  26499. * module:engine/model/node~NodeSet
  26500. */
  26501. /***/ }),
  26502. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js":
  26503. /*!***********************************************************************!*\
  26504. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js ***!
  26505. \***********************************************************************/
  26506. /*! exports provided: default, getTextNodeAtPosition, getNodeAfterPosition, getNodeBeforePosition */
  26507. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  26508. "use strict";
  26509. __webpack_require__.r(__webpack_exports__);
  26510. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Position; });
  26511. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTextNodeAtPosition", function() { return getTextNodeAtPosition; });
  26512. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeAfterPosition", function() { return getNodeAfterPosition; });
  26513. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeBeforePosition", function() { return getNodeBeforePosition; });
  26514. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
  26515. /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
  26516. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  26517. /* harmony import */ var _ckeditor_ckeditor5_utils_src_version__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
  26518. /**
  26519. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  26520. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  26521. */
  26522. /**
  26523. * @module engine/model/position
  26524. */
  26525. // To check if component is loaded more than once.
  26526. /**
  26527. * Represents a position in the model tree.
  26528. *
  26529. * A position is represented by its {@link module:engine/model/position~Position#root} and
  26530. * a {@link module:engine/model/position~Position#path} in that root.
  26531. *
  26532. * You can create position instances via its constructor or the `createPosition*()` factory methods of
  26533. * {@link module:engine/model/model~Model} and {@link module:engine/model/writer~Writer}.
  26534. *
  26535. * **Note:** Position is based on offsets, not indexes. This means that a position between two text nodes
  26536. * `foo` and `bar` has offset `3`, not `1`. See {@link module:engine/model/position~Position#path} for more information.
  26537. *
  26538. * Since a position in the model is represented by a {@link module:engine/model/position~Position#root position root} and
  26539. * {@link module:engine/model/position~Position#path position path} it is possible to create positions placed in non-existing places.
  26540. * This requirement is important for operational transformation algorithms.
  26541. *
  26542. * Also, {@link module:engine/model/operation/operation~Operation operations}
  26543. * kept in the {@link module:engine/model/document~Document#history document history}
  26544. * are storing positions (and ranges) which were correct when those operations were applied, but may not be correct
  26545. * after the document has changed.
  26546. *
  26547. * When changes are applied to the model, it may also happen that {@link module:engine/model/position~Position#parent position parent}
  26548. * will change even if position path has not changed. Keep in mind, that if a position leads to non-existing element,
  26549. * {@link module:engine/model/position~Position#parent} and some other properties and methods will throw errors.
  26550. *
  26551. * In most cases, position with wrong path is caused by an error in code, but it is sometimes needed, as described above.
  26552. */
  26553. class Position {
  26554. /**
  26555. * Creates a position.
  26556. *
  26557. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} root Root of the position.
  26558. * @param {Array.<Number>} path Position path. See {@link module:engine/model/position~Position#path}.
  26559. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
  26560. * See {@link module:engine/model/position~PositionStickiness}.
  26561. */
  26562. constructor( root, path, stickiness = 'toNone' ) {
  26563. if ( !root.is( 'element' ) && !root.is( 'documentFragment' ) ) {
  26564. /**
  26565. * Position root is invalid.
  26566. *
  26567. * Positions can only be anchored in elements or document fragments.
  26568. *
  26569. * @error model-position-root-invalid
  26570. */
  26571. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  26572. 'model-position-root-invalid',
  26573. root
  26574. );
  26575. }
  26576. if ( !( path instanceof Array ) || path.length === 0 ) {
  26577. /**
  26578. * Position path must be an array with at least one item.
  26579. *
  26580. * @error model-position-path-incorrect-format
  26581. * @param path
  26582. */
  26583. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  26584. 'model-position-path-incorrect-format',
  26585. root,
  26586. { path }
  26587. );
  26588. }
  26589. // Normalize the root and path when element (not root) is passed.
  26590. if ( root.is( 'rootElement' ) ) {
  26591. path = path.slice();
  26592. } else {
  26593. path = [ ...root.getPath(), ...path ];
  26594. root = root.root;
  26595. }
  26596. /**
  26597. * Root of the position path.
  26598. *
  26599. * @readonly
  26600. * @member {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}
  26601. * module:engine/model/position~Position#root
  26602. */
  26603. this.root = root;
  26604. /**
  26605. * Position of the node in the tree. **Path contains offsets, not indexes.**
  26606. *
  26607. * Position can be placed before, after or in a {@link module:engine/model/node~Node node} if that node has
  26608. * {@link module:engine/model/node~Node#offsetSize} greater than `1`. Items in position path are
  26609. * {@link module:engine/model/node~Node#startOffset starting offsets} of position ancestors, starting from direct root children,
  26610. * down to the position offset in it's parent.
  26611. *
  26612. * ROOT
  26613. * |- P before: [ 0 ] after: [ 1 ]
  26614. * |- UL before: [ 1 ] after: [ 2 ]
  26615. * |- LI before: [ 1, 0 ] after: [ 1, 1 ]
  26616. * | |- foo before: [ 1, 0, 0 ] after: [ 1, 0, 3 ]
  26617. * |- LI before: [ 1, 1 ] after: [ 1, 2 ]
  26618. * |- bar before: [ 1, 1, 0 ] after: [ 1, 1, 3 ]
  26619. *
  26620. * `foo` and `bar` are representing {@link module:engine/model/text~Text text nodes}. Since text nodes has offset size
  26621. * greater than `1` you can place position offset between their start and end:
  26622. *
  26623. * ROOT
  26624. * |- P
  26625. * |- UL
  26626. * |- LI
  26627. * | |- f^o|o ^ has path: [ 1, 0, 1 ] | has path: [ 1, 0, 2 ]
  26628. * |- LI
  26629. * |- b^a|r ^ has path: [ 1, 1, 1 ] | has path: [ 1, 1, 2 ]
  26630. *
  26631. * @readonly
  26632. * @member {Array.<Number>} module:engine/model/position~Position#path
  26633. */
  26634. this.path = path;
  26635. /**
  26636. * Position stickiness. See {@link module:engine/model/position~PositionStickiness}.
  26637. *
  26638. * @member {module:engine/model/position~PositionStickiness} module:engine/model/position~Position#stickiness
  26639. */
  26640. this.stickiness = stickiness;
  26641. }
  26642. /**
  26643. * Offset at which this position is located in its {@link module:engine/model/position~Position#parent parent}. It is equal
  26644. * to the last item in position {@link module:engine/model/position~Position#path path}.
  26645. *
  26646. * @type {Number}
  26647. */
  26648. get offset() {
  26649. return this.path[ this.path.length - 1 ];
  26650. }
  26651. set offset( newOffset ) {
  26652. this.path[ this.path.length - 1 ] = newOffset;
  26653. }
  26654. /**
  26655. * Parent element of this position.
  26656. *
  26657. * Keep in mind that `parent` value is calculated when the property is accessed.
  26658. * If {@link module:engine/model/position~Position#path position path}
  26659. * leads to a non-existing element, `parent` property will throw error.
  26660. *
  26661. * Also it is a good idea to cache `parent` property if it is used frequently in an algorithm (i.e. in a long loop).
  26662. *
  26663. * @readonly
  26664. * @type {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}
  26665. */
  26666. get parent() {
  26667. let parent = this.root;
  26668. for ( let i = 0; i < this.path.length - 1; i++ ) {
  26669. parent = parent.getChild( parent.offsetToIndex( this.path[ i ] ) );
  26670. if ( !parent ) {
  26671. /**
  26672. * The position's path is incorrect. This means that a position does not point to
  26673. * a correct place in the tree and hence, some of its methods and getters cannot work correctly.
  26674. *
  26675. * **Note**: Unlike DOM and view positions, in the model, the
  26676. * {@link module:engine/model/position~Position#parent position's parent} is always an element or a document fragment.
  26677. * The last offset in the {@link module:engine/model/position~Position#path position's path} is the point in this element
  26678. * where this position points.
  26679. *
  26680. * Read more about model positions and offsets in
  26681. * the {@glink framework/guides/architecture/editing-engine#indexes-and-offsets Editing engine architecture guide}.
  26682. *
  26683. * @error model-position-path-incorrect
  26684. * @param {module:engine/model/position~Position} position The incorrect position.
  26685. */
  26686. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'model-position-path-incorrect', this, { position: this } );
  26687. }
  26688. }
  26689. if ( parent.is( '$text' ) ) {
  26690. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'model-position-path-incorrect', this, { position: this } );
  26691. }
  26692. return parent;
  26693. }
  26694. /**
  26695. * Position {@link module:engine/model/position~Position#offset offset} converted to an index in position's parent node. It is
  26696. * equal to the {@link module:engine/model/node~Node#index index} of a node after this position. If position is placed
  26697. * in text node, position index is equal to the index of that text node.
  26698. *
  26699. * @readonly
  26700. * @type {Number}
  26701. */
  26702. get index() {
  26703. return this.parent.offsetToIndex( this.offset );
  26704. }
  26705. /**
  26706. * Returns {@link module:engine/model/text~Text text node} instance in which this position is placed or `null` if this
  26707. * position is not in a text node.
  26708. *
  26709. * @readonly
  26710. * @type {module:engine/model/text~Text|null}
  26711. */
  26712. get textNode() {
  26713. return getTextNodeAtPosition( this, this.parent );
  26714. }
  26715. /**
  26716. * Node directly after this position or `null` if this position is in text node.
  26717. *
  26718. * @readonly
  26719. * @type {module:engine/model/node~Node|null}
  26720. */
  26721. get nodeAfter() {
  26722. // Cache the parent and reuse for performance reasons. See #6579 and #6582.
  26723. const parent = this.parent;
  26724. return getNodeAfterPosition( this, parent, getTextNodeAtPosition( this, parent ) );
  26725. }
  26726. /**
  26727. * Node directly before this position or `null` if this position is in text node.
  26728. *
  26729. * @readonly
  26730. * @type {module:engine/model/node~Node|null}
  26731. */
  26732. get nodeBefore() {
  26733. // Cache the parent and reuse for performance reasons. See #6579 and #6582.
  26734. const parent = this.parent;
  26735. return getNodeBeforePosition( this, parent, getTextNodeAtPosition( this, parent ) );
  26736. }
  26737. /**
  26738. * Is `true` if position is at the beginning of its {@link module:engine/model/position~Position#parent parent}, `false` otherwise.
  26739. *
  26740. * @readonly
  26741. * @type {Boolean}
  26742. */
  26743. get isAtStart() {
  26744. return this.offset === 0;
  26745. }
  26746. /**
  26747. * Is `true` if position is at the end of its {@link module:engine/model/position~Position#parent parent}, `false` otherwise.
  26748. *
  26749. * @readonly
  26750. * @type {Boolean}
  26751. */
  26752. get isAtEnd() {
  26753. return this.offset == this.parent.maxOffset;
  26754. }
  26755. /**
  26756. * Checks whether this position is before or after given position.
  26757. *
  26758. * This method is safe to use it on non-existing positions (for example during operational transformation).
  26759. *
  26760. * @param {module:engine/model/position~Position} otherPosition Position to compare with.
  26761. * @returns {module:engine/model/position~PositionRelation}
  26762. */
  26763. compareWith( otherPosition ) {
  26764. if ( this.root != otherPosition.root ) {
  26765. return 'different';
  26766. }
  26767. const result = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( this.path, otherPosition.path );
  26768. switch ( result ) {
  26769. case 'same':
  26770. return 'same';
  26771. case 'prefix':
  26772. return 'before';
  26773. case 'extension':
  26774. return 'after';
  26775. default:
  26776. return this.path[ result ] < otherPosition.path[ result ] ? 'before' : 'after';
  26777. }
  26778. }
  26779. /**
  26780. * Gets the farthest position which matches the callback using
  26781. * {@link module:engine/model/treewalker~TreeWalker TreeWalker}.
  26782. *
  26783. * For example:
  26784. *
  26785. * getLastMatchingPosition( value => value.type == 'text' );
  26786. * // <paragraph>[]foo</paragraph> -> <paragraph>foo[]</paragraph>
  26787. *
  26788. * getLastMatchingPosition( value => value.type == 'text', { direction: 'backward' } );
  26789. * // <paragraph>foo[]</paragraph> -> <paragraph>[]foo</paragraph>
  26790. *
  26791. * getLastMatchingPosition( value => false );
  26792. * // Do not move the position.
  26793. *
  26794. * @param {Function} skip Callback function. Gets {@link module:engine/model/treewalker~TreeWalkerValue} and should
  26795. * return `true` if the value should be skipped or `false` if not.
  26796. * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
  26797. *
  26798. * @returns {module:engine/model/position~Position} The position after the last item which matches the `skip` callback test.
  26799. */
  26800. getLastMatchingPosition( skip, options = {} ) {
  26801. options.startPosition = this;
  26802. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( options );
  26803. treeWalker.skip( skip );
  26804. return treeWalker.position;
  26805. }
  26806. /**
  26807. * Returns a path to this position's parent. Parent path is equal to position {@link module:engine/model/position~Position#path path}
  26808. * but without the last item.
  26809. *
  26810. * This method is safe to use it on non-existing positions (for example during operational transformation).
  26811. *
  26812. * @returns {Array.<Number>} Path to the parent.
  26813. */
  26814. getParentPath() {
  26815. return this.path.slice( 0, -1 );
  26816. }
  26817. /**
  26818. * Returns ancestors array of this position, that is this position's parent and its ancestors.
  26819. *
  26820. * @returns {Array.<module:engine/model/item~Item>} Array with ancestors.
  26821. */
  26822. getAncestors() {
  26823. const parent = this.parent;
  26824. if ( parent.is( 'documentFragment' ) ) {
  26825. return [ parent ];
  26826. } else {
  26827. return parent.getAncestors( { includeSelf: true } );
  26828. }
  26829. }
  26830. /**
  26831. * Returns the parent element of the given name. Returns null if the position is not inside the desired parent.
  26832. *
  26833. * @param {String} parentName The name of the parent element to find.
  26834. * @returns {module:engine/model/element~Element|null}
  26835. */
  26836. findAncestor( parentName ) {
  26837. const parent = this.parent;
  26838. if ( parent.is( 'element' ) ) {
  26839. return parent.findAncestor( parentName, { includeSelf: true } );
  26840. }
  26841. return null;
  26842. }
  26843. /**
  26844. * Returns the slice of two position {@link #path paths} which is identical. The {@link #root roots}
  26845. * of these two paths must be identical.
  26846. *
  26847. * This method is safe to use it on non-existing positions (for example during operational transformation).
  26848. *
  26849. * @param {module:engine/model/position~Position} position The second position.
  26850. * @returns {Array.<Number>} The common path.
  26851. */
  26852. getCommonPath( position ) {
  26853. if ( this.root != position.root ) {
  26854. return [];
  26855. }
  26856. // We find on which tree-level start and end have the lowest common ancestor
  26857. const cmp = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( this.path, position.path );
  26858. // If comparison returned string it means that arrays are same.
  26859. const diffAt = ( typeof cmp == 'string' ) ? Math.min( this.path.length, position.path.length ) : cmp;
  26860. return this.path.slice( 0, diffAt );
  26861. }
  26862. /**
  26863. * Returns an {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}
  26864. * which is a common ancestor of both positions. The {@link #root roots} of these two positions must be identical.
  26865. *
  26866. * @param {module:engine/model/position~Position} position The second position.
  26867. * @returns {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
  26868. */
  26869. getCommonAncestor( position ) {
  26870. const ancestorsA = this.getAncestors();
  26871. const ancestorsB = position.getAncestors();
  26872. let i = 0;
  26873. while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
  26874. i++;
  26875. }
  26876. return i === 0 ? null : ancestorsA[ i - 1 ];
  26877. }
  26878. /**
  26879. * Returns a new instance of `Position`, that has same {@link #parent parent} but it's offset
  26880. * is shifted by `shift` value (can be a negative value).
  26881. *
  26882. * This method is safe to use it on non-existing positions (for example during operational transformation).
  26883. *
  26884. * @param {Number} shift Offset shift. Can be a negative value.
  26885. * @returns {module:engine/model/position~Position} Shifted position.
  26886. */
  26887. getShiftedBy( shift ) {
  26888. const shifted = this.clone();
  26889. const offset = shifted.offset + shift;
  26890. shifted.offset = offset < 0 ? 0 : offset;
  26891. return shifted;
  26892. }
  26893. /**
  26894. * Checks whether this position is after given position.
  26895. *
  26896. * This method is safe to use it on non-existing positions (for example during operational transformation).
  26897. *
  26898. * @see module:engine/model/position~Position#isBefore
  26899. * @param {module:engine/model/position~Position} otherPosition Position to compare with.
  26900. * @returns {Boolean} True if this position is after given position.
  26901. */
  26902. isAfter( otherPosition ) {
  26903. return this.compareWith( otherPosition ) == 'after';
  26904. }
  26905. /**
  26906. * Checks whether this position is before given position.
  26907. *
  26908. * **Note:** watch out when using negation of the value returned by this method, because the negation will also
  26909. * be `true` if positions are in different roots and you might not expect this. You should probably use
  26910. * `a.isAfter( b ) || a.isEqual( b )` or `!a.isBefore( p ) && a.root == b.root` in most scenarios. If your
  26911. * condition uses multiple `isAfter` and `isBefore` checks, build them so they do not use negated values, i.e.:
  26912. *
  26913. * if ( a.isBefore( b ) && c.isAfter( d ) ) {
  26914. * // do A.
  26915. * } else {
  26916. * // do B.
  26917. * }
  26918. *
  26919. * or, if you have only one if-branch:
  26920. *
  26921. * if ( !( a.isBefore( b ) && c.isAfter( d ) ) {
  26922. * // do B.
  26923. * }
  26924. *
  26925. * rather than:
  26926. *
  26927. * if ( !a.isBefore( b ) || && !c.isAfter( d ) ) {
  26928. * // do B.
  26929. * } else {
  26930. * // do A.
  26931. * }
  26932. *
  26933. * This method is safe to use it on non-existing positions (for example during operational transformation).
  26934. *
  26935. * @param {module:engine/model/position~Position} otherPosition Position to compare with.
  26936. * @returns {Boolean} True if this position is before given position.
  26937. */
  26938. isBefore( otherPosition ) {
  26939. return this.compareWith( otherPosition ) == 'before';
  26940. }
  26941. /**
  26942. * Checks whether this position is equal to given position.
  26943. *
  26944. * This method is safe to use it on non-existing positions (for example during operational transformation).
  26945. *
  26946. * @param {module:engine/model/position~Position} otherPosition Position to compare with.
  26947. * @returns {Boolean} True if positions are same.
  26948. */
  26949. isEqual( otherPosition ) {
  26950. return this.compareWith( otherPosition ) == 'same';
  26951. }
  26952. /**
  26953. * Checks whether this position is touching given position. Positions touch when there are no text nodes
  26954. * or empty nodes in a range between them. Technically, those positions are not equal but in many cases
  26955. * they are very similar or even indistinguishable.
  26956. *
  26957. * @param {module:engine/model/position~Position} otherPosition Position to compare with.
  26958. * @returns {Boolean} True if positions touch.
  26959. */
  26960. isTouching( otherPosition ) {
  26961. let left = null;
  26962. let right = null;
  26963. const compare = this.compareWith( otherPosition );
  26964. switch ( compare ) {
  26965. case 'same':
  26966. return true;
  26967. case 'before':
  26968. left = Position._createAt( this );
  26969. right = Position._createAt( otherPosition );
  26970. break;
  26971. case 'after':
  26972. left = Position._createAt( otherPosition );
  26973. right = Position._createAt( this );
  26974. break;
  26975. default:
  26976. return false;
  26977. }
  26978. // Cached for optimization purposes.
  26979. let leftParent = left.parent;
  26980. while ( left.path.length + right.path.length ) {
  26981. if ( left.isEqual( right ) ) {
  26982. return true;
  26983. }
  26984. if ( left.path.length > right.path.length ) {
  26985. if ( left.offset !== leftParent.maxOffset ) {
  26986. return false;
  26987. }
  26988. left.path = left.path.slice( 0, -1 );
  26989. leftParent = leftParent.parent;
  26990. left.offset++;
  26991. } else {
  26992. if ( right.offset !== 0 ) {
  26993. return false;
  26994. }
  26995. right.path = right.path.slice( 0, -1 );
  26996. }
  26997. }
  26998. }
  26999. /**
  27000. * Checks whether this object is of the given.
  27001. *
  27002. * position.is( 'position' ); // -> true
  27003. * position.is( 'model:position' ); // -> true
  27004. *
  27005. * position.is( 'view:position' ); // -> false
  27006. * position.is( 'documentSelection' ); // -> false
  27007. *
  27008. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  27009. *
  27010. * @param {String} type
  27011. * @returns {Boolean}
  27012. */
  27013. is( type ) {
  27014. return type === 'position' || type === 'model:position';
  27015. }
  27016. /**
  27017. * Checks if two positions are in the same parent.
  27018. *
  27019. * This method is safe to use it on non-existing positions (for example during operational transformation).
  27020. *
  27021. * @param {module:engine/model/position~Position} position Position to compare with.
  27022. * @returns {Boolean} `true` if positions have the same parent, `false` otherwise.
  27023. */
  27024. hasSameParentAs( position ) {
  27025. if ( this.root !== position.root ) {
  27026. return false;
  27027. }
  27028. const thisParentPath = this.getParentPath();
  27029. const posParentPath = position.getParentPath();
  27030. return Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( thisParentPath, posParentPath ) == 'same';
  27031. }
  27032. /**
  27033. * Returns a copy of this position that is transformed by given `operation`.
  27034. *
  27035. * The new position's parameters are updated accordingly to the effect of the `operation`.
  27036. *
  27037. * For example, if `n` nodes are inserted before the position, the returned position {@link ~Position#offset} will be
  27038. * increased by `n`. If the position was in a merged element, it will be accordingly moved to the new element, etc.
  27039. *
  27040. * This method is safe to use it on non-existing positions (for example during operational transformation).
  27041. *
  27042. * @param {module:engine/model/operation/operation~Operation} operation Operation to transform by.
  27043. * @returns {module:engine/model/position~Position} Transformed position.
  27044. */
  27045. getTransformedByOperation( operation ) {
  27046. let result;
  27047. switch ( operation.type ) {
  27048. case 'insert':
  27049. result = this._getTransformedByInsertOperation( operation );
  27050. break;
  27051. case 'move':
  27052. case 'remove':
  27053. case 'reinsert':
  27054. result = this._getTransformedByMoveOperation( operation );
  27055. break;
  27056. case 'split':
  27057. result = this._getTransformedBySplitOperation( operation );
  27058. break;
  27059. case 'merge':
  27060. result = this._getTransformedByMergeOperation( operation );
  27061. break;
  27062. default:
  27063. result = Position._createAt( this );
  27064. break;
  27065. }
  27066. return result;
  27067. }
  27068. /**
  27069. * Returns a copy of this position transformed by an insert operation.
  27070. *
  27071. * @protected
  27072. * @param {module:engine/model/operation/insertoperation~InsertOperation} operation
  27073. * @returns {module:engine/model/position~Position}
  27074. */
  27075. _getTransformedByInsertOperation( operation ) {
  27076. return this._getTransformedByInsertion( operation.position, operation.howMany );
  27077. }
  27078. /**
  27079. * Returns a copy of this position transformed by a move operation.
  27080. *
  27081. * @protected
  27082. * @param {module:engine/model/operation/moveoperation~MoveOperation} operation
  27083. * @returns {module:engine/model/position~Position}
  27084. */
  27085. _getTransformedByMoveOperation( operation ) {
  27086. return this._getTransformedByMove( operation.sourcePosition, operation.targetPosition, operation.howMany );
  27087. }
  27088. /**
  27089. * Returns a copy of this position transformed by a split operation.
  27090. *
  27091. * @protected
  27092. * @param {module:engine/model/operation/splitoperation~SplitOperation} operation
  27093. * @returns {module:engine/model/position~Position}
  27094. */
  27095. _getTransformedBySplitOperation( operation ) {
  27096. const movedRange = operation.movedRange;
  27097. const isContained = movedRange.containsPosition( this ) ||
  27098. ( movedRange.start.isEqual( this ) && this.stickiness == 'toNext' );
  27099. if ( isContained ) {
  27100. return this._getCombined( operation.splitPosition, operation.moveTargetPosition );
  27101. } else {
  27102. if ( operation.graveyardPosition ) {
  27103. return this._getTransformedByMove( operation.graveyardPosition, operation.insertionPosition, 1 );
  27104. } else {
  27105. return this._getTransformedByInsertion( operation.insertionPosition, 1 );
  27106. }
  27107. }
  27108. }
  27109. /**
  27110. * Returns a copy of this position transformed by merge operation.
  27111. *
  27112. * @protected
  27113. * @param {module:engine/model/operation/mergeoperation~MergeOperation} operation
  27114. * @returns {module:engine/model/position~Position}
  27115. */
  27116. _getTransformedByMergeOperation( operation ) {
  27117. const movedRange = operation.movedRange;
  27118. const isContained = movedRange.containsPosition( this ) || movedRange.start.isEqual( this );
  27119. let pos;
  27120. if ( isContained ) {
  27121. pos = this._getCombined( operation.sourcePosition, operation.targetPosition );
  27122. if ( operation.sourcePosition.isBefore( operation.targetPosition ) ) {
  27123. // Above happens during OT when the merged element is moved before the merged-to element.
  27124. pos = pos._getTransformedByDeletion( operation.deletionPosition, 1 );
  27125. }
  27126. } else if ( this.isEqual( operation.deletionPosition ) ) {
  27127. pos = Position._createAt( operation.deletionPosition );
  27128. } else {
  27129. pos = this._getTransformedByMove( operation.deletionPosition, operation.graveyardPosition, 1 );
  27130. }
  27131. return pos;
  27132. }
  27133. /**
  27134. * Returns a copy of this position that is updated by removing `howMany` nodes starting from `deletePosition`.
  27135. * It may happen that this position is in a removed node. If that is the case, `null` is returned instead.
  27136. *
  27137. * @protected
  27138. * @param {module:engine/model/position~Position} deletePosition Position before the first removed node.
  27139. * @param {Number} howMany How many nodes are removed.
  27140. * @returns {module:engine/model/position~Position|null} Transformed position or `null`.
  27141. */
  27142. _getTransformedByDeletion( deletePosition, howMany ) {
  27143. const transformed = Position._createAt( this );
  27144. // This position can't be affected if deletion was in a different root.
  27145. if ( this.root != deletePosition.root ) {
  27146. return transformed;
  27147. }
  27148. if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( deletePosition.getParentPath(), this.getParentPath() ) == 'same' ) {
  27149. // If nodes are removed from the node that is pointed by this position...
  27150. if ( deletePosition.offset < this.offset ) {
  27151. // And are removed from before an offset of that position...
  27152. if ( deletePosition.offset + howMany > this.offset ) {
  27153. // Position is in removed range, it's no longer in the tree.
  27154. return null;
  27155. } else {
  27156. // Decrement the offset accordingly.
  27157. transformed.offset -= howMany;
  27158. }
  27159. }
  27160. } else if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( deletePosition.getParentPath(), this.getParentPath() ) == 'prefix' ) {
  27161. // If nodes are removed from a node that is on a path to this position...
  27162. const i = deletePosition.path.length - 1;
  27163. if ( deletePosition.offset <= this.path[ i ] ) {
  27164. // And are removed from before next node of that path...
  27165. if ( deletePosition.offset + howMany > this.path[ i ] ) {
  27166. // If the next node of that path is removed return null
  27167. // because the node containing this position got removed.
  27168. return null;
  27169. } else {
  27170. // Otherwise, decrement index on that path.
  27171. transformed.path[ i ] -= howMany;
  27172. }
  27173. }
  27174. }
  27175. return transformed;
  27176. }
  27177. /**
  27178. * Returns a copy of this position that is updated by inserting `howMany` nodes at `insertPosition`.
  27179. *
  27180. * @protected
  27181. * @param {module:engine/model/position~Position} insertPosition Position where nodes are inserted.
  27182. * @param {Number} howMany How many nodes are inserted.
  27183. * @returns {module:engine/model/position~Position} Transformed position.
  27184. */
  27185. _getTransformedByInsertion( insertPosition, howMany ) {
  27186. const transformed = Position._createAt( this );
  27187. // This position can't be affected if insertion was in a different root.
  27188. if ( this.root != insertPosition.root ) {
  27189. return transformed;
  27190. }
  27191. if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( insertPosition.getParentPath(), this.getParentPath() ) == 'same' ) {
  27192. // If nodes are inserted in the node that is pointed by this position...
  27193. if ( insertPosition.offset < this.offset || ( insertPosition.offset == this.offset && this.stickiness != 'toPrevious' ) ) {
  27194. // And are inserted before an offset of that position...
  27195. // "Push" this positions offset.
  27196. transformed.offset += howMany;
  27197. }
  27198. } else if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( insertPosition.getParentPath(), this.getParentPath() ) == 'prefix' ) {
  27199. // If nodes are inserted in a node that is on a path to this position...
  27200. const i = insertPosition.path.length - 1;
  27201. if ( insertPosition.offset <= this.path[ i ] ) {
  27202. // And are inserted before next node of that path...
  27203. // "Push" the index on that path.
  27204. transformed.path[ i ] += howMany;
  27205. }
  27206. }
  27207. return transformed;
  27208. }
  27209. /**
  27210. * Returns a copy of this position that is updated by moving `howMany` nodes from `sourcePosition` to `targetPosition`.
  27211. *
  27212. * @protected
  27213. * @param {module:engine/model/position~Position} sourcePosition Position before the first element to move.
  27214. * @param {module:engine/model/position~Position} targetPosition Position where moved elements will be inserted.
  27215. * @param {Number} howMany How many consecutive nodes to move, starting from `sourcePosition`.
  27216. * @returns {module:engine/model/position~Position} Transformed position.
  27217. */
  27218. _getTransformedByMove( sourcePosition, targetPosition, howMany ) {
  27219. // Update target position, as it could be affected by nodes removal.
  27220. targetPosition = targetPosition._getTransformedByDeletion( sourcePosition, howMany );
  27221. if ( sourcePosition.isEqual( targetPosition ) ) {
  27222. // If `targetPosition` is equal to `sourcePosition` this isn't really any move. Just return position as it is.
  27223. return Position._createAt( this );
  27224. }
  27225. // Moving a range removes nodes from their original position. We acknowledge this by proper transformation.
  27226. const transformed = this._getTransformedByDeletion( sourcePosition, howMany );
  27227. const isMoved = transformed === null ||
  27228. ( sourcePosition.isEqual( this ) && this.stickiness == 'toNext' ) ||
  27229. ( sourcePosition.getShiftedBy( howMany ).isEqual( this ) && this.stickiness == 'toPrevious' );
  27230. if ( isMoved ) {
  27231. // This position is inside moved range (or sticks to it).
  27232. // In this case, we calculate a combination of this position, move source position and target position.
  27233. return this._getCombined( sourcePosition, targetPosition );
  27234. } else {
  27235. // This position is not inside a removed range.
  27236. //
  27237. // In next step, we simply reflect inserting `howMany` nodes, which might further affect the position.
  27238. return transformed._getTransformedByInsertion( targetPosition, howMany );
  27239. }
  27240. }
  27241. /**
  27242. * Returns a new position that is a combination of this position and given positions.
  27243. *
  27244. * The combined position is a copy of this position transformed by moving a range starting at `source` position
  27245. * to the `target` position. It is expected that this position is inside the moved range.
  27246. *
  27247. * Example:
  27248. *
  27249. * let original = model.createPositionFromPath( root, [ 2, 3, 1 ] );
  27250. * let source = model.createPositionFromPath( root, [ 2, 2 ] );
  27251. * let target = model.createPositionFromPath( otherRoot, [ 1, 1, 3 ] );
  27252. * original._getCombined( source, target ); // path is [ 1, 1, 4, 1 ], root is `otherRoot`
  27253. *
  27254. * Explanation:
  27255. *
  27256. * We have a position `[ 2, 3, 1 ]` and move some nodes from `[ 2, 2 ]` to `[ 1, 1, 3 ]`. The original position
  27257. * was inside moved nodes and now should point to the new place. The moved nodes will be after
  27258. * positions `[ 1, 1, 3 ]`, `[ 1, 1, 4 ]`, `[ 1, 1, 5 ]`. Since our position was in the second moved node,
  27259. * the transformed position will be in a sub-tree of a node at `[ 1, 1, 4 ]`. Looking at original path, we
  27260. * took care of `[ 2, 3 ]` part of it. Now we have to add the rest of the original path to the transformed path.
  27261. * Finally, the transformed position will point to `[ 1, 1, 4, 1 ]`.
  27262. *
  27263. * @protected
  27264. * @param {module:engine/model/position~Position} source Beginning of the moved range.
  27265. * @param {module:engine/model/position~Position} target Position where the range is moved.
  27266. * @returns {module:engine/model/position~Position} Combined position.
  27267. */
  27268. _getCombined( source, target ) {
  27269. const i = source.path.length - 1;
  27270. // The first part of a path to combined position is a path to the place where nodes were moved.
  27271. const combined = Position._createAt( target );
  27272. combined.stickiness = this.stickiness;
  27273. // Then we have to update the rest of the path.
  27274. // Fix the offset because this position might be after `from` position and we have to reflect that.
  27275. combined.offset = combined.offset + this.path[ i ] - source.offset;
  27276. // Then, add the rest of the path.
  27277. // If this position is at the same level as `from` position nothing will get added.
  27278. combined.path = [ ...combined.path, ...this.path.slice( i + 1 ) ];
  27279. return combined;
  27280. }
  27281. /**
  27282. * @inheritDoc
  27283. */
  27284. toJSON() {
  27285. return {
  27286. root: this.root.toJSON(),
  27287. path: Array.from( this.path ),
  27288. stickiness: this.stickiness
  27289. };
  27290. }
  27291. /**
  27292. * Returns a new position that is equal to current position.
  27293. *
  27294. * @returns {module:engine/model/position~Position}
  27295. */
  27296. clone() {
  27297. return new this.constructor( this.root, this.path, this.stickiness );
  27298. }
  27299. /**
  27300. * Creates position at the given location. The location can be specified as:
  27301. *
  27302. * * a {@link module:engine/model/position~Position position},
  27303. * * parent element and offset (offset defaults to `0`),
  27304. * * parent element and `'end'` (sets position at the end of that element),
  27305. * * {@link module:engine/model/item~Item model item} and `'before'` or `'after'` (sets position before or after given model item).
  27306. *
  27307. * This method is a shortcut to other factory methods such as:
  27308. *
  27309. * * {@link module:engine/model/position~Position._createBefore},
  27310. * * {@link module:engine/model/position~Position._createAfter}.
  27311. *
  27312. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  27313. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when the
  27314. * first parameter is a {@link module:engine/model/item~Item model item}.
  27315. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness. Used only when the
  27316. * first parameter is a {@link module:engine/model/item~Item model item}.
  27317. * @protected
  27318. */
  27319. static _createAt( itemOrPosition, offset, stickiness = 'toNone' ) {
  27320. if ( itemOrPosition instanceof Position ) {
  27321. return new Position( itemOrPosition.root, itemOrPosition.path, itemOrPosition.stickiness );
  27322. } else {
  27323. const node = itemOrPosition;
  27324. if ( offset == 'end' ) {
  27325. offset = node.maxOffset;
  27326. } else if ( offset == 'before' ) {
  27327. return this._createBefore( node, stickiness );
  27328. } else if ( offset == 'after' ) {
  27329. return this._createAfter( node, stickiness );
  27330. } else if ( offset !== 0 && !offset ) {
  27331. /**
  27332. * {@link module:engine/model/model~Model#createPositionAt `Model#createPositionAt()`}
  27333. * requires the offset to be specified when the first parameter is a model item.
  27334. *
  27335. * @error model-createpositionat-offset-required
  27336. */
  27337. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'model-createpositionat-offset-required', [ this, itemOrPosition ] );
  27338. }
  27339. if ( !node.is( 'element' ) && !node.is( 'documentFragment' ) ) {
  27340. /**
  27341. * Position parent have to be a model element or model document fragment.
  27342. *
  27343. * @error model-position-parent-incorrect
  27344. */
  27345. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  27346. 'model-position-parent-incorrect',
  27347. [ this, itemOrPosition ]
  27348. );
  27349. }
  27350. const path = node.getPath();
  27351. path.push( offset );
  27352. return new this( node.root, path, stickiness );
  27353. }
  27354. }
  27355. /**
  27356. * Creates a new position, after given {@link module:engine/model/item~Item model item}.
  27357. *
  27358. * @param {module:engine/model/item~Item} item Item after which the position should be placed.
  27359. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
  27360. * @returns {module:engine/model/position~Position}
  27361. * @protected
  27362. */
  27363. static _createAfter( item, stickiness ) {
  27364. if ( !item.parent ) {
  27365. /**
  27366. * You can not make a position after a root element.
  27367. *
  27368. * @error model-position-after-root
  27369. * @param {module:engine/model/item~Item} root
  27370. */
  27371. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  27372. 'model-position-after-root',
  27373. [ this, item ],
  27374. { root: item }
  27375. );
  27376. }
  27377. return this._createAt( item.parent, item.endOffset, stickiness );
  27378. }
  27379. /**
  27380. * Creates a new position, before the given {@link module:engine/model/item~Item model item}.
  27381. *
  27382. * @param {module:engine/model/item~Item} item Item before which the position should be placed.
  27383. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
  27384. * @returns {module:engine/model/position~Position}
  27385. * @protected
  27386. */
  27387. static _createBefore( item, stickiness ) {
  27388. if ( !item.parent ) {
  27389. /**
  27390. * You can not make a position before a root element.
  27391. *
  27392. * @error model-position-before-root
  27393. * @param {module:engine/model/item~Item} root
  27394. */
  27395. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  27396. 'model-position-before-root',
  27397. item,
  27398. { root: item }
  27399. );
  27400. }
  27401. return this._createAt( item.parent, item.startOffset, stickiness );
  27402. }
  27403. /**
  27404. * Creates a `Position` instance from given plain object (i.e. parsed JSON string).
  27405. *
  27406. * @param {Object} json Plain object to be converted to `Position`.
  27407. * @param {module:engine/model/document~Document} doc Document object that will be position owner.
  27408. * @returns {module:engine/model/position~Position} `Position` instance created using given plain object.
  27409. */
  27410. static fromJSON( json, doc ) {
  27411. if ( json.root === '$graveyard' ) {
  27412. const pos = new Position( doc.graveyard, json.path );
  27413. pos.stickiness = json.stickiness;
  27414. return pos;
  27415. }
  27416. if ( !doc.getRoot( json.root ) ) {
  27417. /**
  27418. * Cannot create position for document. Root with specified name does not exist.
  27419. *
  27420. * @error model-position-fromjson-no-root
  27421. * @param {String} rootName
  27422. */
  27423. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  27424. 'model-position-fromjson-no-root',
  27425. doc,
  27426. { rootName: json.root }
  27427. );
  27428. }
  27429. return new Position( doc.getRoot( json.root ), json.path, json.stickiness );
  27430. }
  27431. // @if CK_DEBUG_ENGINE // toString() {
  27432. // @if CK_DEBUG_ENGINE // return `${ this.root } [ ${ this.path.join( ', ' ) } ]`;
  27433. // @if CK_DEBUG_ENGINE // }
  27434. // @if CK_DEBUG_ENGINE // log() {
  27435. // @if CK_DEBUG_ENGINE // console.log( 'ModelPosition: ' + this );
  27436. // @if CK_DEBUG_ENGINE // }
  27437. }
  27438. /**
  27439. * A flag indicating whether this position is `'before'` or `'after'` or `'same'` as given position.
  27440. * If positions are in different roots `'different'` flag is returned.
  27441. *
  27442. * @typedef {String} module:engine/model/position~PositionRelation
  27443. */
  27444. /**
  27445. * Represents how position is "sticking" with neighbour nodes. Used to define how position should be transformed (moved)
  27446. * in edge cases. Possible values: `'toNone'`, `'toNext'`, `'toPrevious'`.
  27447. *
  27448. * Examples:
  27449. *
  27450. * Insert. Position is at | and nodes are inserted at the same position, marked as ^:
  27451. *
  27452. * - sticks to none: <p>f^|oo</p> -> <p>fbar|oo</p>
  27453. * - sticks to next node: <p>f^|oo</p> -> <p>fbar|oo</p>
  27454. * - sticks to previous node: <p>f|^oo</p> -> <p>f|baroo</p>
  27455. *
  27456. *
  27457. * Move. Position is at | and range [oo] is moved to position ^:
  27458. *
  27459. * - sticks to none: <p>f|[oo]</p><p>b^ar</p> -> <p>f|</p><p>booar</p>
  27460. * - sticks to none: <p>f[oo]|</p><p>b^ar</p> -> <p>f|</p><p>booar</p>
  27461. *
  27462. * - sticks to next node: <p>f|[oo]</p><p>b^ar</p> -> <p>f</p><p>b|ooar</p>
  27463. * - sticks to next node: <p>f[oo]|</p><p>b^ar</p> -> <p>f|</p><p>booar</p>
  27464. *
  27465. * - sticks to previous node: <p>f|[oo]</p><p>b^ar</p> -> <p>f|</p><p>booar</p>
  27466. * - sticks to previous node: <p>f[oo]|</p><p>b^ar</p> -> <p>f</p><p>boo|ar</p>
  27467. *
  27468. * @typedef {String} module:engine/model/position~PositionStickiness
  27469. */
  27470. /**
  27471. * Returns a text node at the given position.
  27472. *
  27473. * This is a helper function optimized to reuse the position parent instance for performance reasons.
  27474. *
  27475. * Normally, you should use {@link module:engine/model/position~Position#textNode `Position#textNode`}.
  27476. * If you start hitting performance issues with {@link module:engine/model/position~Position#parent `Position#parent`}
  27477. * check if your algorithm does not access it multiple times (which can happen directly or indirectly via other position properties).
  27478. *
  27479. * See https://github.com/ckeditor/ckeditor5/issues/6579.
  27480. *
  27481. * See also:
  27482. *
  27483. * * {@link module:engine/model/position~getNodeAfterPosition}
  27484. * * {@link module:engine/model/position~getNodeBeforePosition}
  27485. *
  27486. * @param {module:engine/model/position~Position} position
  27487. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} positionParent The parent of the
  27488. * given position.
  27489. * @returns {module:engine/model/text~Text|null}
  27490. */
  27491. function getTextNodeAtPosition( position, positionParent ) {
  27492. const node = positionParent.getChild( positionParent.offsetToIndex( position.offset ) );
  27493. if ( node && node.is( '$text' ) && node.startOffset < position.offset ) {
  27494. return node;
  27495. }
  27496. return null;
  27497. }
  27498. /**
  27499. * Returns the node after the given position.
  27500. *
  27501. * This is a helper function optimized to reuse the position parent instance and the calculation of the text node at the
  27502. * specific position for performance reasons.
  27503. *
  27504. * Normally, you should use {@link module:engine/model/position~Position#nodeAfter `Position#nodeAfter`}.
  27505. * If you start hitting performance issues with {@link module:engine/model/position~Position#parent `Position#parent`} and/or
  27506. * {@link module:engine/model/position~Position#textNode `Position#textNode`}
  27507. * check if your algorithm does not access those properties multiple times
  27508. * (which can happen directly or indirectly via other position properties).
  27509. *
  27510. * See https://github.com/ckeditor/ckeditor5/issues/6579 and https://github.com/ckeditor/ckeditor5/issues/6582.
  27511. *
  27512. * See also:
  27513. *
  27514. * * {@link module:engine/model/position~getTextNodeAtPosition}
  27515. * * {@link module:engine/model/position~getNodeBeforePosition}
  27516. *
  27517. * @param {module:engine/model/position~Position} position
  27518. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} positionParent The parent of the
  27519. * given position.
  27520. * @param {module:engine/model/text~Text|null} textNode Text node at the given position.
  27521. * @returns {module:engine/model/node~Node|null}
  27522. */
  27523. function getNodeAfterPosition( position, positionParent, textNode ) {
  27524. if ( textNode !== null ) {
  27525. return null;
  27526. }
  27527. return positionParent.getChild( positionParent.offsetToIndex( position.offset ) );
  27528. }
  27529. /**
  27530. * Returns the node before the given position.
  27531. *
  27532. * Refer to {@link module:engine/model/position~getNodeBeforePosition} for documentation on when to use this util method.
  27533. *
  27534. * See also:
  27535. *
  27536. * * {@link module:engine/model/position~getTextNodeAtPosition}
  27537. * * {@link module:engine/model/position~getNodeAfterPosition}
  27538. *
  27539. * @param {module:engine/model/position~Position} position
  27540. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} positionParent The parent of the
  27541. * given position.
  27542. * @param {module:engine/model/text~Text|null} textNode Text node at the given position.
  27543. * @returns {module:engine/model/node~Node|null}
  27544. */
  27545. function getNodeBeforePosition( position, positionParent, textNode ) {
  27546. if ( textNode !== null ) {
  27547. return null;
  27548. }
  27549. return positionParent.getChild( positionParent.offsetToIndex( position.offset ) - 1 );
  27550. }
  27551. /***/ }),
  27552. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js":
  27553. /*!********************************************************************!*\
  27554. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js ***!
  27555. \********************************************************************/
  27556. /*! exports provided: default */
  27557. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  27558. "use strict";
  27559. __webpack_require__.r(__webpack_exports__);
  27560. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Range; });
  27561. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  27562. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
  27563. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  27564. /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
  27565. /**
  27566. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  27567. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  27568. */
  27569. /**
  27570. * @module engine/model/range
  27571. */
  27572. /**
  27573. * Represents a range in the model tree.
  27574. *
  27575. * A range is defined by its {@link module:engine/model/range~Range#start} and {@link module:engine/model/range~Range#end}
  27576. * positions.
  27577. *
  27578. * You can create range instances via its constructor or the `createRange*()` factory methods of
  27579. * {@link module:engine/model/model~Model} and {@link module:engine/model/writer~Writer}.
  27580. */
  27581. class Range {
  27582. /**
  27583. * Creates a range spanning from `start` position to `end` position.
  27584. *
  27585. * @param {module:engine/model/position~Position} start The start position.
  27586. * @param {module:engine/model/position~Position} [end] The end position. If not set,
  27587. * the range will be collapsed at the `start` position.
  27588. */
  27589. constructor( start, end = null ) {
  27590. /**
  27591. * Start position.
  27592. *
  27593. * @readonly
  27594. * @member {module:engine/model/position~Position}
  27595. */
  27596. this.start = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( start );
  27597. /**
  27598. * End position.
  27599. *
  27600. * @readonly
  27601. * @member {module:engine/model/position~Position}
  27602. */
  27603. this.end = end ? _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( end ) : _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( start );
  27604. // If the range is collapsed, treat in a similar way as a position and set its boundaries stickiness to 'toNone'.
  27605. // In other case, make the boundaries stick to the "inside" of the range.
  27606. this.start.stickiness = this.isCollapsed ? 'toNone' : 'toNext';
  27607. this.end.stickiness = this.isCollapsed ? 'toNone' : 'toPrevious';
  27608. }
  27609. /**
  27610. * Iterable interface.
  27611. *
  27612. * Iterates over all {@link module:engine/model/item~Item items} that are in this range and returns
  27613. * them together with additional information like length or {@link module:engine/model/position~Position positions},
  27614. * grouped as {@link module:engine/model/treewalker~TreeWalkerValue}.
  27615. * It iterates over all {@link module:engine/model/textproxy~TextProxy text contents} that are inside the range
  27616. * and all the {@link module:engine/model/element~Element}s that are entered into when iterating over this range.
  27617. *
  27618. * This iterator uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range
  27619. * and `ignoreElementEnd` option set to `true`.
  27620. *
  27621. * @returns {Iterable.<module:engine/model/treewalker~TreeWalkerValue>}
  27622. */
  27623. * [ Symbol.iterator ]() {
  27624. yield* new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( { boundaries: this, ignoreElementEnd: true } );
  27625. }
  27626. /**
  27627. * Returns whether the range is collapsed, that is if {@link #start} and
  27628. * {@link #end} positions are equal.
  27629. *
  27630. * @type {Boolean}
  27631. */
  27632. get isCollapsed() {
  27633. return this.start.isEqual( this.end );
  27634. }
  27635. /**
  27636. * Returns whether this range is flat, that is if {@link #start} position and
  27637. * {@link #end} position are in the same {@link module:engine/model/position~Position#parent}.
  27638. *
  27639. * @type {Boolean}
  27640. */
  27641. get isFlat() {
  27642. const startParentPath = this.start.getParentPath();
  27643. const endParentPath = this.end.getParentPath();
  27644. return Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__["default"])( startParentPath, endParentPath ) == 'same';
  27645. }
  27646. /**
  27647. * Range root element.
  27648. *
  27649. * @type {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}
  27650. */
  27651. get root() {
  27652. return this.start.root;
  27653. }
  27654. /**
  27655. * Checks whether this range contains given {@link module:engine/model/position~Position position}.
  27656. *
  27657. * @param {module:engine/model/position~Position} position Position to check.
  27658. * @returns {Boolean} `true` if given {@link module:engine/model/position~Position position} is contained
  27659. * in this range,`false` otherwise.
  27660. */
  27661. containsPosition( position ) {
  27662. return position.isAfter( this.start ) && position.isBefore( this.end );
  27663. }
  27664. /**
  27665. * Checks whether this range contains given {@link ~Range range}.
  27666. *
  27667. * @param {module:engine/model/range~Range} otherRange Range to check.
  27668. * @param {Boolean} [loose=false] Whether the check is loose or strict. If the check is strict (`false`), compared range cannot
  27669. * start or end at the same position as this range boundaries. If the check is loose (`true`), compared range can start, end or
  27670. * even be equal to this range. Note that collapsed ranges are always compared in strict mode.
  27671. * @returns {Boolean} `true` if given {@link ~Range range} boundaries are contained by this range, `false` otherwise.
  27672. */
  27673. containsRange( otherRange, loose = false ) {
  27674. if ( otherRange.isCollapsed ) {
  27675. loose = false;
  27676. }
  27677. const containsStart = this.containsPosition( otherRange.start ) || ( loose && this.start.isEqual( otherRange.start ) );
  27678. const containsEnd = this.containsPosition( otherRange.end ) || ( loose && this.end.isEqual( otherRange.end ) );
  27679. return containsStart && containsEnd;
  27680. }
  27681. /**
  27682. * Checks whether given {@link module:engine/model/item~Item} is inside this range.
  27683. *
  27684. * @param {module:engine/model/item~Item} item Model item to check.
  27685. */
  27686. containsItem( item ) {
  27687. const pos = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( item );
  27688. return this.containsPosition( pos ) || this.start.isEqual( pos );
  27689. }
  27690. /**
  27691. * Checks whether this object is of the given.
  27692. *
  27693. * range.is( 'range' ); // -> true
  27694. * range.is( 'model:range' ); // -> true
  27695. *
  27696. * range.is( 'view:range' ); // -> false
  27697. * range.is( 'documentSelection' ); // -> false
  27698. *
  27699. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  27700. *
  27701. * @param {String} type
  27702. * @returns {Boolean}
  27703. */
  27704. is( type ) {
  27705. return type === 'range' || type === 'model:range';
  27706. }
  27707. /**
  27708. * Two ranges are equal if their {@link #start} and {@link #end} positions are equal.
  27709. *
  27710. * @param {module:engine/model/range~Range} otherRange Range to compare with.
  27711. * @returns {Boolean} `true` if ranges are equal, `false` otherwise.
  27712. */
  27713. isEqual( otherRange ) {
  27714. return this.start.isEqual( otherRange.start ) && this.end.isEqual( otherRange.end );
  27715. }
  27716. /**
  27717. * Checks and returns whether this range intersects with given range.
  27718. *
  27719. * @param {module:engine/model/range~Range} otherRange Range to compare with.
  27720. * @returns {Boolean} `true` if ranges intersect, `false` otherwise.
  27721. */
  27722. isIntersecting( otherRange ) {
  27723. return this.start.isBefore( otherRange.end ) && this.end.isAfter( otherRange.start );
  27724. }
  27725. /**
  27726. * Computes which part(s) of this {@link ~Range range} is not a part of given {@link ~Range range}.
  27727. * Returned array contains zero, one or two {@link ~Range ranges}.
  27728. *
  27729. * Examples:
  27730. *
  27731. * let range = model.createRange(
  27732. * model.createPositionFromPath( root, [ 2, 7 ] ),
  27733. * model.createPositionFromPath( root, [ 4, 0, 1 ] )
  27734. * );
  27735. * let otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 5 ] ) );
  27736. * let transformed = range.getDifference( otherRange );
  27737. * // transformed array has no ranges because `otherRange` contains `range`
  27738. *
  27739. * otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 3 ] ) );
  27740. * transformed = range.getDifference( otherRange );
  27741. * // transformed array has one range: from [ 3 ] to [ 4, 0, 1 ]
  27742. *
  27743. * otherRange = model.createRange( model.createPositionFromPath( root, [ 3 ] ), model.createPositionFromPath( root, [ 4 ] ) );
  27744. * transformed = range.getDifference( otherRange );
  27745. * // transformed array has two ranges: from [ 2, 7 ] to [ 3 ] and from [ 4 ] to [ 4, 0, 1 ]
  27746. *
  27747. * @param {module:engine/model/range~Range} otherRange Range to differentiate against.
  27748. * @returns {Array.<module:engine/model/range~Range>} The difference between ranges.
  27749. */
  27750. getDifference( otherRange ) {
  27751. const ranges = [];
  27752. if ( this.isIntersecting( otherRange ) ) {
  27753. // Ranges intersect.
  27754. if ( this.containsPosition( otherRange.start ) ) {
  27755. // Given range start is inside this range. This means that we have to
  27756. // add shrunken range - from the start to the middle of this range.
  27757. ranges.push( new Range( this.start, otherRange.start ) );
  27758. }
  27759. if ( this.containsPosition( otherRange.end ) ) {
  27760. // Given range end is inside this range. This means that we have to
  27761. // add shrunken range - from the middle of this range to the end.
  27762. ranges.push( new Range( otherRange.end, this.end ) );
  27763. }
  27764. } else {
  27765. // Ranges do not intersect, return the original range.
  27766. ranges.push( new Range( this.start, this.end ) );
  27767. }
  27768. return ranges;
  27769. }
  27770. /**
  27771. * Returns an intersection of this {@link ~Range range} and given {@link ~Range range}.
  27772. * Intersection is a common part of both of those ranges. If ranges has no common part, returns `null`.
  27773. *
  27774. * Examples:
  27775. *
  27776. * let range = model.createRange(
  27777. * model.createPositionFromPath( root, [ 2, 7 ] ),
  27778. * model.createPositionFromPath( root, [ 4, 0, 1 ] )
  27779. * );
  27780. * let otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 2 ] ) );
  27781. * let transformed = range.getIntersection( otherRange ); // null - ranges have no common part
  27782. *
  27783. * otherRange = model.createRange( model.createPositionFromPath( root, [ 3 ] ), model.createPositionFromPath( root, [ 5 ] ) );
  27784. * transformed = range.getIntersection( otherRange ); // range from [ 3 ] to [ 4, 0, 1 ]
  27785. *
  27786. * @param {module:engine/model/range~Range} otherRange Range to check for intersection.
  27787. * @returns {module:engine/model/range~Range|null} A common part of given ranges or `null` if ranges have no common part.
  27788. */
  27789. getIntersection( otherRange ) {
  27790. if ( this.isIntersecting( otherRange ) ) {
  27791. // Ranges intersect, so a common range will be returned.
  27792. // At most, it will be same as this range.
  27793. let commonRangeStart = this.start;
  27794. let commonRangeEnd = this.end;
  27795. if ( this.containsPosition( otherRange.start ) ) {
  27796. // Given range start is inside this range. This means thaNt we have to
  27797. // shrink common range to the given range start.
  27798. commonRangeStart = otherRange.start;
  27799. }
  27800. if ( this.containsPosition( otherRange.end ) ) {
  27801. // Given range end is inside this range. This means that we have to
  27802. // shrink common range to the given range end.
  27803. commonRangeEnd = otherRange.end;
  27804. }
  27805. return new Range( commonRangeStart, commonRangeEnd );
  27806. }
  27807. // Ranges do not intersect, so they do not have common part.
  27808. return null;
  27809. }
  27810. /**
  27811. * Returns a range created by joining this {@link ~Range range} with the given {@link ~Range range}.
  27812. * If ranges have no common part, returns `null`.
  27813. *
  27814. * Examples:
  27815. *
  27816. * let range = model.createRange(
  27817. * model.createPositionFromPath( root, [ 2, 7 ] ),
  27818. * model.createPositionFromPath( root, [ 4, 0, 1 ] )
  27819. * );
  27820. * let otherRange = model.createRange(
  27821. * model.createPositionFromPath( root, [ 1 ] ),
  27822. * model.createPositionFromPath( root, [ 2 ] )
  27823. * );
  27824. * let transformed = range.getJoined( otherRange ); // null - ranges have no common part
  27825. *
  27826. * otherRange = model.createRange(
  27827. * model.createPositionFromPath( root, [ 3 ] ),
  27828. * model.createPositionFromPath( root, [ 5 ] )
  27829. * );
  27830. * transformed = range.getJoined( otherRange ); // range from [ 2, 7 ] to [ 5 ]
  27831. *
  27832. * @param {module:engine/model/range~Range} otherRange Range to be joined.
  27833. * @param {Boolean} [loose=false] Whether the intersection check is loose or strict. If the check is strict (`false`),
  27834. * ranges are tested for intersection or whether start/end positions are equal. If the check is loose (`true`),
  27835. * compared range is also checked if it's {@link module:engine/model/position~Position#isTouching touching} current range.
  27836. * @returns {module:engine/model/range~Range|null} A sum of given ranges or `null` if ranges have no common part.
  27837. */
  27838. getJoined( otherRange, loose = false ) {
  27839. let shouldJoin = this.isIntersecting( otherRange );
  27840. if ( !shouldJoin ) {
  27841. if ( this.start.isBefore( otherRange.start ) ) {
  27842. shouldJoin = loose ? this.end.isTouching( otherRange.start ) : this.end.isEqual( otherRange.start );
  27843. } else {
  27844. shouldJoin = loose ? otherRange.end.isTouching( this.start ) : otherRange.end.isEqual( this.start );
  27845. }
  27846. }
  27847. if ( !shouldJoin ) {
  27848. return null;
  27849. }
  27850. let startPosition = this.start;
  27851. let endPosition = this.end;
  27852. if ( otherRange.start.isBefore( startPosition ) ) {
  27853. startPosition = otherRange.start;
  27854. }
  27855. if ( otherRange.end.isAfter( endPosition ) ) {
  27856. endPosition = otherRange.end;
  27857. }
  27858. return new Range( startPosition, endPosition );
  27859. }
  27860. /**
  27861. * Computes and returns the smallest set of {@link #isFlat flat} ranges, that covers this range in whole.
  27862. *
  27863. * See an example of a model structure (`[` and `]` are range boundaries):
  27864. *
  27865. * root root
  27866. * |- element DIV DIV P2 P3 DIV
  27867. * | |- element H H P1 f o o b a r H P4
  27868. * | | |- "fir[st" fir[st lorem se]cond ipsum
  27869. * | |- element P1
  27870. * | | |- "lorem" ||
  27871. * |- element P2 ||
  27872. * | |- "foo" VV
  27873. * |- element P3
  27874. * | |- "bar" root
  27875. * |- element DIV DIV [P2 P3] DIV
  27876. * | |- element H H [P1] f o o b a r H P4
  27877. * | | |- "se]cond" fir[st] lorem [se]cond ipsum
  27878. * | |- element P4
  27879. * | | |- "ipsum"
  27880. *
  27881. * As it can be seen, letters contained in the range are: `stloremfoobarse`, spread across different parents.
  27882. * We are looking for minimal set of flat ranges that contains the same nodes.
  27883. *
  27884. * Minimal flat ranges for above range `( [ 0, 0, 3 ], [ 3, 0, 2 ] )` will be:
  27885. *
  27886. * ( [ 0, 0, 3 ], [ 0, 0, 5 ] ) = "st"
  27887. * ( [ 0, 1 ], [ 0, 2 ] ) = element P1 ("lorem")
  27888. * ( [ 1 ], [ 3 ] ) = element P2, element P3 ("foobar")
  27889. * ( [ 3, 0, 0 ], [ 3, 0, 2 ] ) = "se"
  27890. *
  27891. * **Note:** if an {@link module:engine/model/element~Element element} is not wholly contained in this range, it won't be returned
  27892. * in any of the returned flat ranges. See in the example how `H` elements at the beginning and at the end of the range
  27893. * were omitted. Only their parts that were wholly in the range were returned.
  27894. *
  27895. * **Note:** this method is not returning flat ranges that contain no nodes.
  27896. *
  27897. * @returns {Array.<module:engine/model/range~Range>} Array of flat ranges covering this range.
  27898. */
  27899. getMinimalFlatRanges() {
  27900. const ranges = [];
  27901. const diffAt = this.start.getCommonPath( this.end ).length;
  27902. const pos = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( this.start );
  27903. let posParent = pos.parent;
  27904. // Go up.
  27905. while ( pos.path.length > diffAt + 1 ) {
  27906. const howMany = posParent.maxOffset - pos.offset;
  27907. if ( howMany !== 0 ) {
  27908. ranges.push( new Range( pos, pos.getShiftedBy( howMany ) ) );
  27909. }
  27910. pos.path = pos.path.slice( 0, -1 );
  27911. pos.offset++;
  27912. posParent = posParent.parent;
  27913. }
  27914. // Go down.
  27915. while ( pos.path.length <= this.end.path.length ) {
  27916. const offset = this.end.path[ pos.path.length - 1 ];
  27917. const howMany = offset - pos.offset;
  27918. if ( howMany !== 0 ) {
  27919. ranges.push( new Range( pos, pos.getShiftedBy( howMany ) ) );
  27920. }
  27921. pos.offset = offset;
  27922. pos.path.push( 0 );
  27923. }
  27924. return ranges;
  27925. }
  27926. /**
  27927. * Creates a {@link module:engine/model/treewalker~TreeWalker TreeWalker} instance with this range as a boundary.
  27928. *
  27929. * For example, to iterate over all items in the entire document root:
  27930. *
  27931. * // Create a range spanning over the entire root content:
  27932. * const range = editor.model.createRangeIn( editor.model.document.getRoot() );
  27933. *
  27934. * // Iterate over all items in this range:
  27935. * for ( const value of range.getWalker() ) {
  27936. * console.log( value.item );
  27937. * }
  27938. *
  27939. * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
  27940. * @param {module:engine/model/position~Position} [options.startPosition]
  27941. * @param {Boolean} [options.singleCharacters=false]
  27942. * @param {Boolean} [options.shallow=false]
  27943. * @param {Boolean} [options.ignoreElementEnd=false]
  27944. * @returns {module:engine/model/treewalker~TreeWalker}
  27945. */
  27946. getWalker( options = {} ) {
  27947. options.boundaries = this;
  27948. return new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  27949. }
  27950. /**
  27951. * Returns an iterator that iterates over all {@link module:engine/model/item~Item items} that are in this range and returns
  27952. * them.
  27953. *
  27954. * This method uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range and `ignoreElementEnd` option
  27955. * set to `true`. However it returns only {@link module:engine/model/item~Item model items},
  27956. * not {@link module:engine/model/treewalker~TreeWalkerValue}.
  27957. *
  27958. * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~TreeWalker} for
  27959. * a full list of available options.
  27960. *
  27961. * @param {Object} [options] Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
  27962. * @returns {Iterable.<module:engine/model/item~Item>}
  27963. */
  27964. * getItems( options = {} ) {
  27965. options.boundaries = this;
  27966. options.ignoreElementEnd = true;
  27967. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  27968. for ( const value of treeWalker ) {
  27969. yield value.item;
  27970. }
  27971. }
  27972. /**
  27973. * Returns an iterator that iterates over all {@link module:engine/model/position~Position positions} that are boundaries or
  27974. * contained in this range.
  27975. *
  27976. * This method uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range. However it returns only
  27977. * {@link module:engine/model/position~Position positions}, not {@link module:engine/model/treewalker~TreeWalkerValue}.
  27978. *
  27979. * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~TreeWalker} for
  27980. * a full list of available options.
  27981. *
  27982. * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
  27983. * @returns {Iterable.<module:engine/model/position~Position>}
  27984. */
  27985. * getPositions( options = {} ) {
  27986. options.boundaries = this;
  27987. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  27988. yield treeWalker.position;
  27989. for ( const value of treeWalker ) {
  27990. yield value.nextPosition;
  27991. }
  27992. }
  27993. /**
  27994. * Returns a range that is a result of transforming this range by given `operation`.
  27995. *
  27996. * **Note:** transformation may break one range into multiple ranges (for example, when a part of the range is
  27997. * moved to a different part of document tree). For this reason, an array is returned by this method and it
  27998. * may contain one or more `Range` instances.
  27999. *
  28000. * @param {module:engine/model/operation/operation~Operation} operation Operation to transform range by.
  28001. * @returns {Array.<module:engine/model/range~Range>} Range which is the result of transformation.
  28002. */
  28003. getTransformedByOperation( operation ) {
  28004. switch ( operation.type ) {
  28005. case 'insert':
  28006. return this._getTransformedByInsertOperation( operation );
  28007. case 'move':
  28008. case 'remove':
  28009. case 'reinsert':
  28010. return this._getTransformedByMoveOperation( operation );
  28011. case 'split':
  28012. return [ this._getTransformedBySplitOperation( operation ) ];
  28013. case 'merge':
  28014. return [ this._getTransformedByMergeOperation( operation ) ];
  28015. }
  28016. return [ new Range( this.start, this.end ) ];
  28017. }
  28018. /**
  28019. * Returns a range that is a result of transforming this range by multiple `operations`.
  28020. *
  28021. * @see ~Range#getTransformedByOperation
  28022. * @param {Iterable.<module:engine/model/operation/operation~Operation>} operations Operations to transform the range by.
  28023. * @returns {Array.<module:engine/model/range~Range>} Range which is the result of transformation.
  28024. */
  28025. getTransformedByOperations( operations ) {
  28026. const ranges = [ new Range( this.start, this.end ) ];
  28027. for ( const operation of operations ) {
  28028. for ( let i = 0; i < ranges.length; i++ ) {
  28029. const result = ranges[ i ].getTransformedByOperation( operation );
  28030. ranges.splice( i, 1, ...result );
  28031. i += result.length - 1;
  28032. }
  28033. }
  28034. // It may happen that a range is split into two, and then the part of second "piece" is moved into first
  28035. // "piece". In this case we will have incorrect third range, which should not be included in the result --
  28036. // because it is already included in the first "piece". In this loop we are looking for all such ranges that
  28037. // are inside other ranges and we simply remove them.
  28038. for ( let i = 0; i < ranges.length; i++ ) {
  28039. const range = ranges[ i ];
  28040. for ( let j = i + 1; j < ranges.length; j++ ) {
  28041. const next = ranges[ j ];
  28042. if ( range.containsRange( next ) || next.containsRange( range ) || range.isEqual( next ) ) {
  28043. ranges.splice( j, 1 );
  28044. }
  28045. }
  28046. }
  28047. return ranges;
  28048. }
  28049. /**
  28050. * Returns an {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}
  28051. * which is a common ancestor of the range's both ends (in which the entire range is contained).
  28052. *
  28053. * @returns {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
  28054. */
  28055. getCommonAncestor() {
  28056. return this.start.getCommonAncestor( this.end );
  28057. }
  28058. /**
  28059. * Returns an {@link module:engine/model/element~Element Element} contained by the range.
  28060. * The element will be returned when it is the **only** node within the range and **fully–contained**
  28061. * at the same time.
  28062. *
  28063. * @returns {module:engine/model/element~Element|null}
  28064. */
  28065. getContainedElement() {
  28066. if ( this.isCollapsed ) {
  28067. return null;
  28068. }
  28069. const nodeAfterStart = this.start.nodeAfter;
  28070. const nodeBeforeEnd = this.end.nodeBefore;
  28071. if ( nodeAfterStart && nodeAfterStart.is( 'element' ) && nodeAfterStart === nodeBeforeEnd ) {
  28072. return nodeAfterStart;
  28073. }
  28074. return null;
  28075. }
  28076. /**
  28077. * Converts `Range` to plain object and returns it.
  28078. *
  28079. * @returns {Object} `Node` converted to plain object.
  28080. */
  28081. toJSON() {
  28082. return {
  28083. start: this.start.toJSON(),
  28084. end: this.end.toJSON()
  28085. };
  28086. }
  28087. /**
  28088. * Returns a new range that is equal to current range.
  28089. *
  28090. * @returns {module:engine/model/range~Range}
  28091. */
  28092. clone() {
  28093. return new this.constructor( this.start, this.end );
  28094. }
  28095. /**
  28096. * Returns a result of transforming a copy of this range by insert operation.
  28097. *
  28098. * One or more ranges may be returned as a result of this transformation.
  28099. *
  28100. * @protected
  28101. * @param {module:engine/model/operation/insertoperation~InsertOperation} operation
  28102. * @returns {Array.<module:engine/model/range~Range>}
  28103. */
  28104. _getTransformedByInsertOperation( operation, spread = false ) {
  28105. return this._getTransformedByInsertion( operation.position, operation.howMany, spread );
  28106. }
  28107. /**
  28108. * Returns a result of transforming a copy of this range by move operation.
  28109. *
  28110. * One or more ranges may be returned as a result of this transformation.
  28111. *
  28112. * @protected
  28113. * @param {module:engine/model/operation/moveoperation~MoveOperation} operation
  28114. * @returns {Array.<module:engine/model/range~Range>}
  28115. */
  28116. _getTransformedByMoveOperation( operation, spread = false ) {
  28117. const sourcePosition = operation.sourcePosition;
  28118. const howMany = operation.howMany;
  28119. const targetPosition = operation.targetPosition;
  28120. return this._getTransformedByMove( sourcePosition, targetPosition, howMany, spread );
  28121. }
  28122. /**
  28123. * Returns a result of transforming a copy of this range by split operation.
  28124. *
  28125. * Always one range is returned. The transformation is done in a way to not break the range.
  28126. *
  28127. * @protected
  28128. * @param {module:engine/model/operation/splitoperation~SplitOperation} operation
  28129. * @returns {module:engine/model/range~Range}
  28130. */
  28131. _getTransformedBySplitOperation( operation ) {
  28132. const start = this.start._getTransformedBySplitOperation( operation );
  28133. let end = this.end._getTransformedBySplitOperation( operation );
  28134. if ( this.end.isEqual( operation.insertionPosition ) ) {
  28135. end = this.end.getShiftedBy( 1 );
  28136. }
  28137. // Below may happen when range contains graveyard element used by split operation.
  28138. if ( start.root != end.root ) {
  28139. // End position was next to the moved graveyard element and was moved with it.
  28140. // Fix it by using old `end` which has proper `root`.
  28141. end = this.end.getShiftedBy( -1 );
  28142. }
  28143. return new Range( start, end );
  28144. }
  28145. /**
  28146. * Returns a result of transforming a copy of this range by merge operation.
  28147. *
  28148. * Always one range is returned. The transformation is done in a way to not break the range.
  28149. *
  28150. * @protected
  28151. * @param {module:engine/model/operation/mergeoperation~MergeOperation} operation
  28152. * @returns {module:engine/model/range~Range}
  28153. */
  28154. _getTransformedByMergeOperation( operation ) {
  28155. // Special case when the marker is set on "the closing tag" of an element. Marker can be set like that during
  28156. // transformations, especially when a content of a few block elements were removed. For example:
  28157. //
  28158. // {} is the transformed range, [] is the removed range.
  28159. // <p>F[o{o</p><p>B}ar</p><p>Xy]z</p>
  28160. //
  28161. // <p>Fo{o</p><p>B}ar</p><p>z</p>
  28162. // <p>F{</p><p>B}ar</p><p>z</p>
  28163. // <p>F{</p>}<p>z</p>
  28164. // <p>F{}z</p>
  28165. //
  28166. if ( this.start.isEqual( operation.targetPosition ) && this.end.isEqual( operation.deletionPosition ) ) {
  28167. return new Range( this.start );
  28168. }
  28169. let start = this.start._getTransformedByMergeOperation( operation );
  28170. let end = this.end._getTransformedByMergeOperation( operation );
  28171. if ( start.root != end.root ) {
  28172. // This happens when the end position was next to the merged (deleted) element.
  28173. // Then, the end position was moved to the graveyard root. In this case we need to fix
  28174. // the range cause its boundaries would be in different roots.
  28175. end = this.end.getShiftedBy( -1 );
  28176. }
  28177. if ( start.isAfter( end ) ) {
  28178. // This happens in three following cases:
  28179. //
  28180. // Case 1: Merge operation source position is before the target position (due to some transformations, OT, etc.)
  28181. // This means that start can be moved before the end of the range.
  28182. //
  28183. // Before: <p>a{a</p><p>b}b</p><p>cc</p>
  28184. // Merge: <p>b}b</p><p>cca{a</p>
  28185. // Fix: <p>{b}b</p><p>ccaa</p>
  28186. //
  28187. // Case 2: Range start is before merged node but not directly.
  28188. // Result should include all nodes that were in the original range.
  28189. //
  28190. // Before: <p>aa</p>{<p>cc</p><p>b}b</p>
  28191. // Merge: <p>aab}b</p>{<p>cc</p>
  28192. // Fix: <p>aa{bb</p><p>cc</p>}
  28193. //
  28194. // The range is expanded by an additional `b` letter but it is better than dropping the whole `cc` paragraph.
  28195. //
  28196. // Case 3: Range start is directly before merged node.
  28197. // Resulting range should include only nodes from the merged element:
  28198. //
  28199. // Before: <p>aa</p>{<p>b}b</p><p>cc</p>
  28200. // Merge: <p>aab}b</p>{<p>cc</p>
  28201. // Fix: <p>aa{b}b</p><p>cc</p>
  28202. //
  28203. if ( operation.sourcePosition.isBefore( operation.targetPosition ) ) {
  28204. // Case 1.
  28205. start = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( end );
  28206. start.offset = 0;
  28207. } else {
  28208. if ( !operation.deletionPosition.isEqual( start ) ) {
  28209. // Case 2.
  28210. end = operation.deletionPosition;
  28211. }
  28212. // In both case 2 and 3 start is at the end of the merge-to element.
  28213. start = operation.targetPosition;
  28214. }
  28215. return new Range( start, end );
  28216. }
  28217. return new Range( start, end );
  28218. }
  28219. /**
  28220. * Returns an array containing one or two {@link ~Range ranges} that are a result of transforming this
  28221. * {@link ~Range range} by inserting `howMany` nodes at `insertPosition`. Two {@link ~Range ranges} are
  28222. * returned if the insertion was inside this {@link ~Range range} and `spread` is set to `true`.
  28223. *
  28224. * Examples:
  28225. *
  28226. * let range = model.createRange(
  28227. * model.createPositionFromPath( root, [ 2, 7 ] ),
  28228. * model.createPositionFromPath( root, [ 4, 0, 1 ] )
  28229. * );
  28230. * let transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 1 ] ), 2 );
  28231. * // transformed array has one range from [ 4, 7 ] to [ 6, 0, 1 ]
  28232. *
  28233. * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 4, 0, 0 ] ), 4 );
  28234. * // transformed array has one range from [ 2, 7 ] to [ 4, 0, 5 ]
  28235. *
  28236. * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 3, 2 ] ), 4 );
  28237. * // transformed array has one range, which is equal to original range
  28238. *
  28239. * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 3, 2 ] ), 4, true );
  28240. * // transformed array has two ranges: from [ 2, 7 ] to [ 3, 2 ] and from [ 3, 6 ] to [ 4, 0, 1 ]
  28241. *
  28242. * @protected
  28243. * @param {module:engine/model/position~Position} insertPosition Position where nodes are inserted.
  28244. * @param {Number} howMany How many nodes are inserted.
  28245. * @param {Boolean} [spread] Flag indicating whether this {~Range range} should be spread if insertion
  28246. * was inside the range. Defaults to `false`.
  28247. * @returns {Array.<module:engine/model/range~Range>} Result of the transformation.
  28248. */
  28249. _getTransformedByInsertion( insertPosition, howMany, spread = false ) {
  28250. if ( spread && this.containsPosition( insertPosition ) ) {
  28251. // Range has to be spread. The first part is from original start to the spread point.
  28252. // The other part is from spread point to the original end, but transformed by
  28253. // insertion to reflect insertion changes.
  28254. return [
  28255. new Range( this.start, insertPosition ),
  28256. new Range(
  28257. insertPosition.getShiftedBy( howMany ),
  28258. this.end._getTransformedByInsertion( insertPosition, howMany )
  28259. )
  28260. ];
  28261. } else {
  28262. const range = new Range( this.start, this.end );
  28263. range.start = range.start._getTransformedByInsertion( insertPosition, howMany );
  28264. range.end = range.end._getTransformedByInsertion( insertPosition, howMany );
  28265. return [ range ];
  28266. }
  28267. }
  28268. /**
  28269. * Returns an array containing {@link ~Range ranges} that are a result of transforming this
  28270. * {@link ~Range range} by moving `howMany` nodes from `sourcePosition` to `targetPosition`.
  28271. *
  28272. * @protected
  28273. * @param {module:engine/model/position~Position} sourcePosition Position from which nodes are moved.
  28274. * @param {module:engine/model/position~Position} targetPosition Position to where nodes are moved.
  28275. * @param {Number} howMany How many nodes are moved.
  28276. * @param {Boolean} [spread=false] Whether the range should be spread if the move points inside the range.
  28277. * @returns {Array.<module:engine/model/range~Range>} Result of the transformation.
  28278. */
  28279. _getTransformedByMove( sourcePosition, targetPosition, howMany, spread = false ) {
  28280. // Special case for transforming a collapsed range. Just transform it like a position.
  28281. if ( this.isCollapsed ) {
  28282. const newPos = this.start._getTransformedByMove( sourcePosition, targetPosition, howMany );
  28283. return [ new Range( newPos ) ];
  28284. }
  28285. // Special case for transformation when a part of the range is moved towards the range.
  28286. //
  28287. // Examples:
  28288. //
  28289. // <div><p>ab</p><p>c[d</p></div><p>e]f</p> --> <div><p>ab</p></div><p>c[d</p><p>e]f</p>
  28290. // <p>e[f</p><div><p>a]b</p><p>cd</p></div> --> <p>e[f</p><p>a]b</p><div><p>cd</p></div>
  28291. //
  28292. // Without this special condition, the default algorithm leaves an "artifact" range from one of `differenceSet` parts:
  28293. //
  28294. // <div><p>ab</p><p>c[d</p></div><p>e]f</p> --> <div><p>ab</p>{</div>}<p>c[d</p><p>e]f</p>
  28295. //
  28296. // This special case is applied only if the range is to be kept together (not spread).
  28297. const moveRange = Range._createFromPositionAndShift( sourcePosition, howMany );
  28298. const insertPosition = targetPosition._getTransformedByDeletion( sourcePosition, howMany );
  28299. if ( this.containsPosition( targetPosition ) && !spread ) {
  28300. if ( moveRange.containsPosition( this.start ) || moveRange.containsPosition( this.end ) ) {
  28301. const start = this.start._getTransformedByMove( sourcePosition, targetPosition, howMany );
  28302. const end = this.end._getTransformedByMove( sourcePosition, targetPosition, howMany );
  28303. return [ new Range( start, end ) ];
  28304. }
  28305. }
  28306. // Default algorithm.
  28307. let result;
  28308. const differenceSet = this.getDifference( moveRange );
  28309. let difference = null;
  28310. const common = this.getIntersection( moveRange );
  28311. if ( differenceSet.length == 1 ) {
  28312. // `moveRange` and this range may intersect but may be separate.
  28313. difference = new Range(
  28314. differenceSet[ 0 ].start._getTransformedByDeletion( sourcePosition, howMany ),
  28315. differenceSet[ 0 ].end._getTransformedByDeletion( sourcePosition, howMany )
  28316. );
  28317. } else if ( differenceSet.length == 2 ) {
  28318. // `moveRange` is inside this range.
  28319. difference = new Range(
  28320. this.start,
  28321. this.end._getTransformedByDeletion( sourcePosition, howMany )
  28322. );
  28323. } // else, `moveRange` contains this range.
  28324. if ( difference ) {
  28325. result = difference._getTransformedByInsertion( insertPosition, howMany, common !== null || spread );
  28326. } else {
  28327. result = [];
  28328. }
  28329. if ( common ) {
  28330. const transformedCommon = new Range(
  28331. common.start._getCombined( moveRange.start, insertPosition ),
  28332. common.end._getCombined( moveRange.start, insertPosition )
  28333. );
  28334. if ( result.length == 2 ) {
  28335. result.splice( 1, 0, transformedCommon );
  28336. } else {
  28337. result.push( transformedCommon );
  28338. }
  28339. }
  28340. return result;
  28341. }
  28342. /**
  28343. * Returns a copy of this range that is transformed by deletion of `howMany` nodes from `deletePosition`.
  28344. *
  28345. * If the deleted range is intersecting with the transformed range, the transformed range will be shrank.
  28346. *
  28347. * If the deleted range contains transformed range, `null` will be returned.
  28348. *
  28349. * @protected
  28350. * @param {module:engine/model/position~Position} deletionPosition Position from which nodes are removed.
  28351. * @param {Number} howMany How many nodes are removed.
  28352. * @returns {module:engine/model/range~Range|null} Result of the transformation.
  28353. */
  28354. _getTransformedByDeletion( deletePosition, howMany ) {
  28355. let newStart = this.start._getTransformedByDeletion( deletePosition, howMany );
  28356. let newEnd = this.end._getTransformedByDeletion( deletePosition, howMany );
  28357. if ( newStart == null && newEnd == null ) {
  28358. return null;
  28359. }
  28360. if ( newStart == null ) {
  28361. newStart = deletePosition;
  28362. }
  28363. if ( newEnd == null ) {
  28364. newEnd = deletePosition;
  28365. }
  28366. return new Range( newStart, newEnd );
  28367. }
  28368. /**
  28369. * Creates a new range, spreading from specified {@link module:engine/model/position~Position position} to a position moved by
  28370. * given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.
  28371. *
  28372. * @protected
  28373. * @param {module:engine/model/position~Position} position Beginning of the range.
  28374. * @param {Number} shift How long the range should be.
  28375. * @returns {module:engine/model/range~Range}
  28376. */
  28377. static _createFromPositionAndShift( position, shift ) {
  28378. const start = position;
  28379. const end = position.getShiftedBy( shift );
  28380. return shift > 0 ? new this( start, end ) : new this( end, start );
  28381. }
  28382. /**
  28383. * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of
  28384. * that element and ends after the last child of that element.
  28385. *
  28386. * @protected
  28387. * @param {module:engine/model/element~Element} element Element which is a parent for the range.
  28388. * @returns {module:engine/model/range~Range}
  28389. */
  28390. static _createIn( element ) {
  28391. return new this( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, 0 ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, element.maxOffset ) );
  28392. }
  28393. /**
  28394. * Creates a range that starts before given {@link module:engine/model/item~Item model item} and ends after it.
  28395. *
  28396. * @protected
  28397. * @param {module:engine/model/item~Item} item
  28398. * @returns {module:engine/model/range~Range}
  28399. */
  28400. static _createOn( item ) {
  28401. return this._createFromPositionAndShift( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( item ), item.offsetSize );
  28402. }
  28403. /**
  28404. * Combines all ranges from the passed array into a one range. At least one range has to be passed.
  28405. * Passed ranges must not have common parts.
  28406. *
  28407. * The first range from the array is a reference range. If other ranges start or end on the exactly same position where
  28408. * the reference range, they get combined into one range.
  28409. *
  28410. * [ ][] [ ][ ][ ][ ][] [ ] // Passed ranges, shown sorted
  28411. * [ ] // The result of the function if the first range was a reference range.
  28412. * [ ] // The result of the function if the third-to-seventh range was a reference range.
  28413. * [ ] // The result of the function if the last range was a reference range.
  28414. *
  28415. * @param {Array.<module:engine/model/range~Range>} ranges Ranges to combine.
  28416. * @returns {module:engine/model/range~Range} Combined range.
  28417. */
  28418. static _createFromRanges( ranges ) {
  28419. if ( ranges.length === 0 ) {
  28420. /**
  28421. * At least one range has to be passed to
  28422. * {@link module:engine/model/range~Range._createFromRanges `Range._createFromRanges()`}.
  28423. *
  28424. * @error range-create-from-ranges-empty-array
  28425. */
  28426. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  28427. 'range-create-from-ranges-empty-array',
  28428. null
  28429. );
  28430. } else if ( ranges.length == 1 ) {
  28431. return ranges[ 0 ].clone();
  28432. }
  28433. // 1. Set the first range in `ranges` array as a reference range.
  28434. // If we are going to return just a one range, one of the ranges need to be the reference one.
  28435. // Other ranges will be stuck to that range, if possible.
  28436. const ref = ranges[ 0 ];
  28437. // 2. Sort all the ranges so it's easier to process them.
  28438. ranges.sort( ( a, b ) => {
  28439. return a.start.isAfter( b.start ) ? 1 : -1;
  28440. } );
  28441. // 3. Check at which index the reference range is now.
  28442. const refIndex = ranges.indexOf( ref );
  28443. // 4. At this moment we don't need the original range.
  28444. // We are going to modify the result and we need to return a new instance of Range.
  28445. // We have to create a copy of the reference range.
  28446. const result = new this( ref.start, ref.end );
  28447. // 5. Ranges should be checked and glued starting from the range that is closest to the reference range.
  28448. // Since ranges are sorted, start with the range with index that is closest to reference range index.
  28449. if ( refIndex > 0 ) {
  28450. for ( let i = refIndex - 1; true; i++ ) {
  28451. if ( ranges[ i ].end.isEqual( result.start ) ) {
  28452. result.start = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( ranges[ i ].start );
  28453. } else {
  28454. // If ranges are not starting/ending at the same position there is no point in looking further.
  28455. break;
  28456. }
  28457. }
  28458. }
  28459. // 6. Ranges should be checked and glued starting from the range that is closest to the reference range.
  28460. // Since ranges are sorted, start with the range with index that is closest to reference range index.
  28461. for ( let i = refIndex + 1; i < ranges.length; i++ ) {
  28462. if ( ranges[ i ].start.isEqual( result.end ) ) {
  28463. result.end = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( ranges[ i ].end );
  28464. } else {
  28465. // If ranges are not starting/ending at the same position there is no point in looking further.
  28466. break;
  28467. }
  28468. }
  28469. return result;
  28470. }
  28471. /**
  28472. * Creates a `Range` instance from given plain object (i.e. parsed JSON string).
  28473. *
  28474. * @param {Object} json Plain object to be converted to `Range`.
  28475. * @param {module:engine/model/document~Document} doc Document object that will be range owner.
  28476. * @returns {module:engine/model/range~Range} `Range` instance created using given plain object.
  28477. */
  28478. static fromJSON( json, doc ) {
  28479. return new this( _position__WEBPACK_IMPORTED_MODULE_0__["default"].fromJSON( json.start, doc ), _position__WEBPACK_IMPORTED_MODULE_0__["default"].fromJSON( json.end, doc ) );
  28480. }
  28481. // @if CK_DEBUG_ENGINE // toString() {
  28482. // @if CK_DEBUG_ENGINE // return `${ this.root } [ ${ this.start.path.join( ', ' ) } ] - [ ${ this.end.path.join( ', ' ) } ]`;
  28483. // @if CK_DEBUG_ENGINE // }
  28484. // @if CK_DEBUG_ENGINE // log() {
  28485. // @if CK_DEBUG_ENGINE // console.log( 'ModelPosition: ' + this );
  28486. // @if CK_DEBUG_ENGINE // }
  28487. }
  28488. /***/ }),
  28489. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js":
  28490. /*!**************************************************************************!*\
  28491. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js ***!
  28492. \**************************************************************************/
  28493. /*! exports provided: default */
  28494. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  28495. "use strict";
  28496. __webpack_require__.r(__webpack_exports__);
  28497. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RootElement; });
  28498. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  28499. /**
  28500. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  28501. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  28502. */
  28503. /**
  28504. * @module engine/model/rootelement
  28505. */
  28506. /**
  28507. * Type of {@link module:engine/model/element~Element} that is a root of a model tree.
  28508. * @extends module:engine/model/element~Element
  28509. */
  28510. class RootElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  28511. /**
  28512. * Creates root element.
  28513. *
  28514. * @param {module:engine/model/document~Document} document Document that is an owner of this root.
  28515. * @param {String} name Node name.
  28516. * @param {String} [rootName='main'] Unique root name used to identify this root
  28517. * element by {@link module:engine/model/document~Document}.
  28518. */
  28519. constructor( document, name, rootName = 'main' ) {
  28520. super( name );
  28521. /**
  28522. * Document that is an owner of this root.
  28523. *
  28524. * @private
  28525. * @member {module:engine/model/document~Document}
  28526. */
  28527. this._document = document;
  28528. /**
  28529. * Unique root name used to identify this root element by {@link module:engine/model/document~Document}.
  28530. *
  28531. * @readonly
  28532. * @member {String}
  28533. */
  28534. this.rootName = rootName;
  28535. }
  28536. /**
  28537. * {@link module:engine/model/document~Document Document} that owns this root element.
  28538. *
  28539. * @readonly
  28540. * @type {module:engine/model/document~Document|null}
  28541. */
  28542. get document() {
  28543. return this._document;
  28544. }
  28545. /**
  28546. * Checks whether this object is of the given.
  28547. *
  28548. * rootElement.is( 'rootElement' ); // -> true
  28549. * rootElement.is( 'element' ); // -> true
  28550. * rootElement.is( 'node' ); // -> true
  28551. * rootElement.is( 'model:rootElement' ); // -> true
  28552. * rootElement.is( 'model:element' ); // -> true
  28553. * rootElement.is( 'model:node' ); // -> true
  28554. *
  28555. * rootElement.is( 'view:element' ); // -> false
  28556. * rootElement.is( 'documentFragment' ); // -> false
  28557. *
  28558. * Assuming that the object being checked is an element, you can also check its
  28559. * {@link module:engine/model/element~Element#name name}:
  28560. *
  28561. * rootElement.is( 'rootElement', '$root' ); // -> same as above
  28562. *
  28563. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  28564. *
  28565. * @param {String} type Type to check.
  28566. * @param {String} [name] Element name.
  28567. * @returns {Boolean}
  28568. */
  28569. is( type, name ) {
  28570. if ( !name ) {
  28571. return type === 'rootElement' || type === 'model:rootElement' ||
  28572. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  28573. type === 'element' || type === 'model:element' ||
  28574. type === 'node' || type === 'model:node';
  28575. }
  28576. return name === this.name && (
  28577. type === 'rootElement' || type === 'model:rootElement' ||
  28578. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  28579. type === 'element' || type === 'model:element'
  28580. );
  28581. }
  28582. /**
  28583. * Converts `RootElement` instance to `String` containing it's name.
  28584. *
  28585. * @returns {String} `RootElement` instance converted to `String`.
  28586. */
  28587. toJSON() {
  28588. return this.rootName;
  28589. }
  28590. // @if CK_DEBUG_ENGINE // toString() {
  28591. // @if CK_DEBUG_ENGINE // return this.rootName;
  28592. // @if CK_DEBUG_ENGINE // }
  28593. // @if CK_DEBUG_ENGINE // log() {
  28594. // @if CK_DEBUG_ENGINE // console.log( 'ModelRootElement: ' + this );
  28595. // @if CK_DEBUG_ENGINE // }
  28596. }
  28597. /***/ }),
  28598. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js":
  28599. /*!*********************************************************************!*\
  28600. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js ***!
  28601. \*********************************************************************/
  28602. /*! exports provided: default, SchemaContext */
  28603. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  28604. "use strict";
  28605. __webpack_require__.r(__webpack_exports__);
  28606. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Schema; });
  28607. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SchemaContext", function() { return SchemaContext; });
  28608. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  28609. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  28610. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  28611. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  28612. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  28613. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  28614. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  28615. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
  28616. /**
  28617. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  28618. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  28619. */
  28620. /**
  28621. * @module engine/model/schema
  28622. */
  28623. /**
  28624. * The model's schema. It defines the allowed and disallowed structures of nodes as well as nodes' attributes.
  28625. * The schema is usually defined by the features and based on them, the editing framework and features
  28626. * make decisions on how to change and process the model.
  28627. *
  28628. * The instance of schema is available in {@link module:engine/model/model~Model#schema `editor.model.schema`}.
  28629. *
  28630. * Read more about the schema in:
  28631. *
  28632. * * The {@glink framework/guides/architecture/editing-engine#schema schema section} of the
  28633. * {@glink framework/guides/architecture/editing-engine Introduction to the Editing engine architecture} guide.
  28634. * * The {@glink framework/guides/deep-dive/schema Schema deep dive} guide.
  28635. *
  28636. * @mixes module:utils/observablemixin~ObservableMixin
  28637. */
  28638. class Schema {
  28639. /**
  28640. * Creates a schema instance.
  28641. */
  28642. constructor() {
  28643. this._sourceDefinitions = {};
  28644. /**
  28645. * A dictionary containing attribute properties.
  28646. *
  28647. * @private
  28648. * @member {Object.<String,String>}
  28649. */
  28650. this._attributeProperties = {};
  28651. this.decorate( 'checkChild' );
  28652. this.decorate( 'checkAttribute' );
  28653. this.on( 'checkAttribute', ( evt, args ) => {
  28654. args[ 0 ] = new SchemaContext( args[ 0 ] );
  28655. }, { priority: 'highest' } );
  28656. this.on( 'checkChild', ( evt, args ) => {
  28657. args[ 0 ] = new SchemaContext( args[ 0 ] );
  28658. args[ 1 ] = this.getDefinition( args[ 1 ] );
  28659. }, { priority: 'highest' } );
  28660. }
  28661. /**
  28662. * Registers a schema item. Can only be called once for every item name.
  28663. *
  28664. * schema.register( 'paragraph', {
  28665. * inheritAllFrom: '$block'
  28666. * } );
  28667. *
  28668. * @param {String} itemName
  28669. * @param {module:engine/model/schema~SchemaItemDefinition} definition
  28670. */
  28671. register( itemName, definition ) {
  28672. if ( this._sourceDefinitions[ itemName ] ) {
  28673. /**
  28674. * A single item cannot be registered twice in the schema.
  28675. *
  28676. * This situation may happen when:
  28677. *
  28678. * * Two or more plugins called {@link #register `register()`} with the same name. This will usually mean that
  28679. * there is a collision between plugins which try to use the same element in the model. Unfortunately,
  28680. * the only way to solve this is by modifying one of these plugins to use a unique model element name.
  28681. * * A single plugin was loaded twice. This happens when it is installed by npm/yarn in two versions
  28682. * and usually means one or more of the following issues:
  28683. * * a version mismatch (two of your dependencies require two different versions of this plugin),
  28684. * * incorrect imports (this plugin is somehow imported twice in a way which confuses webpack),
  28685. * * mess in `node_modules/` (`rm -rf node_modules/` may help).
  28686. *
  28687. * **Note:** Check the logged `itemName` to better understand which plugin was duplicated/conflicting.
  28688. *
  28689. * @param itemName The name of the model element that is being registered twice.
  28690. * @error schema-cannot-register-item-twice
  28691. */
  28692. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  28693. 'schema-cannot-register-item-twice',
  28694. this,
  28695. {
  28696. itemName
  28697. }
  28698. );
  28699. }
  28700. this._sourceDefinitions[ itemName ] = [
  28701. Object.assign( {}, definition )
  28702. ];
  28703. this._clearCache();
  28704. }
  28705. /**
  28706. * Extends a {@link #register registered} item's definition.
  28707. *
  28708. * Extending properties such as `allowIn` will add more items to the existing properties,
  28709. * while redefining properties such as `isBlock` will override the previously defined ones.
  28710. *
  28711. * schema.register( 'foo', {
  28712. * allowIn: '$root',
  28713. * isBlock: true;
  28714. * } );
  28715. * schema.extend( 'foo', {
  28716. * allowIn: 'blockQuote',
  28717. * isBlock: false
  28718. * } );
  28719. *
  28720. * schema.getDefinition( 'foo' );
  28721. * // {
  28722. * // allowIn: [ '$root', 'blockQuote' ],
  28723. * // isBlock: false
  28724. * // }
  28725. *
  28726. * @param {String} itemName
  28727. * @param {module:engine/model/schema~SchemaItemDefinition} definition
  28728. */
  28729. extend( itemName, definition ) {
  28730. if ( !this._sourceDefinitions[ itemName ] ) {
  28731. /**
  28732. * Cannot extend an item which was not registered yet.
  28733. *
  28734. * This error happens when a plugin tries to extend the schema definition of an item which was not
  28735. * {@link #register registered} yet.
  28736. *
  28737. * @param itemName The name of the model element which is being extended.
  28738. * @error schema-cannot-extend-missing-item
  28739. */
  28740. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'schema-cannot-extend-missing-item', this, {
  28741. itemName
  28742. } );
  28743. }
  28744. this._sourceDefinitions[ itemName ].push( Object.assign( {}, definition ) );
  28745. this._clearCache();
  28746. }
  28747. /**
  28748. * Returns data of all registered items.
  28749. *
  28750. * This method should normally be used for reflection purposes (e.g. defining a clone of a certain element,
  28751. * checking a list of all block elements, etc).
  28752. * Use specific methods (such as {@link #checkChild `checkChild()`} or {@link #isLimit `isLimit()`})
  28753. * in other cases.
  28754. *
  28755. * @returns {Object.<String,module:engine/model/schema~SchemaCompiledItemDefinition>}
  28756. */
  28757. getDefinitions() {
  28758. if ( !this._compiledDefinitions ) {
  28759. this._compile();
  28760. }
  28761. return this._compiledDefinitions;
  28762. }
  28763. /**
  28764. * Returns a definition of the given item or `undefined` if an item is not registered.
  28765. *
  28766. * This method should normally be used for reflection purposes (e.g. defining a clone of a certain element,
  28767. * checking a list of all block elements, etc).
  28768. * Use specific methods (such as {@link #checkChild `checkChild()`} or {@link #isLimit `isLimit()`})
  28769. * in other cases.
  28770. *
  28771. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  28772. * @returns {module:engine/model/schema~SchemaCompiledItemDefinition}
  28773. */
  28774. getDefinition( item ) {
  28775. let itemName;
  28776. if ( typeof item == 'string' ) {
  28777. itemName = item;
  28778. } else if ( item.is && ( item.is( '$text' ) || item.is( '$textProxy' ) ) ) {
  28779. itemName = '$text';
  28780. }
  28781. // Element or module:engine/model/schema~SchemaContextItem.
  28782. else {
  28783. itemName = item.name;
  28784. }
  28785. return this.getDefinitions()[ itemName ];
  28786. }
  28787. /**
  28788. * Returns `true` if the given item is registered in the schema.
  28789. *
  28790. * schema.isRegistered( 'paragraph' ); // -> true
  28791. * schema.isRegistered( editor.model.document.getRoot() ); // -> true
  28792. * schema.isRegistered( 'foo' ); // -> false
  28793. *
  28794. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  28795. * @returns {Boolean}
  28796. */
  28797. isRegistered( item ) {
  28798. return !!this.getDefinition( item );
  28799. }
  28800. /**
  28801. * Returns `true` if the given item is defined to be
  28802. * a block by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isBlock` property.
  28803. *
  28804. * schema.isBlock( 'paragraph' ); // -> true
  28805. * schema.isBlock( '$root' ); // -> false
  28806. *
  28807. * const paragraphElement = writer.createElement( 'paragraph' );
  28808. * schema.isBlock( paragraphElement ); // -> true
  28809. *
  28810. * See the {@glink framework/guides/deep-dive/schema#block-elements Block elements} section of
  28811. * the {@glink framework/guides/deep-dive/schema Schema deep dive} guide for more details.
  28812. *
  28813. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  28814. * @returns {Boolean}
  28815. */
  28816. isBlock( item ) {
  28817. const def = this.getDefinition( item );
  28818. return !!( def && def.isBlock );
  28819. }
  28820. /**
  28821. * Returns `true` if the given item should be treated as a limit element.
  28822. *
  28823. * It considers an item to be a limit element if its
  28824. * {@link module:engine/model/schema~SchemaItemDefinition}'s
  28825. * {@link module:engine/model/schema~SchemaItemDefinition#isLimit `isLimit`} or
  28826. * {@link module:engine/model/schema~SchemaItemDefinition#isObject `isObject`} property
  28827. * was set to `true`.
  28828. *
  28829. * schema.isLimit( 'paragraph' ); // -> false
  28830. * schema.isLimit( '$root' ); // -> true
  28831. * schema.isLimit( editor.model.document.getRoot() ); // -> true
  28832. * schema.isLimit( 'imageBlock' ); // -> true
  28833. *
  28834. * See the {@glink framework/guides/deep-dive/schema#limit-elements Limit elements} section of
  28835. * the {@glink framework/guides/deep-dive/schema Schema deep dive} guide for more details.
  28836. *
  28837. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  28838. * @returns {Boolean}
  28839. */
  28840. isLimit( item ) {
  28841. const def = this.getDefinition( item );
  28842. if ( !def ) {
  28843. return false;
  28844. }
  28845. return !!( def.isLimit || def.isObject );
  28846. }
  28847. /**
  28848. * Returns `true` if the given item should be treated as an object element.
  28849. *
  28850. * It considers an item to be an object element if its
  28851. * {@link module:engine/model/schema~SchemaItemDefinition}'s
  28852. * {@link module:engine/model/schema~SchemaItemDefinition#isObject `isObject`} property
  28853. * was set to `true`.
  28854. *
  28855. * schema.isObject( 'paragraph' ); // -> false
  28856. * schema.isObject( 'imageBlock' ); // -> true
  28857. *
  28858. * const imageElement = writer.createElement( 'imageBlock' );
  28859. * schema.isObject( imageElement ); // -> true
  28860. *
  28861. * See the {@glink framework/guides/deep-dive/schema#object-elements Object elements} section of
  28862. * the {@glink framework/guides/deep-dive/schema Schema deep dive} guide for more details.
  28863. *
  28864. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  28865. * @returns {Boolean}
  28866. */
  28867. isObject( item ) {
  28868. const def = this.getDefinition( item );
  28869. if ( !def ) {
  28870. return false;
  28871. }
  28872. // Note: Check out the implementation of #isLimit(), #isSelectable(), and #isContent()
  28873. // to understand why these three constitute an object.
  28874. return !!( def.isObject || ( def.isLimit && def.isSelectable && def.isContent ) );
  28875. }
  28876. /**
  28877. * Returns `true` if the given item is defined to be
  28878. * an inline element by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isInline` property.
  28879. *
  28880. * schema.isInline( 'paragraph' ); // -> false
  28881. * schema.isInline( 'softBreak' ); // -> true
  28882. *
  28883. * const text = writer.createText( 'foo' );
  28884. * schema.isInline( text ); // -> true
  28885. *
  28886. * See the {@glink framework/guides/deep-dive/schema#inline-elements Inline elements} section of
  28887. * the {@glink framework/guides/deep-dive/schema Schema deep dive} guide for more details.
  28888. *
  28889. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  28890. * @returns {Boolean}
  28891. */
  28892. isInline( item ) {
  28893. const def = this.getDefinition( item );
  28894. return !!( def && def.isInline );
  28895. }
  28896. /**
  28897. * Returns `true` if the given item is defined to be
  28898. * a selectable element by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isSelectable` property.
  28899. *
  28900. * schema.isSelectable( 'paragraph' ); // -> false
  28901. * schema.isSelectable( 'heading1' ); // -> false
  28902. * schema.isSelectable( 'imageBlock' ); // -> true
  28903. * schema.isSelectable( 'tableCell' ); // -> true
  28904. *
  28905. * const text = writer.createText( 'foo' );
  28906. * schema.isSelectable( text ); // -> false
  28907. *
  28908. * See the {@glink framework/guides/deep-dive/schema#selectable-elements Selectable elements section} of
  28909. * the {@glink framework/guides/deep-dive/schema Schema deep dive} guide for more details.
  28910. *
  28911. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  28912. * @returns {Boolean}
  28913. */
  28914. isSelectable( item ) {
  28915. const def = this.getDefinition( item );
  28916. if ( !def ) {
  28917. return false;
  28918. }
  28919. return !!( def.isSelectable || def.isObject );
  28920. }
  28921. /**
  28922. * Returns `true` if the given item is defined to be
  28923. * a content by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isContent` property.
  28924. *
  28925. * schema.isContent( 'paragraph' ); // -> false
  28926. * schema.isContent( 'heading1' ); // -> false
  28927. * schema.isContent( 'imageBlock' ); // -> true
  28928. * schema.isContent( 'horizontalLine' ); // -> true
  28929. *
  28930. * const text = writer.createText( 'foo' );
  28931. * schema.isContent( text ); // -> true
  28932. *
  28933. * See the {@glink framework/guides/deep-dive/schema#content-elements Content elements section} of
  28934. * the {@glink framework/guides/deep-dive/schema Schema deep dive} guide for more details.
  28935. *
  28936. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  28937. * @returns {Boolean}
  28938. */
  28939. isContent( item ) {
  28940. const def = this.getDefinition( item );
  28941. if ( !def ) {
  28942. return false;
  28943. }
  28944. return !!( def.isContent || def.isObject );
  28945. }
  28946. /**
  28947. * Checks whether the given node (`child`) can be a child of the given context.
  28948. *
  28949. * schema.checkChild( model.document.getRoot(), paragraph ); // -> false
  28950. *
  28951. * schema.register( 'paragraph', {
  28952. * allowIn: '$root'
  28953. * } );
  28954. * schema.checkChild( model.document.getRoot(), paragraph ); // -> true
  28955. *
  28956. * Note: When verifying whether the given node can be a child of the given context, the
  28957. * schema also verifies the entire context &mdash; from its root to its last element. Therefore, it is possible
  28958. * for `checkChild()` to return `false` even though the context's last element can contain the checked child.
  28959. * It happens if one of the context's elements does not allow its child.
  28960. *
  28961. * @fires checkChild
  28962. * @param {module:engine/model/schema~SchemaContextDefinition} context The context in which the child will be checked.
  28963. * @param {module:engine/model/node~Node|String} def The child to check.
  28964. * @returns {Boolean}
  28965. */
  28966. checkChild( context, def ) {
  28967. // Note: context and child are already normalized here to a SchemaContext and SchemaCompiledItemDefinition.
  28968. if ( !def ) {
  28969. return false;
  28970. }
  28971. return this._checkContextMatch( def, context );
  28972. }
  28973. /**
  28974. * Checks whether the given attribute can be applied in the given context (on the last
  28975. * item of the context).
  28976. *
  28977. * schema.checkAttribute( textNode, 'bold' ); // -> false
  28978. *
  28979. * schema.extend( '$text', {
  28980. * allowAttributes: 'bold'
  28981. * } );
  28982. * schema.checkAttribute( textNode, 'bold' ); // -> true
  28983. *
  28984. * @fires checkAttribute
  28985. * @param {module:engine/model/schema~SchemaContextDefinition} context The context in which the attribute will be checked.
  28986. * @param {String} attributeName
  28987. * @returns {Boolean}
  28988. */
  28989. checkAttribute( context, attributeName ) {
  28990. const def = this.getDefinition( context.last );
  28991. if ( !def ) {
  28992. return false;
  28993. }
  28994. return def.allowAttributes.includes( attributeName );
  28995. }
  28996. /**
  28997. * Checks whether the given element (`elementToMerge`) can be merged with the specified base element (`positionOrBaseElement`).
  28998. *
  28999. * In other words &mdash; whether `elementToMerge`'s children {@link #checkChild are allowed} in the `positionOrBaseElement`.
  29000. *
  29001. * This check ensures that elements merged with {@link module:engine/model/writer~Writer#merge `Writer#merge()`}
  29002. * will be valid.
  29003. *
  29004. * Instead of elements, you can pass the instance of the {@link module:engine/model/position~Position} class as the
  29005. * `positionOrBaseElement`. It means that the elements before and after the position will be checked whether they can be merged.
  29006. *
  29007. * @param {module:engine/model/position~Position|module:engine/model/element~Element} positionOrBaseElement The position or base
  29008. * element to which the `elementToMerge` will be merged.
  29009. * @param {module:engine/model/element~Element} elementToMerge The element to merge. Required if `positionOrBaseElement` is an element.
  29010. * @returns {Boolean}
  29011. */
  29012. checkMerge( positionOrBaseElement, elementToMerge = null ) {
  29013. if ( positionOrBaseElement instanceof _position__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  29014. const nodeBefore = positionOrBaseElement.nodeBefore;
  29015. const nodeAfter = positionOrBaseElement.nodeAfter;
  29016. if ( !( nodeBefore instanceof _element__WEBPACK_IMPORTED_MODULE_5__["default"] ) ) {
  29017. /**
  29018. * The node before the merge position must be an element.
  29019. *
  29020. * @error schema-check-merge-no-element-before
  29021. */
  29022. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  29023. 'schema-check-merge-no-element-before',
  29024. this
  29025. );
  29026. }
  29027. if ( !( nodeAfter instanceof _element__WEBPACK_IMPORTED_MODULE_5__["default"] ) ) {
  29028. /**
  29029. * The node after the merge position must be an element.
  29030. *
  29031. * @error schema-check-merge-no-element-after
  29032. */
  29033. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  29034. 'schema-check-merge-no-element-after',
  29035. this
  29036. );
  29037. }
  29038. return this.checkMerge( nodeBefore, nodeAfter );
  29039. }
  29040. for ( const child of elementToMerge.getChildren() ) {
  29041. if ( !this.checkChild( positionOrBaseElement, child ) ) {
  29042. return false;
  29043. }
  29044. }
  29045. return true;
  29046. }
  29047. /**
  29048. * Allows registering a callback to the {@link #checkChild} method calls.
  29049. *
  29050. * Callbacks allow you to implement rules which are not otherwise possible to achieve
  29051. * by using the declarative API of {@link module:engine/model/schema~SchemaItemDefinition}.
  29052. * For example, by using this method you can disallow elements in specific contexts.
  29053. *
  29054. * This method is a shorthand for using the {@link #event:checkChild} event. For even better control,
  29055. * you can use that event instead.
  29056. *
  29057. * Example:
  29058. *
  29059. * // Disallow heading1 directly inside a blockQuote.
  29060. * schema.addChildCheck( ( context, childDefinition ) => {
  29061. * if ( context.endsWith( 'blockQuote' ) && childDefinition.name == 'heading1' ) {
  29062. * return false;
  29063. * }
  29064. * } );
  29065. *
  29066. * Which translates to:
  29067. *
  29068. * schema.on( 'checkChild', ( evt, args ) => {
  29069. * const context = args[ 0 ];
  29070. * const childDefinition = args[ 1 ];
  29071. *
  29072. * if ( context.endsWith( 'blockQuote' ) && childDefinition && childDefinition.name == 'heading1' ) {
  29073. * // Prevent next listeners from being called.
  29074. * evt.stop();
  29075. * // Set the checkChild()'s return value.
  29076. * evt.return = false;
  29077. * }
  29078. * }, { priority: 'high' } );
  29079. *
  29080. * @param {Function} callback The callback to be called. It is called with two parameters:
  29081. * {@link module:engine/model/schema~SchemaContext} (context) instance and
  29082. * {@link module:engine/model/schema~SchemaCompiledItemDefinition} (child-to-check definition).
  29083. * The callback may return `true/false` to override `checkChild()`'s return value. If it does not return
  29084. * a boolean value, the default algorithm (or other callbacks) will define `checkChild()`'s return value.
  29085. */
  29086. addChildCheck( callback ) {
  29087. this.on( 'checkChild', ( evt, [ ctx, childDef ] ) => {
  29088. // checkChild() was called with a non-registered child.
  29089. // In 99% cases such check should return false, so not to overcomplicate all callbacks
  29090. // don't even execute them.
  29091. if ( !childDef ) {
  29092. return;
  29093. }
  29094. const retValue = callback( ctx, childDef );
  29095. if ( typeof retValue == 'boolean' ) {
  29096. evt.stop();
  29097. evt.return = retValue;
  29098. }
  29099. }, { priority: 'high' } );
  29100. }
  29101. /**
  29102. * Allows registering a callback to the {@link #checkAttribute} method calls.
  29103. *
  29104. * Callbacks allow you to implement rules which are not otherwise possible to achieve
  29105. * by using the declarative API of {@link module:engine/model/schema~SchemaItemDefinition}.
  29106. * For example, by using this method you can disallow attribute if node to which it is applied
  29107. * is contained within some other element (e.g. you want to disallow `bold` on `$text` within `heading1`).
  29108. *
  29109. * This method is a shorthand for using the {@link #event:checkAttribute} event. For even better control,
  29110. * you can use that event instead.
  29111. *
  29112. * Example:
  29113. *
  29114. * // Disallow bold on $text inside heading1.
  29115. * schema.addAttributeCheck( ( context, attributeName ) => {
  29116. * if ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) {
  29117. * return false;
  29118. * }
  29119. * } );
  29120. *
  29121. * Which translates to:
  29122. *
  29123. * schema.on( 'checkAttribute', ( evt, args ) => {
  29124. * const context = args[ 0 ];
  29125. * const attributeName = args[ 1 ];
  29126. *
  29127. * if ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) {
  29128. * // Prevent next listeners from being called.
  29129. * evt.stop();
  29130. * // Set the checkAttribute()'s return value.
  29131. * evt.return = false;
  29132. * }
  29133. * }, { priority: 'high' } );
  29134. *
  29135. * @param {Function} callback The callback to be called. It is called with two parameters:
  29136. * {@link module:engine/model/schema~SchemaContext} (context) instance and attribute name.
  29137. * The callback may return `true/false` to override `checkAttribute()`'s return value. If it does not return
  29138. * a boolean value, the default algorithm (or other callbacks) will define `checkAttribute()`'s return value.
  29139. */
  29140. addAttributeCheck( callback ) {
  29141. this.on( 'checkAttribute', ( evt, [ ctx, attributeName ] ) => {
  29142. const retValue = callback( ctx, attributeName );
  29143. if ( typeof retValue == 'boolean' ) {
  29144. evt.stop();
  29145. evt.return = retValue;
  29146. }
  29147. }, { priority: 'high' } );
  29148. }
  29149. /**
  29150. * This method allows assigning additional metadata to the model attributes. For example,
  29151. * {@link module:engine/model/schema~AttributeProperties `AttributeProperties#isFormatting` property} is
  29152. * used to mark formatting attributes (like `bold` or `italic`).
  29153. *
  29154. * // Mark bold as a formatting attribute.
  29155. * schema.setAttributeProperties( 'bold', {
  29156. * isFormatting: true
  29157. * } );
  29158. *
  29159. * // Override code not to be considered a formatting markup.
  29160. * schema.setAttributeProperties( 'code', {
  29161. * isFormatting: false
  29162. * } );
  29163. *
  29164. * Properties are not limited to members defined in the
  29165. * {@link module:engine/model/schema~AttributeProperties `AttributeProperties` type} and you can also use custom properties:
  29166. *
  29167. * schema.setAttributeProperties( 'blockQuote', {
  29168. * customProperty: 'value'
  29169. * } );
  29170. *
  29171. * Subsequent calls with the same attribute will extend its custom properties:
  29172. *
  29173. * schema.setAttributeProperties( 'blockQuote', {
  29174. * one: 1
  29175. * } );
  29176. *
  29177. * schema.setAttributeProperties( 'blockQuote', {
  29178. * two: 2
  29179. * } );
  29180. *
  29181. * console.log( schema.getAttributeProperties( 'blockQuote' ) );
  29182. * // Logs: { one: 1, two: 2 }
  29183. *
  29184. * @param {String} attributeName A name of the attribute to receive the properties.
  29185. * @param {module:engine/model/schema~AttributeProperties} properties A dictionary of properties.
  29186. */
  29187. setAttributeProperties( attributeName, properties ) {
  29188. this._attributeProperties[ attributeName ] = Object.assign( this.getAttributeProperties( attributeName ), properties );
  29189. }
  29190. /**
  29191. * Returns properties associated with a given model attribute. See {@link #setAttributeProperties `setAttributeProperties()`}.
  29192. *
  29193. * @param {String} attributeName A name of the attribute.
  29194. * @returns {module:engine/model/schema~AttributeProperties}
  29195. */
  29196. getAttributeProperties( attributeName ) {
  29197. return this._attributeProperties[ attributeName ] || {};
  29198. }
  29199. /**
  29200. * Returns the lowest {@link module:engine/model/schema~Schema#isLimit limit element} containing the entire
  29201. * selection/range/position or the root otherwise.
  29202. *
  29203. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection|
  29204. * module:engine/model/range~Range|module:engine/model/position~Position} selectionOrRangeOrPosition
  29205. * The selection/range/position to check.
  29206. * @returns {module:engine/model/element~Element} The lowest limit element containing
  29207. * the entire `selectionOrRangeOrPosition`.
  29208. */
  29209. getLimitElement( selectionOrRangeOrPosition ) {
  29210. let element;
  29211. if ( selectionOrRangeOrPosition instanceof _position__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  29212. element = selectionOrRangeOrPosition.parent;
  29213. } else {
  29214. const ranges = selectionOrRangeOrPosition instanceof _range__WEBPACK_IMPORTED_MODULE_3__["default"] ?
  29215. [ selectionOrRangeOrPosition ] :
  29216. Array.from( selectionOrRangeOrPosition.getRanges() );
  29217. // Find the common ancestor for all selection's ranges.
  29218. element = ranges
  29219. .reduce( ( element, range ) => {
  29220. const rangeCommonAncestor = range.getCommonAncestor();
  29221. if ( !element ) {
  29222. return rangeCommonAncestor;
  29223. }
  29224. return element.getCommonAncestor( rangeCommonAncestor, { includeSelf: true } );
  29225. }, null );
  29226. }
  29227. while ( !this.isLimit( element ) ) {
  29228. if ( element.parent ) {
  29229. element = element.parent;
  29230. } else {
  29231. break;
  29232. }
  29233. }
  29234. return element;
  29235. }
  29236. /**
  29237. * Checks whether the attribute is allowed in selection:
  29238. *
  29239. * * if the selection is not collapsed, then checks if the attribute is allowed on any of nodes in that range,
  29240. * * if the selection is collapsed, then checks if on the selection position there's a text with the
  29241. * specified attribute allowed.
  29242. *
  29243. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  29244. * Selection which will be checked.
  29245. * @param {String} attribute The name of the attribute to check.
  29246. * @returns {Boolean}
  29247. */
  29248. checkAttributeInSelection( selection, attribute ) {
  29249. if ( selection.isCollapsed ) {
  29250. const firstPosition = selection.getFirstPosition();
  29251. const context = [
  29252. ...firstPosition.getAncestors(),
  29253. new _text__WEBPACK_IMPORTED_MODULE_6__["default"]( '', selection.getAttributes() )
  29254. ];
  29255. // Check whether schema allows for a text with the attribute in the selection.
  29256. return this.checkAttribute( context, attribute );
  29257. } else {
  29258. const ranges = selection.getRanges();
  29259. // For all ranges, check nodes in them until you find a node that is allowed to have the attribute.
  29260. for ( const range of ranges ) {
  29261. for ( const value of range ) {
  29262. if ( this.checkAttribute( value.item, attribute ) ) {
  29263. // If we found a node that is allowed to have the attribute, return true.
  29264. return true;
  29265. }
  29266. }
  29267. }
  29268. }
  29269. // If we haven't found such node, return false.
  29270. return false;
  29271. }
  29272. /**
  29273. * Transforms the given set of ranges into a set of ranges where the given attribute is allowed (and can be applied).
  29274. *
  29275. * @param {Array.<module:engine/model/range~Range>} ranges Ranges to be validated.
  29276. * @param {String} attribute The name of the attribute to check.
  29277. * @returns {Iterable.<module:engine/model/range~Range>} Ranges in which the attribute is allowed.
  29278. */
  29279. * getValidRanges( ranges, attribute ) {
  29280. ranges = convertToMinimalFlatRanges( ranges );
  29281. for ( const range of ranges ) {
  29282. yield* this._getValidRangesForRange( range, attribute );
  29283. }
  29284. }
  29285. /**
  29286. * Basing on given `position`, finds and returns a {@link module:engine/model/range~Range range} which is
  29287. * nearest to that `position` and is a correct range for selection.
  29288. *
  29289. * The correct selection range might be collapsed when it is located in a position where the text node can be placed.
  29290. * Non-collapsed range is returned when selection can be placed around element marked as an "object" in
  29291. * the {@link module:engine/model/schema~Schema schema}.
  29292. *
  29293. * Direction of searching for the nearest correct selection range can be specified as:
  29294. *
  29295. * * `both` - searching will be performed in both ways,
  29296. * * `forward` - searching will be performed only forward,
  29297. * * `backward` - searching will be performed only backward.
  29298. *
  29299. * When valid selection range cannot be found, `null` is returned.
  29300. *
  29301. * @param {module:engine/model/position~Position} position Reference position where new selection range should be looked for.
  29302. * @param {'both'|'forward'|'backward'} [direction='both'] Search direction.
  29303. * @returns {module:engine/model/range~Range|null} Nearest selection range or `null` if one cannot be found.
  29304. */
  29305. getNearestSelectionRange( position, direction = 'both' ) {
  29306. // Return collapsed range if provided position is valid.
  29307. if ( this.checkChild( position, '$text' ) ) {
  29308. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( position );
  29309. }
  29310. let backwardWalker, forwardWalker;
  29311. // Never leave a limit element.
  29312. const limitElement = position.getAncestors().reverse().find( item => this.isLimit( item ) ) || position.root;
  29313. if ( direction == 'both' || direction == 'backward' ) {
  29314. backwardWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_7__["default"]( {
  29315. boundaries: _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( limitElement ),
  29316. startPosition: position,
  29317. direction: 'backward'
  29318. } );
  29319. }
  29320. if ( direction == 'both' || direction == 'forward' ) {
  29321. forwardWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_7__["default"]( {
  29322. boundaries: _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( limitElement ),
  29323. startPosition: position
  29324. } );
  29325. }
  29326. for ( const data of combineWalkers( backwardWalker, forwardWalker ) ) {
  29327. const type = ( data.walker == backwardWalker ? 'elementEnd' : 'elementStart' );
  29328. const value = data.value;
  29329. if ( value.type == type && this.isObject( value.item ) ) {
  29330. return _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createOn( value.item );
  29331. }
  29332. if ( this.checkChild( value.nextPosition, '$text' ) ) {
  29333. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( value.nextPosition );
  29334. }
  29335. }
  29336. return null;
  29337. }
  29338. /**
  29339. * Tries to find position ancestors that allow to insert a given node.
  29340. * It starts searching from the given position and goes node by node to the top of the model tree
  29341. * as long as a {@link module:engine/model/schema~Schema#isLimit limit element}, an
  29342. * {@link module:engine/model/schema~Schema#isObject object element} or a topmost ancestor is not reached.
  29343. *
  29344. * @param {module:engine/model/position~Position} position The position that the search will start from.
  29345. * @param {module:engine/model/node~Node|String} node The node for which an allowed parent should be found or its name.
  29346. * @returns {module:engine/model/element~Element|null} element Allowed parent or null if nothing was found.
  29347. */
  29348. findAllowedParent( position, node ) {
  29349. let parent = position.parent;
  29350. while ( parent ) {
  29351. if ( this.checkChild( parent, node ) ) {
  29352. return parent;
  29353. }
  29354. // Do not split limit elements.
  29355. if ( this.isLimit( parent ) ) {
  29356. return null;
  29357. }
  29358. parent = parent.parent;
  29359. }
  29360. return null;
  29361. }
  29362. /**
  29363. * Removes attributes disallowed by the schema.
  29364. *
  29365. * @param {Iterable.<module:engine/model/node~Node>} nodes Nodes that will be filtered.
  29366. * @param {module:engine/model/writer~Writer} writer
  29367. */
  29368. removeDisallowedAttributes( nodes, writer ) {
  29369. for ( const node of nodes ) {
  29370. // When node is a `Text` it has no children, so just filter it out.
  29371. if ( node.is( '$text' ) ) {
  29372. removeDisallowedAttributeFromNode( this, node, writer );
  29373. }
  29374. // In a case of `Element` iterates through positions between nodes inside this element
  29375. // and filter out node before the current position, or position parent when position
  29376. // is at start of an element. Using positions prevent from omitting merged nodes
  29377. // see https://github.com/ckeditor/ckeditor5-engine/issues/1789.
  29378. else {
  29379. const rangeInNode = _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( node );
  29380. const positionsInRange = rangeInNode.getPositions();
  29381. for ( const position of positionsInRange ) {
  29382. const item = position.nodeBefore || position.parent;
  29383. removeDisallowedAttributeFromNode( this, item, writer );
  29384. }
  29385. }
  29386. }
  29387. }
  29388. /**
  29389. * Creates an instance of the schema context.
  29390. *
  29391. * @param {module:engine/model/schema~SchemaContextDefinition} context
  29392. * @returns {module:engine/model/schema~SchemaContext}
  29393. */
  29394. createContext( context ) {
  29395. return new SchemaContext( context );
  29396. }
  29397. /**
  29398. * @private
  29399. */
  29400. _clearCache() {
  29401. this._compiledDefinitions = null;
  29402. }
  29403. /**
  29404. * @private
  29405. */
  29406. _compile() {
  29407. const compiledDefinitions = {};
  29408. const sourceRules = this._sourceDefinitions;
  29409. const itemNames = Object.keys( sourceRules );
  29410. for ( const itemName of itemNames ) {
  29411. compiledDefinitions[ itemName ] = compileBaseItemRule( sourceRules[ itemName ], itemName );
  29412. }
  29413. for ( const itemName of itemNames ) {
  29414. compileAllowChildren( compiledDefinitions, itemName );
  29415. }
  29416. for ( const itemName of itemNames ) {
  29417. compileAllowContentOf( compiledDefinitions, itemName );
  29418. }
  29419. for ( const itemName of itemNames ) {
  29420. compileAllowWhere( compiledDefinitions, itemName );
  29421. }
  29422. for ( const itemName of itemNames ) {
  29423. compileAllowAttributesOf( compiledDefinitions, itemName );
  29424. compileInheritPropertiesFrom( compiledDefinitions, itemName );
  29425. }
  29426. for ( const itemName of itemNames ) {
  29427. cleanUpAllowIn( compiledDefinitions, itemName );
  29428. setupAllowChildren( compiledDefinitions, itemName );
  29429. cleanUpAllowAttributes( compiledDefinitions, itemName );
  29430. }
  29431. this._compiledDefinitions = compiledDefinitions;
  29432. }
  29433. /**
  29434. * @private
  29435. * @param {module:engine/model/schema~SchemaCompiledItemDefinition} def
  29436. * @param {module:engine/model/schema~SchemaContext} context
  29437. * @param {Number} contextItemIndex
  29438. */
  29439. _checkContextMatch( def, context, contextItemIndex = context.length - 1 ) {
  29440. const contextItem = context.getItem( contextItemIndex );
  29441. if ( def.allowIn.includes( contextItem.name ) ) {
  29442. if ( contextItemIndex == 0 ) {
  29443. return true;
  29444. } else {
  29445. const parentRule = this.getDefinition( contextItem );
  29446. return this._checkContextMatch( parentRule, context, contextItemIndex - 1 );
  29447. }
  29448. } else {
  29449. return false;
  29450. }
  29451. }
  29452. /**
  29453. * Takes a flat range and an attribute name. Traverses the range recursively and deeply to find and return all ranges
  29454. * inside the given range on which the attribute can be applied.
  29455. *
  29456. * This is a helper function for {@link ~Schema#getValidRanges}.
  29457. *
  29458. * @private
  29459. * @param {module:engine/model/range~Range} range The range to process.
  29460. * @param {String} attribute The name of the attribute to check.
  29461. * @returns {Iterable.<module:engine/model/range~Range>} Ranges in which the attribute is allowed.
  29462. */
  29463. * _getValidRangesForRange( range, attribute ) {
  29464. let start = range.start;
  29465. let end = range.start;
  29466. for ( const item of range.getItems( { shallow: true } ) ) {
  29467. if ( item.is( 'element' ) ) {
  29468. yield* this._getValidRangesForRange( _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( item ), attribute );
  29469. }
  29470. if ( !this.checkAttribute( item, attribute ) ) {
  29471. if ( !start.isEqual( end ) ) {
  29472. yield new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( start, end );
  29473. }
  29474. start = _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAfter( item );
  29475. }
  29476. end = _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAfter( item );
  29477. }
  29478. if ( !start.isEqual( end ) ) {
  29479. yield new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( start, end );
  29480. }
  29481. }
  29482. }
  29483. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( Schema, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  29484. /**
  29485. * Event fired when the {@link #checkChild} method is called. It allows plugging in
  29486. * additional behavior, for example implementing rules which cannot be defined using the declarative
  29487. * {@link module:engine/model/schema~SchemaItemDefinition} interface.
  29488. *
  29489. * **Note:** The {@link #addChildCheck} method is a more handy way to register callbacks. Internally,
  29490. * it registers a listener to this event but comes with a simpler API and it is the recommended choice
  29491. * in most of the cases.
  29492. *
  29493. * The {@link #checkChild} method fires an event because it is
  29494. * {@link module:utils/observablemixin~ObservableMixin#decorate decorated} with it. Thanks to that you can
  29495. * use this event in various ways, but the most important use case is overriding standard behavior of the
  29496. * `checkChild()` method. Let's see a typical listener template:
  29497. *
  29498. * schema.on( 'checkChild', ( evt, args ) => {
  29499. * const context = args[ 0 ];
  29500. * const childDefinition = args[ 1 ];
  29501. * }, { priority: 'high' } );
  29502. *
  29503. * The listener is added with a `high` priority to be executed before the default method is really called. The `args` callback
  29504. * parameter contains arguments passed to `checkChild( context, child )`. However, the `context` parameter is already
  29505. * normalized to a {@link module:engine/model/schema~SchemaContext} instance and `child` to a
  29506. * {@link module:engine/model/schema~SchemaCompiledItemDefinition} instance, so you do not have to worry about
  29507. * the various ways how `context` and `child` may be passed to `checkChild()`.
  29508. *
  29509. * **Note:** `childDefinition` may be `undefined` if `checkChild()` was called with a non-registered element.
  29510. *
  29511. * So, in order to implement a rule "disallow `heading1` in `blockQuote`", you can add such a listener:
  29512. *
  29513. * schema.on( 'checkChild', ( evt, args ) => {
  29514. * const context = args[ 0 ];
  29515. * const childDefinition = args[ 1 ];
  29516. *
  29517. * if ( context.endsWith( 'blockQuote' ) && childDefinition && childDefinition.name == 'heading1' ) {
  29518. * // Prevent next listeners from being called.
  29519. * evt.stop();
  29520. * // Set the checkChild()'s return value.
  29521. * evt.return = false;
  29522. * }
  29523. * }, { priority: 'high' } );
  29524. *
  29525. * Allowing elements in specific contexts will be a far less common use case, because it is normally handled by the
  29526. * `allowIn` rule from {@link module:engine/model/schema~SchemaItemDefinition}. But if you have a complex scenario
  29527. * where `listItem` should be allowed only in element `foo` which must be in element `bar`, then this would be the way:
  29528. *
  29529. * schema.on( 'checkChild', ( evt, args ) => {
  29530. * const context = args[ 0 ];
  29531. * const childDefinition = args[ 1 ];
  29532. *
  29533. * if ( context.endsWith( 'bar foo' ) && childDefinition.name == 'listItem' ) {
  29534. * // Prevent next listeners from being called.
  29535. * evt.stop();
  29536. * // Set the checkChild()'s return value.
  29537. * evt.return = true;
  29538. * }
  29539. * }, { priority: 'high' } );
  29540. *
  29541. * @event checkChild
  29542. * @param {Array} args The `checkChild()`'s arguments.
  29543. */
  29544. /**
  29545. * Event fired when the {@link #checkAttribute} method is called. It allows plugging in
  29546. * additional behavior, for example implementing rules which cannot be defined using the declarative
  29547. * {@link module:engine/model/schema~SchemaItemDefinition} interface.
  29548. *
  29549. * **Note:** The {@link #addAttributeCheck} method is a more handy way to register callbacks. Internally,
  29550. * it registers a listener to this event but comes with a simpler API and it is the recommended choice
  29551. * in most of the cases.
  29552. *
  29553. * The {@link #checkAttribute} method fires an event because it is
  29554. * {@link module:utils/observablemixin~ObservableMixin#decorate decorated} with it. Thanks to that you can
  29555. * use this event in various ways, but the most important use case is overriding the standard behavior of the
  29556. * `checkAttribute()` method. Let's see a typical listener template:
  29557. *
  29558. * schema.on( 'checkAttribute', ( evt, args ) => {
  29559. * const context = args[ 0 ];
  29560. * const attributeName = args[ 1 ];
  29561. * }, { priority: 'high' } );
  29562. *
  29563. * The listener is added with a `high` priority to be executed before the default method is really called. The `args` callback
  29564. * parameter contains arguments passed to `checkAttribute( context, attributeName )`. However, the `context` parameter is already
  29565. * normalized to a {@link module:engine/model/schema~SchemaContext} instance, so you do not have to worry about
  29566. * the various ways how `context` may be passed to `checkAttribute()`.
  29567. *
  29568. * So, in order to implement a rule "disallow `bold` in a text which is in a `heading1`, you can add such a listener:
  29569. *
  29570. * schema.on( 'checkAttribute', ( evt, args ) => {
  29571. * const context = args[ 0 ];
  29572. * const attributeName = args[ 1 ];
  29573. *
  29574. * if ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) {
  29575. * // Prevent next listeners from being called.
  29576. * evt.stop();
  29577. * // Set the checkAttribute()'s return value.
  29578. * evt.return = false;
  29579. * }
  29580. * }, { priority: 'high' } );
  29581. *
  29582. * Allowing attributes in specific contexts will be a far less common use case, because it is normally handled by the
  29583. * `allowAttributes` rule from {@link module:engine/model/schema~SchemaItemDefinition}. But if you have a complex scenario
  29584. * where `bold` should be allowed only in element `foo` which must be in element `bar`, then this would be the way:
  29585. *
  29586. * schema.on( 'checkAttribute', ( evt, args ) => {
  29587. * const context = args[ 0 ];
  29588. * const attributeName = args[ 1 ];
  29589. *
  29590. * if ( context.endsWith( 'bar foo $text' ) && attributeName == 'bold' ) {
  29591. * // Prevent next listeners from being called.
  29592. * evt.stop();
  29593. * // Set the checkAttribute()'s return value.
  29594. * evt.return = true;
  29595. * }
  29596. * }, { priority: 'high' } );
  29597. *
  29598. * @event checkAttribute
  29599. * @param {Array} args The `checkAttribute()`'s arguments.
  29600. */
  29601. /**
  29602. * A definition of a {@link module:engine/model/schema~Schema schema} item.
  29603. *
  29604. * You can define the following rules:
  29605. *
  29606. * * {@link ~SchemaItemDefinition#allowIn `allowIn`} &ndash; Defines in which other items this item will be allowed.
  29607. * * {@link ~SchemaItemDefinition#allowChildren `allowChildren`} &ndash; Defines which other items are allowed inside this item.
  29608. * * {@link ~SchemaItemDefinition#allowAttributes `allowAttributes`} &ndash; Defines allowed attributes of the given item.
  29609. * * {@link ~SchemaItemDefinition#allowContentOf `allowContentOf`} &ndash; Inherits "allowed children" from other items.
  29610. * * {@link ~SchemaItemDefinition#allowWhere `allowWhere`} &ndash; Inherits "allowed in" from other items.
  29611. * * {@link ~SchemaItemDefinition#allowAttributesOf `allowAttributesOf`} &ndash; Inherits attributes from other items.
  29612. * * {@link ~SchemaItemDefinition#inheritTypesFrom `inheritTypesFrom`} &ndash; Inherits `is*` properties of other items.
  29613. * * {@link ~SchemaItemDefinition#inheritAllFrom `inheritAllFrom`} &ndash;
  29614. * A shorthand for `allowContentOf`, `allowWhere`, `allowAttributesOf`, `inheritTypesFrom`.
  29615. *
  29616. * # The `is*` properties
  29617. *
  29618. * There are a couple commonly used `is*` properties. Their role is to assign additional semantics to schema items.
  29619. * You can define more properties but you will also need to implement support for them in the existing editor features.
  29620. *
  29621. * * {@link ~SchemaItemDefinition#isBlock `isBlock`} &ndash; Whether this item is paragraph-like.
  29622. * Generally speaking, content is usually made out of blocks like paragraphs, list items, images, headings, etc.
  29623. * * {@link ~SchemaItemDefinition#isInline `isInline`} &ndash; Whether an item is "text-like" and should be treated as an inline node.
  29624. * Examples of inline elements: `$text`, `softBreak` (`<br>`), etc.
  29625. * * {@link ~SchemaItemDefinition#isLimit `isLimit`} &ndash; It can be understood as whether this element
  29626. * should not be split by <kbd>Enter</kbd>. Examples of limit elements: `$root`, table cell, image caption, etc.
  29627. * In other words, all actions that happen inside a limit element are limited to its content.
  29628. * All objects are treated as limit elements, too.
  29629. * * {@link ~SchemaItemDefinition#isObject `isObject`} &ndash; Whether an item is "self-contained" and should be treated as a whole.
  29630. * Examples of object elements: `imageBlock`, `table`, `video`, etc. An object is also a limit, so
  29631. * {@link module:engine/model/schema~Schema#isLimit `isLimit()`} returns `true` for object elements automatically.
  29632. *
  29633. * Read more about the meaning of these types in the
  29634. * {@glink framework/guides/deep-dive/schema#defining-additional-semantics dedicated section of the Schema deep dive} guide.
  29635. *
  29636. * # Generic items
  29637. *
  29638. * There are three basic generic items: `$root`, `$block` and `$text`.
  29639. * They are defined as follows:
  29640. *
  29641. * this.schema.register( '$root', {
  29642. * isLimit: true
  29643. * } );
  29644. * this.schema.register( '$block', {
  29645. * allowIn: '$root',
  29646. * isBlock: true
  29647. * } );
  29648. * this.schema.register( '$text', {
  29649. * allowIn: '$block',
  29650. * isInline: true
  29651. * } );
  29652. *
  29653. * They reflect typical editor content that is contained within one root, consists of several blocks
  29654. * (paragraphs, lists items, headings, images) which, in turn, may contain text inside.
  29655. *
  29656. * By inheriting from the generic items you can define new items which will get extended by other editor features.
  29657. * Read more about generic types in the {@glink framework/guides/deep-dive/schema Schema deep dive} guide.
  29658. *
  29659. * # Example definitions
  29660. *
  29661. * Allow `paragraph` in roots and block quotes:
  29662. *
  29663. * schema.register( 'paragraph', {
  29664. * allowIn: [ '$root', 'blockQuote' ],
  29665. * isBlock: true
  29666. * } );
  29667. *
  29668. * Allow `paragraph` everywhere where `$block` is allowed (i.e. in `$root`):
  29669. *
  29670. * schema.register( 'paragraph', {
  29671. * allowWhere: '$block',
  29672. * isBlock: true
  29673. * } );
  29674. *
  29675. * Allow `paragraph` inside a `$root` and allow `$text` as a `paragraph` child:
  29676. *
  29677. * schema.register( 'paragraph', {
  29678. * allowIn: '$root',
  29679. * allowChildren: '$text',
  29680. * isBlock: true
  29681. * } );
  29682. *
  29683. * Make `imageBlock` a block object, which is allowed everywhere where `$block` is.
  29684. * Also, allow `src` and `alt` attributes in it:
  29685. *
  29686. * schema.register( 'imageBlock', {
  29687. * allowWhere: '$block',
  29688. * allowAttributes: [ 'src', 'alt' ],
  29689. * isBlock: true,
  29690. * isObject: true
  29691. * } );
  29692. *
  29693. * Make `caption` allowed in `imageBlock` and make it allow all the content of `$block`s (usually, `$text`).
  29694. * Also, mark it as a limit element so it cannot be split:
  29695. *
  29696. * schema.register( 'caption', {
  29697. * allowIn: 'imageBlock',
  29698. * allowContentOf: '$block',
  29699. * isLimit: true
  29700. * } );
  29701. *
  29702. * Make `listItem` inherit all from `$block` but also allow additional attributes:
  29703. *
  29704. * schema.register( 'listItem', {
  29705. * inheritAllFrom: '$block',
  29706. * allowAttributes: [ 'listType', 'listIndent' ]
  29707. * } );
  29708. *
  29709. * Which translates to:
  29710. *
  29711. * schema.register( 'listItem', {
  29712. * allowWhere: '$block',
  29713. * allowContentOf: '$block',
  29714. * allowAttributesOf: '$block',
  29715. * inheritTypesFrom: '$block',
  29716. * allowAttributes: [ 'listType', 'listIndent' ]
  29717. * } );
  29718. *
  29719. * # Tips
  29720. *
  29721. * * Check schema definitions of existing features to see how they are defined.
  29722. * * If you want to publish your feature so other developers can use it, try to use
  29723. * generic items as much as possible.
  29724. * * Keep your model clean. Limit it to the actual data and store information in a normalized way.
  29725. * * Remember about defining the `is*` properties. They do not affect the allowed structures, but they can
  29726. * affect how the editor features treat your elements.
  29727. *
  29728. * @typedef {Object} module:engine/model/schema~SchemaItemDefinition
  29729. *
  29730. * @property {String|Array.<String>} allowIn Defines in which other items this item will be allowed.
  29731. * @property {String|Array.<String>} allowChildren Defines which other items are allowed inside this item.
  29732. * @property {String|Array.<String>} allowAttributes Defines allowed attributes of the given item.
  29733. * @property {String|Array.<String>} allowContentOf Inherits "allowed children" from other items.
  29734. * @property {String|Array.<String>} allowWhere Inherits "allowed in" from other items.
  29735. * @property {String|Array.<String>} allowAttributesOf Inherits attributes from other items.
  29736. * @property {String|Array.<String>} inheritTypesFrom Inherits `is*` properties of other items.
  29737. * @property {String} inheritAllFrom A shorthand for `allowContentOf`, `allowWhere`, `allowAttributesOf`, `inheritTypesFrom`.
  29738. *
  29739. * @property {Boolean} isBlock
  29740. * Whether this item is paragraph-like. Generally speaking, content is usually made out of blocks
  29741. * like paragraphs, list items, images, headings, etc. All these elements are marked as blocks. A block
  29742. * should not allow another block inside. Note: There is also the `$block` generic item which has `isBlock` set to `true`.
  29743. * Most block type items will inherit from `$block` (through `inheritAllFrom`).
  29744. *
  29745. * Read more about the block elements in the
  29746. * {@glink framework/guides/deep-dive/schema#block-elements Block elements section} of
  29747. * the {@glink framework/guides/deep-dive/schema Schema deep dive}.
  29748. *
  29749. * @property {Boolean} isInline
  29750. * Whether an item is "text-like" and should be treated as an inline node. Examples of inline elements:
  29751. * `$text`, `softBreak` (`<br>`), etc.
  29752. *
  29753. * Read more about the inline elements in the
  29754. * {@glink framework/guides/deep-dive/schema#inline-elements Inline elements section} of the Schema deep dive guide.
  29755. *
  29756. * @property {Boolean} isLimit
  29757. * It can be understood as whether this element should not be split by <kbd>Enter</kbd>.
  29758. * Examples of limit elements: `$root`, table cell, image caption, etc. In other words, all actions that happen inside
  29759. * a limit element are limited to its content.
  29760. *
  29761. * Read more about the limit elements in the
  29762. * {@glink framework/guides/deep-dive/schema#limit-elements Limit elements section} of
  29763. * the {@glink framework/guides/deep-dive/schema Schema deep dive} guide.
  29764. *
  29765. * @property {Boolean} isObject
  29766. * Whether an item is "self-contained" and should be treated as a whole. Examples of object elements:
  29767. * `imageBlock`, `table`, `video`, etc.
  29768. *
  29769. * **Note:** An object is also a limit, so
  29770. * {@link module:engine/model/schema~Schema#isLimit `isLimit()`} returns `true` for object elements automatically.
  29771. *
  29772. * Read more about the object elements in the
  29773. * {@glink framework/guides/deep-dive/schema#object-elements Object elements section} of the Schema deep dive guide.
  29774. *
  29775. * @property {Boolean} isSelectable
  29776. * `true` when an element should be selectable as a whole by the user. Examples of selectable elements: `imageBlock`, `table`, `tableCell`,
  29777. * etc.
  29778. *
  29779. * **Note:** An object is also a selectable element, so
  29780. * {@link module:engine/model/schema~Schema#isSelectable `isSelectable()`} returns `true` for object elements automatically.
  29781. *
  29782. * Read more about selectable elements in the
  29783. * {@glink framework/guides/deep-dive/schema#selectable-elements Selectable elements section} of
  29784. * the {@glink framework/guides/deep-dive/schema Schema deep dive} guide.
  29785. *
  29786. * @property {Boolean} isContent
  29787. * An item is a content when it always finds its way to the editor data output regardless of the number and type of its descendants.
  29788. * Examples of content elements: `$text`, `imageBlock`, `table`, etc. (but not `paragraph`, `heading1` or `tableCell`).
  29789. *
  29790. * **Note:** An object is also a content element, so
  29791. * {@link module:engine/model/schema~Schema#isContent `isContent()`} returns `true` for object elements automatically.
  29792. *
  29793. * Read more about content elements in the
  29794. * {@glink framework/guides/deep-dive/schema#content-elements Content elements section} of
  29795. * the {@glink framework/guides/deep-dive/schema Schema deep dive} guide.
  29796. */
  29797. /**
  29798. * A simplified version of {@link module:engine/model/schema~SchemaItemDefinition} after
  29799. * compilation by the {@link module:engine/model/schema~Schema schema}.
  29800. * Rules fed to the schema by {@link module:engine/model/schema~Schema#register}
  29801. * and {@link module:engine/model/schema~Schema#extend} methods are defined in the
  29802. * {@link module:engine/model/schema~SchemaItemDefinition} format.
  29803. * Later on, they are compiled to `SchemaCompiledItemDefinition` so when you use e.g.
  29804. * the {@link module:engine/model/schema~Schema#getDefinition} method you get the compiled version.
  29805. *
  29806. * The compiled version contains only the following properties:
  29807. *
  29808. * * The `name` property,
  29809. * * The `is*` properties,
  29810. * * The `allowIn` array,
  29811. * * The `allowChildren` array,
  29812. * * The `allowAttributes` array.
  29813. *
  29814. * @typedef {Object} module:engine/model/schema~SchemaCompiledItemDefinition
  29815. */
  29816. /**
  29817. * A schema context &mdash; a list of ancestors of a given position in the document.
  29818. *
  29819. * Considering such position:
  29820. *
  29821. * <$root>
  29822. * <blockQuote>
  29823. * <paragraph>
  29824. * ^
  29825. * </paragraph>
  29826. * </blockQuote>
  29827. * </$root>
  29828. *
  29829. * The context of this position is its {@link module:engine/model/position~Position#getAncestors lists of ancestors}:
  29830. *
  29831. * [ rootElement, blockQuoteElement, paragraphElement ]
  29832. *
  29833. * Contexts are used in the {@link module:engine/model/schema~Schema#event:checkChild `Schema#checkChild`} and
  29834. * {@link module:engine/model/schema~Schema#event:checkAttribute `Schema#checkAttribute`} events as a definition
  29835. * of a place in the document where the check occurs. The context instances are created based on the first arguments
  29836. * of the {@link module:engine/model/schema~Schema#checkChild `Schema#checkChild()`} and
  29837. * {@link module:engine/model/schema~Schema#checkAttribute `Schema#checkAttribute()`} methods so when
  29838. * using these methods you need to use {@link module:engine/model/schema~SchemaContextDefinition}s.
  29839. */
  29840. class SchemaContext {
  29841. /**
  29842. * Creates an instance of the context.
  29843. *
  29844. * @param {module:engine/model/schema~SchemaContextDefinition} context
  29845. */
  29846. constructor( context ) {
  29847. if ( context instanceof SchemaContext ) {
  29848. return context;
  29849. }
  29850. if ( typeof context == 'string' ) {
  29851. context = [ context ];
  29852. } else if ( !Array.isArray( context ) ) {
  29853. // `context` is item or position.
  29854. // Position#getAncestors() doesn't accept any parameters but it works just fine here.
  29855. context = context.getAncestors( { includeSelf: true } );
  29856. }
  29857. this._items = context.map( mapContextItem );
  29858. }
  29859. /**
  29860. * The number of items.
  29861. *
  29862. * @type {Number}
  29863. */
  29864. get length() {
  29865. return this._items.length;
  29866. }
  29867. /**
  29868. * The last item (the lowest node).
  29869. *
  29870. * @type {module:engine/model/schema~SchemaContextItem}
  29871. */
  29872. get last() {
  29873. return this._items[ this._items.length - 1 ];
  29874. }
  29875. /**
  29876. * Iterable interface.
  29877. *
  29878. * Iterates over all context items.
  29879. *
  29880. * @returns {Iterable.<module:engine/model/schema~SchemaContextItem>}
  29881. */
  29882. [ Symbol.iterator ]() {
  29883. return this._items[ Symbol.iterator ]();
  29884. }
  29885. /**
  29886. * Returns a new schema context instance with an additional item.
  29887. *
  29888. * Item can be added as:
  29889. *
  29890. * const context = new SchemaContext( [ '$root' ] );
  29891. *
  29892. * // An element.
  29893. * const fooElement = writer.createElement( 'fooElement' );
  29894. * const newContext = context.push( fooElement ); // [ '$root', 'fooElement' ]
  29895. *
  29896. * // A text node.
  29897. * const text = writer.createText( 'foobar' );
  29898. * const newContext = context.push( text ); // [ '$root', '$text' ]
  29899. *
  29900. * // A string (element name).
  29901. * const newContext = context.push( 'barElement' ); // [ '$root', 'barElement' ]
  29902. *
  29903. * **Note** {@link module:engine/model/node~Node} that is already in the model tree will be added as the only item
  29904. * (without ancestors).
  29905. *
  29906. * @param {String|module:engine/model/node~Node|Array<String|module:engine/model/node~Node>} item An item that will be added
  29907. * to the current context.
  29908. * @returns {module:engine/model/schema~SchemaContext} A new schema context instance with an additional item.
  29909. */
  29910. push( item ) {
  29911. const ctx = new SchemaContext( [ item ] );
  29912. ctx._items = [ ...this._items, ...ctx._items ];
  29913. return ctx;
  29914. }
  29915. /**
  29916. * Gets an item on the given index.
  29917. *
  29918. * @returns {module:engine/model/schema~SchemaContextItem}
  29919. */
  29920. getItem( index ) {
  29921. return this._items[ index ];
  29922. }
  29923. /**
  29924. * Returns the names of items.
  29925. *
  29926. * @returns {Iterable.<String>}
  29927. */
  29928. * getNames() {
  29929. yield* this._items.map( item => item.name );
  29930. }
  29931. /**
  29932. * Checks whether the context ends with the given nodes.
  29933. *
  29934. * const ctx = new SchemaContext( [ rootElement, paragraphElement, textNode ] );
  29935. *
  29936. * ctx.endsWith( '$text' ); // -> true
  29937. * ctx.endsWith( 'paragraph $text' ); // -> true
  29938. * ctx.endsWith( '$root' ); // -> false
  29939. * ctx.endsWith( 'paragraph' ); // -> false
  29940. *
  29941. * @param {String} query
  29942. * @returns {Boolean}
  29943. */
  29944. endsWith( query ) {
  29945. return Array.from( this.getNames() ).join( ' ' ).endsWith( query );
  29946. }
  29947. /**
  29948. * Checks whether the context starts with the given nodes.
  29949. *
  29950. * const ctx = new SchemaContext( [ rootElement, paragraphElement, textNode ] );
  29951. *
  29952. * ctx.endsWith( '$root' ); // -> true
  29953. * ctx.endsWith( '$root paragraph' ); // -> true
  29954. * ctx.endsWith( '$text' ); // -> false
  29955. * ctx.endsWith( 'paragraph' ); // -> false
  29956. *
  29957. * @param {String} query
  29958. * @returns {Boolean}
  29959. */
  29960. startsWith( query ) {
  29961. return Array.from( this.getNames() ).join( ' ' ).startsWith( query );
  29962. }
  29963. }
  29964. /**
  29965. * The definition of a {@link module:engine/model/schema~SchemaContext schema context}.
  29966. *
  29967. * Contexts can be created in multiple ways:
  29968. *
  29969. * * By defining a **node** – in this cases this node and all its ancestors will be used.
  29970. * * By defining a **position** in the document – in this case all its ancestors will be used.
  29971. * * By defining an **array of nodes** – in this case this array defines the entire context.
  29972. * * By defining a **name of node** - in this case node will be "mocked". It is not recommended because context
  29973. * will be unrealistic (e.g. attributes of these nodes are not specified). However, at times this may be the only
  29974. * way to define the context (e.g. when checking some hypothetical situation).
  29975. * * By defining an **array of node names** (potentially, mixed with real nodes) – The same as **name of node**
  29976. * but it is possible to create a path.
  29977. * * By defining a {@link module:engine/model/schema~SchemaContext} instance - in this case the same instance as provided
  29978. * will be return.
  29979. *
  29980. * Examples of context definitions passed to the {@link module:engine/model/schema~Schema#checkChild `Schema#checkChild()`}
  29981. * method:
  29982. *
  29983. * // Assuming that we have a $root > blockQuote > paragraph structure, the following code
  29984. * // will check node 'foo' in the following context:
  29985. * // [ rootElement, blockQuoteElement, paragraphElement ]
  29986. * const contextDefinition = paragraphElement;
  29987. * const childToCheck = 'foo';
  29988. * schema.checkChild( contextDefinition, childToCheck );
  29989. *
  29990. * // Also check in [ rootElement, blockQuoteElement, paragraphElement ].
  29991. * schema.checkChild( model.createPositionAt( paragraphElement, 0 ), 'foo' );
  29992. *
  29993. * // Check in [ rootElement, paragraphElement ].
  29994. * schema.checkChild( [ rootElement, paragraphElement ], 'foo' );
  29995. *
  29996. * // Check only fakeParagraphElement.
  29997. * schema.checkChild( 'paragraph', 'foo' );
  29998. *
  29999. * // Check in [ fakeRootElement, fakeBarElement, paragraphElement ].
  30000. * schema.checkChild( [ '$root', 'bar', paragraphElement ], 'foo' );
  30001. *
  30002. * All these `checkChild()` calls will fire {@link module:engine/model/schema~Schema#event:checkChild `Schema#checkChild`}
  30003. * events in which `args[ 0 ]` is an instance of the context. Therefore, you can write a listener like this:
  30004. *
  30005. * schema.on( 'checkChild', ( evt, args ) => {
  30006. * const ctx = args[ 0 ];
  30007. *
  30008. * console.log( Array.from( ctx.getNames() ) );
  30009. * } );
  30010. *
  30011. * Which will log the following:
  30012. *
  30013. * [ '$root', 'blockQuote', 'paragraph' ]
  30014. * [ '$root', 'paragraph' ]
  30015. * [ '$root', 'bar', 'paragraph' ]
  30016. *
  30017. * Note: When using the {@link module:engine/model/schema~Schema#checkAttribute `Schema#checkAttribute()`} method
  30018. * you may want to check whether a text node may have an attribute. A {@link module:engine/model/text~Text} is a
  30019. * correct way to define a context so you can do this:
  30020. *
  30021. * schema.checkAttribute( textNode, 'bold' );
  30022. *
  30023. * But sometimes you want to check whether a text at a given position might've had some attribute,
  30024. * in which case you can create a context by mixing in an array of elements with a `'$text'` string:
  30025. *
  30026. * // Check in [ rootElement, paragraphElement, textNode ].
  30027. * schema.checkChild( [ ...positionInParagraph.getAncestors(), '$text' ], 'bold' );
  30028. *
  30029. * @typedef {module:engine/model/node~Node|module:engine/model/position~Position|module:engine/model/schema~SchemaContext|
  30030. * String|Array.<String|module:engine/model/node~Node>} module:engine/model/schema~SchemaContextDefinition
  30031. */
  30032. /**
  30033. * An item of the {@link module:engine/model/schema~SchemaContext schema context}.
  30034. *
  30035. * It contains 3 properties:
  30036. *
  30037. * * `name` – the name of this item,
  30038. * * `* getAttributeKeys()` – a generator of keys of item attributes,
  30039. * * `getAttribute( keyName )` – a method to get attribute values.
  30040. *
  30041. * The context item interface is a highly simplified version of {@link module:engine/model/node~Node} and its role
  30042. * is to expose only the information which schema checks are able to provide (which is the name of the node and
  30043. * node's attributes).
  30044. *
  30045. * schema.on( 'checkChild', ( evt, args ) => {
  30046. * const ctx = args[ 0 ];
  30047. * const firstItem = ctx.getItem( 0 );
  30048. *
  30049. * console.log( firstItem.name ); // -> '$root'
  30050. * console.log( firstItem.getAttribute( 'foo' ) ); // -> 'bar'
  30051. * console.log( Array.from( firstItem.getAttributeKeys() ) ); // -> [ 'foo', 'faa' ]
  30052. * } );
  30053. *
  30054. * @typedef {Object} module:engine/model/schema~SchemaContextItem
  30055. */
  30056. /**
  30057. * A structure containing additional metadata describing the attribute.
  30058. *
  30059. * See {@link module:engine/model/schema~Schema#setAttributeProperties `Schema#setAttributeProperties()`} for usage examples.
  30060. *
  30061. * @typedef {Object} module:engine/model/schema~AttributeProperties
  30062. * @property {Boolean} [isFormatting] Indicates that the attribute should be considered as a visual formatting, like `bold`, `italic` or
  30063. * `fontSize` rather than semantic attribute (such as `src`, `listType`, etc.). For example, it is used by the "Remove format" feature.
  30064. * @property {Boolean} [copyOnEnter] Indicates that given text attribute should be copied to the next block when enter is pressed.
  30065. */
  30066. function compileBaseItemRule( sourceItemRules, itemName ) {
  30067. const itemRule = {
  30068. name: itemName,
  30069. allowIn: [],
  30070. allowContentOf: [],
  30071. allowWhere: [],
  30072. allowAttributes: [],
  30073. allowAttributesOf: [],
  30074. allowChildren: [],
  30075. inheritTypesFrom: []
  30076. };
  30077. copyTypes( sourceItemRules, itemRule );
  30078. copyProperty( sourceItemRules, itemRule, 'allowIn' );
  30079. copyProperty( sourceItemRules, itemRule, 'allowContentOf' );
  30080. copyProperty( sourceItemRules, itemRule, 'allowWhere' );
  30081. copyProperty( sourceItemRules, itemRule, 'allowAttributes' );
  30082. copyProperty( sourceItemRules, itemRule, 'allowAttributesOf' );
  30083. copyProperty( sourceItemRules, itemRule, 'allowChildren' );
  30084. copyProperty( sourceItemRules, itemRule, 'inheritTypesFrom' );
  30085. makeInheritAllWork( sourceItemRules, itemRule );
  30086. return itemRule;
  30087. }
  30088. function compileAllowChildren( compiledDefinitions, itemName ) {
  30089. const item = compiledDefinitions[ itemName ];
  30090. for ( const allowChildrenItem of item.allowChildren ) {
  30091. const allowedChildren = compiledDefinitions[ allowChildrenItem ];
  30092. // The allowChildren property may point to an unregistered element.
  30093. if ( !allowedChildren ) {
  30094. continue;
  30095. }
  30096. allowedChildren.allowIn.push( itemName );
  30097. }
  30098. // The allowIn property already includes correct items, reset the allowChildren property
  30099. // to avoid duplicates later when setting up compilation results.
  30100. item.allowChildren.length = 0;
  30101. }
  30102. function compileAllowContentOf( compiledDefinitions, itemName ) {
  30103. for ( const allowContentOfItemName of compiledDefinitions[ itemName ].allowContentOf ) {
  30104. // The allowContentOf property may point to an unregistered element.
  30105. if ( compiledDefinitions[ allowContentOfItemName ] ) {
  30106. const allowedChildren = getAllowedChildren( compiledDefinitions, allowContentOfItemName );
  30107. allowedChildren.forEach( allowedItem => {
  30108. allowedItem.allowIn.push( itemName );
  30109. } );
  30110. }
  30111. }
  30112. delete compiledDefinitions[ itemName ].allowContentOf;
  30113. }
  30114. function compileAllowWhere( compiledDefinitions, itemName ) {
  30115. for ( const allowWhereItemName of compiledDefinitions[ itemName ].allowWhere ) {
  30116. const inheritFrom = compiledDefinitions[ allowWhereItemName ];
  30117. // The allowWhere property may point to an unregistered element.
  30118. if ( inheritFrom ) {
  30119. const allowedIn = inheritFrom.allowIn;
  30120. compiledDefinitions[ itemName ].allowIn.push( ...allowedIn );
  30121. }
  30122. }
  30123. delete compiledDefinitions[ itemName ].allowWhere;
  30124. }
  30125. function compileAllowAttributesOf( compiledDefinitions, itemName ) {
  30126. for ( const allowAttributeOfItem of compiledDefinitions[ itemName ].allowAttributesOf ) {
  30127. const inheritFrom = compiledDefinitions[ allowAttributeOfItem ];
  30128. if ( inheritFrom ) {
  30129. const inheritAttributes = inheritFrom.allowAttributes;
  30130. compiledDefinitions[ itemName ].allowAttributes.push( ...inheritAttributes );
  30131. }
  30132. }
  30133. delete compiledDefinitions[ itemName ].allowAttributesOf;
  30134. }
  30135. function compileInheritPropertiesFrom( compiledDefinitions, itemName ) {
  30136. const item = compiledDefinitions[ itemName ];
  30137. for ( const inheritPropertiesOfItem of item.inheritTypesFrom ) {
  30138. const inheritFrom = compiledDefinitions[ inheritPropertiesOfItem ];
  30139. if ( inheritFrom ) {
  30140. const typeNames = Object.keys( inheritFrom ).filter( name => name.startsWith( 'is' ) );
  30141. for ( const name of typeNames ) {
  30142. if ( !( name in item ) ) {
  30143. item[ name ] = inheritFrom[ name ];
  30144. }
  30145. }
  30146. }
  30147. }
  30148. delete item.inheritTypesFrom;
  30149. }
  30150. // Remove items which weren't registered (because it may break some checks or we'd need to complicate them).
  30151. // Make sure allowIn doesn't contain repeated values.
  30152. function cleanUpAllowIn( compiledDefinitions, itemName ) {
  30153. const itemRule = compiledDefinitions[ itemName ];
  30154. const existingItems = itemRule.allowIn.filter( itemToCheck => compiledDefinitions[ itemToCheck ] );
  30155. itemRule.allowIn = Array.from( new Set( existingItems ) );
  30156. }
  30157. // Setup allowChildren items based on allowIn.
  30158. function setupAllowChildren( compiledDefinitions, itemName ) {
  30159. const itemRule = compiledDefinitions[ itemName ];
  30160. for ( const allowedParentItemName of itemRule.allowIn ) {
  30161. const allowedParentItem = compiledDefinitions[ allowedParentItemName ];
  30162. allowedParentItem.allowChildren.push( itemName );
  30163. }
  30164. }
  30165. function cleanUpAllowAttributes( compiledDefinitions, itemName ) {
  30166. const itemRule = compiledDefinitions[ itemName ];
  30167. itemRule.allowAttributes = Array.from( new Set( itemRule.allowAttributes ) );
  30168. }
  30169. function copyTypes( sourceItemRules, itemRule ) {
  30170. for ( const sourceItemRule of sourceItemRules ) {
  30171. const typeNames = Object.keys( sourceItemRule ).filter( name => name.startsWith( 'is' ) );
  30172. for ( const name of typeNames ) {
  30173. itemRule[ name ] = sourceItemRule[ name ];
  30174. }
  30175. }
  30176. }
  30177. function copyProperty( sourceItemRules, itemRule, propertyName ) {
  30178. for ( const sourceItemRule of sourceItemRules ) {
  30179. if ( typeof sourceItemRule[ propertyName ] == 'string' ) {
  30180. itemRule[ propertyName ].push( sourceItemRule[ propertyName ] );
  30181. } else if ( Array.isArray( sourceItemRule[ propertyName ] ) ) {
  30182. itemRule[ propertyName ].push( ...sourceItemRule[ propertyName ] );
  30183. }
  30184. }
  30185. }
  30186. function makeInheritAllWork( sourceItemRules, itemRule ) {
  30187. for ( const sourceItemRule of sourceItemRules ) {
  30188. const inheritFrom = sourceItemRule.inheritAllFrom;
  30189. if ( inheritFrom ) {
  30190. itemRule.allowContentOf.push( inheritFrom );
  30191. itemRule.allowWhere.push( inheritFrom );
  30192. itemRule.allowAttributesOf.push( inheritFrom );
  30193. itemRule.inheritTypesFrom.push( inheritFrom );
  30194. }
  30195. }
  30196. }
  30197. function getAllowedChildren( compiledDefinitions, itemName ) {
  30198. const itemRule = compiledDefinitions[ itemName ];
  30199. return getValues( compiledDefinitions ).filter( def => def.allowIn.includes( itemRule.name ) );
  30200. }
  30201. function getValues( obj ) {
  30202. return Object.keys( obj ).map( key => obj[ key ] );
  30203. }
  30204. function mapContextItem( ctxItem ) {
  30205. if ( typeof ctxItem == 'string' || ctxItem.is( 'documentFragment' ) ) {
  30206. return {
  30207. name: typeof ctxItem == 'string' ? ctxItem : '$documentFragment',
  30208. * getAttributeKeys() {},
  30209. getAttribute() {}
  30210. };
  30211. } else {
  30212. return {
  30213. // '$text' means text nodes and text proxies.
  30214. name: ctxItem.is( 'element' ) ? ctxItem.name : '$text',
  30215. * getAttributeKeys() {
  30216. yield* ctxItem.getAttributeKeys();
  30217. },
  30218. getAttribute( key ) {
  30219. return ctxItem.getAttribute( key );
  30220. }
  30221. };
  30222. }
  30223. }
  30224. // Generator function returning values from provided walkers, switching between them at each iteration. If only one walker
  30225. // is provided it will return data only from that walker.
  30226. //
  30227. // @param {module:engine/module/treewalker~TreeWalker} [backward] Walker iterating in backward direction.
  30228. // @param {module:engine/module/treewalker~TreeWalker} [forward] Walker iterating in forward direction.
  30229. // @returns {Iterable.<Object>} Object returned at each iteration contains `value` and `walker` (informing which walker returned
  30230. // given value) fields.
  30231. function* combineWalkers( backward, forward ) {
  30232. let done = false;
  30233. while ( !done ) {
  30234. done = true;
  30235. if ( backward ) {
  30236. const step = backward.next();
  30237. if ( !step.done ) {
  30238. done = false;
  30239. yield {
  30240. walker: backward,
  30241. value: step.value
  30242. };
  30243. }
  30244. }
  30245. if ( forward ) {
  30246. const step = forward.next();
  30247. if ( !step.done ) {
  30248. done = false;
  30249. yield {
  30250. walker: forward,
  30251. value: step.value
  30252. };
  30253. }
  30254. }
  30255. }
  30256. }
  30257. // Takes an array of non-intersecting ranges. For each of them gets minimal flat ranges covering that range and returns
  30258. // all those minimal flat ranges.
  30259. //
  30260. // @param {Array.<module:engine/model/range~Range>} ranges Ranges to process.
  30261. // @returns {Iterable.<module:engine/model/range~Range>} Minimal flat ranges of given `ranges`.
  30262. function* convertToMinimalFlatRanges( ranges ) {
  30263. for ( const range of ranges ) {
  30264. yield* range.getMinimalFlatRanges();
  30265. }
  30266. }
  30267. function removeDisallowedAttributeFromNode( schema, node, writer ) {
  30268. for ( const attribute of node.getAttributeKeys() ) {
  30269. if ( !schema.checkAttribute( node, attribute ) ) {
  30270. writer.removeAttribute( attribute, node );
  30271. }
  30272. }
  30273. }
  30274. /***/ }),
  30275. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js":
  30276. /*!************************************************************************!*\
  30277. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js ***!
  30278. \************************************************************************/
  30279. /*! exports provided: default */
  30280. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  30281. "use strict";
  30282. __webpack_require__.r(__webpack_exports__);
  30283. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Selection; });
  30284. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  30285. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
  30286. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  30287. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  30288. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  30289. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  30290. /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  30291. /**
  30292. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  30293. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  30294. */
  30295. /**
  30296. * @module engine/model/selection
  30297. */
  30298. /**
  30299. * Selection is a set of {@link module:engine/model/range~Range ranges}. It has a direction specified by its
  30300. * {@link module:engine/model/selection~Selection#anchor anchor} and {@link module:engine/model/selection~Selection#focus focus}
  30301. * (it can be {@link module:engine/model/selection~Selection#isBackward forward or backward}).
  30302. * Additionally, selection may have its own attributes (think – whether text typed in in this selection
  30303. * should have those attributes – e.g. whether you type a bolded text).
  30304. *
  30305. * @mixes module:utils/emittermixin~EmitterMixin
  30306. */
  30307. class Selection {
  30308. /**
  30309. * Creates a new selection instance based on the given {@link module:engine/model/selection~Selectable selectable}
  30310. * or creates an empty selection if no arguments were passed.
  30311. *
  30312. * // Creates empty selection without ranges.
  30313. * const selection = writer.createSelection();
  30314. *
  30315. * // Creates selection at the given range.
  30316. * const range = writer.createRange( start, end );
  30317. * const selection = writer.createSelection( range );
  30318. *
  30319. * // Creates selection at the given ranges
  30320. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  30321. * const selection = writer.createSelection( ranges );
  30322. *
  30323. * // Creates selection from the other selection.
  30324. * // Note: It doesn't copies selection attributes.
  30325. * const otherSelection = writer.createSelection();
  30326. * const selection = writer.createSelection( otherSelection );
  30327. *
  30328. * // Creates selection from the given document selection.
  30329. * // Note: It doesn't copies selection attributes.
  30330. * const documentSelection = model.document.selection;
  30331. * const selection = writer.createSelection( documentSelection );
  30332. *
  30333. * // Creates selection at the given position.
  30334. * const position = writer.createPositionFromPath( root, path );
  30335. * const selection = writer.createSelection( position );
  30336. *
  30337. * // Creates selection at the given offset in the given element.
  30338. * const paragraph = writer.createElement( 'paragraph' );
  30339. * const selection = writer.createSelection( paragraph, offset );
  30340. *
  30341. * // Creates a range inside an {@link module:engine/model/element~Element element} which starts before the
  30342. * // first child of that element and ends after the last child of that element.
  30343. * const selection = writer.createSelection( paragraph, 'in' );
  30344. *
  30345. * // Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends
  30346. * // just after the item.
  30347. * const selection = writer.createSelection( paragraph, 'on' );
  30348. *
  30349. * Selection's constructor allow passing additional options (`'backward'`) as the last argument.
  30350. *
  30351. * // Creates backward selection.
  30352. * const selection = writer.createSelection( range, { backward: true } );
  30353. *
  30354. * @param {module:engine/model/selection~Selectable} [selectable]
  30355. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  30356. * @param {Object} [options]
  30357. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  30358. */
  30359. constructor( selectable, placeOrOffset, options ) {
  30360. /**
  30361. * Specifies whether the last added range was added as a backward or forward range.
  30362. *
  30363. * @private
  30364. * @type {Boolean}
  30365. */
  30366. this._lastRangeBackward = false;
  30367. /**
  30368. * Stores selection ranges.
  30369. *
  30370. * @protected
  30371. * @type {Array.<module:engine/model/range~Range>}
  30372. */
  30373. this._ranges = [];
  30374. /**
  30375. * List of attributes set on current selection.
  30376. *
  30377. * @protected
  30378. * @type {Map.<String,*>}
  30379. */
  30380. this._attrs = new Map();
  30381. if ( selectable ) {
  30382. this.setTo( selectable, placeOrOffset, options );
  30383. }
  30384. }
  30385. /**
  30386. * Selection anchor. Anchor is the position from which the selection was started. If a user is making a selection
  30387. * by dragging the mouse, the anchor is where the user pressed the mouse button (the beginning of the selection).
  30388. *
  30389. * Anchor and {@link #focus} define the direction of the selection, which is important
  30390. * when expanding/shrinking selection. The focus moves, while the anchor should remain in the same place.
  30391. *
  30392. * Anchor is always set to the {@link module:engine/model/range~Range#start start} or
  30393. * {@link module:engine/model/range~Range#end end} position of the last of selection's ranges. Whether it is
  30394. * the `start` or `end` depends on the specified `options.backward`. See the {@link #setTo `setTo()`} method.
  30395. *
  30396. * May be set to `null` if there are no ranges in the selection.
  30397. *
  30398. * @see #focus
  30399. * @readonly
  30400. * @type {module:engine/model/position~Position|null}
  30401. */
  30402. get anchor() {
  30403. if ( this._ranges.length > 0 ) {
  30404. const range = this._ranges[ this._ranges.length - 1 ];
  30405. return this._lastRangeBackward ? range.end : range.start;
  30406. }
  30407. return null;
  30408. }
  30409. /**
  30410. * Selection focus. Focus is the position where the selection ends. If a user is making a selection
  30411. * by dragging the mouse, the focus is where the mouse cursor is.
  30412. *
  30413. * May be set to `null` if there are no ranges in the selection.
  30414. *
  30415. * @see #anchor
  30416. * @readonly
  30417. * @type {module:engine/model/position~Position|null}
  30418. */
  30419. get focus() {
  30420. if ( this._ranges.length > 0 ) {
  30421. const range = this._ranges[ this._ranges.length - 1 ];
  30422. return this._lastRangeBackward ? range.start : range.end;
  30423. }
  30424. return null;
  30425. }
  30426. /**
  30427. * Whether the selection is collapsed. Selection is collapsed when there is exactly one range in it
  30428. * and it is collapsed.
  30429. *
  30430. * @readonly
  30431. * @type {Boolean}
  30432. */
  30433. get isCollapsed() {
  30434. const length = this._ranges.length;
  30435. if ( length === 1 ) {
  30436. return this._ranges[ 0 ].isCollapsed;
  30437. } else {
  30438. return false;
  30439. }
  30440. }
  30441. /**
  30442. * Returns the number of ranges in the selection.
  30443. *
  30444. * @readonly
  30445. * @type {Number}
  30446. */
  30447. get rangeCount() {
  30448. return this._ranges.length;
  30449. }
  30450. /**
  30451. * Specifies whether the selection's {@link #focus} precedes the selection's {@link #anchor}.
  30452. *
  30453. * @readonly
  30454. * @type {Boolean}
  30455. */
  30456. get isBackward() {
  30457. return !this.isCollapsed && this._lastRangeBackward;
  30458. }
  30459. /**
  30460. * Checks whether this selection is equal to the given selection. Selections are equal if they have the same directions,
  30461. * the same number of ranges and all ranges from one selection equal to ranges from the another selection.
  30462. *
  30463. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} otherSelection
  30464. * Selection to compare with.
  30465. * @returns {Boolean} `true` if selections are equal, `false` otherwise.
  30466. */
  30467. isEqual( otherSelection ) {
  30468. if ( this.rangeCount != otherSelection.rangeCount ) {
  30469. return false;
  30470. } else if ( this.rangeCount === 0 ) {
  30471. return true;
  30472. }
  30473. if ( !this.anchor.isEqual( otherSelection.anchor ) || !this.focus.isEqual( otherSelection.focus ) ) {
  30474. return false;
  30475. }
  30476. for ( const thisRange of this._ranges ) {
  30477. let found = false;
  30478. for ( const otherRange of otherSelection._ranges ) {
  30479. if ( thisRange.isEqual( otherRange ) ) {
  30480. found = true;
  30481. break;
  30482. }
  30483. }
  30484. if ( !found ) {
  30485. return false;
  30486. }
  30487. }
  30488. return true;
  30489. }
  30490. /**
  30491. * Returns an iterable object that iterates over copies of selection ranges.
  30492. *
  30493. * @returns {Iterable.<module:engine/model/range~Range>}
  30494. */
  30495. * getRanges() {
  30496. for ( const range of this._ranges ) {
  30497. yield new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( range.start, range.end );
  30498. }
  30499. }
  30500. /**
  30501. * Returns a copy of the first range in the selection.
  30502. * First range is the one which {@link module:engine/model/range~Range#start start} position
  30503. * {@link module:engine/model/position~Position#isBefore is before} start position of all other ranges
  30504. * (not to confuse with the first range added to the selection).
  30505. *
  30506. * Returns `null` if there are no ranges in selection.
  30507. *
  30508. * @returns {module:engine/model/range~Range|null}
  30509. */
  30510. getFirstRange() {
  30511. let first = null;
  30512. for ( const range of this._ranges ) {
  30513. if ( !first || range.start.isBefore( first.start ) ) {
  30514. first = range;
  30515. }
  30516. }
  30517. return first ? new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( first.start, first.end ) : null;
  30518. }
  30519. /**
  30520. * Returns a copy of the last range in the selection.
  30521. * Last range is the one which {@link module:engine/model/range~Range#end end} position
  30522. * {@link module:engine/model/position~Position#isAfter is after} end position of all other ranges (not to confuse with the range most
  30523. * recently added to the selection).
  30524. *
  30525. * Returns `null` if there are no ranges in selection.
  30526. *
  30527. * @returns {module:engine/model/range~Range|null}
  30528. */
  30529. getLastRange() {
  30530. let last = null;
  30531. for ( const range of this._ranges ) {
  30532. if ( !last || range.end.isAfter( last.end ) ) {
  30533. last = range;
  30534. }
  30535. }
  30536. return last ? new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( last.start, last.end ) : null;
  30537. }
  30538. /**
  30539. * Returns the first position in the selection.
  30540. * First position is the position that {@link module:engine/model/position~Position#isBefore is before}
  30541. * any other position in the selection.
  30542. *
  30543. * Returns `null` if there are no ranges in selection.
  30544. *
  30545. * @returns {module:engine/model/position~Position|null}
  30546. */
  30547. getFirstPosition() {
  30548. const first = this.getFirstRange();
  30549. return first ? first.start.clone() : null;
  30550. }
  30551. /**
  30552. * Returns the last position in the selection.
  30553. * Last position is the position that {@link module:engine/model/position~Position#isAfter is after}
  30554. * any other position in the selection.
  30555. *
  30556. * Returns `null` if there are no ranges in selection.
  30557. *
  30558. * @returns {module:engine/model/position~Position|null}
  30559. */
  30560. getLastPosition() {
  30561. const lastRange = this.getLastRange();
  30562. return lastRange ? lastRange.end.clone() : null;
  30563. }
  30564. /**
  30565. * Sets this selection's ranges and direction to the specified location based on the given
  30566. * {@link module:engine/model/selection~Selectable selectable}.
  30567. *
  30568. * // Removes all selection's ranges.
  30569. * selection.setTo( null );
  30570. *
  30571. * // Sets selection to the given range.
  30572. * const range = writer.createRange( start, end );
  30573. * selection.setTo( range );
  30574. *
  30575. * // Sets selection to given ranges.
  30576. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  30577. * selection.setTo( ranges );
  30578. *
  30579. * // Sets selection to other selection.
  30580. * // Note: It doesn't copies selection attributes.
  30581. * const otherSelection = writer.createSelection();
  30582. * selection.setTo( otherSelection );
  30583. *
  30584. * // Sets selection to the given document selection.
  30585. * // Note: It doesn't copies selection attributes.
  30586. * const documentSelection = new DocumentSelection( doc );
  30587. * selection.setTo( documentSelection );
  30588. *
  30589. * // Sets collapsed selection at the given position.
  30590. * const position = writer.createPositionFromPath( root, path );
  30591. * selection.setTo( position );
  30592. *
  30593. * // Sets collapsed selection at the position of the given node and an offset.
  30594. * selection.setTo( paragraph, offset );
  30595. *
  30596. * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of
  30597. * that element and ends after the last child of that element.
  30598. *
  30599. * selection.setTo( paragraph, 'in' );
  30600. *
  30601. * Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends just after the item.
  30602. *
  30603. * selection.setTo( paragraph, 'on' );
  30604. *
  30605. * `Selection#setTo()`' method allow passing additional options (`backward`) as the last argument.
  30606. *
  30607. * // Sets backward selection.
  30608. * const selection = writer.createSelection( range, { backward: true } );
  30609. *
  30610. * @param {module:engine/model/selection~Selectable} selectable
  30611. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  30612. * @param {Object} [options]
  30613. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  30614. */
  30615. setTo( selectable, placeOrOffset, options ) {
  30616. if ( selectable === null ) {
  30617. this._setRanges( [] );
  30618. } else if ( selectable instanceof Selection ) {
  30619. this._setRanges( selectable.getRanges(), selectable.isBackward );
  30620. } else if ( selectable && typeof selectable.getRanges == 'function' ) {
  30621. // We assume that the selectable is a DocumentSelection.
  30622. // It can't be imported here, because it would lead to circular imports.
  30623. this._setRanges( selectable.getRanges(), selectable.isBackward );
  30624. } else if ( selectable instanceof _range__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  30625. this._setRanges( [ selectable ], !!placeOrOffset && !!placeOrOffset.backward );
  30626. } else if ( selectable instanceof _position__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  30627. this._setRanges( [ new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( selectable ) ] );
  30628. } else if ( selectable instanceof _node__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  30629. const backward = !!options && !!options.backward;
  30630. let range;
  30631. if ( placeOrOffset == 'in' ) {
  30632. range = _range__WEBPACK_IMPORTED_MODULE_2__["default"]._createIn( selectable );
  30633. } else if ( placeOrOffset == 'on' ) {
  30634. range = _range__WEBPACK_IMPORTED_MODULE_2__["default"]._createOn( selectable );
  30635. } else if ( placeOrOffset !== undefined ) {
  30636. range = new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( selectable, placeOrOffset ) );
  30637. } else {
  30638. /**
  30639. * selection.setTo requires the second parameter when the first parameter is a node.
  30640. *
  30641. * @error model-selection-setto-required-second-parameter
  30642. */
  30643. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'model-selection-setto-required-second-parameter', [ this, selectable ] );
  30644. }
  30645. this._setRanges( [ range ], backward );
  30646. } else if ( Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_6__["default"])( selectable ) ) {
  30647. // We assume that the selectable is an iterable of ranges.
  30648. this._setRanges( selectable, placeOrOffset && !!placeOrOffset.backward );
  30649. } else {
  30650. /**
  30651. * Cannot set the selection to the given place.
  30652. *
  30653. * Invalid parameters were specified when setting the selection. Common issues:
  30654. *
  30655. * * A {@link module:engine/model/textproxy~TextProxy} instance was passed instead of
  30656. * a real {@link module:engine/model/text~Text}.
  30657. * * View nodes were passed instead of model nodes.
  30658. * * `null`/`undefined` was passed.
  30659. *
  30660. * @error model-selection-setto-not-selectable
  30661. */
  30662. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'model-selection-setto-not-selectable', [ this, selectable ] );
  30663. }
  30664. }
  30665. /**
  30666. * Replaces all ranges that were added to the selection with given array of ranges. Last range of the array
  30667. * is treated like the last added range and is used to set {@link module:engine/model/selection~Selection#anchor} and
  30668. * {@link module:engine/model/selection~Selection#focus}. Accepts a flag describing in which direction the selection is made.
  30669. *
  30670. * @protected
  30671. * @fires change:range
  30672. * @param {Iterable.<module:engine/model/range~Range>} newRanges Ranges to set.
  30673. * @param {Boolean} [isLastBackward=false] Flag describing if last added range was selected forward - from start to end (`false`)
  30674. * or backward - from end to start (`true`).
  30675. */
  30676. _setRanges( newRanges, isLastBackward = false ) {
  30677. newRanges = Array.from( newRanges );
  30678. // Check whether there is any range in new ranges set that is different than all already added ranges.
  30679. const anyNewRange = newRanges.some( newRange => {
  30680. if ( !( newRange instanceof _range__WEBPACK_IMPORTED_MODULE_2__["default"] ) ) {
  30681. /**
  30682. * Selection range set to an object that is not an instance of {@link module:engine/model/range~Range}.
  30683. *
  30684. * Only {@link module:engine/model/range~Range} instances can be used to set a selection.
  30685. * Common mistakes leading to this error are:
  30686. *
  30687. * * using DOM `Range` object,
  30688. * * incorrect CKEditor 5 installation with multiple `ckeditor5-engine` packages having different versions.
  30689. *
  30690. * @error model-selection-set-ranges-not-range
  30691. */
  30692. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  30693. 'model-selection-set-ranges-not-range',
  30694. [ this, newRanges ]
  30695. );
  30696. }
  30697. return this._ranges.every( oldRange => {
  30698. return !oldRange.isEqual( newRange );
  30699. } );
  30700. } );
  30701. // Don't do anything if nothing changed.
  30702. if ( newRanges.length === this._ranges.length && !anyNewRange ) {
  30703. return;
  30704. }
  30705. this._removeAllRanges();
  30706. for ( const range of newRanges ) {
  30707. this._pushRange( range );
  30708. }
  30709. this._lastRangeBackward = !!isLastBackward;
  30710. this.fire( 'change:range', { directChange: true } );
  30711. }
  30712. /**
  30713. * Moves {@link module:engine/model/selection~Selection#focus} to the specified location.
  30714. *
  30715. * The location can be specified in the same form as
  30716. * {@link module:engine/model/writer~Writer#createPositionAt writer.createPositionAt()} parameters.
  30717. *
  30718. * @fires change:range
  30719. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  30720. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  30721. * first parameter is a {@link module:engine/model/item~Item model item}.
  30722. */
  30723. setFocus( itemOrPosition, offset ) {
  30724. if ( this.anchor === null ) {
  30725. /**
  30726. * Cannot set selection focus if there are no ranges in selection.
  30727. *
  30728. * @error model-selection-setfocus-no-ranges
  30729. */
  30730. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'model-selection-setfocus-no-ranges', [ this, itemOrPosition ] );
  30731. }
  30732. const newFocus = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( itemOrPosition, offset );
  30733. if ( newFocus.compareWith( this.focus ) == 'same' ) {
  30734. return;
  30735. }
  30736. const anchor = this.anchor;
  30737. if ( this._ranges.length ) {
  30738. this._popRange();
  30739. }
  30740. if ( newFocus.compareWith( anchor ) == 'before' ) {
  30741. this._pushRange( new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( newFocus, anchor ) );
  30742. this._lastRangeBackward = true;
  30743. } else {
  30744. this._pushRange( new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( anchor, newFocus ) );
  30745. this._lastRangeBackward = false;
  30746. }
  30747. this.fire( 'change:range', { directChange: true } );
  30748. }
  30749. /**
  30750. * Gets an attribute value for given key or `undefined` if that attribute is not set on the selection.
  30751. *
  30752. * @param {String} key Key of attribute to look for.
  30753. * @returns {*} Attribute value or `undefined`.
  30754. */
  30755. getAttribute( key ) {
  30756. return this._attrs.get( key );
  30757. }
  30758. /**
  30759. * Returns iterable that iterates over this selection's attributes.
  30760. *
  30761. * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.
  30762. * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
  30763. *
  30764. * @returns {Iterable.<*>}
  30765. */
  30766. getAttributes() {
  30767. return this._attrs.entries();
  30768. }
  30769. /**
  30770. * Returns iterable that iterates over this selection's attribute keys.
  30771. *
  30772. * @returns {Iterable.<String>}
  30773. */
  30774. getAttributeKeys() {
  30775. return this._attrs.keys();
  30776. }
  30777. /**
  30778. * Checks if the selection has an attribute for given key.
  30779. *
  30780. * @param {String} key Key of attribute to check.
  30781. * @returns {Boolean} `true` if attribute with given key is set on selection, `false` otherwise.
  30782. */
  30783. hasAttribute( key ) {
  30784. return this._attrs.has( key );
  30785. }
  30786. /**
  30787. * Removes an attribute with given key from the selection.
  30788. *
  30789. * If given attribute was set on the selection, fires the {@link #event:change:range} event with
  30790. * removed attribute key.
  30791. *
  30792. * @fires change:attribute
  30793. * @param {String} key Key of attribute to remove.
  30794. */
  30795. removeAttribute( key ) {
  30796. if ( this.hasAttribute( key ) ) {
  30797. this._attrs.delete( key );
  30798. this.fire( 'change:attribute', { attributeKeys: [ key ], directChange: true } );
  30799. }
  30800. }
  30801. /**
  30802. * Sets attribute on the selection. If attribute with the same key already is set, it's value is overwritten.
  30803. *
  30804. * If the attribute value has changed, fires the {@link #event:change:range} event with
  30805. * the attribute key.
  30806. *
  30807. * @fires change:attribute
  30808. * @param {String} key Key of attribute to set.
  30809. * @param {*} value Attribute value.
  30810. */
  30811. setAttribute( key, value ) {
  30812. if ( this.getAttribute( key ) !== value ) {
  30813. this._attrs.set( key, value );
  30814. this.fire( 'change:attribute', { attributeKeys: [ key ], directChange: true } );
  30815. }
  30816. }
  30817. /**
  30818. * Returns the selected element. {@link module:engine/model/element~Element Element} is considered as selected if there is only
  30819. * one range in the selection, and that range contains exactly one element.
  30820. * Returns `null` if there is no selected element.
  30821. *
  30822. * @returns {module:engine/model/element~Element|null}
  30823. */
  30824. getSelectedElement() {
  30825. if ( this.rangeCount !== 1 ) {
  30826. return null;
  30827. }
  30828. return this.getFirstRange().getContainedElement();
  30829. }
  30830. /**
  30831. * Checks whether this object is of the given.
  30832. *
  30833. * selection.is( 'selection' ); // -> true
  30834. * selection.is( 'model:selection' ); // -> true
  30835. *
  30836. * selection.is( 'view:selection' ); // -> false
  30837. * selection.is( 'range' ); // -> false
  30838. *
  30839. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  30840. *
  30841. * @param {String} type
  30842. * @returns {Boolean}
  30843. */
  30844. is( type ) {
  30845. return type === 'selection' || type === 'model:selection';
  30846. }
  30847. /**
  30848. * Gets elements of type {@link module:engine/model/schema~Schema#isBlock "block"} touched by the selection.
  30849. *
  30850. * This method's result can be used for example to apply block styling to all blocks covered by this selection.
  30851. *
  30852. * **Note:** `getSelectedBlocks()` returns blocks that are nested in other non-block elements
  30853. * but will not return blocks nested in other blocks.
  30854. *
  30855. * In this case the function will return exactly all 3 paragraphs (note: `<blockQuote>` is not a block itself):
  30856. *
  30857. * <paragraph>[a</paragraph>
  30858. * <blockQuote>
  30859. * <paragraph>b</paragraph>
  30860. * </blockQuote>
  30861. * <paragraph>c]d</paragraph>
  30862. *
  30863. * In this case the paragraph will also be returned, despite the collapsed selection:
  30864. *
  30865. * <paragraph>[]a</paragraph>
  30866. *
  30867. * In such a scenario, however, only blocks A, B & E will be returned as blocks C & D are nested in block B:
  30868. *
  30869. * [<blockA></blockA>
  30870. * <blockB>
  30871. * <blockC></blockC>
  30872. * <blockD></blockD>
  30873. * </blockB>
  30874. * <blockE></blockE>]
  30875. *
  30876. * If the selection is inside a block all the inner blocks (A & B) are returned:
  30877. *
  30878. * <block>
  30879. * <blockA>[a</blockA>
  30880. * <blockB>b]</blockB>
  30881. * </block>
  30882. *
  30883. * **Special case**: If a selection ends at the beginning of a block, that block is not returned as from user perspective
  30884. * this block wasn't selected. See [#984](https://github.com/ckeditor/ckeditor5-engine/issues/984) for more details.
  30885. *
  30886. * <paragraph>[a</paragraph>
  30887. * <paragraph>b</paragraph>
  30888. * <paragraph>]c</paragraph> // this block will not be returned
  30889. *
  30890. * @returns {Iterable.<module:engine/model/element~Element>}
  30891. */
  30892. * getSelectedBlocks() {
  30893. const visited = new WeakSet();
  30894. for ( const range of this.getRanges() ) {
  30895. // Get start block of range in case of a collapsed range.
  30896. const startBlock = getParentBlock( range.start, visited );
  30897. if ( startBlock && isTopBlockInRange( startBlock, range ) ) {
  30898. yield startBlock;
  30899. }
  30900. for ( const value of range.getWalker() ) {
  30901. const block = value.item;
  30902. if ( value.type == 'elementEnd' && isUnvisitedTopBlock( block, visited, range ) ) {
  30903. yield block;
  30904. }
  30905. }
  30906. const endBlock = getParentBlock( range.end, visited );
  30907. // #984. Don't return the end block if the range ends right at its beginning.
  30908. if ( endBlock && !range.end.isTouching( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( endBlock, 0 ) ) && isTopBlockInRange( endBlock, range ) ) {
  30909. yield endBlock;
  30910. }
  30911. }
  30912. }
  30913. /**
  30914. * Checks whether the selection contains the entire content of the given element. This means that selection must start
  30915. * at a position {@link module:engine/model/position~Position#isTouching touching} the element's start and ends at position
  30916. * touching the element's end.
  30917. *
  30918. * By default, this method will check whether the entire content of the selection's current root is selected.
  30919. * Useful to check if e.g. the user has just pressed <kbd>Ctrl</kbd> + <kbd>A</kbd>.
  30920. *
  30921. * @param {module:engine/model/element~Element} [element=this.anchor.root]
  30922. * @returns {Boolean}
  30923. */
  30924. containsEntireContent( element = this.anchor.root ) {
  30925. const limitStartPosition = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, 0 );
  30926. const limitEndPosition = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, 'end' );
  30927. return limitStartPosition.isTouching( this.getFirstPosition() ) &&
  30928. limitEndPosition.isTouching( this.getLastPosition() );
  30929. }
  30930. /**
  30931. * Adds given range to internal {@link #_ranges ranges array}. Throws an error
  30932. * if given range is intersecting with any range that is already stored in this selection.
  30933. *
  30934. * @protected
  30935. * @param {module:engine/model/range~Range} range Range to add.
  30936. */
  30937. _pushRange( range ) {
  30938. this._checkRange( range );
  30939. this._ranges.push( new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( range.start, range.end ) );
  30940. }
  30941. /**
  30942. * Checks if given range intersects with ranges that are already in the selection. Throws an error if it does.
  30943. *
  30944. * @protected
  30945. * @param {module:engine/model/range~Range} range Range to check.
  30946. */
  30947. _checkRange( range ) {
  30948. for ( let i = 0; i < this._ranges.length; i++ ) {
  30949. if ( range.isIntersecting( this._ranges[ i ] ) ) {
  30950. /**
  30951. * Trying to add a range that intersects with another range in the selection.
  30952. *
  30953. * @error model-selection-range-intersects
  30954. * @param {module:engine/model/range~Range} addedRange Range that was added to the selection.
  30955. * @param {module:engine/model/range~Range} intersectingRange Range in the selection that intersects with `addedRange`.
  30956. */
  30957. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  30958. 'model-selection-range-intersects',
  30959. [ this, range ],
  30960. { addedRange: range, intersectingRange: this._ranges[ i ] }
  30961. );
  30962. }
  30963. }
  30964. }
  30965. /**
  30966. * Deletes ranges from internal range array. Uses {@link #_popRange _popRange} to
  30967. * ensure proper ranges removal.
  30968. *
  30969. * @protected
  30970. */
  30971. _removeAllRanges() {
  30972. while ( this._ranges.length > 0 ) {
  30973. this._popRange();
  30974. }
  30975. }
  30976. /**
  30977. * Removes most recently added range from the selection.
  30978. *
  30979. * @protected
  30980. */
  30981. _popRange() {
  30982. this._ranges.pop();
  30983. }
  30984. /**
  30985. * Fired when selection range(s) changed.
  30986. *
  30987. * @event change:range
  30988. * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set
  30989. * to `true` which indicates that the selection change was caused by a direct use of selection's API.
  30990. * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its position
  30991. * was directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was
  30992. * changed because the structure of the model has been changed (which means an indirect change).
  30993. * The indirect change does not occur in case of normal (detached) selections because they are "static" (as "not live")
  30994. * which mean that they are not updated once the document changes.
  30995. */
  30996. /**
  30997. * Fired when selection attribute changed.
  30998. *
  30999. * @event change:attribute
  31000. * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set
  31001. * to `true` which indicates that the selection change was caused by a direct use of selection's API.
  31002. * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its attributes
  31003. * were directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was
  31004. * changed in the model and its attributes were refreshed (which means an indirect change).
  31005. * The indirect change does not occur in case of normal (detached) selections because they are "static" (as "not live")
  31006. * which mean that they are not updated once the document changes.
  31007. * @param {Array.<String>} attributeKeys Array containing keys of attributes that changed.
  31008. */
  31009. }
  31010. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__["default"])( Selection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  31011. // Checks whether the given element extends $block in the schema and has a parent (is not a root).
  31012. // Marks it as already visited.
  31013. function isUnvisitedBlock( element, visited ) {
  31014. if ( visited.has( element ) ) {
  31015. return false;
  31016. }
  31017. visited.add( element );
  31018. return element.root.document.model.schema.isBlock( element ) && element.parent;
  31019. }
  31020. // Checks if the given element is a $block was not previously visited and is a top block in a range.
  31021. function isUnvisitedTopBlock( element, visited, range ) {
  31022. return isUnvisitedBlock( element, visited ) && isTopBlockInRange( element, range );
  31023. }
  31024. // Finds the lowest element in position's ancestors which is a block.
  31025. // It will search until first ancestor that is a limit element.
  31026. // Marks all ancestors as already visited to not include any of them later on.
  31027. function getParentBlock( position, visited ) {
  31028. const element = position.parent;
  31029. const schema = element.root.document.model.schema;
  31030. const ancestors = position.parent.getAncestors( { parentFirst: true, includeSelf: true } );
  31031. let hasParentLimit = false;
  31032. const block = ancestors.find( element => {
  31033. // Stop searching after first parent node that is limit element.
  31034. if ( hasParentLimit ) {
  31035. return false;
  31036. }
  31037. hasParentLimit = schema.isLimit( element );
  31038. return !hasParentLimit && isUnvisitedBlock( element, visited );
  31039. } );
  31040. // Mark all ancestors of this position's parent, because find() might've stopped early and
  31041. // the found block may be a child of another block.
  31042. ancestors.forEach( element => visited.add( element ) );
  31043. return block;
  31044. }
  31045. // Checks if the blocks is not nested in other block inside a range.
  31046. //
  31047. // @param {module:engine/model/element~Element} block Block to check.
  31048. // @param {module:engine/model/range~Range} range Range to check.
  31049. function isTopBlockInRange( block, range ) {
  31050. const parentBlock = findAncestorBlock( block );
  31051. if ( !parentBlock ) {
  31052. return true;
  31053. }
  31054. // Add loose flag to check as parentRange can be equal to range.
  31055. const isParentInRange = range.containsRange( _range__WEBPACK_IMPORTED_MODULE_2__["default"]._createOn( parentBlock ), true );
  31056. return !isParentInRange;
  31057. }
  31058. // Returns first ancestor block of a node.
  31059. //
  31060. // @param {module:engine/model/node~Node} node
  31061. // @returns {module:engine/model/node~Node|undefined}
  31062. function findAncestorBlock( node ) {
  31063. const schema = node.root.document.model.schema;
  31064. let parent = node.parent;
  31065. while ( parent ) {
  31066. if ( schema.isBlock( parent ) ) {
  31067. return parent;
  31068. }
  31069. parent = parent.parent;
  31070. }
  31071. }
  31072. /**
  31073. * An entity that is used to set selection.
  31074. *
  31075. * See also {@link module:engine/model/selection~Selection#setTo}
  31076. *
  31077. * @typedef {
  31078. * module:engine/model/selection~Selection|
  31079. * module:engine/model/documentselection~DocumentSelection|
  31080. * module:engine/model/position~Position|
  31081. * module:engine/model/range~Range|
  31082. * module:engine/model/node~Node|
  31083. * Iterable.<module:engine/model/range~Range>|
  31084. * null
  31085. * } module:engine/model/selection~Selectable
  31086. */
  31087. /***/ }),
  31088. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js":
  31089. /*!*******************************************************************!*\
  31090. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js ***!
  31091. \*******************************************************************/
  31092. /*! exports provided: default */
  31093. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31094. "use strict";
  31095. __webpack_require__.r(__webpack_exports__);
  31096. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Text; });
  31097. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
  31098. /**
  31099. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  31100. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  31101. */
  31102. /**
  31103. * @module engine/model/text
  31104. */
  31105. // @if CK_DEBUG_ENGINE // const { convertMapToStringifiedObject } = require( '../dev-utils/utils' );
  31106. /**
  31107. * Model text node. Type of {@link module:engine/model/node~Node node} that contains {@link module:engine/model/text~Text#data text data}.
  31108. *
  31109. * **Important:** see {@link module:engine/model/node~Node} to read about restrictions using `Text` and `Node` API.
  31110. *
  31111. * **Note:** keep in mind that `Text` instances might indirectly got removed from model tree when model is changed.
  31112. * This happens when {@link module:engine/model/writer~Writer model writer} is used to change model and the text node is merged with
  31113. * another text node. Then, both text nodes are removed and a new text node is inserted into the model. Because of
  31114. * this behavior, keeping references to `Text` is not recommended. Instead, consider creating
  31115. * {@link module:engine/model/liveposition~LivePosition live position} placed before the text node.
  31116. *
  31117. * @extends module:engine/model/node~Node
  31118. */
  31119. class Text extends _node__WEBPACK_IMPORTED_MODULE_0__["default"] {
  31120. /**
  31121. * Creates a text node.
  31122. *
  31123. * **Note:** Constructor of this class shouldn't be used directly in the code.
  31124. * Use the {@link module:engine/model/writer~Writer#createText} method instead.
  31125. *
  31126. * @protected
  31127. * @param {String} data Node's text.
  31128. * @param {Object} [attrs] Node's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.
  31129. */
  31130. constructor( data, attrs ) {
  31131. super( attrs );
  31132. /**
  31133. * Text data contained in this text node.
  31134. *
  31135. * @protected
  31136. * @type {String}
  31137. */
  31138. this._data = data || '';
  31139. }
  31140. /**
  31141. * @inheritDoc
  31142. */
  31143. get offsetSize() {
  31144. return this.data.length;
  31145. }
  31146. /**
  31147. * Returns a text data contained in the node.
  31148. *
  31149. * @readonly
  31150. * @type {String}
  31151. */
  31152. get data() {
  31153. return this._data;
  31154. }
  31155. /**
  31156. * Checks whether this object is of the given.
  31157. *
  31158. * text.is( '$text' ); // -> true
  31159. * text.is( 'node' ); // -> true
  31160. * text.is( 'model:$text' ); // -> true
  31161. * text.is( 'model:node' ); // -> true
  31162. *
  31163. * text.is( 'view:$text' ); // -> false
  31164. * text.is( 'documentSelection' ); // -> false
  31165. *
  31166. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  31167. *
  31168. * **Note:** Until version 20.0.0 this method wasn't accepting `'$text'` type. The legacy `'text'` type is still
  31169. * accepted for backward compatibility.
  31170. *
  31171. * @param {String} type Type to check.
  31172. * @returns {Boolean}
  31173. */
  31174. is( type ) {
  31175. return type === '$text' || type === 'model:$text' ||
  31176. // This are legacy values kept for backward compatibility.
  31177. type === 'text' || type === 'model:text' ||
  31178. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  31179. type === 'node' || type === 'model:node';
  31180. }
  31181. /**
  31182. * Converts `Text` instance to plain object and returns it.
  31183. *
  31184. * @returns {Object} `Text` instance converted to plain object.
  31185. */
  31186. toJSON() {
  31187. const json = super.toJSON();
  31188. json.data = this.data;
  31189. return json;
  31190. }
  31191. /**
  31192. * Creates a copy of this text node and returns it. Created text node has same text data and attributes as original text node.
  31193. *
  31194. * @protected
  31195. * @returns {module:engine/model/text~Text} `Text` instance created using given plain object.
  31196. */
  31197. _clone() {
  31198. return new Text( this.data, this.getAttributes() );
  31199. }
  31200. /**
  31201. * Creates a `Text` instance from given plain object (i.e. parsed JSON string).
  31202. *
  31203. * @param {Object} json Plain object to be converted to `Text`.
  31204. * @returns {module:engine/model/text~Text} `Text` instance created using given plain object.
  31205. */
  31206. static fromJSON( json ) {
  31207. return new Text( json.data, json.attributes );
  31208. }
  31209. // @if CK_DEBUG_ENGINE // toString() {
  31210. // @if CK_DEBUG_ENGINE // return `#${ this.data }`;
  31211. // @if CK_DEBUG_ENGINE // }
  31212. // @if CK_DEBUG_ENGINE // logExtended() {
  31213. // @if CK_DEBUG_ENGINE // console.log( `ModelText: ${ this }, attrs: ${ convertMapToStringifiedObject( this.getAttributes() ) }` );
  31214. // @if CK_DEBUG_ENGINE // }
  31215. // @if CK_DEBUG_ENGINE // log() {
  31216. // @if CK_DEBUG_ENGINE // console.log( 'ModelText: ' + this );
  31217. // @if CK_DEBUG_ENGINE // }
  31218. }
  31219. /***/ }),
  31220. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js":
  31221. /*!************************************************************************!*\
  31222. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js ***!
  31223. \************************************************************************/
  31224. /*! exports provided: default */
  31225. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31226. "use strict";
  31227. __webpack_require__.r(__webpack_exports__);
  31228. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextProxy; });
  31229. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  31230. /**
  31231. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  31232. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  31233. */
  31234. /**
  31235. * @module engine/model/textproxy
  31236. */
  31237. // @if CK_DEBUG_ENGINE // const { convertMapToStringifiedObject } = require( '../dev-utils/utils' );
  31238. /**
  31239. * `TextProxy` represents a part of {@link module:engine/model/text~Text text node}.
  31240. *
  31241. * Since {@link module:engine/model/position~Position positions} can be placed between characters of a text node,
  31242. * {@link module:engine/model/range~Range ranges} may contain only parts of text nodes. When {@link module:engine/model/range~Range#getItems
  31243. * getting items}
  31244. * contained in such range, we need to represent a part of that text node, since returning the whole text node would be incorrect.
  31245. * `TextProxy` solves this issue.
  31246. *
  31247. * `TextProxy` has an API similar to {@link module:engine/model/text~Text Text} and allows to do most of the common tasks performed
  31248. * on model nodes.
  31249. *
  31250. * **Note:** Some `TextProxy` instances may represent whole text node, not just a part of it.
  31251. * See {@link module:engine/model/textproxy~TextProxy#isPartial}.
  31252. *
  31253. * **Note:** `TextProxy` is not an instance of {@link module:engine/model/node~Node node}. Keep this in mind when using it as a
  31254. * parameter of methods.
  31255. *
  31256. * **Note:** `TextProxy` is a readonly interface. If you want to perform changes on model data represented by a `TextProxy`
  31257. * use {@link module:engine/model/writer~Writer model writer API}.
  31258. *
  31259. * **Note:** `TextProxy` instances are created on the fly, basing on the current state of model. Because of this, it is
  31260. * highly unrecommended to store references to `TextProxy` instances. `TextProxy` instances are not refreshed when
  31261. * model changes, so they might get invalidated. Instead, consider creating {@link module:engine/model/liveposition~LivePosition live
  31262. * position}.
  31263. *
  31264. * `TextProxy` instances are created by {@link module:engine/model/treewalker~TreeWalker model tree walker}. You should not need to create
  31265. * an instance of this class by your own.
  31266. */
  31267. class TextProxy {
  31268. /**
  31269. * Creates a text proxy.
  31270. *
  31271. * @protected
  31272. * @param {module:engine/model/text~Text} textNode Text node which part is represented by this text proxy.
  31273. * @param {Number} offsetInText Offset in {@link module:engine/model/textproxy~TextProxy#textNode text node} from which the text proxy
  31274. * starts.
  31275. * @param {Number} length Text proxy length, that is how many text node's characters, starting from `offsetInText` it represents.
  31276. * @constructor
  31277. */
  31278. constructor( textNode, offsetInText, length ) {
  31279. /**
  31280. * Text node which part is represented by this text proxy.
  31281. *
  31282. * @readonly
  31283. * @member {module:engine/model/text~Text}
  31284. */
  31285. this.textNode = textNode;
  31286. if ( offsetInText < 0 || offsetInText > textNode.offsetSize ) {
  31287. /**
  31288. * Given `offsetInText` value is incorrect.
  31289. *
  31290. * @error model-textproxy-wrong-offsetintext
  31291. */
  31292. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'model-textproxy-wrong-offsetintext', this );
  31293. }
  31294. if ( length < 0 || offsetInText + length > textNode.offsetSize ) {
  31295. /**
  31296. * Given `length` value is incorrect.
  31297. *
  31298. * @error model-textproxy-wrong-length
  31299. */
  31300. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'model-textproxy-wrong-length', this );
  31301. }
  31302. /**
  31303. * Text data represented by this text proxy.
  31304. *
  31305. * @readonly
  31306. * @member {String}
  31307. */
  31308. this.data = textNode.data.substring( offsetInText, offsetInText + length );
  31309. /**
  31310. * Offset in {@link module:engine/model/textproxy~TextProxy#textNode text node} from which the text proxy starts.
  31311. *
  31312. * @readonly
  31313. * @member {Number}
  31314. */
  31315. this.offsetInText = offsetInText;
  31316. }
  31317. /**
  31318. * Offset at which this text proxy starts in it's parent.
  31319. *
  31320. * @see module:engine/model/node~Node#startOffset
  31321. * @readonly
  31322. * @type {Number}
  31323. */
  31324. get startOffset() {
  31325. return this.textNode.startOffset !== null ? this.textNode.startOffset + this.offsetInText : null;
  31326. }
  31327. /**
  31328. * Offset size of this text proxy. Equal to the number of characters represented by the text proxy.
  31329. *
  31330. * @see module:engine/model/node~Node#offsetSize
  31331. * @readonly
  31332. * @type {Number}
  31333. */
  31334. get offsetSize() {
  31335. return this.data.length;
  31336. }
  31337. /**
  31338. * Offset at which this text proxy ends in it's parent.
  31339. *
  31340. * @see module:engine/model/node~Node#endOffset
  31341. * @readonly
  31342. * @type {Number}
  31343. */
  31344. get endOffset() {
  31345. return this.startOffset !== null ? this.startOffset + this.offsetSize : null;
  31346. }
  31347. /**
  31348. * Flag indicating whether `TextProxy` instance covers only part of the original {@link module:engine/model/text~Text text node}
  31349. * (`true`) or the whole text node (`false`).
  31350. *
  31351. * This is `false` when text proxy starts at the very beginning of {@link module:engine/model/textproxy~TextProxy#textNode textNode}
  31352. * ({@link module:engine/model/textproxy~TextProxy#offsetInText offsetInText} equals `0`) and text proxy sizes is equal to
  31353. * text node size.
  31354. *
  31355. * @readonly
  31356. * @type {Boolean}
  31357. */
  31358. get isPartial() {
  31359. return this.offsetSize !== this.textNode.offsetSize;
  31360. }
  31361. /**
  31362. * Parent of this text proxy, which is same as parent of text node represented by this text proxy.
  31363. *
  31364. * @readonly
  31365. * @type {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
  31366. */
  31367. get parent() {
  31368. return this.textNode.parent;
  31369. }
  31370. /**
  31371. * Root of this text proxy, which is same as root of text node represented by this text proxy.
  31372. *
  31373. * @readonly
  31374. * @type {module:engine/model/node~Node|module:engine/model/documentfragment~DocumentFragment}
  31375. */
  31376. get root() {
  31377. return this.textNode.root;
  31378. }
  31379. /**
  31380. * Checks whether this object is of the given.
  31381. *
  31382. * textProxy.is( '$textProxy' ); // -> true
  31383. * textProxy.is( 'model:$textProxy' ); // -> true
  31384. *
  31385. * textProxy.is( 'view:$textProxy' ); // -> false
  31386. * textProxy.is( 'range' ); // -> false
  31387. *
  31388. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  31389. *
  31390. * **Note:** Until version 20.0.0 this method wasn't accepting `'$textProxy'` type. The legacy `'textProxt'` type is still
  31391. * accepted for backward compatibility.
  31392. *
  31393. * @param {String} type Type to check.
  31394. * @returns {Boolean}
  31395. */
  31396. is( type ) {
  31397. return type === '$textProxy' || type === 'model:$textProxy' ||
  31398. // This are legacy values kept for backward compatibility.
  31399. type === 'textProxy' || type === 'model:textProxy';
  31400. }
  31401. /**
  31402. * Gets path to this text proxy.
  31403. *
  31404. * @see module:engine/model/node~Node#getPath
  31405. * @returns {Array.<Number>}
  31406. */
  31407. getPath() {
  31408. const path = this.textNode.getPath();
  31409. if ( path.length > 0 ) {
  31410. path[ path.length - 1 ] += this.offsetInText;
  31411. }
  31412. return path;
  31413. }
  31414. /**
  31415. * Returns ancestors array of this text proxy.
  31416. *
  31417. * @param {Object} options Options object.
  31418. * @param {Boolean} [options.includeSelf=false] When set to `true` this text proxy will be also included in parent's array.
  31419. * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from text proxy parent to root element,
  31420. * otherwise root element will be the first item in the array.
  31421. * @returns {Array} Array with ancestors.
  31422. */
  31423. getAncestors( options = { includeSelf: false, parentFirst: false } ) {
  31424. const ancestors = [];
  31425. let parent = options.includeSelf ? this : this.parent;
  31426. while ( parent ) {
  31427. ancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );
  31428. parent = parent.parent;
  31429. }
  31430. return ancestors;
  31431. }
  31432. /**
  31433. * Checks if this text proxy has an attribute for given key.
  31434. *
  31435. * @param {String} key Key of attribute to check.
  31436. * @returns {Boolean} `true` if attribute with given key is set on text proxy, `false` otherwise.
  31437. */
  31438. hasAttribute( key ) {
  31439. return this.textNode.hasAttribute( key );
  31440. }
  31441. /**
  31442. * Gets an attribute value for given key or `undefined` if that attribute is not set on text proxy.
  31443. *
  31444. * @param {String} key Key of attribute to look for.
  31445. * @returns {*} Attribute value or `undefined`.
  31446. */
  31447. getAttribute( key ) {
  31448. return this.textNode.getAttribute( key );
  31449. }
  31450. /**
  31451. * Returns iterator that iterates over this node's attributes. Attributes are returned as arrays containing two
  31452. * items. First one is attribute key and second is attribute value.
  31453. *
  31454. * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
  31455. *
  31456. * @returns {Iterable.<*>}
  31457. */
  31458. getAttributes() {
  31459. return this.textNode.getAttributes();
  31460. }
  31461. /**
  31462. * Returns iterator that iterates over this node's attribute keys.
  31463. *
  31464. * @returns {Iterable.<String>}
  31465. */
  31466. getAttributeKeys() {
  31467. return this.textNode.getAttributeKeys();
  31468. }
  31469. // @if CK_DEBUG_ENGINE // toString() {
  31470. // @if CK_DEBUG_ENGINE // return `#${ this.data }`;
  31471. // @if CK_DEBUG_ENGINE // }
  31472. // @if CK_DEBUG_ENGINE // log() {
  31473. // @if CK_DEBUG_ENGINE // console.log( 'ModelTextProxy: ' + this );
  31474. // @if CK_DEBUG_ENGINE // }
  31475. // @if CK_DEBUG_ENGINE // logExtended() {
  31476. // @if CK_DEBUG_ENGINE // console.log( `ModelTextProxy: ${ this }, ` +
  31477. // @if CK_DEBUG_ENGINE // `attrs: ${ convertMapToStringifiedObject( this.getAttributes() ) }` );
  31478. // @if CK_DEBUG_ENGINE // }
  31479. }
  31480. /***/ }),
  31481. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js":
  31482. /*!*************************************************************************!*\
  31483. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js ***!
  31484. \*************************************************************************/
  31485. /*! exports provided: default */
  31486. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31487. "use strict";
  31488. __webpack_require__.r(__webpack_exports__);
  31489. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TreeWalker; });
  31490. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  31491. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  31492. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  31493. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  31494. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  31495. /**
  31496. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  31497. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  31498. */
  31499. /**
  31500. * @module engine/model/treewalker
  31501. */
  31502. /**
  31503. * Position iterator class. It allows to iterate forward and backward over the document.
  31504. */
  31505. class TreeWalker {
  31506. /**
  31507. * Creates a range iterator. All parameters are optional, but you have to specify either `boundaries` or `startPosition`.
  31508. *
  31509. * @constructor
  31510. * @param {Object} [options={}] Object with configuration.
  31511. * @param {'forward'|'backward'} [options.direction='forward'] Walking direction.
  31512. * @param {module:engine/model/range~Range} [options.boundaries=null] Range to define boundaries of the iterator.
  31513. * @param {module:engine/model/position~Position} [options.startPosition] Starting position.
  31514. * @param {Boolean} [options.singleCharacters=false] Flag indicating whether all consecutive characters with the same attributes
  31515. * should be returned one by one as multiple {@link module:engine/model/textproxy~TextProxy} (`true`) objects or as one
  31516. * {@link module:engine/model/textproxy~TextProxy} (`false`).
  31517. * @param {Boolean} [options.shallow=false] Flag indicating whether iterator should enter elements or not. If the
  31518. * iterator is shallow child nodes of any iterated node will not be returned along with `elementEnd` tag.
  31519. * @param {Boolean} [options.ignoreElementEnd=false] Flag indicating whether iterator should ignore `elementEnd`
  31520. * tags. If the option is true walker will not return a parent node of start position. If this option is `true`
  31521. * each {@link module:engine/model/element~Element} will be returned once, while if the option is `false` they might be returned
  31522. * twice: for `'elementStart'` and `'elementEnd'`.
  31523. */
  31524. constructor( options = {} ) {
  31525. if ( !options.boundaries && !options.startPosition ) {
  31526. /**
  31527. * Neither boundaries nor starting position of a `TreeWalker` have been defined.
  31528. *
  31529. * @error model-tree-walker-no-start-position
  31530. */
  31531. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  31532. 'model-tree-walker-no-start-position',
  31533. null
  31534. );
  31535. }
  31536. const direction = options.direction || 'forward';
  31537. if ( direction != 'forward' && direction != 'backward' ) {
  31538. /**
  31539. * Only `backward` and `forward` direction allowed.
  31540. *
  31541. * @error model-tree-walker-unknown-direction
  31542. */
  31543. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'model-tree-walker-unknown-direction', options, { direction } );
  31544. }
  31545. /**
  31546. * Walking direction. Defaults `'forward'`.
  31547. *
  31548. * @readonly
  31549. * @member {'backward'|'forward'} module:engine/model/treewalker~TreeWalker#direction
  31550. */
  31551. this.direction = direction;
  31552. /**
  31553. * Iterator boundaries.
  31554. *
  31555. * When the iterator is walking `'forward'` on the end of boundary or is walking `'backward'`
  31556. * on the start of boundary, then `{ done: true }` is returned.
  31557. *
  31558. * If boundaries are not defined they are set before first and after last child of the root node.
  31559. *
  31560. * @readonly
  31561. * @member {module:engine/model/range~Range} module:engine/model/treewalker~TreeWalker#boundaries
  31562. */
  31563. this.boundaries = options.boundaries || null;
  31564. /**
  31565. * Iterator position. This is always static position, even if the initial position was a
  31566. * {@link module:engine/model/liveposition~LivePosition live position}. If start position is not defined then position depends
  31567. * on {@link #direction}. If direction is `'forward'` position starts form the beginning, when direction
  31568. * is `'backward'` position starts from the end.
  31569. *
  31570. * @readonly
  31571. * @member {module:engine/model/position~Position} module:engine/model/treewalker~TreeWalker#position
  31572. */
  31573. if ( options.startPosition ) {
  31574. this.position = options.startPosition.clone();
  31575. } else {
  31576. this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAt( this.boundaries[ this.direction == 'backward' ? 'end' : 'start' ] );
  31577. }
  31578. // Reset position stickiness in case it was set to other value, as the stickiness is kept after cloning.
  31579. this.position.stickiness = 'toNone';
  31580. /**
  31581. * Flag indicating whether all consecutive characters with the same attributes should be
  31582. * returned as one {@link module:engine/model/textproxy~TextProxy} (`true`) or one by one (`false`).
  31583. *
  31584. * @readonly
  31585. * @member {Boolean} module:engine/model/treewalker~TreeWalker#singleCharacters
  31586. */
  31587. this.singleCharacters = !!options.singleCharacters;
  31588. /**
  31589. * Flag indicating whether iterator should enter elements or not. If the iterator is shallow child nodes of any
  31590. * iterated node will not be returned along with `elementEnd` tag.
  31591. *
  31592. * @readonly
  31593. * @member {Boolean} module:engine/model/treewalker~TreeWalker#shallow
  31594. */
  31595. this.shallow = !!options.shallow;
  31596. /**
  31597. * Flag indicating whether iterator should ignore `elementEnd` tags. If the option is true walker will not
  31598. * return a parent node of the start position. If this option is `true` each {@link module:engine/model/element~Element} will
  31599. * be returned once, while if the option is `false` they might be returned twice:
  31600. * for `'elementStart'` and `'elementEnd'`.
  31601. *
  31602. * @readonly
  31603. * @member {Boolean} module:engine/model/treewalker~TreeWalker#ignoreElementEnd
  31604. */
  31605. this.ignoreElementEnd = !!options.ignoreElementEnd;
  31606. /**
  31607. * Start boundary cached for optimization purposes.
  31608. *
  31609. * @private
  31610. * @member {module:engine/model/element~Element} module:engine/model/treewalker~TreeWalker#_boundaryStartParent
  31611. */
  31612. this._boundaryStartParent = this.boundaries ? this.boundaries.start.parent : null;
  31613. /**
  31614. * End boundary cached for optimization purposes.
  31615. *
  31616. * @private
  31617. * @member {module:engine/model/element~Element} module:engine/model/treewalker~TreeWalker#_boundaryEndParent
  31618. */
  31619. this._boundaryEndParent = this.boundaries ? this.boundaries.end.parent : null;
  31620. /**
  31621. * Parent of the most recently visited node. Cached for optimization purposes.
  31622. *
  31623. * @private
  31624. * @member {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}
  31625. * module:engine/model/treewalker~TreeWalker#_visitedParent
  31626. */
  31627. this._visitedParent = this.position.parent;
  31628. }
  31629. /**
  31630. * Iterable interface.
  31631. *
  31632. * @returns {Iterable.<module:engine/model/treewalker~TreeWalkerValue>}
  31633. */
  31634. [ Symbol.iterator ]() {
  31635. return this;
  31636. }
  31637. /**
  31638. * Moves {@link #position} in the {@link #direction} skipping values as long as the callback function returns `true`.
  31639. *
  31640. * For example:
  31641. *
  31642. * walker.skip( value => value.type == 'text' ); // <paragraph>[]foo</paragraph> -> <paragraph>foo[]</paragraph>
  31643. * walker.skip( () => true ); // Move the position to the end: <paragraph>[]foo</paragraph> -> <paragraph>foo</paragraph>[]
  31644. * walker.skip( () => false ); // Do not move the position.
  31645. *
  31646. * @param {Function} skip Callback function. Gets {@link module:engine/model/treewalker~TreeWalkerValue} and should
  31647. * return `true` if the value should be skipped or `false` if not.
  31648. */
  31649. skip( skip ) {
  31650. let done, value, prevPosition, prevVisitedParent;
  31651. do {
  31652. prevPosition = this.position;
  31653. prevVisitedParent = this._visitedParent;
  31654. ( { done, value } = this.next() );
  31655. } while ( !done && skip( value ) );
  31656. if ( !done ) {
  31657. this.position = prevPosition;
  31658. this._visitedParent = prevVisitedParent;
  31659. }
  31660. }
  31661. /**
  31662. * Gets the next tree walker's value.
  31663. *
  31664. * @returns {module:engine/model/treewalker~TreeWalkerValue} Next tree walker's value.
  31665. */
  31666. next() {
  31667. if ( this.direction == 'forward' ) {
  31668. return this._next();
  31669. } else {
  31670. return this._previous();
  31671. }
  31672. }
  31673. /**
  31674. * Makes a step forward in model. Moves the {@link #position} to the next position and returns the encountered value.
  31675. *
  31676. * @private
  31677. * @returns {Object}
  31678. * @returns {Boolean} return.done True if iterator is done.
  31679. * @returns {module:engine/model/treewalker~TreeWalkerValue} return.value Information about taken step.
  31680. */
  31681. _next() {
  31682. const previousPosition = this.position;
  31683. const position = this.position.clone();
  31684. const parent = this._visitedParent;
  31685. // We are at the end of the root.
  31686. if ( parent.parent === null && position.offset === parent.maxOffset ) {
  31687. return { done: true };
  31688. }
  31689. // We reached the walker boundary.
  31690. if ( parent === this._boundaryEndParent && position.offset == this.boundaries.end.offset ) {
  31691. return { done: true };
  31692. }
  31693. // Get node just after the current position.
  31694. // Use a highly optimized version instead of checking the text node first and then getting the node after. See #6582.
  31695. const positionParent = position.parent;
  31696. const textNodeAtPosition = Object(_position__WEBPACK_IMPORTED_MODULE_3__["getTextNodeAtPosition"])( position, positionParent );
  31697. const node = textNodeAtPosition ? textNodeAtPosition : Object(_position__WEBPACK_IMPORTED_MODULE_3__["getNodeAfterPosition"])( position, positionParent, textNodeAtPosition );
  31698. if ( node instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  31699. if ( !this.shallow ) {
  31700. // Manual operations on path internals for optimization purposes. Here and in the rest of the method.
  31701. position.path.push( 0 );
  31702. this._visitedParent = node;
  31703. } else {
  31704. position.offset++;
  31705. }
  31706. this.position = position;
  31707. return formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
  31708. } else if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  31709. let charactersCount;
  31710. if ( this.singleCharacters ) {
  31711. charactersCount = 1;
  31712. } else {
  31713. let offset = node.endOffset;
  31714. if ( this._boundaryEndParent == parent && this.boundaries.end.offset < offset ) {
  31715. offset = this.boundaries.end.offset;
  31716. }
  31717. charactersCount = offset - position.offset;
  31718. }
  31719. const offsetInTextNode = position.offset - node.startOffset;
  31720. const item = new _textproxy__WEBPACK_IMPORTED_MODULE_1__["default"]( node, offsetInTextNode, charactersCount );
  31721. position.offset += charactersCount;
  31722. this.position = position;
  31723. return formatReturnValue( 'text', item, previousPosition, position, charactersCount );
  31724. } else {
  31725. // `node` is not set, we reached the end of current `parent`.
  31726. position.path.pop();
  31727. position.offset++;
  31728. this.position = position;
  31729. this._visitedParent = parent.parent;
  31730. if ( this.ignoreElementEnd ) {
  31731. return this._next();
  31732. } else {
  31733. return formatReturnValue( 'elementEnd', parent, previousPosition, position );
  31734. }
  31735. }
  31736. }
  31737. /**
  31738. * Makes a step backward in model. Moves the {@link #position} to the previous position and returns the encountered value.
  31739. *
  31740. * @private
  31741. * @returns {Object}
  31742. * @returns {Boolean} return.done True if iterator is done.
  31743. * @returns {module:engine/model/treewalker~TreeWalkerValue} return.value Information about taken step.
  31744. */
  31745. _previous() {
  31746. const previousPosition = this.position;
  31747. const position = this.position.clone();
  31748. const parent = this._visitedParent;
  31749. // We are at the beginning of the root.
  31750. if ( parent.parent === null && position.offset === 0 ) {
  31751. return { done: true };
  31752. }
  31753. // We reached the walker boundary.
  31754. if ( parent == this._boundaryStartParent && position.offset == this.boundaries.start.offset ) {
  31755. return { done: true };
  31756. }
  31757. // Get node just before the current position.
  31758. // Use a highly optimized version instead of checking the text node first and then getting the node before. See #6582.
  31759. const positionParent = position.parent;
  31760. const textNodeAtPosition = Object(_position__WEBPACK_IMPORTED_MODULE_3__["getTextNodeAtPosition"])( position, positionParent );
  31761. const node = textNodeAtPosition ? textNodeAtPosition : Object(_position__WEBPACK_IMPORTED_MODULE_3__["getNodeBeforePosition"])( position, positionParent, textNodeAtPosition );
  31762. if ( node instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  31763. position.offset--;
  31764. if ( !this.shallow ) {
  31765. position.path.push( node.maxOffset );
  31766. this.position = position;
  31767. this._visitedParent = node;
  31768. if ( this.ignoreElementEnd ) {
  31769. return this._previous();
  31770. } else {
  31771. return formatReturnValue( 'elementEnd', node, previousPosition, position );
  31772. }
  31773. } else {
  31774. this.position = position;
  31775. return formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
  31776. }
  31777. } else if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  31778. let charactersCount;
  31779. if ( this.singleCharacters ) {
  31780. charactersCount = 1;
  31781. } else {
  31782. let offset = node.startOffset;
  31783. if ( this._boundaryStartParent == parent && this.boundaries.start.offset > offset ) {
  31784. offset = this.boundaries.start.offset;
  31785. }
  31786. charactersCount = position.offset - offset;
  31787. }
  31788. const offsetInTextNode = position.offset - node.startOffset;
  31789. const item = new _textproxy__WEBPACK_IMPORTED_MODULE_1__["default"]( node, offsetInTextNode - charactersCount, charactersCount );
  31790. position.offset -= charactersCount;
  31791. this.position = position;
  31792. return formatReturnValue( 'text', item, previousPosition, position, charactersCount );
  31793. } else {
  31794. // `node` is not set, we reached the beginning of current `parent`.
  31795. position.path.pop();
  31796. this.position = position;
  31797. this._visitedParent = parent.parent;
  31798. return formatReturnValue( 'elementStart', parent, previousPosition, position, 1 );
  31799. }
  31800. }
  31801. }
  31802. function formatReturnValue( type, item, previousPosition, nextPosition, length ) {
  31803. return {
  31804. done: false,
  31805. value: {
  31806. type,
  31807. item,
  31808. previousPosition,
  31809. nextPosition,
  31810. length
  31811. }
  31812. };
  31813. }
  31814. /**
  31815. * Type of the step made by {@link module:engine/model/treewalker~TreeWalker}.
  31816. * Possible values: `'elementStart'` if walker is at the beginning of a node, `'elementEnd'` if walker is at the end of node,
  31817. * or `'text'` if walker traversed over text.
  31818. *
  31819. * @typedef {'elementStart'|'elementEnd'|'text'} module:engine/model/treewalker~TreeWalkerValueType
  31820. */
  31821. /**
  31822. * Object returned by {@link module:engine/model/treewalker~TreeWalker} when traversing tree model.
  31823. *
  31824. * @typedef {Object} module:engine/model/treewalker~TreeWalkerValue
  31825. * @property {module:engine/model/treewalker~TreeWalkerValueType} type
  31826. * @property {module:engine/model/item~Item} item Item between old and new positions of {@link module:engine/model/treewalker~TreeWalker}.
  31827. * @property {module:engine/model/position~Position} previousPosition Previous position of the iterator.
  31828. * * Forward iteration: For `'elementEnd'` it is the last position inside the element. For all other types it is the
  31829. * position before the item.
  31830. * * Backward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
  31831. * the position after item.
  31832. * @property {module:engine/model/position~Position} nextPosition Next position of the iterator.
  31833. * * Forward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
  31834. * the position after the item.
  31835. * * Backward iteration: For `'elementEnd'` it is last position inside element. For all other types it is the position
  31836. * before the item.
  31837. * @property {Number} [length] Length of the item. For `'elementStart'` it is 1. For `'text'` it is
  31838. * the length of the text. For `'elementEnd'` it is `undefined`.
  31839. */
  31840. /**
  31841. * Tree walking directions.
  31842. *
  31843. * @typedef {'forward'|'backward'} module:engine/model/treewalker~TreeWalkerDirection
  31844. */
  31845. /***/ }),
  31846. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js":
  31847. /*!*************************************************************************************!*\
  31848. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js ***!
  31849. \*************************************************************************************/
  31850. /*! exports provided: autoParagraphEmptyRoots, isParagraphable, wrapInParagraph */
  31851. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31852. "use strict";
  31853. __webpack_require__.r(__webpack_exports__);
  31854. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoParagraphEmptyRoots", function() { return autoParagraphEmptyRoots; });
  31855. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isParagraphable", function() { return isParagraphable; });
  31856. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapInParagraph", function() { return wrapInParagraph; });
  31857. /**
  31858. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  31859. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  31860. */
  31861. /**
  31862. * @module engine/model/utils/autoparagraphing
  31863. */
  31864. /**
  31865. * Fixes all empty roots.
  31866. *
  31867. * @protected
  31868. * @param {module:engine/model/writer~Writer} writer The model writer.
  31869. * @returns {Boolean} `true` if any change has been applied, `false` otherwise.
  31870. */
  31871. function autoParagraphEmptyRoots( writer ) {
  31872. const { schema, document } = writer.model;
  31873. for ( const rootName of document.getRootNames() ) {
  31874. const root = document.getRoot( rootName );
  31875. if ( root.isEmpty && !schema.checkChild( root, '$text' ) ) {
  31876. // If paragraph element is allowed in the root, create paragraph element.
  31877. if ( schema.checkChild( root, 'paragraph' ) ) {
  31878. writer.insertElement( 'paragraph', root );
  31879. // Other roots will get fixed in the next post-fixer round. Those will be triggered
  31880. // in the same batch no matter if this method was triggered by the post-fixing or not
  31881. // (the above insertElement call will trigger the post-fixers).
  31882. return true;
  31883. }
  31884. }
  31885. }
  31886. return false;
  31887. }
  31888. /**
  31889. * Checks if the given node wrapped with a paragraph would be accepted by the schema in the given position.
  31890. *
  31891. * @protected
  31892. * @param {module:engine/model/position~Position} position The position at which to check.
  31893. * @param {module:engine/model/node~Node|String} nodeOrType The child node or child type to check.
  31894. * @param {module:engine/model/schema~Schema} schema A schema instance used for element validation.
  31895. */
  31896. function isParagraphable( position, nodeOrType, schema ) {
  31897. const context = schema.createContext( position );
  31898. // When paragraph is allowed in this context...
  31899. if ( !schema.checkChild( context, 'paragraph' ) ) {
  31900. return false;
  31901. }
  31902. // And a node would be allowed in this paragraph...
  31903. if ( !schema.checkChild( context.push( 'paragraph' ), nodeOrType ) ) {
  31904. return false;
  31905. }
  31906. return true;
  31907. }
  31908. /**
  31909. * Inserts a new paragraph at the given position and returns a position inside that paragraph.
  31910. *
  31911. * @protected
  31912. * @param {module:engine/model/position~Position} position The position where a paragraph should be inserted.
  31913. * @param {module:engine/model/writer~Writer} writer The model writer.
  31914. * @returns {module:engine/model/position~Position} Position inside the created paragraph.
  31915. */
  31916. function wrapInParagraph( position, writer ) {
  31917. const paragraph = writer.createElement( 'paragraph' );
  31918. writer.insert( paragraph, position );
  31919. return writer.createPositionAt( paragraph, 0 );
  31920. }
  31921. /***/ }),
  31922. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/deletecontent.js":
  31923. /*!**********************************************************************************!*\
  31924. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/deletecontent.js ***!
  31925. \**********************************************************************************/
  31926. /*! exports provided: default */
  31927. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31928. "use strict";
  31929. __webpack_require__.r(__webpack_exports__);
  31930. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return deleteContent; });
  31931. /* harmony import */ var _liveposition__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../liveposition */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js");
  31932. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  31933. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  31934. /**
  31935. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  31936. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  31937. */
  31938. /**
  31939. * @module engine/model/utils/deletecontent
  31940. */
  31941. /**
  31942. * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.
  31943. *
  31944. * **Note:** Use {@link module:engine/model/model~Model#deleteContent} instead of this function.
  31945. * This function is only exposed to be reusable in algorithms
  31946. * which change the {@link module:engine/model/model~Model#deleteContent}
  31947. * method's behavior.
  31948. *
  31949. * @param {module:engine/model/model~Model} model The model in context of which the insertion
  31950. * should be performed.
  31951. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  31952. * Selection of which the content should be deleted.
  31953. * @param {Object} [options]
  31954. * @param {Boolean} [options.leaveUnmerged=false] Whether to merge elements after removing the content of the selection.
  31955. *
  31956. * For example `<heading>x[x</heading><paragraph>y]y</paragraph>` will become:
  31957. *
  31958. * * `<heading>x^y</heading>` with the option disabled (`leaveUnmerged == false`)
  31959. * * `<heading>x^</heading><paragraph>y</paragraph>` with enabled (`leaveUnmerged == true`).
  31960. *
  31961. * Note: {@link module:engine/model/schema~Schema#isObject object} and {@link module:engine/model/schema~Schema#isLimit limit}
  31962. * elements will not be merged.
  31963. *
  31964. * @param {Boolean} [options.doNotResetEntireContent=false] Whether to skip replacing the entire content with a
  31965. * paragraph when the entire content was selected.
  31966. *
  31967. * For example `<heading>[x</heading><paragraph>y]</paragraph>` will become:
  31968. *
  31969. * * `<paragraph>^</paragraph>` with the option disabled (`doNotResetEntireContent == false`)
  31970. * * `<heading>^</heading>` with enabled (`doNotResetEntireContent == true`).
  31971. *
  31972. * @param {Boolean} [options.doNotAutoparagraph=false] Whether to create a paragraph if after content deletion selection is moved
  31973. * to a place where text cannot be inserted.
  31974. *
  31975. * For example `<paragraph>x</paragraph>[<imageBlock src="foo.jpg"></imageBlock>]` will become:
  31976. *
  31977. * * `<paragraph>x</paragraph><paragraph>[]</paragraph>` with the option disabled (`doNotAutoparagraph == false`)
  31978. * * `<paragraph>x</paragraph>[]` with the option enabled (`doNotAutoparagraph == true`).
  31979. *
  31980. * If you use this option you need to make sure to handle invalid selections yourself or leave
  31981. * them to the selection post-fixer (may not always work).
  31982. *
  31983. * **Note:** If there is no valid position for the selection, the paragraph will always be created:
  31984. *
  31985. * `[<imageBlock src="foo.jpg"></imageBlock>]` -> `<paragraph>[]</paragraph>`.
  31986. */
  31987. function deleteContent( model, selection, options = {} ) {
  31988. if ( selection.isCollapsed ) {
  31989. return;
  31990. }
  31991. const selRange = selection.getFirstRange();
  31992. // If the selection is already removed, don't do anything.
  31993. if ( selRange.root.rootName == '$graveyard' ) {
  31994. return;
  31995. }
  31996. const schema = model.schema;
  31997. model.change( writer => {
  31998. // 1. Replace the entire content with paragraph.
  31999. // See: https://github.com/ckeditor/ckeditor5-engine/issues/1012#issuecomment-315017594.
  32000. if ( !options.doNotResetEntireContent && shouldEntireContentBeReplacedWithParagraph( schema, selection ) ) {
  32001. replaceEntireContentWithParagraph( writer, selection, schema );
  32002. return;
  32003. }
  32004. // Get the live positions for the range adjusted to span only blocks selected from the user perspective.
  32005. const [ startPosition, endPosition ] = getLivePositionsForSelectedBlocks( selRange );
  32006. // 2. Remove the content if there is any.
  32007. if ( !startPosition.isTouching( endPosition ) ) {
  32008. writer.remove( writer.createRange( startPosition, endPosition ) );
  32009. }
  32010. // 3. Merge elements in the right branch to the elements in the left branch.
  32011. // The only reasonable (in terms of data and selection correctness) case in which we need to do that is:
  32012. //
  32013. // <heading type=1>Fo[</heading><paragraph>]ar</paragraph> => <heading type=1>Fo^ar</heading>
  32014. //
  32015. // However, the algorithm supports also merging deeper structures (up to the depth of the shallower branch),
  32016. // as it's hard to imagine what should actually be the default behavior. Usually, specific features will
  32017. // want to override that behavior anyway.
  32018. if ( !options.leaveUnmerged ) {
  32019. mergeBranches( writer, startPosition, endPosition );
  32020. // TMP this will be replaced with a postfixer.
  32021. // We need to check and strip disallowed attributes in all nested nodes because after merge
  32022. // some attributes could end up in a path where are disallowed.
  32023. //
  32024. // e.g. bold is disallowed for <H1>
  32025. // <h1>Fo{o</h1><p>b}a<b>r</b><p> -> <h1>Fo{}a<b>r</b><h1> -> <h1>Fo{}ar<h1>.
  32026. schema.removeDisallowedAttributes( startPosition.parent.getChildren(), writer );
  32027. }
  32028. collapseSelectionAt( writer, selection, startPosition );
  32029. // 4. Add a paragraph to set selection in it.
  32030. // Check if a text is allowed in the new container. If not, try to create a new paragraph (if it's allowed here).
  32031. // If autoparagraphing is off, we assume that you know what you do so we leave the selection wherever it was.
  32032. if ( !options.doNotAutoparagraph && shouldAutoparagraph( schema, startPosition ) ) {
  32033. insertParagraph( writer, startPosition, selection );
  32034. }
  32035. startPosition.detach();
  32036. endPosition.detach();
  32037. } );
  32038. }
  32039. // Returns the live positions for the range adjusted to span only blocks selected from the user perspective. Example:
  32040. //
  32041. // <heading1>[foo</heading1>
  32042. // <paragraph>bar</paragraph>
  32043. // <heading1>]abc</heading1> <-- this block is not considered as selected
  32044. //
  32045. // This is the same behavior as in Selection#getSelectedBlocks() "special case".
  32046. function getLivePositionsForSelectedBlocks( range ) {
  32047. const model = range.root.document.model;
  32048. const startPosition = range.start;
  32049. let endPosition = range.end;
  32050. // If the end of selection is at the start position of last block in the selection, then
  32051. // shrink it to not include that trailing block. Note that this should happen only for not empty selection.
  32052. if ( model.hasContent( range, { ignoreMarkers: true } ) ) {
  32053. const endBlock = getParentBlock( endPosition );
  32054. if ( endBlock && endPosition.isTouching( model.createPositionAt( endBlock, 0 ) ) ) {
  32055. // Create forward selection as a probe to find a valid position after excluding last block from the range.
  32056. const selection = model.createSelection( range );
  32057. // Modify the forward selection in backward direction to shrink it and remove first position of following block from it.
  32058. // This is how modifySelection works and here we are making use of it.
  32059. model.modifySelection( selection, { direction: 'backward' } );
  32060. const newEndPosition = selection.getLastPosition();
  32061. // For such a model and selection:
  32062. // <paragraph>A[</paragraph><imageBlock></imageBlock><paragraph>]B</paragraph>
  32063. //
  32064. // After modifySelection(), we would end up with this:
  32065. // <paragraph>A[</paragraph>]<imageBlock></imageBlock><paragraph>B</paragraph>
  32066. //
  32067. // So we need to check if there is no content in the skipped range (because we want to include the <imageBlock>).
  32068. const skippedRange = model.createRange( newEndPosition, endPosition );
  32069. if ( !model.hasContent( skippedRange, { ignoreMarkers: true } ) ) {
  32070. endPosition = newEndPosition;
  32071. }
  32072. }
  32073. }
  32074. return [
  32075. _liveposition__WEBPACK_IMPORTED_MODULE_0__["default"].fromPosition( startPosition, 'toPrevious' ),
  32076. _liveposition__WEBPACK_IMPORTED_MODULE_0__["default"].fromPosition( endPosition, 'toNext' )
  32077. ];
  32078. }
  32079. // Finds the lowest element in position's ancestors which is a block.
  32080. // Returns null if a limit element is encountered before reaching a block element.
  32081. function getParentBlock( position ) {
  32082. const element = position.parent;
  32083. const schema = element.root.document.model.schema;
  32084. const ancestors = element.getAncestors( { parentFirst: true, includeSelf: true } );
  32085. for ( const element of ancestors ) {
  32086. if ( schema.isLimit( element ) ) {
  32087. return null;
  32088. }
  32089. if ( schema.isBlock( element ) ) {
  32090. return element;
  32091. }
  32092. }
  32093. }
  32094. // This function is a result of reaching the Ballmer's peak for just the right amount of time.
  32095. // Even I had troubles documenting it after a while and after reading it again I couldn't believe that it really works.
  32096. function mergeBranches( writer, startPosition, endPosition ) {
  32097. const model = writer.model;
  32098. // Verify if there is a need and possibility to merge.
  32099. if ( !checkShouldMerge( writer.model.schema, startPosition, endPosition ) ) {
  32100. return;
  32101. }
  32102. // If the start element on the common ancestor level is empty, and the end element on the same level is not empty
  32103. // then merge those to the right element so that it's properties are preserved (name, attributes).
  32104. // Because of OT merging is used instead of removing elements.
  32105. //
  32106. // Merge left:
  32107. // <heading1>foo[</heading1> -> <heading1>foo[]bar</heading1>
  32108. // <paragraph>]bar</paragraph> -> --^
  32109. //
  32110. // Merge right:
  32111. // <heading1>[</heading1> ->
  32112. // <paragraph>]bar</paragraph> -> <paragraph>[]bar</paragraph>
  32113. //
  32114. // Merge left:
  32115. // <blockQuote> -> <blockQuote>
  32116. // <heading1>foo[</heading1> -> <heading1>foo[]bar</heading1>
  32117. // <paragraph>]bar</paragraph> -> --^
  32118. // </blockQuote> -> </blockQuote>
  32119. //
  32120. // Merge right:
  32121. // <blockQuote> -> <blockQuote>
  32122. // <heading1>[</heading1> ->
  32123. // <paragraph>]bar</paragraph> -> <paragraph>[]bar</paragraph>
  32124. // </blockQuote> -> </blockQuote>
  32125. // Merging should not go deeper than common ancestor.
  32126. const [ startAncestor, endAncestor ] = getAncestorsJustBelowCommonAncestor( startPosition, endPosition );
  32127. // Branches can't be merged if one of the positions is directly inside a common ancestor.
  32128. //
  32129. // Example:
  32130. // <blockQuote>
  32131. // <paragraph>[foo</paragraph>]
  32132. // <table> ... </table>
  32133. // <blockQuote>
  32134. //
  32135. if ( !startAncestor || !endAncestor ) {
  32136. return;
  32137. }
  32138. if ( !model.hasContent( startAncestor, { ignoreMarkers: true } ) && model.hasContent( endAncestor, { ignoreMarkers: true } ) ) {
  32139. mergeBranchesRight( writer, startPosition, endPosition, startAncestor.parent );
  32140. } else {
  32141. mergeBranchesLeft( writer, startPosition, endPosition, startAncestor.parent );
  32142. }
  32143. }
  32144. // Merging blocks to the left (properties of the left block are preserved).
  32145. // Simple example:
  32146. // <heading1>foo[</heading1> -> <heading1>foo[bar</heading1>]
  32147. // <paragraph>]bar</paragraph> -> --^
  32148. //
  32149. // Nested example:
  32150. // <blockQuote> -> <blockQuote>
  32151. // <heading1>foo[</heading1> -> <heading1>foo[bar</heading1>
  32152. // </blockQuote> -> </blockQuote>] ^
  32153. // <blockBlock> -> |
  32154. // <paragraph>]bar</paragraph> -> ---
  32155. // </blockBlock> ->
  32156. //
  32157. function mergeBranchesLeft( writer, startPosition, endPosition, commonAncestor ) {
  32158. const startElement = startPosition.parent;
  32159. const endElement = endPosition.parent;
  32160. // Merging reached the common ancestor element, stop here.
  32161. if ( startElement == commonAncestor || endElement == commonAncestor ) {
  32162. return;
  32163. }
  32164. // Remember next positions to merge in next recursive step (also used as modification points pointers).
  32165. startPosition = writer.createPositionAfter( startElement );
  32166. endPosition = writer.createPositionBefore( endElement );
  32167. // Move endElement just after startElement if they aren't siblings.
  32168. if ( !endPosition.isEqual( startPosition ) ) {
  32169. //
  32170. // <blockQuote> -> <blockQuote>
  32171. // <heading1>foo[</heading1> -> <heading1>foo</heading1>[<paragraph>bar</paragraph>
  32172. // </blockQuote> -> </blockQuote> ^
  32173. // <blockBlock> -> <blockBlock> |
  32174. // <paragraph>]bar</paragraph> -> ] ---
  32175. // </blockBlock> -> </blockBlock>
  32176. //
  32177. writer.insert( endElement, startPosition );
  32178. }
  32179. // Merge two siblings (nodes on sides of startPosition):
  32180. //
  32181. // <blockQuote> -> <blockQuote>
  32182. // <heading1>foo</heading1>[<paragraph>bar</paragraph> -> <heading1>foo[bar</heading1>
  32183. // </blockQuote> -> </blockQuote>
  32184. // <blockBlock> -> <blockBlock>
  32185. // ] -> ]
  32186. // </blockBlock> -> </blockBlock>
  32187. //
  32188. // Or in simple case (without moving elements in above if):
  32189. // <heading1>foo</heading1>[<paragraph>bar</paragraph>] -> <heading1>foo[bar</heading1>]
  32190. //
  32191. writer.merge( startPosition );
  32192. // Remove empty end ancestors:
  32193. //
  32194. // <blockQuote> -> <blockQuote>
  32195. // <heading1>foo[bar</heading1> -> <heading1>foo[bar</heading1>
  32196. // </blockQuote> -> </blockQuote>
  32197. // <blockBlock> ->
  32198. // ] -> ]
  32199. // </blockBlock> ->
  32200. //
  32201. while ( endPosition.parent.isEmpty ) {
  32202. const parentToRemove = endPosition.parent;
  32203. endPosition = writer.createPositionBefore( parentToRemove );
  32204. writer.remove( parentToRemove );
  32205. }
  32206. // Verify if there is a need and possibility to merge next level.
  32207. if ( !checkShouldMerge( writer.model.schema, startPosition, endPosition ) ) {
  32208. return;
  32209. }
  32210. // Continue merging next level (blockQuote with blockBlock in the examples above if it would not be empty and got removed).
  32211. mergeBranchesLeft( writer, startPosition, endPosition, commonAncestor );
  32212. }
  32213. // Merging blocks to the right (properties of the right block are preserved).
  32214. // Simple example:
  32215. // <heading1>foo[</heading1> -> --v
  32216. // <paragraph>]bar</paragraph> -> [<paragraph>foo]bar</paragraph>
  32217. //
  32218. // Nested example:
  32219. // <blockQuote> ->
  32220. // <heading1>foo[</heading1> -> ---
  32221. // </blockQuote> -> |
  32222. // <blockBlock> -> [<blockBlock> v
  32223. // <paragraph>]bar</paragraph> -> <paragraph>foo]bar</paragraph>
  32224. // </blockBlock> -> </blockBlock>
  32225. //
  32226. function mergeBranchesRight( writer, startPosition, endPosition, commonAncestor ) {
  32227. const startElement = startPosition.parent;
  32228. const endElement = endPosition.parent;
  32229. // Merging reached the common ancestor element, stop here.
  32230. if ( startElement == commonAncestor || endElement == commonAncestor ) {
  32231. return;
  32232. }
  32233. // Remember next positions to merge in next recursive step (also used as modification points pointers).
  32234. startPosition = writer.createPositionAfter( startElement );
  32235. endPosition = writer.createPositionBefore( endElement );
  32236. // Move startElement just before endElement if they aren't siblings.
  32237. if ( !endPosition.isEqual( startPosition ) ) {
  32238. //
  32239. // <blockQuote> -> <blockQuote>
  32240. // <heading1>foo[</heading1> -> [ ---
  32241. // </blockQuote> -> </blockQuote> |
  32242. // <blockBlock> -> <blockBlock> v
  32243. // <paragraph>]bar</paragraph> -> <heading1>foo</heading1>]<paragraph>bar</paragraph>
  32244. // </blockBlock> -> </blockBlock>
  32245. //
  32246. writer.insert( startElement, endPosition );
  32247. }
  32248. // Remove empty end ancestors:
  32249. //
  32250. // <blockQuote> ->
  32251. // [ -> [
  32252. // </blockQuote> ->
  32253. // <blockBlock> -> <blockBlock>
  32254. // <heading1>foo</heading1>]<paragraph>bar</paragraph> -> <heading1>foo</heading1>]<paragraph>bar</paragraph>
  32255. // </blockBlock> -> </blockBlock>
  32256. //
  32257. while ( startPosition.parent.isEmpty ) {
  32258. const parentToRemove = startPosition.parent;
  32259. startPosition = writer.createPositionBefore( parentToRemove );
  32260. writer.remove( parentToRemove );
  32261. }
  32262. // Update endPosition after inserting and removing elements.
  32263. endPosition = writer.createPositionBefore( endElement );
  32264. // Merge right two siblings (nodes on sides of endPosition):
  32265. // ->
  32266. // [ -> [
  32267. // ->
  32268. // <blockBlock> -> <blockBlock>
  32269. // <heading1>foo</heading1>]<paragraph>bar</paragraph> -> <paragraph>foo]bar</paragraph>
  32270. // </blockBlock> -> </blockBlock>
  32271. //
  32272. // Or in simple case (without moving elements in above if):
  32273. // [<heading1>foo</heading1>]<paragraph>bar</paragraph> -> [<heading1>foo]bar</heading1>
  32274. //
  32275. mergeRight( writer, endPosition );
  32276. // Verify if there is a need and possibility to merge next level.
  32277. if ( !checkShouldMerge( writer.model.schema, startPosition, endPosition ) ) {
  32278. return;
  32279. }
  32280. // Continue merging next level (blockQuote with blockBlock in the examples above if it would not be empty and got removed).
  32281. mergeBranchesRight( writer, startPosition, endPosition, commonAncestor );
  32282. }
  32283. // There is no right merge operation so we need to simulate it.
  32284. function mergeRight( writer, position ) {
  32285. const startElement = position.nodeBefore;
  32286. const endElement = position.nodeAfter;
  32287. if ( startElement.name != endElement.name ) {
  32288. writer.rename( startElement, endElement.name );
  32289. }
  32290. writer.clearAttributes( startElement );
  32291. writer.setAttributes( Object.fromEntries( endElement.getAttributes() ), startElement );
  32292. writer.merge( position );
  32293. }
  32294. // Verifies if merging is needed and possible. It's not needed if both positions are in the same element
  32295. // and it's not possible if some element is a limit or the range crosses a limit element.
  32296. function checkShouldMerge( schema, startPosition, endPosition ) {
  32297. const startElement = startPosition.parent;
  32298. const endElement = endPosition.parent;
  32299. // If both positions ended up in the same parent, then there's nothing more to merge:
  32300. // <$root><p>x[</p><p>]y</p></$root> => <$root><p>xy</p>[]</$root>
  32301. if ( startElement == endElement ) {
  32302. return false;
  32303. }
  32304. // If one of the positions is a limit element, then there's nothing to merge because we don't want to cross the limit boundaries.
  32305. if ( schema.isLimit( startElement ) || schema.isLimit( endElement ) ) {
  32306. return false;
  32307. }
  32308. // Check if operations we'll need to do won't need to cross object or limit boundaries.
  32309. // E.g., we can't merge endElement into startElement in this case:
  32310. // <limit><startElement>x[</startElement></limit><endElement>]</endElement>
  32311. return isCrossingLimitElement( startPosition, endPosition, schema );
  32312. }
  32313. // Returns the elements that are the ancestors of the provided positions that are direct children of the common ancestor.
  32314. function getAncestorsJustBelowCommonAncestor( positionA, positionB ) {
  32315. const ancestorsA = positionA.getAncestors();
  32316. const ancestorsB = positionB.getAncestors();
  32317. let i = 0;
  32318. while ( ancestorsA[ i ] && ancestorsA[ i ] == ancestorsB[ i ] ) {
  32319. i++;
  32320. }
  32321. return [ ancestorsA[ i ], ancestorsB[ i ] ];
  32322. }
  32323. function shouldAutoparagraph( schema, position ) {
  32324. const isTextAllowed = schema.checkChild( position, '$text' );
  32325. const isParagraphAllowed = schema.checkChild( position, 'paragraph' );
  32326. return !isTextAllowed && isParagraphAllowed;
  32327. }
  32328. // Check if parents of two positions can be merged by checking if there are no limit/object
  32329. // boundaries between those two positions.
  32330. //
  32331. // E.g. in <bQ><p>x[]</p></bQ><widget><caption>{}</caption></widget>
  32332. // we'll check <p>, <bQ>, <widget> and <caption>.
  32333. // Usually, widget and caption are marked as objects/limits in the schema, so in this case merging will be blocked.
  32334. function isCrossingLimitElement( leftPos, rightPos, schema ) {
  32335. const rangeToCheck = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( leftPos, rightPos );
  32336. for ( const value of rangeToCheck.getWalker() ) {
  32337. if ( schema.isLimit( value.item ) ) {
  32338. return false;
  32339. }
  32340. }
  32341. return true;
  32342. }
  32343. function insertParagraph( writer, position, selection ) {
  32344. const paragraph = writer.createElement( 'paragraph' );
  32345. writer.insert( paragraph, position );
  32346. collapseSelectionAt( writer, selection, writer.createPositionAt( paragraph, 0 ) );
  32347. }
  32348. function replaceEntireContentWithParagraph( writer, selection ) {
  32349. const limitElement = writer.model.schema.getLimitElement( selection );
  32350. writer.remove( writer.createRangeIn( limitElement ) );
  32351. insertParagraph( writer, writer.createPositionAt( limitElement, 0 ), selection );
  32352. }
  32353. // We want to replace the entire content with a paragraph when:
  32354. // * the entire content is selected,
  32355. // * selection contains at least two elements,
  32356. // * whether the paragraph is allowed in schema in the common ancestor.
  32357. function shouldEntireContentBeReplacedWithParagraph( schema, selection ) {
  32358. const limitElement = schema.getLimitElement( selection );
  32359. if ( !selection.containsEntireContent( limitElement ) ) {
  32360. return false;
  32361. }
  32362. const range = selection.getFirstRange();
  32363. if ( range.start.parent == range.end.parent ) {
  32364. return false;
  32365. }
  32366. return schema.checkChild( limitElement, 'paragraph' );
  32367. }
  32368. // Helper function that sets the selection. Depending whether given `selection` is a document selection or not,
  32369. // uses a different method to set it.
  32370. function collapseSelectionAt( writer, selection, positionOrRange ) {
  32371. if ( selection instanceof _documentselection__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  32372. writer.setSelection( positionOrRange );
  32373. } else {
  32374. selection.setTo( positionOrRange );
  32375. }
  32376. }
  32377. /***/ }),
  32378. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/getselectedcontent.js":
  32379. /*!***************************************************************************************!*\
  32380. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/getselectedcontent.js ***!
  32381. \***************************************************************************************/
  32382. /*! exports provided: default */
  32383. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  32384. "use strict";
  32385. __webpack_require__.r(__webpack_exports__);
  32386. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getSelectedContent; });
  32387. /**
  32388. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  32389. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  32390. */
  32391. /**
  32392. * @module engine/model/utils/getselectedcontent
  32393. */
  32394. /**
  32395. * Gets a clone of the selected content.
  32396. *
  32397. * For example, for the following selection:
  32398. *
  32399. * ```html
  32400. * <p>x</p><quote><p>y</p><h>fir[st</h></quote><p>se]cond</p><p>z</p>
  32401. * ```
  32402. *
  32403. * It will return a document fragment with such a content:
  32404. *
  32405. * ```html
  32406. * <quote><h>st</h></quote><p>se</p>
  32407. * ```
  32408. *
  32409. * @param {module:engine/model/model~Model} model The model in context of which
  32410. * the selection modification should be performed.
  32411. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  32412. * The selection of which content will be returned.
  32413. * @returns {module:engine/model/documentfragment~DocumentFragment}
  32414. */
  32415. function getSelectedContent( model, selection ) {
  32416. return model.change( writer => {
  32417. const frag = writer.createDocumentFragment();
  32418. const range = selection.getFirstRange();
  32419. if ( !range || range.isCollapsed ) {
  32420. return frag;
  32421. }
  32422. const root = range.start.root;
  32423. const commonPath = range.start.getCommonPath( range.end );
  32424. const commonParent = root.getNodeByPath( commonPath );
  32425. // ## 1st step
  32426. //
  32427. // First, we'll clone a fragment represented by a minimal flat range
  32428. // containing the original range to be cloned.
  32429. // E.g. let's consider such a range:
  32430. //
  32431. // <p>x</p><quote><p>y</p><h>fir[st</h></quote><p>se]cond</p><p>z</p>
  32432. //
  32433. // A minimal flat range containing this one is:
  32434. //
  32435. // <p>x</p>[<quote><p>y</p><h>first</h></quote><p>second</p>]<p>z</p>
  32436. //
  32437. // We can easily clone this structure, preserving e.g. the <quote> element.
  32438. let flatSubtreeRange;
  32439. if ( range.start.parent == range.end.parent ) {
  32440. // The original range is flat, so take it.
  32441. flatSubtreeRange = range;
  32442. } else {
  32443. flatSubtreeRange = writer.createRange(
  32444. writer.createPositionAt( commonParent, range.start.path[ commonPath.length ] ),
  32445. writer.createPositionAt( commonParent, range.end.path[ commonPath.length ] + 1 )
  32446. );
  32447. }
  32448. const howMany = flatSubtreeRange.end.offset - flatSubtreeRange.start.offset;
  32449. // Clone the whole contents.
  32450. for ( const item of flatSubtreeRange.getItems( { shallow: true } ) ) {
  32451. if ( item.is( '$textProxy' ) ) {
  32452. writer.appendText( item.data, item.getAttributes(), frag );
  32453. } else {
  32454. writer.append( writer.cloneElement( item, true ), frag );
  32455. }
  32456. }
  32457. // ## 2nd step
  32458. //
  32459. // If the original range wasn't flat, then we need to remove the excess nodes from the both ends of the cloned fragment.
  32460. //
  32461. // For example, for the range shown in the 1st step comment, we need to remove these pieces:
  32462. //
  32463. // <quote>[<p>y</p>]<h>[fir]st</h></quote><p>se[cond]</p>
  32464. //
  32465. // So this will be the final copied content:
  32466. //
  32467. // <quote><h>st</h></quote><p>se</p>
  32468. //
  32469. // In order to do that, we remove content from these two ranges:
  32470. //
  32471. // [<quote><p>y</p><h>fir]st</h></quote><p>se[cond</p>]
  32472. if ( flatSubtreeRange != range ) {
  32473. // Find the position of the original range in the cloned fragment.
  32474. const newRange = range._getTransformedByMove( flatSubtreeRange.start, writer.createPositionAt( frag, 0 ), howMany )[ 0 ];
  32475. const leftExcessRange = writer.createRange( writer.createPositionAt( frag, 0 ), newRange.start );
  32476. const rightExcessRange = writer.createRange( newRange.end, writer.createPositionAt( frag, 'end' ) );
  32477. removeRangeContent( rightExcessRange, writer );
  32478. removeRangeContent( leftExcessRange, writer );
  32479. }
  32480. return frag;
  32481. } );
  32482. }
  32483. // After https://github.com/ckeditor/ckeditor5-engine/issues/690 is fixed,
  32484. // this function will, most likely, be able to rewritten using getMinimalFlatRanges().
  32485. function removeRangeContent( range, writer ) {
  32486. const parentsToCheck = [];
  32487. Array.from( range.getItems( { direction: 'backward' } ) )
  32488. // We should better store ranges because text proxies will lose integrity
  32489. // with the text nodes when we'll start removing content.
  32490. .map( item => writer.createRangeOn( item ) )
  32491. // Filter only these items which are fully contained in the passed range.
  32492. //
  32493. // E.g. for the following range: [<quote><p>y</p><h>fir]st</h>
  32494. // the walker will return the entire <h> element, when only the "fir" item inside it is fully contained.
  32495. .filter( itemRange => {
  32496. // We should be able to use Range.containsRange, but https://github.com/ckeditor/ckeditor5-engine/issues/691.
  32497. const contained =
  32498. ( itemRange.start.isAfter( range.start ) || itemRange.start.isEqual( range.start ) ) &&
  32499. ( itemRange.end.isBefore( range.end ) || itemRange.end.isEqual( range.end ) );
  32500. return contained;
  32501. } )
  32502. .forEach( itemRange => {
  32503. parentsToCheck.push( itemRange.start.parent );
  32504. writer.remove( itemRange );
  32505. } );
  32506. // Remove ancestors of the removed items if they turned to be empty now
  32507. // (their whole content was contained in the range).
  32508. parentsToCheck.forEach( parentToCheck => {
  32509. let parent = parentToCheck;
  32510. while ( parent.parent && parent.isEmpty ) {
  32511. const removeRange = writer.createRangeOn( parent );
  32512. parent = parent.parent;
  32513. writer.remove( removeRange );
  32514. }
  32515. } );
  32516. }
  32517. /***/ }),
  32518. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertcontent.js":
  32519. /*!**********************************************************************************!*\
  32520. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertcontent.js ***!
  32521. \**********************************************************************************/
  32522. /*! exports provided: default */
  32523. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  32524. "use strict";
  32525. __webpack_require__.r(__webpack_exports__);
  32526. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return insertContent; });
  32527. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  32528. /* harmony import */ var _liveposition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../liveposition */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js");
  32529. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  32530. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  32531. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  32532. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js");
  32533. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  32534. /**
  32535. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  32536. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  32537. */
  32538. /**
  32539. * @module engine/model/utils/insertcontent
  32540. */
  32541. /**
  32542. * Inserts content into the editor (specified selection) as one would expect the paste functionality to work.
  32543. *
  32544. * It takes care of removing the selected content, splitting elements (if needed), inserting elements and merging elements appropriately.
  32545. *
  32546. * Some examples:
  32547. *
  32548. * <p>x^</p> + <p>y</p> => <p>x</p><p>y</p> => <p>xy[]</p>
  32549. * <p>x^y</p> + <p>z</p> => <p>x</p>^<p>y</p> + <p>z</p> => <p>x</p><p>z</p><p>y</p> => <p>xz[]y</p>
  32550. * <p>x^y</p> + <img /> => <p>x</p>^<p>y</p> + <img /> => <p>x</p><img /><p>y</p>
  32551. * <p>x</p><p>^</p><p>z</p> + <p>y</p> => <p>x</p><p>y[]</p><p>z</p> (no merging)
  32552. * <p>x</p>[<img />]<p>z</p> + <p>y</p> => <p>x</p>^<p>z</p> + <p>y</p> => <p>x</p><p>y[]</p><p>z</p>
  32553. *
  32554. * If an instance of {@link module:engine/model/selection~Selection} is passed as `selectable` it will be modified
  32555. * to the insertion selection (equal to a range to be selected after insertion).
  32556. *
  32557. * If `selectable` is not passed, the content will be inserted using the current selection of the model document.
  32558. *
  32559. * **Note:** Use {@link module:engine/model/model~Model#insertContent} instead of this function.
  32560. * This function is only exposed to be reusable in algorithms which change the {@link module:engine/model/model~Model#insertContent}
  32561. * method's behavior.
  32562. *
  32563. * @param {module:engine/model/model~Model} model The model in context of which the insertion
  32564. * should be performed.
  32565. * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
  32566. * @param {module:engine/model/selection~Selectable} [selectable=model.document.selection]
  32567. * Selection into which the content should be inserted.
  32568. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  32569. * @returns {module:engine/model/range~Range} Range which contains all the performed changes. This is a range that, if removed,
  32570. * would return the model to the state before the insertion. If no changes were preformed by `insertContent`, returns a range collapsed
  32571. * at the insertion position.
  32572. */
  32573. function insertContent( model, content, selectable, placeOrOffset ) {
  32574. return model.change( writer => {
  32575. let selection;
  32576. if ( !selectable ) {
  32577. selection = model.document.selection;
  32578. } else if ( selectable instanceof _selection__WEBPACK_IMPORTED_MODULE_5__["default"] || selectable instanceof _documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  32579. selection = selectable;
  32580. } else {
  32581. selection = writer.createSelection( selectable, placeOrOffset );
  32582. }
  32583. if ( !selection.isCollapsed ) {
  32584. model.deleteContent( selection, { doNotAutoparagraph: true } );
  32585. }
  32586. const insertion = new Insertion( model, writer, selection.anchor );
  32587. let nodesToInsert;
  32588. if ( content.is( 'documentFragment' ) ) {
  32589. nodesToInsert = content.getChildren();
  32590. } else {
  32591. nodesToInsert = [ content ];
  32592. }
  32593. insertion.handleNodes( nodesToInsert );
  32594. const newRange = insertion.getSelectionRange();
  32595. /* istanbul ignore else */
  32596. if ( newRange ) {
  32597. if ( selection instanceof _documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  32598. writer.setSelection( newRange );
  32599. } else {
  32600. selection.setTo( newRange );
  32601. }
  32602. } else {
  32603. // We are not testing else because it's a safe check for unpredictable edge cases:
  32604. // an insertion without proper range to select.
  32605. //
  32606. // @if CK_DEBUG // console.warn( 'Cannot determine a proper selection range after insertion.' );
  32607. }
  32608. const affectedRange = insertion.getAffectedRange() || model.createRange( selection.anchor );
  32609. insertion.destroy();
  32610. return affectedRange;
  32611. } );
  32612. }
  32613. /**
  32614. * Utility class for performing content insertion.
  32615. *
  32616. * @private
  32617. */
  32618. class Insertion {
  32619. constructor( model, writer, position ) {
  32620. /**
  32621. * The model in context of which the insertion should be performed.
  32622. *
  32623. * @member {module:engine/model~Model} #model
  32624. */
  32625. this.model = model;
  32626. /**
  32627. * Batch to which operations will be added.
  32628. *
  32629. * @member {module:engine/controller/writer~Batch} #writer
  32630. */
  32631. this.writer = writer;
  32632. /**
  32633. * The position at which (or near which) the next node will be inserted.
  32634. *
  32635. * @member {module:engine/model/position~Position} #position
  32636. */
  32637. this.position = position;
  32638. /**
  32639. * Elements with which the inserted elements can be merged.
  32640. *
  32641. * <p>x^</p><p>y</p> + <p>z</p> (can merge to <p>x</p>)
  32642. * <p>x</p><p>^y</p> + <p>z</p> (can merge to <p>y</p>)
  32643. * <p>x^y</p> + <p>z</p> (can merge to <p>xy</p> which will be split during the action,
  32644. * so both its pieces will be added to this set)
  32645. *
  32646. *
  32647. * @member {Set} #canMergeWith
  32648. */
  32649. this.canMergeWith = new Set( [ this.position.parent ] );
  32650. /**
  32651. * Schema of the model.
  32652. *
  32653. * @member {module:engine/model/schema~Schema} #schema
  32654. */
  32655. this.schema = model.schema;
  32656. /**
  32657. * The temporary DocumentFragment used for grouping multiple nodes for single insert operation.
  32658. *
  32659. * @private
  32660. * @type {module:engine/model/documentfragment~DocumentFragment}
  32661. */
  32662. this._documentFragment = writer.createDocumentFragment();
  32663. /**
  32664. * The current position in the temporary DocumentFragment.
  32665. *
  32666. * @private
  32667. * @type {module:engine/model/position~Position}
  32668. */
  32669. this._documentFragmentPosition = writer.createPositionAt( this._documentFragment, 0 );
  32670. /**
  32671. * The reference to the first inserted node.
  32672. *
  32673. * @private
  32674. * @type {module:engine/model/node~Node}
  32675. */
  32676. this._firstNode = null;
  32677. /**
  32678. * The reference to the last inserted node.
  32679. *
  32680. * @private
  32681. * @type {module:engine/model/node~Node}
  32682. */
  32683. this._lastNode = null;
  32684. /**
  32685. * The reference to the last auto paragraph node.
  32686. *
  32687. * @private
  32688. * @type {module:engine/model/node~Node}
  32689. */
  32690. this._lastAutoParagraph = null;
  32691. /**
  32692. * The array of nodes that should be cleaned of not allowed attributes.
  32693. *
  32694. * @private
  32695. * @type {Array.<module:engine/model/node~Node>}
  32696. */
  32697. this._filterAttributesOf = [];
  32698. /**
  32699. * Beginning of the affected range. See {@link module:engine/model/utils/insertcontent~Insertion#getAffectedRange}.
  32700. *
  32701. * @private
  32702. * @member {module:engine/model/liveposition~LivePosition|null} #_affectedStart
  32703. */
  32704. this._affectedStart = null;
  32705. /**
  32706. * End of the affected range. See {@link module:engine/model/utils/insertcontent~Insertion#getAffectedRange}.
  32707. *
  32708. * @private
  32709. * @member {module:engine/model/liveposition~LivePosition|null} #_affectedEnd
  32710. */
  32711. this._affectedEnd = null;
  32712. }
  32713. /**
  32714. * Handles insertion of a set of nodes.
  32715. *
  32716. * @param {Iterable.<module:engine/model/node~Node>} nodes Nodes to insert.
  32717. */
  32718. handleNodes( nodes ) {
  32719. for ( const node of Array.from( nodes ) ) {
  32720. this._handleNode( node );
  32721. }
  32722. // Insert nodes collected in temporary DocumentFragment.
  32723. this._insertPartialFragment();
  32724. // If there was an auto paragraph then we might need to adjust the end of insertion.
  32725. if ( this._lastAutoParagraph ) {
  32726. this._updateLastNodeFromAutoParagraph( this._lastAutoParagraph );
  32727. }
  32728. // After the content was inserted we may try to merge it with its next sibling if the selection was in it initially.
  32729. // Merging with the previous sibling was performed just after inserting the first node to the document.
  32730. this._mergeOnRight();
  32731. // TMP this will become a post-fixer.
  32732. this.schema.removeDisallowedAttributes( this._filterAttributesOf, this.writer );
  32733. this._filterAttributesOf = [];
  32734. }
  32735. /**
  32736. * Updates the last node after the auto paragraphing.
  32737. *
  32738. * @private
  32739. * @param {module:engine/model/node~Node} node The last auto paragraphing node.
  32740. */
  32741. _updateLastNodeFromAutoParagraph( node ) {
  32742. const positionAfterLastNode = this.writer.createPositionAfter( this._lastNode );
  32743. const positionAfterNode = this.writer.createPositionAfter( node );
  32744. // If the real end was after the last auto paragraph then update relevant properties.
  32745. if ( positionAfterNode.isAfter( positionAfterLastNode ) ) {
  32746. this._lastNode = node;
  32747. /* istanbul ignore if */
  32748. if ( this.position.parent != node || !this.position.isAtEnd ) {
  32749. // Algorithm's correctness check. We should never end up here but it's good to know that we did.
  32750. // At this point the insertion position should be at the end of the last auto paragraph.
  32751. // Note: This error is documented in other place in this file.
  32752. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"]( 'insertcontent-invalid-insertion-position', this );
  32753. }
  32754. this.position = positionAfterNode;
  32755. this._setAffectedBoundaries( this.position );
  32756. }
  32757. }
  32758. /**
  32759. * Returns range to be selected after insertion.
  32760. * Returns `null` if there is no valid range to select after insertion.
  32761. *
  32762. * @returns {module:engine/model/range~Range|null}
  32763. */
  32764. getSelectionRange() {
  32765. if ( this.nodeToSelect ) {
  32766. return _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createOn( this.nodeToSelect );
  32767. }
  32768. return this.model.schema.getNearestSelectionRange( this.position );
  32769. }
  32770. /**
  32771. * Returns a range which contains all the performed changes. This is a range that, if removed, would return the model to the state
  32772. * before the insertion. Returns `null` if no changes were done.
  32773. *
  32774. * @returns {module:engine/model/range~Range|null}
  32775. */
  32776. getAffectedRange() {
  32777. if ( !this._affectedStart ) {
  32778. return null;
  32779. }
  32780. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( this._affectedStart, this._affectedEnd );
  32781. }
  32782. /**
  32783. * Destroys `Insertion` instance.
  32784. */
  32785. destroy() {
  32786. if ( this._affectedStart ) {
  32787. this._affectedStart.detach();
  32788. }
  32789. if ( this._affectedEnd ) {
  32790. this._affectedEnd.detach();
  32791. }
  32792. }
  32793. /**
  32794. * Handles insertion of a single node.
  32795. *
  32796. * @private
  32797. * @param {module:engine/model/node~Node} node
  32798. */
  32799. _handleNode( node ) {
  32800. // Let's handle object in a special way.
  32801. // * They should never be merged with other elements.
  32802. // * If they are not allowed in any of the selection ancestors, they could be either autoparagraphed or totally removed.
  32803. if ( this.schema.isObject( node ) ) {
  32804. this._handleObject( node );
  32805. return;
  32806. }
  32807. // Try to find a place for the given node.
  32808. // Check if a node can be inserted in the given position or it would be accepted if a paragraph would be inserted.
  32809. // Inserts the auto paragraph if it would allow for insertion.
  32810. let isAllowed = this._checkAndAutoParagraphToAllowedPosition( node );
  32811. if ( !isAllowed ) {
  32812. // Split the position.parent's branch up to a point where the node can be inserted.
  32813. // If it isn't allowed in the whole branch, then of course don't split anything.
  32814. isAllowed = this._checkAndSplitToAllowedPosition( node );
  32815. if ( !isAllowed ) {
  32816. this._handleDisallowedNode( node );
  32817. return;
  32818. }
  32819. }
  32820. // Add node to the current temporary DocumentFragment.
  32821. this._appendToFragment( node );
  32822. // Store the first and last nodes for easy access for merging with sibling nodes.
  32823. if ( !this._firstNode ) {
  32824. this._firstNode = node;
  32825. }
  32826. this._lastNode = node;
  32827. }
  32828. /**
  32829. * Inserts the temporary DocumentFragment into the model.
  32830. *
  32831. * @private
  32832. */
  32833. _insertPartialFragment() {
  32834. if ( this._documentFragment.isEmpty ) {
  32835. return;
  32836. }
  32837. const livePosition = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( this.position, 'toNext' );
  32838. this._setAffectedBoundaries( this.position );
  32839. // If the very first node of the whole insertion process is inserted, insert it separately for OT reasons (undo).
  32840. // Note: there can be multiple calls to `_insertPartialFragment()` during one insertion process.
  32841. // Note: only the very first node can be merged so we have to do separate operation only for it.
  32842. if ( this._documentFragment.getChild( 0 ) == this._firstNode ) {
  32843. this.writer.insert( this._firstNode, this.position );
  32844. // We must merge the first node just after inserting it to avoid problems with OT.
  32845. // (See: https://github.com/ckeditor/ckeditor5/pull/8773#issuecomment-760945652).
  32846. this._mergeOnLeft();
  32847. this.position = livePosition.toPosition();
  32848. }
  32849. // Insert the remaining nodes from document fragment.
  32850. if ( !this._documentFragment.isEmpty ) {
  32851. this.writer.insert( this._documentFragment, this.position );
  32852. }
  32853. this._documentFragmentPosition = this.writer.createPositionAt( this._documentFragment, 0 );
  32854. this.position = livePosition.toPosition();
  32855. livePosition.detach();
  32856. }
  32857. /**
  32858. * @private
  32859. * @param {module:engine/model/element~Element} node The object element.
  32860. */
  32861. _handleObject( node ) {
  32862. // Try finding it a place in the tree.
  32863. if ( this._checkAndSplitToAllowedPosition( node ) ) {
  32864. this._appendToFragment( node );
  32865. }
  32866. // Try autoparagraphing.
  32867. else {
  32868. this._tryAutoparagraphing( node );
  32869. }
  32870. }
  32871. /**
  32872. * @private
  32873. * @param {module:engine/model/node~Node} node The disallowed node which needs to be handled.
  32874. */
  32875. _handleDisallowedNode( node ) {
  32876. // If the node is an element, try inserting its children (strip the parent).
  32877. if ( node.is( 'element' ) ) {
  32878. this.handleNodes( node.getChildren() );
  32879. }
  32880. // If text is not allowed, try autoparagraphing it.
  32881. else {
  32882. this._tryAutoparagraphing( node );
  32883. }
  32884. }
  32885. /**
  32886. * Append a node to the temporary DocumentFragment.
  32887. *
  32888. * @private
  32889. * @param {module:engine/model/node~Node} node The node to insert.
  32890. */
  32891. _appendToFragment( node ) {
  32892. /* istanbul ignore if */
  32893. if ( !this.schema.checkChild( this.position, node ) ) {
  32894. // Algorithm's correctness check. We should never end up here but it's good to know that we did.
  32895. // Note that it would often be a silent issue if we insert node in a place where it's not allowed.
  32896. /**
  32897. * Given node cannot be inserted on the given position.
  32898. *
  32899. * @error insertcontent-wrong-position
  32900. * @param {module:engine/model/node~Node} node Node to insert.
  32901. * @param {module:engine/model/position~Position} position Position to insert the node at.
  32902. */
  32903. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"](
  32904. 'insertcontent-wrong-position',
  32905. this,
  32906. { node, position: this.position }
  32907. );
  32908. }
  32909. this.writer.insert( node, this._documentFragmentPosition );
  32910. this._documentFragmentPosition = this._documentFragmentPosition.getShiftedBy( node.offsetSize );
  32911. // The last inserted object should be selected because we can't put a collapsed selection after it.
  32912. if ( this.schema.isObject( node ) && !this.schema.checkChild( this.position, '$text' ) ) {
  32913. this.nodeToSelect = node;
  32914. } else {
  32915. this.nodeToSelect = null;
  32916. }
  32917. this._filterAttributesOf.push( node );
  32918. }
  32919. /**
  32920. * Sets `_affectedStart` and `_affectedEnd` to the given `position`. Should be used before a change is done during insertion process to
  32921. * mark the affected range.
  32922. *
  32923. * This method is used before inserting a node or splitting a parent node. `_affectedStart` and `_affectedEnd` are also changed
  32924. * during merging, but the logic there is more complicated so it is left out of this function.
  32925. *
  32926. * @private
  32927. * @param {module:engine/model/position~Position} position
  32928. */
  32929. _setAffectedBoundaries( position ) {
  32930. // Set affected boundaries stickiness so that those position will "expand" when something is inserted in between them:
  32931. // <paragraph>Foo][bar</paragraph> -> <paragraph>Foo]xx[bar</paragraph>
  32932. // This is why it cannot be a range but two separate positions.
  32933. if ( !this._affectedStart ) {
  32934. this._affectedStart = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( position, 'toPrevious' );
  32935. }
  32936. // If `_affectedEnd` is before the new boundary position, expand `_affectedEnd`. This can happen if first inserted node was
  32937. // inserted into the parent but the next node is moved-out of that parent:
  32938. // (1) <paragraph>Foo][</paragraph> -> <paragraph>Foo]xx[</paragraph>
  32939. // (2) <paragraph>Foo]xx[</paragraph> -> <paragraph>Foo]xx</paragraph><widget></widget>[
  32940. if ( !this._affectedEnd || this._affectedEnd.isBefore( position ) ) {
  32941. if ( this._affectedEnd ) {
  32942. this._affectedEnd.detach();
  32943. }
  32944. this._affectedEnd = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( position, 'toNext' );
  32945. }
  32946. }
  32947. /**
  32948. * Merges the previous sibling of the first node if it should be merged.
  32949. *
  32950. * After the content was inserted we may try to merge it with its siblings.
  32951. * This should happen only if the selection was in those elements initially.
  32952. *
  32953. * @private
  32954. */
  32955. _mergeOnLeft() {
  32956. const node = this._firstNode;
  32957. if ( !( node instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) ) {
  32958. return;
  32959. }
  32960. if ( !this._canMergeLeft( node ) ) {
  32961. return;
  32962. }
  32963. const mergePosLeft = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createBefore( node );
  32964. mergePosLeft.stickiness = 'toNext';
  32965. const livePosition = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( this.position, 'toNext' );
  32966. // If `_affectedStart` is sames as merge position, it means that the element "marked" by `_affectedStart` is going to be
  32967. // removed and its contents will be moved. This won't transform `LivePosition` so `_affectedStart` needs to be moved
  32968. // by hand to properly reflect affected range. (Due to `_affectedStart` and `_affectedEnd` stickiness, the "range" is
  32969. // shown as `][`).
  32970. //
  32971. // Example - insert `<paragraph>Abc</paragraph><paragraph>Xyz</paragraph>` at the end of `<paragraph>Foo^</paragraph>`:
  32972. //
  32973. // <paragraph>Foo</paragraph><paragraph>Bar</paragraph> -->
  32974. // <paragraph>Foo</paragraph>]<paragraph>Abc</paragraph><paragraph>Xyz</paragraph>[<paragraph>Bar</paragraph> -->
  32975. // <paragraph>Foo]Abc</paragraph><paragraph>Xyz</paragraph>[<paragraph>Bar</paragraph>
  32976. //
  32977. // Note, that if we are here then something must have been inserted, so `_affectedStart` and `_affectedEnd` have to be set.
  32978. if ( this._affectedStart.isEqual( mergePosLeft ) ) {
  32979. this._affectedStart.detach();
  32980. this._affectedStart = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAt( mergePosLeft.nodeBefore, 'end', 'toPrevious' );
  32981. }
  32982. // We need to update the references to the first and last nodes if they will be merged into the previous sibling node
  32983. // because the reference would point to the removed node.
  32984. //
  32985. // <p>A^A</p> + <p>X</p>
  32986. //
  32987. // <p>A</p>^<p>A</p>
  32988. // <p>A</p><p>X</p><p>A</p>
  32989. // <p>AX</p><p>A</p>
  32990. // <p>AXA</p>
  32991. if ( this._firstNode === this._lastNode ) {
  32992. this._firstNode = mergePosLeft.nodeBefore;
  32993. this._lastNode = mergePosLeft.nodeBefore;
  32994. }
  32995. this.writer.merge( mergePosLeft );
  32996. // If only one element (the merged one) is in the "affected range", also move the affected range end appropriately.
  32997. //
  32998. // Example - insert `<paragraph>Abc</paragraph>` at the of `<paragraph>Foo^</paragraph>`:
  32999. //
  33000. // <paragraph>Foo</paragraph><paragraph>Bar</paragraph> -->
  33001. // <paragraph>Foo</paragraph>]<paragraph>Abc</paragraph>[<paragraph>Bar</paragraph> -->
  33002. // <paragraph>Foo]Abc</paragraph>[<paragraph>Bar</paragraph> -->
  33003. // <paragraph>Foo]Abc[</paragraph><paragraph>Bar</paragraph>
  33004. if ( mergePosLeft.isEqual( this._affectedEnd ) && this._firstNode === this._lastNode ) {
  33005. this._affectedEnd.detach();
  33006. this._affectedEnd = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAt( mergePosLeft.nodeBefore, 'end', 'toNext' );
  33007. }
  33008. this.position = livePosition.toPosition();
  33009. livePosition.detach();
  33010. // After merge elements that were marked by _insert() to be filtered might be gone so
  33011. // we need to mark the new container.
  33012. this._filterAttributesOf.push( this.position.parent );
  33013. mergePosLeft.detach();
  33014. }
  33015. /**
  33016. * Merges the next sibling of the last node if it should be merged.
  33017. *
  33018. * After the content was inserted we may try to merge it with its siblings.
  33019. * This should happen only if the selection was in those elements initially.
  33020. *
  33021. * @private
  33022. */
  33023. _mergeOnRight() {
  33024. const node = this._lastNode;
  33025. if ( !( node instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) ) {
  33026. return;
  33027. }
  33028. if ( !this._canMergeRight( node ) ) {
  33029. return;
  33030. }
  33031. const mergePosRight = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAfter( node );
  33032. mergePosRight.stickiness = 'toNext';
  33033. /* istanbul ignore if */
  33034. if ( !this.position.isEqual( mergePosRight ) ) {
  33035. // Algorithm's correctness check. We should never end up here but it's good to know that we did.
  33036. // At this point the insertion position should be after the node we'll merge. If it isn't,
  33037. // it should need to be secured as in the left merge case.
  33038. /**
  33039. * An internal error occurred when merging inserted content with its siblings.
  33040. * The insertion position should equal the merge position.
  33041. *
  33042. * If you encountered this error, report it back to the CKEditor 5 team
  33043. * with as many details as possible regarding the content being inserted and the insertion position.
  33044. *
  33045. * @error insertcontent-invalid-insertion-position
  33046. */
  33047. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"]( 'insertcontent-invalid-insertion-position', this );
  33048. }
  33049. // Move the position to the previous node, so it isn't moved to the graveyard on merge.
  33050. // <p>x</p>[]<p>y</p> => <p>x[]</p><p>y</p>
  33051. this.position = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( mergePosRight.nodeBefore, 'end' );
  33052. // Explanation of setting position stickiness to `'toPrevious'`:
  33053. // OK: <p>xx[]</p> + <p>yy</p> => <p>xx[]yy</p> (when sticks to previous)
  33054. // NOK: <p>xx[]</p> + <p>yy</p> => <p>xxyy[]</p> (when sticks to next)
  33055. const livePosition = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( this.position, 'toPrevious' );
  33056. // See comment in `_mergeOnLeft()` on moving `_affectedStart`.
  33057. if ( this._affectedEnd.isEqual( mergePosRight ) ) {
  33058. this._affectedEnd.detach();
  33059. this._affectedEnd = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAt( mergePosRight.nodeBefore, 'end', 'toNext' );
  33060. }
  33061. // We need to update the references to the first and last nodes if they will be merged into the previous sibling node
  33062. // because the reference would point to the removed node.
  33063. //
  33064. // <p>A^A</p> + <p>X</p>
  33065. //
  33066. // <p>A</p>^<p>A</p>
  33067. // <p>A</p><p>X</p><p>A</p>
  33068. // <p>AX</p><p>A</p>
  33069. // <p>AXA</p>
  33070. if ( this._firstNode === this._lastNode ) {
  33071. this._firstNode = mergePosRight.nodeBefore;
  33072. this._lastNode = mergePosRight.nodeBefore;
  33073. }
  33074. this.writer.merge( mergePosRight );
  33075. // See comment in `_mergeOnLeft()` on moving `_affectedStart`.
  33076. if ( mergePosRight.getShiftedBy( -1 ).isEqual( this._affectedStart ) && this._firstNode === this._lastNode ) {
  33077. this._affectedStart.detach();
  33078. this._affectedStart = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAt( mergePosRight.nodeBefore, 0, 'toPrevious' );
  33079. }
  33080. this.position = livePosition.toPosition();
  33081. livePosition.detach();
  33082. // After merge elements that were marked by _insert() to be filtered might be gone so
  33083. // we need to mark the new container.
  33084. this._filterAttributesOf.push( this.position.parent );
  33085. mergePosRight.detach();
  33086. }
  33087. /**
  33088. * Checks whether specified node can be merged with previous sibling element.
  33089. *
  33090. * @private
  33091. * @param {module:engine/model/node~Node} node The node which could potentially be merged.
  33092. * @returns {Boolean}
  33093. */
  33094. _canMergeLeft( node ) {
  33095. const previousSibling = node.previousSibling;
  33096. return ( previousSibling instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) &&
  33097. this.canMergeWith.has( previousSibling ) &&
  33098. this.model.schema.checkMerge( previousSibling, node );
  33099. }
  33100. /**
  33101. * Checks whether specified node can be merged with next sibling element.
  33102. *
  33103. * @private
  33104. * @param {module:engine/model/node~Node} node The node which could potentially be merged.
  33105. * @returns {Boolean}
  33106. */
  33107. _canMergeRight( node ) {
  33108. const nextSibling = node.nextSibling;
  33109. return ( nextSibling instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) &&
  33110. this.canMergeWith.has( nextSibling ) &&
  33111. this.model.schema.checkMerge( node, nextSibling );
  33112. }
  33113. /**
  33114. * Tries wrapping the node in a new paragraph and inserting it this way.
  33115. *
  33116. * @private
  33117. * @param {module:engine/model/node~Node} node The node which needs to be autoparagraphed.
  33118. */
  33119. _tryAutoparagraphing( node ) {
  33120. const paragraph = this.writer.createElement( 'paragraph' );
  33121. // Do not autoparagraph if the paragraph won't be allowed there,
  33122. // cause that would lead to an infinite loop. The paragraph would be rejected in
  33123. // the next _handleNode() call and we'd be here again.
  33124. if ( this._getAllowedIn( this.position.parent, paragraph ) && this.schema.checkChild( paragraph, node ) ) {
  33125. paragraph._appendChild( node );
  33126. this._handleNode( paragraph );
  33127. }
  33128. }
  33129. /**
  33130. * Checks if a node can be inserted in the given position or it would be accepted if a paragraph would be inserted.
  33131. * It also handles inserting the paragraph.
  33132. *
  33133. * @private
  33134. * @param {module:engine/model/node~Node} node The node.
  33135. * @returns {Boolean} Whether an allowed position was found.
  33136. * `false` is returned if the node isn't allowed at the current position or in auto paragraph, `true` if was.
  33137. */
  33138. _checkAndAutoParagraphToAllowedPosition( node ) {
  33139. if ( this.schema.checkChild( this.position.parent, node ) ) {
  33140. return true;
  33141. }
  33142. // Do not auto paragraph if the paragraph won't be allowed there,
  33143. // cause that would lead to an infinite loop. The paragraph would be rejected in
  33144. // the next _handleNode() call and we'd be here again.
  33145. if ( !this.schema.checkChild( this.position.parent, 'paragraph' ) || !this.schema.checkChild( 'paragraph', node ) ) {
  33146. return false;
  33147. }
  33148. // Insert nodes collected in temporary DocumentFragment if the position parent needs change to process further nodes.
  33149. this._insertPartialFragment();
  33150. // Insert a paragraph and move insertion position to it.
  33151. const paragraph = this.writer.createElement( 'paragraph' );
  33152. this.writer.insert( paragraph, this.position );
  33153. this._setAffectedBoundaries( this.position );
  33154. this._lastAutoParagraph = paragraph;
  33155. this.position = this.writer.createPositionAt( paragraph, 0 );
  33156. return true;
  33157. }
  33158. /**
  33159. * @private
  33160. * @param {module:engine/model/node~Node} node
  33161. * @returns {Boolean} Whether an allowed position was found.
  33162. * `false` is returned if the node isn't allowed at any position up in the tree, `true` if was.
  33163. */
  33164. _checkAndSplitToAllowedPosition( node ) {
  33165. const allowedIn = this._getAllowedIn( this.position.parent, node );
  33166. if ( !allowedIn ) {
  33167. return false;
  33168. }
  33169. // Insert nodes collected in temporary DocumentFragment if the position parent needs change to process further nodes.
  33170. if ( allowedIn != this.position.parent ) {
  33171. this._insertPartialFragment();
  33172. }
  33173. while ( allowedIn != this.position.parent ) {
  33174. if ( this.position.isAtStart ) {
  33175. // If insertion position is at the beginning of the parent, move it out instead of splitting.
  33176. // <p>^Foo</p> -> ^<p>Foo</p>
  33177. const parent = this.position.parent;
  33178. this.position = this.writer.createPositionBefore( parent );
  33179. // Special case – parent is empty (<p>^</p>).
  33180. //
  33181. // 1. parent.isEmpty
  33182. // We can remove the element after moving insertion position out of it.
  33183. //
  33184. // 2. parent.parent === allowedIn
  33185. // However parent should remain in place when allowed element is above limit element in document tree.
  33186. // For example there shouldn't be allowed to remove empty paragraph from tableCell, when is pasted
  33187. // content allowed in $root.
  33188. if ( parent.isEmpty && parent.parent === allowedIn ) {
  33189. this.writer.remove( parent );
  33190. }
  33191. } else if ( this.position.isAtEnd ) {
  33192. // If insertion position is at the end of the parent, move it out instead of splitting.
  33193. // <p>Foo^</p> -> <p>Foo</p>^
  33194. this.position = this.writer.createPositionAfter( this.position.parent );
  33195. } else {
  33196. const tempPos = this.writer.createPositionAfter( this.position.parent );
  33197. this._setAffectedBoundaries( this.position );
  33198. this.writer.split( this.position );
  33199. this.position = tempPos;
  33200. this.canMergeWith.add( this.position.nodeAfter );
  33201. }
  33202. }
  33203. return true;
  33204. }
  33205. /**
  33206. * Gets the element in which the given node is allowed. It checks the passed element and all its ancestors.
  33207. *
  33208. * @private
  33209. * @param {module:engine/model/element~Element} contextElement The element in which context the node should be checked.
  33210. * @param {module:engine/model/node~Node} childNode The node to check.
  33211. * @returns {module:engine/model/element~Element|null}
  33212. */
  33213. _getAllowedIn( contextElement, childNode ) {
  33214. if ( this.schema.checkChild( contextElement, childNode ) ) {
  33215. return contextElement;
  33216. }
  33217. // If the child wasn't allowed in the context element and the element is a limit there's no point in
  33218. // checking any further towards the root. This is it: the limit is unsplittable and there's nothing
  33219. // we can do about it. Without this check, the algorithm will analyze parent of the limit and may create
  33220. // an illusion of the child being allowed. There's no way to insert it down there, though. It results in
  33221. // infinite loops.
  33222. if ( this.schema.isLimit( contextElement ) ) {
  33223. return null;
  33224. }
  33225. return this._getAllowedIn( contextElement.parent, childNode );
  33226. }
  33227. }
  33228. /***/ }),
  33229. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/modifyselection.js":
  33230. /*!************************************************************************************!*\
  33231. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/modifyselection.js ***!
  33232. \************************************************************************************/
  33233. /*! exports provided: default */
  33234. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33235. "use strict";
  33236. __webpack_require__.r(__webpack_exports__);
  33237. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return modifySelection; });
  33238. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  33239. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
  33240. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  33241. /* harmony import */ var _ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/unicode */ "./node_modules/@ckeditor/ckeditor5-utils/src/unicode.js");
  33242. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  33243. /**
  33244. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  33245. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  33246. */
  33247. /**
  33248. * @module engine/model/utils/modifyselection
  33249. */
  33250. const wordBoundaryCharacters = ' ,.?!:;"-()';
  33251. /**
  33252. * Modifies the selection. Currently, the supported modifications are:
  33253. *
  33254. * * Extending. The selection focus is moved in the specified `options.direction` with a step specified in `options.unit`.
  33255. * Possible values for `unit` are:
  33256. * * `'character'` (default) - moves selection by one user-perceived character. In most cases this means moving by one
  33257. * character in `String` sense. However, unicode also defines "combing marks". These are special symbols, that combines
  33258. * with a symbol before it ("base character") to create one user-perceived character. For example, `q̣̇` is a normal
  33259. * letter `q` with two "combining marks": upper dot (`Ux0307`) and lower dot (`Ux0323`). For most actions, i.e. extending
  33260. * selection by one position, it is correct to include both "base character" and all of it's "combining marks". That is
  33261. * why `'character'` value is most natural and common method of modifying selection.
  33262. * * `'codePoint'` - moves selection by one unicode code point. In contrary to, `'character'` unit, this will insert
  33263. * selection between "base character" and "combining mark", because "combining marks" have their own unicode code points.
  33264. * However, for technical reasons, unicode code points with values above `UxFFFF` are represented in native `String` by
  33265. * two characters, called "surrogate pairs". Halves of "surrogate pairs" have a meaning only when placed next to each other.
  33266. * For example `𨭎` is represented in `String` by `\uD862\uDF4E`. Both `\uD862` and `\uDF4E` do not have any meaning
  33267. * outside the pair (are rendered as ? when alone). Position between them would be incorrect. In this case, selection
  33268. * extension will include whole "surrogate pair".
  33269. * * `'word'` - moves selection by a whole word.
  33270. *
  33271. * **Note:** if you extend a forward selection in a backward direction you will in fact shrink it.
  33272. *
  33273. * **Note:** Use {@link module:engine/model/model~Model#modifySelection} instead of this function.
  33274. * This function is only exposed to be reusable in algorithms
  33275. * which change the {@link module:engine/model/model~Model#modifySelection}
  33276. * method's behavior.
  33277. *
  33278. * @param {module:engine/model/model~Model} model The model in context of which
  33279. * the selection modification should be performed.
  33280. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  33281. * The selection to modify.
  33282. * @param {Object} [options]
  33283. * @param {'forward'|'backward'} [options.direction='forward'] The direction in which the selection should be modified.
  33284. * @param {'character'|'codePoint'|'word'} [options.unit='character'] The unit by which selection should be modified.
  33285. */
  33286. function modifySelection( model, selection, options = {} ) {
  33287. const schema = model.schema;
  33288. const isForward = options.direction != 'backward';
  33289. const unit = options.unit ? options.unit : 'character';
  33290. const focus = selection.focus;
  33291. const walker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( {
  33292. boundaries: getSearchRange( focus, isForward ),
  33293. singleCharacters: true,
  33294. direction: isForward ? 'forward' : 'backward'
  33295. } );
  33296. const data = { walker, schema, isForward, unit };
  33297. let next;
  33298. while ( ( next = walker.next() ) ) {
  33299. if ( next.done ) {
  33300. return;
  33301. }
  33302. const position = tryExtendingTo( data, next.value );
  33303. if ( position ) {
  33304. if ( selection instanceof _documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  33305. model.change( writer => {
  33306. writer.setSelectionFocus( position );
  33307. } );
  33308. } else {
  33309. selection.setFocus( position );
  33310. }
  33311. return;
  33312. }
  33313. }
  33314. }
  33315. // Checks whether the selection can be extended to the the walker's next value (next position).
  33316. // @param {{ walker, unit, isForward, schema }} data
  33317. // @param {module:engine/view/treewalker~TreeWalkerValue} value
  33318. function tryExtendingTo( data, value ) {
  33319. const { isForward, walker, unit, schema } = data;
  33320. const { type, item, nextPosition } = value;
  33321. // If found text, we can certainly put the focus in it. Let's just find a correct position
  33322. // based on the unit.
  33323. if ( type == 'text' ) {
  33324. if ( data.unit === 'word' ) {
  33325. return getCorrectWordBreakPosition( walker, isForward );
  33326. }
  33327. return getCorrectPosition( walker, unit, isForward );
  33328. }
  33329. // Entering an element.
  33330. if ( type == ( isForward ? 'elementStart' : 'elementEnd' ) ) {
  33331. // If it's a selectable, we can select it now.
  33332. if ( schema.isSelectable( item ) ) {
  33333. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( item, isForward ? 'after' : 'before' );
  33334. }
  33335. // If text allowed on this position, extend to this place.
  33336. if ( schema.checkChild( nextPosition, '$text' ) ) {
  33337. return nextPosition;
  33338. }
  33339. }
  33340. // Leaving an element.
  33341. else {
  33342. // If leaving a limit element, stop.
  33343. if ( schema.isLimit( item ) ) {
  33344. // NOTE: Fast-forward the walker until the end.
  33345. walker.skip( () => true );
  33346. return;
  33347. }
  33348. // If text allowed on this position, extend to this place.
  33349. if ( schema.checkChild( nextPosition, '$text' ) ) {
  33350. return nextPosition;
  33351. }
  33352. }
  33353. }
  33354. // Finds a correct position by walking in a text node and checking whether selection can be extended to given position
  33355. // or should be extended further.
  33356. //
  33357. // @param {module:engine/model/treewalker~TreeWalker} walker
  33358. // @param {String} unit The unit by which selection should be modified.
  33359. function getCorrectPosition( walker, unit ) {
  33360. const textNode = walker.position.textNode;
  33361. if ( textNode ) {
  33362. const data = textNode.data;
  33363. let offset = walker.position.offset - textNode.startOffset;
  33364. while ( Object(_ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_3__["isInsideSurrogatePair"])( data, offset ) || ( unit == 'character' && Object(_ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_3__["isInsideCombinedSymbol"])( data, offset ) ) ) {
  33365. walker.next();
  33366. offset = walker.position.offset - textNode.startOffset;
  33367. }
  33368. }
  33369. return walker.position;
  33370. }
  33371. // Finds a correct position of a word break by walking in a text node and checking whether selection can be extended to given position
  33372. // or should be extended further.
  33373. //
  33374. // @param {module:engine/model/treewalker~TreeWalker} walker
  33375. // @param {Boolean} isForward Is the direction in which the selection should be modified is forward.
  33376. function getCorrectWordBreakPosition( walker, isForward ) {
  33377. let textNode = walker.position.textNode;
  33378. if ( textNode ) {
  33379. let offset = walker.position.offset - textNode.startOffset;
  33380. while ( !isAtWordBoundary( textNode.data, offset, isForward ) && !isAtNodeBoundary( textNode, offset, isForward ) ) {
  33381. walker.next();
  33382. // Check of adjacent text nodes with different attributes (like BOLD).
  33383. // Example : 'foofoo []bar<$text bold="true">bar</$text> bazbaz'
  33384. // should expand to : 'foofoo [bar<$text bold="true">bar</$text>] bazbaz'.
  33385. const nextNode = isForward ? walker.position.nodeAfter : walker.position.nodeBefore;
  33386. // Scan only text nodes. Ignore inline elements (like `<softBreak>`).
  33387. if ( nextNode && nextNode.is( '$text' ) ) {
  33388. // Check boundary char of an adjacent text node.
  33389. const boundaryChar = nextNode.data.charAt( isForward ? 0 : nextNode.data.length - 1 );
  33390. // Go to the next node if the character at the boundary of that node belongs to the same word.
  33391. if ( !wordBoundaryCharacters.includes( boundaryChar ) ) {
  33392. // If adjacent text node belongs to the same word go to it & reset values.
  33393. walker.next();
  33394. textNode = walker.position.textNode;
  33395. }
  33396. }
  33397. offset = walker.position.offset - textNode.startOffset;
  33398. }
  33399. }
  33400. return walker.position;
  33401. }
  33402. function getSearchRange( start, isForward ) {
  33403. const root = start.root;
  33404. const searchEnd = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( root, isForward ? 'end' : 0 );
  33405. if ( isForward ) {
  33406. return new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( start, searchEnd );
  33407. } else {
  33408. return new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( searchEnd, start );
  33409. }
  33410. }
  33411. // Checks if selection is on word boundary.
  33412. //
  33413. // @param {String} data The text node value to investigate.
  33414. // @param {Number} offset Position offset.
  33415. // @param {Boolean} isForward Is the direction in which the selection should be modified is forward.
  33416. function isAtWordBoundary( data, offset, isForward ) {
  33417. // The offset to check depends on direction.
  33418. const offsetToCheck = offset + ( isForward ? 0 : -1 );
  33419. return wordBoundaryCharacters.includes( data.charAt( offsetToCheck ) );
  33420. }
  33421. // Checks if selection is on node boundary.
  33422. //
  33423. // @param {module:engine/model/text~Text} textNode The text node to investigate.
  33424. // @param {Number} offset Position offset.
  33425. // @param {Boolean} isForward Is the direction in which the selection should be modified is forward.
  33426. function isAtNodeBoundary( textNode, offset, isForward ) {
  33427. return offset === ( isForward ? textNode.endOffset : 0 );
  33428. }
  33429. /***/ }),
  33430. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/selection-post-fixer.js":
  33431. /*!*****************************************************************************************!*\
  33432. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/selection-post-fixer.js ***!
  33433. \*****************************************************************************************/
  33434. /*! exports provided: injectSelectionPostFixer, mergeIntersectingRanges */
  33435. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33436. "use strict";
  33437. __webpack_require__.r(__webpack_exports__);
  33438. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectSelectionPostFixer", function() { return injectSelectionPostFixer; });
  33439. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeIntersectingRanges", function() { return mergeIntersectingRanges; });
  33440. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  33441. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  33442. /**
  33443. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  33444. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  33445. */
  33446. /**
  33447. * @module engine/model/utils/selection-post-fixer
  33448. */
  33449. /**
  33450. * Injects selection post-fixer to the model.
  33451. *
  33452. * The role of the selection post-fixer is to ensure that the selection is in a correct place
  33453. * after a {@link module:engine/model/model~Model#change `change()`} block was executed.
  33454. *
  33455. * The correct position means that:
  33456. *
  33457. * * All collapsed selection ranges are in a place where the {@link module:engine/model/schema~Schema}
  33458. * allows a `$text`.
  33459. * * None of the selection's non-collapsed ranges crosses a {@link module:engine/model/schema~Schema#isLimit limit element}
  33460. * boundary (a range must be rooted within one limit element).
  33461. * * Only {@link module:engine/model/schema~Schema#isSelectable selectable elements} can be selected from the outside
  33462. * (e.g. `[<paragraph>foo</paragraph>]` is invalid). This rule applies independently to both selection ends, so this
  33463. * selection is correct: `<paragraph>f[oo</paragraph><imageBlock></imageBlock>]`.
  33464. *
  33465. * If the position is not correct, the post-fixer will automatically correct it.
  33466. *
  33467. * ## Fixing a non-collapsed selection
  33468. *
  33469. * See as an example a selection that starts in a P1 element and ends inside the text of a TD element
  33470. * (`[` and `]` are range boundaries and `(l)` denotes an element defined as `isLimit=true`):
  33471. *
  33472. * root
  33473. * |- element P1
  33474. * | |- "foo" root
  33475. * |- element TABLE (l) P1 TABLE P2
  33476. * | |- element TR (l) f o[o TR TR b a r
  33477. * | | |- element TD (l) TD TD
  33478. * | | |- "aaa" a]a a b b b
  33479. * | |- element TR (l)
  33480. * | | |- element TD (l) ||
  33481. * | | |- "bbb" ||
  33482. * |- element P2 VV
  33483. * | |- "bar"
  33484. * root
  33485. * P1 TABLE] P2
  33486. * f o[o TR TR b a r
  33487. * TD TD
  33488. * a a a b b b
  33489. *
  33490. * In the example above, the TABLE, TR and TD are defined as `isLimit=true` in the schema. The range which is not contained within
  33491. * a single limit element must be expanded to select the outermost limit element. The range end is inside the text node of the TD element.
  33492. * As the TD element is a child of the TR and TABLE elements, where both are defined as `isLimit=true` in the schema, the range must be
  33493. * expanded to select the whole TABLE element.
  33494. *
  33495. * **Note** If the selection contains multiple ranges, the method returns a minimal set of ranges that are not intersecting after expanding
  33496. * them to select `isLimit=true` elements.
  33497. *
  33498. * @param {module:engine/model/model~Model} model
  33499. */
  33500. function injectSelectionPostFixer( model ) {
  33501. model.document.registerPostFixer( writer => selectionPostFixer( writer, model ) );
  33502. }
  33503. // The selection post-fixer.
  33504. //
  33505. // @param {module:engine/model/writer~Writer} writer
  33506. // @param {module:engine/model/model~Model} model
  33507. function selectionPostFixer( writer, model ) {
  33508. const selection = model.document.selection;
  33509. const schema = model.schema;
  33510. const ranges = [];
  33511. let wasFixed = false;
  33512. for ( const modelRange of selection.getRanges() ) {
  33513. // Go through all ranges in selection and try fixing each of them.
  33514. // Those ranges might overlap but will be corrected later.
  33515. const correctedRange = tryFixingRange( modelRange, schema );
  33516. // "Selection fixing" algorithms sometimes get lost. In consequence, it may happen
  33517. // that a new range is returned but, in fact, it has the same positions as the original
  33518. // range anyway. If this range is not discarded, a new selection will be set and that,
  33519. // for instance, would destroy the selection attributes. Let's make sure that the post-fixer
  33520. // actually worked first before setting a new selection.
  33521. //
  33522. // https://github.com/ckeditor/ckeditor5/issues/6693
  33523. if ( correctedRange && !correctedRange.isEqual( modelRange ) ) {
  33524. ranges.push( correctedRange );
  33525. wasFixed = true;
  33526. } else {
  33527. ranges.push( modelRange );
  33528. }
  33529. }
  33530. // If any of ranges were corrected update the selection.
  33531. if ( wasFixed ) {
  33532. writer.setSelection( mergeIntersectingRanges( ranges ), { backward: selection.isBackward } );
  33533. }
  33534. }
  33535. // Tries fixing a range if it's incorrect.
  33536. //
  33537. // @param {module:engine/model/range~Range} range
  33538. // @param {module:engine/model/schema~Schema} schema
  33539. // @returns {module:engine/model/range~Range|null} Returns fixed range or null if range is valid.
  33540. function tryFixingRange( range, schema ) {
  33541. if ( range.isCollapsed ) {
  33542. return tryFixingCollapsedRange( range, schema );
  33543. }
  33544. return tryFixingNonCollapsedRage( range, schema );
  33545. }
  33546. // Tries to fix collapsed ranges.
  33547. //
  33548. // * Fixes situation when a range is in a place where $text is not allowed
  33549. //
  33550. // @param {module:engine/model/range~Range} range Collapsed range to fix.
  33551. // @param {module:engine/model/schema~Schema} schema
  33552. // @returns {module:engine/model/range~Range|null} Returns fixed range or null if range is valid.
  33553. function tryFixingCollapsedRange( range, schema ) {
  33554. const originalPosition = range.start;
  33555. const nearestSelectionRange = schema.getNearestSelectionRange( originalPosition );
  33556. // This might be null, i.e. when the editor data is empty or the selection is inside a limit element
  33557. // that doesn't allow text inside.
  33558. // In the first case, there is no need to fix the selection range.
  33559. // In the second, let's go up to the outer selectable element
  33560. if ( !nearestSelectionRange ) {
  33561. const ancestorObject = originalPosition.getAncestors().reverse().find( item => schema.isObject( item ) );
  33562. if ( ancestorObject ) {
  33563. return _range__WEBPACK_IMPORTED_MODULE_0__["default"]._createOn( ancestorObject );
  33564. }
  33565. return null;
  33566. }
  33567. if ( !nearestSelectionRange.isCollapsed ) {
  33568. return nearestSelectionRange;
  33569. }
  33570. const fixedPosition = nearestSelectionRange.start;
  33571. // Fixed position is the same as original - no need to return corrected range.
  33572. if ( originalPosition.isEqual( fixedPosition ) ) {
  33573. return null;
  33574. }
  33575. return new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( fixedPosition );
  33576. }
  33577. // Tries to fix an expanded range.
  33578. //
  33579. // @param {module:engine/model/range~Range} range Expanded range to fix.
  33580. // @param {module:engine/model/schema~Schema} schema
  33581. // @returns {module:engine/model/range~Range|null} Returns fixed range or null if range is valid.
  33582. function tryFixingNonCollapsedRage( range, schema ) {
  33583. const { start, end } = range;
  33584. const isTextAllowedOnStart = schema.checkChild( start, '$text' );
  33585. const isTextAllowedOnEnd = schema.checkChild( end, '$text' );
  33586. const startLimitElement = schema.getLimitElement( start );
  33587. const endLimitElement = schema.getLimitElement( end );
  33588. // Ranges which both end are inside the same limit element (or root) might needs only minor fix.
  33589. if ( startLimitElement === endLimitElement ) {
  33590. // Range is valid when both position allows to place a text:
  33591. // - <block>f[oobarba]z</block>
  33592. // This would be "fixed" by a next check but as it will be the same it's better to return null so the selection stays the same.
  33593. if ( isTextAllowedOnStart && isTextAllowedOnEnd ) {
  33594. return null;
  33595. }
  33596. // Range that is on non-limit element (or is partially) must be fixed so it is placed inside the block around $text:
  33597. // - [<block>foo</block>] -> <block>[foo]</block>
  33598. // - [<block>foo]</block> -> <block>[foo]</block>
  33599. // - <block>f[oo</block>] -> <block>f[oo]</block>
  33600. // - [<block>foo</block><selectable></selectable>] -> <block>[foo</block><selectable></selectable>]
  33601. if ( checkSelectionOnNonLimitElements( start, end, schema ) ) {
  33602. const isStartBeforeSelectable = start.nodeAfter && schema.isSelectable( start.nodeAfter );
  33603. const fixedStart = isStartBeforeSelectable ? null : schema.getNearestSelectionRange( start, 'forward' );
  33604. const isEndAfterSelectable = end.nodeBefore && schema.isSelectable( end.nodeBefore );
  33605. const fixedEnd = isEndAfterSelectable ? null : schema.getNearestSelectionRange( end, 'backward' );
  33606. // The schema.getNearestSelectionRange might return null - if that happens use original position.
  33607. const rangeStart = fixedStart ? fixedStart.start : start;
  33608. const rangeEnd = fixedEnd ? fixedEnd.end : end;
  33609. return new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( rangeStart, rangeEnd );
  33610. }
  33611. }
  33612. const isStartInLimit = startLimitElement && !startLimitElement.is( 'rootElement' );
  33613. const isEndInLimit = endLimitElement && !endLimitElement.is( 'rootElement' );
  33614. // At this point we eliminated valid positions on text nodes so if one of range positions is placed inside a limit element
  33615. // then the range crossed limit element boundaries and needs to be fixed.
  33616. if ( isStartInLimit || isEndInLimit ) {
  33617. const bothInSameParent = ( start.nodeAfter && end.nodeBefore ) && start.nodeAfter.parent === end.nodeBefore.parent;
  33618. const expandStart = isStartInLimit && ( !bothInSameParent || !isSelectable( start.nodeAfter, schema ) );
  33619. const expandEnd = isEndInLimit && ( !bothInSameParent || !isSelectable( end.nodeBefore, schema ) );
  33620. // Although we've already found limit element on start/end positions we must find the outer-most limit element.
  33621. // as limit elements might be nested directly inside (ie table > tableRow > tableCell).
  33622. let fixedStart = start;
  33623. let fixedEnd = end;
  33624. if ( expandStart ) {
  33625. fixedStart = _position__WEBPACK_IMPORTED_MODULE_1__["default"]._createBefore( findOutermostLimitAncestor( startLimitElement, schema ) );
  33626. }
  33627. if ( expandEnd ) {
  33628. fixedEnd = _position__WEBPACK_IMPORTED_MODULE_1__["default"]._createAfter( findOutermostLimitAncestor( endLimitElement, schema ) );
  33629. }
  33630. return new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( fixedStart, fixedEnd );
  33631. }
  33632. // Range was not fixed at this point so it is valid - ie it was placed around limit element already.
  33633. return null;
  33634. }
  33635. // Finds the outer-most ancestor.
  33636. //
  33637. // @param {module:engine/model/node~Node} startingNode
  33638. // @param {module:engine/model/schema~Schema} schema
  33639. // @param {String} expandToDirection Direction of expansion - either 'start' or 'end' of the range.
  33640. // @returns {module:engine/model/node~Node}
  33641. function findOutermostLimitAncestor( startingNode, schema ) {
  33642. let isLimitNode = startingNode;
  33643. let parent = isLimitNode;
  33644. // Find outer most isLimit block as such blocks might be nested (ie. in tables).
  33645. while ( schema.isLimit( parent ) && parent.parent ) {
  33646. isLimitNode = parent;
  33647. parent = parent.parent;
  33648. }
  33649. return isLimitNode;
  33650. }
  33651. // Checks whether any of range boundaries is placed around non-limit elements.
  33652. //
  33653. // @param {module:engine/model/position~Position} start
  33654. // @param {module:engine/model/position~Position} end
  33655. // @param {module:engine/model/schema~Schema} schema
  33656. // @returns {Boolean}
  33657. function checkSelectionOnNonLimitElements( start, end, schema ) {
  33658. const startIsOnBlock = ( start.nodeAfter && !schema.isLimit( start.nodeAfter ) ) || schema.checkChild( start, '$text' );
  33659. const endIsOnBlock = ( end.nodeBefore && !schema.isLimit( end.nodeBefore ) ) || schema.checkChild( end, '$text' );
  33660. // We should fix such selection when one of those nodes needs fixing.
  33661. return startIsOnBlock || endIsOnBlock;
  33662. }
  33663. /**
  33664. * Returns a minimal non-intersecting array of ranges without duplicates.
  33665. *
  33666. * @param {Array.<module:engine/model/range~Range>} Ranges to merge.
  33667. * @returns {Array.<module:engine/model/range~Range>} Array of unique and nonIntersecting ranges.
  33668. */
  33669. function mergeIntersectingRanges( ranges ) {
  33670. const rangesToMerge = [ ...ranges ];
  33671. const rangeIndexesToRemove = new Set();
  33672. let currentRangeIndex = 1;
  33673. while ( currentRangeIndex < rangesToMerge.length ) {
  33674. const currentRange = rangesToMerge[ currentRangeIndex ];
  33675. const previousRanges = rangesToMerge.slice( 0, currentRangeIndex );
  33676. for ( const [ previousRangeIndex, previousRange ] of previousRanges.entries() ) {
  33677. if ( rangeIndexesToRemove.has( previousRangeIndex ) ) {
  33678. continue;
  33679. }
  33680. if ( currentRange.isEqual( previousRange ) ) {
  33681. rangeIndexesToRemove.add( previousRangeIndex );
  33682. } else if ( currentRange.isIntersecting( previousRange ) ) {
  33683. rangeIndexesToRemove.add( previousRangeIndex );
  33684. rangeIndexesToRemove.add( currentRangeIndex );
  33685. const mergedRange = currentRange.getJoined( previousRange );
  33686. rangesToMerge.push( mergedRange );
  33687. }
  33688. }
  33689. currentRangeIndex++;
  33690. }
  33691. const nonIntersectingRanges = rangesToMerge.filter( ( _, index ) => !rangeIndexesToRemove.has( index ) );
  33692. return nonIntersectingRanges;
  33693. }
  33694. // Checks if node exists and if it's a selectable.
  33695. //
  33696. // @param {module:engine/model/node~Node} node
  33697. // @param {module:engine/model/schema~Schema} schema
  33698. // @returns {Boolean}
  33699. function isSelectable( node, schema ) {
  33700. return node && schema.isSelectable( node );
  33701. }
  33702. /***/ }),
  33703. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/writer.js":
  33704. /*!*********************************************************************!*\
  33705. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/writer.js ***!
  33706. \*********************************************************************/
  33707. /*! exports provided: default */
  33708. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33709. "use strict";
  33710. __webpack_require__.r(__webpack_exports__);
  33711. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Writer; });
  33712. /* harmony import */ var _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation/attributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js");
  33713. /* harmony import */ var _operation_detachoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./operation/detachoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/detachoperation.js");
  33714. /* harmony import */ var _operation_insertoperation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./operation/insertoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js");
  33715. /* harmony import */ var _operation_markeroperation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./operation/markeroperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js");
  33716. /* harmony import */ var _operation_moveoperation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./operation/moveoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js");
  33717. /* harmony import */ var _operation_renameoperation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./operation/renameoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js");
  33718. /* harmony import */ var _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./operation/rootattributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js");
  33719. /* harmony import */ var _operation_splitoperation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./operation/splitoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js");
  33720. /* harmony import */ var _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./operation/mergeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js");
  33721. /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js");
  33722. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  33723. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  33724. /* harmony import */ var _rootelement__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./rootelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js");
  33725. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  33726. /* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./range.js */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  33727. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  33728. /* harmony import */ var _ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
  33729. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  33730. /**
  33731. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  33732. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  33733. */
  33734. /**
  33735. * @module engine/model/writer
  33736. */
  33737. /**
  33738. * The model can only be modified by using the writer. It should be used whenever you want to create a node, modify
  33739. * child nodes, attributes or text, set the selection's position and its attributes.
  33740. *
  33741. * The instance of the writer is only available in the {@link module:engine/model/model~Model#change `change()`} or
  33742. * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()`}.
  33743. *
  33744. * model.change( writer => {
  33745. * writer.insertText( 'foo', paragraph, 'end' );
  33746. * } );
  33747. *
  33748. * Note that the writer should never be stored and used outside of the `change()` and
  33749. * `enqueueChange()` blocks.
  33750. *
  33751. * Note that writer's methods do not check the {@link module:engine/model/schema~Schema}. It is possible
  33752. * to create incorrect model structures by using the writer. Read more about in
  33753. * {@glink framework/guides/deep-dive/schema#who-checks-the-schema "Who checks the schema?"}.
  33754. *
  33755. * @see module:engine/model/model~Model#change
  33756. * @see module:engine/model/model~Model#enqueueChange
  33757. */
  33758. class Writer {
  33759. /**
  33760. * Creates a writer instance.
  33761. *
  33762. * **Note:** It is not recommended to use it directly. Use {@link module:engine/model/model~Model#change `Model#change()`} or
  33763. * {@link module:engine/model/model~Model#enqueueChange `Model#enqueueChange()`} instead.
  33764. *
  33765. * @protected
  33766. * @param {module:engine/model/model~Model} model
  33767. * @param {module:engine/model/batch~Batch} batch
  33768. */
  33769. constructor( model, batch ) {
  33770. /**
  33771. * Instance of the model on which this writer operates.
  33772. *
  33773. * @readonly
  33774. * @type {module:engine/model/model~Model}
  33775. */
  33776. this.model = model;
  33777. /**
  33778. * The batch to which this writer will add changes.
  33779. *
  33780. * @readonly
  33781. * @type {module:engine/model/batch~Batch}
  33782. */
  33783. this.batch = batch;
  33784. }
  33785. /**
  33786. * Creates a new {@link module:engine/model/text~Text text node}.
  33787. *
  33788. * writer.createText( 'foo' );
  33789. * writer.createText( 'foo', { bold: true } );
  33790. *
  33791. * @param {String} data Text data.
  33792. * @param {Object} [attributes] Text attributes.
  33793. * @returns {module:engine/model/text~Text} Created text node.
  33794. */
  33795. createText( data, attributes ) {
  33796. return new _text__WEBPACK_IMPORTED_MODULE_10__["default"]( data, attributes );
  33797. }
  33798. /**
  33799. * Creates a new {@link module:engine/model/element~Element element}.
  33800. *
  33801. * writer.createElement( 'paragraph' );
  33802. * writer.createElement( 'paragraph', { alignment: 'center' } );
  33803. *
  33804. * @param {String} name Name of the element.
  33805. * @param {Object} [attributes] Elements attributes.
  33806. * @returns {module:engine/model/element~Element} Created element.
  33807. */
  33808. createElement( name, attributes ) {
  33809. return new _element__WEBPACK_IMPORTED_MODULE_11__["default"]( name, attributes );
  33810. }
  33811. /**
  33812. * Creates a new {@link module:engine/model/documentfragment~DocumentFragment document fragment}.
  33813. *
  33814. * @returns {module:engine/model/documentfragment~DocumentFragment} Created document fragment.
  33815. */
  33816. createDocumentFragment() {
  33817. return new _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"]();
  33818. }
  33819. /**
  33820. * Creates a copy of the element and returns it. Created element has the same name and attributes as the original element.
  33821. * If clone is deep, the original element's children are also cloned. If not, then empty element is returned.
  33822. *
  33823. * @param {module:engine/model/element~Element} element The element to clone.
  33824. * @param {Boolean} [deep=true] If set to `true` clones element and all its children recursively. When set to `false`,
  33825. * element will be cloned without any child.
  33826. */
  33827. cloneElement( element, deep = true ) {
  33828. return element._clone( deep );
  33829. }
  33830. /**
  33831. * Inserts item on given position.
  33832. *
  33833. * const paragraph = writer.createElement( 'paragraph' );
  33834. * writer.insert( paragraph, position );
  33835. *
  33836. * Instead of using position you can use parent and offset:
  33837. *
  33838. * const text = writer.createText( 'foo' );
  33839. * writer.insert( text, paragraph, 5 );
  33840. *
  33841. * You can also use `end` instead of the offset to insert at the end:
  33842. *
  33843. * const text = writer.createText( 'foo' );
  33844. * writer.insert( text, paragraph, 'end' );
  33845. *
  33846. * Or insert before or after another element:
  33847. *
  33848. * const paragraph = writer.createElement( 'paragraph' );
  33849. * writer.insert( paragraph, anotherParagraph, 'after' );
  33850. *
  33851. * These parameters works the same way as {@link #createPositionAt `writer.createPositionAt()`}.
  33852. *
  33853. * Note that if the item already has parent it will be removed from the previous parent.
  33854. *
  33855. * Note that you cannot re-insert a node from a document to a different document or a document fragment. In this case,
  33856. * `model-writer-insert-forbidden-move` is thrown.
  33857. *
  33858. * If you want to move {@link module:engine/model/range~Range range} instead of an
  33859. * {@link module:engine/model/item~Item item} use {@link module:engine/model/writer~Writer#move `Writer#move()`}.
  33860. *
  33861. * **Note:** For a paste-like content insertion mechanism see
  33862. * {@link module:engine/model/model~Model#insertContent `model.insertContent()`}.
  33863. *
  33864. * @param {module:engine/model/item~Item|module:engine/model/documentfragment~DocumentFragment} item Item or document
  33865. * fragment to insert.
  33866. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  33867. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  33868. * second parameter is a {@link module:engine/model/item~Item model item}.
  33869. */
  33870. insert( item, itemOrPosition, offset = 0 ) {
  33871. this._assertWriterUsedCorrectly();
  33872. if ( item instanceof _text__WEBPACK_IMPORTED_MODULE_10__["default"] && item.data == '' ) {
  33873. return;
  33874. }
  33875. const position = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( itemOrPosition, offset );
  33876. // If item has a parent already.
  33877. if ( item.parent ) {
  33878. // We need to check if item is going to be inserted within the same document.
  33879. if ( isSameTree( item.root, position.root ) ) {
  33880. // If it's we just need to move it.
  33881. this.move( _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]._createOn( item ), position );
  33882. return;
  33883. }
  33884. // If it isn't the same root.
  33885. else {
  33886. if ( item.root.document ) {
  33887. /**
  33888. * Cannot move a node from a document to a different tree.
  33889. * It is forbidden to move a node that was already in a document outside of it.
  33890. *
  33891. * @error model-writer-insert-forbidden-move
  33892. */
  33893. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"](
  33894. 'model-writer-insert-forbidden-move',
  33895. this
  33896. );
  33897. } else {
  33898. // Move between two different document fragments or from document fragment to a document is possible.
  33899. // In that case, remove the item from it's original parent.
  33900. this.remove( item );
  33901. }
  33902. }
  33903. }
  33904. const version = position.root.document ? position.root.document.version : null;
  33905. const insert = new _operation_insertoperation__WEBPACK_IMPORTED_MODULE_2__["default"]( position, item, version );
  33906. if ( item instanceof _text__WEBPACK_IMPORTED_MODULE_10__["default"] ) {
  33907. insert.shouldReceiveAttributes = true;
  33908. }
  33909. this.batch.addOperation( insert );
  33910. this.model.applyOperation( insert );
  33911. // When element is a DocumentFragment we need to move its markers to Document#markers.
  33912. if ( item instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] ) {
  33913. for ( const [ markerName, markerRange ] of item.markers ) {
  33914. // We need to migrate marker range from DocumentFragment to Document.
  33915. const rangeRootPosition = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( markerRange.root, 0 );
  33916. const range = new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"](
  33917. markerRange.start._getCombined( rangeRootPosition, position ),
  33918. markerRange.end._getCombined( rangeRootPosition, position )
  33919. );
  33920. const options = { range, usingOperation: true, affectsData: true };
  33921. if ( this.model.markers.has( markerName ) ) {
  33922. this.updateMarker( markerName, options );
  33923. } else {
  33924. this.addMarker( markerName, options );
  33925. }
  33926. }
  33927. }
  33928. }
  33929. /**
  33930. * Creates and inserts text on given position. You can optionally set text attributes:
  33931. *
  33932. * writer.insertText( 'foo', position );
  33933. * writer.insertText( 'foo', { bold: true }, position );
  33934. *
  33935. * Instead of using position you can use parent and offset or define that text should be inserted at the end
  33936. * or before or after other node:
  33937. *
  33938. * // Inserts 'foo' in paragraph, at offset 5:
  33939. * writer.insertText( 'foo', paragraph, 5 );
  33940. * // Inserts 'foo' at the end of a paragraph:
  33941. * writer.insertText( 'foo', paragraph, 'end' );
  33942. * // Inserts 'foo' after an image:
  33943. * writer.insertText( 'foo', image, 'after' );
  33944. *
  33945. * These parameters work in the same way as {@link #createPositionAt `writer.createPositionAt()`}.
  33946. *
  33947. * @param {String} data Text data.
  33948. * @param {Object} [attributes] Text attributes.
  33949. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  33950. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  33951. * third parameter is a {@link module:engine/model/item~Item model item}.
  33952. */
  33953. insertText( text, attributes, itemOrPosition, offset ) {
  33954. if ( attributes instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] || attributes instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] || attributes instanceof _position__WEBPACK_IMPORTED_MODULE_13__["default"] ) {
  33955. this.insert( this.createText( text ), attributes, itemOrPosition );
  33956. } else {
  33957. this.insert( this.createText( text, attributes ), itemOrPosition, offset );
  33958. }
  33959. }
  33960. /**
  33961. * Creates and inserts element on given position. You can optionally set attributes:
  33962. *
  33963. * writer.insertElement( 'paragraph', position );
  33964. * writer.insertElement( 'paragraph', { alignment: 'center' }, position );
  33965. *
  33966. * Instead of using position you can use parent and offset or define that text should be inserted at the end
  33967. * or before or after other node:
  33968. *
  33969. * // Inserts paragraph in the root at offset 5:
  33970. * writer.insertElement( 'paragraph', root, 5 );
  33971. * // Inserts paragraph at the end of a blockquote:
  33972. * writer.insertElement( 'paragraph', blockquote, 'end' );
  33973. * // Inserts after an image:
  33974. * writer.insertElement( 'paragraph', image, 'after' );
  33975. *
  33976. * These parameters works the same way as {@link #createPositionAt `writer.createPositionAt()`}.
  33977. *
  33978. * @param {String} name Name of the element.
  33979. * @param {Object} [attributes] Elements attributes.
  33980. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  33981. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  33982. * third parameter is a {@link module:engine/model/item~Item model item}.
  33983. */
  33984. insertElement( name, attributes, itemOrPosition, offset ) {
  33985. if ( attributes instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] || attributes instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] || attributes instanceof _position__WEBPACK_IMPORTED_MODULE_13__["default"] ) {
  33986. this.insert( this.createElement( name ), attributes, itemOrPosition );
  33987. } else {
  33988. this.insert( this.createElement( name, attributes ), itemOrPosition, offset );
  33989. }
  33990. }
  33991. /**
  33992. * Inserts item at the end of the given parent.
  33993. *
  33994. * const paragraph = writer.createElement( 'paragraph' );
  33995. * writer.append( paragraph, root );
  33996. *
  33997. * Note that if the item already has parent it will be removed from the previous parent.
  33998. *
  33999. * If you want to move {@link module:engine/model/range~Range range} instead of an
  34000. * {@link module:engine/model/item~Item item} use {@link module:engine/model/writer~Writer#move `Writer#move()`}.
  34001. *
  34002. * @param {module:engine/model/item~Item|module:engine/model/documentfragment~DocumentFragment}
  34003. * item Item or document fragment to insert.
  34004. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} parent
  34005. */
  34006. append( item, parent ) {
  34007. this.insert( item, parent, 'end' );
  34008. }
  34009. /**
  34010. * Creates text node and inserts it at the end of the parent. You can optionally set text attributes:
  34011. *
  34012. * writer.appendText( 'foo', paragraph );
  34013. * writer.appendText( 'foo', { bold: true }, paragraph );
  34014. *
  34015. * @param {String} text Text data.
  34016. * @param {Object} [attributes] Text attributes.
  34017. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} parent
  34018. */
  34019. appendText( text, attributes, parent ) {
  34020. if ( attributes instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] || attributes instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) {
  34021. this.insert( this.createText( text ), attributes, 'end' );
  34022. } else {
  34023. this.insert( this.createText( text, attributes ), parent, 'end' );
  34024. }
  34025. }
  34026. /**
  34027. * Creates element and inserts it at the end of the parent. You can optionally set attributes:
  34028. *
  34029. * writer.appendElement( 'paragraph', root );
  34030. * writer.appendElement( 'paragraph', { alignment: 'center' }, root );
  34031. *
  34032. * @param {String} name Name of the element.
  34033. * @param {Object} [attributes] Elements attributes.
  34034. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} parent
  34035. */
  34036. appendElement( name, attributes, parent ) {
  34037. if ( attributes instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] || attributes instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) {
  34038. this.insert( this.createElement( name ), attributes, 'end' );
  34039. } else {
  34040. this.insert( this.createElement( name, attributes ), parent, 'end' );
  34041. }
  34042. }
  34043. /**
  34044. * Sets value of the attribute with given key on a {@link module:engine/model/item~Item model item}
  34045. * or on a {@link module:engine/model/range~Range range}.
  34046. *
  34047. * @param {String} key Attribute key.
  34048. * @param {*} value Attribute new value.
  34049. * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange
  34050. * Model item or range on which the attribute will be set.
  34051. */
  34052. setAttribute( key, value, itemOrRange ) {
  34053. this._assertWriterUsedCorrectly();
  34054. if ( itemOrRange instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ) {
  34055. const ranges = itemOrRange.getMinimalFlatRanges();
  34056. for ( const range of ranges ) {
  34057. setAttributeOnRange( this, key, value, range );
  34058. }
  34059. } else {
  34060. setAttributeOnItem( this, key, value, itemOrRange );
  34061. }
  34062. }
  34063. /**
  34064. * Sets values of attributes on a {@link module:engine/model/item~Item model item}
  34065. * or on a {@link module:engine/model/range~Range range}.
  34066. *
  34067. * writer.setAttributes( {
  34068. * bold: true,
  34069. * italic: true
  34070. * }, range );
  34071. *
  34072. * @param {Object} attributes Attributes keys and values.
  34073. * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange
  34074. * Model item or range on which the attributes will be set.
  34075. */
  34076. setAttributes( attributes, itemOrRange ) {
  34077. for ( const [ key, val ] of Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_16__["default"])( attributes ) ) {
  34078. this.setAttribute( key, val, itemOrRange );
  34079. }
  34080. }
  34081. /**
  34082. * Removes an attribute with given key from a {@link module:engine/model/item~Item model item}
  34083. * or from a {@link module:engine/model/range~Range range}.
  34084. *
  34085. * @param {String} key Attribute key.
  34086. * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange
  34087. * Model item or range from which the attribute will be removed.
  34088. */
  34089. removeAttribute( key, itemOrRange ) {
  34090. this._assertWriterUsedCorrectly();
  34091. if ( itemOrRange instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ) {
  34092. const ranges = itemOrRange.getMinimalFlatRanges();
  34093. for ( const range of ranges ) {
  34094. setAttributeOnRange( this, key, null, range );
  34095. }
  34096. } else {
  34097. setAttributeOnItem( this, key, null, itemOrRange );
  34098. }
  34099. }
  34100. /**
  34101. * Removes all attributes from all elements in the range or from the given item.
  34102. *
  34103. * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange
  34104. * Model item or range from which all attributes will be removed.
  34105. */
  34106. clearAttributes( itemOrRange ) {
  34107. this._assertWriterUsedCorrectly();
  34108. const removeAttributesFromItem = item => {
  34109. for ( const attribute of item.getAttributeKeys() ) {
  34110. this.removeAttribute( attribute, item );
  34111. }
  34112. };
  34113. if ( !( itemOrRange instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ) ) {
  34114. removeAttributesFromItem( itemOrRange );
  34115. } else {
  34116. for ( const item of itemOrRange.getItems() ) {
  34117. removeAttributesFromItem( item );
  34118. }
  34119. }
  34120. }
  34121. /**
  34122. * Moves all items in the source range to the target position.
  34123. *
  34124. * writer.move( sourceRange, targetPosition );
  34125. *
  34126. * Instead of the target position you can use parent and offset or define that range should be moved to the end
  34127. * or before or after chosen item:
  34128. *
  34129. * // Moves all items in the range to the paragraph at offset 5:
  34130. * writer.move( sourceRange, paragraph, 5 );
  34131. * // Moves all items in the range to the end of a blockquote:
  34132. * writer.move( sourceRange, blockquote, 'end' );
  34133. * // Moves all items in the range to a position after an image:
  34134. * writer.move( sourceRange, image, 'after' );
  34135. *
  34136. * These parameters works the same way as {@link #createPositionAt `writer.createPositionAt()`}.
  34137. *
  34138. * Note that items can be moved only within the same tree. It means that you can move items within the same root
  34139. * (element or document fragment) or between {@link module:engine/model/document~Document#roots documents roots},
  34140. * but you can not move items from document fragment to the document or from one detached element to another. Use
  34141. * {@link module:engine/model/writer~Writer#insert} in such cases.
  34142. *
  34143. * @param {module:engine/model/range~Range} range Source range.
  34144. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  34145. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  34146. * second parameter is a {@link module:engine/model/item~Item model item}.
  34147. */
  34148. move( range, itemOrPosition, offset ) {
  34149. this._assertWriterUsedCorrectly();
  34150. if ( !( range instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ) ) {
  34151. /**
  34152. * Invalid range to move.
  34153. *
  34154. * @error writer-move-invalid-range
  34155. */
  34156. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-move-invalid-range', this );
  34157. }
  34158. if ( !range.isFlat ) {
  34159. /**
  34160. * Range to move is not flat.
  34161. *
  34162. * @error writer-move-range-not-flat
  34163. */
  34164. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-move-range-not-flat', this );
  34165. }
  34166. const position = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( itemOrPosition, offset );
  34167. // Do not move anything if the move target is same as moved range start.
  34168. if ( position.isEqual( range.start ) ) {
  34169. return;
  34170. }
  34171. // If part of the marker is removed, create additional marker operation for undo purposes.
  34172. this._addOperationForAffectedMarkers( 'move', range );
  34173. if ( !isSameTree( range.root, position.root ) ) {
  34174. /**
  34175. * Range is going to be moved within not the same document. Please use
  34176. * {@link module:engine/model/writer~Writer#insert insert} instead.
  34177. *
  34178. * @error writer-move-different-document
  34179. */
  34180. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-move-different-document', this );
  34181. }
  34182. const version = range.root.document ? range.root.document.version : null;
  34183. const operation = new _operation_moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( range.start, range.end.offset - range.start.offset, position, version );
  34184. this.batch.addOperation( operation );
  34185. this.model.applyOperation( operation );
  34186. }
  34187. /**
  34188. * Removes given model {@link module:engine/model/item~Item item} or {@link module:engine/model/range~Range range}.
  34189. *
  34190. * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange Model item or range to remove.
  34191. */
  34192. remove( itemOrRange ) {
  34193. this._assertWriterUsedCorrectly();
  34194. const rangeToRemove = itemOrRange instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ? itemOrRange : _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]._createOn( itemOrRange );
  34195. const ranges = rangeToRemove.getMinimalFlatRanges().reverse();
  34196. for ( const flat of ranges ) {
  34197. // If part of the marker is removed, create additional marker operation for undo purposes.
  34198. this._addOperationForAffectedMarkers( 'move', flat );
  34199. applyRemoveOperation( flat.start, flat.end.offset - flat.start.offset, this.batch, this.model );
  34200. }
  34201. }
  34202. /**
  34203. * Merges two siblings at the given position.
  34204. *
  34205. * Node before and after the position have to be an element. Otherwise `writer-merge-no-element-before` or
  34206. * `writer-merge-no-element-after` error will be thrown.
  34207. *
  34208. * @param {module:engine/model/position~Position} position Position between merged elements.
  34209. */
  34210. merge( position ) {
  34211. this._assertWriterUsedCorrectly();
  34212. const nodeBefore = position.nodeBefore;
  34213. const nodeAfter = position.nodeAfter;
  34214. // If part of the marker is removed, create additional marker operation for undo purposes.
  34215. this._addOperationForAffectedMarkers( 'merge', position );
  34216. if ( !( nodeBefore instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) ) {
  34217. /**
  34218. * Node before merge position must be an element.
  34219. *
  34220. * @error writer-merge-no-element-before
  34221. */
  34222. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-merge-no-element-before', this );
  34223. }
  34224. if ( !( nodeAfter instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) ) {
  34225. /**
  34226. * Node after merge position must be an element.
  34227. *
  34228. * @error writer-merge-no-element-after
  34229. */
  34230. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-merge-no-element-after', this );
  34231. }
  34232. if ( !position.root.document ) {
  34233. this._mergeDetached( position );
  34234. } else {
  34235. this._merge( position );
  34236. }
  34237. }
  34238. /**
  34239. * Shortcut for {@link module:engine/model/model~Model#createPositionFromPath `Model#createPositionFromPath()`}.
  34240. *
  34241. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} root Root of the position.
  34242. * @param {Array.<Number>} path Position path. See {@link module:engine/model/position~Position#path}.
  34243. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
  34244. * See {@link module:engine/model/position~PositionStickiness}.
  34245. * @returns {module:engine/model/position~Position}
  34246. */
  34247. createPositionFromPath( root, path, stickiness ) {
  34248. return this.model.createPositionFromPath( root, path, stickiness );
  34249. }
  34250. /**
  34251. * Shortcut for {@link module:engine/model/model~Model#createPositionAt `Model#createPositionAt()`}.
  34252. *
  34253. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  34254. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  34255. * first parameter is a {@link module:engine/model/item~Item model item}.
  34256. * @returns {module:engine/model/position~Position}
  34257. */
  34258. createPositionAt( itemOrPosition, offset ) {
  34259. return this.model.createPositionAt( itemOrPosition, offset );
  34260. }
  34261. /**
  34262. * Shortcut for {@link module:engine/model/model~Model#createPositionAfter `Model#createPositionAfter()`}.
  34263. *
  34264. * @param {module:engine/model/item~Item} item Item after which the position should be placed.
  34265. * @returns {module:engine/model/position~Position}
  34266. */
  34267. createPositionAfter( item ) {
  34268. return this.model.createPositionAfter( item );
  34269. }
  34270. /**
  34271. * Shortcut for {@link module:engine/model/model~Model#createPositionBefore `Model#createPositionBefore()`}.
  34272. *
  34273. * @param {module:engine/model/item~Item} item Item after which the position should be placed.
  34274. * @returns {module:engine/model/position~Position}
  34275. */
  34276. createPositionBefore( item ) {
  34277. return this.model.createPositionBefore( item );
  34278. }
  34279. /**
  34280. * Shortcut for {@link module:engine/model/model~Model#createRange `Model#createRange()`}.
  34281. *
  34282. * @param {module:engine/model/position~Position} start Start position.
  34283. * @param {module:engine/model/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
  34284. * @returns {module:engine/model/range~Range}
  34285. */
  34286. createRange( start, end ) {
  34287. return this.model.createRange( start, end );
  34288. }
  34289. /**
  34290. * Shortcut for {@link module:engine/model/model~Model#createRangeIn `Model#createRangeIn()`}.
  34291. *
  34292. * @param {module:engine/model/element~Element} element Element which is a parent for the range.
  34293. * @returns {module:engine/model/range~Range}
  34294. */
  34295. createRangeIn( element ) {
  34296. return this.model.createRangeIn( element );
  34297. }
  34298. /**
  34299. * Shortcut for {@link module:engine/model/model~Model#createRangeOn `Model#createRangeOn()`}.
  34300. *
  34301. * @param {module:engine/model/element~Element} element Element which is a parent for the range.
  34302. * @returns {module:engine/model/range~Range}
  34303. */
  34304. createRangeOn( element ) {
  34305. return this.model.createRangeOn( element );
  34306. }
  34307. /**
  34308. * Shortcut for {@link module:engine/model/model~Model#createSelection `Model#createSelection()`}.
  34309. *
  34310. * @param {module:engine/model/selection~Selectable} selectable
  34311. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  34312. * @param {Object} [options]
  34313. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  34314. * @returns {module:engine/model/selection~Selection}
  34315. */
  34316. createSelection( selectable, placeOrOffset, options ) {
  34317. return this.model.createSelection( selectable, placeOrOffset, options );
  34318. }
  34319. /**
  34320. * Performs merge action in a detached tree.
  34321. *
  34322. * @private
  34323. * @param {module:engine/model/position~Position} position Position between merged elements.
  34324. */
  34325. _mergeDetached( position ) {
  34326. const nodeBefore = position.nodeBefore;
  34327. const nodeAfter = position.nodeAfter;
  34328. this.move( _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]._createIn( nodeAfter ), _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( nodeBefore, 'end' ) );
  34329. this.remove( nodeAfter );
  34330. }
  34331. /**
  34332. * Performs merge action in a non-detached tree.
  34333. *
  34334. * @private
  34335. * @param {module:engine/model/position~Position} position Position between merged elements.
  34336. */
  34337. _merge( position ) {
  34338. const targetPosition = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( position.nodeBefore, 'end' );
  34339. const sourcePosition = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( position.nodeAfter, 0 );
  34340. const graveyard = position.root.document.graveyard;
  34341. const graveyardPosition = new _position__WEBPACK_IMPORTED_MODULE_13__["default"]( graveyard, [ 0 ] );
  34342. const version = position.root.document.version;
  34343. const merge = new _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_8__["default"]( sourcePosition, position.nodeAfter.maxOffset, targetPosition, graveyardPosition, version );
  34344. this.batch.addOperation( merge );
  34345. this.model.applyOperation( merge );
  34346. }
  34347. /**
  34348. * Renames the given element.
  34349. *
  34350. * @param {module:engine/model/element~Element} element The element to rename.
  34351. * @param {String} newName New element name.
  34352. */
  34353. rename( element, newName ) {
  34354. this._assertWriterUsedCorrectly();
  34355. if ( !( element instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) ) {
  34356. /**
  34357. * Trying to rename an object which is not an instance of Element.
  34358. *
  34359. * @error writer-rename-not-element-instance
  34360. */
  34361. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"](
  34362. 'writer-rename-not-element-instance',
  34363. this
  34364. );
  34365. }
  34366. const version = element.root.document ? element.root.document.version : null;
  34367. const renameOperation = new _operation_renameoperation__WEBPACK_IMPORTED_MODULE_5__["default"]( _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createBefore( element ), element.name, newName, version );
  34368. this.batch.addOperation( renameOperation );
  34369. this.model.applyOperation( renameOperation );
  34370. }
  34371. /**
  34372. * Splits elements starting from the given position and going to the top of the model tree as long as given
  34373. * `limitElement` is reached. When `limitElement` is not defined then only the parent of the given position will be split.
  34374. *
  34375. * The element needs to have a parent. It cannot be a root element nor a document fragment.
  34376. * The `writer-split-element-no-parent` error will be thrown if you try to split an element with no parent.
  34377. *
  34378. * @param {module:engine/model/position~Position} position Position of split.
  34379. * @param {module:engine/model/node~Node} [limitElement] Stop splitting when this element will be reached.
  34380. * @returns {Object} result Split result.
  34381. * @returns {module:engine/model/position~Position} result.position Position between split elements.
  34382. * @returns {module:engine/model/range~Range} result.range Range that stars from the end of the first split element and ends
  34383. * at the beginning of the first copy element.
  34384. */
  34385. split( position, limitElement ) {
  34386. this._assertWriterUsedCorrectly();
  34387. let splitElement = position.parent;
  34388. if ( !splitElement.parent ) {
  34389. /**
  34390. * Element with no parent can not be split.
  34391. *
  34392. * @error writer-split-element-no-parent
  34393. */
  34394. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-split-element-no-parent', this );
  34395. }
  34396. // When limit element is not defined lets set splitElement parent as limit.
  34397. if ( !limitElement ) {
  34398. limitElement = splitElement.parent;
  34399. }
  34400. if ( !position.parent.getAncestors( { includeSelf: true } ).includes( limitElement ) ) {
  34401. /**
  34402. * Limit element is not a position ancestor.
  34403. *
  34404. * @error writer-split-invalid-limit-element
  34405. */
  34406. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-split-invalid-limit-element', this );
  34407. }
  34408. // We need to cache elements that will be created as a result of the first split because
  34409. // we need to create a range from the end of the first split element to the beginning of the
  34410. // first copy element. This should be handled by LiveRange but it doesn't work on detached nodes.
  34411. let firstSplitElement, firstCopyElement;
  34412. do {
  34413. const version = splitElement.root.document ? splitElement.root.document.version : null;
  34414. const howMany = splitElement.maxOffset - position.offset;
  34415. const insertionPosition = _operation_splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( position );
  34416. const split = new _operation_splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"]( position, howMany, insertionPosition, null, version );
  34417. this.batch.addOperation( split );
  34418. this.model.applyOperation( split );
  34419. // Cache result of the first split.
  34420. if ( !firstSplitElement && !firstCopyElement ) {
  34421. firstSplitElement = splitElement;
  34422. firstCopyElement = position.parent.nextSibling;
  34423. }
  34424. position = this.createPositionAfter( position.parent );
  34425. splitElement = position.parent;
  34426. } while ( splitElement !== limitElement );
  34427. return {
  34428. position,
  34429. range: new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]( _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( firstSplitElement, 'end' ), _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( firstCopyElement, 0 ) )
  34430. };
  34431. }
  34432. /**
  34433. * Wraps the given range with the given element or with a new element (if a string was passed).
  34434. *
  34435. * **Note:** range to wrap should be a "flat range" (see {@link module:engine/model/range~Range#isFlat `Range#isFlat`}).
  34436. * If not, an error will be thrown.
  34437. *
  34438. * @param {module:engine/model/range~Range} range Range to wrap.
  34439. * @param {module:engine/model/element~Element|String} elementOrString Element or name of element to wrap the range with.
  34440. */
  34441. wrap( range, elementOrString ) {
  34442. this._assertWriterUsedCorrectly();
  34443. if ( !range.isFlat ) {
  34444. /**
  34445. * Range to wrap is not flat.
  34446. *
  34447. * @error writer-wrap-range-not-flat
  34448. */
  34449. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-wrap-range-not-flat', this );
  34450. }
  34451. const element = elementOrString instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ? elementOrString : new _element__WEBPACK_IMPORTED_MODULE_11__["default"]( elementOrString );
  34452. if ( element.childCount > 0 ) {
  34453. /**
  34454. * Element to wrap with is not empty.
  34455. *
  34456. * @error writer-wrap-element-not-empty
  34457. */
  34458. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-wrap-element-not-empty', this );
  34459. }
  34460. if ( element.parent !== null ) {
  34461. /**
  34462. * Element to wrap with is already attached to a tree model.
  34463. *
  34464. * @error writer-wrap-element-attached
  34465. */
  34466. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-wrap-element-attached', this );
  34467. }
  34468. this.insert( element, range.start );
  34469. // Shift the range-to-wrap because we just inserted an element before that range.
  34470. const shiftedRange = new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]( range.start.getShiftedBy( 1 ), range.end.getShiftedBy( 1 ) );
  34471. this.move( shiftedRange, _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( element, 0 ) );
  34472. }
  34473. /**
  34474. * Unwraps children of the given element – all its children are moved before it and then the element is removed.
  34475. * Throws error if you try to unwrap an element which does not have a parent.
  34476. *
  34477. * @param {module:engine/model/element~Element} element Element to unwrap.
  34478. */
  34479. unwrap( element ) {
  34480. this._assertWriterUsedCorrectly();
  34481. if ( element.parent === null ) {
  34482. /**
  34483. * Trying to unwrap an element which has no parent.
  34484. *
  34485. * @error writer-unwrap-element-no-parent
  34486. */
  34487. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-unwrap-element-no-parent', this );
  34488. }
  34489. this.move( _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]._createIn( element ), this.createPositionAfter( element ) );
  34490. this.remove( element );
  34491. }
  34492. /**
  34493. * Adds a {@link module:engine/model/markercollection~Marker marker}. Marker is a named range, which tracks
  34494. * changes in the document and updates its range automatically, when model tree changes.
  34495. *
  34496. * As the first parameter you can set marker name.
  34497. *
  34498. * The required `options.usingOperation` parameter lets you decide if the marker should be managed by operations or not. See
  34499. * {@link module:engine/model/markercollection~Marker marker class description} to learn about the difference between
  34500. * markers managed by operations and not-managed by operations.
  34501. *
  34502. * The `options.affectsData` parameter, which defaults to `false`, allows you to define if a marker affects the data. It should be
  34503. * `true` when the marker change changes the data returned by the
  34504. * {@link module:core/editor/utils/dataapimixin~DataApi#getData `editor.getData()`} method.
  34505. * When set to `true` it fires the {@link module:engine/model/document~Document#event:change:data `change:data`} event.
  34506. * When set to `false` it fires the {@link module:engine/model/document~Document#event:change `change`} event.
  34507. *
  34508. * Create marker directly base on marker's name:
  34509. *
  34510. * addMarker( markerName, { range, usingOperation: false } );
  34511. *
  34512. * Create marker using operation:
  34513. *
  34514. * addMarker( markerName, { range, usingOperation: true } );
  34515. *
  34516. * Create marker that affects the editor data:
  34517. *
  34518. * addMarker( markerName, { range, usingOperation: false, affectsData: true } );
  34519. *
  34520. * Note: For efficiency reasons, it's best to create and keep as little markers as possible.
  34521. *
  34522. * @see module:engine/model/markercollection~Marker
  34523. * @param {String} name Name of a marker to create - must be unique.
  34524. * @param {Object} options
  34525. * @param {Boolean} options.usingOperation Flag indicating that the marker should be added by MarkerOperation.
  34526. * See {@link module:engine/model/markercollection~Marker#managedUsingOperations}.
  34527. * @param {module:engine/model/range~Range} options.range Marker range.
  34528. * @param {Boolean} [options.affectsData=false] Flag indicating that the marker changes the editor data.
  34529. * @returns {module:engine/model/markercollection~Marker} Marker that was set.
  34530. */
  34531. addMarker( name, options ) {
  34532. this._assertWriterUsedCorrectly();
  34533. if ( !options || typeof options.usingOperation != 'boolean' ) {
  34534. /**
  34535. * The `options.usingOperation` parameter is required when adding a new marker.
  34536. *
  34537. * @error writer-addmarker-no-usingoperation
  34538. */
  34539. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-addmarker-no-usingoperation', this );
  34540. }
  34541. const usingOperation = options.usingOperation;
  34542. const range = options.range;
  34543. const affectsData = options.affectsData === undefined ? false : options.affectsData;
  34544. if ( this.model.markers.has( name ) ) {
  34545. /**
  34546. * Marker with provided name already exists.
  34547. *
  34548. * @error writer-addmarker-marker-exists
  34549. */
  34550. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-addmarker-marker-exists', this );
  34551. }
  34552. if ( !range ) {
  34553. /**
  34554. * Range parameter is required when adding a new marker.
  34555. *
  34556. * @error writer-addmarker-no-range
  34557. */
  34558. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-addmarker-no-range', this );
  34559. }
  34560. if ( !usingOperation ) {
  34561. return this.model.markers._set( name, range, usingOperation, affectsData );
  34562. }
  34563. applyMarkerOperation( this, name, null, range, affectsData );
  34564. return this.model.markers.get( name );
  34565. }
  34566. /**
  34567. * Adds, updates or refreshes a {@link module:engine/model/markercollection~Marker marker}. Marker is a named range, which tracks
  34568. * changes in the document and updates its range automatically, when model tree changes. Still, it is possible to change the
  34569. * marker's range directly using this method.
  34570. *
  34571. * As the first parameter you can set marker name or instance. If none of them is provided, new marker, with a unique
  34572. * name is created and returned.
  34573. *
  34574. * As the second parameter you can set the new marker data or leave this parameter as empty which will just refresh
  34575. * the marker by triggering downcast conversion for it. Refreshing the marker is useful when you want to change
  34576. * the marker {@link module:engine/view/element~Element view element} without changing any marker data.
  34577. *
  34578. * let isCommentActive = false;
  34579. *
  34580. * model.conversion.markerToHighlight( {
  34581. * model: 'comment',
  34582. * view: data => {
  34583. * const classes = [ 'comment-marker' ];
  34584. *
  34585. * if ( isCommentActive ) {
  34586. * classes.push( 'comment-marker--active' );
  34587. * }
  34588. *
  34589. * return { classes };
  34590. * }
  34591. * } );
  34592. *
  34593. * // Change the property that indicates if marker is displayed as active or not.
  34594. * isCommentActive = true;
  34595. *
  34596. * // And refresh the marker to convert it with additional class.
  34597. * model.change( writer => writer.updateMarker( 'comment' ) );
  34598. *
  34599. * The `options.usingOperation` parameter lets you change if the marker should be managed by operations or not. See
  34600. * {@link module:engine/model/markercollection~Marker marker class description} to learn about the difference between
  34601. * markers managed by operations and not-managed by operations. It is possible to change this option for an existing marker.
  34602. *
  34603. * The `options.affectsData` parameter, which defaults to `false`, allows you to define if a marker affects the data. It should be
  34604. * `true` when the marker change changes the data returned by
  34605. * the {@link module:core/editor/utils/dataapimixin~DataApi#getData `editor.getData()`} method.
  34606. * When set to `true` it fires the {@link module:engine/model/document~Document#event:change:data `change:data`} event.
  34607. * When set to `false` it fires the {@link module:engine/model/document~Document#event:change `change`} event.
  34608. *
  34609. * Update marker directly base on marker's name:
  34610. *
  34611. * updateMarker( markerName, { range } );
  34612. *
  34613. * Update marker using operation:
  34614. *
  34615. * updateMarker( marker, { range, usingOperation: true } );
  34616. * updateMarker( markerName, { range, usingOperation: true } );
  34617. *
  34618. * Change marker's option (start using operations to manage it):
  34619. *
  34620. * updateMarker( marker, { usingOperation: true } );
  34621. *
  34622. * Change marker's option (inform the engine, that the marker does not affect the data anymore):
  34623. *
  34624. * updateMarker( markerName, { affectsData: false } );
  34625. *
  34626. * @see module:engine/model/markercollection~Marker
  34627. * @param {String|module:engine/model/markercollection~Marker} markerOrName Name of a marker to update, or a marker instance.
  34628. * @param {Object} [options] If options object is not defined then marker will be refreshed by triggering
  34629. * downcast conversion for this marker with the same data.
  34630. * @param {module:engine/model/range~Range} [options.range] Marker range to update.
  34631. * @param {Boolean} [options.usingOperation] Flag indicated whether the marker should be added by MarkerOperation.
  34632. * See {@link module:engine/model/markercollection~Marker#managedUsingOperations}.
  34633. * @param {Boolean} [options.affectsData] Flag indicating that the marker changes the editor data.
  34634. */
  34635. updateMarker( markerOrName, options ) {
  34636. this._assertWriterUsedCorrectly();
  34637. const markerName = typeof markerOrName == 'string' ? markerOrName : markerOrName.name;
  34638. const currentMarker = this.model.markers.get( markerName );
  34639. if ( !currentMarker ) {
  34640. /**
  34641. * Marker with provided name does not exists.
  34642. *
  34643. * @error writer-updatemarker-marker-not-exists
  34644. */
  34645. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-updatemarker-marker-not-exists', this );
  34646. }
  34647. if ( !options ) {
  34648. this.model.markers._refresh( currentMarker );
  34649. return;
  34650. }
  34651. const hasUsingOperationDefined = typeof options.usingOperation == 'boolean';
  34652. const affectsDataDefined = typeof options.affectsData == 'boolean';
  34653. // Use previously defined marker's affectsData if the property is not provided.
  34654. const affectsData = affectsDataDefined ? options.affectsData : currentMarker.affectsData;
  34655. if ( !hasUsingOperationDefined && !options.range && !affectsDataDefined ) {
  34656. /**
  34657. * One of the options is required - provide range, usingOperations or affectsData.
  34658. *
  34659. * @error writer-updatemarker-wrong-options
  34660. */
  34661. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-updatemarker-wrong-options', this );
  34662. }
  34663. const currentRange = currentMarker.getRange();
  34664. const updatedRange = options.range ? options.range : currentRange;
  34665. if ( hasUsingOperationDefined && options.usingOperation !== currentMarker.managedUsingOperations ) {
  34666. // The marker type is changed so it's necessary to create proper operations.
  34667. if ( options.usingOperation ) {
  34668. // If marker changes to a managed one treat this as synchronizing existing marker.
  34669. // Create `MarkerOperation` with `oldRange` set to `null`, so reverse operation will remove the marker.
  34670. applyMarkerOperation( this, markerName, null, updatedRange, affectsData );
  34671. } else {
  34672. // If marker changes to a marker that do not use operations then we need to create additional operation
  34673. // that removes that marker first.
  34674. applyMarkerOperation( this, markerName, currentRange, null, affectsData );
  34675. // Although not managed the marker itself should stay in model and its range should be preserver or changed to passed range.
  34676. this.model.markers._set( markerName, updatedRange, undefined, affectsData );
  34677. }
  34678. return;
  34679. }
  34680. // Marker's type doesn't change so update it accordingly.
  34681. if ( currentMarker.managedUsingOperations ) {
  34682. applyMarkerOperation( this, markerName, currentRange, updatedRange, affectsData );
  34683. } else {
  34684. this.model.markers._set( markerName, updatedRange, undefined, affectsData );
  34685. }
  34686. }
  34687. /**
  34688. * Removes given {@link module:engine/model/markercollection~Marker marker} or marker with given name.
  34689. * The marker is removed accordingly to how it has been created, so if the marker was created using operation,
  34690. * it will be destroyed using operation.
  34691. *
  34692. * @param {module:engine/model/markercollection~Marker|String} markerOrName Marker or marker name to remove.
  34693. */
  34694. removeMarker( markerOrName ) {
  34695. this._assertWriterUsedCorrectly();
  34696. const name = typeof markerOrName == 'string' ? markerOrName : markerOrName.name;
  34697. if ( !this.model.markers.has( name ) ) {
  34698. /**
  34699. * Trying to remove marker which does not exist.
  34700. *
  34701. * @error writer-removemarker-no-marker
  34702. */
  34703. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-removemarker-no-marker', this );
  34704. }
  34705. const marker = this.model.markers.get( name );
  34706. if ( !marker.managedUsingOperations ) {
  34707. this.model.markers._remove( name );
  34708. return;
  34709. }
  34710. const oldRange = marker.getRange();
  34711. applyMarkerOperation( this, name, oldRange, null, marker.affectsData );
  34712. }
  34713. /**
  34714. * Sets the document's selection (ranges and direction) to the specified location based on the given
  34715. * {@link module:engine/model/selection~Selectable selectable} or creates an empty selection if no arguments were passed.
  34716. *
  34717. * // Sets selection to the given range.
  34718. * const range = writer.createRange( start, end );
  34719. * writer.setSelection( range );
  34720. *
  34721. * // Sets selection to given ranges.
  34722. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  34723. * writer.setSelection( ranges );
  34724. *
  34725. * // Sets selection to other selection.
  34726. * const otherSelection = writer.createSelection();
  34727. * writer.setSelection( otherSelection );
  34728. *
  34729. * // Sets selection to the given document selection.
  34730. * const documentSelection = model.document.selection;
  34731. * writer.setSelection( documentSelection );
  34732. *
  34733. * // Sets collapsed selection at the given position.
  34734. * const position = writer.createPosition( root, path );
  34735. * writer.setSelection( position );
  34736. *
  34737. * // Sets collapsed selection at the position of the given node and an offset.
  34738. * writer.setSelection( paragraph, offset );
  34739. *
  34740. * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of
  34741. * that element and ends after the last child of that element.
  34742. *
  34743. * writer.setSelection( paragraph, 'in' );
  34744. *
  34745. * Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends just after the item.
  34746. *
  34747. * writer.setSelection( paragraph, 'on' );
  34748. *
  34749. * // Removes all selection's ranges.
  34750. * writer.setSelection( null );
  34751. *
  34752. * `Writer#setSelection()` allow passing additional options (`backward`) as the last argument.
  34753. *
  34754. * // Sets selection as backward.
  34755. * writer.setSelection( range, { backward: true } );
  34756. *
  34757. * Throws `writer-incorrect-use` error when the writer is used outside the `change()` block.
  34758. *
  34759. * @param {module:engine/model/selection~Selectable} selectable
  34760. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  34761. * @param {Object} [options]
  34762. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  34763. */
  34764. setSelection( selectable, placeOrOffset, options ) {
  34765. this._assertWriterUsedCorrectly();
  34766. this.model.document.selection._setTo( selectable, placeOrOffset, options );
  34767. }
  34768. /**
  34769. * Moves {@link module:engine/model/documentselection~DocumentSelection#focus} to the specified location.
  34770. *
  34771. * The location can be specified in the same form as
  34772. * {@link #createPositionAt `writer.createPositionAt()`} parameters.
  34773. *
  34774. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  34775. * @param {Number|'end'|'before'|'after'} [offset=0] Offset or one of the flags. Used only when
  34776. * first parameter is a {@link module:engine/model/item~Item model item}.
  34777. */
  34778. setSelectionFocus( itemOrPosition, offset ) {
  34779. this._assertWriterUsedCorrectly();
  34780. this.model.document.selection._setFocus( itemOrPosition, offset );
  34781. }
  34782. /**
  34783. * Sets attribute(s) on the selection. If attribute with the same key already is set, it's value is overwritten.
  34784. *
  34785. * Using key and value pair:
  34786. *
  34787. * writer.setSelectionAttribute( 'italic', true );
  34788. *
  34789. * Using key-value object:
  34790. *
  34791. * writer.setSelectionAttribute( { italic: true, bold: false } );
  34792. *
  34793. * Using iterable object:
  34794. *
  34795. * writer.setSelectionAttribute( new Map( [ [ 'italic', true ] ] ) );
  34796. *
  34797. * @param {String|Object|Iterable.<*>} keyOrObjectOrIterable Key of the attribute to set
  34798. * or object / iterable of key => value attribute pairs.
  34799. * @param {*} [value] Attribute value.
  34800. */
  34801. setSelectionAttribute( keyOrObjectOrIterable, value ) {
  34802. this._assertWriterUsedCorrectly();
  34803. if ( typeof keyOrObjectOrIterable === 'string' ) {
  34804. this._setSelectionAttribute( keyOrObjectOrIterable, value );
  34805. } else {
  34806. for ( const [ key, value ] of Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_16__["default"])( keyOrObjectOrIterable ) ) {
  34807. this._setSelectionAttribute( key, value );
  34808. }
  34809. }
  34810. }
  34811. /**
  34812. * Removes attribute(s) with given key(s) from the selection.
  34813. *
  34814. * Remove one attribute:
  34815. *
  34816. * writer.removeSelectionAttribute( 'italic' );
  34817. *
  34818. * Remove multiple attributes:
  34819. *
  34820. * writer.removeSelectionAttribute( [ 'italic', 'bold' ] );
  34821. *
  34822. * @param {String|Iterable.<String>} keyOrIterableOfKeys Key of the attribute to remove or an iterable of attribute keys to remove.
  34823. */
  34824. removeSelectionAttribute( keyOrIterableOfKeys ) {
  34825. this._assertWriterUsedCorrectly();
  34826. if ( typeof keyOrIterableOfKeys === 'string' ) {
  34827. this._removeSelectionAttribute( keyOrIterableOfKeys );
  34828. } else {
  34829. for ( const key of keyOrIterableOfKeys ) {
  34830. this._removeSelectionAttribute( key );
  34831. }
  34832. }
  34833. }
  34834. /**
  34835. * Temporarily changes the {@link module:engine/model/documentselection~DocumentSelection#isGravityOverridden gravity}
  34836. * of the selection from left to right.
  34837. *
  34838. * The gravity defines from which direction the selection inherits its attributes. If it's the default left gravity,
  34839. * then the selection (after being moved by the user) inherits attributes from its left-hand side.
  34840. * This method allows to temporarily override this behavior by forcing the gravity to the right.
  34841. *
  34842. * For the following model fragment:
  34843. *
  34844. * <$text bold="true" linkHref="url">bar[]</$text><$text bold="true">biz</$text>
  34845. *
  34846. * * Default gravity: selection will have the `bold` and `linkHref` attributes.
  34847. * * Overridden gravity: selection will have `bold` attribute.
  34848. *
  34849. * **Note**: It returns an unique identifier which is required to restore the gravity. It guarantees the symmetry
  34850. * of the process.
  34851. *
  34852. * @returns {String} The unique id which allows restoring the gravity.
  34853. */
  34854. overrideSelectionGravity() {
  34855. return this.model.document.selection._overrideGravity();
  34856. }
  34857. /**
  34858. * Restores {@link ~Writer#overrideSelectionGravity} gravity to default.
  34859. *
  34860. * Restoring the gravity is only possible using the unique identifier returned by
  34861. * {@link ~Writer#overrideSelectionGravity}. Note that the gravity remains overridden as long as won't be restored
  34862. * the same number of times it was overridden.
  34863. *
  34864. * @param {String} uid The unique id returned by {@link ~Writer#overrideSelectionGravity}.
  34865. */
  34866. restoreSelectionGravity( uid ) {
  34867. this.model.document.selection._restoreGravity( uid );
  34868. }
  34869. /**
  34870. * @private
  34871. * @param {String} key Key of the attribute to remove.
  34872. * @param {*} value Attribute value.
  34873. */
  34874. _setSelectionAttribute( key, value ) {
  34875. const selection = this.model.document.selection;
  34876. // Store attribute in parent element if the selection is collapsed in an empty node.
  34877. if ( selection.isCollapsed && selection.anchor.parent.isEmpty ) {
  34878. const storeKey = _documentselection__WEBPACK_IMPORTED_MODULE_15__["default"]._getStoreAttributeKey( key );
  34879. this.setAttribute( storeKey, value, selection.anchor.parent );
  34880. }
  34881. selection._setAttribute( key, value );
  34882. }
  34883. /**
  34884. * @private
  34885. * @param {String} key Key of the attribute to remove.
  34886. */
  34887. _removeSelectionAttribute( key ) {
  34888. const selection = this.model.document.selection;
  34889. // Remove stored attribute from parent element if the selection is collapsed in an empty node.
  34890. if ( selection.isCollapsed && selection.anchor.parent.isEmpty ) {
  34891. const storeKey = _documentselection__WEBPACK_IMPORTED_MODULE_15__["default"]._getStoreAttributeKey( key );
  34892. this.removeAttribute( storeKey, selection.anchor.parent );
  34893. }
  34894. selection._removeAttribute( key );
  34895. }
  34896. /**
  34897. * Throws `writer-detached-writer-tries-to-modify-model` error when the writer is used outside of the `change()` block.
  34898. *
  34899. * @private
  34900. */
  34901. _assertWriterUsedCorrectly() {
  34902. /**
  34903. * Trying to use a writer outside a {@link module:engine/model/model~Model#change `change()`} or
  34904. * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()`} blocks.
  34905. *
  34906. * The writer can only be used inside these blocks which ensures that the model
  34907. * can only be changed during such "sessions".
  34908. *
  34909. * @error writer-incorrect-use
  34910. */
  34911. if ( this.model._currentWriter !== this ) {
  34912. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-incorrect-use', this );
  34913. }
  34914. }
  34915. /**
  34916. * For given action `type` and `positionOrRange` where the action happens, this function finds all affected markers
  34917. * and applies a marker operation with the new marker range equal to the current range. Thanks to this, the marker range
  34918. * can be later correctly processed during undo.
  34919. *
  34920. * @private
  34921. * @param {'move'|'merge'} type Writer action type.
  34922. * @param {module:engine/model/position~Position|module:engine/model/range~Range} positionOrRange Position or range
  34923. * where the writer action happens.
  34924. */
  34925. _addOperationForAffectedMarkers( type, positionOrRange ) {
  34926. for ( const marker of this.model.markers ) {
  34927. if ( !marker.managedUsingOperations ) {
  34928. continue;
  34929. }
  34930. const markerRange = marker.getRange();
  34931. let isAffected = false;
  34932. if ( type === 'move' ) {
  34933. isAffected =
  34934. positionOrRange.containsPosition( markerRange.start ) ||
  34935. positionOrRange.start.isEqual( markerRange.start ) ||
  34936. positionOrRange.containsPosition( markerRange.end ) ||
  34937. positionOrRange.end.isEqual( markerRange.end );
  34938. } else {
  34939. // if type === 'merge'.
  34940. const elementBefore = positionOrRange.nodeBefore;
  34941. const elementAfter = positionOrRange.nodeAfter;
  34942. // Start: <p>Foo[</p><p>Bar]</p>
  34943. // After merge: <p>Foo[Bar]</p>
  34944. // After undoing split: <p>Foo</p><p>[Bar]</p> <-- incorrect, needs remembering for undo.
  34945. //
  34946. const affectedInLeftElement = markerRange.start.parent == elementBefore && markerRange.start.isAtEnd;
  34947. // Start: <p>[Foo</p><p>]Bar</p>
  34948. // After merge: <p>[Foo]Bar</p>
  34949. // After undoing split: <p>[Foo]</p><p>Bar</p> <-- incorrect, needs remembering for undo.
  34950. //
  34951. const affectedInRightElement = markerRange.end.parent == elementAfter && markerRange.end.offset == 0;
  34952. // Start: <p>[Foo</p>]<p>Bar</p>
  34953. // After merge: <p>[Foo]Bar</p>
  34954. // After undoing split: <p>[Foo]</p><p>Bar</p> <-- incorrect, needs remembering for undo.
  34955. //
  34956. const affectedAfterLeftElement = markerRange.end.nodeAfter == elementAfter;
  34957. // Start: <p>Foo</p>[<p>Bar]</p>
  34958. // After merge: <p>Foo[Bar]</p>
  34959. // After undoing split: <p>Foo</p><p>[Bar]</p> <-- incorrect, needs remembering for undo.
  34960. //
  34961. const affectedBeforeRightElement = markerRange.start.nodeAfter == elementAfter;
  34962. isAffected = affectedInLeftElement || affectedInRightElement || affectedAfterLeftElement || affectedBeforeRightElement;
  34963. }
  34964. if ( isAffected ) {
  34965. this.updateMarker( marker.name, { range: markerRange } );
  34966. }
  34967. }
  34968. }
  34969. }
  34970. // Sets given attribute to each node in given range. When attribute value is null then attribute will be removed.
  34971. //
  34972. // Because attribute operation needs to have the same attribute value on the whole range, this function splits
  34973. // the range into smaller parts.
  34974. //
  34975. // Given `range` must be flat.
  34976. //
  34977. // @private
  34978. // @param {module:engine/model/writer~Writer} writer
  34979. // @param {String} key Attribute key.
  34980. // @param {*} value Attribute new value.
  34981. // @param {module:engine/model/range~Range} range Model range on which the attribute will be set.
  34982. function setAttributeOnRange( writer, key, value, range ) {
  34983. const model = writer.model;
  34984. const doc = model.document;
  34985. // Position of the last split, the beginning of the new range.
  34986. let lastSplitPosition = range.start;
  34987. // Currently position in the scanning range. Because we need value after the position, it is not a current
  34988. // position of the iterator but the previous one (we need to iterate one more time to get the value after).
  34989. let position;
  34990. // Value before the currently position.
  34991. let valueBefore;
  34992. // Value after the currently position.
  34993. let valueAfter;
  34994. for ( const val of range.getWalker( { shallow: true } ) ) {
  34995. valueAfter = val.item.getAttribute( key );
  34996. // At the first run of the iterator the position in undefined. We also do not have a valueBefore, but
  34997. // because valueAfter may be null, valueBefore may be equal valueAfter ( undefined == null ).
  34998. if ( position && valueBefore != valueAfter ) {
  34999. // if valueBefore == value there is nothing to change, so we add operation only if these values are different.
  35000. if ( valueBefore != value ) {
  35001. addOperation();
  35002. }
  35003. lastSplitPosition = position;
  35004. }
  35005. position = val.nextPosition;
  35006. valueBefore = valueAfter;
  35007. }
  35008. // Because position in the loop is not the iterator position (see let position comment), the last position in
  35009. // the while loop will be last but one position in the range. We need to check the last position manually.
  35010. if ( position instanceof _position__WEBPACK_IMPORTED_MODULE_13__["default"] && position != lastSplitPosition && valueBefore != value ) {
  35011. addOperation();
  35012. }
  35013. function addOperation() {
  35014. const range = new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]( lastSplitPosition, position );
  35015. const version = range.root.document ? doc.version : null;
  35016. const operation = new _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__["default"]( range, key, valueBefore, value, version );
  35017. writer.batch.addOperation( operation );
  35018. model.applyOperation( operation );
  35019. }
  35020. }
  35021. // Sets given attribute to the given node. When attribute value is null then attribute will be removed.
  35022. //
  35023. // @private
  35024. // @param {module:engine/model/writer~Writer} writer
  35025. // @param {String} key Attribute key.
  35026. // @param {*} value Attribute new value.
  35027. // @param {module:engine/model/item~Item} item Model item on which the attribute will be set.
  35028. function setAttributeOnItem( writer, key, value, item ) {
  35029. const model = writer.model;
  35030. const doc = model.document;
  35031. const previousValue = item.getAttribute( key );
  35032. let range, operation;
  35033. if ( previousValue != value ) {
  35034. const isRootChanged = item.root === item;
  35035. if ( isRootChanged ) {
  35036. // If we change attributes of root element, we have to use `RootAttributeOperation`.
  35037. const version = item.document ? doc.version : null;
  35038. operation = new _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]( item, key, previousValue, value, version );
  35039. } else {
  35040. range = new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]( _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createBefore( item ), writer.createPositionAfter( item ) );
  35041. const version = range.root.document ? doc.version : null;
  35042. operation = new _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__["default"]( range, key, previousValue, value, version );
  35043. }
  35044. writer.batch.addOperation( operation );
  35045. model.applyOperation( operation );
  35046. }
  35047. }
  35048. // Creates and applies marker operation to {@link module:engine/model/operation/operation~Operation operation}.
  35049. //
  35050. // @private
  35051. // @param {module:engine/model/writer~Writer} writer
  35052. // @param {String} name Marker name.
  35053. // @param {module:engine/model/range~Range} oldRange Marker range before the change.
  35054. // @param {module:engine/model/range~Range} newRange Marker range after the change.
  35055. // @param {Boolean} affectsData
  35056. function applyMarkerOperation( writer, name, oldRange, newRange, affectsData ) {
  35057. const model = writer.model;
  35058. const doc = model.document;
  35059. const operation = new _operation_markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"]( name, oldRange, newRange, model.markers, affectsData, doc.version );
  35060. writer.batch.addOperation( operation );
  35061. model.applyOperation( operation );
  35062. }
  35063. // Creates `MoveOperation` or `DetachOperation` that removes `howMany` nodes starting from `position`.
  35064. // The operation will be applied on given model instance and added to given operation instance.
  35065. //
  35066. // @private
  35067. // @param {module:engine/model/position~Position} position Position from which nodes are removed.
  35068. // @param {Number} howMany Number of nodes to remove.
  35069. // @param {Batch} batch Batch to which the operation will be added.
  35070. // @param {module:engine/model/model~Model} model Model instance on which operation will be applied.
  35071. function applyRemoveOperation( position, howMany, batch, model ) {
  35072. let operation;
  35073. if ( position.root.document ) {
  35074. const doc = model.document;
  35075. const graveyardPosition = new _position__WEBPACK_IMPORTED_MODULE_13__["default"]( doc.graveyard, [ 0 ] );
  35076. operation = new _operation_moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( position, howMany, graveyardPosition, doc.version );
  35077. } else {
  35078. operation = new _operation_detachoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( position, howMany );
  35079. }
  35080. batch.addOperation( operation );
  35081. model.applyOperation( operation );
  35082. }
  35083. // Returns `true` if both root elements are the same element or both are documents root elements.
  35084. //
  35085. // Elements in the same tree can be moved (for instance you can move element form one documents root to another, or
  35086. // within the same document fragment), but when element supposed to be moved from document fragment to the document, or
  35087. // to another document it should be removed and inserted to avoid problems with OT. This is because features like undo or
  35088. // collaboration may track changes on the document but ignore changes on detached fragments and should not get
  35089. // unexpected `move` operation.
  35090. function isSameTree( rootA, rootB ) {
  35091. // If it is the same root this is the same tree.
  35092. if ( rootA === rootB ) {
  35093. return true;
  35094. }
  35095. // If both roots are documents root it is operation within the document what we still treat as the same tree.
  35096. if ( rootA instanceof _rootelement__WEBPACK_IMPORTED_MODULE_12__["default"] && rootB instanceof _rootelement__WEBPACK_IMPORTED_MODULE_12__["default"] ) {
  35097. return true;
  35098. }
  35099. return false;
  35100. }
  35101. /***/ }),
  35102. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js":
  35103. /*!******************************************************************************!*\
  35104. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js ***!
  35105. \******************************************************************************/
  35106. /*! exports provided: default */
  35107. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35108. "use strict";
  35109. __webpack_require__.r(__webpack_exports__);
  35110. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AttributeElement; });
  35111. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  35112. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  35113. /**
  35114. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  35115. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  35116. */
  35117. /**
  35118. * @module engine/view/attributeelement
  35119. */
  35120. // Default attribute priority.
  35121. const DEFAULT_PRIORITY = 10;
  35122. /**
  35123. * Attribute elements are used to represent formatting elements in the view (think – `<b>`, `<span style="font-size: 2em">`, etc.).
  35124. * Most often they are created when downcasting model text attributes.
  35125. *
  35126. * Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various
  35127. * types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},
  35128. * {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.
  35129. *
  35130. * To create a new attribute element instance use the
  35131. * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement `DowncastWriter#createAttributeElement()`} method.
  35132. *
  35133. * **Note:** Attribute elements by default can wrap {@link module:engine/view/text~Text},
  35134. * {@link module:engine/view/emptyelement~EmptyElement}, {@link module:engine/view/uielement~UIElement},
  35135. * {@link module:engine/view/rawelement~RawElement} and other attribute elements with higher priority. Other elements while placed inside
  35136. * an attribute element will split it (or nest in case of an `AttributeElement`). This behavior can be modified by changing
  35137. * the `isAllowedInsideAttributeElement` option while creating
  35138. * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement},
  35139. * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement},
  35140. * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement} or
  35141. * {@link module:engine/view/downcastwriter~DowncastWriter#createRawElement}.
  35142. *
  35143. * @extends module:engine/view/element~Element
  35144. */
  35145. class AttributeElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  35146. /**
  35147. * Creates an attribute element.
  35148. *
  35149. * @see module:engine/view/downcastwriter~DowncastWriter#createAttributeElement
  35150. * @see module:engine/view/element~Element
  35151. * @protected
  35152. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  35153. * @param {String} name Node name.
  35154. * @param {Object|Iterable} [attrs] Collection of attributes.
  35155. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  35156. * A list of nodes to be inserted into created element.
  35157. */
  35158. constructor( document, name, attrs, children ) {
  35159. super( document, name, attrs, children );
  35160. /**
  35161. * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
  35162. *
  35163. * @method #getFillerOffset
  35164. * @returns {Number|null} Block filler offset or `null` if block filler is not needed.
  35165. */
  35166. this.getFillerOffset = getFillerOffset;
  35167. /**
  35168. * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.
  35169. *
  35170. * @protected
  35171. * @member {Number}
  35172. */
  35173. this._priority = DEFAULT_PRIORITY;
  35174. /**
  35175. * Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},
  35176. * and then two elements are considered similar if, and only if they have the same `_id`.
  35177. *
  35178. * @protected
  35179. * @member {String|Number}
  35180. */
  35181. this._id = null;
  35182. /**
  35183. * Keeps all the attribute elements that have the same {@link module:engine/view/attributeelement~AttributeElement#id ids}
  35184. * and still exist in the view tree.
  35185. *
  35186. * This property is managed by {@link module:engine/view/downcastwriter~DowncastWriter}.
  35187. *
  35188. * @protected
  35189. * @member {Set.<module:engine/view/attributeelement~AttributeElement>|null}
  35190. */
  35191. this._clonesGroup = null;
  35192. }
  35193. /**
  35194. * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.
  35195. *
  35196. * @readonly
  35197. * @type {Number}
  35198. */
  35199. get priority() {
  35200. return this._priority;
  35201. }
  35202. /**
  35203. * Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},
  35204. * and then two elements are considered similar if, and only if they have the same `id`.
  35205. *
  35206. * @readonly
  35207. * @type {String|Number}
  35208. */
  35209. get id() {
  35210. return this._id;
  35211. }
  35212. /**
  35213. * Returns all {@link module:engine/view/attributeelement~AttributeElement attribute elements} that has the
  35214. * same {@link module:engine/view/attributeelement~AttributeElement#id id} and are in the view tree (were not removed).
  35215. *
  35216. * Note: If this element has been removed from the tree, returned set will not include it.
  35217. *
  35218. * Throws {@link module:utils/ckeditorerror~CKEditorError attribute-element-get-elements-with-same-id-no-id}
  35219. * if this element has no `id`.
  35220. *
  35221. * @returns {Set.<module:engine/view/attributeelement~AttributeElement>} Set containing all the attribute elements
  35222. * with the same `id` that were added and not removed from the view tree.
  35223. */
  35224. getElementsWithSameId() {
  35225. if ( this.id === null ) {
  35226. /**
  35227. * Cannot get elements with the same id for an attribute element without id.
  35228. *
  35229. * @error attribute-element-get-elements-with-same-id-no-id
  35230. */
  35231. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  35232. 'attribute-element-get-elements-with-same-id-no-id',
  35233. this
  35234. );
  35235. }
  35236. return new Set( this._clonesGroup );
  35237. }
  35238. /**
  35239. * Checks whether this object is of the given.
  35240. *
  35241. * attributeElement.is( 'attributeElement' ); // -> true
  35242. * attributeElement.is( 'element' ); // -> true
  35243. * attributeElement.is( 'node' ); // -> true
  35244. * attributeElement.is( 'view:attributeElement' ); // -> true
  35245. * attributeElement.is( 'view:element' ); // -> true
  35246. * attributeElement.is( 'view:node' ); // -> true
  35247. *
  35248. * attributeElement.is( 'model:element' ); // -> false
  35249. * attributeElement.is( 'documentFragment' ); // -> false
  35250. *
  35251. * Assuming that the object being checked is an attribute element, you can also check its
  35252. * {@link module:engine/view/attributeelement~AttributeElement#name name}:
  35253. *
  35254. * attributeElement.is( 'element', 'b' ); // -> true if this is a bold element
  35255. * attributeElement.is( 'attributeElement', 'b' ); // -> same as above
  35256. * text.is( 'element', 'b' ); -> false
  35257. *
  35258. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  35259. *
  35260. * @param {String} type Type to check.
  35261. * @param {String} [name] Element name.
  35262. * @returns {Boolean}
  35263. */
  35264. is( type, name = null ) {
  35265. if ( !name ) {
  35266. return type === 'attributeElement' || type === 'view:attributeElement' ||
  35267. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  35268. type === 'element' || type === 'view:element' ||
  35269. type === 'node' || type === 'view:node';
  35270. } else {
  35271. return name === this.name && (
  35272. type === 'attributeElement' || type === 'view:attributeElement' ||
  35273. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  35274. type === 'element' || type === 'view:element'
  35275. );
  35276. }
  35277. }
  35278. /**
  35279. * Checks if this element is similar to other element.
  35280. *
  35281. * If none of elements has set {@link module:engine/view/attributeelement~AttributeElement#id}, then both elements
  35282. * should have the same name, attributes and priority to be considered as similar. Two similar elements can contain
  35283. * different set of children nodes.
  35284. *
  35285. * If at least one element has {@link module:engine/view/attributeelement~AttributeElement#id} set, then both
  35286. * elements have to have the same {@link module:engine/view/attributeelement~AttributeElement#id} value to be
  35287. * considered similar.
  35288. *
  35289. * Similarity is important for {@link module:engine/view/downcastwriter~DowncastWriter}. For example:
  35290. *
  35291. * * two following similar elements can be merged together into one, longer element,
  35292. * * {@link module:engine/view/downcastwriter~DowncastWriter#unwrap} checks similarity of passed element and processed element to
  35293. * decide whether processed element should be unwrapped,
  35294. * * etc.
  35295. *
  35296. * @param {module:engine/view/element~Element} otherElement
  35297. * @returns {Boolean}
  35298. */
  35299. isSimilar( otherElement ) {
  35300. // If any element has an `id` set, just compare the ids.
  35301. if ( this.id !== null || otherElement.id !== null ) {
  35302. return this.id === otherElement.id;
  35303. }
  35304. return super.isSimilar( otherElement ) && this.priority == otherElement.priority;
  35305. }
  35306. /**
  35307. * Clones provided element with priority.
  35308. *
  35309. * @protected
  35310. * @param {Boolean} deep If set to `true` clones element and all its children recursively. When set to `false`,
  35311. * element will be cloned without any children.
  35312. * @returns {module:engine/view/attributeelement~AttributeElement} Clone of this element.
  35313. */
  35314. _clone( deep ) {
  35315. const cloned = super._clone( deep );
  35316. // Clone priority too.
  35317. cloned._priority = this._priority;
  35318. // And id too.
  35319. cloned._id = this._id;
  35320. return cloned;
  35321. }
  35322. }
  35323. /**
  35324. * Default attribute priority.
  35325. *
  35326. * @member {Number} module:engine/view/attributeelement~AttributeElement.DEFAULT_PRIORITY
  35327. */
  35328. AttributeElement.DEFAULT_PRIORITY = DEFAULT_PRIORITY;
  35329. // Returns block {@link module:engine/view/filler~Filler filler} offset or `null` if block filler is not needed.
  35330. //
  35331. // @returns {Number|null} Block filler offset or `null` if block filler is not needed.
  35332. function getFillerOffset() {
  35333. // <b>foo</b> does not need filler.
  35334. if ( nonUiChildrenCount( this ) ) {
  35335. return null;
  35336. }
  35337. let element = this.parent;
  35338. // <p><b></b></p> needs filler -> <p><b><br></b></p>
  35339. while ( element && element.is( 'attributeElement' ) ) {
  35340. if ( nonUiChildrenCount( element ) > 1 ) {
  35341. return null;
  35342. }
  35343. element = element.parent;
  35344. }
  35345. if ( !element || nonUiChildrenCount( element ) > 1 ) {
  35346. return null;
  35347. }
  35348. // Render block filler at the end of element (after all ui elements).
  35349. return this.childCount;
  35350. }
  35351. // Returns total count of children that are not {@link module:engine/view/uielement~UIElement UIElements}.
  35352. //
  35353. // @param {module:engine/view/element~Element} element
  35354. // @returns {Number}
  35355. function nonUiChildrenCount( element ) {
  35356. return Array.from( element.getChildren() ).filter( element => !element.is( 'uiElement' ) ).length;
  35357. }
  35358. /***/ }),
  35359. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js":
  35360. /*!******************************************************************************!*\
  35361. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js ***!
  35362. \******************************************************************************/
  35363. /*! exports provided: default, getFillerOffset */
  35364. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35365. "use strict";
  35366. __webpack_require__.r(__webpack_exports__);
  35367. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ContainerElement; });
  35368. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFillerOffset", function() { return getFillerOffset; });
  35369. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  35370. /**
  35371. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  35372. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  35373. */
  35374. /**
  35375. * @module engine/view/containerelement
  35376. */
  35377. /**
  35378. * Containers are elements which define document structure. They define boundaries for
  35379. * {@link module:engine/view/attributeelement~AttributeElement attributes}. They are mostly used for block elements like `<p>` or `<div>`.
  35380. *
  35381. * Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various
  35382. * types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},
  35383. * {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.
  35384. *
  35385. * The container element should be your default choice when writing a converter, unless:
  35386. *
  35387. * * this element represents a model text attribute (then use {@link module:engine/view/attributeelement~AttributeElement}),
  35388. * * this is an empty element like `<img>` (then use {@link module:engine/view/emptyelement~EmptyElement}),
  35389. * * this is a root element,
  35390. * * this is a nested editable element (then use {@link module:engine/view/editableelement~EditableElement}).
  35391. *
  35392. * To create a new container element instance use the
  35393. * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement `DowncastWriter#createContainerElement()`}
  35394. * method.
  35395. *
  35396. * @extends module:engine/view/element~Element
  35397. */
  35398. class ContainerElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  35399. /**
  35400. * Creates a container element.
  35401. *
  35402. * @see module:engine/view/downcastwriter~DowncastWriter#createContainerElement
  35403. * @see module:engine/view/element~Element
  35404. * @protected
  35405. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  35406. * @param {String} name Node name.
  35407. * @param {Object|Iterable} [attrs] Collection of attributes.
  35408. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  35409. * A list of nodes to be inserted into created element.
  35410. */
  35411. constructor( document, name, attrs, children ) {
  35412. super( document, name, attrs, children );
  35413. /**
  35414. * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
  35415. *
  35416. * @method #getFillerOffset
  35417. * @returns {Number|null} Block filler offset or `null` if block filler is not needed.
  35418. */
  35419. this.getFillerOffset = getFillerOffset;
  35420. }
  35421. /**
  35422. * Checks whether this object is of the given.
  35423. *
  35424. * containerElement.is( 'containerElement' ); // -> true
  35425. * containerElement.is( 'element' ); // -> true
  35426. * containerElement.is( 'node' ); // -> true
  35427. * containerElement.is( 'view:containerElement' ); // -> true
  35428. * containerElement.is( 'view:element' ); // -> true
  35429. * containerElement.is( 'view:node' ); // -> true
  35430. *
  35431. * containerElement.is( 'model:element' ); // -> false
  35432. * containerElement.is( 'documentFragment' ); // -> false
  35433. *
  35434. * Assuming that the object being checked is a container element, you can also check its
  35435. * {@link module:engine/view/containerelement~ContainerElement#name name}:
  35436. *
  35437. * containerElement.is( 'element', 'div' ); // -> true if this is a div container element
  35438. * containerElement.is( 'contaienrElement', 'div' ); // -> same as above
  35439. * text.is( 'element', 'div' ); -> false
  35440. *
  35441. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  35442. *
  35443. * @param {String} type Type to check.
  35444. * @param {String} [name] Element name.
  35445. * @returns {Boolean}
  35446. */
  35447. is( type, name = null ) {
  35448. if ( !name ) {
  35449. return type === 'containerElement' || type === 'view:containerElement' ||
  35450. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  35451. type === 'element' || type === 'view:element' ||
  35452. type === 'node' || type === 'view:node';
  35453. } else {
  35454. return name === this.name && (
  35455. type === 'containerElement' || type === 'view:containerElement' ||
  35456. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  35457. type === 'element' || type === 'view:element'
  35458. );
  35459. }
  35460. }
  35461. }
  35462. /**
  35463. * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
  35464. *
  35465. * @returns {Number|null} Block filler offset or `null` if block filler is not needed.
  35466. */
  35467. function getFillerOffset() {
  35468. const children = [ ...this.getChildren() ];
  35469. const lastChild = children[ this.childCount - 1 ];
  35470. // Block filler is required after a `<br>` if it's the last element in its container. See #1422.
  35471. if ( lastChild && lastChild.is( 'element', 'br' ) ) {
  35472. return this.childCount;
  35473. }
  35474. for ( const child of children ) {
  35475. // If there's any non-UI element – don't render the bogus.
  35476. if ( !child.is( 'uiElement' ) ) {
  35477. return null;
  35478. }
  35479. }
  35480. // If there are only UI elements – render the bogus at the end of the element.
  35481. return this.childCount;
  35482. }
  35483. /***/ }),
  35484. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js":
  35485. /*!**********************************************************************!*\
  35486. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js ***!
  35487. \**********************************************************************/
  35488. /*! exports provided: default */
  35489. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35490. "use strict";
  35491. __webpack_require__.r(__webpack_exports__);
  35492. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Document; });
  35493. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js");
  35494. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  35495. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  35496. /* harmony import */ var _observer_bubblingemittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./observer/bubblingemittermixin */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js");
  35497. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  35498. /**
  35499. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  35500. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  35501. */
  35502. /**
  35503. * @module engine/view/document
  35504. */
  35505. // @if CK_DEBUG_ENGINE // const { logDocument } = require( '../dev-utils/utils' );
  35506. /**
  35507. * Document class creates an abstract layer over the content editable area, contains a tree of view elements and
  35508. * {@link module:engine/view/documentselection~DocumentSelection view selection} associated with this document.
  35509. *
  35510. * @mixes module:engine/view/observer/bubblingemittermixin~BubblingEmitterMixin
  35511. * @mixes module:utils/observablemixin~ObservableMixin
  35512. */
  35513. class Document {
  35514. /**
  35515. * Creates a Document instance.
  35516. *
  35517. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor The styles processor instance.
  35518. */
  35519. constructor( stylesProcessor ) {
  35520. /**
  35521. * Selection done on this document.
  35522. *
  35523. * @readonly
  35524. * @member {module:engine/view/documentselection~DocumentSelection} module:engine/view/document~Document#selection
  35525. */
  35526. this.selection = new _documentselection__WEBPACK_IMPORTED_MODULE_0__["default"]();
  35527. /**
  35528. * Roots of the view tree. Collection of the {@link module:engine/view/element~Element view elements}.
  35529. *
  35530. * View roots are created as a result of binding between {@link module:engine/view/document~Document#roots} and
  35531. * {@link module:engine/model/document~Document#roots} and this is handled by
  35532. * {@link module:engine/controller/editingcontroller~EditingController}, so to create view root we need to create
  35533. * model root using {@link module:engine/model/document~Document#createRoot}.
  35534. *
  35535. * @readonly
  35536. * @member {module:utils/collection~Collection} module:engine/view/document~Document#roots
  35537. */
  35538. this.roots = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__["default"]( { idProperty: 'rootName' } );
  35539. /**
  35540. * The styles processor instance used by this document when normalizing styles.
  35541. *
  35542. * @readonly
  35543. * @member {module:engine/view/stylesmap~StylesProcessor}
  35544. */
  35545. this.stylesProcessor = stylesProcessor;
  35546. /**
  35547. * Defines whether document is in read-only mode.
  35548. *
  35549. * When document is read-ony then all roots are read-only as well and caret placed inside this root is hidden.
  35550. *
  35551. * @observable
  35552. * @member {Boolean} #isReadOnly
  35553. */
  35554. this.set( 'isReadOnly', false );
  35555. /**
  35556. * True if document is focused.
  35557. *
  35558. * This property is updated by the {@link module:engine/view/observer/focusobserver~FocusObserver}.
  35559. * If the {@link module:engine/view/observer/focusobserver~FocusObserver} is disabled this property will not change.
  35560. *
  35561. * @readonly
  35562. * @observable
  35563. * @member {Boolean} module:engine/view/document~Document#isFocused
  35564. */
  35565. this.set( 'isFocused', false );
  35566. /**
  35567. * `true` while the user is making a selection in the document (e.g. holding the mouse button and moving the cursor).
  35568. * When they stop selecting, the property goes back to `false`.
  35569. *
  35570. * This property is updated by the {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
  35571. *
  35572. * @readonly
  35573. * @observable
  35574. * @member {Boolean} module:engine/view/document~Document#isSelecting
  35575. */
  35576. this.set( 'isSelecting', false );
  35577. /**
  35578. * True if composition is in progress inside the document.
  35579. *
  35580. * This property is updated by the {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
  35581. * If the {@link module:engine/view/observer/compositionobserver~CompositionObserver} is disabled this property will not change.
  35582. *
  35583. * @readonly
  35584. * @observable
  35585. * @member {Boolean} module:engine/view/document~Document#isComposing
  35586. */
  35587. this.set( 'isComposing', false );
  35588. /**
  35589. * Post-fixer callbacks registered to the view document.
  35590. *
  35591. * @private
  35592. * @member {Set}
  35593. */
  35594. this._postFixers = new Set();
  35595. }
  35596. /**
  35597. * Gets a {@link module:engine/view/document~Document#roots view root element} with the specified name. If the name is not
  35598. * specific "main" root is returned.
  35599. *
  35600. * @param {String} [name='main'] Name of the root.
  35601. * @returns {module:engine/view/rooteditableelement~RootEditableElement|null} The view root element with the specified name
  35602. * or null when there is no root of given name.
  35603. */
  35604. getRoot( name = 'main' ) {
  35605. return this.roots.get( name );
  35606. }
  35607. /**
  35608. * Allows registering post-fixer callbacks. A post-fixers mechanism allows to update the view tree just before it is rendered
  35609. * to the DOM.
  35610. *
  35611. * Post-fixers are executed right after all changes from the outermost change block were applied but
  35612. * before the {@link module:engine/view/view~View#event:render render event} is fired. If a post-fixer callback made
  35613. * a change, it should return `true`. When this happens, all post-fixers are fired again to check if something else should
  35614. * not be fixed in the new document tree state.
  35615. *
  35616. * View post-fixers are useful when you want to apply some fixes whenever the view structure changes. Keep in mind that
  35617. * changes executed in a view post-fixer should not break model-view mapping.
  35618. *
  35619. * The types of changes which should be safe:
  35620. *
  35621. * * adding or removing attribute from elements,
  35622. * * changes inside of {@link module:engine/view/uielement~UIElement UI elements},
  35623. * * {@link module:engine/model/differ~Differ#refreshItem marking some of the model elements to be re-converted}.
  35624. *
  35625. * Try to avoid changes which touch view structure:
  35626. *
  35627. * * you should not add or remove nor wrap or unwrap any view elements,
  35628. * * you should not change the editor data model in a view post-fixer.
  35629. *
  35630. * As a parameter, a post-fixer callback receives a {@link module:engine/view/downcastwriter~DowncastWriter downcast writer}.
  35631. *
  35632. * Typically, a post-fixer will look like this:
  35633. *
  35634. * editor.editing.view.document.registerPostFixer( writer => {
  35635. * if ( checkSomeCondition() ) {
  35636. * writer.doSomething();
  35637. *
  35638. * // Let other post-fixers know that something changed.
  35639. * return true;
  35640. * }
  35641. * } );
  35642. *
  35643. * Note that nothing happens right after you register a post-fixer (e.g. execute such a code in the console).
  35644. * That is because adding a post-fixer does not execute it.
  35645. * The post-fixer will be executed as soon as any change in the document needs to cause its rendering.
  35646. * If you want to re-render the editor's view after registering the post-fixer then you should do it manually by calling
  35647. * {@link module:engine/view/view~View#forceRender `view.forceRender()`}.
  35648. *
  35649. * If you need to register a callback which is executed when DOM elements are already updated,
  35650. * use {@link module:engine/view/view~View#event:render render event}.
  35651. *
  35652. * @param {Function} postFixer
  35653. */
  35654. registerPostFixer( postFixer ) {
  35655. this._postFixers.add( postFixer );
  35656. }
  35657. /**
  35658. * Destroys this instance. Makes sure that all observers are destroyed and listeners removed.
  35659. */
  35660. destroy() {
  35661. this.roots.map( root => root.destroy() );
  35662. this.stopListening();
  35663. }
  35664. /**
  35665. * Performs post-fixer loops. Executes post-fixer callbacks as long as none of them has done any changes to the model.
  35666. *
  35667. * @protected
  35668. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  35669. */
  35670. _callPostFixers( writer ) {
  35671. let wasFixed = false;
  35672. do {
  35673. for ( const callback of this._postFixers ) {
  35674. wasFixed = callback( writer );
  35675. if ( wasFixed ) {
  35676. break;
  35677. }
  35678. }
  35679. } while ( wasFixed );
  35680. }
  35681. /**
  35682. * Event fired whenever document content layout changes. It is fired whenever content is
  35683. * {@link module:engine/view/view~View#event:render rendered}, but should be also fired by observers in case of
  35684. * other actions which may change layout, for instance when image loads.
  35685. *
  35686. * @event layoutChanged
  35687. */
  35688. // @if CK_DEBUG_ENGINE // log( version ) {
  35689. // @if CK_DEBUG_ENGINE // logDocument( this, version );
  35690. // @if CK_DEBUG_ENGINE // }
  35691. }
  35692. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( Document, _observer_bubblingemittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  35693. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( Document, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
  35694. /**
  35695. * Enum representing type of the change.
  35696. *
  35697. * Possible values:
  35698. *
  35699. * * `children` - for child list changes,
  35700. * * `attributes` - for element attributes changes,
  35701. * * `text` - for text nodes changes.
  35702. *
  35703. * @typedef {String} module:engine/view/document~ChangeType
  35704. */
  35705. /***/ }),
  35706. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js":
  35707. /*!******************************************************************************!*\
  35708. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js ***!
  35709. \******************************************************************************/
  35710. /*! exports provided: default */
  35711. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35712. "use strict";
  35713. __webpack_require__.r(__webpack_exports__);
  35714. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentFragment; });
  35715. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  35716. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js");
  35717. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  35718. /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  35719. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  35720. /**
  35721. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  35722. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  35723. */
  35724. /**
  35725. * @module engine/view/documentfragment
  35726. */
  35727. /**
  35728. * Document fragment.
  35729. *
  35730. * To create a new document fragment instance use the
  35731. * {@link module:engine/view/upcastwriter~UpcastWriter#createDocumentFragment `UpcastWriter#createDocumentFragment()`}
  35732. * method.
  35733. */
  35734. class DocumentFragment {
  35735. /**
  35736. * Creates new DocumentFragment instance.
  35737. *
  35738. * @protected
  35739. * @param {module:engine/view/document~Document} document The document to which this document fragment belongs.
  35740. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  35741. * A list of nodes to be inserted into the created document fragment.
  35742. */
  35743. constructor( document, children ) {
  35744. /**
  35745. * The document to which this document fragment belongs.
  35746. *
  35747. * @readonly
  35748. * @member {module:engine/view/document~Document}
  35749. */
  35750. this.document = document;
  35751. /**
  35752. * Array of child nodes.
  35753. *
  35754. * @protected
  35755. * @member {Array.<module:engine/view/element~Element>} module:engine/view/documentfragment~DocumentFragment#_children
  35756. */
  35757. this._children = [];
  35758. if ( children ) {
  35759. this._insertChild( 0, children );
  35760. }
  35761. }
  35762. /**
  35763. * Iterable interface.
  35764. *
  35765. * Iterates over nodes added to this document fragment.
  35766. *
  35767. * @returns {Iterable.<module:engine/view/node~Node>}
  35768. */
  35769. [ Symbol.iterator ]() {
  35770. return this._children[ Symbol.iterator ]();
  35771. }
  35772. /**
  35773. * Number of child nodes in this document fragment.
  35774. *
  35775. * @readonly
  35776. * @type {Number}
  35777. */
  35778. get childCount() {
  35779. return this._children.length;
  35780. }
  35781. /**
  35782. * Is `true` if there are no nodes inside this document fragment, `false` otherwise.
  35783. *
  35784. * @readonly
  35785. * @type {Boolean}
  35786. */
  35787. get isEmpty() {
  35788. return this.childCount === 0;
  35789. }
  35790. /**
  35791. * Artificial root of `DocumentFragment`. Returns itself. Added for compatibility reasons.
  35792. *
  35793. * @readonly
  35794. * @type {module:engine/model/documentfragment~DocumentFragment}
  35795. */
  35796. get root() {
  35797. return this;
  35798. }
  35799. /**
  35800. * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.
  35801. *
  35802. * @readonly
  35803. * @type {null}
  35804. */
  35805. get parent() {
  35806. return null;
  35807. }
  35808. /**
  35809. * Checks whether this object is of the given type.
  35810. *
  35811. * docFrag.is( 'documentFragment' ); // -> true
  35812. * docFrag.is( 'view:documentFragment' ); // -> true
  35813. *
  35814. * docFrag.is( 'model:documentFragment' ); // -> false
  35815. * docFrag.is( 'element' ); // -> false
  35816. * docFrag.is( 'node' ); // -> false
  35817. *
  35818. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  35819. *
  35820. * @param {String} type
  35821. * @returns {Boolean}
  35822. */
  35823. is( type ) {
  35824. return type === 'documentFragment' || type === 'view:documentFragment';
  35825. }
  35826. /**
  35827. * {@link module:engine/view/documentfragment~DocumentFragment#_insertChild Insert} a child node or a list of child nodes at the end
  35828. * and sets the parent of these nodes to this fragment.
  35829. *
  35830. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  35831. * @returns {Number} Number of appended nodes.
  35832. */
  35833. _appendChild( items ) {
  35834. return this._insertChild( this.childCount, items );
  35835. }
  35836. /**
  35837. * Gets child at the given index.
  35838. *
  35839. * @param {Number} index Index of child.
  35840. * @returns {module:engine/view/node~Node} Child node.
  35841. */
  35842. getChild( index ) {
  35843. return this._children[ index ];
  35844. }
  35845. /**
  35846. * Gets index of the given child node. Returns `-1` if child node is not found.
  35847. *
  35848. * @param {module:engine/view/node~Node} node Child node.
  35849. * @returns {Number} Index of the child node.
  35850. */
  35851. getChildIndex( node ) {
  35852. return this._children.indexOf( node );
  35853. }
  35854. /**
  35855. * Gets child nodes iterator.
  35856. *
  35857. * @returns {Iterable.<module:engine/view/node~Node>} Child nodes iterator.
  35858. */
  35859. getChildren() {
  35860. return this._children[ Symbol.iterator ]();
  35861. }
  35862. /**
  35863. * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to
  35864. * this fragment.
  35865. *
  35866. * @param {Number} index Position where nodes should be inserted.
  35867. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  35868. * @returns {Number} Number of inserted nodes.
  35869. */
  35870. _insertChild( index, items ) {
  35871. this._fireChange( 'children', this );
  35872. let count = 0;
  35873. const nodes = normalize( this.document, items );
  35874. for ( const node of nodes ) {
  35875. // If node that is being added to this element is already inside another element, first remove it from the old parent.
  35876. if ( node.parent !== null ) {
  35877. node._remove();
  35878. }
  35879. node.parent = this;
  35880. this._children.splice( index, 0, node );
  35881. index++;
  35882. count++;
  35883. }
  35884. return count;
  35885. }
  35886. /**
  35887. * Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.
  35888. *
  35889. * @param {Number} index Number of the first node to remove.
  35890. * @param {Number} [howMany=1] Number of nodes to remove.
  35891. * @returns {Array.<module:engine/view/node~Node>} The array of removed nodes.
  35892. */
  35893. _removeChildren( index, howMany = 1 ) {
  35894. this._fireChange( 'children', this );
  35895. for ( let i = index; i < index + howMany; i++ ) {
  35896. this._children[ i ].parent = null;
  35897. }
  35898. return this._children.splice( index, howMany );
  35899. }
  35900. /**
  35901. * Fires `change` event with given type of the change.
  35902. *
  35903. * @private
  35904. * @param {module:engine/view/document~ChangeType} type Type of the change.
  35905. * @param {module:engine/view/node~Node} node Changed node.
  35906. * @fires module:engine/view/node~Node#change
  35907. */
  35908. _fireChange( type, node ) {
  35909. this.fire( 'change:' + type, node );
  35910. }
  35911. // @if CK_DEBUG_ENGINE // printTree() {
  35912. // @if CK_DEBUG_ENGINE // let string = 'ViewDocumentFragment: [';
  35913. // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
  35914. // @if CK_DEBUG_ENGINE // if ( child.is( '$text' ) ) {
  35915. // @if CK_DEBUG_ENGINE // string += '\n' + '\t'.repeat( 1 ) + child.data;
  35916. // @if CK_DEBUG_ENGINE // } else {
  35917. // @if CK_DEBUG_ENGINE // string += '\n' + child.printTree( 1 );
  35918. // @if CK_DEBUG_ENGINE // }
  35919. // @if CK_DEBUG_ENGINE // }
  35920. // @if CK_DEBUG_ENGINE // string += '\n]';
  35921. // @if CK_DEBUG_ENGINE // return string;
  35922. // @if CK_DEBUG_ENGINE // }
  35923. // @if CK_DEBUG_ENGINE // logTree() {
  35924. // @if CK_DEBUG_ENGINE // console.log( this.printTree() );
  35925. // @if CK_DEBUG_ENGINE // }
  35926. }
  35927. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( DocumentFragment, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
  35928. // Converts strings to Text and non-iterables to arrays.
  35929. //
  35930. // @param {String|module:engine/view/item~Item|Iterable.<String|module:engine/view/item~Item>}
  35931. // @returns {Iterable.<module:engine/view/node~Node>}
  35932. function normalize( document, nodes ) {
  35933. // Separate condition because string is iterable.
  35934. if ( typeof nodes == 'string' ) {
  35935. return [ new _text__WEBPACK_IMPORTED_MODULE_0__["default"]( document, nodes ) ];
  35936. }
  35937. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_3__["default"])( nodes ) ) {
  35938. nodes = [ nodes ];
  35939. }
  35940. // Array.from to enable .map() on non-arrays.
  35941. return Array.from( nodes )
  35942. .map( node => {
  35943. if ( typeof node == 'string' ) {
  35944. return new _text__WEBPACK_IMPORTED_MODULE_0__["default"]( document, node );
  35945. }
  35946. if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  35947. return new _text__WEBPACK_IMPORTED_MODULE_0__["default"]( document, node.data );
  35948. }
  35949. return node;
  35950. } );
  35951. }
  35952. /***/ }),
  35953. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js":
  35954. /*!*******************************************************************************!*\
  35955. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js ***!
  35956. \*******************************************************************************/
  35957. /*! exports provided: default */
  35958. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35959. "use strict";
  35960. __webpack_require__.r(__webpack_exports__);
  35961. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentSelection; });
  35962. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  35963. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  35964. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  35965. /**
  35966. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  35967. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  35968. */
  35969. /**
  35970. * @module engine/view/documentselection
  35971. */
  35972. /**
  35973. * Class representing the document selection in the view.
  35974. *
  35975. * Its instance is available in {@link module:engine/view/document~Document#selection `Document#selection`}.
  35976. *
  35977. * It is similar to {@link module:engine/view/selection~Selection} but
  35978. * it has a read-only API and can be modified only by the writer available in
  35979. * the {@link module:engine/view/view~View#change `View#change()`} block
  35980. * (so via {@link module:engine/view/downcastwriter~DowncastWriter#setSelection `DowncastWriter#setSelection()`}).
  35981. */
  35982. class DocumentSelection {
  35983. /**
  35984. * Creates new DocumentSelection instance.
  35985. *
  35986. * // Creates empty selection without ranges.
  35987. * const selection = new DocumentSelection();
  35988. *
  35989. * // Creates selection at the given range.
  35990. * const range = writer.createRange( start, end );
  35991. * const selection = new DocumentSelection( range );
  35992. *
  35993. * // Creates selection at the given ranges
  35994. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( start2, end2 ) ];
  35995. * const selection = new DocumentSelection( ranges );
  35996. *
  35997. * // Creates selection from the other selection.
  35998. * const otherSelection = writer.createSelection();
  35999. * const selection = new DocumentSelection( otherSelection );
  36000. *
  36001. * // Creates selection at the given position.
  36002. * const position = writer.createPositionAt( root, offset );
  36003. * const selection = new DocumentSelection( position );
  36004. *
  36005. * // Creates collapsed selection at the position of given item and offset.
  36006. * const paragraph = writer.createContainerElement( 'paragraph' );
  36007. * const selection = new DocumentSelection( paragraph, offset );
  36008. *
  36009. * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
  36010. * // first child of that element and ends after the last child of that element.
  36011. * const selection = new DocumentSelection( paragraph, 'in' );
  36012. *
  36013. * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
  36014. * // just after the item.
  36015. * const selection = new DocumentSelection( paragraph, 'on' );
  36016. *
  36017. * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  36018. *
  36019. * // Creates backward selection.
  36020. * const selection = new DocumentSelection( range, { backward: true } );
  36021. *
  36022. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  36023. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  36024. * represented in other way, for example by applying proper CSS class.
  36025. *
  36026. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  36027. * (and be properly handled by screen readers).
  36028. *
  36029. * // Creates fake selection with label.
  36030. * const selection = new DocumentSelection( range, { fake: true, label: 'foo' } );
  36031. *
  36032. * @param {module:engine/view/selection~Selectable} [selectable=null]
  36033. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
  36034. * @param {Object} [options]
  36035. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  36036. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  36037. * @param {String} [options.label] Label for the fake selection.
  36038. */
  36039. constructor( selectable = null, placeOrOffset, options ) {
  36040. /**
  36041. * Selection is used internally (`DocumentSelection` is a proxy to that selection).
  36042. *
  36043. * @private
  36044. * @member {module:engine/view/selection~Selection}
  36045. */
  36046. this._selection = new _selection__WEBPACK_IMPORTED_MODULE_0__["default"]();
  36047. // Delegate change event to be fired on DocumentSelection instance.
  36048. this._selection.delegate( 'change' ).to( this );
  36049. // Set selection data.
  36050. this._selection.setTo( selectable, placeOrOffset, options );
  36051. }
  36052. /**
  36053. * Returns true if selection instance is marked as `fake`.
  36054. *
  36055. * @see #_setTo
  36056. * @type {Boolean}
  36057. */
  36058. get isFake() {
  36059. return this._selection.isFake;
  36060. }
  36061. /**
  36062. * Returns fake selection label.
  36063. *
  36064. * @see #_setTo
  36065. * @type {String}
  36066. */
  36067. get fakeSelectionLabel() {
  36068. return this._selection.fakeSelectionLabel;
  36069. }
  36070. /**
  36071. * Selection anchor. Anchor may be described as a position where the selection starts. Together with
  36072. * {@link #focus focus} they define the direction of selection, which is important
  36073. * when expanding/shrinking selection. Anchor is always the start or end of the most recent added range.
  36074. * It may be a bit unintuitive when there are multiple ranges in selection.
  36075. *
  36076. * @see #focus
  36077. * @type {module:engine/view/position~Position}
  36078. */
  36079. get anchor() {
  36080. return this._selection.anchor;
  36081. }
  36082. /**
  36083. * Selection focus. Focus is a position where the selection ends.
  36084. *
  36085. * @see #anchor
  36086. * @type {module:engine/view/position~Position}
  36087. */
  36088. get focus() {
  36089. return this._selection.focus;
  36090. }
  36091. /**
  36092. * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is
  36093. * collapsed.
  36094. *
  36095. * @type {Boolean}
  36096. */
  36097. get isCollapsed() {
  36098. return this._selection.isCollapsed;
  36099. }
  36100. /**
  36101. * Returns number of ranges in selection.
  36102. *
  36103. * @type {Number}
  36104. */
  36105. get rangeCount() {
  36106. return this._selection.rangeCount;
  36107. }
  36108. /**
  36109. * Specifies whether the {@link #focus} precedes {@link #anchor}.
  36110. *
  36111. * @type {Boolean}
  36112. */
  36113. get isBackward() {
  36114. return this._selection.isBackward;
  36115. }
  36116. /**
  36117. * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this selection, or `null`
  36118. * if the selection is not inside an editable element.
  36119. *
  36120. * @type {module:engine/view/editableelement~EditableElement|null}
  36121. */
  36122. get editableElement() {
  36123. return this._selection.editableElement;
  36124. }
  36125. /**
  36126. * Used for the compatibility with the {@link module:engine/view/selection~Selection#isEqual} method.
  36127. *
  36128. * @protected
  36129. */
  36130. get _ranges() {
  36131. return this._selection._ranges;
  36132. }
  36133. /**
  36134. * Returns an iterable that contains copies of all ranges added to the selection.
  36135. *
  36136. * @returns {Iterable.<module:engine/view/range~Range>}
  36137. */
  36138. * getRanges() {
  36139. yield* this._selection.getRanges();
  36140. }
  36141. /**
  36142. * Returns copy of the first range in the selection. First range is the one which
  36143. * {@link module:engine/view/range~Range#start start} position {@link module:engine/view/position~Position#isBefore is before} start
  36144. * position of all other ranges (not to confuse with the first range added to the selection).
  36145. * Returns `null` if no ranges are added to selection.
  36146. *
  36147. * @returns {module:engine/view/range~Range|null}
  36148. */
  36149. getFirstRange() {
  36150. return this._selection.getFirstRange();
  36151. }
  36152. /**
  36153. * Returns copy of the last range in the selection. Last range is the one which {@link module:engine/view/range~Range#end end}
  36154. * position {@link module:engine/view/position~Position#isAfter is after} end position of all other ranges (not to confuse
  36155. * with the last range added to the selection). Returns `null` if no ranges are added to selection.
  36156. *
  36157. * @returns {module:engine/view/range~Range|null}
  36158. */
  36159. getLastRange() {
  36160. return this._selection.getLastRange();
  36161. }
  36162. /**
  36163. * Returns copy of the first position in the selection. First position is the position that
  36164. * {@link module:engine/view/position~Position#isBefore is before} any other position in the selection ranges.
  36165. * Returns `null` if no ranges are added to selection.
  36166. *
  36167. * @returns {module:engine/view/position~Position|null}
  36168. */
  36169. getFirstPosition() {
  36170. return this._selection.getFirstPosition();
  36171. }
  36172. /**
  36173. * Returns copy of the last position in the selection. Last position is the position that
  36174. * {@link module:engine/view/position~Position#isAfter is after} any other position in the selection ranges.
  36175. * Returns `null` if no ranges are added to selection.
  36176. *
  36177. * @returns {module:engine/view/position~Position|null}
  36178. */
  36179. getLastPosition() {
  36180. return this._selection.getLastPosition();
  36181. }
  36182. /**
  36183. * Returns the selected element. {@link module:engine/view/element~Element Element} is considered as selected if there is only
  36184. * one range in the selection, and that range contains exactly one element.
  36185. * Returns `null` if there is no selected element.
  36186. *
  36187. * @returns {module:engine/view/element~Element|null}
  36188. */
  36189. getSelectedElement() {
  36190. return this._selection.getSelectedElement();
  36191. }
  36192. /**
  36193. * Checks whether, this selection is equal to given selection. Selections are equal if they have same directions,
  36194. * same number of ranges and all ranges from one selection equal to a range from other selection.
  36195. *
  36196. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} otherSelection
  36197. * Selection to compare with.
  36198. * @returns {Boolean} `true` if selections are equal, `false` otherwise.
  36199. */
  36200. isEqual( otherSelection ) {
  36201. return this._selection.isEqual( otherSelection );
  36202. }
  36203. /**
  36204. * Checks whether this selection is similar to given selection. Selections are similar if they have same directions, same
  36205. * number of ranges, and all {@link module:engine/view/range~Range#getTrimmed trimmed} ranges from one selection are
  36206. * equal to any trimmed range from other selection.
  36207. *
  36208. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} otherSelection
  36209. * Selection to compare with.
  36210. * @returns {Boolean} `true` if selections are similar, `false` otherwise.
  36211. */
  36212. isSimilar( otherSelection ) {
  36213. return this._selection.isSimilar( otherSelection );
  36214. }
  36215. /**
  36216. * Checks whether this object is of the given type.
  36217. *
  36218. * docSelection.is( 'selection' ); // -> true
  36219. * docSelection.is( 'documentSelection' ); // -> true
  36220. * docSelection.is( 'view:selection' ); // -> true
  36221. * docSelection.is( 'view:documentSelection' ); // -> true
  36222. *
  36223. * docSelection.is( 'model:documentSelection' ); // -> false
  36224. * docSelection.is( 'element' ); // -> false
  36225. * docSelection.is( 'node' ); // -> false
  36226. *
  36227. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  36228. *
  36229. * @param {String} type
  36230. * @returns {Boolean}
  36231. */
  36232. is( type ) {
  36233. return type === 'selection' ||
  36234. type == 'documentSelection' ||
  36235. type == 'view:selection' ||
  36236. type == 'view:documentSelection';
  36237. }
  36238. /**
  36239. * Sets this selection's ranges and direction to the specified location based on the given
  36240. * {@link module:engine/view/selection~Selectable selectable}.
  36241. *
  36242. * // Sets selection to the given range.
  36243. * const range = writer.createRange( start, end );
  36244. * documentSelection._setTo( range );
  36245. *
  36246. * // Sets selection to given ranges.
  36247. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( start2, end2 ) ];
  36248. * documentSelection._setTo( range );
  36249. *
  36250. * // Sets selection to the other selection.
  36251. * const otherSelection = writer.createSelection();
  36252. * documentSelection._setTo( otherSelection );
  36253. *
  36254. * // Sets collapsed selection at the given position.
  36255. * const position = writer.createPositionAt( root, offset );
  36256. * documentSelection._setTo( position );
  36257. *
  36258. * // Sets collapsed selection at the position of given item and offset.
  36259. * documentSelection._setTo( paragraph, offset );
  36260. *
  36261. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  36262. * that element and ends after the last child of that element.
  36263. *
  36264. * documentSelection._setTo( paragraph, 'in' );
  36265. *
  36266. * Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends just after the item.
  36267. *
  36268. * documentSelection._setTo( paragraph, 'on' );
  36269. *
  36270. * // Clears selection. Removes all ranges.
  36271. * documentSelection._setTo( null );
  36272. *
  36273. * `Selection#_setTo()` method allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  36274. *
  36275. * // Sets selection as backward.
  36276. * documentSelection._setTo( range, { backward: true } );
  36277. *
  36278. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  36279. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  36280. * represented in other way, for example by applying proper CSS class.
  36281. *
  36282. * Additionally fake's selection label can be provided. It will be used to des cribe fake selection in DOM
  36283. * (and be properly handled by screen readers).
  36284. *
  36285. * // Creates fake selection with label.
  36286. * documentSelection._setTo( range, { fake: true, label: 'foo' } );
  36287. *
  36288. * @protected
  36289. * @fires change
  36290. * @param {module:engine/view/selection~Selectable} selectable
  36291. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  36292. * @param {Object} [options]
  36293. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  36294. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  36295. * @param {String} [options.label] Label for the fake selection.
  36296. */
  36297. _setTo( selectable, placeOrOffset, options ) {
  36298. this._selection.setTo( selectable, placeOrOffset, options );
  36299. }
  36300. /**
  36301. * Moves {@link #focus} to the specified location.
  36302. *
  36303. * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}
  36304. * parameters.
  36305. *
  36306. * @protected
  36307. * @fires change
  36308. * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
  36309. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  36310. * first parameter is a {@link module:engine/view/item~Item view item}.
  36311. */
  36312. _setFocus( itemOrPosition, offset ) {
  36313. this._selection.setFocus( itemOrPosition, offset );
  36314. }
  36315. /**
  36316. * Fired whenever selection ranges are changed through {@link ~DocumentSelection Selection API}.
  36317. *
  36318. * @event change
  36319. */
  36320. }
  36321. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( DocumentSelection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  36322. /***/ }),
  36323. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js":
  36324. /*!**************************************************************************!*\
  36325. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js ***!
  36326. \**************************************************************************/
  36327. /*! exports provided: default */
  36328. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36329. "use strict";
  36330. __webpack_require__.r(__webpack_exports__);
  36331. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DomConverter; });
  36332. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  36333. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  36334. /* harmony import */ var _uielement__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./uielement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js");
  36335. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  36336. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  36337. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  36338. /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js");
  36339. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js");
  36340. /* harmony import */ var _matcher__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./matcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js");
  36341. /* harmony import */ var _filler__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./filler */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js");
  36342. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  36343. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  36344. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_indexof__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/indexof */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/indexof.js");
  36345. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_getancestors__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/getancestors */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js");
  36346. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
  36347. /**
  36348. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  36349. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  36350. */
  36351. /**
  36352. * @module engine/view/domconverter
  36353. */
  36354. /* globals document, Node, NodeFilter, DOMParser, Text */
  36355. const BR_FILLER_REF = Object(_filler__WEBPACK_IMPORTED_MODULE_9__["BR_FILLER"])( document ); // eslint-disable-line new-cap
  36356. const NBSP_FILLER_REF = Object(_filler__WEBPACK_IMPORTED_MODULE_9__["NBSP_FILLER"])( document ); // eslint-disable-line new-cap
  36357. const MARKED_NBSP_FILLER_REF = Object(_filler__WEBPACK_IMPORTED_MODULE_9__["MARKED_NBSP_FILLER"])( document ); // eslint-disable-line new-cap
  36358. const UNSAFE_ATTRIBUTE_NAME_PREFIX = 'data-ck-unsafe-attribute-';
  36359. const UNSAFE_ELEMENT_REPLACEMENT_ATTRIBUTE = 'data-ck-unsafe-element';
  36360. /**
  36361. * `DomConverter` is a set of tools to do transformations between DOM nodes and view nodes. It also handles
  36362. * {@link module:engine/view/domconverter~DomConverter#bindElements bindings} between these nodes.
  36363. *
  36364. * An instance of the DOM converter is available under
  36365. * {@link module:engine/view/view~View#domConverter `editor.editing.view.domConverter`}.
  36366. *
  36367. * The DOM converter does not check which nodes should be rendered (use {@link module:engine/view/renderer~Renderer}), does not keep the
  36368. * state of a tree nor keeps the synchronization between the tree view and the DOM tree (use {@link module:engine/view/document~Document}).
  36369. *
  36370. * The DOM converter keeps DOM elements to view element bindings, so when the converter gets destroyed, the bindings are lost.
  36371. * Two converters will keep separate binding maps, so one tree view can be bound with two DOM trees.
  36372. */
  36373. class DomConverter {
  36374. /**
  36375. * Creates a DOM converter.
  36376. *
  36377. * @param {module:engine/view/document~Document} document The view document instance.
  36378. * @param {Object} options An object with configuration options.
  36379. * @param {module:engine/view/filler~BlockFillerMode} [options.blockFillerMode] The type of the block filler to use.
  36380. * Default value depends on the options.renderingMode:
  36381. * 'nbsp' when options.renderingMode == 'data',
  36382. * 'br' when options.renderingMode == 'editing'.
  36383. * @param {'data'|'editing'} [options.renderingMode='editing'] Whether to leave the View-to-DOM conversion result unchanged
  36384. * or improve editing experience by filtering out interactive data.
  36385. */
  36386. constructor( document, options = {} ) {
  36387. /**
  36388. * @readonly
  36389. * @type {module:engine/view/document~Document}
  36390. */
  36391. this.document = document;
  36392. /**
  36393. * Whether to leave the View-to-DOM conversion result unchanged or improve editing experience by filtering out interactive data.
  36394. *
  36395. * @member {'data'|'editing'} module:engine/view/domconverter~DomConverter#renderingMode
  36396. */
  36397. this.renderingMode = options.renderingMode || 'editing';
  36398. /**
  36399. * The mode of a block filler used by the DOM converter.
  36400. *
  36401. * @member {'br'|'nbsp'|'markedNbsp'} module:engine/view/domconverter~DomConverter#blockFillerMode
  36402. */
  36403. this.blockFillerMode = options.blockFillerMode || ( this.renderingMode === 'editing' ? 'br' : 'nbsp' );
  36404. /**
  36405. * Elements which are considered pre-formatted elements.
  36406. *
  36407. * @readonly
  36408. * @member {Array.<String>} module:engine/view/domconverter~DomConverter#preElements
  36409. */
  36410. this.preElements = [ 'pre' ];
  36411. /**
  36412. * Elements which are considered block elements (and hence should be filled with a
  36413. * {@link #isBlockFiller block filler}).
  36414. *
  36415. * Whether an element is considered a block element also affects handling of trailing whitespaces.
  36416. *
  36417. * You can extend this array if you introduce support for block elements which are not yet recognized here.
  36418. *
  36419. * @readonly
  36420. * @member {Array.<String>} module:engine/view/domconverter~DomConverter#blockElements
  36421. */
  36422. this.blockElements = [
  36423. 'address', 'article', 'aside', 'blockquote', 'caption', 'center', 'dd', 'details', 'dir', 'div',
  36424. 'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header',
  36425. 'hgroup', 'legend', 'li', 'main', 'menu', 'nav', 'ol', 'p', 'pre', 'section', 'summary', 'table', 'tbody',
  36426. 'td', 'tfoot', 'th', 'thead', 'tr', 'ul'
  36427. ];
  36428. /**
  36429. * A list of elements that exist inline (in text) but their inner structure cannot be edited because
  36430. * of the way they are rendered by the browser. They are mostly HTML form elements but there are other
  36431. * elements such as `<img>` or `<iframe>` that also have non-editable children or no children whatsoever.
  36432. *
  36433. * Whether an element is considered an inline object has an impact on white space rendering (trimming)
  36434. * around (and inside of it). In short, white spaces in text nodes next to inline objects are not trimmed.
  36435. *
  36436. * You can extend this array if you introduce support for inline object elements which are not yet recognized here.
  36437. *
  36438. * @readonly
  36439. * @member {Array.<String>} module:engine/view/domconverter~DomConverter#inlineObjectElements
  36440. */
  36441. this.inlineObjectElements = [
  36442. 'object', 'iframe', 'input', 'button', 'textarea', 'select', 'option', 'video', 'embed', 'audio', 'img', 'canvas'
  36443. ];
  36444. /**
  36445. * The DOM-to-view mapping.
  36446. *
  36447. * @private
  36448. * @member {WeakMap} module:engine/view/domconverter~DomConverter#_domToViewMapping
  36449. */
  36450. this._domToViewMapping = new WeakMap();
  36451. /**
  36452. * The view-to-DOM mapping.
  36453. *
  36454. * @private
  36455. * @member {WeakMap} module:engine/view/domconverter~DomConverter#_viewToDomMapping
  36456. */
  36457. this._viewToDomMapping = new WeakMap();
  36458. /**
  36459. * Holds the mapping between fake selection containers and corresponding view selections.
  36460. *
  36461. * @private
  36462. * @member {WeakMap} module:engine/view/domconverter~DomConverter#_fakeSelectionMapping
  36463. */
  36464. this._fakeSelectionMapping = new WeakMap();
  36465. /**
  36466. * Matcher for view elements whose content should be treated as raw data
  36467. * and not processed during the conversion from DOM nodes to view elements.
  36468. *
  36469. * @private
  36470. * @type {module:engine/view/matcher~Matcher}
  36471. */
  36472. this._rawContentElementMatcher = new _matcher__WEBPACK_IMPORTED_MODULE_8__["default"]();
  36473. /**
  36474. * A set of encountered raw content DOM nodes. It is used for preventing left trimming of the following text node.
  36475. *
  36476. * @private
  36477. * @type {WeakSet.<Node>}
  36478. */
  36479. this._encounteredRawContentDomNodes = new WeakSet();
  36480. }
  36481. /**
  36482. * Binds a given DOM element that represents fake selection to a **position** of a
  36483. * {@link module:engine/view/documentselection~DocumentSelection document selection}.
  36484. * Document selection copy is stored and can be retrieved by the
  36485. * {@link module:engine/view/domconverter~DomConverter#fakeSelectionToView} method.
  36486. *
  36487. * @param {HTMLElement} domElement
  36488. * @param {module:engine/view/documentselection~DocumentSelection} viewDocumentSelection
  36489. */
  36490. bindFakeSelection( domElement, viewDocumentSelection ) {
  36491. this._fakeSelectionMapping.set( domElement, new _selection__WEBPACK_IMPORTED_MODULE_5__["default"]( viewDocumentSelection ) );
  36492. }
  36493. /**
  36494. * Returns a {@link module:engine/view/selection~Selection view selection} instance corresponding to a given
  36495. * DOM element that represents fake selection. Returns `undefined` if binding to the given DOM element does not exist.
  36496. *
  36497. * @param {HTMLElement} domElement
  36498. * @returns {module:engine/view/selection~Selection|undefined}
  36499. */
  36500. fakeSelectionToView( domElement ) {
  36501. return this._fakeSelectionMapping.get( domElement );
  36502. }
  36503. /**
  36504. * Binds DOM and view elements, so it will be possible to get corresponding elements using
  36505. * {@link module:engine/view/domconverter~DomConverter#mapDomToView} and
  36506. * {@link module:engine/view/domconverter~DomConverter#mapViewToDom}.
  36507. *
  36508. * @param {HTMLElement} domElement The DOM element to bind.
  36509. * @param {module:engine/view/element~Element} viewElement The view element to bind.
  36510. */
  36511. bindElements( domElement, viewElement ) {
  36512. this._domToViewMapping.set( domElement, viewElement );
  36513. this._viewToDomMapping.set( viewElement, domElement );
  36514. }
  36515. /**
  36516. * Unbinds a given DOM element from the view element it was bound to. Unbinding is deep, meaning that all children of
  36517. * the DOM element will be unbound too.
  36518. *
  36519. * @param {HTMLElement} domElement The DOM element to unbind.
  36520. */
  36521. unbindDomElement( domElement ) {
  36522. const viewElement = this._domToViewMapping.get( domElement );
  36523. if ( viewElement ) {
  36524. this._domToViewMapping.delete( domElement );
  36525. this._viewToDomMapping.delete( viewElement );
  36526. for ( const child of domElement.childNodes ) {
  36527. this.unbindDomElement( child );
  36528. }
  36529. }
  36530. }
  36531. /**
  36532. * Binds DOM and view document fragments, so it will be possible to get corresponding document fragments using
  36533. * {@link module:engine/view/domconverter~DomConverter#mapDomToView} and
  36534. * {@link module:engine/view/domconverter~DomConverter#mapViewToDom}.
  36535. *
  36536. * @param {DocumentFragment} domFragment The DOM document fragment to bind.
  36537. * @param {module:engine/view/documentfragment~DocumentFragment} viewFragment The view document fragment to bind.
  36538. */
  36539. bindDocumentFragments( domFragment, viewFragment ) {
  36540. this._domToViewMapping.set( domFragment, viewFragment );
  36541. this._viewToDomMapping.set( viewFragment, domFragment );
  36542. }
  36543. /**
  36544. * Decides whether a given pair of attribute key and value should be passed further down the pipeline.
  36545. *
  36546. * @param {String} attributeKey
  36547. * @param {String} attributeValue
  36548. * @param {String} elementName Element name in lower case.
  36549. * @returns {Boolean}
  36550. */
  36551. shouldRenderAttribute( attributeKey, attributeValue, elementName ) {
  36552. if ( this.renderingMode === 'data' ) {
  36553. return true;
  36554. }
  36555. attributeKey = attributeKey.toLowerCase();
  36556. if ( attributeKey.startsWith( 'on' ) ) {
  36557. return false;
  36558. }
  36559. if (
  36560. attributeKey === 'srcdoc' &&
  36561. attributeValue.match( /\bon\S+\s*=|javascript:|<\s*\/*script/i )
  36562. ) {
  36563. return false;
  36564. }
  36565. if (
  36566. elementName === 'img' &&
  36567. ( attributeKey === 'src' || attributeKey === 'srcset' )
  36568. ) {
  36569. return true;
  36570. }
  36571. if ( elementName === 'source' && attributeKey === 'srcset' ) {
  36572. return true;
  36573. }
  36574. if ( attributeValue.match( /^\s*(javascript:|data:(image\/svg|text\/x?html))/i ) ) {
  36575. return false;
  36576. }
  36577. return true;
  36578. }
  36579. /**
  36580. * Set `domElement`'s content using provided `html` argument. Apply necessary filtering for the editing pipeline.
  36581. *
  36582. * @param {Element} domElement DOM element that should have `html` set as its content.
  36583. * @param {String} html Textual representation of the HTML that will be set on `domElement`.
  36584. */
  36585. setContentOf( domElement, html ) {
  36586. // For data pipeline we pass the HTML as-is.
  36587. if ( this.renderingMode === 'data' ) {
  36588. domElement.innerHTML = html;
  36589. return;
  36590. }
  36591. const document = new DOMParser().parseFromString( html, 'text/html' );
  36592. const fragment = document.createDocumentFragment();
  36593. const bodyChildNodes = document.body.childNodes;
  36594. while ( bodyChildNodes.length > 0 ) {
  36595. fragment.appendChild( bodyChildNodes[ 0 ] );
  36596. }
  36597. const treeWalker = document.createTreeWalker( fragment, NodeFilter.SHOW_ELEMENT );
  36598. const nodes = [];
  36599. let currentNode;
  36600. // eslint-disable-next-line no-cond-assign
  36601. while ( currentNode = treeWalker.nextNode() ) {
  36602. nodes.push( currentNode );
  36603. }
  36604. for ( const currentNode of nodes ) {
  36605. // Go through nodes to remove those that are prohibited in editing pipeline.
  36606. for ( const attributeName of currentNode.getAttributeNames() ) {
  36607. this.setDomElementAttribute( currentNode, attributeName, currentNode.getAttribute( attributeName ) );
  36608. }
  36609. const elementName = currentNode.tagName.toLowerCase();
  36610. // There are certain nodes, that should be renamed to <span> in editing pipeline.
  36611. if ( this._shouldRenameElement( elementName ) ) {
  36612. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__["logWarning"])( 'domconverter-unsafe-element-detected', { unsafeElement: currentNode } );
  36613. currentNode.replaceWith( this._createReplacementDomElement( elementName, currentNode ) );
  36614. }
  36615. }
  36616. // Empty the target element.
  36617. while ( domElement.firstChild ) {
  36618. domElement.firstChild.remove();
  36619. }
  36620. domElement.append( fragment );
  36621. }
  36622. /**
  36623. * Converts the view to the DOM. For all text nodes, not bound elements and document fragments new items will
  36624. * be created. For bound elements and document fragments the method will return corresponding items.
  36625. *
  36626. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} viewNode
  36627. * View node or document fragment to transform.
  36628. * @param {Document} domDocument Document which will be used to create DOM nodes.
  36629. * @param {Object} [options] Conversion options.
  36630. * @param {Boolean} [options.bind=false] Determines whether new elements will be bound.
  36631. * @param {Boolean} [options.withChildren=true] If `true`, node's and document fragment's children will be converted too.
  36632. * @returns {Node|DocumentFragment} Converted node or DocumentFragment.
  36633. */
  36634. viewToDom( viewNode, domDocument, options = {} ) {
  36635. if ( viewNode.is( '$text' ) ) {
  36636. const textData = this._processDataFromViewText( viewNode );
  36637. return domDocument.createTextNode( textData );
  36638. } else {
  36639. if ( this.mapViewToDom( viewNode ) ) {
  36640. return this.mapViewToDom( viewNode );
  36641. }
  36642. let domElement;
  36643. if ( viewNode.is( 'documentFragment' ) ) {
  36644. // Create DOM document fragment.
  36645. domElement = domDocument.createDocumentFragment();
  36646. if ( options.bind ) {
  36647. this.bindDocumentFragments( domElement, viewNode );
  36648. }
  36649. } else if ( viewNode.is( 'uiElement' ) ) {
  36650. if ( viewNode.name === '$comment' ) {
  36651. domElement = domDocument.createComment( viewNode.getCustomProperty( '$rawContent' ) );
  36652. } else {
  36653. // UIElement has its own render() method (see #799).
  36654. domElement = viewNode.render( domDocument, this );
  36655. }
  36656. if ( options.bind ) {
  36657. this.bindElements( domElement, viewNode );
  36658. }
  36659. return domElement;
  36660. } else {
  36661. // Create DOM element.
  36662. if ( this._shouldRenameElement( viewNode.name ) ) {
  36663. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__["logWarning"])( 'domconverter-unsafe-element-detected', { unsafeElement: viewNode } );
  36664. domElement = this._createReplacementDomElement( viewNode.name );
  36665. } else if ( viewNode.hasAttribute( 'xmlns' ) ) {
  36666. domElement = domDocument.createElementNS( viewNode.getAttribute( 'xmlns' ), viewNode.name );
  36667. } else {
  36668. domElement = domDocument.createElement( viewNode.name );
  36669. }
  36670. // RawElement take care of their children in RawElement#render() method which can be customized
  36671. // (see https://github.com/ckeditor/ckeditor5/issues/4469).
  36672. if ( viewNode.is( 'rawElement' ) ) {
  36673. viewNode.render( domElement, this );
  36674. }
  36675. if ( options.bind ) {
  36676. this.bindElements( domElement, viewNode );
  36677. }
  36678. // Copy element's attributes.
  36679. for ( const key of viewNode.getAttributeKeys() ) {
  36680. this.setDomElementAttribute( domElement, key, viewNode.getAttribute( key ), viewNode );
  36681. }
  36682. }
  36683. if ( options.withChildren !== false ) {
  36684. for ( const child of this.viewChildrenToDom( viewNode, domDocument, options ) ) {
  36685. domElement.appendChild( child );
  36686. }
  36687. }
  36688. return domElement;
  36689. }
  36690. }
  36691. /**
  36692. * Sets the attribute on a DOM element.
  36693. *
  36694. * **Note**: To remove the attribute, use {@link #removeDomElementAttribute}.
  36695. *
  36696. * @param {HTMLElement} domElement The DOM element the attribute should be set on.
  36697. * @param {String} key The name of the attribute
  36698. * @param {String} value The value of the attribute
  36699. * @param {module:engine/view/element~Element} [relatedViewElement] The view element related to the `domElement` (if there is any).
  36700. * It helps decide whether the attribute set is unsafe. For instance, view elements created via
  36701. * {@link module:engine/view/downcastwriter~DowncastWriter} methods can allow certain attributes that would normally be filtered out.
  36702. */
  36703. setDomElementAttribute( domElement, key, value, relatedViewElement = null ) {
  36704. const shouldRenderAttribute = this.shouldRenderAttribute( key, value, domElement.tagName.toLowerCase() ) ||
  36705. relatedViewElement && relatedViewElement.shouldRenderUnsafeAttribute( key );
  36706. if ( !shouldRenderAttribute ) {
  36707. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__["logWarning"])( 'domconverter-unsafe-attribute-detected', { domElement, key, value } );
  36708. }
  36709. // The old value was safe but the new value is unsafe.
  36710. if ( domElement.hasAttribute( key ) && !shouldRenderAttribute ) {
  36711. domElement.removeAttribute( key );
  36712. }
  36713. // The old value was unsafe (but prefixed) but the new value will be safe (will be unprefixed).
  36714. else if ( domElement.hasAttribute( UNSAFE_ATTRIBUTE_NAME_PREFIX + key ) && shouldRenderAttribute ) {
  36715. domElement.removeAttribute( UNSAFE_ATTRIBUTE_NAME_PREFIX + key );
  36716. }
  36717. // If the attribute should not be rendered, rename it (instead of removing) to give developers some idea of what
  36718. // is going on (https://github.com/ckeditor/ckeditor5/issues/10801).
  36719. domElement.setAttribute( shouldRenderAttribute ? key : UNSAFE_ATTRIBUTE_NAME_PREFIX + key, value );
  36720. }
  36721. /**
  36722. * Removes an attribute from a DOM element.
  36723. *
  36724. * **Note**: To set the attribute, use {@link #setDomElementAttribute}.
  36725. *
  36726. * @param {HTMLElement} domElement The DOM element the attribute should be removed from.
  36727. * @param {String} key The name of the attribute.
  36728. */
  36729. removeDomElementAttribute( domElement, key ) {
  36730. // See #_createReplacementDomElement() to learn what this is.
  36731. if ( key == UNSAFE_ELEMENT_REPLACEMENT_ATTRIBUTE ) {
  36732. return;
  36733. }
  36734. domElement.removeAttribute( key );
  36735. // See setDomElementAttribute() to learn what this is.
  36736. domElement.removeAttribute( UNSAFE_ATTRIBUTE_NAME_PREFIX + key );
  36737. }
  36738. /**
  36739. * Converts children of the view element to DOM using the
  36740. * {@link module:engine/view/domconverter~DomConverter#viewToDom} method.
  36741. * Additionally, this method adds block {@link module:engine/view/filler filler} to the list of children, if needed.
  36742. *
  36743. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} viewElement Parent view element.
  36744. * @param {Document} domDocument Document which will be used to create DOM nodes.
  36745. * @param {Object} options See {@link module:engine/view/domconverter~DomConverter#viewToDom} options parameter.
  36746. * @returns {Iterable.<Node>} DOM nodes.
  36747. */
  36748. * viewChildrenToDom( viewElement, domDocument, options = {} ) {
  36749. const fillerPositionOffset = viewElement.getFillerOffset && viewElement.getFillerOffset();
  36750. let offset = 0;
  36751. for ( const childView of viewElement.getChildren() ) {
  36752. if ( fillerPositionOffset === offset ) {
  36753. yield this._getBlockFiller( domDocument );
  36754. }
  36755. yield this.viewToDom( childView, domDocument, options );
  36756. offset++;
  36757. }
  36758. if ( fillerPositionOffset === offset ) {
  36759. yield this._getBlockFiller( domDocument );
  36760. }
  36761. }
  36762. /**
  36763. * Converts view {@link module:engine/view/range~Range} to DOM range.
  36764. * Inline and block {@link module:engine/view/filler fillers} are handled during the conversion.
  36765. *
  36766. * @param {module:engine/view/range~Range} viewRange View range.
  36767. * @returns {Range} DOM range.
  36768. */
  36769. viewRangeToDom( viewRange ) {
  36770. const domStart = this.viewPositionToDom( viewRange.start );
  36771. const domEnd = this.viewPositionToDom( viewRange.end );
  36772. const domRange = document.createRange();
  36773. domRange.setStart( domStart.parent, domStart.offset );
  36774. domRange.setEnd( domEnd.parent, domEnd.offset );
  36775. return domRange;
  36776. }
  36777. /**
  36778. * Converts view {@link module:engine/view/position~Position} to DOM parent and offset.
  36779. *
  36780. * Inline and block {@link module:engine/view/filler fillers} are handled during the conversion.
  36781. * If the converted position is directly before inline filler it is moved inside the filler.
  36782. *
  36783. * @param {module:engine/view/position~Position} viewPosition View position.
  36784. * @returns {Object|null} position DOM position or `null` if view position could not be converted to DOM.
  36785. * @returns {Node} position.parent DOM position parent.
  36786. * @returns {Number} position.offset DOM position offset.
  36787. */
  36788. viewPositionToDom( viewPosition ) {
  36789. const viewParent = viewPosition.parent;
  36790. if ( viewParent.is( '$text' ) ) {
  36791. const domParent = this.findCorrespondingDomText( viewParent );
  36792. if ( !domParent ) {
  36793. // Position is in a view text node that has not been rendered to DOM yet.
  36794. return null;
  36795. }
  36796. let offset = viewPosition.offset;
  36797. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_9__["startsWithFiller"])( domParent ) ) {
  36798. offset += _filler__WEBPACK_IMPORTED_MODULE_9__["INLINE_FILLER_LENGTH"];
  36799. }
  36800. return { parent: domParent, offset };
  36801. } else {
  36802. // viewParent is instance of ViewElement.
  36803. let domParent, domBefore, domAfter;
  36804. if ( viewPosition.offset === 0 ) {
  36805. domParent = this.mapViewToDom( viewParent );
  36806. if ( !domParent ) {
  36807. // Position is in a view element that has not been rendered to DOM yet.
  36808. return null;
  36809. }
  36810. domAfter = domParent.childNodes[ 0 ];
  36811. } else {
  36812. const nodeBefore = viewPosition.nodeBefore;
  36813. domBefore = nodeBefore.is( '$text' ) ?
  36814. this.findCorrespondingDomText( nodeBefore ) :
  36815. this.mapViewToDom( viewPosition.nodeBefore );
  36816. if ( !domBefore ) {
  36817. // Position is after a view element that has not been rendered to DOM yet.
  36818. return null;
  36819. }
  36820. domParent = domBefore.parentNode;
  36821. domAfter = domBefore.nextSibling;
  36822. }
  36823. // If there is an inline filler at position return position inside the filler. We should never return
  36824. // the position before the inline filler.
  36825. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_14__["default"])( domAfter ) && Object(_filler__WEBPACK_IMPORTED_MODULE_9__["startsWithFiller"])( domAfter ) ) {
  36826. return { parent: domAfter, offset: _filler__WEBPACK_IMPORTED_MODULE_9__["INLINE_FILLER_LENGTH"] };
  36827. }
  36828. const offset = domBefore ? Object(_ckeditor_ckeditor5_utils_src_dom_indexof__WEBPACK_IMPORTED_MODULE_12__["default"])( domBefore ) + 1 : 0;
  36829. return { parent: domParent, offset };
  36830. }
  36831. }
  36832. /**
  36833. * Converts DOM to view. For all text nodes, not bound elements and document fragments new items will
  36834. * be created. For bound elements and document fragments function will return corresponding items. For
  36835. * {@link module:engine/view/filler fillers} `null` will be returned.
  36836. * For all DOM elements rendered by {@link module:engine/view/uielement~UIElement} that UIElement will be returned.
  36837. *
  36838. * @param {Node|DocumentFragment} domNode DOM node or document fragment to transform.
  36839. * @param {Object} [options] Conversion options.
  36840. * @param {Boolean} [options.bind=false] Determines whether new elements will be bound.
  36841. * @param {Boolean} [options.withChildren=true] If `true`, node's and document fragment's children will be converted too.
  36842. * @param {Boolean} [options.keepOriginalCase=false] If `false`, node's tag name will be converted to lower case.
  36843. * @param {Boolean} [options.skipComments=false] If `false`, comment nodes will be converted to `$comment`
  36844. * {@link module:engine/view/uielement~UIElement view UI elements}.
  36845. * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null} Converted node or document fragment
  36846. * or `null` if DOM node is a {@link module:engine/view/filler filler} or the given node is an empty text node.
  36847. */
  36848. domToView( domNode, options = {} ) {
  36849. if ( this.isBlockFiller( domNode ) ) {
  36850. return null;
  36851. }
  36852. // When node is inside a UIElement or a RawElement return that parent as it's view representation.
  36853. const hostElement = this.getHostViewElement( domNode );
  36854. if ( hostElement ) {
  36855. return hostElement;
  36856. }
  36857. if ( this.isComment( domNode ) && options.skipComments ) {
  36858. return null;
  36859. }
  36860. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_14__["default"])( domNode ) ) {
  36861. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_9__["isInlineFiller"])( domNode ) ) {
  36862. return null;
  36863. } else {
  36864. const textData = this._processDataFromDomText( domNode );
  36865. return textData === '' ? null : new _text__WEBPACK_IMPORTED_MODULE_0__["default"]( this.document, textData );
  36866. }
  36867. } else {
  36868. if ( this.mapDomToView( domNode ) ) {
  36869. return this.mapDomToView( domNode );
  36870. }
  36871. let viewElement;
  36872. if ( this.isDocumentFragment( domNode ) ) {
  36873. // Create view document fragment.
  36874. viewElement = new _documentfragment__WEBPACK_IMPORTED_MODULE_6__["default"]( this.document );
  36875. if ( options.bind ) {
  36876. this.bindDocumentFragments( domNode, viewElement );
  36877. }
  36878. } else {
  36879. // Create view element.
  36880. viewElement = this._createViewElement( domNode, options );
  36881. if ( options.bind ) {
  36882. this.bindElements( domNode, viewElement );
  36883. }
  36884. // Copy element's attributes.
  36885. const attrs = domNode.attributes;
  36886. if ( attrs ) {
  36887. for ( let i = attrs.length - 1; i >= 0; i-- ) {
  36888. viewElement._setAttribute( attrs[ i ].name, attrs[ i ].value );
  36889. }
  36890. }
  36891. // Treat this element's content as a raw data if it was registered as such.
  36892. // Comment node is also treated as an element with raw data.
  36893. if ( this._isViewElementWithRawContent( viewElement, options ) || this.isComment( domNode ) ) {
  36894. const rawContent = this.isComment( domNode ) ? domNode.data : domNode.innerHTML;
  36895. viewElement._setCustomProperty( '$rawContent', rawContent );
  36896. // Store a DOM node to prevent left trimming of the following text node.
  36897. this._encounteredRawContentDomNodes.add( domNode );
  36898. return viewElement;
  36899. }
  36900. }
  36901. if ( options.withChildren !== false ) {
  36902. for ( const child of this.domChildrenToView( domNode, options ) ) {
  36903. viewElement._appendChild( child );
  36904. }
  36905. }
  36906. return viewElement;
  36907. }
  36908. }
  36909. /**
  36910. * Converts children of the DOM element to view nodes using
  36911. * the {@link module:engine/view/domconverter~DomConverter#domToView} method.
  36912. * Additionally this method omits block {@link module:engine/view/filler filler}, if it exists in the DOM parent.
  36913. *
  36914. * @param {HTMLElement} domElement Parent DOM element.
  36915. * @param {Object} options See {@link module:engine/view/domconverter~DomConverter#domToView} options parameter.
  36916. * @returns {Iterable.<module:engine/view/node~Node>} View nodes.
  36917. */
  36918. * domChildrenToView( domElement, options = {} ) {
  36919. for ( let i = 0; i < domElement.childNodes.length; i++ ) {
  36920. const domChild = domElement.childNodes[ i ];
  36921. const viewChild = this.domToView( domChild, options );
  36922. if ( viewChild !== null ) {
  36923. yield viewChild;
  36924. }
  36925. }
  36926. }
  36927. /**
  36928. * Converts DOM selection to view {@link module:engine/view/selection~Selection}.
  36929. * Ranges which cannot be converted will be omitted.
  36930. *
  36931. * @param {Selection} domSelection DOM selection.
  36932. * @returns {module:engine/view/selection~Selection} View selection.
  36933. */
  36934. domSelectionToView( domSelection ) {
  36935. // DOM selection might be placed in fake selection container.
  36936. // If container contains fake selection - return corresponding view selection.
  36937. if ( domSelection.rangeCount === 1 ) {
  36938. let container = domSelection.getRangeAt( 0 ).startContainer;
  36939. // The DOM selection might be moved to the text node inside the fake selection container.
  36940. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_14__["default"])( container ) ) {
  36941. container = container.parentNode;
  36942. }
  36943. const viewSelection = this.fakeSelectionToView( container );
  36944. if ( viewSelection ) {
  36945. return viewSelection;
  36946. }
  36947. }
  36948. const isBackward = this.isDomSelectionBackward( domSelection );
  36949. const viewRanges = [];
  36950. for ( let i = 0; i < domSelection.rangeCount; i++ ) {
  36951. // DOM Range have correct start and end, no matter what is the DOM Selection direction. So we don't have to fix anything.
  36952. const domRange = domSelection.getRangeAt( i );
  36953. const viewRange = this.domRangeToView( domRange );
  36954. if ( viewRange ) {
  36955. viewRanges.push( viewRange );
  36956. }
  36957. }
  36958. return new _selection__WEBPACK_IMPORTED_MODULE_5__["default"]( viewRanges, { backward: isBackward } );
  36959. }
  36960. /**
  36961. * Converts DOM Range to view {@link module:engine/view/range~Range}.
  36962. * If the start or end position can not be converted `null` is returned.
  36963. *
  36964. * @param {Range} domRange DOM range.
  36965. * @returns {module:engine/view/range~Range|null} View range.
  36966. */
  36967. domRangeToView( domRange ) {
  36968. const viewStart = this.domPositionToView( domRange.startContainer, domRange.startOffset );
  36969. const viewEnd = this.domPositionToView( domRange.endContainer, domRange.endOffset );
  36970. if ( viewStart && viewEnd ) {
  36971. return new _range__WEBPACK_IMPORTED_MODULE_4__["default"]( viewStart, viewEnd );
  36972. }
  36973. return null;
  36974. }
  36975. /**
  36976. * Converts DOM parent and offset to view {@link module:engine/view/position~Position}.
  36977. *
  36978. * If the position is inside a {@link module:engine/view/filler filler} which has no corresponding view node,
  36979. * position of the filler will be converted and returned.
  36980. *
  36981. * If the position is inside DOM element rendered by {@link module:engine/view/uielement~UIElement}
  36982. * that position will be converted to view position before that UIElement.
  36983. *
  36984. * If structures are too different and it is not possible to find corresponding position then `null` will be returned.
  36985. *
  36986. * @param {Node} domParent DOM position parent.
  36987. * @param {Number} [domOffset=0] DOM position offset. You can skip it when converting the inline filler node.
  36988. * @returns {module:engine/view/position~Position} viewPosition View position.
  36989. */
  36990. domPositionToView( domParent, domOffset = 0 ) {
  36991. if ( this.isBlockFiller( domParent ) ) {
  36992. return this.domPositionToView( domParent.parentNode, Object(_ckeditor_ckeditor5_utils_src_dom_indexof__WEBPACK_IMPORTED_MODULE_12__["default"])( domParent ) );
  36993. }
  36994. // If position is somewhere inside UIElement or a RawElement - return position before that element.
  36995. const viewElement = this.mapDomToView( domParent );
  36996. if ( viewElement && ( viewElement.is( 'uiElement' ) || viewElement.is( 'rawElement' ) ) ) {
  36997. return _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( viewElement );
  36998. }
  36999. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_14__["default"])( domParent ) ) {
  37000. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_9__["isInlineFiller"])( domParent ) ) {
  37001. return this.domPositionToView( domParent.parentNode, Object(_ckeditor_ckeditor5_utils_src_dom_indexof__WEBPACK_IMPORTED_MODULE_12__["default"])( domParent ) );
  37002. }
  37003. const viewParent = this.findCorrespondingViewText( domParent );
  37004. let offset = domOffset;
  37005. if ( !viewParent ) {
  37006. return null;
  37007. }
  37008. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_9__["startsWithFiller"])( domParent ) ) {
  37009. offset -= _filler__WEBPACK_IMPORTED_MODULE_9__["INLINE_FILLER_LENGTH"];
  37010. offset = offset < 0 ? 0 : offset;
  37011. }
  37012. return new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( viewParent, offset );
  37013. }
  37014. // domParent instanceof HTMLElement.
  37015. else {
  37016. if ( domOffset === 0 ) {
  37017. const viewParent = this.mapDomToView( domParent );
  37018. if ( viewParent ) {
  37019. return new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( viewParent, 0 );
  37020. }
  37021. } else {
  37022. const domBefore = domParent.childNodes[ domOffset - 1 ];
  37023. const viewBefore = Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_14__["default"])( domBefore ) ?
  37024. this.findCorrespondingViewText( domBefore ) :
  37025. this.mapDomToView( domBefore );
  37026. // TODO #663
  37027. if ( viewBefore && viewBefore.parent ) {
  37028. return new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( viewBefore.parent, viewBefore.index + 1 );
  37029. }
  37030. }
  37031. return null;
  37032. }
  37033. }
  37034. /**
  37035. * Returns corresponding view {@link module:engine/view/element~Element Element} or
  37036. * {@link module:engine/view/documentfragment~DocumentFragment} for provided DOM element or
  37037. * document fragment. If there is no view item {@link module:engine/view/domconverter~DomConverter#bindElements bound}
  37038. * to the given DOM - `undefined` is returned.
  37039. *
  37040. * For all DOM elements rendered by a {@link module:engine/view/uielement~UIElement} or
  37041. * a {@link module:engine/view/rawelement~RawElement}, the parent `UIElement` or `RawElement` will be returned.
  37042. *
  37043. * @param {DocumentFragment|Element} domElementOrDocumentFragment DOM element or document fragment.
  37044. * @returns {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment|undefined}
  37045. * Corresponding view element, document fragment or `undefined` if no element was bound.
  37046. */
  37047. mapDomToView( domElementOrDocumentFragment ) {
  37048. const hostElement = this.getHostViewElement( domElementOrDocumentFragment );
  37049. return hostElement || this._domToViewMapping.get( domElementOrDocumentFragment );
  37050. }
  37051. /**
  37052. * Finds corresponding text node. Text nodes are not {@link module:engine/view/domconverter~DomConverter#bindElements bound},
  37053. * corresponding text node is returned based on the sibling or parent.
  37054. *
  37055. * If the directly previous sibling is a {@link module:engine/view/domconverter~DomConverter#bindElements bound} element, it is used
  37056. * to find the corresponding text node.
  37057. *
  37058. * If this is a first child in the parent and the parent is a {@link module:engine/view/domconverter~DomConverter#bindElements bound}
  37059. * element, it is used to find the corresponding text node.
  37060. *
  37061. * For all text nodes rendered by a {@link module:engine/view/uielement~UIElement} or
  37062. * a {@link module:engine/view/rawelement~RawElement}, the parent `UIElement` or `RawElement` will be returned.
  37063. *
  37064. * Otherwise `null` is returned.
  37065. *
  37066. * Note that for the block or inline {@link module:engine/view/filler filler} this method returns `null`.
  37067. *
  37068. * @param {Text} domText DOM text node.
  37069. * @returns {module:engine/view/text~Text|null} Corresponding view text node or `null`, if it was not possible to find a
  37070. * corresponding node.
  37071. */
  37072. findCorrespondingViewText( domText ) {
  37073. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_9__["isInlineFiller"])( domText ) ) {
  37074. return null;
  37075. }
  37076. // If DOM text was rendered by a UIElement or a RawElement - return this parent element.
  37077. const hostElement = this.getHostViewElement( domText );
  37078. if ( hostElement ) {
  37079. return hostElement;
  37080. }
  37081. const previousSibling = domText.previousSibling;
  37082. // Try to use previous sibling to find the corresponding text node.
  37083. if ( previousSibling ) {
  37084. if ( !( this.isElement( previousSibling ) ) ) {
  37085. // The previous is text or comment.
  37086. return null;
  37087. }
  37088. const viewElement = this.mapDomToView( previousSibling );
  37089. if ( viewElement ) {
  37090. const nextSibling = viewElement.nextSibling;
  37091. // It might be filler which has no corresponding view node.
  37092. if ( nextSibling instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  37093. return viewElement.nextSibling;
  37094. } else {
  37095. return null;
  37096. }
  37097. }
  37098. }
  37099. // Try to use parent to find the corresponding text node.
  37100. else {
  37101. const viewElement = this.mapDomToView( domText.parentNode );
  37102. if ( viewElement ) {
  37103. const firstChild = viewElement.getChild( 0 );
  37104. // It might be filler which has no corresponding view node.
  37105. if ( firstChild instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  37106. return firstChild;
  37107. } else {
  37108. return null;
  37109. }
  37110. }
  37111. }
  37112. return null;
  37113. }
  37114. /**
  37115. * Returns corresponding DOM item for provided {@link module:engine/view/element~Element Element} or
  37116. * {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment}.
  37117. * To find a corresponding text for {@link module:engine/view/text~Text view Text instance}
  37118. * use {@link #findCorrespondingDomText}.
  37119. *
  37120. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} viewNode
  37121. * View element or document fragment.
  37122. * @returns {Node|DocumentFragment|undefined} Corresponding DOM node or document fragment.
  37123. */
  37124. mapViewToDom( documentFragmentOrElement ) {
  37125. return this._viewToDomMapping.get( documentFragmentOrElement );
  37126. }
  37127. /**
  37128. * Finds corresponding text node. Text nodes are not {@link module:engine/view/domconverter~DomConverter#bindElements bound},
  37129. * corresponding text node is returned based on the sibling or parent.
  37130. *
  37131. * If the directly previous sibling is a {@link module:engine/view/domconverter~DomConverter#bindElements bound} element, it is used
  37132. * to find the corresponding text node.
  37133. *
  37134. * If this is a first child in the parent and the parent is a {@link module:engine/view/domconverter~DomConverter#bindElements bound}
  37135. * element, it is used to find the corresponding text node.
  37136. *
  37137. * Otherwise `null` is returned.
  37138. *
  37139. * @param {module:engine/view/text~Text} viewText View text node.
  37140. * @returns {Text|null} Corresponding DOM text node or `null`, if it was not possible to find a corresponding node.
  37141. */
  37142. findCorrespondingDomText( viewText ) {
  37143. const previousSibling = viewText.previousSibling;
  37144. // Try to use previous sibling to find the corresponding text node.
  37145. if ( previousSibling && this.mapViewToDom( previousSibling ) ) {
  37146. return this.mapViewToDom( previousSibling ).nextSibling;
  37147. }
  37148. // If this is a first node, try to use parent to find the corresponding text node.
  37149. if ( !previousSibling && viewText.parent && this.mapViewToDom( viewText.parent ) ) {
  37150. return this.mapViewToDom( viewText.parent ).childNodes[ 0 ];
  37151. }
  37152. return null;
  37153. }
  37154. /**
  37155. * Focuses DOM editable that is corresponding to provided {@link module:engine/view/editableelement~EditableElement}.
  37156. *
  37157. * @param {module:engine/view/editableelement~EditableElement} viewEditable
  37158. */
  37159. focus( viewEditable ) {
  37160. const domEditable = this.mapViewToDom( viewEditable );
  37161. if ( domEditable && domEditable.ownerDocument.activeElement !== domEditable ) {
  37162. // Save the scrollX and scrollY positions before the focus.
  37163. const { scrollX, scrollY } = _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_10__["default"].window;
  37164. const scrollPositions = [];
  37165. // Save all scrollLeft and scrollTop values starting from domEditable up to
  37166. // document#documentElement.
  37167. forEachDomNodeAncestor( domEditable, node => {
  37168. const { scrollLeft, scrollTop } = node;
  37169. scrollPositions.push( [ scrollLeft, scrollTop ] );
  37170. } );
  37171. domEditable.focus();
  37172. // Restore scrollLeft and scrollTop values starting from domEditable up to
  37173. // document#documentElement.
  37174. // https://github.com/ckeditor/ckeditor5-engine/issues/951
  37175. // https://github.com/ckeditor/ckeditor5-engine/issues/957
  37176. forEachDomNodeAncestor( domEditable, node => {
  37177. const [ scrollLeft, scrollTop ] = scrollPositions.shift();
  37178. node.scrollLeft = scrollLeft;
  37179. node.scrollTop = scrollTop;
  37180. } );
  37181. // Restore the scrollX and scrollY positions after the focus.
  37182. // https://github.com/ckeditor/ckeditor5-engine/issues/951
  37183. _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_10__["default"].window.scrollTo( scrollX, scrollY );
  37184. }
  37185. }
  37186. /**
  37187. * Returns `true` when `node.nodeType` equals `Node.ELEMENT_NODE`.
  37188. *
  37189. * @param {Node} node Node to check.
  37190. * @returns {Boolean}
  37191. */
  37192. isElement( node ) {
  37193. return node && node.nodeType == Node.ELEMENT_NODE;
  37194. }
  37195. /**
  37196. * Returns `true` when `node.nodeType` equals `Node.DOCUMENT_FRAGMENT_NODE`.
  37197. *
  37198. * @param {Node} node Node to check.
  37199. * @returns {Boolean}
  37200. */
  37201. isDocumentFragment( node ) {
  37202. return node && node.nodeType == Node.DOCUMENT_FRAGMENT_NODE;
  37203. }
  37204. /**
  37205. * Returns `true` when `node.nodeType` equals `Node.COMMENT_NODE`.
  37206. *
  37207. * @param {Node} node Node to check.
  37208. * @returns {Boolean}
  37209. */
  37210. isComment( node ) {
  37211. return node && node.nodeType == Node.COMMENT_NODE;
  37212. }
  37213. /**
  37214. * Checks if the node is an instance of the block filler for this DOM converter.
  37215. *
  37216. * const converter = new DomConverter( viewDocument, { blockFillerMode: 'br' } );
  37217. *
  37218. * converter.isBlockFiller( BR_FILLER( document ) ); // true
  37219. * converter.isBlockFiller( NBSP_FILLER( document ) ); // false
  37220. *
  37221. * **Note:**: For the `'nbsp'` mode the method also checks context of a node so it cannot be a detached node.
  37222. *
  37223. * **Note:** A special case in the `'nbsp'` mode exists where the `<br>` in `<p><br></p>` is treated as a block filler.
  37224. *
  37225. * @param {Node} domNode DOM node to check.
  37226. * @returns {Boolean} True if a node is considered a block filler for given mode.
  37227. */
  37228. isBlockFiller( domNode ) {
  37229. if ( this.blockFillerMode == 'br' ) {
  37230. return domNode.isEqualNode( BR_FILLER_REF );
  37231. }
  37232. // Special case for <p><br></p> in which <br> should be treated as filler even when we are not in the 'br' mode. See ckeditor5#5564.
  37233. if ( domNode.tagName === 'BR' && hasBlockParent( domNode, this.blockElements ) && domNode.parentNode.childNodes.length === 1 ) {
  37234. return true;
  37235. }
  37236. // If not in 'br' mode, try recognizing both marked and regular nbsp block fillers.
  37237. return domNode.isEqualNode( MARKED_NBSP_FILLER_REF ) || isNbspBlockFiller( domNode, this.blockElements );
  37238. }
  37239. /**
  37240. * Returns `true` if given selection is a backward selection, that is, if it's `focus` is before `anchor`.
  37241. *
  37242. * @param {Selection} DOM Selection instance to check.
  37243. * @returns {Boolean}
  37244. */
  37245. isDomSelectionBackward( selection ) {
  37246. if ( selection.isCollapsed ) {
  37247. return false;
  37248. }
  37249. // Since it takes multiple lines of code to check whether a "DOM Position" is before/after another "DOM Position",
  37250. // we will use the fact that range will collapse if it's end is before it's start.
  37251. const range = document.createRange();
  37252. range.setStart( selection.anchorNode, selection.anchorOffset );
  37253. range.setEnd( selection.focusNode, selection.focusOffset );
  37254. const backward = range.collapsed;
  37255. range.detach();
  37256. return backward;
  37257. }
  37258. /**
  37259. * Returns a parent {@link module:engine/view/uielement~UIElement} or {@link module:engine/view/rawelement~RawElement}
  37260. * that hosts the provided DOM node. Returns `null` if there is no such parent.
  37261. *
  37262. * @param {Node} domNode
  37263. * @returns {module:engine/view/uielement~UIElement|module:engine/view/rawelement~RawElement|null}
  37264. */
  37265. getHostViewElement( domNode ) {
  37266. const ancestors = Object(_ckeditor_ckeditor5_utils_src_dom_getancestors__WEBPACK_IMPORTED_MODULE_13__["default"])( domNode );
  37267. // Remove domNode from the list.
  37268. ancestors.pop();
  37269. while ( ancestors.length ) {
  37270. const domNode = ancestors.pop();
  37271. const viewNode = this._domToViewMapping.get( domNode );
  37272. if ( viewNode && ( viewNode.is( 'uiElement' ) || viewNode.is( 'rawElement' ) ) ) {
  37273. return viewNode;
  37274. }
  37275. }
  37276. return null;
  37277. }
  37278. /**
  37279. * Checks if the given selection's boundaries are at correct places.
  37280. *
  37281. * The following places are considered as incorrect for selection boundaries:
  37282. *
  37283. * * before or in the middle of an inline filler sequence,
  37284. * * inside a DOM element which represents {@link module:engine/view/uielement~UIElement a view UI element},
  37285. * * inside a DOM element which represents {@link module:engine/view/rawelement~RawElement a view raw element}.
  37286. *
  37287. * @param {Selection} domSelection The DOM selection object to be checked.
  37288. * @returns {Boolean} `true` if the given selection is at a correct place, `false` otherwise.
  37289. */
  37290. isDomSelectionCorrect( domSelection ) {
  37291. return this._isDomSelectionPositionCorrect( domSelection.anchorNode, domSelection.anchorOffset ) &&
  37292. this._isDomSelectionPositionCorrect( domSelection.focusNode, domSelection.focusOffset );
  37293. }
  37294. /**
  37295. * Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data
  37296. * and not processed during the conversion from DOM nodes to view elements.
  37297. *
  37298. * This is affecting how {@link module:engine/view/domconverter~DomConverter#domToView} and
  37299. * {@link module:engine/view/domconverter~DomConverter#domChildrenToView} process DOM nodes.
  37300. *
  37301. * The raw data can be later accessed by a
  37302. * {@link module:engine/view/element~Element#getCustomProperty custom property of a view element} called `"$rawContent"`.
  37303. *
  37304. * @param {module:engine/view/matcher~MatcherPattern} pattern Pattern matching a view element whose content should
  37305. * be treated as raw data.
  37306. */
  37307. registerRawContentMatcher( pattern ) {
  37308. this._rawContentElementMatcher.add( pattern );
  37309. }
  37310. /**
  37311. * Returns the block {@link module:engine/view/filler filler} node based on the current {@link #blockFillerMode} setting.
  37312. *
  37313. * @private
  37314. * @params {Document} domDocument
  37315. * @returns {Node} filler
  37316. */
  37317. _getBlockFiller( domDocument ) {
  37318. switch ( this.blockFillerMode ) {
  37319. case 'nbsp':
  37320. return Object(_filler__WEBPACK_IMPORTED_MODULE_9__["NBSP_FILLER"])( domDocument ); // eslint-disable-line new-cap
  37321. case 'markedNbsp':
  37322. return Object(_filler__WEBPACK_IMPORTED_MODULE_9__["MARKED_NBSP_FILLER"])( domDocument ); // eslint-disable-line new-cap
  37323. case 'br':
  37324. return Object(_filler__WEBPACK_IMPORTED_MODULE_9__["BR_FILLER"])( domDocument ); // eslint-disable-line new-cap
  37325. }
  37326. }
  37327. /**
  37328. * Checks if the given DOM position is a correct place for selection boundary. See {@link #isDomSelectionCorrect}.
  37329. *
  37330. * @private
  37331. * @param {Element} domParent Position parent.
  37332. * @param {Number} offset Position offset.
  37333. * @returns {Boolean} `true` if given position is at a correct place for selection boundary, `false` otherwise.
  37334. */
  37335. _isDomSelectionPositionCorrect( domParent, offset ) {
  37336. // If selection is before or in the middle of inline filler string, it is incorrect.
  37337. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_14__["default"])( domParent ) && Object(_filler__WEBPACK_IMPORTED_MODULE_9__["startsWithFiller"])( domParent ) && offset < _filler__WEBPACK_IMPORTED_MODULE_9__["INLINE_FILLER_LENGTH"] ) {
  37338. // Selection in a text node, at wrong position (before or in the middle of filler).
  37339. return false;
  37340. }
  37341. if ( this.isElement( domParent ) && Object(_filler__WEBPACK_IMPORTED_MODULE_9__["startsWithFiller"])( domParent.childNodes[ offset ] ) ) {
  37342. // Selection in an element node, before filler text node.
  37343. return false;
  37344. }
  37345. const viewParent = this.mapDomToView( domParent );
  37346. // The position is incorrect when anchored inside a UIElement or a RawElement.
  37347. // Note: In case of UIElement and RawElement, mapDomToView() returns a parent element for any DOM child
  37348. // so there's no need to perform any additional checks.
  37349. if ( viewParent && ( viewParent.is( 'uiElement' ) || viewParent.is( 'rawElement' ) ) ) {
  37350. return false;
  37351. }
  37352. return true;
  37353. }
  37354. /**
  37355. * Takes text data from a given {@link module:engine/view/text~Text#data} and processes it so
  37356. * it is correctly displayed in the DOM.
  37357. *
  37358. * Following changes are done:
  37359. *
  37360. * * a space at the beginning is changed to `&nbsp;` if this is the first text node in its container
  37361. * element or if a previous text node ends with a space character,
  37362. * * space at the end of the text node is changed to `&nbsp;` if there are two spaces at the end of a node or if next node
  37363. * starts with a space or if it is the last text node in its container,
  37364. * * remaining spaces are replaced to a chain of spaces and `&nbsp;` (e.g. `'x x'` becomes `'x &nbsp; x'`).
  37365. *
  37366. * Content of {@link #preElements} is not processed.
  37367. *
  37368. * @private
  37369. * @param {module:engine/view/text~Text} node View text node to process.
  37370. * @returns {String} Processed text data.
  37371. */
  37372. _processDataFromViewText( node ) {
  37373. let data = node.data;
  37374. // If any of node ancestors has a name which is in `preElements` array, then currently processed
  37375. // view text node is (will be) in preformatted element. We should not change whitespaces then.
  37376. if ( node.getAncestors().some( parent => this.preElements.includes( parent.name ) ) ) {
  37377. return data;
  37378. }
  37379. // 1. Replace the first space with a nbsp if the previous node ends with a space or there is no previous node
  37380. // (container element boundary).
  37381. if ( data.charAt( 0 ) == ' ' ) {
  37382. const prevNode = this._getTouchingInlineViewNode( node, false );
  37383. const prevEndsWithSpace = prevNode && prevNode.is( '$textProxy' ) && this._nodeEndsWithSpace( prevNode );
  37384. if ( prevEndsWithSpace || !prevNode ) {
  37385. data = '\u00A0' + data.substr( 1 );
  37386. }
  37387. }
  37388. // 2. Replace the last space with nbsp if there are two spaces at the end or if the next node starts with space or there is no
  37389. // next node (container element boundary).
  37390. //
  37391. // Keep in mind that Firefox prefers $nbsp; before tag, not inside it:
  37392. //
  37393. // Foo <span>&nbsp;bar</span> <-- bad.
  37394. // Foo&nbsp;<span> bar</span> <-- good.
  37395. //
  37396. // More here: https://github.com/ckeditor/ckeditor5-engine/issues/1747.
  37397. if ( data.charAt( data.length - 1 ) == ' ' ) {
  37398. const nextNode = this._getTouchingInlineViewNode( node, true );
  37399. const nextStartsWithSpace = nextNode && nextNode.is( '$textProxy' ) && nextNode.data.charAt( 0 ) == ' ';
  37400. if ( data.charAt( data.length - 2 ) == ' ' || !nextNode || nextStartsWithSpace ) {
  37401. data = data.substr( 0, data.length - 1 ) + '\u00A0';
  37402. }
  37403. }
  37404. // 3. Create space+nbsp pairs.
  37405. return data.replace( / {2}/g, ' \u00A0' );
  37406. }
  37407. /**
  37408. * Checks whether given node ends with a space character after changing appropriate space characters to `&nbsp;`s.
  37409. *
  37410. * @private
  37411. * @param {module:engine/view/text~Text} node Node to check.
  37412. * @returns {Boolean} `true` if given `node` ends with space, `false` otherwise.
  37413. */
  37414. _nodeEndsWithSpace( node ) {
  37415. if ( node.getAncestors().some( parent => this.preElements.includes( parent.name ) ) ) {
  37416. return false;
  37417. }
  37418. const data = this._processDataFromViewText( node );
  37419. return data.charAt( data.length - 1 ) == ' ';
  37420. }
  37421. /**
  37422. * Takes text data from native `Text` node and processes it to a correct {@link module:engine/view/text~Text view text node} data.
  37423. *
  37424. * Following changes are done:
  37425. *
  37426. * * multiple whitespaces are replaced to a single space,
  37427. * * space at the beginning of a text node is removed if it is the first text node in its container
  37428. * element or if the previous text node ends with a space character,
  37429. * * space at the end of the text node is removed if there are two spaces at the end of a node or if next node
  37430. * starts with a space or if it is the last text node in its container
  37431. * * nbsps are converted to spaces.
  37432. *
  37433. * @param {Node} node DOM text node to process.
  37434. * @returns {String} Processed data.
  37435. * @private
  37436. */
  37437. _processDataFromDomText( node ) {
  37438. let data = node.data;
  37439. if ( _hasDomParentOfType( node, this.preElements ) ) {
  37440. return Object(_filler__WEBPACK_IMPORTED_MODULE_9__["getDataWithoutFiller"])( node );
  37441. }
  37442. // Change all consecutive whitespace characters (from the [ \n\t\r] set –
  37443. // see https://github.com/ckeditor/ckeditor5-engine/issues/822#issuecomment-311670249) to a single space character.
  37444. // That's how multiple whitespaces are treated when rendered, so we normalize those whitespaces.
  37445. // We're replacing 1+ (and not 2+) to also normalize singular \n\t\r characters (#822).
  37446. data = data.replace( /[ \n\t\r]{1,}/g, ' ' );
  37447. const prevNode = this._getTouchingInlineDomNode( node, false );
  37448. const nextNode = this._getTouchingInlineDomNode( node, true );
  37449. const shouldLeftTrim = this._checkShouldLeftTrimDomText( node, prevNode );
  37450. const shouldRightTrim = this._checkShouldRightTrimDomText( node, nextNode );
  37451. // If the previous dom text node does not exist or it ends by whitespace character, remove space character from the beginning
  37452. // of this text node. Such space character is treated as a whitespace.
  37453. if ( shouldLeftTrim ) {
  37454. data = data.replace( /^ /, '' );
  37455. }
  37456. // If the next text node does not exist remove space character from the end of this text node.
  37457. if ( shouldRightTrim ) {
  37458. data = data.replace( / $/, '' );
  37459. }
  37460. // At the beginning and end of a block element, Firefox inserts normal space + <br> instead of non-breaking space.
  37461. // This means that the text node starts/end with normal space instead of non-breaking space.
  37462. // This causes a problem because the normal space would be removed in `.replace` calls above. To prevent that,
  37463. // the inline filler is removed only after the data is initially processed (by the `.replace` above). See ckeditor5#692.
  37464. data = Object(_filler__WEBPACK_IMPORTED_MODULE_9__["getDataWithoutFiller"])( new Text( data ) );
  37465. // At this point we should have removed all whitespaces from DOM text data.
  37466. //
  37467. // Now, We will reverse the process that happens in `_processDataFromViewText`.
  37468. //
  37469. // We have to change &nbsp; chars, that were in DOM text data because of rendering reasons, to spaces.
  37470. // First, change all ` \u00A0` pairs (space + &nbsp;) to two spaces. DOM converter changes two spaces from model/view to
  37471. // ` \u00A0` to ensure proper rendering. Since here we convert back, we recognize those pairs and change them back to ` `.
  37472. data = data.replace( / \u00A0/g, ' ' );
  37473. const isNextNodeInlineObjectElement = nextNode && this.isElement( nextNode ) && nextNode.tagName != 'BR';
  37474. const isNextNodeStartingWithSpace = nextNode && Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_14__["default"])( nextNode ) && nextNode.data.charAt( 0 ) == ' ';
  37475. // Then, let's change the last nbsp to a space.
  37476. if ( /( |\u00A0)\u00A0$/.test( data ) || !nextNode || isNextNodeInlineObjectElement || isNextNodeStartingWithSpace ) {
  37477. data = data.replace( /\u00A0$/, ' ' );
  37478. }
  37479. // Then, change &nbsp; character that is at the beginning of the text node to space character.
  37480. // We do that replacement only if this is the first node or the previous node ends on whitespace character.
  37481. if ( shouldLeftTrim || prevNode && this.isElement( prevNode ) && prevNode.tagName != 'BR' ) {
  37482. data = data.replace( /^\u00A0/, ' ' );
  37483. }
  37484. // At this point, all whitespaces should be removed and all &nbsp; created for rendering reasons should be
  37485. // changed to normal space. All left &nbsp; are &nbsp; inserted intentionally.
  37486. return data;
  37487. }
  37488. /**
  37489. * Helper function which checks if a DOM text node, preceded by the given `prevNode` should
  37490. * be trimmed from the left side.
  37491. *
  37492. * @private
  37493. * @param {Node} node
  37494. * @param {Node} prevNode Either DOM text or `<br>` or one of `#inlineObjectElements`.
  37495. */
  37496. _checkShouldLeftTrimDomText( node, prevNode ) {
  37497. if ( !prevNode ) {
  37498. return true;
  37499. }
  37500. if ( this.isElement( prevNode ) ) {
  37501. return prevNode.tagName === 'BR';
  37502. }
  37503. // Shouldn't left trim if previous node is a node that was encountered as a raw content node.
  37504. if ( this._encounteredRawContentDomNodes.has( node.previousSibling ) ) {
  37505. return false;
  37506. }
  37507. return /[^\S\u00A0]/.test( prevNode.data.charAt( prevNode.data.length - 1 ) );
  37508. }
  37509. /**
  37510. * Helper function which checks if a DOM text node, succeeded by the given `nextNode` should
  37511. * be trimmed from the right side.
  37512. *
  37513. * @private
  37514. * @param {Node} node
  37515. * @param {Node} nextNode Either DOM text or `<br>` or one of `#inlineObjectElements`.
  37516. */
  37517. _checkShouldRightTrimDomText( node, nextNode ) {
  37518. if ( nextNode ) {
  37519. return false;
  37520. }
  37521. return !Object(_filler__WEBPACK_IMPORTED_MODULE_9__["startsWithFiller"])( node );
  37522. }
  37523. /**
  37524. * Helper function. For given {@link module:engine/view/text~Text view text node}, it finds previous or next sibling
  37525. * that is contained in the same container element. If there is no such sibling, `null` is returned.
  37526. *
  37527. * @private
  37528. * @param {module:engine/view/text~Text} node Reference node.
  37529. * @param {Boolean} getNext
  37530. * @returns {module:engine/view/text~Text|module:engine/view/element~Element|null} Touching text node, an inline object
  37531. * or `null` if there is no next or previous touching text node.
  37532. */
  37533. _getTouchingInlineViewNode( node, getNext ) {
  37534. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_7__["default"]( {
  37535. startPosition: getNext ? _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( node ) : _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( node ),
  37536. direction: getNext ? 'forward' : 'backward'
  37537. } );
  37538. for ( const value of treeWalker ) {
  37539. // Found an inline object (for example an image).
  37540. if ( value.item.is( 'element' ) && this.inlineObjectElements.includes( value.item.name ) ) {
  37541. return value.item;
  37542. }
  37543. // ViewContainerElement is found on a way to next ViewText node, so given `node` was first/last
  37544. // text node in its container element.
  37545. else if ( value.item.is( 'containerElement' ) ) {
  37546. return null;
  37547. }
  37548. // <br> found – it works like a block boundary, so do not scan further.
  37549. else if ( value.item.is( 'element', 'br' ) ) {
  37550. return null;
  37551. }
  37552. // Found a text node in the same container element.
  37553. else if ( value.item.is( '$textProxy' ) ) {
  37554. return value.item;
  37555. }
  37556. }
  37557. return null;
  37558. }
  37559. /**
  37560. * Helper function. For the given text node, it finds the closest touching node which is either
  37561. * a text, `<br>` or an {@link #inlineObjectElements inline object}.
  37562. *
  37563. * If no such node is found, `null` is returned.
  37564. *
  37565. * For instance, in the following DOM structure:
  37566. *
  37567. * <p>foo<b>bar</b><br>bom</p>
  37568. *
  37569. * * `foo` doesn't have its previous touching inline node (`null` is returned),
  37570. * * `foo`'s next touching inline node is `bar`
  37571. * * `bar`'s next touching inline node is `<br>`
  37572. *
  37573. * This method returns text nodes and `<br>` elements because these types of nodes affect how
  37574. * spaces in the given text node need to be converted.
  37575. *
  37576. * @private
  37577. * @param {Text} node
  37578. * @param {Boolean} getNext
  37579. * @returns {Text|Element|null}
  37580. */
  37581. _getTouchingInlineDomNode( node, getNext ) {
  37582. if ( !node.parentNode ) {
  37583. return null;
  37584. }
  37585. const stepInto = getNext ? 'firstChild' : 'lastChild';
  37586. const stepOver = getNext ? 'nextSibling' : 'previousSibling';
  37587. let skipChildren = true;
  37588. do {
  37589. if ( !skipChildren && node[ stepInto ] ) {
  37590. node = node[ stepInto ];
  37591. } else if ( node[ stepOver ] ) {
  37592. node = node[ stepOver ];
  37593. skipChildren = false;
  37594. } else {
  37595. node = node.parentNode;
  37596. skipChildren = true;
  37597. }
  37598. if ( !node || this._isBlockElement( node ) ) {
  37599. return null;
  37600. }
  37601. } while (
  37602. !( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_14__["default"])( node ) || node.tagName == 'BR' || this._isInlineObjectElement( node ) )
  37603. );
  37604. return node;
  37605. }
  37606. /**
  37607. * Returns `true` if a DOM node belongs to {@link #blockElements}. `false` otherwise.
  37608. *
  37609. * @private
  37610. * @param {Node} node
  37611. * @returns {Boolean}
  37612. */
  37613. _isBlockElement( node ) {
  37614. return this.isElement( node ) && this.blockElements.includes( node.tagName.toLowerCase() );
  37615. }
  37616. /**
  37617. * Returns `true` if a DOM node belongs to {@link #inlineObjectElements}. `false` otherwise.
  37618. *
  37619. * @private
  37620. * @param {Node} node
  37621. * @returns {Boolean}
  37622. */
  37623. _isInlineObjectElement( node ) {
  37624. return this.isElement( node ) && this.inlineObjectElements.includes( node.tagName.toLowerCase() );
  37625. }
  37626. /**
  37627. * Creates view element basing on the node type.
  37628. *
  37629. * @private
  37630. * @param {Node} node DOM node to check.
  37631. * @param {Object} options Conversion options. See {@link module:engine/view/domconverter~DomConverter#domToView} options parameter.
  37632. * @returns {Element}
  37633. */
  37634. _createViewElement( node, options ) {
  37635. if ( this.isComment( node ) ) {
  37636. return new _uielement__WEBPACK_IMPORTED_MODULE_2__["default"]( this.document, '$comment' );
  37637. }
  37638. const viewName = options.keepOriginalCase ? node.tagName : node.tagName.toLowerCase();
  37639. return new _element__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document, viewName );
  37640. }
  37641. /**
  37642. * Checks if view element's content should be treated as a raw data.
  37643. *
  37644. * @private
  37645. * @param {Element} viewElement View element to check.
  37646. * @param {Object} options Conversion options. See {@link module:engine/view/domconverter~DomConverter#domToView} options parameter.
  37647. * @returns {Boolean}
  37648. */
  37649. _isViewElementWithRawContent( viewElement, options ) {
  37650. return options.withChildren !== false && this._rawContentElementMatcher.match( viewElement );
  37651. }
  37652. /**
  37653. * Checks whether a given element name should be renamed in a current rendering mode.
  37654. *
  37655. * @private
  37656. * @param {String} elementName The name of view element.
  37657. * @returns {Boolean}
  37658. */
  37659. _shouldRenameElement( elementName ) {
  37660. return this.renderingMode == 'editing' && elementName.toLowerCase() == 'script';
  37661. }
  37662. /**
  37663. * Return a <span> element with a special attribute holding the name of the original element.
  37664. * Optionally, copy all the attributes of the original element if that element is provided.
  37665. *
  37666. * @private
  37667. * @param {String} elementName The name of view element.
  37668. * @param {Element} [originalDomElement] The original DOM element to copy attributes and content from.
  37669. * @returns {Element}
  37670. */
  37671. _createReplacementDomElement( elementName, originalDomElement = null ) {
  37672. const newDomElement = document.createElement( 'span' );
  37673. // Mark the span replacing a script as hidden.
  37674. newDomElement.setAttribute( UNSAFE_ELEMENT_REPLACEMENT_ATTRIBUTE, elementName );
  37675. if ( originalDomElement ) {
  37676. while ( originalDomElement.firstChild ) {
  37677. newDomElement.appendChild( originalDomElement.firstChild );
  37678. }
  37679. for ( const attributeName of originalDomElement.getAttributeNames() ) {
  37680. newDomElement.setAttribute( attributeName, originalDomElement.getAttribute( attributeName ) );
  37681. }
  37682. }
  37683. return newDomElement;
  37684. }
  37685. }
  37686. // Helper function.
  37687. // Used to check if given native `Element` or `Text` node has parent with tag name from `types` array.
  37688. //
  37689. // @param {Node} node
  37690. // @param {Array.<String>} types
  37691. // @returns {Boolean} `true` if such parent exists or `false` if it does not.
  37692. function _hasDomParentOfType( node, types ) {
  37693. const parents = Object(_ckeditor_ckeditor5_utils_src_dom_getancestors__WEBPACK_IMPORTED_MODULE_13__["default"])( node );
  37694. return parents.some( parent => parent.tagName && types.includes( parent.tagName.toLowerCase() ) );
  37695. }
  37696. // A helper that executes given callback for each DOM node's ancestor, starting from the given node
  37697. // and ending in document#documentElement.
  37698. //
  37699. // @param {Node} node
  37700. // @param {Function} callback A callback to be executed for each ancestor.
  37701. function forEachDomNodeAncestor( node, callback ) {
  37702. while ( node && node != _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_10__["default"].document ) {
  37703. callback( node );
  37704. node = node.parentNode;
  37705. }
  37706. }
  37707. // Checks if given node is a nbsp block filler.
  37708. //
  37709. // A &nbsp; is a block filler only if it is a single child of a block element.
  37710. //
  37711. // @param {Node} domNode DOM node.
  37712. // @param {Array.<String>} blockElements
  37713. // @returns {Boolean}
  37714. function isNbspBlockFiller( domNode, blockElements ) {
  37715. const isNBSP = domNode.isEqualNode( NBSP_FILLER_REF );
  37716. return isNBSP && hasBlockParent( domNode, blockElements ) && domNode.parentNode.childNodes.length === 1;
  37717. }
  37718. // Checks if domNode has block parent.
  37719. //
  37720. // @param {Node} domNode DOM node.
  37721. // @param {Array.<String>} blockElements
  37722. // @returns {Boolean}
  37723. function hasBlockParent( domNode, blockElements ) {
  37724. const parent = domNode.parentNode;
  37725. return parent && parent.tagName && blockElements.includes( parent.tagName.toLowerCase() );
  37726. }
  37727. /**
  37728. * Enum representing the type of the block filler.
  37729. *
  37730. * Possible values:
  37731. *
  37732. * * `br` &ndash; For the `<br data-cke-filler="true">` block filler used in the editing view.
  37733. * * `nbsp` &ndash; For the `&nbsp;` block fillers used in the data.
  37734. * * `markedNbsp` &ndash; For the `&nbsp;` block fillers wrapped in `<span>` elements: `<span data-cke-filler="true">&nbsp;</span>`
  37735. * used in the data.
  37736. *
  37737. * @typedef {String} module:engine/view/filler~BlockFillerMode
  37738. */
  37739. /**
  37740. * The {@link module:engine/view/domconverter~DomConverter} detected a `<script>` element that may disrupt the
  37741. * {@glink framework/guides/architecture/editing-engine#editing-pipeline editing pipeline} of the editor. To avoid this,
  37742. * the `<script>` element was renamed to `<span data-ck-unsafe-element="script"></span>`.
  37743. *
  37744. * @error domconverter-unsafe-element-detected
  37745. * @param {module:engine/model/element~Element|HTMLElement} unsafeElement The editing view or DOM element
  37746. * that was renamed.
  37747. */
  37748. /**
  37749. * The {@link module:engine/view/domconverter~DomConverter} detected an interactive attribute in the
  37750. * {@glink framework/guides/architecture/editing-engine#editing-pipeline editing pipeline}. For the best
  37751. * editing experience, the attribute was renamed to `data-ck-unsafe-attribute-[original attribute name]`.
  37752. *
  37753. * If you are the author of the plugin that generated this attribute and you want it to be preserved
  37754. * in the editing pipeline, you can configure this when creating the element
  37755. * using {@link module:engine/view/downcastwriter~DowncastWriter} during the
  37756. * {@glink framework/guides/architecture/editing-engine#conversion model–view conversion}. Methods such as
  37757. * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement},
  37758. * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement}, or
  37759. * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement}
  37760. * accept an option that will disable filtering of specific attributes:
  37761. *
  37762. * const paragraph = writer.createContainerElement( 'p',
  37763. * {
  37764. * class: 'clickable-paragraph',
  37765. * onclick: 'alert( "Paragraph clicked!" )'
  37766. * },
  37767. * {
  37768. * // Make sure the "onclick" attribute will pass through.
  37769. * renderUnsafeAttributes: [ 'onclick' ]
  37770. * }
  37771. * );
  37772. *
  37773. * @error domconverter-unsafe-attribute-detected
  37774. * @param {HTMLElement} domElement The DOM element the attribute was set on.
  37775. * @param {String} key The original name of the attribute
  37776. * @param {String} value The value of the original attribute
  37777. */
  37778. /***/ }),
  37779. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js":
  37780. /*!****************************************************************************!*\
  37781. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js ***!
  37782. \****************************************************************************/
  37783. /*! exports provided: default */
  37784. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37785. "use strict";
  37786. __webpack_require__.r(__webpack_exports__);
  37787. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DowncastWriter; });
  37788. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  37789. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  37790. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  37791. /* harmony import */ var _containerelement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./containerelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js");
  37792. /* harmony import */ var _attributeelement__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./attributeelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js");
  37793. /* harmony import */ var _emptyelement__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./emptyelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/emptyelement.js");
  37794. /* harmony import */ var _uielement__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./uielement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js");
  37795. /* harmony import */ var _rawelement__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./rawelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/rawelement.js");
  37796. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  37797. /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js");
  37798. /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  37799. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  37800. /* harmony import */ var _editableelement__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./editableelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js");
  37801. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  37802. /**
  37803. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  37804. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  37805. */
  37806. /**
  37807. * @module module:engine/view/downcastwriter
  37808. */
  37809. /**
  37810. * View downcast writer.
  37811. *
  37812. * It provides a set of methods used to manipulate view nodes.
  37813. *
  37814. * Do not create an instance of this writer manually. To modify a view structure, use
  37815. * the {@link module:engine/view/view~View#change `View#change()`} block.
  37816. *
  37817. * The `DowncastWriter` is designed to work with semantic views which are the views that were/are being downcasted from the model.
  37818. * To work with ordinary views (e.g. parsed from a pasted content) use the
  37819. * {@link module:engine/view/upcastwriter~UpcastWriter upcast writer}.
  37820. *
  37821. * Read more about changing the view in the {@glink framework/guides/architecture/editing-engine#changing-the-view Changing the view}
  37822. * section of the {@glink framework/guides/architecture/editing-engine Editing engine architecture} guide.
  37823. */
  37824. class DowncastWriter {
  37825. /**
  37826. * @param {module:engine/view/document~Document} document The view document instance.
  37827. */
  37828. constructor( document ) {
  37829. /**
  37830. * The view document instance in which this writer operates.
  37831. *
  37832. * @readonly
  37833. * @type {module:engine/view/document~Document}
  37834. */
  37835. this.document = document;
  37836. /**
  37837. * Holds references to the attribute groups that share the same {@link module:engine/view/attributeelement~AttributeElement#id id}.
  37838. * The keys are `id`s, the values are `Set`s holding {@link module:engine/view/attributeelement~AttributeElement}s.
  37839. *
  37840. * @private
  37841. * @type {Map.<String,Set>}
  37842. */
  37843. this._cloneGroups = new Map();
  37844. }
  37845. /**
  37846. * Sets {@link module:engine/view/documentselection~DocumentSelection selection's} ranges and direction to the
  37847. * specified location based on the given {@link module:engine/view/selection~Selectable selectable}.
  37848. *
  37849. * Usage:
  37850. *
  37851. * // Sets selection to the given range.
  37852. * const range = writer.createRange( start, end );
  37853. * writer.setSelection( range );
  37854. *
  37855. * // Sets backward selection to the given range.
  37856. * const range = writer.createRange( start, end );
  37857. * writer.setSelection( range );
  37858. *
  37859. * // Sets selection to given ranges.
  37860. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( start2, end2 ) ];
  37861. * writer.setSelection( range );
  37862. *
  37863. * // Sets selection to the other selection.
  37864. * const otherSelection = writer.createSelection();
  37865. * writer.setSelection( otherSelection );
  37866. *
  37867. * // Sets collapsed selection at the given position.
  37868. * const position = writer.createPositionFromPath( root, path );
  37869. * writer.setSelection( position );
  37870. *
  37871. * // Sets collapsed selection at the position of given item and offset.
  37872. * const paragraph = writer.createContainerElement( 'p' );
  37873. * writer.setSelection( paragraph, offset );
  37874. *
  37875. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  37876. * that element and ends after the last child of that element.
  37877. *
  37878. * writer.setSelection( paragraph, 'in' );
  37879. *
  37880. * Creates a range on the {@link module:engine/view/item~Item item} which starts before the item and ends just after the item.
  37881. *
  37882. * writer.setSelection( paragraph, 'on' );
  37883. *
  37884. * // Removes all ranges.
  37885. * writer.setSelection( null );
  37886. *
  37887. * `DowncastWriter#setSelection()` allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  37888. *
  37889. * // Sets selection as backward.
  37890. * writer.setSelection( range, { backward: true } );
  37891. *
  37892. * // Sets selection as fake.
  37893. * // Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  37894. * // This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  37895. * // represented in other way, for example by applying proper CSS class.
  37896. * writer.setSelection( range, { fake: true } );
  37897. *
  37898. * // Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  37899. * // (and be properly handled by screen readers).
  37900. * writer.setSelection( range, { fake: true, label: 'foo' } );
  37901. *
  37902. * @param {module:engine/view/selection~Selectable} selectable
  37903. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  37904. * @param {Object} [options]
  37905. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  37906. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  37907. * @param {String} [options.label] Label for the fake selection.
  37908. */
  37909. setSelection( selectable, placeOrOffset, options ) {
  37910. this.document.selection._setTo( selectable, placeOrOffset, options );
  37911. }
  37912. /**
  37913. * Moves {@link module:engine/view/documentselection~DocumentSelection#focus selection's focus} to the specified location.
  37914. *
  37915. * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}
  37916. * parameters.
  37917. *
  37918. * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
  37919. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  37920. * first parameter is a {@link module:engine/view/item~Item view item}.
  37921. */
  37922. setSelectionFocus( itemOrPosition, offset ) {
  37923. this.document.selection._setFocus( itemOrPosition, offset );
  37924. }
  37925. /**
  37926. * Creates a new {@link module:engine/view/documentfragment~DocumentFragment} instance.
  37927. *
  37928. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  37929. * A list of nodes to be inserted into the created document fragment.
  37930. * @returns {module:engine/view/documentfragment~DocumentFragment} The created document fragment.
  37931. */
  37932. createDocumentFragment( children ) {
  37933. return new _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"]( this.document, children );
  37934. }
  37935. /**
  37936. * Creates a new {@link module:engine/view/text~Text text node}.
  37937. *
  37938. * writer.createText( 'foo' );
  37939. *
  37940. * @param {String} data The text's data.
  37941. * @returns {module:engine/view/text~Text} The created text node.
  37942. */
  37943. createText( data ) {
  37944. return new _text__WEBPACK_IMPORTED_MODULE_11__["default"]( this.document, data );
  37945. }
  37946. /**
  37947. * Creates a new {@link module:engine/view/attributeelement~AttributeElement}.
  37948. *
  37949. * writer.createAttributeElement( 'strong' );
  37950. * writer.createAttributeElement( 'a', { href: 'foo.bar' } );
  37951. *
  37952. * // Make `<a>` element contain other attributes element so the `<a>` element is not broken.
  37953. * writer.createAttributeElement( 'a', { href: 'foo.bar' }, { priority: 5 } );
  37954. *
  37955. * // Set `id` of a marker element so it is not joined or merged with "normal" elements.
  37956. * writer.createAttributeElement( 'span', { class: 'my-marker' }, { id: 'marker:my' } );
  37957. *
  37958. * **Note:** By default an `AttributeElement` is split by a
  37959. * {@link module:engine/view/containerelement~ContainerElement `ContainerElement`} but this behavior can be modified
  37960. * with `isAllowedInsideAttributeElement` option set while {@link #createContainerElement creating the element}.
  37961. *
  37962. * @param {String} name Name of the element.
  37963. * @param {Object} [attributes] Element's attributes.
  37964. * @param {Object} [options] Element's options.
  37965. * @param {Number} [options.priority] Element's {@link module:engine/view/attributeelement~AttributeElement#priority priority}.
  37966. * @param {Number|String} [options.id] Element's {@link module:engine/view/attributeelement~AttributeElement#id id}.
  37967. * @param {Array.<String>} [options.renderUnsafeAttributes] A list of attribute names that should be rendered in the editing
  37968. * pipeline even though they would normally be filtered out by unsafe attribute detection mechanisms.
  37969. * @returns {module:engine/view/attributeelement~AttributeElement} Created element.
  37970. */
  37971. createAttributeElement( name, attributes, options = {} ) {
  37972. const attributeElement = new _attributeelement__WEBPACK_IMPORTED_MODULE_4__["default"]( this.document, name, attributes );
  37973. if ( typeof options.priority === 'number' ) {
  37974. attributeElement._priority = options.priority;
  37975. }
  37976. if ( options.id ) {
  37977. attributeElement._id = options.id;
  37978. }
  37979. if ( options.renderUnsafeAttributes ) {
  37980. attributeElement._unsafeAttributesToRender.push( ...options.renderUnsafeAttributes );
  37981. }
  37982. return attributeElement;
  37983. }
  37984. /**
  37985. * Creates a new {@link module:engine/view/containerelement~ContainerElement}.
  37986. *
  37987. * writer.createContainerElement( 'p' );
  37988. *
  37989. * // Create element with custom attributes.
  37990. * writer.createContainerElement( 'div', { id: 'foo-bar', 'data-baz': '123' } );
  37991. *
  37992. * // Create element with custom styles.
  37993. * writer.createContainerElement( 'p', { style: 'font-weight: bold; padding-bottom: 10px' } );
  37994. *
  37995. * // Create element with custom classes.
  37996. * writer.createContainerElement( 'p', { class: 'foo bar baz' } );
  37997. *
  37998. * @param {String} name Name of the element.
  37999. * @param {Object} [attributes] Elements attributes.
  38000. * @param {Object} [options] Element's options.
  38001. * @param {Boolean} [options.isAllowedInsideAttributeElement=false] Whether an element is
  38002. * {@link module:engine/view/element~Element#isAllowedInsideAttributeElement allowed inside an AttributeElement} and can be wrapped
  38003. * with {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
  38004. * @param {Array.<String>} [options.renderUnsafeAttributes] A list of attribute names that should be rendered in the editing
  38005. * pipeline even though they would normally be filtered out by unsafe attribute detection mechanisms.
  38006. * @returns {module:engine/view/containerelement~ContainerElement} Created element.
  38007. */
  38008. createContainerElement( name, attributes, options = {} ) {
  38009. const containerElement = new _containerelement__WEBPACK_IMPORTED_MODULE_3__["default"]( this.document, name, attributes );
  38010. if ( options.isAllowedInsideAttributeElement !== undefined ) {
  38011. containerElement._isAllowedInsideAttributeElement = options.isAllowedInsideAttributeElement;
  38012. }
  38013. if ( options.renderUnsafeAttributes ) {
  38014. containerElement._unsafeAttributesToRender.push( ...options.renderUnsafeAttributes );
  38015. }
  38016. return containerElement;
  38017. }
  38018. /**
  38019. * Creates a new {@link module:engine/view/editableelement~EditableElement}.
  38020. *
  38021. * writer.createEditableElement( 'div' );
  38022. * writer.createEditableElement( 'div', { id: 'foo-1234' } );
  38023. *
  38024. * Note: The editable element is to be used in the editing pipeline. Usually, together with
  38025. * {@link module:widget/utils~toWidgetEditable `toWidgetEditable()`}.
  38026. *
  38027. * @param {String} name Name of the element.
  38028. * @param {Object} [attributes] Elements attributes.
  38029. * @param {Object} [options] Element's options.
  38030. * @param {Array.<String>} [options.renderUnsafeAttributes] A list of attribute names that should be rendered in the editing
  38031. * pipeline even though they would normally be filtered out by unsafe attribute detection mechanisms.
  38032. * @returns {module:engine/view/editableelement~EditableElement} Created element.
  38033. */
  38034. createEditableElement( name, attributes, options = {} ) {
  38035. const editableElement = new _editableelement__WEBPACK_IMPORTED_MODULE_12__["default"]( this.document, name, attributes );
  38036. editableElement._document = this.document;
  38037. if ( options.renderUnsafeAttributes ) {
  38038. editableElement._unsafeAttributesToRender.push( ...options.renderUnsafeAttributes );
  38039. }
  38040. return editableElement;
  38041. }
  38042. /**
  38043. * Creates a new {@link module:engine/view/emptyelement~EmptyElement}.
  38044. *
  38045. * writer.createEmptyElement( 'img' );
  38046. * writer.createEmptyElement( 'img', { id: 'foo-1234' } );
  38047. *
  38048. * @param {String} name Name of the element.
  38049. * @param {Object} [attributes] Elements attributes.
  38050. * @param {Object} [options] Element's options.
  38051. * @param {Boolean} [options.isAllowedInsideAttributeElement=true] Whether an element is
  38052. * {@link module:engine/view/element~Element#isAllowedInsideAttributeElement allowed inside an AttributeElement} and can be wrapped
  38053. * with {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
  38054. * @param {Array.<String>} [options.renderUnsafeAttributes] A list of attribute names that should be rendered in the editing
  38055. * pipeline even though they would normally be filtered out by unsafe attribute detection mechanisms.
  38056. * @returns {module:engine/view/emptyelement~EmptyElement} Created element.
  38057. */
  38058. createEmptyElement( name, attributes, options = {} ) {
  38059. const emptyElement = new _emptyelement__WEBPACK_IMPORTED_MODULE_5__["default"]( this.document, name, attributes );
  38060. if ( options.isAllowedInsideAttributeElement !== undefined ) {
  38061. emptyElement._isAllowedInsideAttributeElement = options.isAllowedInsideAttributeElement;
  38062. }
  38063. if ( options.renderUnsafeAttributes ) {
  38064. emptyElement._unsafeAttributesToRender.push( ...options.renderUnsafeAttributes );
  38065. }
  38066. return emptyElement;
  38067. }
  38068. /**
  38069. * Creates a new {@link module:engine/view/uielement~UIElement}.
  38070. *
  38071. * writer.createUIElement( 'span' );
  38072. * writer.createUIElement( 'span', { id: 'foo-1234' } );
  38073. *
  38074. * A custom render function can be provided as the third parameter:
  38075. *
  38076. * writer.createUIElement( 'span', null, function( domDocument ) {
  38077. * const domElement = this.toDomElement( domDocument );
  38078. * domElement.innerHTML = '<b>this is ui element</b>';
  38079. *
  38080. * return domElement;
  38081. * } );
  38082. *
  38083. * Unlike {@link #createRawElement raw elements}, UI elements are by no means editor content, for instance,
  38084. * they are ignored by the editor selection system.
  38085. *
  38086. * You should not use UI elements as data containers. Check out {@link #createRawElement} instead.
  38087. *
  38088. * @param {String} name The name of the element.
  38089. * @param {Object} [attributes] Element attributes.
  38090. * @param {Function} [renderFunction] A custom render function.
  38091. * @param {Object} [options] Element's options.
  38092. * @param {Boolean} [options.isAllowedInsideAttributeElement=true] Whether an element is
  38093. * {@link module:engine/view/element~Element#isAllowedInsideAttributeElement allowed inside an AttributeElement} and can be wrapped
  38094. * with {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
  38095. * @returns {module:engine/view/uielement~UIElement} The created element.
  38096. */
  38097. createUIElement( name, attributes, renderFunction, options = {} ) {
  38098. const uiElement = new _uielement__WEBPACK_IMPORTED_MODULE_6__["default"]( this.document, name, attributes );
  38099. if ( renderFunction ) {
  38100. uiElement.render = renderFunction;
  38101. }
  38102. if ( options.isAllowedInsideAttributeElement !== undefined ) {
  38103. uiElement._isAllowedInsideAttributeElement = options.isAllowedInsideAttributeElement;
  38104. }
  38105. return uiElement;
  38106. }
  38107. /**
  38108. * Creates a new {@link module:engine/view/rawelement~RawElement}.
  38109. *
  38110. * writer.createRawElement( 'span', { id: 'foo-1234' }, function( domElement ) {
  38111. * domElement.innerHTML = '<b>This is the raw content of the raw element.</b>';
  38112. * } );
  38113. *
  38114. * Raw elements work as data containers ("wrappers", "sandboxes") but their children are not managed or
  38115. * even recognized by the editor. This encapsulation allows integrations to maintain custom DOM structures
  38116. * in the editor content without, for instance, worrying about compatibility with other editor features.
  38117. * Raw elements are a perfect tool for integration with external frameworks and data sources.
  38118. *
  38119. * Unlike {@link #createUIElement UI elements}, raw elements act like "real" editor content (similar to
  38120. * {@link module:engine/view/containerelement~ContainerElement} or {@link module:engine/view/emptyelement~EmptyElement}),
  38121. * and they are considered by the editor selection.
  38122. *
  38123. * You should not use raw elements to render the UI in the editor content. Check out {@link #createUIElement `#createUIElement()`}
  38124. * instead.
  38125. *
  38126. * @param {String} name The name of the element.
  38127. * @param {Object} [attributes] Element attributes.
  38128. * @param {Function} [renderFunction] A custom render function.
  38129. * @param {Object} [options] Element's options.
  38130. * @param {Boolean} [options.isAllowedInsideAttributeElement=true] Whether an element is
  38131. * {@link module:engine/view/element~Element#isAllowedInsideAttributeElement allowed inside an AttributeElement} and can be wrapped
  38132. * with {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
  38133. * @param {Array.<String>} [options.renderUnsafeAttributes] A list of attribute names that should be rendered in the editing
  38134. * pipeline even though they would normally be filtered out by unsafe attribute detection mechanisms.
  38135. * @returns {module:engine/view/rawelement~RawElement} The created element.
  38136. */
  38137. createRawElement( name, attributes, renderFunction, options = {} ) {
  38138. const rawElement = new _rawelement__WEBPACK_IMPORTED_MODULE_7__["default"]( this.document, name, attributes );
  38139. rawElement.render = renderFunction || ( () => {} );
  38140. if ( options.isAllowedInsideAttributeElement !== undefined ) {
  38141. rawElement._isAllowedInsideAttributeElement = options.isAllowedInsideAttributeElement;
  38142. }
  38143. if ( options.renderUnsafeAttributes ) {
  38144. rawElement._unsafeAttributesToRender.push( ...options.renderUnsafeAttributes );
  38145. }
  38146. return rawElement;
  38147. }
  38148. /**
  38149. * Adds or overwrites the element's attribute with a specified key and value.
  38150. *
  38151. * writer.setAttribute( 'href', 'http://ckeditor.com', linkElement );
  38152. *
  38153. * @param {String} key The attribute key.
  38154. * @param {String} value The attribute value.
  38155. * @param {module:engine/view/element~Element} element
  38156. */
  38157. setAttribute( key, value, element ) {
  38158. element._setAttribute( key, value );
  38159. }
  38160. /**
  38161. * Removes attribute from the element.
  38162. *
  38163. * writer.removeAttribute( 'href', linkElement );
  38164. *
  38165. * @param {String} key Attribute key.
  38166. * @param {module:engine/view/element~Element} element
  38167. */
  38168. removeAttribute( key, element ) {
  38169. element._removeAttribute( key );
  38170. }
  38171. /**
  38172. * Adds specified class to the element.
  38173. *
  38174. * writer.addClass( 'foo', linkElement );
  38175. * writer.addClass( [ 'foo', 'bar' ], linkElement );
  38176. *
  38177. * @param {Array.<String>|String} className
  38178. * @param {module:engine/view/element~Element} element
  38179. */
  38180. addClass( className, element ) {
  38181. element._addClass( className );
  38182. }
  38183. /**
  38184. * Removes specified class from the element.
  38185. *
  38186. * writer.removeClass( 'foo', linkElement );
  38187. * writer.removeClass( [ 'foo', 'bar' ], linkElement );
  38188. *
  38189. * @param {Array.<String>|String} className
  38190. * @param {module:engine/view/element~Element} element
  38191. */
  38192. removeClass( className, element ) {
  38193. element._removeClass( className );
  38194. }
  38195. /**
  38196. * Adds style to the element.
  38197. *
  38198. * writer.setStyle( 'color', 'red', element );
  38199. * writer.setStyle( {
  38200. * color: 'red',
  38201. * position: 'fixed'
  38202. * }, element );
  38203. *
  38204. * **Note**: The passed style can be normalized if
  38205. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  38206. * See {@link module:engine/view/stylesmap~StylesMap#set `StylesMap#set()`} for details.
  38207. *
  38208. * @param {String|Object} property Property name or object with key - value pairs.
  38209. * @param {String} [value] Value to set. This parameter is ignored if object is provided as the first parameter.
  38210. * @param {module:engine/view/element~Element} element Element to set styles on.
  38211. */
  38212. setStyle( property, value, element ) {
  38213. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_13__["isPlainObject"])( property ) && element === undefined ) {
  38214. element = value;
  38215. }
  38216. element._setStyle( property, value );
  38217. }
  38218. /**
  38219. * Removes specified style from the element.
  38220. *
  38221. * writer.removeStyle( 'color', element ); // Removes 'color' style.
  38222. * writer.removeStyle( [ 'color', 'border-top' ], element ); // Removes both 'color' and 'border-top' styles.
  38223. *
  38224. * **Note**: This method can work with normalized style names if
  38225. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  38226. * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.
  38227. *
  38228. * @param {Array.<String>|String} property
  38229. * @param {module:engine/view/element~Element} element
  38230. */
  38231. removeStyle( property, element ) {
  38232. element._removeStyle( property );
  38233. }
  38234. /**
  38235. * Sets a custom property on element. Unlike attributes, custom properties are not rendered to the DOM,
  38236. * so they can be used to add special data to elements.
  38237. *
  38238. * @param {String|Symbol} key
  38239. * @param {*} value
  38240. * @param {module:engine/view/element~Element} element
  38241. */
  38242. setCustomProperty( key, value, element ) {
  38243. element._setCustomProperty( key, value );
  38244. }
  38245. /**
  38246. * Removes a custom property stored under the given key.
  38247. *
  38248. * @param {String|Symbol} key
  38249. * @param {module:engine/view/element~Element} element
  38250. * @returns {Boolean} Returns true if property was removed.
  38251. */
  38252. removeCustomProperty( key, element ) {
  38253. return element._removeCustomProperty( key );
  38254. }
  38255. /**
  38256. * Breaks attribute elements at the provided position or at the boundaries of a provided range. It breaks attribute elements
  38257. * up to their first ancestor that is a container element.
  38258. *
  38259. * In following examples `<p>` is a container, `<b>` and `<u>` are attribute elements:
  38260. *
  38261. * <p>foo<b><u>bar{}</u></b></p> -> <p>foo<b><u>bar</u></b>[]</p>
  38262. * <p>foo<b><u>{}bar</u></b></p> -> <p>foo{}<b><u>bar</u></b></p>
  38263. * <p>foo<b><u>b{}ar</u></b></p> -> <p>foo<b><u>b</u></b>[]<b><u>ar</u></b></p>
  38264. * <p><b>fo{o</b><u>ba}r</u></p> -> <p><b>fo</b><b>o</b><u>ba</u><u>r</u></b></p>
  38265. *
  38266. * **Note:** {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment} is treated like a container.
  38267. *
  38268. * **Note:** The difference between {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes breakAttributes()} and
  38269. * {@link module:engine/view/downcastwriter~DowncastWriter#breakContainer breakContainer()} is that `breakAttributes()` breaks all
  38270. * {@link module:engine/view/attributeelement~AttributeElement attribute elements} that are ancestors of a given `position`,
  38271. * up to the first encountered {@link module:engine/view/containerelement~ContainerElement container element}.
  38272. * `breakContainer()` assumes that a given `position` is directly in the container element and breaks that container element.
  38273. *
  38274. * Throws the `view-writer-invalid-range-container` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
  38275. * when the {@link module:engine/view/range~Range#start start}
  38276. * and {@link module:engine/view/range~Range#end end} positions of a passed range are not placed inside same parent container.
  38277. *
  38278. * Throws the `view-writer-cannot-break-empty-element` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
  38279. * when trying to break attributes inside an {@link module:engine/view/emptyelement~EmptyElement EmptyElement}.
  38280. *
  38281. * Throws the `view-writer-cannot-break-ui-element` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
  38282. * when trying to break attributes inside a {@link module:engine/view/uielement~UIElement UIElement}.
  38283. *
  38284. * @see module:engine/view/attributeelement~AttributeElement
  38285. * @see module:engine/view/containerelement~ContainerElement
  38286. * @see module:engine/view/downcastwriter~DowncastWriter#breakContainer
  38287. * @param {module:engine/view/position~Position|module:engine/view/range~Range} positionOrRange The position where
  38288. * to break attribute elements.
  38289. * @returns {module:engine/view/position~Position|module:engine/view/range~Range} The new position or range, after breaking the
  38290. * attribute elements.
  38291. */
  38292. breakAttributes( positionOrRange ) {
  38293. if ( positionOrRange instanceof _position__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  38294. return this._breakAttributes( positionOrRange );
  38295. } else {
  38296. return this._breakAttributesRange( positionOrRange );
  38297. }
  38298. }
  38299. /**
  38300. * Breaks a {@link module:engine/view/containerelement~ContainerElement container view element} into two, at the given position.
  38301. * The position has to be directly inside the container element and cannot be in the root. It does not break the conrainer view element
  38302. * if the position is at the beginning or at the end of its parent element.
  38303. *
  38304. * <p>foo^bar</p> -> <p>foo</p><p>bar</p>
  38305. * <div><p>foo</p>^<p>bar</p></div> -> <div><p>foo</p></div><div><p>bar</p></div>
  38306. * <p>^foobar</p> -> ^<p>foobar</p>
  38307. * <p>foobar^</p> -> <p>foobar</p>^
  38308. *
  38309. * **Note:** The difference between {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes breakAttributes()} and
  38310. * {@link module:engine/view/downcastwriter~DowncastWriter#breakContainer breakContainer()} is that `breakAttributes()` breaks all
  38311. * {@link module:engine/view/attributeelement~AttributeElement attribute elements} that are ancestors of a given `position`,
  38312. * up to the first encountered {@link module:engine/view/containerelement~ContainerElement container element}.
  38313. * `breakContainer()` assumes that the given `position` is directly in the container element and breaks that container element.
  38314. *
  38315. * @see module:engine/view/attributeelement~AttributeElement
  38316. * @see module:engine/view/containerelement~ContainerElement
  38317. * @see module:engine/view/downcastwriter~DowncastWriter#breakAttributes
  38318. * @param {module:engine/view/position~Position} position The position where to break the element.
  38319. * @returns {module:engine/view/position~Position} The position between broken elements. If an element has not been broken,
  38320. * the returned position is placed either before or after it.
  38321. */
  38322. breakContainer( position ) {
  38323. const element = position.parent;
  38324. if ( !( element.is( 'containerElement' ) ) ) {
  38325. /**
  38326. * Trying to break an element which is not a container element.
  38327. *
  38328. * @error view-writer-break-non-container-element
  38329. */
  38330. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-break-non-container-element', this.document );
  38331. }
  38332. if ( !element.parent ) {
  38333. /**
  38334. * Trying to break root element.
  38335. *
  38336. * @error view-writer-break-root
  38337. */
  38338. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-break-root', this.document );
  38339. }
  38340. if ( position.isAtStart ) {
  38341. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( element );
  38342. } else if ( !position.isAtEnd ) {
  38343. const newElement = element._clone( false );
  38344. this.insert( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( element ), newElement );
  38345. const sourceRange = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position, _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, 'end' ) );
  38346. const targetPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( newElement, 0 );
  38347. this.move( sourceRange, targetPosition );
  38348. }
  38349. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( element );
  38350. }
  38351. /**
  38352. * Merges {@link module:engine/view/attributeelement~AttributeElement attribute elements}. It also merges text nodes if needed.
  38353. * Only {@link module:engine/view/attributeelement~AttributeElement#isSimilar similar} attribute elements can be merged.
  38354. *
  38355. * In following examples `<p>` is a container and `<b>` is an attribute element:
  38356. *
  38357. * <p>foo[]bar</p> -> <p>foo{}bar</p>
  38358. * <p><b>foo</b>[]<b>bar</b></p> -> <p><b>foo{}bar</b></p>
  38359. * <p><b foo="bar">a</b>[]<b foo="baz">b</b></p> -> <p><b foo="bar">a</b>[]<b foo="baz">b</b></p>
  38360. *
  38361. * It will also take care about empty attributes when merging:
  38362. *
  38363. * <p><b>[]</b></p> -> <p>[]</p>
  38364. * <p><b>foo</b><i>[]</i><b>bar</b></p> -> <p><b>foo{}bar</b></p>
  38365. *
  38366. * **Note:** Difference between {@link module:engine/view/downcastwriter~DowncastWriter#mergeAttributes mergeAttributes} and
  38367. * {@link module:engine/view/downcastwriter~DowncastWriter#mergeContainers mergeContainers} is that `mergeAttributes` merges two
  38368. * {@link module:engine/view/attributeelement~AttributeElement attribute elements} or {@link module:engine/view/text~Text text nodes}
  38369. * while `mergeContainer` merges two {@link module:engine/view/containerelement~ContainerElement container elements}.
  38370. *
  38371. * @see module:engine/view/attributeelement~AttributeElement
  38372. * @see module:engine/view/containerelement~ContainerElement
  38373. * @see module:engine/view/downcastwriter~DowncastWriter#mergeContainers
  38374. * @param {module:engine/view/position~Position} position Merge position.
  38375. * @returns {module:engine/view/position~Position} Position after merge.
  38376. */
  38377. mergeAttributes( position ) {
  38378. const positionOffset = position.offset;
  38379. const positionParent = position.parent;
  38380. // When inside text node - nothing to merge.
  38381. if ( positionParent.is( '$text' ) ) {
  38382. return position;
  38383. }
  38384. // When inside empty attribute - remove it.
  38385. if ( positionParent.is( 'attributeElement' ) && positionParent.childCount === 0 ) {
  38386. const parent = positionParent.parent;
  38387. const offset = positionParent.index;
  38388. positionParent._remove();
  38389. this._removeFromClonedElementsGroup( positionParent );
  38390. return this.mergeAttributes( new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, offset ) );
  38391. }
  38392. const nodeBefore = positionParent.getChild( positionOffset - 1 );
  38393. const nodeAfter = positionParent.getChild( positionOffset );
  38394. // Position should be placed between two nodes.
  38395. if ( !nodeBefore || !nodeAfter ) {
  38396. return position;
  38397. }
  38398. // When position is between two text nodes.
  38399. if ( nodeBefore.is( '$text' ) && nodeAfter.is( '$text' ) ) {
  38400. return mergeTextNodes( nodeBefore, nodeAfter );
  38401. }
  38402. // When position is between two same attribute elements.
  38403. else if ( nodeBefore.is( 'attributeElement' ) && nodeAfter.is( 'attributeElement' ) && nodeBefore.isSimilar( nodeAfter ) ) {
  38404. // Move all children nodes from node placed after selection and remove that node.
  38405. const count = nodeBefore.childCount;
  38406. nodeBefore._appendChild( nodeAfter.getChildren() );
  38407. nodeAfter._remove();
  38408. this._removeFromClonedElementsGroup( nodeAfter );
  38409. // New position is located inside the first node, before new nodes.
  38410. // Call this method recursively to merge again if needed.
  38411. return this.mergeAttributes( new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeBefore, count ) );
  38412. }
  38413. return position;
  38414. }
  38415. /**
  38416. * Merges two {@link module:engine/view/containerelement~ContainerElement container elements} that are before and after given position.
  38417. * Precisely, the element after the position is removed and it's contents are moved to element before the position.
  38418. *
  38419. * <p>foo</p>^<p>bar</p> -> <p>foo^bar</p>
  38420. * <div>foo</div>^<p>bar</p> -> <div>foo^bar</div>
  38421. *
  38422. * **Note:** Difference between {@link module:engine/view/downcastwriter~DowncastWriter#mergeAttributes mergeAttributes} and
  38423. * {@link module:engine/view/downcastwriter~DowncastWriter#mergeContainers mergeContainers} is that `mergeAttributes` merges two
  38424. * {@link module:engine/view/attributeelement~AttributeElement attribute elements} or {@link module:engine/view/text~Text text nodes}
  38425. * while `mergeContainer` merges two {@link module:engine/view/containerelement~ContainerElement container elements}.
  38426. *
  38427. * @see module:engine/view/attributeelement~AttributeElement
  38428. * @see module:engine/view/containerelement~ContainerElement
  38429. * @see module:engine/view/downcastwriter~DowncastWriter#mergeAttributes
  38430. * @param {module:engine/view/position~Position} position Merge position.
  38431. * @returns {module:engine/view/position~Position} Position after merge.
  38432. */
  38433. mergeContainers( position ) {
  38434. const prev = position.nodeBefore;
  38435. const next = position.nodeAfter;
  38436. if ( !prev || !next || !prev.is( 'containerElement' ) || !next.is( 'containerElement' ) ) {
  38437. /**
  38438. * Element before and after given position cannot be merged.
  38439. *
  38440. * @error view-writer-merge-containers-invalid-position
  38441. */
  38442. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-merge-containers-invalid-position', this.document );
  38443. }
  38444. const lastChild = prev.getChild( prev.childCount - 1 );
  38445. const newPosition = lastChild instanceof _text__WEBPACK_IMPORTED_MODULE_11__["default"] ? _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( lastChild, 'end' ) : _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( prev, 'end' );
  38446. this.move( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( next ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( prev, 'end' ) );
  38447. this.remove( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( next ) );
  38448. return newPosition;
  38449. }
  38450. /**
  38451. * Inserts a node or nodes at specified position. Takes care about breaking attributes before insertion
  38452. * and merging them afterwards.
  38453. *
  38454. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-insert-invalid-node` when nodes to insert
  38455. * contains instances that are not {@link module:engine/view/text~Text Texts},
  38456. * {@link module:engine/view/attributeelement~AttributeElement AttributeElements},
  38457. * {@link module:engine/view/containerelement~ContainerElement ContainerElements},
  38458. * {@link module:engine/view/emptyelement~EmptyElement EmptyElements},
  38459. * {@link module:engine/view/rawelement~RawElement RawElements} or
  38460. * {@link module:engine/view/uielement~UIElement UIElements}.
  38461. *
  38462. * @param {module:engine/view/position~Position} position Insertion position.
  38463. * @param {module:engine/view/text~Text|module:engine/view/attributeelement~AttributeElement|
  38464. * module:engine/view/containerelement~ContainerElement|module:engine/view/emptyelement~EmptyElement|
  38465. * module:engine/view/rawelement~RawElement|module:engine/view/uielement~UIElement|
  38466. * Iterable.<module:engine/view/text~Text|
  38467. * module:engine/view/attributeelement~AttributeElement|module:engine/view/containerelement~ContainerElement|
  38468. * module:engine/view/emptyelement~EmptyElement|module:engine/view/rawelement~RawElement|
  38469. * module:engine/view/uielement~UIElement>} nodes Node or nodes to insert.
  38470. * @returns {module:engine/view/range~Range} Range around inserted nodes.
  38471. */
  38472. insert( position, nodes ) {
  38473. nodes = Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_10__["default"])( nodes ) ? [ ...nodes ] : [ nodes ];
  38474. // Check if nodes to insert are instances of AttributeElements, ContainerElements, EmptyElements, UIElements or Text.
  38475. validateNodesToInsert( nodes, this.document );
  38476. // Group nodes in batches of nodes that require or do not require breaking an AttributeElements.
  38477. const nodeGroups = nodes.reduce( ( groups, node ) => {
  38478. const lastGroup = groups[ groups.length - 1 ];
  38479. // Break attributes on nodes that do exist in the model tree so they can have attributes, other elements
  38480. // can't have an attribute in model and won't get wrapped with an AttributeElement while down-casted.
  38481. const breakAttributes = !( node.is( 'uiElement' ) && node.isAllowedInsideAttributeElement );
  38482. if ( !lastGroup || lastGroup.breakAttributes != breakAttributes ) {
  38483. groups.push( {
  38484. breakAttributes,
  38485. nodes: [ node ]
  38486. } );
  38487. } else {
  38488. lastGroup.nodes.push( node );
  38489. }
  38490. return groups;
  38491. }, [] );
  38492. // Insert nodes in batches.
  38493. let start = null;
  38494. let end = position;
  38495. for ( const { nodes, breakAttributes } of nodeGroups ) {
  38496. const range = this._insertNodes( end, nodes, breakAttributes );
  38497. if ( !start ) {
  38498. start = range.start;
  38499. }
  38500. end = range.end;
  38501. }
  38502. // When no nodes were inserted - return collapsed range.
  38503. if ( !start ) {
  38504. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position );
  38505. }
  38506. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
  38507. }
  38508. /**
  38509. * Removes provided range from the container.
  38510. *
  38511. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when
  38512. * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside
  38513. * same parent container.
  38514. *
  38515. * @param {module:engine/view/range~Range|module:engine/view/item~Item} rangeOrItem Range to remove from container
  38516. * or an {@link module:engine/view/item~Item item} to remove. If range is provided, after removing, it will be updated
  38517. * to a collapsed range showing the new position.
  38518. * @returns {module:engine/view/documentfragment~DocumentFragment} Document fragment containing removed nodes.
  38519. */
  38520. remove( rangeOrItem ) {
  38521. const range = rangeOrItem instanceof _range__WEBPACK_IMPORTED_MODULE_1__["default"] ? rangeOrItem : _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( rangeOrItem );
  38522. validateRangeContainer( range, this.document );
  38523. // If range is collapsed - nothing to remove.
  38524. if ( range.isCollapsed ) {
  38525. return new _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"]( this.document );
  38526. }
  38527. // Break attributes at range start and end.
  38528. const { start: breakStart, end: breakEnd } = this._breakAttributesRange( range, true );
  38529. const parentContainer = breakStart.parent;
  38530. const count = breakEnd.offset - breakStart.offset;
  38531. // Remove nodes in range.
  38532. const removed = parentContainer._removeChildren( breakStart.offset, count );
  38533. for ( const node of removed ) {
  38534. this._removeFromClonedElementsGroup( node );
  38535. }
  38536. // Merge after removing.
  38537. const mergePosition = this.mergeAttributes( breakStart );
  38538. range.start = mergePosition;
  38539. range.end = mergePosition.clone();
  38540. // Return removed nodes.
  38541. return new _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"]( this.document, removed );
  38542. }
  38543. /**
  38544. * Removes matching elements from given range.
  38545. *
  38546. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when
  38547. * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside
  38548. * same parent container.
  38549. *
  38550. * @param {module:engine/view/range~Range} range Range to clear.
  38551. * @param {module:engine/view/element~Element} element Element to remove.
  38552. */
  38553. clear( range, element ) {
  38554. validateRangeContainer( range, this.document );
  38555. // Create walker on given range.
  38556. // We walk backward because when we remove element during walk it modifies range end position.
  38557. const walker = range.getWalker( {
  38558. direction: 'backward',
  38559. ignoreElementEnd: true
  38560. } );
  38561. // Let's walk.
  38562. for ( const current of walker ) {
  38563. const item = current.item;
  38564. let rangeToRemove;
  38565. // When current item matches to the given element.
  38566. if ( item.is( 'element' ) && element.isSimilar( item ) ) {
  38567. // Create range on this element.
  38568. rangeToRemove = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( item );
  38569. // When range starts inside Text or TextProxy element.
  38570. } else if ( !current.nextPosition.isAfter( range.start ) && item.is( '$textProxy' ) ) {
  38571. // We need to check if parent of this text matches to given element.
  38572. const parentElement = item.getAncestors().find( ancestor => {
  38573. return ancestor.is( 'element' ) && element.isSimilar( ancestor );
  38574. } );
  38575. // If it is then create range inside this element.
  38576. if ( parentElement ) {
  38577. rangeToRemove = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( parentElement );
  38578. }
  38579. }
  38580. // If we have found element to remove.
  38581. if ( rangeToRemove ) {
  38582. // We need to check if element range stick out of the given range and truncate if it is.
  38583. if ( rangeToRemove.end.isAfter( range.end ) ) {
  38584. rangeToRemove.end = range.end;
  38585. }
  38586. if ( rangeToRemove.start.isBefore( range.start ) ) {
  38587. rangeToRemove.start = range.start;
  38588. }
  38589. // At the end we remove range with found element.
  38590. this.remove( rangeToRemove );
  38591. }
  38592. }
  38593. }
  38594. /**
  38595. * Moves nodes from provided range to target position.
  38596. *
  38597. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when
  38598. * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside
  38599. * same parent container.
  38600. *
  38601. * @param {module:engine/view/range~Range} sourceRange Range containing nodes to move.
  38602. * @param {module:engine/view/position~Position} targetPosition Position to insert.
  38603. * @returns {module:engine/view/range~Range} Range in target container. Inserted nodes are placed between
  38604. * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions.
  38605. */
  38606. move( sourceRange, targetPosition ) {
  38607. let nodes;
  38608. if ( targetPosition.isAfter( sourceRange.end ) ) {
  38609. targetPosition = this._breakAttributes( targetPosition, true );
  38610. const parent = targetPosition.parent;
  38611. const countBefore = parent.childCount;
  38612. sourceRange = this._breakAttributesRange( sourceRange, true );
  38613. nodes = this.remove( sourceRange );
  38614. targetPosition.offset += ( parent.childCount - countBefore );
  38615. } else {
  38616. nodes = this.remove( sourceRange );
  38617. }
  38618. return this.insert( targetPosition, nodes );
  38619. }
  38620. /**
  38621. * Wraps elements within range with provided {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.
  38622. * If a collapsed range is provided, it will be wrapped only if it is equal to view selection.
  38623. *
  38624. * If a collapsed range was passed and is same as selection, the selection
  38625. * will be moved to the inside of the wrapped attribute element.
  38626. *
  38627. * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-invalid-range-container`
  38628. * when {@link module:engine/view/range~Range#start}
  38629. * and {@link module:engine/view/range~Range#end} positions are not placed inside same parent container.
  38630. *
  38631. * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not
  38632. * an instance of {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.
  38633. *
  38634. * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-nonselection-collapsed-range` when passed range
  38635. * is collapsed and different than view selection.
  38636. *
  38637. * **Note:** Attribute elements by default can wrap {@link module:engine/view/text~Text},
  38638. * {@link module:engine/view/emptyelement~EmptyElement}, {@link module:engine/view/uielement~UIElement},
  38639. * {@link module:engine/view/rawelement~RawElement} and other attribute elements with higher priority. Other elements while placed
  38640. * inside an attribute element will split it (or nest it in case of an `AttributeElement`). This behavior can be modified by changing
  38641. * the `isAllowedInsideAttributeElement` option while using
  38642. * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement},
  38643. * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement},
  38644. * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement} or
  38645. * {@link module:engine/view/downcastwriter~DowncastWriter#createRawElement}.
  38646. *
  38647. * @param {module:engine/view/range~Range} range Range to wrap.
  38648. * @param {module:engine/view/attributeelement~AttributeElement} attribute Attribute element to use as wrapper.
  38649. * @returns {module:engine/view/range~Range} range Range after wrapping, spanning over wrapping attribute element.
  38650. */
  38651. wrap( range, attribute ) {
  38652. if ( !( attribute instanceof _attributeelement__WEBPACK_IMPORTED_MODULE_4__["default"] ) ) {
  38653. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
  38654. 'view-writer-wrap-invalid-attribute',
  38655. this.document
  38656. );
  38657. }
  38658. validateRangeContainer( range, this.document );
  38659. if ( !range.isCollapsed ) {
  38660. // Non-collapsed range. Wrap it with the attribute element.
  38661. return this._wrapRange( range, attribute );
  38662. } else {
  38663. // Collapsed range. Wrap position.
  38664. let position = range.start;
  38665. if ( position.parent.is( 'element' ) && !_hasNonUiChildren( position.parent ) ) {
  38666. position = position.getLastMatchingPosition( value => value.item.is( 'uiElement' ) );
  38667. }
  38668. position = this._wrapPosition( position, attribute );
  38669. const viewSelection = this.document.selection;
  38670. // If wrapping position is equal to view selection, move view selection inside wrapping attribute element.
  38671. if ( viewSelection.isCollapsed && viewSelection.getFirstPosition().isEqual( range.start ) ) {
  38672. this.setSelection( position );
  38673. }
  38674. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position );
  38675. }
  38676. }
  38677. /**
  38678. * Unwraps nodes within provided range from attribute element.
  38679. *
  38680. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when
  38681. * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside
  38682. * same parent container.
  38683. *
  38684. * @param {module:engine/view/range~Range} range
  38685. * @param {module:engine/view/attributeelement~AttributeElement} attribute
  38686. */
  38687. unwrap( range, attribute ) {
  38688. if ( !( attribute instanceof _attributeelement__WEBPACK_IMPORTED_MODULE_4__["default"] ) ) {
  38689. /**
  38690. * The `attribute` passed to {@link module:engine/view/downcastwriter~DowncastWriter#unwrap `DowncastWriter#unwrap()`}
  38691. * must be an instance of {@link module:engine/view/attributeelement~AttributeElement `AttributeElement`}.
  38692. *
  38693. * @error view-writer-unwrap-invalid-attribute
  38694. */
  38695. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
  38696. 'view-writer-unwrap-invalid-attribute',
  38697. this.document
  38698. );
  38699. }
  38700. validateRangeContainer( range, this.document );
  38701. // If range is collapsed - nothing to unwrap.
  38702. if ( range.isCollapsed ) {
  38703. return range;
  38704. }
  38705. // Break attributes at range start and end.
  38706. const { start: breakStart, end: breakEnd } = this._breakAttributesRange( range, true );
  38707. const parentContainer = breakStart.parent;
  38708. // Unwrap children located between break points.
  38709. const newRange = this._unwrapChildren( parentContainer, breakStart.offset, breakEnd.offset, attribute );
  38710. // Merge attributes at the both ends and return a new range.
  38711. const start = this.mergeAttributes( newRange.start );
  38712. // If start position was merged - move end position back.
  38713. if ( !start.isEqual( newRange.start ) ) {
  38714. newRange.end.offset--;
  38715. }
  38716. const end = this.mergeAttributes( newRange.end );
  38717. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
  38718. }
  38719. /**
  38720. * Renames element by creating a copy of renamed element but with changed name and then moving contents of the
  38721. * old element to the new one. Keep in mind that this will invalidate all {@link module:engine/view/position~Position positions} which
  38722. * has renamed element as {@link module:engine/view/position~Position#parent a parent}.
  38723. *
  38724. * New element has to be created because `Element#tagName` property in DOM is readonly.
  38725. *
  38726. * Since this function creates a new element and removes the given one, the new element is returned to keep reference.
  38727. *
  38728. * @param {String} newName New name for element.
  38729. * @param {module:engine/view/containerelement~ContainerElement} viewElement Element to be renamed.
  38730. * @returns {module:engine/view/containerelement~ContainerElement} Element created due to rename.
  38731. */
  38732. rename( newName, viewElement ) {
  38733. const newElement = new _containerelement__WEBPACK_IMPORTED_MODULE_3__["default"]( this.document, newName, viewElement.getAttributes() );
  38734. this.insert( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( viewElement ), newElement );
  38735. this.move( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( viewElement ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( newElement, 0 ) );
  38736. this.remove( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( viewElement ) );
  38737. return newElement;
  38738. }
  38739. /**
  38740. * Cleans up memory by removing obsolete cloned elements group from the writer.
  38741. *
  38742. * Should be used whenever all {@link module:engine/view/attributeelement~AttributeElement attribute elements}
  38743. * with the same {@link module:engine/view/attributeelement~AttributeElement#id id} are going to be removed from the view and
  38744. * the group will no longer be needed.
  38745. *
  38746. * Cloned elements group are not removed automatically in case if the group is still needed after all its elements
  38747. * were removed from the view.
  38748. *
  38749. * Keep in mind that group names are equal to the `id` property of the attribute element.
  38750. *
  38751. * @param {String} groupName Name of the group to clear.
  38752. */
  38753. clearClonedElementsGroup( groupName ) {
  38754. this._cloneGroups.delete( groupName );
  38755. }
  38756. /**
  38757. * Creates position at the given location. The location can be specified as:
  38758. *
  38759. * * a {@link module:engine/view/position~Position position},
  38760. * * parent element and offset (offset defaults to `0`),
  38761. * * parent element and `'end'` (sets position at the end of that element),
  38762. * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).
  38763. *
  38764. * This method is a shortcut to other constructors such as:
  38765. *
  38766. * * {@link #createPositionBefore},
  38767. * * {@link #createPositionAfter},
  38768. *
  38769. * @param {module:engine/view/item~Item|module:engine/model/position~Position} itemOrPosition
  38770. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  38771. * first parameter is a {@link module:engine/view/item~Item view item}.
  38772. * @returns {module:engine/view/position~Position}
  38773. */
  38774. createPositionAt( itemOrPosition, offset ) {
  38775. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( itemOrPosition, offset );
  38776. }
  38777. /**
  38778. * Creates a new position after given view item.
  38779. *
  38780. * @param {module:engine/view/item~Item} item View item after which the position should be located.
  38781. * @returns {module:engine/view/position~Position}
  38782. */
  38783. createPositionAfter( item ) {
  38784. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( item );
  38785. }
  38786. /**
  38787. * Creates a new position before given view item.
  38788. *
  38789. * @param {module:engine/view/item~Item} item View item before which the position should be located.
  38790. * @returns {module:engine/view/position~Position}
  38791. */
  38792. createPositionBefore( item ) {
  38793. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( item );
  38794. }
  38795. /**
  38796. * Creates a range spanning from `start` position to `end` position.
  38797. *
  38798. * **Note:** This factory method creates its own {@link module:engine/view/position~Position} instances basing on passed values.
  38799. *
  38800. * @param {module:engine/view/position~Position} start Start position.
  38801. * @param {module:engine/view/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
  38802. * @returns {module:engine/view/range~Range}
  38803. */
  38804. createRange( start, end ) {
  38805. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
  38806. }
  38807. /**
  38808. * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.
  38809. *
  38810. * @param {module:engine/view/item~Item} item
  38811. * @returns {module:engine/view/range~Range}
  38812. */
  38813. createRangeOn( item ) {
  38814. return _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( item );
  38815. }
  38816. /**
  38817. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  38818. * that element and ends after the last child of that element.
  38819. *
  38820. * @param {module:engine/view/element~Element} element Element which is a parent for the range.
  38821. * @returns {module:engine/view/range~Range}
  38822. */
  38823. createRangeIn( element ) {
  38824. return _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( element );
  38825. }
  38826. /**
  38827. Creates new {@link module:engine/view/selection~Selection} instance.
  38828. *
  38829. * // Creates empty selection without ranges.
  38830. * const selection = writer.createSelection();
  38831. *
  38832. * // Creates selection at the given range.
  38833. * const range = writer.createRange( start, end );
  38834. * const selection = writer.createSelection( range );
  38835. *
  38836. * // Creates selection at the given ranges
  38837. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  38838. * const selection = writer.createSelection( ranges );
  38839. *
  38840. * // Creates selection from the other selection.
  38841. * const otherSelection = writer.createSelection();
  38842. * const selection = writer.createSelection( otherSelection );
  38843. *
  38844. * // Creates selection from the document selection.
  38845. * const selection = writer.createSelection( editor.editing.view.document.selection );
  38846. *
  38847. * // Creates selection at the given position.
  38848. * const position = writer.createPositionFromPath( root, path );
  38849. * const selection = writer.createSelection( position );
  38850. *
  38851. * // Creates collapsed selection at the position of given item and offset.
  38852. * const paragraph = writer.createContainerElement( 'p' );
  38853. * const selection = writer.createSelection( paragraph, offset );
  38854. *
  38855. * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
  38856. * // first child of that element and ends after the last child of that element.
  38857. * const selection = writer.createSelection( paragraph, 'in' );
  38858. *
  38859. * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
  38860. * // just after the item.
  38861. * const selection = writer.createSelection( paragraph, 'on' );
  38862. *
  38863. * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  38864. *
  38865. * // Creates backward selection.
  38866. * const selection = writer.createSelection( range, { backward: true } );
  38867. *
  38868. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  38869. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  38870. * represented in other way, for example by applying proper CSS class.
  38871. *
  38872. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  38873. * (and be properly handled by screen readers).
  38874. *
  38875. * // Creates fake selection with label.
  38876. * const selection = writer.createSelection( range, { fake: true, label: 'foo' } );
  38877. *
  38878. * @param {module:engine/view/selection~Selectable} [selectable=null]
  38879. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
  38880. * @param {Object} [options]
  38881. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  38882. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  38883. * @param {String} [options.label] Label for the fake selection.
  38884. * @returns {module:engine/view/selection~Selection}
  38885. */
  38886. createSelection( selectable, placeOrOffset, options ) {
  38887. return new _selection__WEBPACK_IMPORTED_MODULE_2__["default"]( selectable, placeOrOffset, options );
  38888. }
  38889. /**
  38890. * Inserts a node or nodes at the specified position. Takes care of breaking attributes before insertion
  38891. * and merging them afterwards if requested by the breakAttributes param.
  38892. *
  38893. * @private
  38894. * @param {module:engine/view/position~Position} position Insertion position.
  38895. * @param {module:engine/view/text~Text|module:engine/view/attributeelement~AttributeElement|
  38896. * module:engine/view/containerelement~ContainerElement|module:engine/view/emptyelement~EmptyElement|
  38897. * module:engine/view/rawelement~RawElement|module:engine/view/uielement~UIElement|
  38898. * Iterable.<module:engine/view/text~Text|
  38899. * module:engine/view/attributeelement~AttributeElement|module:engine/view/containerelement~ContainerElement|
  38900. * module:engine/view/emptyelement~EmptyElement|module:engine/view/rawelement~RawElement|
  38901. * module:engine/view/uielement~UIElement>} nodes Node or nodes to insert.
  38902. * @param {Boolean} breakAttributes Whether attributes should be broken.
  38903. * @returns {module:engine/view/range~Range} Range around inserted nodes.
  38904. */
  38905. _insertNodes( position, nodes, breakAttributes ) {
  38906. let parentElement;
  38907. // Break attributes on nodes that do exist in the model tree so they can have attributes, other elements
  38908. // can't have an attribute in model and won't get wrapped with an AttributeElement while down-casted.
  38909. if ( breakAttributes ) {
  38910. parentElement = getParentContainer( position );
  38911. } else {
  38912. parentElement = position.parent.is( '$text' ) ? position.parent.parent : position.parent;
  38913. }
  38914. if ( !parentElement ) {
  38915. /**
  38916. * Position's parent container cannot be found.
  38917. *
  38918. * @error view-writer-invalid-position-container
  38919. */
  38920. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
  38921. 'view-writer-invalid-position-container',
  38922. this.document
  38923. );
  38924. }
  38925. let insertionPosition;
  38926. if ( breakAttributes ) {
  38927. insertionPosition = this._breakAttributes( position, true );
  38928. } else {
  38929. insertionPosition = position.parent.is( '$text' ) ? breakTextNode( position ) : position;
  38930. }
  38931. const length = parentElement._insertChild( insertionPosition.offset, nodes );
  38932. for ( const node of nodes ) {
  38933. this._addToClonedElementsGroup( node );
  38934. }
  38935. const endPosition = insertionPosition.getShiftedBy( length );
  38936. const start = this.mergeAttributes( insertionPosition );
  38937. // If start position was merged - move end position.
  38938. if ( !start.isEqual( insertionPosition ) ) {
  38939. endPosition.offset--;
  38940. }
  38941. const end = this.mergeAttributes( endPosition );
  38942. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
  38943. }
  38944. /**
  38945. * Wraps children with provided `wrapElement`. Only children contained in `parent` element between
  38946. * `startOffset` and `endOffset` will be wrapped.
  38947. *
  38948. * @private
  38949. * @param {module:engine/view/element~Element} parent
  38950. * @param {Number} startOffset
  38951. * @param {Number} endOffset
  38952. * @param {module:engine/view/element~Element} wrapElement
  38953. */
  38954. _wrapChildren( parent, startOffset, endOffset, wrapElement ) {
  38955. let i = startOffset;
  38956. const wrapPositions = [];
  38957. while ( i < endOffset ) {
  38958. const child = parent.getChild( i );
  38959. const isText = child.is( '$text' );
  38960. const isAttribute = child.is( 'attributeElement' );
  38961. const isAllowedInsideAttributeElement = child.isAllowedInsideAttributeElement;
  38962. //
  38963. // (In all examples, assume that `wrapElement` is `<span class="foo">` element.)
  38964. //
  38965. // Check if `wrapElement` can be joined with the wrapped element. One of requirements is having same name.
  38966. // If possible, join elements.
  38967. //
  38968. // <p><span class="bar">abc</span></p> --> <p><span class="foo bar">abc</span></p>
  38969. //
  38970. if ( isAttribute && this._wrapAttributeElement( wrapElement, child ) ) {
  38971. wrapPositions.push( new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i ) );
  38972. }
  38973. //
  38974. // Wrap the child if it is not an attribute element or if it is an attribute element that should be inside
  38975. // `wrapElement` (due to priority).
  38976. //
  38977. // <p>abc</p> --> <p><span class="foo">abc</span></p>
  38978. // <p><strong>abc</strong></p> --> <p><span class="foo"><strong>abc</strong></span></p>
  38979. else if ( isText || isAllowedInsideAttributeElement || ( isAttribute && shouldABeOutsideB( wrapElement, child ) ) ) {
  38980. // Clone attribute.
  38981. const newAttribute = wrapElement._clone();
  38982. // Wrap current node with new attribute.
  38983. child._remove();
  38984. newAttribute._appendChild( child );
  38985. parent._insertChild( i, newAttribute );
  38986. this._addToClonedElementsGroup( newAttribute );
  38987. wrapPositions.push( new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i ) );
  38988. }
  38989. //
  38990. // If other nested attribute is found and it wasn't wrapped (see above), continue wrapping inside it.
  38991. //
  38992. // <p><a href="foo.html">abc</a></p> --> <p><a href="foo.html"><span class="foo">abc</span></a></p>
  38993. //
  38994. else if ( isAttribute ) {
  38995. this._wrapChildren( child, 0, child.childCount, wrapElement );
  38996. }
  38997. i++;
  38998. }
  38999. // Merge at each wrap.
  39000. let offsetChange = 0;
  39001. for ( const position of wrapPositions ) {
  39002. position.offset -= offsetChange;
  39003. // Do not merge with elements outside selected children.
  39004. if ( position.offset == startOffset ) {
  39005. continue;
  39006. }
  39007. const newPosition = this.mergeAttributes( position );
  39008. // If nodes were merged - other merge offsets will change.
  39009. if ( !newPosition.isEqual( position ) ) {
  39010. offsetChange++;
  39011. endOffset--;
  39012. }
  39013. }
  39014. return _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromParentsAndOffsets( parent, startOffset, parent, endOffset );
  39015. }
  39016. /**
  39017. * Unwraps children from provided `unwrapElement`. Only children contained in `parent` element between
  39018. * `startOffset` and `endOffset` will be unwrapped.
  39019. *
  39020. * @private
  39021. * @param {module:engine/view/element~Element} parent
  39022. * @param {Number} startOffset
  39023. * @param {Number} endOffset
  39024. * @param {module:engine/view/element~Element} unwrapElement
  39025. */
  39026. _unwrapChildren( parent, startOffset, endOffset, unwrapElement ) {
  39027. let i = startOffset;
  39028. const unwrapPositions = [];
  39029. // Iterate over each element between provided offsets inside parent.
  39030. // We don't use tree walker or range iterator because we will be removing and merging potentially multiple nodes,
  39031. // so it could get messy. It is safer to it manually in this case.
  39032. while ( i < endOffset ) {
  39033. const child = parent.getChild( i );
  39034. // Skip all text nodes. There should be no container element's here either.
  39035. if ( !child.is( 'attributeElement' ) ) {
  39036. i++;
  39037. continue;
  39038. }
  39039. //
  39040. // (In all examples, assume that `unwrapElement` is `<span class="foo">` element.)
  39041. //
  39042. // If the child is similar to the given attribute element, unwrap it - it will be completely removed.
  39043. //
  39044. // <p><span class="foo">abc</span>xyz</p> --> <p>abcxyz</p>
  39045. //
  39046. if ( child.isSimilar( unwrapElement ) ) {
  39047. const unwrapped = child.getChildren();
  39048. const count = child.childCount;
  39049. // Replace wrapper element with its children
  39050. child._remove();
  39051. parent._insertChild( i, unwrapped );
  39052. this._removeFromClonedElementsGroup( child );
  39053. // Save start and end position of moved items.
  39054. unwrapPositions.push(
  39055. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i ),
  39056. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i + count )
  39057. );
  39058. // Skip elements that were unwrapped. Assuming there won't be another element to unwrap in child elements.
  39059. i += count;
  39060. endOffset += count - 1;
  39061. continue;
  39062. }
  39063. //
  39064. // If the child is not similar but is an attribute element, try partial unwrapping - remove the same attributes/styles/classes.
  39065. // Partial unwrapping will happen only if the elements have the same name.
  39066. //
  39067. // <p><span class="foo bar">abc</span>xyz</p> --> <p><span class="bar">abc</span>xyz</p>
  39068. // <p><i class="foo">abc</i>xyz</p> --> <p><i class="foo">abc</i>xyz</p>
  39069. //
  39070. if ( this._unwrapAttributeElement( unwrapElement, child ) ) {
  39071. unwrapPositions.push(
  39072. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i ),
  39073. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i + 1 )
  39074. );
  39075. i++;
  39076. continue;
  39077. }
  39078. //
  39079. // If other nested attribute is found, look through it's children for elements to unwrap.
  39080. //
  39081. // <p><i><span class="foo">abc</span></i><p> --> <p><i>abc</i><p>
  39082. //
  39083. this._unwrapChildren( child, 0, child.childCount, unwrapElement );
  39084. i++;
  39085. }
  39086. // Merge at each unwrap.
  39087. let offsetChange = 0;
  39088. for ( const position of unwrapPositions ) {
  39089. position.offset -= offsetChange;
  39090. // Do not merge with elements outside selected children.
  39091. if ( position.offset == startOffset || position.offset == endOffset ) {
  39092. continue;
  39093. }
  39094. const newPosition = this.mergeAttributes( position );
  39095. // If nodes were merged - other merge offsets will change.
  39096. if ( !newPosition.isEqual( position ) ) {
  39097. offsetChange++;
  39098. endOffset--;
  39099. }
  39100. }
  39101. return _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromParentsAndOffsets( parent, startOffset, parent, endOffset );
  39102. }
  39103. /**
  39104. * Helper function for `view.writer.wrap`. Wraps range with provided attribute element.
  39105. * This method will also merge newly added attribute element with its siblings whenever possible.
  39106. *
  39107. * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not
  39108. * an instance of {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.
  39109. *
  39110. * @private
  39111. * @param {module:engine/view/range~Range} range
  39112. * @param {module:engine/view/attributeelement~AttributeElement} attribute
  39113. * @returns {module:engine/view/range~Range} New range after wrapping, spanning over wrapping attribute element.
  39114. */
  39115. _wrapRange( range, attribute ) {
  39116. // Break attributes at range start and end.
  39117. const { start: breakStart, end: breakEnd } = this._breakAttributesRange( range, true );
  39118. const parentContainer = breakStart.parent;
  39119. // Wrap all children with attribute.
  39120. const newRange = this._wrapChildren( parentContainer, breakStart.offset, breakEnd.offset, attribute );
  39121. // Merge attributes at the both ends and return a new range.
  39122. const start = this.mergeAttributes( newRange.start );
  39123. // If start position was merged - move end position back.
  39124. if ( !start.isEqual( newRange.start ) ) {
  39125. newRange.end.offset--;
  39126. }
  39127. const end = this.mergeAttributes( newRange.end );
  39128. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
  39129. }
  39130. /**
  39131. * Helper function for {@link #wrap}. Wraps position with provided attribute element.
  39132. * This method will also merge newly added attribute element with its siblings whenever possible.
  39133. *
  39134. * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not
  39135. * an instance of {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.
  39136. *
  39137. * @private
  39138. * @param {module:engine/view/position~Position} position
  39139. * @param {module:engine/view/attributeelement~AttributeElement} attribute
  39140. * @returns {module:engine/view/position~Position} New position after wrapping.
  39141. */
  39142. _wrapPosition( position, attribute ) {
  39143. // Return same position when trying to wrap with attribute similar to position parent.
  39144. if ( attribute.isSimilar( position.parent ) ) {
  39145. return movePositionToTextNode( position.clone() );
  39146. }
  39147. // When position is inside text node - break it and place new position between two text nodes.
  39148. if ( position.parent.is( '$text' ) ) {
  39149. position = breakTextNode( position );
  39150. }
  39151. // Create fake element that will represent position, and will not be merged with other attributes.
  39152. const fakePosition = this.createAttributeElement();
  39153. fakePosition._priority = Number.POSITIVE_INFINITY;
  39154. fakePosition.isSimilar = () => false;
  39155. // Insert fake element in position location.
  39156. position.parent._insertChild( position.offset, fakePosition );
  39157. // Range around inserted fake attribute element.
  39158. const wrapRange = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position, position.getShiftedBy( 1 ) );
  39159. // Wrap fake element with attribute (it will also merge if possible).
  39160. this.wrap( wrapRange, attribute );
  39161. // Remove fake element and place new position there.
  39162. const newPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( fakePosition.parent, fakePosition.index );
  39163. fakePosition._remove();
  39164. // If position is placed between text nodes - merge them and return position inside.
  39165. const nodeBefore = newPosition.nodeBefore;
  39166. const nodeAfter = newPosition.nodeAfter;
  39167. if ( nodeBefore instanceof _text__WEBPACK_IMPORTED_MODULE_11__["default"] && nodeAfter instanceof _text__WEBPACK_IMPORTED_MODULE_11__["default"] ) {
  39168. return mergeTextNodes( nodeBefore, nodeAfter );
  39169. }
  39170. // If position is next to text node - move position inside.
  39171. return movePositionToTextNode( newPosition );
  39172. }
  39173. /**
  39174. * Wraps one {@link module:engine/view/attributeelement~AttributeElement AttributeElement} into another by
  39175. * merging them if possible. When merging is possible - all attributes, styles and classes are moved from wrapper
  39176. * element to element being wrapped.
  39177. *
  39178. * @private
  39179. * @param {module:engine/view/attributeelement~AttributeElement} wrapper Wrapper AttributeElement.
  39180. * @param {module:engine/view/attributeelement~AttributeElement} toWrap AttributeElement to wrap using wrapper element.
  39181. * @returns {Boolean} Returns `true` if elements are merged.
  39182. */
  39183. _wrapAttributeElement( wrapper, toWrap ) {
  39184. if ( !canBeJoined( wrapper, toWrap ) ) {
  39185. return false;
  39186. }
  39187. // Can't merge if name or priority differs.
  39188. if ( wrapper.name !== toWrap.name || wrapper.priority !== toWrap.priority ) {
  39189. return false;
  39190. }
  39191. // Check if attributes can be merged.
  39192. for ( const key of wrapper.getAttributeKeys() ) {
  39193. // Classes and styles should be checked separately.
  39194. if ( key === 'class' || key === 'style' ) {
  39195. continue;
  39196. }
  39197. // If some attributes are different we cannot wrap.
  39198. if ( toWrap.hasAttribute( key ) && toWrap.getAttribute( key ) !== wrapper.getAttribute( key ) ) {
  39199. return false;
  39200. }
  39201. }
  39202. // Check if styles can be merged.
  39203. for ( const key of wrapper.getStyleNames() ) {
  39204. if ( toWrap.hasStyle( key ) && toWrap.getStyle( key ) !== wrapper.getStyle( key ) ) {
  39205. return false;
  39206. }
  39207. }
  39208. // Move all attributes/classes/styles from wrapper to wrapped AttributeElement.
  39209. for ( const key of wrapper.getAttributeKeys() ) {
  39210. // Classes and styles should be checked separately.
  39211. if ( key === 'class' || key === 'style' ) {
  39212. continue;
  39213. }
  39214. // Move only these attributes that are not present - other are similar.
  39215. if ( !toWrap.hasAttribute( key ) ) {
  39216. this.setAttribute( key, wrapper.getAttribute( key ), toWrap );
  39217. }
  39218. }
  39219. for ( const key of wrapper.getStyleNames() ) {
  39220. if ( !toWrap.hasStyle( key ) ) {
  39221. this.setStyle( key, wrapper.getStyle( key ), toWrap );
  39222. }
  39223. }
  39224. for ( const key of wrapper.getClassNames() ) {
  39225. if ( !toWrap.hasClass( key ) ) {
  39226. this.addClass( key, toWrap );
  39227. }
  39228. }
  39229. return true;
  39230. }
  39231. /**
  39232. * Unwraps {@link module:engine/view/attributeelement~AttributeElement AttributeElement} from another by removing
  39233. * corresponding attributes, classes and styles. All attributes, classes and styles from wrapper should be present
  39234. * inside element being unwrapped.
  39235. *
  39236. * @private
  39237. * @param {module:engine/view/attributeelement~AttributeElement} wrapper Wrapper AttributeElement.
  39238. * @param {module:engine/view/attributeelement~AttributeElement} toUnwrap AttributeElement to unwrap using wrapper element.
  39239. * @returns {Boolean} Returns `true` if elements are unwrapped.
  39240. **/
  39241. _unwrapAttributeElement( wrapper, toUnwrap ) {
  39242. if ( !canBeJoined( wrapper, toUnwrap ) ) {
  39243. return false;
  39244. }
  39245. // Can't unwrap if name or priority differs.
  39246. if ( wrapper.name !== toUnwrap.name || wrapper.priority !== toUnwrap.priority ) {
  39247. return false;
  39248. }
  39249. // Check if AttributeElement has all wrapper attributes.
  39250. for ( const key of wrapper.getAttributeKeys() ) {
  39251. // Classes and styles should be checked separately.
  39252. if ( key === 'class' || key === 'style' ) {
  39253. continue;
  39254. }
  39255. // If some attributes are missing or different we cannot unwrap.
  39256. if ( !toUnwrap.hasAttribute( key ) || toUnwrap.getAttribute( key ) !== wrapper.getAttribute( key ) ) {
  39257. return false;
  39258. }
  39259. }
  39260. // Check if AttributeElement has all wrapper classes.
  39261. if ( !toUnwrap.hasClass( ...wrapper.getClassNames() ) ) {
  39262. return false;
  39263. }
  39264. // Check if AttributeElement has all wrapper styles.
  39265. for ( const key of wrapper.getStyleNames() ) {
  39266. // If some styles are missing or different we cannot unwrap.
  39267. if ( !toUnwrap.hasStyle( key ) || toUnwrap.getStyle( key ) !== wrapper.getStyle( key ) ) {
  39268. return false;
  39269. }
  39270. }
  39271. // Remove all wrapper's attributes from unwrapped element.
  39272. for ( const key of wrapper.getAttributeKeys() ) {
  39273. // Classes and styles should be checked separately.
  39274. if ( key === 'class' || key === 'style' ) {
  39275. continue;
  39276. }
  39277. this.removeAttribute( key, toUnwrap );
  39278. }
  39279. // Remove all wrapper's classes from unwrapped element.
  39280. this.removeClass( Array.from( wrapper.getClassNames() ), toUnwrap );
  39281. // Remove all wrapper's styles from unwrapped element.
  39282. this.removeStyle( Array.from( wrapper.getStyleNames() ), toUnwrap );
  39283. return true;
  39284. }
  39285. /**
  39286. * Helper function used by other `DowncastWriter` methods. Breaks attribute elements at the boundaries of given range.
  39287. *
  39288. * @private
  39289. * @param {module:engine/view/range~Range} range Range which `start` and `end` positions will be used to break attributes.
  39290. * @param {Boolean} [forceSplitText=false] If set to `true`, will break text nodes even if they are directly in container element.
  39291. * This behavior will result in incorrect view state, but is needed by other view writing methods which then fixes view state.
  39292. * @returns {module:engine/view/range~Range} New range with located at break positions.
  39293. */
  39294. _breakAttributesRange( range, forceSplitText = false ) {
  39295. const rangeStart = range.start;
  39296. const rangeEnd = range.end;
  39297. validateRangeContainer( range, this.document );
  39298. // Break at the collapsed position. Return new collapsed range.
  39299. if ( range.isCollapsed ) {
  39300. const position = this._breakAttributes( range.start, forceSplitText );
  39301. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position, position );
  39302. }
  39303. const breakEnd = this._breakAttributes( rangeEnd, forceSplitText );
  39304. const count = breakEnd.parent.childCount;
  39305. const breakStart = this._breakAttributes( rangeStart, forceSplitText );
  39306. // Calculate new break end offset.
  39307. breakEnd.offset += breakEnd.parent.childCount - count;
  39308. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( breakStart, breakEnd );
  39309. }
  39310. /**
  39311. * Helper function used by other `DowncastWriter` methods. Breaks attribute elements at given position.
  39312. *
  39313. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-empty-element` when break position
  39314. * is placed inside {@link module:engine/view/emptyelement~EmptyElement EmptyElement}.
  39315. *
  39316. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-ui-element` when break position
  39317. * is placed inside {@link module:engine/view/uielement~UIElement UIElement}.
  39318. *
  39319. * @private
  39320. * @param {module:engine/view/position~Position} position Position where to break attributes.
  39321. * @param {Boolean} [forceSplitText=false] If set to `true`, will break text nodes even if they are directly in container element.
  39322. * This behavior will result in incorrect view state, but is needed by other view writing methods which then fixes view state.
  39323. * @returns {module:engine/view/position~Position} New position after breaking the attributes.
  39324. */
  39325. _breakAttributes( position, forceSplitText = false ) {
  39326. const positionOffset = position.offset;
  39327. const positionParent = position.parent;
  39328. // If position is placed inside EmptyElement - throw an exception as we cannot break inside.
  39329. if ( position.parent.is( 'emptyElement' ) ) {
  39330. /**
  39331. * Cannot break an `EmptyElement` instance.
  39332. *
  39333. * This error is thrown if
  39334. * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}
  39335. * was executed in an incorrect position.
  39336. *
  39337. * @error view-writer-cannot-break-empty-element
  39338. */
  39339. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-cannot-break-empty-element', this.document );
  39340. }
  39341. // If position is placed inside UIElement - throw an exception as we cannot break inside.
  39342. if ( position.parent.is( 'uiElement' ) ) {
  39343. /**
  39344. * Cannot break a `UIElement` instance.
  39345. *
  39346. * This error is thrown if
  39347. * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}
  39348. * was executed in an incorrect position.
  39349. *
  39350. * @error view-writer-cannot-break-ui-element
  39351. */
  39352. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-cannot-break-ui-element', this.document );
  39353. }
  39354. // If position is placed inside RawElement - throw an exception as we cannot break inside.
  39355. if ( position.parent.is( 'rawElement' ) ) {
  39356. /**
  39357. * Cannot break a `RawElement` instance.
  39358. *
  39359. * This error is thrown if
  39360. * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}
  39361. * was executed in an incorrect position.
  39362. *
  39363. * @error view-writer-cannot-break-raw-element
  39364. */
  39365. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-cannot-break-raw-element', this.document );
  39366. }
  39367. // There are no attributes to break and text nodes breaking is not forced.
  39368. if ( !forceSplitText && positionParent.is( '$text' ) && isContainerOrFragment( positionParent.parent ) ) {
  39369. return position.clone();
  39370. }
  39371. // Position's parent is container, so no attributes to break.
  39372. if ( isContainerOrFragment( positionParent ) ) {
  39373. return position.clone();
  39374. }
  39375. // Break text and start again in new position.
  39376. if ( positionParent.is( '$text' ) ) {
  39377. return this._breakAttributes( breakTextNode( position ), forceSplitText );
  39378. }
  39379. const length = positionParent.childCount;
  39380. // <p>foo<b><u>bar{}</u></b></p>
  39381. // <p>foo<b><u>bar</u>[]</b></p>
  39382. // <p>foo<b><u>bar</u></b>[]</p>
  39383. if ( positionOffset == length ) {
  39384. const newPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( positionParent.parent, positionParent.index + 1 );
  39385. return this._breakAttributes( newPosition, forceSplitText );
  39386. } else {
  39387. // <p>foo<b><u>{}bar</u></b></p>
  39388. // <p>foo<b>[]<u>bar</u></b></p>
  39389. // <p>foo{}<b><u>bar</u></b></p>
  39390. if ( positionOffset === 0 ) {
  39391. const newPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( positionParent.parent, positionParent.index );
  39392. return this._breakAttributes( newPosition, forceSplitText );
  39393. }
  39394. // <p>foo<b><u>b{}ar</u></b></p>
  39395. // <p>foo<b><u>b[]ar</u></b></p>
  39396. // <p>foo<b><u>b</u>[]<u>ar</u></b></p>
  39397. // <p>foo<b><u>b</u></b>[]<b><u>ar</u></b></p>
  39398. else {
  39399. const offsetAfter = positionParent.index + 1;
  39400. // Break element.
  39401. const clonedNode = positionParent._clone();
  39402. // Insert cloned node to position's parent node.
  39403. positionParent.parent._insertChild( offsetAfter, clonedNode );
  39404. this._addToClonedElementsGroup( clonedNode );
  39405. // Get nodes to move.
  39406. const count = positionParent.childCount - positionOffset;
  39407. const nodesToMove = positionParent._removeChildren( positionOffset, count );
  39408. // Move nodes to cloned node.
  39409. clonedNode._appendChild( nodesToMove );
  39410. // Create new position to work on.
  39411. const newPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( positionParent.parent, offsetAfter );
  39412. return this._breakAttributes( newPosition, forceSplitText );
  39413. }
  39414. }
  39415. }
  39416. /**
  39417. * Stores the information that an {@link module:engine/view/attributeelement~AttributeElement attribute element} was
  39418. * added to the tree. Saves the reference to the group in the given element and updates the group, so other elements
  39419. * from the group now keep a reference to the given attribute element.
  39420. *
  39421. * The clones group can be obtained using {@link module:engine/view/attributeelement~AttributeElement#getElementsWithSameId}.
  39422. *
  39423. * Does nothing if added element has no {@link module:engine/view/attributeelement~AttributeElement#id id}.
  39424. *
  39425. * @private
  39426. * @param {module:engine/view/attributeelement~AttributeElement} element Attribute element to save.
  39427. */
  39428. _addToClonedElementsGroup( element ) {
  39429. // Add only if the element is in document tree.
  39430. if ( !element.root.is( 'rootElement' ) ) {
  39431. return;
  39432. }
  39433. // Traverse the element's children recursively to find other attribute elements that also might got inserted.
  39434. // The loop is at the beginning so we can make fast returns later in the code.
  39435. if ( element.is( 'element' ) ) {
  39436. for ( const child of element.getChildren() ) {
  39437. this._addToClonedElementsGroup( child );
  39438. }
  39439. }
  39440. const id = element.id;
  39441. if ( !id ) {
  39442. return;
  39443. }
  39444. let group = this._cloneGroups.get( id );
  39445. if ( !group ) {
  39446. group = new Set();
  39447. this._cloneGroups.set( id, group );
  39448. }
  39449. group.add( element );
  39450. element._clonesGroup = group;
  39451. }
  39452. /**
  39453. * Removes all the information about the given {@link module:engine/view/attributeelement~AttributeElement attribute element}
  39454. * from its clones group.
  39455. *
  39456. * Keep in mind, that the element will still keep a reference to the group (but the group will not keep a reference to it).
  39457. * This allows to reference the whole group even if the element was already removed from the tree.
  39458. *
  39459. * Does nothing if the element has no {@link module:engine/view/attributeelement~AttributeElement#id id}.
  39460. *
  39461. * @private
  39462. * @param {module:engine/view/attributeelement~AttributeElement} element Attribute element to remove.
  39463. */
  39464. _removeFromClonedElementsGroup( element ) {
  39465. // Traverse the element's children recursively to find other attribute elements that also got removed.
  39466. // The loop is at the beginning so we can make fast returns later in the code.
  39467. if ( element.is( 'element' ) ) {
  39468. for ( const child of element.getChildren() ) {
  39469. this._removeFromClonedElementsGroup( child );
  39470. }
  39471. }
  39472. const id = element.id;
  39473. if ( !id ) {
  39474. return;
  39475. }
  39476. const group = this._cloneGroups.get( id );
  39477. if ( !group ) {
  39478. return;
  39479. }
  39480. group.delete( element );
  39481. // Not removing group from element on purpose!
  39482. // If other parts of code have reference to this element, they will be able to get references to other elements from the group.
  39483. }
  39484. }
  39485. // Helper function for `view.writer.wrap`. Checks if given element has any children that are not ui elements.
  39486. function _hasNonUiChildren( parent ) {
  39487. return Array.from( parent.getChildren() ).some( child => !child.is( 'uiElement' ) );
  39488. }
  39489. /**
  39490. * The `attribute` passed to {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#wrap()`}
  39491. * must be an instance of {@link module:engine/view/attributeelement~AttributeElement `AttributeElement`}.
  39492. *
  39493. * @error view-writer-wrap-invalid-attribute
  39494. */
  39495. // Returns first parent container of specified {@link module:engine/view/position~Position Position}.
  39496. // Position's parent node is checked as first, then next parents are checked.
  39497. // Note that {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment} is treated like a container.
  39498. //
  39499. // @param {module:engine/view/position~Position} position Position used as a start point to locate parent container.
  39500. // @returns {module:engine/view/containerelement~ContainerElement|module:engine/view/documentfragment~DocumentFragment|undefined}
  39501. // Parent container element or `undefined` if container is not found.
  39502. function getParentContainer( position ) {
  39503. let parent = position.parent;
  39504. while ( !isContainerOrFragment( parent ) ) {
  39505. if ( !parent ) {
  39506. return undefined;
  39507. }
  39508. parent = parent.parent;
  39509. }
  39510. return parent;
  39511. }
  39512. // Checks if first {@link module:engine/view/attributeelement~AttributeElement AttributeElement} provided to the function
  39513. // can be wrapped outside second element. It is done by comparing elements'
  39514. // {@link module:engine/view/attributeelement~AttributeElement#priority priorities}, if both have same priority
  39515. // {@link module:engine/view/element~Element#getIdentity identities} are compared.
  39516. //
  39517. // @param {module:engine/view/attributeelement~AttributeElement} a
  39518. // @param {module:engine/view/attributeelement~AttributeElement} b
  39519. // @returns {Boolean}
  39520. function shouldABeOutsideB( a, b ) {
  39521. if ( a.priority < b.priority ) {
  39522. return true;
  39523. } else if ( a.priority > b.priority ) {
  39524. return false;
  39525. }
  39526. // When priorities are equal and names are different - use identities.
  39527. return a.getIdentity() < b.getIdentity();
  39528. }
  39529. // Returns new position that is moved to near text node. Returns same position if there is no text node before of after
  39530. // specified position.
  39531. //
  39532. // <p>foo[]</p> -> <p>foo{}</p>
  39533. // <p>[]foo</p> -> <p>{}foo</p>
  39534. //
  39535. // @param {module:engine/view/position~Position} position
  39536. // @returns {module:engine/view/position~Position} Position located inside text node or same position if there is no text nodes
  39537. // before or after position location.
  39538. function movePositionToTextNode( position ) {
  39539. const nodeBefore = position.nodeBefore;
  39540. if ( nodeBefore && nodeBefore.is( '$text' ) ) {
  39541. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeBefore, nodeBefore.data.length );
  39542. }
  39543. const nodeAfter = position.nodeAfter;
  39544. if ( nodeAfter && nodeAfter.is( '$text' ) ) {
  39545. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeAfter, 0 );
  39546. }
  39547. return position;
  39548. }
  39549. // Breaks text node into two text nodes when possible.
  39550. //
  39551. // <p>foo{}bar</p> -> <p>foo[]bar</p>
  39552. // <p>{}foobar</p> -> <p>[]foobar</p>
  39553. // <p>foobar{}</p> -> <p>foobar[]</p>
  39554. //
  39555. // @param {module:engine/view/position~Position} position Position that need to be placed inside text node.
  39556. // @returns {module:engine/view/position~Position} New position after breaking text node.
  39557. function breakTextNode( position ) {
  39558. if ( position.offset == position.parent.data.length ) {
  39559. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( position.parent.parent, position.parent.index + 1 );
  39560. }
  39561. if ( position.offset === 0 ) {
  39562. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( position.parent.parent, position.parent.index );
  39563. }
  39564. // Get part of the text that need to be moved.
  39565. const textToMove = position.parent.data.slice( position.offset );
  39566. // Leave rest of the text in position's parent.
  39567. position.parent._data = position.parent.data.slice( 0, position.offset );
  39568. // Insert new text node after position's parent text node.
  39569. position.parent.parent._insertChild( position.parent.index + 1, new _text__WEBPACK_IMPORTED_MODULE_11__["default"]( position.root.document, textToMove ) );
  39570. // Return new position between two newly created text nodes.
  39571. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( position.parent.parent, position.parent.index + 1 );
  39572. }
  39573. // Merges two text nodes into first node. Removes second node and returns merge position.
  39574. //
  39575. // @param {module:engine/view/text~Text} t1 First text node to merge. Data from second text node will be moved at the end of
  39576. // this text node.
  39577. // @param {module:engine/view/text~Text} t2 Second text node to merge. This node will be removed after merging.
  39578. // @returns {module:engine/view/position~Position} Position after merging text nodes.
  39579. function mergeTextNodes( t1, t2 ) {
  39580. // Merge text data into first text node and remove second one.
  39581. const nodeBeforeLength = t1.data.length;
  39582. t1._data += t2.data;
  39583. t2._remove();
  39584. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( t1, nodeBeforeLength );
  39585. }
  39586. // Checks if provided nodes are valid to insert.
  39587. //
  39588. // Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-insert-invalid-node` when nodes to insert
  39589. // contains instances that are not supported ones (see error description for valid ones.
  39590. //
  39591. // @param Iterable.<module:engine/view/text~Text|module:engine/view/element~Element> nodes
  39592. // @param {Object} errorContext
  39593. function validateNodesToInsert( nodes, errorContext ) {
  39594. for ( const node of nodes ) {
  39595. if ( !validNodesToInsert.some( ( validNode => node instanceof validNode ) ) ) { // eslint-disable-line no-use-before-define
  39596. /**
  39597. * One of the nodes to be inserted is of an invalid type.
  39598. *
  39599. * Nodes to be inserted with {@link module:engine/view/downcastwriter~DowncastWriter#insert `DowncastWriter#insert()`} should be
  39600. * of the following types:
  39601. *
  39602. * * {@link module:engine/view/attributeelement~AttributeElement AttributeElement},
  39603. * * {@link module:engine/view/containerelement~ContainerElement ContainerElement},
  39604. * * {@link module:engine/view/emptyelement~EmptyElement EmptyElement},
  39605. * * {@link module:engine/view/uielement~UIElement UIElement},
  39606. * * {@link module:engine/view/rawelement~RawElement RawElement},
  39607. * * {@link module:engine/view/text~Text Text}.
  39608. *
  39609. * @error view-writer-insert-invalid-node-type
  39610. */
  39611. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-insert-invalid-node-type', errorContext );
  39612. }
  39613. if ( !node.is( '$text' ) ) {
  39614. validateNodesToInsert( node.getChildren(), errorContext );
  39615. }
  39616. }
  39617. }
  39618. const validNodesToInsert = [ _text__WEBPACK_IMPORTED_MODULE_11__["default"], _attributeelement__WEBPACK_IMPORTED_MODULE_4__["default"], _containerelement__WEBPACK_IMPORTED_MODULE_3__["default"], _emptyelement__WEBPACK_IMPORTED_MODULE_5__["default"], _rawelement__WEBPACK_IMPORTED_MODULE_7__["default"], _uielement__WEBPACK_IMPORTED_MODULE_6__["default"] ];
  39619. // Checks if node is ContainerElement or DocumentFragment, because in most cases they should be treated the same way.
  39620. //
  39621. // @param {module:engine/view/node~Node} node
  39622. // @returns {Boolean} Returns `true` if node is instance of ContainerElement or DocumentFragment.
  39623. function isContainerOrFragment( node ) {
  39624. return node && ( node.is( 'containerElement' ) || node.is( 'documentFragment' ) );
  39625. }
  39626. // Checks if {@link module:engine/view/range~Range#start range start} and {@link module:engine/view/range~Range#end range end} are placed
  39627. // inside same {@link module:engine/view/containerelement~ContainerElement container element}.
  39628. // Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when validation fails.
  39629. //
  39630. // @param {module:engine/view/range~Range} range
  39631. // @param {Object} errorContext
  39632. function validateRangeContainer( range, errorContext ) {
  39633. const startContainer = getParentContainer( range.start );
  39634. const endContainer = getParentContainer( range.end );
  39635. if ( !startContainer || !endContainer || startContainer !== endContainer ) {
  39636. /**
  39637. * The container of the given range is invalid.
  39638. *
  39639. * This may happen if {@link module:engine/view/range~Range#start range start} and
  39640. * {@link module:engine/view/range~Range#end range end} positions are not placed inside the same container element or
  39641. * a parent container for these positions cannot be found.
  39642. *
  39643. * Methods like {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#remove()`},
  39644. * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#clean()`},
  39645. * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#wrap()`},
  39646. * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#unwrap()`} need to be called
  39647. * on a range that has its start and end positions located in the same container element. Both positions can be
  39648. * nested within other elements (e.g. an attribute element) but the closest container ancestor must be the same.
  39649. *
  39650. * @error view-writer-invalid-range-container
  39651. */
  39652. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-invalid-range-container', errorContext );
  39653. }
  39654. }
  39655. // Checks if two attribute elements can be joined together. Elements can be joined together if, and only if
  39656. // they do not have ids specified.
  39657. //
  39658. // @private
  39659. // @param {module:engine/view/element~Element} a
  39660. // @param {module:engine/view/element~Element} b
  39661. // @returns {Boolean}
  39662. function canBeJoined( a, b ) {
  39663. return a.id === null && b.id === null;
  39664. }
  39665. /***/ }),
  39666. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js":
  39667. /*!*****************************************************************************!*\
  39668. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js ***!
  39669. \*****************************************************************************/
  39670. /*! exports provided: default */
  39671. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39672. "use strict";
  39673. __webpack_require__.r(__webpack_exports__);
  39674. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditableElement; });
  39675. /* harmony import */ var _containerelement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./containerelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js");
  39676. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  39677. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  39678. /**
  39679. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  39680. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  39681. */
  39682. /**
  39683. * @module engine/view/editableelement
  39684. */
  39685. /**
  39686. * Editable element which can be a {@link module:engine/view/rooteditableelement~RootEditableElement root}
  39687. * or nested editable area in the editor.
  39688. *
  39689. * Editable is automatically read-only when its {@link module:engine/view/document~Document Document} is read-only.
  39690. *
  39691. * The constructor of this class shouldn't be used directly. To create new `EditableElement` use the
  39692. * {@link module:engine/view/downcastwriter~DowncastWriter#createEditableElement `downcastWriter#createEditableElement()`} method.
  39693. *
  39694. * @extends module:engine/view/containerelement~ContainerElement
  39695. * @mixes module:utils/observablemixin~ObservableMixin
  39696. */
  39697. class EditableElement extends _containerelement__WEBPACK_IMPORTED_MODULE_0__["default"] {
  39698. /**
  39699. * Creates an editable element.
  39700. *
  39701. * @see module:engine/view/downcastwriter~DowncastWriter#createEditableElement
  39702. * @protected
  39703. */
  39704. constructor( document, name, attrs, children ) {
  39705. super( document, name, attrs, children );
  39706. /**
  39707. * Whether the editable is in read-write or read-only mode.
  39708. *
  39709. * @observable
  39710. * @member {Boolean} module:engine/view/editableelement~EditableElement#isReadOnly
  39711. */
  39712. this.set( 'isReadOnly', false );
  39713. /**
  39714. * Whether the editable is focused.
  39715. *
  39716. * This property updates when {@link module:engine/view/document~Document#isFocused document.isFocused} or view
  39717. * selection is changed.
  39718. *
  39719. * @readonly
  39720. * @observable
  39721. * @member {Boolean} module:engine/view/editableelement~EditableElement#isFocused
  39722. */
  39723. this.set( 'isFocused', false );
  39724. this.bind( 'isReadOnly' ).to( document );
  39725. this.bind( 'isFocused' ).to(
  39726. document,
  39727. 'isFocused',
  39728. isFocused => isFocused && document.selection.editableElement == this
  39729. );
  39730. // Update focus state based on selection changes.
  39731. this.listenTo( document.selection, 'change', () => {
  39732. this.isFocused = document.isFocused && document.selection.editableElement == this;
  39733. } );
  39734. }
  39735. /**
  39736. * Checks whether this object is of the given.
  39737. *
  39738. * editableElement.is( 'editableElement' ); // -> true
  39739. * editableElement.is( 'element' ); // -> true
  39740. * editableElement.is( 'node' ); // -> true
  39741. * editableElement.is( 'view:editableElement' ); // -> true
  39742. * editableElement.is( 'view:element' ); // -> true
  39743. * editableElement.is( 'view:node' ); // -> true
  39744. *
  39745. * editableElement.is( 'model:element' ); // -> false
  39746. * editableElement.is( 'documentFragment' ); // -> false
  39747. *
  39748. * Assuming that the object being checked is an editbale element, you can also check its
  39749. * {@link module:engine/view/editableelement~EditableElement#name name}:
  39750. *
  39751. * editableElement.is( 'element', 'div' ); // -> true if this is a div element
  39752. * editableElement.is( 'editableElement', 'div' ); // -> same as above
  39753. * text.is( 'element', 'div' ); -> false
  39754. *
  39755. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  39756. *
  39757. * @param {String} type Type to check.
  39758. * @param {String} [name] Element name.
  39759. * @returns {Boolean}
  39760. */
  39761. is( type, name = null ) {
  39762. if ( !name ) {
  39763. return type === 'editableElement' || type === 'view:editableElement' ||
  39764. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  39765. type === 'containerElement' || type === 'view:containerElement' ||
  39766. type === 'element' || type === 'view:element' ||
  39767. type === 'node' || type === 'view:node';
  39768. } else {
  39769. return name === this.name && (
  39770. type === 'editableElement' || type === 'view:editableElement' ||
  39771. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  39772. type === 'containerElement' || type === 'view:containerElement' ||
  39773. type === 'element' || type === 'view:element'
  39774. );
  39775. }
  39776. }
  39777. destroy() {
  39778. this.stopListening();
  39779. }
  39780. }
  39781. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( EditableElement, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  39782. /***/ }),
  39783. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js":
  39784. /*!*********************************************************************!*\
  39785. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js ***!
  39786. \*********************************************************************/
  39787. /*! exports provided: default */
  39788. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39789. "use strict";
  39790. __webpack_require__.r(__webpack_exports__);
  39791. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Element; });
  39792. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  39793. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  39794. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js");
  39795. /* harmony import */ var _ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
  39796. /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
  39797. /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  39798. /* harmony import */ var _matcher__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./matcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js");
  39799. /* harmony import */ var _stylesmap__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./stylesmap */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js");
  39800. /**
  39801. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  39802. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  39803. */
  39804. /**
  39805. * @module engine/view/element
  39806. */
  39807. // @if CK_DEBUG_ENGINE // const { convertMapToTags } = require( '../dev-utils/utils' );
  39808. /**
  39809. * View element.
  39810. *
  39811. * The editing engine does not define a fixed semantics of its elements (it is "DTD-free").
  39812. * This is why the type of the {@link module:engine/view/element~Element} need to
  39813. * be defined by the feature developer. When creating an element you should use one of the following methods:
  39814. *
  39815. * * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement `downcastWriter#createContainerElement()`}
  39816. * in order to create a {@link module:engine/view/containerelement~ContainerElement},
  39817. * * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement `downcastWriter#createAttributeElement()`}
  39818. * in order to create a {@link module:engine/view/attributeelement~AttributeElement},
  39819. * * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement `downcastWriter#createEmptyElement()`}
  39820. * in order to create a {@link module:engine/view/emptyelement~EmptyElement}.
  39821. * * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`}
  39822. * in order to create a {@link module:engine/view/uielement~UIElement}.
  39823. * * {@link module:engine/view/downcastwriter~DowncastWriter#createEditableElement `downcastWriter#createEditableElement()`}
  39824. * in order to create a {@link module:engine/view/editableelement~EditableElement}.
  39825. *
  39826. * Note that for view elements which are not created from the model, like elements from mutations, paste or
  39827. * {@link module:engine/controller/datacontroller~DataController#set data.set} it is not possible to define the type of the element.
  39828. * In such cases the {@link module:engine/view/upcastwriter~UpcastWriter#createElement `UpcastWriter#createElement()`} method
  39829. * should be used to create generic view elements.
  39830. *
  39831. * @extends module:engine/view/node~Node
  39832. */
  39833. class Element extends _node__WEBPACK_IMPORTED_MODULE_0__["default"] {
  39834. /**
  39835. * Creates a view element.
  39836. *
  39837. * Attributes can be passed in various formats:
  39838. *
  39839. * new Element( viewDocument, 'div', { class: 'editor', contentEditable: 'true' } ); // object
  39840. * new Element( viewDocument, 'div', [ [ 'class', 'editor' ], [ 'contentEditable', 'true' ] ] ); // map-like iterator
  39841. * new Element( viewDocument, 'div', mapOfAttributes ); // map
  39842. *
  39843. * @protected
  39844. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  39845. * @param {String} name Node name.
  39846. * @param {Object|Iterable} [attrs] Collection of attributes.
  39847. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  39848. * A list of nodes to be inserted into created element.
  39849. */
  39850. constructor( document, name, attrs, children ) {
  39851. super( document );
  39852. /**
  39853. * Name of the element.
  39854. *
  39855. * @readonly
  39856. * @member {String}
  39857. */
  39858. this.name = name;
  39859. /**
  39860. * Map of attributes, where attributes names are keys and attributes values are values.
  39861. *
  39862. * @protected
  39863. * @member {Map} #_attrs
  39864. */
  39865. this._attrs = parseAttributes( attrs );
  39866. /**
  39867. * Array of child nodes.
  39868. *
  39869. * @protected
  39870. * @member {Array.<module:engine/view/node~Node>}
  39871. */
  39872. this._children = [];
  39873. if ( children ) {
  39874. this._insertChild( 0, children );
  39875. }
  39876. /**
  39877. * Set of classes associated with element instance.
  39878. *
  39879. * @protected
  39880. * @member {Set}
  39881. */
  39882. this._classes = new Set();
  39883. if ( this._attrs.has( 'class' ) ) {
  39884. // Remove class attribute and handle it by class set.
  39885. const classString = this._attrs.get( 'class' );
  39886. parseClasses( this._classes, classString );
  39887. this._attrs.delete( 'class' );
  39888. }
  39889. /**
  39890. * Normalized styles.
  39891. *
  39892. * @protected
  39893. * @member {module:engine/view/stylesmap~StylesMap} module:engine/view/element~Element#_styles
  39894. */
  39895. this._styles = new _stylesmap__WEBPACK_IMPORTED_MODULE_7__["default"]( this.document.stylesProcessor );
  39896. if ( this._attrs.has( 'style' ) ) {
  39897. // Remove style attribute and handle it by styles map.
  39898. this._styles.setTo( this._attrs.get( 'style' ) );
  39899. this._attrs.delete( 'style' );
  39900. }
  39901. /**
  39902. * Map of custom properties.
  39903. * Custom properties can be added to element instance, will be cloned but not rendered into DOM.
  39904. *
  39905. * @protected
  39906. * @member {Map}
  39907. */
  39908. this._customProperties = new Map();
  39909. /**
  39910. * Whether an element is allowed inside an AttributeElement and can be wrapped with
  39911. * {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
  39912. *
  39913. * @protected
  39914. * @member {Boolean}
  39915. */
  39916. this._isAllowedInsideAttributeElement = false;
  39917. /**
  39918. * A list of attribute names that should be rendered in the editing pipeline even though filtering mechanisms
  39919. * implemented in the {@link module:engine/view/domconverter~DomConverter} (for instance,
  39920. * {@link module:engine/view/domconverter~DomConverter#shouldRenderAttribute}) would filter them out.
  39921. *
  39922. * These attributes can be specified as an option when the element is created by
  39923. * the {@link module:engine/view/downcastwriter~DowncastWriter}. To check whether an unsafe an attribute should
  39924. * be permitted, use the {@link #shouldRenderUnsafeAttribute} method.
  39925. *
  39926. * @private
  39927. * @readonly
  39928. * @member {Array.<String>}
  39929. */
  39930. this._unsafeAttributesToRender = [];
  39931. }
  39932. /**
  39933. * Number of element's children.
  39934. *
  39935. * @readonly
  39936. * @type {Number}
  39937. */
  39938. get childCount() {
  39939. return this._children.length;
  39940. }
  39941. /**
  39942. * Is `true` if there are no nodes inside this element, `false` otherwise.
  39943. *
  39944. * @readonly
  39945. * @type {Boolean}
  39946. */
  39947. get isEmpty() {
  39948. return this._children.length === 0;
  39949. }
  39950. /**
  39951. * Whether the element is allowed inside an AttributeElement and can be wrapped with
  39952. * {@link module:engine/view/attributeelement~AttributeElement} by {@link module:engine/view/downcastwriter~DowncastWriter}.
  39953. *
  39954. * @readonly
  39955. * @type {Boolean}
  39956. */
  39957. get isAllowedInsideAttributeElement() {
  39958. return this._isAllowedInsideAttributeElement;
  39959. }
  39960. /**
  39961. * Checks whether this object is of the given.
  39962. *
  39963. * element.is( 'element' ); // -> true
  39964. * element.is( 'node' ); // -> true
  39965. * element.is( 'view:element' ); // -> true
  39966. * element.is( 'view:node' ); // -> true
  39967. *
  39968. * element.is( 'model:element' ); // -> false
  39969. * element.is( 'documentSelection' ); // -> false
  39970. *
  39971. * Assuming that the object being checked is an element, you can also check its
  39972. * {@link module:engine/view/element~Element#name name}:
  39973. *
  39974. * element.is( 'element', 'img' ); // -> true if this is an <img> element
  39975. * text.is( 'element', 'img' ); -> false
  39976. *
  39977. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  39978. *
  39979. * @param {String} type Type to check.
  39980. * @param {String} [name] Element name.
  39981. * @returns {Boolean}
  39982. */
  39983. is( type, name = null ) {
  39984. if ( !name ) {
  39985. return type === 'element' || type === 'view:element' ||
  39986. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  39987. type === 'node' || type === 'view:node';
  39988. } else {
  39989. return name === this.name && ( type === 'element' || type === 'view:element' );
  39990. }
  39991. }
  39992. /**
  39993. * Gets child at the given index.
  39994. *
  39995. * @param {Number} index Index of child.
  39996. * @returns {module:engine/view/node~Node} Child node.
  39997. */
  39998. getChild( index ) {
  39999. return this._children[ index ];
  40000. }
  40001. /**
  40002. * Gets index of the given child node. Returns `-1` if child node is not found.
  40003. *
  40004. * @param {module:engine/view/node~Node} node Child node.
  40005. * @returns {Number} Index of the child node.
  40006. */
  40007. getChildIndex( node ) {
  40008. return this._children.indexOf( node );
  40009. }
  40010. /**
  40011. * Gets child nodes iterator.
  40012. *
  40013. * @returns {Iterable.<module:engine/view/node~Node>} Child nodes iterator.
  40014. */
  40015. getChildren() {
  40016. return this._children[ Symbol.iterator ]();
  40017. }
  40018. /**
  40019. * Returns an iterator that contains the keys for attributes. Order of inserting attributes is not preserved.
  40020. *
  40021. * @returns {Iterable.<String>} Keys for attributes.
  40022. */
  40023. * getAttributeKeys() {
  40024. if ( this._classes.size > 0 ) {
  40025. yield 'class';
  40026. }
  40027. if ( !this._styles.isEmpty ) {
  40028. yield 'style';
  40029. }
  40030. yield* this._attrs.keys();
  40031. }
  40032. /**
  40033. * Returns iterator that iterates over this element's attributes.
  40034. *
  40035. * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.
  40036. * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
  40037. *
  40038. * @returns {Iterable.<*>}
  40039. */
  40040. * getAttributes() {
  40041. yield* this._attrs.entries();
  40042. if ( this._classes.size > 0 ) {
  40043. yield [ 'class', this.getAttribute( 'class' ) ];
  40044. }
  40045. if ( !this._styles.isEmpty ) {
  40046. yield [ 'style', this.getAttribute( 'style' ) ];
  40047. }
  40048. }
  40049. /**
  40050. * Gets attribute by key. If attribute is not present - returns undefined.
  40051. *
  40052. * @param {String} key Attribute key.
  40053. * @returns {String|undefined} Attribute value.
  40054. */
  40055. getAttribute( key ) {
  40056. if ( key == 'class' ) {
  40057. if ( this._classes.size > 0 ) {
  40058. return [ ...this._classes ].join( ' ' );
  40059. }
  40060. return undefined;
  40061. }
  40062. if ( key == 'style' ) {
  40063. const inlineStyle = this._styles.toString();
  40064. return inlineStyle == '' ? undefined : inlineStyle;
  40065. }
  40066. return this._attrs.get( key );
  40067. }
  40068. /**
  40069. * Returns a boolean indicating whether an attribute with the specified key exists in the element.
  40070. *
  40071. * @param {String} key Attribute key.
  40072. * @returns {Boolean} `true` if attribute with the specified key exists in the element, false otherwise.
  40073. */
  40074. hasAttribute( key ) {
  40075. if ( key == 'class' ) {
  40076. return this._classes.size > 0;
  40077. }
  40078. if ( key == 'style' ) {
  40079. return !this._styles.isEmpty;
  40080. }
  40081. return this._attrs.has( key );
  40082. }
  40083. /**
  40084. * Checks if this element is similar to other element.
  40085. * Both elements should have the same name and attributes to be considered as similar. Two similar elements
  40086. * can contain different set of children nodes.
  40087. *
  40088. * @param {module:engine/view/element~Element} otherElement
  40089. * @returns {Boolean}
  40090. */
  40091. isSimilar( otherElement ) {
  40092. if ( !( otherElement instanceof Element ) ) {
  40093. return false;
  40094. }
  40095. // If exactly the same Element is provided - return true immediately.
  40096. if ( this === otherElement ) {
  40097. return true;
  40098. }
  40099. // Check element name.
  40100. if ( this.name != otherElement.name ) {
  40101. return false;
  40102. }
  40103. // Check isAllowedInsideAttributeElement property.
  40104. if ( this.isAllowedInsideAttributeElement != otherElement.isAllowedInsideAttributeElement ) {
  40105. return false;
  40106. }
  40107. // Check number of attributes, classes and styles.
  40108. if ( this._attrs.size !== otherElement._attrs.size || this._classes.size !== otherElement._classes.size ||
  40109. this._styles.size !== otherElement._styles.size ) {
  40110. return false;
  40111. }
  40112. // Check if attributes are the same.
  40113. for ( const [ key, value ] of this._attrs ) {
  40114. if ( !otherElement._attrs.has( key ) || otherElement._attrs.get( key ) !== value ) {
  40115. return false;
  40116. }
  40117. }
  40118. // Check if classes are the same.
  40119. for ( const className of this._classes ) {
  40120. if ( !otherElement._classes.has( className ) ) {
  40121. return false;
  40122. }
  40123. }
  40124. // Check if styles are the same.
  40125. for ( const property of this._styles.getStyleNames() ) {
  40126. if (
  40127. !otherElement._styles.has( property ) ||
  40128. otherElement._styles.getAsString( property ) !== this._styles.getAsString( property )
  40129. ) {
  40130. return false;
  40131. }
  40132. }
  40133. return true;
  40134. }
  40135. /**
  40136. * Returns true if class is present.
  40137. * If more then one class is provided - returns true only when all classes are present.
  40138. *
  40139. * element.hasClass( 'foo' ); // Returns true if 'foo' class is present.
  40140. * element.hasClass( 'foo', 'bar' ); // Returns true if 'foo' and 'bar' classes are both present.
  40141. *
  40142. * @param {...String} className
  40143. */
  40144. hasClass( ...className ) {
  40145. for ( const name of className ) {
  40146. if ( !this._classes.has( name ) ) {
  40147. return false;
  40148. }
  40149. }
  40150. return true;
  40151. }
  40152. /**
  40153. * Returns iterator that contains all class names.
  40154. *
  40155. * @returns {Iterable.<String>}
  40156. */
  40157. getClassNames() {
  40158. return this._classes.keys();
  40159. }
  40160. /**
  40161. * Returns style value for the given property mae.
  40162. * If the style does not exist `undefined` is returned.
  40163. *
  40164. * **Note**: This method can work with normalized style names if
  40165. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  40166. * See {@link module:engine/view/stylesmap~StylesMap#getAsString `StylesMap#getAsString()`} for details.
  40167. *
  40168. * For an element with style set to `'margin:1px'`:
  40169. *
  40170. * // Enable 'margin' shorthand processing:
  40171. * editor.data.addStyleProcessorRules( addMarginRules );
  40172. *
  40173. * const element = view.change( writer => {
  40174. * const element = writer.createElement();
  40175. * writer.setStyle( 'margin', '1px' );
  40176. * writer.setStyle( 'margin-bottom', '3em' );
  40177. *
  40178. * return element;
  40179. * } );
  40180. *
  40181. * element.getStyle( 'margin' ); // -> 'margin: 1px 1px 3em;'
  40182. *
  40183. * @param {String} property
  40184. * @returns {String|undefined}
  40185. */
  40186. getStyle( property ) {
  40187. return this._styles.getAsString( property );
  40188. }
  40189. /**
  40190. * Returns a normalized style object or single style value.
  40191. *
  40192. * For an element with style set to: margin:1px 2px 3em;
  40193. *
  40194. * element.getNormalizedStyle( 'margin' ) );
  40195. *
  40196. * will return:
  40197. *
  40198. * {
  40199. * top: '1px',
  40200. * right: '2px',
  40201. * bottom: '3em',
  40202. * left: '2px' // a normalized value from margin shorthand
  40203. * }
  40204. *
  40205. * and reading for single style value:
  40206. *
  40207. * styles.getNormalizedStyle( 'margin-left' );
  40208. *
  40209. * Will return a `2px` string.
  40210. *
  40211. * **Note**: This method will return normalized values only if
  40212. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  40213. * See {@link module:engine/view/stylesmap~StylesMap#getNormalized `StylesMap#getNormalized()`} for details.
  40214. *
  40215. *
  40216. * @param {String} property Name of CSS property
  40217. * @returns {Object|String|undefined}
  40218. */
  40219. getNormalizedStyle( property ) {
  40220. return this._styles.getNormalized( property );
  40221. }
  40222. /**
  40223. * Returns iterator that contains all style names.
  40224. *
  40225. * @param {Boolean} [expand=false] Expand shorthand style properties and return all equivalent style representations.
  40226. * @returns {Iterable.<String>}
  40227. */
  40228. getStyleNames( expand = false ) {
  40229. return this._styles.getStyleNames( expand );
  40230. }
  40231. /**
  40232. * Returns true if style keys are present.
  40233. * If more then one style property is provided - returns true only when all properties are present.
  40234. *
  40235. * element.hasStyle( 'color' ); // Returns true if 'border-top' style is present.
  40236. * element.hasStyle( 'color', 'border-top' ); // Returns true if 'color' and 'border-top' styles are both present.
  40237. *
  40238. * @param {...String} property
  40239. */
  40240. hasStyle( ...property ) {
  40241. for ( const name of property ) {
  40242. if ( !this._styles.has( name ) ) {
  40243. return false;
  40244. }
  40245. }
  40246. return true;
  40247. }
  40248. /**
  40249. * Returns ancestor element that match specified pattern.
  40250. * Provided patterns should be compatible with {@link module:engine/view/matcher~Matcher Matcher} as it is used internally.
  40251. *
  40252. * @see module:engine/view/matcher~Matcher
  40253. * @param {Object|String|RegExp|Function} patterns Patterns used to match correct ancestor.
  40254. * See {@link module:engine/view/matcher~Matcher}.
  40255. * @returns {module:engine/view/element~Element|null} Found element or `null` if no matching ancestor was found.
  40256. */
  40257. findAncestor( ...patterns ) {
  40258. const matcher = new _matcher__WEBPACK_IMPORTED_MODULE_6__["default"]( ...patterns );
  40259. let parent = this.parent;
  40260. while ( parent ) {
  40261. if ( matcher.match( parent ) ) {
  40262. return parent;
  40263. }
  40264. parent = parent.parent;
  40265. }
  40266. return null;
  40267. }
  40268. /**
  40269. * Returns the custom property value for the given key.
  40270. *
  40271. * @param {String|Symbol} key
  40272. * @returns {*}
  40273. */
  40274. getCustomProperty( key ) {
  40275. return this._customProperties.get( key );
  40276. }
  40277. /**
  40278. * Returns an iterator which iterates over this element's custom properties.
  40279. * Iterator provides `[ key, value ]` pairs for each stored property.
  40280. *
  40281. * @returns {Iterable.<*>}
  40282. */
  40283. * getCustomProperties() {
  40284. yield* this._customProperties.entries();
  40285. }
  40286. /**
  40287. * Returns identity string based on element's name, styles, classes and other attributes.
  40288. * Two elements that {@link #isSimilar are similar} will have same identity string.
  40289. * It has the following format:
  40290. *
  40291. * 'name class="class1,class2" style="style1:value1;style2:value2" attr1="val1" attr2="val2"'
  40292. *
  40293. * For example:
  40294. *
  40295. * const element = writer.createContainerElement( 'foo', {
  40296. * banana: '10',
  40297. * apple: '20',
  40298. * style: 'color: red; border-color: white;',
  40299. * class: 'baz'
  40300. * } );
  40301. *
  40302. * // returns 'foo class="baz" style="border-color:white;color:red" apple="20" banana="10"'
  40303. * element.getIdentity();
  40304. *
  40305. * **Note**: Classes, styles and other attributes are sorted alphabetically.
  40306. *
  40307. * @returns {String}
  40308. */
  40309. getIdentity() {
  40310. const classes = Array.from( this._classes ).sort().join( ',' );
  40311. const styles = this._styles.toString();
  40312. const attributes = Array.from( this._attrs ).map( i => `${ i[ 0 ] }="${ i[ 1 ] }"` ).sort().join( ' ' );
  40313. return this.name +
  40314. ( classes == '' ? '' : ` class="${ classes }"` ) +
  40315. ( !styles ? '' : ` style="${ styles }"` ) +
  40316. ( attributes == '' ? '' : ` ${ attributes }` );
  40317. }
  40318. /**
  40319. * Decides whether an unsafe attribute is whitelisted and should be rendered in the editing pipeline even though filtering mechanisms
  40320. * like {@link module:engine/view/domconverter~DomConverter#shouldRenderAttribute} say it should not.
  40321. *
  40322. * Unsafe attribute names can be specified when creating an element via {@link module:engine/view/downcastwriter~DowncastWriter}.
  40323. *
  40324. * @param {String} attributeName The name of the attribute to be checked.
  40325. * @returns {Boolean}
  40326. */
  40327. shouldRenderUnsafeAttribute( attributeName ) {
  40328. return this._unsafeAttributesToRender.includes( attributeName );
  40329. }
  40330. /**
  40331. * Clones provided element.
  40332. *
  40333. * @protected
  40334. * @param {Boolean} [deep=false] If set to `true` clones element and all its children recursively. When set to `false`,
  40335. * element will be cloned without any children.
  40336. * @returns {module:engine/view/element~Element} Clone of this element.
  40337. */
  40338. _clone( deep = false ) {
  40339. const childrenClone = [];
  40340. if ( deep ) {
  40341. for ( const child of this.getChildren() ) {
  40342. childrenClone.push( child._clone( deep ) );
  40343. }
  40344. }
  40345. // ContainerElement and AttributeElement should be also cloned properly.
  40346. const cloned = new this.constructor( this.document, this.name, this._attrs, childrenClone );
  40347. // Classes and styles are cloned separately - this solution is faster than adding them back to attributes and
  40348. // parse once again in constructor.
  40349. cloned._classes = new Set( this._classes );
  40350. cloned._styles.set( this._styles.getNormalized() );
  40351. // Clone custom properties.
  40352. cloned._customProperties = new Map( this._customProperties );
  40353. // Clone filler offset method.
  40354. // We can't define this method in a prototype because it's behavior which
  40355. // is changed by e.g. toWidget() function from ckeditor5-widget. Perhaps this should be one of custom props.
  40356. cloned.getFillerOffset = this.getFillerOffset;
  40357. cloned._isAllowedInsideAttributeElement = this.isAllowedInsideAttributeElement;
  40358. return cloned;
  40359. }
  40360. /**
  40361. * {@link module:engine/view/element~Element#_insertChild Insert} a child node or a list of child nodes at the end of this node
  40362. * and sets the parent of these nodes to this element.
  40363. *
  40364. * @see module:engine/view/downcastwriter~DowncastWriter#insert
  40365. * @protected
  40366. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  40367. * @fires module:engine/view/node~Node#change
  40368. * @returns {Number} Number of appended nodes.
  40369. */
  40370. _appendChild( items ) {
  40371. return this._insertChild( this.childCount, items );
  40372. }
  40373. /**
  40374. * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to
  40375. * this element.
  40376. *
  40377. * @see module:engine/view/downcastwriter~DowncastWriter#insert
  40378. * @protected
  40379. * @param {Number} index Position where nodes should be inserted.
  40380. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  40381. * @fires module:engine/view/node~Node#change
  40382. * @returns {Number} Number of inserted nodes.
  40383. */
  40384. _insertChild( index, items ) {
  40385. this._fireChange( 'children', this );
  40386. let count = 0;
  40387. const nodes = normalize( this.document, items );
  40388. for ( const node of nodes ) {
  40389. // If node that is being added to this element is already inside another element, first remove it from the old parent.
  40390. if ( node.parent !== null ) {
  40391. node._remove();
  40392. }
  40393. node.parent = this;
  40394. node.document = this.document;
  40395. this._children.splice( index, 0, node );
  40396. index++;
  40397. count++;
  40398. }
  40399. return count;
  40400. }
  40401. /**
  40402. * Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.
  40403. *
  40404. * @see module:engine/view/downcastwriter~DowncastWriter#remove
  40405. * @protected
  40406. * @param {Number} index Number of the first node to remove.
  40407. * @param {Number} [howMany=1] Number of nodes to remove.
  40408. * @fires module:engine/view/node~Node#change
  40409. * @returns {Array.<module:engine/view/node~Node>} The array of removed nodes.
  40410. */
  40411. _removeChildren( index, howMany = 1 ) {
  40412. this._fireChange( 'children', this );
  40413. for ( let i = index; i < index + howMany; i++ ) {
  40414. this._children[ i ].parent = null;
  40415. }
  40416. return this._children.splice( index, howMany );
  40417. }
  40418. /**
  40419. * Adds or overwrite attribute with a specified key and value.
  40420. *
  40421. * @see module:engine/view/downcastwriter~DowncastWriter#setAttribute
  40422. * @protected
  40423. * @param {String} key Attribute key.
  40424. * @param {String} value Attribute value.
  40425. * @fires module:engine/view/node~Node#change
  40426. */
  40427. _setAttribute( key, value ) {
  40428. value = String( value );
  40429. this._fireChange( 'attributes', this );
  40430. if ( key == 'class' ) {
  40431. parseClasses( this._classes, value );
  40432. } else if ( key == 'style' ) {
  40433. this._styles.setTo( value );
  40434. } else {
  40435. this._attrs.set( key, value );
  40436. }
  40437. }
  40438. /**
  40439. * Removes attribute from the element.
  40440. *
  40441. * @see module:engine/view/downcastwriter~DowncastWriter#removeAttribute
  40442. * @protected
  40443. * @param {String} key Attribute key.
  40444. * @returns {Boolean} Returns true if an attribute existed and has been removed.
  40445. * @fires module:engine/view/node~Node#change
  40446. */
  40447. _removeAttribute( key ) {
  40448. this._fireChange( 'attributes', this );
  40449. // Remove class attribute.
  40450. if ( key == 'class' ) {
  40451. if ( this._classes.size > 0 ) {
  40452. this._classes.clear();
  40453. return true;
  40454. }
  40455. return false;
  40456. }
  40457. // Remove style attribute.
  40458. if ( key == 'style' ) {
  40459. if ( !this._styles.isEmpty ) {
  40460. this._styles.clear();
  40461. return true;
  40462. }
  40463. return false;
  40464. }
  40465. // Remove other attributes.
  40466. return this._attrs.delete( key );
  40467. }
  40468. /**
  40469. * Adds specified class.
  40470. *
  40471. * element._addClass( 'foo' ); // Adds 'foo' class.
  40472. * element._addClass( [ 'foo', 'bar' ] ); // Adds 'foo' and 'bar' classes.
  40473. *
  40474. * @see module:engine/view/downcastwriter~DowncastWriter#addClass
  40475. * @protected
  40476. * @param {Array.<String>|String} className
  40477. * @fires module:engine/view/node~Node#change
  40478. */
  40479. _addClass( className ) {
  40480. this._fireChange( 'attributes', this );
  40481. for ( const name of Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__["default"])( className ) ) {
  40482. this._classes.add( name );
  40483. }
  40484. }
  40485. /**
  40486. * Removes specified class.
  40487. *
  40488. * element._removeClass( 'foo' ); // Removes 'foo' class.
  40489. * element._removeClass( [ 'foo', 'bar' ] ); // Removes both 'foo' and 'bar' classes.
  40490. *
  40491. * @see module:engine/view/downcastwriter~DowncastWriter#removeClass
  40492. * @protected
  40493. * @param {Array.<String>|String} className
  40494. * @fires module:engine/view/node~Node#change
  40495. */
  40496. _removeClass( className ) {
  40497. this._fireChange( 'attributes', this );
  40498. for ( const name of Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__["default"])( className ) ) {
  40499. this._classes.delete( name );
  40500. }
  40501. }
  40502. /**
  40503. * Adds style to the element.
  40504. *
  40505. * element._setStyle( 'color', 'red' );
  40506. * element._setStyle( {
  40507. * color: 'red',
  40508. * position: 'fixed'
  40509. * } );
  40510. *
  40511. * **Note**: This method can work with normalized style names if
  40512. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  40513. * See {@link module:engine/view/stylesmap~StylesMap#set `StylesMap#set()`} for details.
  40514. *
  40515. * @see module:engine/view/downcastwriter~DowncastWriter#setStyle
  40516. * @protected
  40517. * @param {String|Object} property Property name or object with key - value pairs.
  40518. * @param {String} [value] Value to set. This parameter is ignored if object is provided as the first parameter.
  40519. * @fires module:engine/view/node~Node#change
  40520. */
  40521. _setStyle( property, value ) {
  40522. this._fireChange( 'attributes', this );
  40523. this._styles.set( property, value );
  40524. }
  40525. /**
  40526. * Removes specified style.
  40527. *
  40528. * element._removeStyle( 'color' ); // Removes 'color' style.
  40529. * element._removeStyle( [ 'color', 'border-top' ] ); // Removes both 'color' and 'border-top' styles.
  40530. *
  40531. * **Note**: This method can work with normalized style names if
  40532. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  40533. * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.
  40534. *
  40535. * @see module:engine/view/downcastwriter~DowncastWriter#removeStyle
  40536. * @protected
  40537. * @param {Array.<String>|String} property
  40538. * @fires module:engine/view/node~Node#change
  40539. */
  40540. _removeStyle( property ) {
  40541. this._fireChange( 'attributes', this );
  40542. for ( const name of Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_4__["default"])( property ) ) {
  40543. this._styles.remove( name );
  40544. }
  40545. }
  40546. /**
  40547. * Sets a custom property. Unlike attributes, custom properties are not rendered to the DOM,
  40548. * so they can be used to add special data to elements.
  40549. *
  40550. * @see module:engine/view/downcastwriter~DowncastWriter#setCustomProperty
  40551. * @protected
  40552. * @param {String|Symbol} key
  40553. * @param {*} value
  40554. */
  40555. _setCustomProperty( key, value ) {
  40556. this._customProperties.set( key, value );
  40557. }
  40558. /**
  40559. * Removes the custom property stored under the given key.
  40560. *
  40561. * @see module:engine/view/downcastwriter~DowncastWriter#removeCustomProperty
  40562. * @protected
  40563. * @param {String|Symbol} key
  40564. * @returns {Boolean} Returns true if property was removed.
  40565. */
  40566. _removeCustomProperty( key ) {
  40567. return this._customProperties.delete( key );
  40568. }
  40569. /**
  40570. * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
  40571. *
  40572. * @abstract
  40573. * @method module:engine/view/element~Element#getFillerOffset
  40574. */
  40575. // @if CK_DEBUG_ENGINE // printTree( level = 0) {
  40576. // @if CK_DEBUG_ENGINE // let string = '';
  40577. // @if CK_DEBUG_ENGINE // string += '\t'.repeat( level ) + `<${ this.name }${ convertMapToTags( this.getAttributes() ) }>`;
  40578. // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
  40579. // @if CK_DEBUG_ENGINE // if ( child.is( '$text' ) ) {
  40580. // @if CK_DEBUG_ENGINE // string += '\n' + '\t'.repeat( level + 1 ) + child.data;
  40581. // @if CK_DEBUG_ENGINE // } else {
  40582. // @if CK_DEBUG_ENGINE // string += '\n' + child.printTree( level + 1 );
  40583. // @if CK_DEBUG_ENGINE // }
  40584. // @if CK_DEBUG_ENGINE // }
  40585. // @if CK_DEBUG_ENGINE // if ( this.childCount ) {
  40586. // @if CK_DEBUG_ENGINE // string += '\n' + '\t'.repeat( level );
  40587. // @if CK_DEBUG_ENGINE // }
  40588. // @if CK_DEBUG_ENGINE // string += `</${ this.name }>`;
  40589. // @if CK_DEBUG_ENGINE // return string;
  40590. // @if CK_DEBUG_ENGINE // }
  40591. // @if CK_DEBUG_ENGINE // logTree() {
  40592. // @if CK_DEBUG_ENGINE // console.log( this.printTree() );
  40593. // @if CK_DEBUG_ENGINE // }
  40594. }
  40595. // Parses attributes provided to the element constructor before they are applied to an element. If attributes are passed
  40596. // as an object (instead of `Iterable`), the object is transformed to the map. Attributes with `null` value are removed.
  40597. // Attributes with non-`String` value are converted to `String`.
  40598. //
  40599. // @param {Object|Iterable} attrs Attributes to parse.
  40600. // @returns {Map} Parsed attributes.
  40601. function parseAttributes( attrs ) {
  40602. attrs = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_3__["default"])( attrs );
  40603. for ( const [ key, value ] of attrs ) {
  40604. if ( value === null ) {
  40605. attrs.delete( key );
  40606. } else if ( typeof value != 'string' ) {
  40607. attrs.set( key, String( value ) );
  40608. }
  40609. }
  40610. return attrs;
  40611. }
  40612. // Parses class attribute and puts all classes into classes set.
  40613. // Classes set s cleared before insertion.
  40614. //
  40615. // @param {Set.<String>} classesSet Set to insert parsed classes.
  40616. // @param {String} classesString String with classes to parse.
  40617. function parseClasses( classesSet, classesString ) {
  40618. const classArray = classesString.split( /\s+/ );
  40619. classesSet.clear();
  40620. classArray.forEach( name => classesSet.add( name ) );
  40621. }
  40622. // Converts strings to Text and non-iterables to arrays.
  40623. //
  40624. // @param {String|module:engine/view/item~Item|Iterable.<String|module:engine/view/item~Item>}
  40625. // @returns {Iterable.<module:engine/view/node~Node>}
  40626. function normalize( document, nodes ) {
  40627. // Separate condition because string is iterable.
  40628. if ( typeof nodes == 'string' ) {
  40629. return [ new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( document, nodes ) ];
  40630. }
  40631. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_5__["default"])( nodes ) ) {
  40632. nodes = [ nodes ];
  40633. }
  40634. // Array.from to enable .map() on non-arrays.
  40635. return Array.from( nodes )
  40636. .map( node => {
  40637. if ( typeof node == 'string' ) {
  40638. return new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( document, node );
  40639. }
  40640. if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  40641. return new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( document, node.data );
  40642. }
  40643. return node;
  40644. } );
  40645. }
  40646. /***/ }),
  40647. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/emptyelement.js":
  40648. /*!**************************************************************************!*\
  40649. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/emptyelement.js ***!
  40650. \**************************************************************************/
  40651. /*! exports provided: default */
  40652. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40653. "use strict";
  40654. __webpack_require__.r(__webpack_exports__);
  40655. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EmptyElement; });
  40656. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  40657. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  40658. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  40659. /**
  40660. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  40661. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  40662. */
  40663. /**
  40664. * @module engine/view/emptyelement
  40665. */
  40666. /**
  40667. * Empty element class. It is used to represent elements that cannot contain any child nodes (for example `<img>` elements).
  40668. *
  40669. * To create a new empty element use the
  40670. * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement `downcastWriter#createEmptyElement()`} method.
  40671. *
  40672. * @extends module:engine/view/element~Element
  40673. */
  40674. class EmptyElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  40675. /**
  40676. * Creates new instance of EmptyElement.
  40677. *
  40678. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-emptyelement-cannot-add` when third parameter is passed,
  40679. * to inform that usage of EmptyElement is incorrect (adding child nodes to EmptyElement is forbidden).
  40680. *
  40681. * @see module:engine/view/downcastwriter~DowncastWriter#createEmptyElement
  40682. * @protected
  40683. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  40684. * @param {String} name Node name.
  40685. * @param {Object|Iterable} [attrs] Collection of attributes.
  40686. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  40687. * A list of nodes to be inserted into created element.
  40688. */
  40689. constructor( document, name, attrs, children ) {
  40690. super( document, name, attrs, children );
  40691. // Override the default of the base class.
  40692. this._isAllowedInsideAttributeElement = true;
  40693. /**
  40694. * Returns `null` because filler is not needed for EmptyElements.
  40695. *
  40696. * @method #getFillerOffset
  40697. * @returns {null} Always returns null.
  40698. */
  40699. this.getFillerOffset = getFillerOffset;
  40700. }
  40701. /**
  40702. * Checks whether this object is of the given.
  40703. *
  40704. * emptyElement.is( 'emptyElement' ); // -> true
  40705. * emptyElement.is( 'element' ); // -> true
  40706. * emptyElement.is( 'node' ); // -> true
  40707. * emptyElement.is( 'view:emptyElement' ); // -> true
  40708. * emptyElement.is( 'view:element' ); // -> true
  40709. * emptyElement.is( 'view:node' ); // -> true
  40710. *
  40711. * emptyElement.is( 'model:element' ); // -> false
  40712. * emptyElement.is( 'documentFragment' ); // -> false
  40713. *
  40714. * Assuming that the object being checked is an empty element, you can also check its
  40715. * {@link module:engine/view/emptyelement~EmptyElement#name name}:
  40716. *
  40717. * emptyElement.is( 'element', 'img' ); // -> true if this is a img element
  40718. * emptyElement.is( 'emptyElement', 'img' ); // -> same as above
  40719. * text.is( 'element', 'img' ); -> false
  40720. *
  40721. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  40722. *
  40723. * @param {String} type Type to check.
  40724. * @param {String} [name] Element name.
  40725. * @returns {Boolean}
  40726. */
  40727. is( type, name = null ) {
  40728. if ( !name ) {
  40729. return type === 'emptyElement' || type === 'view:emptyElement' ||
  40730. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  40731. type === 'element' || type === 'view:element' ||
  40732. type === 'node' || type === 'view:node';
  40733. } else {
  40734. return name === this.name && (
  40735. type === 'emptyElement' || type === 'view:emptyElement' ||
  40736. type === 'element' || type === 'view:element'
  40737. );
  40738. }
  40739. }
  40740. /**
  40741. * Overrides {@link module:engine/view/element~Element#_insertChild} method.
  40742. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-emptyelement-cannot-add` to prevent
  40743. * adding any child nodes to EmptyElement.
  40744. *
  40745. * @protected
  40746. */
  40747. _insertChild( index, nodes ) {
  40748. if ( nodes && ( nodes instanceof _node__WEBPACK_IMPORTED_MODULE_2__["default"] || Array.from( nodes ).length > 0 ) ) {
  40749. /**
  40750. * Cannot add children to {@link module:engine/view/emptyelement~EmptyElement}.
  40751. *
  40752. * @error view-emptyelement-cannot-add
  40753. */
  40754. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  40755. 'view-emptyelement-cannot-add',
  40756. [ this, nodes ]
  40757. );
  40758. }
  40759. }
  40760. }
  40761. // Returns `null` because block filler is not needed for EmptyElements.
  40762. //
  40763. // @returns {null}
  40764. function getFillerOffset() {
  40765. return null;
  40766. }
  40767. /***/ }),
  40768. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js":
  40769. /*!********************************************************************!*\
  40770. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js ***!
  40771. \********************************************************************/
  40772. /*! exports provided: NBSP_FILLER, MARKED_NBSP_FILLER, BR_FILLER, INLINE_FILLER_LENGTH, INLINE_FILLER, startsWithFiller, isInlineFiller, getDataWithoutFiller, injectQuirksHandling */
  40773. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40774. "use strict";
  40775. __webpack_require__.r(__webpack_exports__);
  40776. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NBSP_FILLER", function() { return NBSP_FILLER; });
  40777. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MARKED_NBSP_FILLER", function() { return MARKED_NBSP_FILLER; });
  40778. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BR_FILLER", function() { return BR_FILLER; });
  40779. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INLINE_FILLER_LENGTH", function() { return INLINE_FILLER_LENGTH; });
  40780. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INLINE_FILLER", function() { return INLINE_FILLER; });
  40781. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithFiller", function() { return startsWithFiller; });
  40782. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInlineFiller", function() { return isInlineFiller; });
  40783. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDataWithoutFiller", function() { return getDataWithoutFiller; });
  40784. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectQuirksHandling", function() { return injectQuirksHandling; });
  40785. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  40786. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
  40787. /**
  40788. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  40789. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  40790. */
  40791. /**
  40792. * Set of utilities related to handling block and inline fillers.
  40793. *
  40794. * Browsers do not allow to put caret in elements which does not have height. Because of it, we need to fill all
  40795. * empty elements which should be selectable with elements or characters called "fillers". Unfortunately there is no one
  40796. * universal filler, this is why two types are uses:
  40797. *
  40798. * * Block filler is an element which fill block elements, like `<p>`. CKEditor uses `<br>` as a block filler during the editing,
  40799. * as browsers do natively. So instead of an empty `<p>` there will be `<p><br></p>`. The advantage of block filler is that
  40800. * it is transparent for the selection, so when the caret is before the `<br>` and user presses right arrow he will be
  40801. * moved to the next paragraph, not after the `<br>`. The disadvantage is that it breaks a block, so it can not be used
  40802. * in the middle of a line of text. The {@link module:engine/view/filler~BR_FILLER `<br>` filler} can be replaced with any other
  40803. * character in the data output, for instance {@link module:engine/view/filler~NBSP_FILLER non-breaking space} or
  40804. * {@link module:engine/view/filler~MARKED_NBSP_FILLER marked non-breaking space}.
  40805. *
  40806. * * Inline filler is a filler which does not break a line of text, so it can be used inside the text, for instance in the empty
  40807. * `<b>` surrendered by text: `foo<b></b>bar`, if we want to put the caret there. CKEditor uses a sequence of the zero-width
  40808. * spaces as an {@link module:engine/view/filler~INLINE_FILLER inline filler} having the predetermined
  40809. * {@link module:engine/view/filler~INLINE_FILLER_LENGTH length}. A sequence is used, instead of a single character to
  40810. * avoid treating random zero-width spaces as the inline filler. Disadvantage of the inline filler is that it is not
  40811. * transparent for the selection. The arrow key moves the caret between zero-width spaces characters, so the additional
  40812. * code is needed to handle the caret.
  40813. *
  40814. * Both inline and block fillers are handled by the {@link module:engine/view/renderer~Renderer renderer} and are not present in the
  40815. * view.
  40816. *
  40817. * @module engine/view/filler
  40818. */
  40819. /**
  40820. * Non-breaking space filler creator. This function creates the `&nbsp;` text node.
  40821. * It defines how the filler is created.
  40822. *
  40823. * @see module:engine/view/filler~MARKED_NBSP_FILLER
  40824. * @see module:engine/view/filler~BR_FILLER
  40825. * @function
  40826. */
  40827. const NBSP_FILLER = domDocument => domDocument.createTextNode( '\u00A0' );
  40828. /**
  40829. * Marked non-breaking space filler creator. This function creates the `<span data-cke-filler="true">&nbsp;</span>` element.
  40830. * It defines how the filler is created.
  40831. *
  40832. * @see module:engine/view/filler~NBSP_FILLER
  40833. * @see module:engine/view/filler~BR_FILLER
  40834. * @function
  40835. */
  40836. const MARKED_NBSP_FILLER = domDocument => {
  40837. const span = domDocument.createElement( 'span' );
  40838. span.dataset.ckeFiller = true;
  40839. span.innerHTML = '\u00A0';
  40840. return span;
  40841. };
  40842. /**
  40843. * `<br>` filler creator. This function creates the `<br data-cke-filler="true">` element.
  40844. * It defines how the filler is created.
  40845. *
  40846. * @see module:engine/view/filler~NBSP_FILLER
  40847. * @see module:engine/view/filler~MARKED_NBSP_FILLER
  40848. * @function
  40849. */
  40850. const BR_FILLER = domDocument => {
  40851. const fillerBr = domDocument.createElement( 'br' );
  40852. fillerBr.dataset.ckeFiller = true;
  40853. return fillerBr;
  40854. };
  40855. /**
  40856. * Length of the {@link module:engine/view/filler~INLINE_FILLER INLINE_FILLER}.
  40857. */
  40858. const INLINE_FILLER_LENGTH = 7;
  40859. /**
  40860. * Inline filler which is a sequence of the word joiners.
  40861. *
  40862. * @type {String}
  40863. */
  40864. const INLINE_FILLER = '\u2060'.repeat( INLINE_FILLER_LENGTH );
  40865. /**
  40866. * Checks if the node is a text node which starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
  40867. *
  40868. * startsWithFiller( document.createTextNode( INLINE_FILLER ) ); // true
  40869. * startsWithFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // true
  40870. * startsWithFiller( document.createTextNode( 'foo' ) ); // false
  40871. * startsWithFiller( document.createElement( 'p' ) ); // false
  40872. *
  40873. * @param {Node} domNode DOM node.
  40874. * @returns {Boolean} True if the text node starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
  40875. */
  40876. function startsWithFiller( domNode ) {
  40877. return Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_1__["default"])( domNode ) && ( domNode.data.substr( 0, INLINE_FILLER_LENGTH ) === INLINE_FILLER );
  40878. }
  40879. /**
  40880. * Checks if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
  40881. *
  40882. * isInlineFiller( document.createTextNode( INLINE_FILLER ) ); // true
  40883. * isInlineFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // false
  40884. *
  40885. * @param {Text} domText DOM text node.
  40886. * @returns {Boolean} True if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
  40887. */
  40888. function isInlineFiller( domText ) {
  40889. return domText.data.length == INLINE_FILLER_LENGTH && startsWithFiller( domText );
  40890. }
  40891. /**
  40892. * Get string data from the text node, removing an {@link module:engine/view/filler~INLINE_FILLER inline filler} from it,
  40893. * if text node contains it.
  40894. *
  40895. * getDataWithoutFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ) == 'foo' // true
  40896. * getDataWithoutFiller( document.createTextNode( 'foo' ) ) == 'foo' // true
  40897. *
  40898. * @param {Text} domText DOM text node, possible with inline filler.
  40899. * @returns {String} Data without filler.
  40900. */
  40901. function getDataWithoutFiller( domText ) {
  40902. if ( startsWithFiller( domText ) ) {
  40903. return domText.data.slice( INLINE_FILLER_LENGTH );
  40904. } else {
  40905. return domText.data;
  40906. }
  40907. }
  40908. /**
  40909. * Assign key observer which move cursor from the end of the inline filler to the beginning of it when
  40910. * the left arrow is pressed, so the filler does not break navigation.
  40911. *
  40912. * @param {module:engine/view/view~View} view View controller instance we should inject quirks handling on.
  40913. */
  40914. function injectQuirksHandling( view ) {
  40915. view.document.on( 'arrowKey', jumpOverInlineFiller, { priority: 'low' } );
  40916. }
  40917. // Move cursor from the end of the inline filler to the beginning of it when, so the filler does not break navigation.
  40918. function jumpOverInlineFiller( evt, data ) {
  40919. if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].arrowleft ) {
  40920. const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
  40921. if ( domSelection.rangeCount == 1 && domSelection.getRangeAt( 0 ).collapsed ) {
  40922. const domParent = domSelection.getRangeAt( 0 ).startContainer;
  40923. const domOffset = domSelection.getRangeAt( 0 ).startOffset;
  40924. if ( startsWithFiller( domParent ) && domOffset <= INLINE_FILLER_LENGTH ) {
  40925. domSelection.collapse( domParent, 0 );
  40926. }
  40927. }
  40928. }
  40929. }
  40930. /***/ }),
  40931. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js":
  40932. /*!*********************************************************************!*\
  40933. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js ***!
  40934. \*********************************************************************/
  40935. /*! exports provided: default */
  40936. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40937. "use strict";
  40938. __webpack_require__.r(__webpack_exports__);
  40939. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Matcher; });
  40940. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  40941. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  40942. /**
  40943. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  40944. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  40945. */
  40946. /**
  40947. * @module engine/view/matcher
  40948. */
  40949. /**
  40950. * View matcher class.
  40951. * Instance of this class can be used to find {@link module:engine/view/element~Element elements} that match given pattern.
  40952. */
  40953. class Matcher {
  40954. /**
  40955. * Creates new instance of Matcher.
  40956. *
  40957. * @param {String|RegExp|Object} [pattern] Match patterns. See {@link module:engine/view/matcher~Matcher#add add method} for
  40958. * more information.
  40959. */
  40960. constructor( ...pattern ) {
  40961. /**
  40962. * @private
  40963. * @type {Array<String|RegExp|Object>}
  40964. */
  40965. this._patterns = [];
  40966. this.add( ...pattern );
  40967. }
  40968. /**
  40969. * Adds pattern or patterns to matcher instance.
  40970. *
  40971. * // String.
  40972. * matcher.add( 'div' );
  40973. *
  40974. * // Regular expression.
  40975. * matcher.add( /^\w/ );
  40976. *
  40977. * // Single class.
  40978. * matcher.add( {
  40979. * classes: 'foobar'
  40980. * } );
  40981. *
  40982. * See {@link module:engine/view/matcher~MatcherPattern} for more examples.
  40983. *
  40984. * Multiple patterns can be added in one call:
  40985. *
  40986. * matcher.add( 'div', { classes: 'foobar' } );
  40987. *
  40988. * @param {Object|String|RegExp|Function} pattern Object describing pattern details. If string or regular expression
  40989. * is provided it will be used to match element's name. Pattern can be also provided in a form
  40990. * of a function - then this function will be called with each {@link module:engine/view/element~Element element} as a parameter.
  40991. * Function's return value will be stored under `match` key of the object returned from
  40992. * {@link module:engine/view/matcher~Matcher#match match} or {@link module:engine/view/matcher~Matcher#matchAll matchAll} methods.
  40993. * @param {String|RegExp} [pattern.name] Name or regular expression to match element's name.
  40994. * @param {Object} [pattern.attributes] Object with key-value pairs representing attributes to match. Each object key
  40995. * represents attribute name. Value under that key can be either:
  40996. * * `true` - then attribute is just required (can be empty),
  40997. * * a string - then attribute has to be equal, or
  40998. * * a regular expression - then attribute has to match the expression.
  40999. * @param {String|RegExp|Array} [pattern.classes] Class name or array of class names to match. Each name can be
  41000. * provided in a form of string or regular expression.
  41001. * @param {Object} [pattern.styles] Object with key-value pairs representing styles to match. Each object key
  41002. * represents style name. Value under that key can be either a string or a regular expression and it will be used
  41003. * to match style value.
  41004. */
  41005. add( ...pattern ) {
  41006. for ( let item of pattern ) {
  41007. // String or RegExp pattern is used as element's name.
  41008. if ( typeof item == 'string' || item instanceof RegExp ) {
  41009. item = { name: item };
  41010. }
  41011. this._patterns.push( item );
  41012. }
  41013. }
  41014. /**
  41015. * Matches elements for currently stored patterns. Returns match information about first found
  41016. * {@link module:engine/view/element~Element element}, otherwise returns `null`.
  41017. *
  41018. * Example of returned object:
  41019. *
  41020. * {
  41021. * element: <instance of found element>,
  41022. * pattern: <pattern used to match found element>,
  41023. * match: {
  41024. * name: true,
  41025. * attributes: [ 'title', 'href' ],
  41026. * classes: [ 'foo' ],
  41027. * styles: [ 'color', 'position' ]
  41028. * }
  41029. * }
  41030. *
  41031. * @see module:engine/view/matcher~Matcher#add
  41032. * @see module:engine/view/matcher~Matcher#matchAll
  41033. * @param {...module:engine/view/element~Element} element View element to match against stored patterns.
  41034. * @returns {Object|null} result
  41035. * @returns {module:engine/view/element~Element} result.element Matched view element.
  41036. * @returns {Object|String|RegExp|Function} result.pattern Pattern that was used to find matched element.
  41037. * @returns {Object} result.match Object representing matched element parts.
  41038. * @returns {Boolean} [result.match.name] True if name of the element was matched.
  41039. * @returns {Array} [result.match.attributes] Array with matched attribute names.
  41040. * @returns {Array} [result.match.classes] Array with matched class names.
  41041. * @returns {Array} [result.match.styles] Array with matched style names.
  41042. */
  41043. match( ...element ) {
  41044. for ( const singleElement of element ) {
  41045. for ( const pattern of this._patterns ) {
  41046. const match = isElementMatching( singleElement, pattern );
  41047. if ( match ) {
  41048. return {
  41049. element: singleElement,
  41050. pattern,
  41051. match
  41052. };
  41053. }
  41054. }
  41055. }
  41056. return null;
  41057. }
  41058. /**
  41059. * Matches elements for currently stored patterns. Returns array of match information with all found
  41060. * {@link module:engine/view/element~Element elements}. If no element is found - returns `null`.
  41061. *
  41062. * @see module:engine/view/matcher~Matcher#add
  41063. * @see module:engine/view/matcher~Matcher#match
  41064. * @param {...module:engine/view/element~Element} element View element to match against stored patterns.
  41065. * @returns {Array.<Object>|null} Array with match information about found elements or `null`. For more information
  41066. * see {@link module:engine/view/matcher~Matcher#match match method} description.
  41067. */
  41068. matchAll( ...element ) {
  41069. const results = [];
  41070. for ( const singleElement of element ) {
  41071. for ( const pattern of this._patterns ) {
  41072. const match = isElementMatching( singleElement, pattern );
  41073. if ( match ) {
  41074. results.push( {
  41075. element: singleElement,
  41076. pattern,
  41077. match
  41078. } );
  41079. }
  41080. }
  41081. }
  41082. return results.length > 0 ? results : null;
  41083. }
  41084. /**
  41085. * Returns the name of the element to match if there is exactly one pattern added to the matcher instance
  41086. * and it matches element name defined by `string` (not `RegExp`). Otherwise, returns `null`.
  41087. *
  41088. * @returns {String|null} Element name trying to match.
  41089. */
  41090. getElementName() {
  41091. if ( this._patterns.length !== 1 ) {
  41092. return null;
  41093. }
  41094. const pattern = this._patterns[ 0 ];
  41095. const name = pattern.name;
  41096. return ( typeof pattern != 'function' && name && !( name instanceof RegExp ) ) ? name : null;
  41097. }
  41098. }
  41099. // Returns match information if {@link module:engine/view/element~Element element} is matching provided pattern.
  41100. // If element cannot be matched to provided pattern - returns `null`.
  41101. //
  41102. // @param {module:engine/view/element~Element} element
  41103. // @param {Object|String|RegExp|Function} pattern
  41104. // @returns {Object|null} Returns object with match information or null if element is not matching.
  41105. function isElementMatching( element, pattern ) {
  41106. // If pattern is provided as function - return result of that function;
  41107. if ( typeof pattern == 'function' ) {
  41108. return pattern( element );
  41109. }
  41110. const match = {};
  41111. // Check element's name.
  41112. if ( pattern.name ) {
  41113. match.name = matchName( pattern.name, element.name );
  41114. if ( !match.name ) {
  41115. return null;
  41116. }
  41117. }
  41118. // Check element's attributes.
  41119. if ( pattern.attributes ) {
  41120. match.attributes = matchAttributes( pattern.attributes, element );
  41121. if ( !match.attributes ) {
  41122. return null;
  41123. }
  41124. }
  41125. // Check element's classes.
  41126. if ( pattern.classes ) {
  41127. match.classes = matchClasses( pattern.classes, element );
  41128. if ( !match.classes ) {
  41129. return false;
  41130. }
  41131. }
  41132. // Check element's styles.
  41133. if ( pattern.styles ) {
  41134. match.styles = matchStyles( pattern.styles, element );
  41135. if ( !match.styles ) {
  41136. return false;
  41137. }
  41138. }
  41139. return match;
  41140. }
  41141. // Checks if name can be matched by provided pattern.
  41142. //
  41143. // @param {String|RegExp} pattern
  41144. // @param {String} name
  41145. // @returns {Boolean} Returns `true` if name can be matched, `false` otherwise.
  41146. function matchName( pattern, name ) {
  41147. // If pattern is provided as RegExp - test against this regexp.
  41148. if ( pattern instanceof RegExp ) {
  41149. return !!name.match( pattern );
  41150. }
  41151. return pattern === name;
  41152. }
  41153. // Checks if an array of key/value pairs can be matched against provided patterns.
  41154. //
  41155. // Patterns can be provided in a following ways:
  41156. // - a boolean value matches any attribute with any value (or no value):
  41157. //
  41158. // pattern: true
  41159. //
  41160. // - a RegExp expression or object matches any attribute name:
  41161. //
  41162. // pattern: /h[1-6]/
  41163. //
  41164. // - an object matches any attribute that has the same name as the object item's key, where object item's value is:
  41165. // - equal to `true`, which matches any attribute value:
  41166. //
  41167. // pattern: {
  41168. // required: true
  41169. // }
  41170. //
  41171. // - a string that is equal to attribute value:
  41172. //
  41173. // pattern: {
  41174. // rel: 'nofollow'
  41175. // }
  41176. //
  41177. // - a regular expression that matches attribute value,
  41178. //
  41179. // pattern: {
  41180. // src: /https.*/
  41181. // }
  41182. //
  41183. // - an array with items, where the item is:
  41184. // - a string that is equal to attribute value:
  41185. //
  41186. // pattern: [ 'data-property-1', 'data-property-2' ],
  41187. //
  41188. // - an object with `key` and `value` property, where `key` is a regular expression matching attribute name and
  41189. // `value` is either regular expression matching attribute value or a string equal to attribute value:
  41190. //
  41191. // pattern: [
  41192. // { key: /data-property-.*/, value: true },
  41193. // // or:
  41194. // { key: /data-property-.*/, value: 'foobar' },
  41195. // // or:
  41196. // { key: /data-property-.*/, value: /foo.*/ }
  41197. // ]
  41198. //
  41199. // @param {Object} patterns Object with information about attributes to match.
  41200. // @param {Iterable.<String>} keys Attribute, style or class keys.
  41201. // @param {Function} valueGetter A function providing value for a given item key.
  41202. // @returns {Array|null} Returns array with matched attribute names or `null` if no attributes were matched.
  41203. function matchPatterns( patterns, keys, valueGetter ) {
  41204. const normalizedPatterns = normalizePatterns( patterns );
  41205. const normalizedItems = Array.from( keys );
  41206. const match = [];
  41207. normalizedPatterns.forEach( ( [ patternKey, patternValue ] ) => {
  41208. normalizedItems.forEach( itemKey => {
  41209. if (
  41210. isKeyMatched( patternKey, itemKey ) &&
  41211. isValueMatched( patternValue, itemKey, valueGetter )
  41212. ) {
  41213. match.push( itemKey );
  41214. }
  41215. } );
  41216. } );
  41217. // Return matches only if there are at least as many of them as there are patterns.
  41218. // The RegExp pattern can match more than one item.
  41219. if ( !normalizedPatterns.length || match.length < normalizedPatterns.length ) {
  41220. return null;
  41221. }
  41222. return match;
  41223. }
  41224. // Bring all the possible pattern forms to an array of arrays where first item is a key and second is a value.
  41225. //
  41226. // Examples:
  41227. //
  41228. // Boolean pattern value:
  41229. //
  41230. // true
  41231. //
  41232. // to
  41233. //
  41234. // [ [ true, true ] ]
  41235. //
  41236. // Textual pattern value:
  41237. //
  41238. // 'attribute-name-or-class-or-style'
  41239. //
  41240. // to
  41241. //
  41242. // [ [ 'attribute-name-or-class-or-style', true ] ]
  41243. //
  41244. // Regular expression:
  41245. //
  41246. // /^data-.*$/
  41247. //
  41248. // to
  41249. //
  41250. // [ [ /^data-.*$/, true ] ]
  41251. //
  41252. // Objects (plain or with `key` and `value` specified explicitly):
  41253. //
  41254. // {
  41255. // src: /^https:.*$/
  41256. // }
  41257. //
  41258. // or
  41259. //
  41260. // [ {
  41261. // key: 'src',
  41262. // value: /^https:.*$/
  41263. // } ]
  41264. //
  41265. // to:
  41266. //
  41267. // [ [ 'src', /^https:.*$/ ] ]
  41268. //
  41269. // @param {Object|Array} patterns
  41270. // @returns {Array|null} Returns an array of objects or null if provided patterns were not in an expected form.
  41271. function normalizePatterns( patterns ) {
  41272. if ( Array.isArray( patterns ) ) {
  41273. return patterns.map( pattern => {
  41274. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( pattern ) ) {
  41275. if ( pattern.key === undefined || pattern.value === undefined ) {
  41276. // Documented at the end of matcher.js.
  41277. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["logWarning"])( 'matcher-pattern-missing-key-or-value', pattern );
  41278. }
  41279. return [ pattern.key, pattern.value ];
  41280. }
  41281. // Assume the pattern is either String or RegExp.
  41282. return [ pattern, true ];
  41283. } );
  41284. }
  41285. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( patterns ) ) {
  41286. return Object.entries( patterns );
  41287. }
  41288. // Other cases (true, string or regexp).
  41289. return [ [ patterns, true ] ];
  41290. }
  41291. // @param {String|RegExp} patternKey A pattern representing a key we want to match.
  41292. // @param {String} itemKey An actual item key (e.g. `'src'`, `'background-color'`, `'ck-widget'`) we're testing against pattern.
  41293. // @returns {Boolean}
  41294. function isKeyMatched( patternKey, itemKey ) {
  41295. return patternKey === true ||
  41296. patternKey === itemKey ||
  41297. patternKey instanceof RegExp && itemKey.match( patternKey );
  41298. }
  41299. // @param {String|RegExp} patternValue A pattern representing a value we want to match.
  41300. // @param {String} itemKey An item key, e.g. `background`, `href`, 'rel', etc.
  41301. // @param {Function} valueGetter A function used to provide a value for a given `itemKey`.
  41302. // @returns {Boolean}
  41303. function isValueMatched( patternValue, itemKey, valueGetter ) {
  41304. if ( patternValue === true ) {
  41305. return true;
  41306. }
  41307. const itemValue = valueGetter( itemKey );
  41308. // For now, the reducers are not returning the full tree of properties.
  41309. // Casting to string preserves the old behavior until the root cause is fixed.
  41310. // More can be found in https://github.com/ckeditor/ckeditor5/issues/10399.
  41311. return patternValue === itemValue ||
  41312. patternValue instanceof RegExp && !!String( itemValue ).match( patternValue );
  41313. }
  41314. // Checks if attributes of provided element can be matched against provided patterns.
  41315. //
  41316. // @param {Object} patterns Object with information about attributes to match. Each key of the object will be
  41317. // used as attribute name. Value of each key can be a string or regular expression to match against attribute value.
  41318. // @param {module:engine/view/element~Element} element Element which attributes will be tested.
  41319. // @returns {Array|null} Returns array with matched attribute names or `null` if no attributes were matched.
  41320. function matchAttributes( patterns, element ) {
  41321. const attributeKeys = new Set( element.getAttributeKeys() );
  41322. // `style` and `class` attribute keys are deprecated. Only allow them in object pattern
  41323. // for backward compatibility.
  41324. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( patterns ) ) {
  41325. if ( patterns.style !== undefined ) {
  41326. // Documented at the end of matcher.js.
  41327. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["logWarning"])( 'matcher-pattern-deprecated-attributes-style-key', patterns );
  41328. }
  41329. if ( patterns.class !== undefined ) {
  41330. // Documented at the end of matcher.js.
  41331. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["logWarning"])( 'matcher-pattern-deprecated-attributes-class-key', patterns );
  41332. }
  41333. } else {
  41334. attributeKeys.delete( 'style' );
  41335. attributeKeys.delete( 'class' );
  41336. }
  41337. return matchPatterns( patterns, attributeKeys, key => element.getAttribute( key ) );
  41338. }
  41339. // Checks if classes of provided element can be matched against provided patterns.
  41340. //
  41341. // @param {Array.<String|RegExp>} patterns Array of strings or regular expressions to match against element's classes.
  41342. // @param {module:engine/view/element~Element} element Element which classes will be tested.
  41343. // @returns {Array|null} Returns array with matched class names or `null` if no classes were matched.
  41344. function matchClasses( patterns, element ) {
  41345. // We don't need `getter` here because patterns for classes are always normalized to `[ className, true ]`.
  41346. return matchPatterns( patterns, element.getClassNames() );
  41347. }
  41348. // Checks if styles of provided element can be matched against provided patterns.
  41349. //
  41350. // @param {Object} patterns Object with information about styles to match. Each key of the object will be
  41351. // used as style name. Value of each key can be a string or regular expression to match against style value.
  41352. // @param {module:engine/view/element~Element} element Element which styles will be tested.
  41353. // @returns {Array|null} Returns array with matched style names or `null` if no styles were matched.
  41354. function matchStyles( patterns, element ) {
  41355. return matchPatterns( patterns, element.getStyleNames( true ), key => element.getStyle( key ) );
  41356. }
  41357. /**
  41358. * An entity that is a valid pattern recognized by a matcher. `MatcherPattern` is used by {@link ~Matcher} to recognize
  41359. * if a view element fits in a group of view elements described by the pattern.
  41360. *
  41361. * `MatcherPattern` can be given as a `String`, a `RegExp`, an `Object` or a `Function`.
  41362. *
  41363. * If `MatcherPattern` is given as a `String` or `RegExp`, it will match any view element that has a matching name:
  41364. *
  41365. * // Match any element with name equal to 'div'.
  41366. * const pattern = 'div';
  41367. *
  41368. * // Match any element which name starts on 'p'.
  41369. * const pattern = /^p/;
  41370. *
  41371. * If `MatcherPattern` is given as an `Object`, all the object's properties will be matched with view element properties.
  41372. * If the view element does not meet all of the object's pattern properties, the match will not happen.
  41373. * Available `Object` matching properties:
  41374. *
  41375. * Matching view element:
  41376. *
  41377. * // Match view element's name using String:
  41378. * const pattern = { name: 'p' };
  41379. *
  41380. * // or by providing RegExp:
  41381. * const pattern = { name: /^(ul|ol)$/ };
  41382. *
  41383. * // The name can also be skipped to match any view element with matching attributes:
  41384. * const pattern = {
  41385. * attributes: {
  41386. * 'title': true
  41387. * }
  41388. * };
  41389. *
  41390. * Matching view element attributes:
  41391. *
  41392. * // Match view element with any attribute value.
  41393. * const pattern = {
  41394. * name: 'p',
  41395. * attributes: true
  41396. * };
  41397. *
  41398. * // Match view element which has matching attributes (String).
  41399. * const pattern = {
  41400. * name: 'figure',
  41401. * attributes: 'title' // Match title attribute (can be empty).
  41402. * };
  41403. *
  41404. * // Match view element which has matching attributes (RegExp).
  41405. * const pattern = {
  41406. * name: 'figure',
  41407. * attributes: /^data-.*$/ // Match attributes starting with `data-` e.g. `data-foo` with any value (can be empty).
  41408. * };
  41409. *
  41410. * // Match view element which has matching attributes (Object).
  41411. * const pattern = {
  41412. * name: 'figure',
  41413. * attributes: {
  41414. * title: 'foobar', // Match `title` attribute with 'foobar' value.
  41415. * alt: true, // Match `alt` attribute with any value (can be empty).
  41416. * 'data-type': /^(jpg|png)$/ // Match `data-type` attribute with `jpg` or `png` value.
  41417. * }
  41418. * };
  41419. *
  41420. * // Match view element which has matching attributes (Array).
  41421. * const pattern = {
  41422. * name: 'figure',
  41423. * attributes: [
  41424. * 'title', // Match `title` attribute (can be empty).
  41425. * /^data-*$/ // Match attributes starting with `data-` e.g. `data-foo` with any value (can be empty).
  41426. * ]
  41427. * };
  41428. *
  41429. * // Match view element which has matching attributes (key-value pairs).
  41430. * const pattern = {
  41431. * name: 'input',
  41432. * attributes: [
  41433. * {
  41434. * key: 'type', // Match `type` as an attribute key.
  41435. * value: /^(text|number|date)$/ // Match `text`, `number` or `date` values.
  41436. * },
  41437. * {
  41438. * key: /^data-.*$/, // Match attributes starting with `data-` e.g. `data-foo`.
  41439. * value: true // Match any value (can be empty).
  41440. * }
  41441. * ]
  41442. * };
  41443. *
  41444. * Matching view element styles:
  41445. *
  41446. * // Match view element with any style.
  41447. * const pattern = {
  41448. * name: 'p',
  41449. * styles: true
  41450. * };
  41451. *
  41452. * // Match view element which has matching styles (String).
  41453. * const pattern = {
  41454. * name: 'p',
  41455. * styles: 'color' // Match attributes with `color` style.
  41456. * };
  41457. *
  41458. * // Match view element which has matching styles (RegExp).
  41459. * const pattern = {
  41460. * name: 'p',
  41461. * styles: /^border.*$/ // Match view element with any border style.
  41462. * };
  41463. *
  41464. * // Match view element which has matching styles (Object).
  41465. * const pattern = {
  41466. * name: 'p',
  41467. * styles: {
  41468. * color: /rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/, // Match `color` in RGB format only.
  41469. * 'font-weight': 600, // Match `font-weight` only if it's `600`.
  41470. * 'text-decoration': true // Match any text decoration.
  41471. * }
  41472. * };
  41473. *
  41474. * // Match view element which has matching styles (Array).
  41475. * const pattern = {
  41476. * name: 'p',
  41477. * styles: [
  41478. * 'color', // Match `color` with any value.
  41479. * /^border.*$/ // Match all border properties.
  41480. * ]
  41481. * };
  41482. *
  41483. * // Match view element which has matching styles (key-value pairs).
  41484. * const pattern = {
  41485. * name: 'p',
  41486. * styles: [
  41487. * {
  41488. * key: 'color', // Match `color` as an property key.
  41489. * value: /rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/ // Match RGB format only.
  41490. * },
  41491. * {
  41492. * key: /^border.*$/, // Match any border style.
  41493. * value: true // Match any value.
  41494. * }
  41495. * ]
  41496. * };
  41497. *
  41498. * Matching view element classes:
  41499. *
  41500. * // Match view element with any class.
  41501. * const pattern = {
  41502. * name: 'p',
  41503. * classes: true
  41504. * };
  41505. *
  41506. * // Match view element which has matching class (String).
  41507. * const pattern = {
  41508. * name: 'p',
  41509. * classes: 'highlighted' // Match `highlighted` class.
  41510. * };
  41511. *
  41512. * // Match view element which has matching classes (RegExp).
  41513. * const pattern = {
  41514. * name: 'figure',
  41515. * classes: /^image-side-(left|right)$/ // Match `image-side-left` or `image-side-right` class.
  41516. * };
  41517. *
  41518. * // Match view element which has matching classes (Object).
  41519. * const pattern = {
  41520. * name: 'p',
  41521. * classes: {
  41522. * highlighted: true, // Match `highlighted` class.
  41523. * marker: true // Match `marker` class.
  41524. * }
  41525. * };
  41526. *
  41527. * // Match view element which has matching classes (Array).
  41528. * const pattern = {
  41529. * name: 'figure',
  41530. * classes: [
  41531. * 'image', // Match `image` class.
  41532. * /^image-side-(left|right)$/ // Match `image-side-left` or `image-side-right` class.
  41533. * ]
  41534. * };
  41535. *
  41536. * // Match view element which has matching classes (key-value pairs).
  41537. * const pattern = {
  41538. * name: 'figure',
  41539. * classes: [
  41540. * {
  41541. * key: 'image', // Match `image` class.
  41542. * value: true
  41543. * },
  41544. * {
  41545. * key: /^image-side-(left|right)$/, // Match `image-side-left` or `image-side-right` class.
  41546. * value: true
  41547. * }
  41548. * ]
  41549. * };
  41550. *
  41551. * Pattern can combine multiple properties allowing for more complex view element matching:
  41552. *
  41553. * const pattern = {
  41554. * name: 'span',
  41555. * attributes: [ 'title' ],
  41556. * styles: {
  41557. * 'font-weight': 'bold'
  41558. * },
  41559. * classes: 'highlighted'
  41560. * };
  41561. *
  41562. * If `MatcherPattern` is given as a `Function`, the function takes a view element as a first and only parameter and
  41563. * the function should decide whether that element matches. If so, it should return what part of the view element has been matched.
  41564. * Otherwise, the function should return `null`. The returned result will be included in `match` property of the object
  41565. * returned by {@link ~Matcher#match} call.
  41566. *
  41567. * // Match an empty <div> element.
  41568. * const pattern = element => {
  41569. * if ( element.name == 'div' && element.childCount > 0 ) {
  41570. * // Return which part of the element was matched.
  41571. * return { name: true };
  41572. * }
  41573. *
  41574. * return null;
  41575. * };
  41576. *
  41577. * // Match a <p> element with big font ("heading-like" element).
  41578. * const pattern = element => {
  41579. * if ( element.name == 'p' ) {
  41580. * const fontSize = element.getStyle( 'font-size' );
  41581. * const size = fontSize.match( /(\d+)/px );
  41582. *
  41583. * if ( size && Number( size[ 1 ] ) > 26 ) {
  41584. * return { name: true, attribute: [ 'font-size' ] };
  41585. * }
  41586. * }
  41587. *
  41588. * return null;
  41589. * };
  41590. *
  41591. * `MatcherPattern` is defined in a way that it is a superset of {@link module:engine/view/elementdefinition~ElementDefinition},
  41592. * that is, every `ElementDefinition` also can be used as a `MatcherPattern`.
  41593. *
  41594. * @typedef {String|RegExp|Object|Function} module:engine/view/matcher~MatcherPattern
  41595. *
  41596. * @property {String|RegExp} [name] View element name to match.
  41597. * @property {Boolean|String|RegExp|Object|Array.<String|RegExp|Object>} [classes] View element's classes to match.
  41598. * @property {Boolean|String|RegExp|Object|Array.<String|RegExp|Object>} [styles] View element's styles to match.
  41599. * @property {Boolean|String|RegExp|Object|Array.<String|RegExp|Object>} [attributes] View element's attributes to match.
  41600. */
  41601. /**
  41602. * The key-value matcher pattern is missing key or value. Both must be present.
  41603. * Refer the documentation: {@link module:engine/view/matcher~MatcherPattern}.
  41604. *
  41605. * @param {Object} pattern Pattern with missing properties.
  41606. * @error matcher-pattern-missing-key-or-value
  41607. */
  41608. /**
  41609. * The key-value matcher pattern for `attributes` option is using deprecated `style` key.
  41610. *
  41611. * Use `styles` matcher pattern option instead:
  41612. *
  41613. * // Instead of:
  41614. * const pattern = {
  41615. * attributes: {
  41616. * key1: 'value1',
  41617. * key2: 'value2',
  41618. * style: /^border.*$/
  41619. * }
  41620. * }
  41621. *
  41622. * // Use:
  41623. * const pattern = {
  41624. * attributes: {
  41625. * key1: 'value1',
  41626. * key2: 'value2'
  41627. * },
  41628. * styles: /^border.*$/
  41629. * }
  41630. *
  41631. * Refer to the {@glink builds/guides/migration/migration-to-29##migration-to-ckeditor-5-v2910 Migration to v29.1.0} guide
  41632. * and {@link module:engine/view/matcher~MatcherPattern} documentation.
  41633. *
  41634. * @param {Object} pattern Pattern with missing properties.
  41635. * @error matcher-pattern-deprecated-attributes-style-key
  41636. */
  41637. /**
  41638. * The key-value matcher pattern for `attributes` option is using deprecated `class` key.
  41639. *
  41640. * Use `classes` matcher pattern option instead:
  41641. *
  41642. * // Instead of:
  41643. * const pattern = {
  41644. * attributes: {
  41645. * key1: 'value1',
  41646. * key2: 'value2',
  41647. * class: 'foobar'
  41648. * }
  41649. * }
  41650. *
  41651. * // Use:
  41652. * const pattern = {
  41653. * attributes: {
  41654. * key1: 'value1',
  41655. * key2: 'value2'
  41656. * },
  41657. * classes: 'foobar'
  41658. * }
  41659. *
  41660. * Refer to the {@glink builds/guides/migration/migration-to-29##migration-to-ckeditor-5-v2910 Migration to v29.1.0} guide
  41661. * and the {@link module:engine/view/matcher~MatcherPattern} documentation.
  41662. *
  41663. * @param {Object} pattern Pattern with missing properties.
  41664. * @error matcher-pattern-deprecated-attributes-class-key
  41665. */
  41666. /***/ }),
  41667. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js":
  41668. /*!******************************************************************!*\
  41669. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js ***!
  41670. \******************************************************************/
  41671. /*! exports provided: default */
  41672. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41673. "use strict";
  41674. __webpack_require__.r(__webpack_exports__);
  41675. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Node; });
  41676. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  41677. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  41678. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  41679. /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
  41680. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  41681. /* harmony import */ var _ckeditor_ckeditor5_utils_src_version__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
  41682. /**
  41683. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  41684. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  41685. */
  41686. /**
  41687. * @module engine/view/node
  41688. */
  41689. // To check if component is loaded more than once.
  41690. /**
  41691. * Abstract view node class.
  41692. *
  41693. * This is an abstract class. Its constructor should not be used directly.
  41694. * Use the {@link module:engine/view/downcastwriter~DowncastWriter} or {@link module:engine/view/upcastwriter~UpcastWriter}
  41695. * to create new instances of view nodes.
  41696. *
  41697. * @abstract
  41698. */
  41699. class Node {
  41700. /**
  41701. * Creates a tree view node.
  41702. *
  41703. * @protected
  41704. * @param {module:engine/view/document~Document} document The document instance to which this node belongs.
  41705. */
  41706. constructor( document ) {
  41707. /**
  41708. * The document instance to which this node belongs.
  41709. *
  41710. * @readonly
  41711. * @member {module:engine/view/document~Document}
  41712. */
  41713. this.document = document;
  41714. /**
  41715. * Parent element. Null by default. Set by {@link module:engine/view/element~Element#_insertChild}.
  41716. *
  41717. * @readonly
  41718. * @member {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment|null}
  41719. */
  41720. this.parent = null;
  41721. }
  41722. /**
  41723. * Index of the node in the parent element or null if the node has no parent.
  41724. *
  41725. * Accessing this property throws an error if this node's parent element does not contain it.
  41726. * This means that view tree got broken.
  41727. *
  41728. * @readonly
  41729. * @type {Number|null}
  41730. */
  41731. get index() {
  41732. let pos;
  41733. if ( !this.parent ) {
  41734. return null;
  41735. }
  41736. // No parent or child doesn't exist in parent's children.
  41737. if ( ( pos = this.parent.getChildIndex( this ) ) == -1 ) {
  41738. /**
  41739. * The node's parent does not contain this node. It means that the document tree is corrupted.
  41740. *
  41741. * @error view-node-not-found-in-parent
  41742. */
  41743. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-node-not-found-in-parent', this );
  41744. }
  41745. return pos;
  41746. }
  41747. /**
  41748. * Node's next sibling, or `null` if it is the last child.
  41749. *
  41750. * @readonly
  41751. * @type {module:engine/view/node~Node|null}
  41752. */
  41753. get nextSibling() {
  41754. const index = this.index;
  41755. return ( index !== null && this.parent.getChild( index + 1 ) ) || null;
  41756. }
  41757. /**
  41758. * Node's previous sibling, or `null` if it is the first child.
  41759. *
  41760. * @readonly
  41761. * @type {module:engine/view/node~Node|null}
  41762. */
  41763. get previousSibling() {
  41764. const index = this.index;
  41765. return ( index !== null && this.parent.getChild( index - 1 ) ) || null;
  41766. }
  41767. /**
  41768. * Top-most ancestor of the node. If the node has no parent it is the root itself.
  41769. *
  41770. * @readonly
  41771. * @type {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
  41772. */
  41773. get root() {
  41774. let root = this; // eslint-disable-line consistent-this
  41775. while ( root.parent ) {
  41776. root = root.parent;
  41777. }
  41778. return root;
  41779. }
  41780. /**
  41781. * Returns true if the node is in a tree rooted in the document (is a descendant of one of its roots).
  41782. *
  41783. * @returns {Boolean}
  41784. */
  41785. isAttached() {
  41786. return this.root.is( 'rootElement' );
  41787. }
  41788. /**
  41789. * Gets a path to the node. The path is an array containing indices of consecutive ancestors of this node,
  41790. * beginning from {@link module:engine/view/node~Node#root root}, down to this node's index.
  41791. *
  41792. * const abc = downcastWriter.createText( 'abc' );
  41793. * const foo = downcastWriter.createText( 'foo' );
  41794. * const h1 = downcastWriter.createElement( 'h1', null, downcastWriter.createText( 'header' ) );
  41795. * const p = downcastWriter.createElement( 'p', null, [ abc, foo ] );
  41796. * const div = downcastWriter.createElement( 'div', null, [ h1, p ] );
  41797. * foo.getPath(); // Returns [ 1, 3 ]. `foo` is in `p` which is in `div`. `p` starts at offset 1, while `foo` at 3.
  41798. * h1.getPath(); // Returns [ 0 ].
  41799. * div.getPath(); // Returns [].
  41800. *
  41801. * @returns {Array.<Number>} The path.
  41802. */
  41803. getPath() {
  41804. const path = [];
  41805. let node = this; // eslint-disable-line consistent-this
  41806. while ( node.parent ) {
  41807. path.unshift( node.index );
  41808. node = node.parent;
  41809. }
  41810. return path;
  41811. }
  41812. /**
  41813. * Returns ancestors array of this node.
  41814. *
  41815. * @param {Object} options Options object.
  41816. * @param {Boolean} [options.includeSelf=false] When set to `true` this node will be also included in parent's array.
  41817. * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from node's parent to root element,
  41818. * otherwise root element will be the first item in the array.
  41819. * @returns {Array} Array with ancestors.
  41820. */
  41821. getAncestors( options = { includeSelf: false, parentFirst: false } ) {
  41822. const ancestors = [];
  41823. let parent = options.includeSelf ? this : this.parent;
  41824. while ( parent ) {
  41825. ancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );
  41826. parent = parent.parent;
  41827. }
  41828. return ancestors;
  41829. }
  41830. /**
  41831. * Returns a {@link module:engine/view/element~Element} or {@link module:engine/view/documentfragment~DocumentFragment}
  41832. * which is a common ancestor of both nodes.
  41833. *
  41834. * @param {module:engine/view/node~Node} node The second node.
  41835. * @param {Object} options Options object.
  41836. * @param {Boolean} [options.includeSelf=false] When set to `true` both nodes will be considered "ancestors" too.
  41837. * Which means that if e.g. node A is inside B, then their common ancestor will be B.
  41838. * @returns {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment|null}
  41839. */
  41840. getCommonAncestor( node, options = {} ) {
  41841. const ancestorsA = this.getAncestors( options );
  41842. const ancestorsB = node.getAncestors( options );
  41843. let i = 0;
  41844. while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
  41845. i++;
  41846. }
  41847. return i === 0 ? null : ancestorsA[ i - 1 ];
  41848. }
  41849. /**
  41850. * Returns whether this node is before given node. `false` is returned if nodes are in different trees (for example,
  41851. * in different {@link module:engine/view/documentfragment~DocumentFragment}s).
  41852. *
  41853. * @param {module:engine/view/node~Node} node Node to compare with.
  41854. * @returns {Boolean}
  41855. */
  41856. isBefore( node ) {
  41857. // Given node is not before this node if they are same.
  41858. if ( this == node ) {
  41859. return false;
  41860. }
  41861. // Return `false` if it is impossible to compare nodes.
  41862. if ( this.root !== node.root ) {
  41863. return false;
  41864. }
  41865. const thisPath = this.getPath();
  41866. const nodePath = node.getPath();
  41867. const result = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__["default"])( thisPath, nodePath );
  41868. switch ( result ) {
  41869. case 'prefix':
  41870. return true;
  41871. case 'extension':
  41872. return false;
  41873. default:
  41874. return thisPath[ result ] < nodePath[ result ];
  41875. }
  41876. }
  41877. /**
  41878. * Returns whether this node is after given node. `false` is returned if nodes are in different trees (for example,
  41879. * in different {@link module:engine/view/documentfragment~DocumentFragment}s).
  41880. *
  41881. * @param {module:engine/view/node~Node} node Node to compare with.
  41882. * @returns {Boolean}
  41883. */
  41884. isAfter( node ) {
  41885. // Given node is not before this node if they are same.
  41886. if ( this == node ) {
  41887. return false;
  41888. }
  41889. // Return `false` if it is impossible to compare nodes.
  41890. if ( this.root !== node.root ) {
  41891. return false;
  41892. }
  41893. // In other cases, just check if the `node` is before, and return the opposite.
  41894. return !this.isBefore( node );
  41895. }
  41896. /**
  41897. * Removes node from parent.
  41898. *
  41899. * @protected
  41900. */
  41901. _remove() {
  41902. this.parent._removeChildren( this.index );
  41903. }
  41904. /**
  41905. * @protected
  41906. * @param {module:engine/view/document~ChangeType} type Type of the change.
  41907. * @param {module:engine/view/node~Node} node Changed node.
  41908. * @fires change
  41909. */
  41910. _fireChange( type, node ) {
  41911. this.fire( 'change:' + type, node );
  41912. if ( this.parent ) {
  41913. this.parent._fireChange( type, node );
  41914. }
  41915. }
  41916. /**
  41917. * Custom toJSON method to solve child-parent circular dependencies.
  41918. *
  41919. * @returns {Object} Clone of this object with the parent property removed.
  41920. */
  41921. toJSON() {
  41922. const json = Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["clone"])( this );
  41923. // Due to circular references we need to remove parent reference.
  41924. delete json.parent;
  41925. return json;
  41926. }
  41927. /**
  41928. * Checks whether this object is of the given type.
  41929. *
  41930. * This method is useful when processing view objects that are of unknown type. For example, a function
  41931. * may return a {@link module:engine/view/documentfragment~DocumentFragment} or a {@link module:engine/view/node~Node}
  41932. * that can be either a text node or an element. This method can be used to check what kind of object is returned.
  41933. *
  41934. * someObject.is( 'element' ); // -> true if this is an element
  41935. * someObject.is( 'node' ); // -> true if this is a node (a text node or an element)
  41936. * someObject.is( 'documentFragment' ); // -> true if this is a document fragment
  41937. *
  41938. * Since this method is also available on a range of model objects, you can prefix the type of the object with
  41939. * `model:` or `view:` to check, for example, if this is the model's or view's element:
  41940. *
  41941. * viewElement.is( 'view:element' ); // -> true
  41942. * viewElement.is( 'model:element' ); // -> false
  41943. *
  41944. * By using this method it is also possible to check a name of an element:
  41945. *
  41946. * imgElement.is( 'element', 'img' ); // -> true
  41947. * imgElement.is( 'view:element', 'img' ); // -> same as above, but more precise
  41948. *
  41949. * The list of view objects which implement the `is()` method:
  41950. *
  41951. * * {@link module:engine/view/attributeelement~AttributeElement#is `AttributeElement#is()`}
  41952. * * {@link module:engine/view/containerelement~ContainerElement#is `ContainerElement#is()`}
  41953. * * {@link module:engine/view/documentfragment~DocumentFragment#is `DocumentFragment#is()`}
  41954. * * {@link module:engine/view/documentselection~DocumentSelection#is `DocumentSelection#is()`}
  41955. * * {@link module:engine/view/editableelement~EditableElement#is `EditableElement#is()`}
  41956. * * {@link module:engine/view/element~Element#is `Element#is()`}
  41957. * * {@link module:engine/view/emptyelement~EmptyElement#is `EmptyElement#is()`}
  41958. * * {@link module:engine/view/node~Node#is `Node#is()`}
  41959. * * {@link module:engine/view/position~Position#is `Position#is()`}
  41960. * * {@link module:engine/view/range~Range#is `Range#is()`}
  41961. * * {@link module:engine/view/rooteditableelement~RootEditableElement#is `RootEditableElement#is()`}
  41962. * * {@link module:engine/view/selection~Selection#is `Selection#is()`}
  41963. * * {@link module:engine/view/text~Text#is `Text#is()`}
  41964. * * {@link module:engine/view/textproxy~TextProxy#is `TextProxy#is()`}
  41965. * * {@link module:engine/view/uielement~UIElement#is `UIElement#is()`}
  41966. *
  41967. * @method #is
  41968. * @param {String} type Type to check.
  41969. * @returns {Boolean}
  41970. */
  41971. is( type ) {
  41972. return type === 'node' || type === 'view:node';
  41973. }
  41974. /**
  41975. * Clones this node.
  41976. *
  41977. * @protected
  41978. * @method #_clone
  41979. * @returns {module:engine/view/node~Node} Clone of this node.
  41980. */
  41981. /**
  41982. * Checks if provided node is similar to this node.
  41983. *
  41984. * @method #isSimilar
  41985. * @returns {Boolean} True if nodes are similar.
  41986. */
  41987. }
  41988. /**
  41989. * Fired when list of {@link module:engine/view/element~Element elements} children changes.
  41990. *
  41991. * Change event is bubbled – it is fired on all ancestors.
  41992. *
  41993. * @event change:children
  41994. * @param {module:engine/view/node~Node} changedNode
  41995. */
  41996. /**
  41997. * Fired when list of {@link module:engine/view/element~Element elements} attributes changes.
  41998. *
  41999. * Change event is bubbled – it is fired on all ancestors.
  42000. *
  42001. * @event change:attributes
  42002. * @param {module:engine/view/node~Node} changedNode
  42003. */
  42004. /**
  42005. * Fired when {@link module:engine/view/text~Text text nodes} data changes.
  42006. *
  42007. * Change event is bubbled – it is fired on all ancestors.
  42008. *
  42009. * @event change:text
  42010. * @param {module:engine/view/node~Node} changedNode
  42011. */
  42012. /**
  42013. * @event change
  42014. */
  42015. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( Node, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  42016. /***/ }),
  42017. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/arrowkeysobserver.js":
  42018. /*!****************************************************************************************!*\
  42019. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/arrowkeysobserver.js ***!
  42020. \****************************************************************************************/
  42021. /*! exports provided: default */
  42022. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42023. "use strict";
  42024. __webpack_require__.r(__webpack_exports__);
  42025. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ArrowKeysObserver; });
  42026. /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  42027. /* harmony import */ var _bubblingeventinfo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bubblingeventinfo */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js");
  42028. /* harmony import */ var _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils */ "./node_modules/@ckeditor/ckeditor5-utils/src/index.js");
  42029. /**
  42030. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  42031. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  42032. */
  42033. /**
  42034. * @module engine/view/observer/arrowkeysobserver
  42035. */
  42036. /**
  42037. * Arrow keys observer introduces the {@link module:engine/view/document~Document#event:arrowKey `Document#arrowKey`} event.
  42038. *
  42039. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  42040. *
  42041. * @extends module:engine/view/observer/observer~Observer
  42042. */
  42043. class ArrowKeysObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  42044. /**
  42045. * @inheritDoc
  42046. */
  42047. constructor( view ) {
  42048. super( view );
  42049. this.document.on( 'keydown', ( event, data ) => {
  42050. if ( this.isEnabled && Object(_ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_2__["isArrowKeyCode"])( data.keyCode ) ) {
  42051. const eventInfo = new _bubblingeventinfo__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document, 'arrowKey', this.document.selection.getFirstRange() );
  42052. this.document.fire( eventInfo, data );
  42053. if ( eventInfo.stop.called ) {
  42054. event.stop();
  42055. }
  42056. }
  42057. } );
  42058. }
  42059. /**
  42060. * @inheritDoc
  42061. */
  42062. observe() {}
  42063. }
  42064. /**
  42065. * Event fired when the user presses an arrow keys.
  42066. *
  42067. * Introduced by {@link module:engine/view/observer/arrowkeysobserver~ArrowKeysObserver}.
  42068. *
  42069. * Note that because {@link module:engine/view/observer/arrowkeysobserver~ArrowKeysObserver} is attached by the
  42070. * {@link module:engine/view/view~View} this event is available by default.
  42071. *
  42072. * @event module:engine/view/document~Document#event:arrowKey
  42073. * @param {module:engine/view/observer/domeventdata~DomEventData} data
  42074. */
  42075. /***/ }),
  42076. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js":
  42077. /*!*******************************************************************************************!*\
  42078. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js ***!
  42079. \*******************************************************************************************/
  42080. /*! exports provided: default */
  42081. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42082. "use strict";
  42083. __webpack_require__.r(__webpack_exports__);
  42084. /* harmony import */ var _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/eventinfo */ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js");
  42085. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  42086. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  42087. /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
  42088. /* harmony import */ var _bubblingeventinfo__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bubblingeventinfo */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js");
  42089. /**
  42090. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  42091. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  42092. */
  42093. /**
  42094. * @module engine/view/observer/bubblingemittermixin
  42095. */
  42096. const contextsSymbol = Symbol( 'bubbling contexts' );
  42097. /**
  42098. * Bubbling emitter mixin for the view document as described in the
  42099. * {@link ~BubblingEmitter} interface.
  42100. *
  42101. * @mixin BubblingEmitterMixin
  42102. * @implements module:engine/view/observer/bubblingemittermixin~BubblingEmitter
  42103. */
  42104. const BubblingEmitterMixin = {
  42105. /**
  42106. * @inheritDoc
  42107. */
  42108. fire( eventOrInfo, ...eventArgs ) {
  42109. try {
  42110. const eventInfo = eventOrInfo instanceof _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"] ? eventOrInfo : new _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"]( this, eventOrInfo );
  42111. const eventContexts = getBubblingContexts( this );
  42112. if ( !eventContexts.size ) {
  42113. return;
  42114. }
  42115. updateEventInfo( eventInfo, 'capturing', this );
  42116. // The capture phase of the event.
  42117. if ( fireListenerFor( eventContexts, '$capture', eventInfo, ...eventArgs ) ) {
  42118. return eventInfo.return;
  42119. }
  42120. const startRange = eventInfo.startRange || this.selection.getFirstRange();
  42121. const selectedElement = startRange ? startRange.getContainedElement() : null;
  42122. const isCustomContext = selectedElement ? Boolean( getCustomContext( eventContexts, selectedElement ) ) : false;
  42123. let node = selectedElement || getDeeperRangeParent( startRange );
  42124. updateEventInfo( eventInfo, 'atTarget', node );
  42125. // For the not yet bubbling event trigger for $text node if selection can be there and it's not a custom context selected.
  42126. if ( !isCustomContext ) {
  42127. if ( fireListenerFor( eventContexts, '$text', eventInfo, ...eventArgs ) ) {
  42128. return eventInfo.return;
  42129. }
  42130. updateEventInfo( eventInfo, 'bubbling', node );
  42131. }
  42132. while ( node ) {
  42133. // Root node handling.
  42134. if ( node.is( 'rootElement' ) ) {
  42135. if ( fireListenerFor( eventContexts, '$root', eventInfo, ...eventArgs ) ) {
  42136. return eventInfo.return;
  42137. }
  42138. }
  42139. // Element node handling.
  42140. else if ( node.is( 'element' ) ) {
  42141. if ( fireListenerFor( eventContexts, node.name, eventInfo, ...eventArgs ) ) {
  42142. return eventInfo.return;
  42143. }
  42144. }
  42145. // Check custom contexts (i.e., a widget).
  42146. if ( fireListenerFor( eventContexts, node, eventInfo, ...eventArgs ) ) {
  42147. return eventInfo.return;
  42148. }
  42149. node = node.parent;
  42150. updateEventInfo( eventInfo, 'bubbling', node );
  42151. }
  42152. updateEventInfo( eventInfo, 'bubbling', this );
  42153. // Document context.
  42154. fireListenerFor( eventContexts, '$document', eventInfo, ...eventArgs );
  42155. return eventInfo.return;
  42156. } catch ( err ) {
  42157. // @if CK_DEBUG // throw err;
  42158. /* istanbul ignore next */
  42159. _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"].rethrowUnexpectedError( err, this );
  42160. }
  42161. },
  42162. /**
  42163. * @inheritDoc
  42164. */
  42165. _addEventListener( event, callback, options ) {
  42166. const contexts = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_3__["default"])( options.context || '$document' );
  42167. const eventContexts = getBubblingContexts( this );
  42168. for ( const context of contexts ) {
  42169. let emitter = eventContexts.get( context );
  42170. if ( !emitter ) {
  42171. emitter = Object.create( _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  42172. eventContexts.set( context, emitter );
  42173. }
  42174. this.listenTo( emitter, event, callback, options );
  42175. }
  42176. },
  42177. /**
  42178. * @inheritDoc
  42179. */
  42180. _removeEventListener( event, callback ) {
  42181. const eventContexts = getBubblingContexts( this );
  42182. for ( const emitter of eventContexts.values() ) {
  42183. this.stopListening( emitter, event, callback );
  42184. }
  42185. }
  42186. };
  42187. /* harmony default export */ __webpack_exports__["default"] = (BubblingEmitterMixin);
  42188. // Update the event info bubbling fields.
  42189. //
  42190. // @param {module:utils/eventinfo~EventInfo} eventInfo The event info object to update.
  42191. // @param {'none'|'capturing'|'atTarget'|'bubbling'} eventPhase The current event phase.
  42192. // @param {module:engine/view/document~Document|module:engine/view/node~Node} currentTarget The current bubbling target.
  42193. function updateEventInfo( eventInfo, eventPhase, currentTarget ) {
  42194. if ( eventInfo instanceof _bubblingeventinfo__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  42195. eventInfo._eventPhase = eventPhase;
  42196. eventInfo._currentTarget = currentTarget;
  42197. }
  42198. }
  42199. // Fires the listener for the specified context. Returns `true` if event was stopped.
  42200. //
  42201. // @private
  42202. // @param {Map.<String|Function, module:utils/emittermixin~Emitter>} eventContexts
  42203. // @param {String|module:engine/view/node~Node} context
  42204. // @param {module:utils/eventinfo~EventInfo} eventInfo The `EventInfo` object.
  42205. // @param {...*} [eventArgs] Additional arguments to be passed to the callbacks.
  42206. // @returns {Boolean} True if event stop was called.
  42207. function fireListenerFor( eventContexts, context, eventInfo, ...eventArgs ) {
  42208. const emitter = typeof context == 'string' ? eventContexts.get( context ) : getCustomContext( eventContexts, context );
  42209. if ( !emitter ) {
  42210. return false;
  42211. }
  42212. emitter.fire( eventInfo, ...eventArgs );
  42213. return eventInfo.stop.called;
  42214. }
  42215. // Returns an emitter for a specified view node.
  42216. //
  42217. // @private
  42218. // @param {Map.<String|Function, module:utils/emittermixin~Emitter>} eventContexts
  42219. // @param {module:engine/view/node~Node} node
  42220. // @returns {module:utils/emittermixin~Emitter|null}
  42221. function getCustomContext( eventContexts, node ) {
  42222. for ( const [ context, emitter ] of eventContexts ) {
  42223. if ( typeof context == 'function' && context( node ) ) {
  42224. return emitter;
  42225. }
  42226. }
  42227. return null;
  42228. }
  42229. // Returns bubbling contexts map for the source (emitter).
  42230. function getBubblingContexts( source ) {
  42231. if ( !source[ contextsSymbol ] ) {
  42232. source[ contextsSymbol ] = new Map();
  42233. }
  42234. return source[ contextsSymbol ];
  42235. }
  42236. // Returns the deeper parent element for the range.
  42237. function getDeeperRangeParent( range ) {
  42238. if ( !range ) {
  42239. return null;
  42240. }
  42241. const startParent = range.start.parent;
  42242. const endParent = range.end.parent;
  42243. const startPath = startParent.getPath();
  42244. const endPath = endParent.getPath();
  42245. return startPath.length > endPath.length ? startParent : endParent;
  42246. }
  42247. /**
  42248. * Bubbling emitter for the view document.
  42249. *
  42250. * Bubbling emitter is triggering events in the context of specified {@link module:engine/view/element~Element view element} name,
  42251. * predefined `'$text'`, `'$root'`, `'$document'` and `'$capture'` contexts, and context matchers provided as a function.
  42252. *
  42253. * Before bubbling starts, listeners for `'$capture'` context are triggered. Then the bubbling starts from the deeper selection
  42254. * position (by firing event on the `'$text'` context) and propagates the view document tree up to the `'$root'` and finally
  42255. * the listeners at `'$document'` context are fired (this is the default context).
  42256. *
  42257. * Examples:
  42258. *
  42259. * // Listeners registered in the context of the view element names:
  42260. * this.listenTo( viewDocument, 'enter', ( evt, data ) => {
  42261. * // ...
  42262. * }, { context: 'blockquote' } );
  42263. *
  42264. * this.listenTo( viewDocument, 'enter', ( evt, data ) => {
  42265. * // ...
  42266. * }, { context: 'li' } );
  42267. *
  42268. * // Listeners registered in the context of the '$text' and '$root' nodes.
  42269. * this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
  42270. * // ...
  42271. * }, { context: '$text', priority: 'high' } );
  42272. *
  42273. * this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
  42274. * // ...
  42275. * }, { context: '$root' } );
  42276. *
  42277. * // Listeners registered in the context of custom callback function.
  42278. * this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
  42279. * // ...
  42280. * }, { context: isWidget } );
  42281. *
  42282. * this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
  42283. * // ...
  42284. * }, { context: isWidget, priority: 'high' } );
  42285. *
  42286. * Example flow for selection in text:
  42287. *
  42288. * <blockquote><p>Foo[]bar</p></blockquote>
  42289. *
  42290. * Fired events on contexts:
  42291. * 1. `'$capture'`
  42292. * 2. `'$text'`
  42293. * 3. `'p'`
  42294. * 4. `'blockquote'`
  42295. * 5. `'$root'`
  42296. * 6. `'$document'`
  42297. *
  42298. * Example flow for selection on element (i.e., Widget):
  42299. *
  42300. * <blockquote><p>Foo[<widget/>]bar</p></blockquote>
  42301. *
  42302. * Fired events on contexts:
  42303. * 1. `'$capture'`
  42304. * 2. *widget* (custom matcher)
  42305. * 3. `'p'`
  42306. * 4. `'blockquote'`
  42307. * 5. `'$root'`
  42308. * 6. `'$document'`
  42309. *
  42310. * There could be multiple listeners registered for the same context and at different priority levels:
  42311. *
  42312. * <p>Foo[]bar</p>
  42313. *
  42314. * 1. `'$capture'` at priorities:
  42315. * 1. `'highest'`
  42316. * 2. `'high'`
  42317. * 3. `'normal'`
  42318. * 4. `'low'`
  42319. * 5. `'lowest'`
  42320. * 2. `'$text'` at priorities:
  42321. * 1. `'highest'`
  42322. * 2. `'high'`
  42323. * 3. `'normal'`
  42324. * 4. `'low'`
  42325. * 5. `'lowest'`
  42326. * 3. `'p'` at priorities:
  42327. * 1. `'highest'`
  42328. * 2. `'high'`
  42329. * 3. `'normal'`
  42330. * 4. `'low'`
  42331. * 5. `'lowest'`
  42332. * 4. `'$root'` at priorities:
  42333. * 1. `'highest'`
  42334. * 2. `'high'`
  42335. * 3. `'normal'`
  42336. * 4. `'low'`
  42337. * 5. `'lowest'`
  42338. * 5. `'$document'` at priorities:
  42339. * 1. `'highest'`
  42340. * 2. `'high'`
  42341. * 3. `'normal'`
  42342. * 4. `'low'`
  42343. * 5. `'lowest'`
  42344. *
  42345. * @interface BubblingEmitter
  42346. * @extends module:utils/emittermixin~Emitter
  42347. */
  42348. /***/ }),
  42349. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js":
  42350. /*!****************************************************************************************!*\
  42351. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js ***!
  42352. \****************************************************************************************/
  42353. /*! exports provided: default */
  42354. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42355. "use strict";
  42356. __webpack_require__.r(__webpack_exports__);
  42357. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BubblingEventInfo; });
  42358. /* harmony import */ var _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/eventinfo */ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js");
  42359. /**
  42360. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  42361. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  42362. */
  42363. /**
  42364. * @module engine/view/observer/bubblingeventinfo
  42365. */
  42366. /**
  42367. * The event object passed to bubbling event callbacks. It is used to provide information about the event as well as a tool to
  42368. * manipulate it.
  42369. *
  42370. * @extends module:utils/eventinfo~EventInfo
  42371. */
  42372. class BubblingEventInfo extends _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"] {
  42373. /**
  42374. * @param {Object} source The emitter.
  42375. * @param {String} name The event name.
  42376. * @param {module:engine/view/range~Range} startRange The view range that the bubbling should start from.
  42377. */
  42378. constructor( source, name, startRange ) {
  42379. super( source, name );
  42380. /**
  42381. * The view range that the bubbling should start from.
  42382. *
  42383. * @readonly
  42384. * @member {module:engine/view/range~Range}
  42385. */
  42386. this.startRange = startRange;
  42387. /**
  42388. * The current event phase.
  42389. *
  42390. * @protected
  42391. * @member {'none'|'capturing'|'atTarget'|'bubbling'}
  42392. */
  42393. this._eventPhase = 'none';
  42394. /**
  42395. * The current bubbling target.
  42396. *
  42397. * @protected
  42398. * @member {module:engine/view/document~Document|module:engine/view/node~Node|null}
  42399. */
  42400. this._currentTarget = null;
  42401. }
  42402. /**
  42403. * The current event phase.
  42404. *
  42405. * @readonly
  42406. * @member {'none'|'capturing'|'atTarget'|'bubbling'}
  42407. */
  42408. get eventPhase() {
  42409. return this._eventPhase;
  42410. }
  42411. /**
  42412. * The current bubbling target.
  42413. *
  42414. * @readonly
  42415. * @member {module:engine/view/document~Document|module:engine/view/node~Node|null}
  42416. */
  42417. get currentTarget() {
  42418. return this._currentTarget;
  42419. }
  42420. }
  42421. /***/ }),
  42422. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.js":
  42423. /*!************************************************************************************!*\
  42424. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.js ***!
  42425. \************************************************************************************/
  42426. /*! exports provided: default */
  42427. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42428. "use strict";
  42429. __webpack_require__.r(__webpack_exports__);
  42430. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClickObserver; });
  42431. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  42432. /**
  42433. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  42434. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  42435. */
  42436. /**
  42437. * @module engine/view/observer/clickobserver
  42438. */
  42439. /**
  42440. * {@link module:engine/view/document~Document#event:click Click} event observer.
  42441. *
  42442. * Note that this observer is not available by default. To make it available it needs to be added to
  42443. * {@link module:engine/view/view~View view controller}
  42444. * by a {@link module:engine/view/view~View#addObserver} method.
  42445. *
  42446. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  42447. */
  42448. class ClickObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  42449. constructor( view ) {
  42450. super( view );
  42451. this.domEventType = 'click';
  42452. }
  42453. onDomEvent( domEvent ) {
  42454. this.fire( domEvent.type, domEvent );
  42455. }
  42456. }
  42457. /**
  42458. * Fired when one of the editables has been clicked.
  42459. *
  42460. * Introduced by {@link module:engine/view/observer/clickobserver~ClickObserver}.
  42461. *
  42462. * Note that this event is not available by default. To make it available
  42463. * {@link module:engine/view/observer/clickobserver~ClickObserver} needs to be added
  42464. * to {@link module:engine/view/view~View} by a {@link module:engine/view/view~View#addObserver} method.
  42465. *
  42466. * @see module:engine/view/observer/clickobserver~ClickObserver
  42467. * @event module:engine/view/document~Document#event:click
  42468. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  42469. */
  42470. /***/ }),
  42471. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/compositionobserver.js":
  42472. /*!******************************************************************************************!*\
  42473. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/compositionobserver.js ***!
  42474. \******************************************************************************************/
  42475. /*! exports provided: default */
  42476. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42477. "use strict";
  42478. __webpack_require__.r(__webpack_exports__);
  42479. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CompositionObserver; });
  42480. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  42481. /**
  42482. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  42483. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  42484. */
  42485. /**
  42486. * @module engine/view/observer/compositionobserver
  42487. */
  42488. /**
  42489. * {@link module:engine/view/document~Document#event:compositionstart Compositionstart},
  42490. * {@link module:engine/view/document~Document#event:compositionupdate compositionupdate} and
  42491. * {@link module:engine/view/document~Document#event:compositionend compositionend} events observer.
  42492. *
  42493. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  42494. *
  42495. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  42496. */
  42497. class CompositionObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  42498. constructor( view ) {
  42499. super( view );
  42500. this.domEventType = [ 'compositionstart', 'compositionupdate', 'compositionend' ];
  42501. const document = this.document;
  42502. document.on( 'compositionstart', () => {
  42503. document.isComposing = true;
  42504. } );
  42505. document.on( 'compositionend', () => {
  42506. document.isComposing = false;
  42507. } );
  42508. }
  42509. onDomEvent( domEvent ) {
  42510. this.fire( domEvent.type, domEvent );
  42511. }
  42512. }
  42513. /**
  42514. * Fired when composition starts inside one of the editables.
  42515. *
  42516. * Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
  42517. *
  42518. * Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the
  42519. * {@link module:engine/view/view~View} this event is available by default.
  42520. *
  42521. * @see module:engine/view/observer/compositionobserver~CompositionObserver
  42522. * @event module:engine/view/document~Document#event:compositionstart
  42523. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  42524. */
  42525. /**
  42526. * Fired when composition is updated inside one of the editables.
  42527. *
  42528. * Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
  42529. *
  42530. * Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the
  42531. * {@link module:engine/view/view~View} this event is available by default.
  42532. *
  42533. * @see module:engine/view/observer/compositionobserver~CompositionObserver
  42534. * @event module:engine/view/document~Document#event:compositionupdate
  42535. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  42536. */
  42537. /**
  42538. * Fired when composition ends inside one of the editables.
  42539. *
  42540. * Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
  42541. *
  42542. * Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the
  42543. * {@link module:engine/view/view~View} this event is available by default.
  42544. *
  42545. * @see module:engine/view/observer/compositionobserver~CompositionObserver
  42546. * @event module:engine/view/document~Document#event:compositionend
  42547. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  42548. */
  42549. /***/ }),
  42550. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js":
  42551. /*!***********************************************************************************!*\
  42552. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js ***!
  42553. \***********************************************************************************/
  42554. /*! exports provided: default */
  42555. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42556. "use strict";
  42557. __webpack_require__.r(__webpack_exports__);
  42558. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DomEventData; });
  42559. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  42560. /**
  42561. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  42562. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  42563. */
  42564. /**
  42565. * @module engine/view/observer/domeventdata
  42566. */
  42567. /**
  42568. * Information about a DOM event in context of the {@link module:engine/view/document~Document}.
  42569. * It wraps the native event, which usually should not be used as the wrapper contains
  42570. * additional data (like key code for keyboard events).
  42571. */
  42572. class DomEventData {
  42573. /**
  42574. * @param {module:engine/view/view~View} view The instance of the view controller.
  42575. * @param {Event} domEvent The DOM event.
  42576. * @param {Object} [additionalData] Additional properties that the instance should contain.
  42577. */
  42578. constructor( view, domEvent, additionalData ) {
  42579. /**
  42580. * Instance of the view controller.
  42581. *
  42582. * @readonly
  42583. * @member {module:engine/view/view~View} module:engine/view/observer/observer~Observer.DomEvent#view
  42584. */
  42585. this.view = view;
  42586. /**
  42587. * The instance of the document.
  42588. *
  42589. * @readonly
  42590. * @member {module:engine/view/document~Document} module:engine/view/observer/observer~Observer.DomEvent#document
  42591. */
  42592. this.document = view.document;
  42593. /**
  42594. * The DOM event.
  42595. *
  42596. * @readonly
  42597. * @member {Event} module:engine/view/observer/observer~Observer.DomEvent#domEvent
  42598. */
  42599. this.domEvent = domEvent;
  42600. /**
  42601. * The DOM target.
  42602. *
  42603. * @readonly
  42604. * @member {HTMLElement} module:engine/view/observer/observer~Observer.DomEvent#target
  42605. */
  42606. this.domTarget = domEvent.target;
  42607. Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["extend"])( this, additionalData );
  42608. }
  42609. /**
  42610. * The tree view element representing the target.
  42611. *
  42612. * @readonly
  42613. * @type module:engine/view/element~Element
  42614. */
  42615. get target() {
  42616. return this.view.domConverter.mapDomToView( this.domTarget );
  42617. }
  42618. /**
  42619. * Prevents the native's event default action.
  42620. */
  42621. preventDefault() {
  42622. this.domEvent.preventDefault();
  42623. }
  42624. /**
  42625. * Stops native event propagation.
  42626. */
  42627. stopPropagation() {
  42628. this.domEvent.stopPropagation();
  42629. }
  42630. }
  42631. /***/ }),
  42632. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js":
  42633. /*!***************************************************************************************!*\
  42634. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js ***!
  42635. \***************************************************************************************/
  42636. /*! exports provided: default */
  42637. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42638. "use strict";
  42639. __webpack_require__.r(__webpack_exports__);
  42640. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DomEventObserver; });
  42641. /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  42642. /* harmony import */ var _domeventdata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./domeventdata */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js");
  42643. /**
  42644. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  42645. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  42646. */
  42647. /**
  42648. * @module engine/view/observer/domeventobserver
  42649. */
  42650. /**
  42651. * Base class for DOM event observers. This class handles
  42652. * {@link module:engine/view/observer/observer~Observer#observe adding} listeners to DOM elements,
  42653. * {@link module:engine/view/observer/observer~Observer#disable disabling} and
  42654. * {@link module:engine/view/observer/observer~Observer#enable re-enabling} events.
  42655. * Child class needs to define
  42656. * {@link module:engine/view/observer/domeventobserver~DomEventObserver#domEventType DOM event type} and
  42657. * {@link module:engine/view/observer/domeventobserver~DomEventObserver#onDomEvent callback}.
  42658. *
  42659. * For instance:
  42660. *
  42661. * class ClickObserver extends DomEventObserver {
  42662. * // It can also be defined as a normal property in the constructor.
  42663. * get domEventType() {
  42664. * return 'click';
  42665. * }
  42666. *
  42667. * onDomEvent( domEvent ) {
  42668. * this.fire( 'click', domEvent );
  42669. * }
  42670. * }
  42671. *
  42672. * @extends module:engine/view/observer/observer~Observer
  42673. */
  42674. class DomEventObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  42675. /**
  42676. * Type of the DOM event the observer should listen to. Array of types can be defined
  42677. * if the observer should listen to multiple DOM events.
  42678. *
  42679. * @readonly
  42680. * @member {String|Array.<String>} #domEventType
  42681. */
  42682. /**
  42683. * Callback which should be called when the DOM event occurred. Note that the callback will not be called if
  42684. * observer {@link #isEnabled is not enabled}.
  42685. *
  42686. * @see #domEventType
  42687. * @abstract
  42688. * @method #onDomEvent
  42689. */
  42690. /**
  42691. * @inheritDoc
  42692. */
  42693. constructor( view ) {
  42694. super( view );
  42695. /**
  42696. * If set to `true` DOM events will be listened on the capturing phase.
  42697. * Default value is `false`.
  42698. *
  42699. * @member {Boolean}
  42700. */
  42701. this.useCapture = false;
  42702. }
  42703. /**
  42704. * @inheritDoc
  42705. */
  42706. observe( domElement ) {
  42707. const types = typeof this.domEventType == 'string' ? [ this.domEventType ] : this.domEventType;
  42708. types.forEach( type => {
  42709. this.listenTo( domElement, type, ( eventInfo, domEvent ) => {
  42710. if ( this.isEnabled && !this.checkShouldIgnoreEventFromTarget( domEvent.target ) ) {
  42711. this.onDomEvent( domEvent );
  42712. }
  42713. }, { useCapture: this.useCapture } );
  42714. } );
  42715. }
  42716. /**
  42717. * Calls `Document#fire()` if observer {@link #isEnabled is enabled}.
  42718. *
  42719. * @see module:utils/emittermixin~EmitterMixin#fire
  42720. * @param {String} eventType The event type (name).
  42721. * @param {Event} domEvent The DOM event.
  42722. * @param {Object} [additionalData] The additional data which should extend the
  42723. * {@link module:engine/view/observer/domeventdata~DomEventData event data} object.
  42724. */
  42725. fire( eventType, domEvent, additionalData ) {
  42726. if ( this.isEnabled ) {
  42727. this.document.fire( eventType, new _domeventdata__WEBPACK_IMPORTED_MODULE_1__["default"]( this.view, domEvent, additionalData ) );
  42728. }
  42729. }
  42730. }
  42731. /***/ }),
  42732. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.js":
  42733. /*!********************************************************************************************!*\
  42734. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.js ***!
  42735. \********************************************************************************************/
  42736. /*! exports provided: default */
  42737. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42738. "use strict";
  42739. __webpack_require__.r(__webpack_exports__);
  42740. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FakeSelectionObserver; });
  42741. /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  42742. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  42743. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  42744. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  42745. /**
  42746. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  42747. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  42748. */
  42749. /**
  42750. * @module engine/view/observer/fakeselectionobserver
  42751. */
  42752. /**
  42753. * Fake selection observer class. If view selection is fake it is placed in dummy DOM container. This observer listens
  42754. * on {@link module:engine/view/document~Document#event:keydown keydown} events and handles moving fake view selection to the correct place
  42755. * if arrow keys are pressed.
  42756. * Fires {@link module:engine/view/document~Document#event:selectionChange selectionChange event} simulating natural behaviour of
  42757. * {@link module:engine/view/observer/selectionobserver~SelectionObserver SelectionObserver}.
  42758. *
  42759. * @extends module:engine/view/observer/observer~Observer
  42760. */
  42761. class FakeSelectionObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  42762. /**
  42763. * Creates new FakeSelectionObserver instance.
  42764. *
  42765. * @param {module:engine/view/view~View} view
  42766. */
  42767. constructor( view ) {
  42768. super( view );
  42769. /**
  42770. * Fires debounced event `selectionChangeDone`. It uses `lodash#debounce` method to delay function call.
  42771. *
  42772. * @private
  42773. * @param {Object} data Selection change data.
  42774. * @method #_fireSelectionChangeDoneDebounced
  42775. */
  42776. this._fireSelectionChangeDoneDebounced = Object(lodash_es__WEBPACK_IMPORTED_MODULE_3__["debounce"])( data => this.document.fire( 'selectionChangeDone', data ), 200 );
  42777. }
  42778. /**
  42779. * @inheritDoc
  42780. */
  42781. observe() {
  42782. const document = this.document;
  42783. document.on( 'arrowKey', ( eventInfo, data ) => {
  42784. const selection = document.selection;
  42785. if ( selection.isFake && this.isEnabled ) {
  42786. // Prevents default key down handling - no selection change will occur.
  42787. data.preventDefault();
  42788. }
  42789. }, { context: '$capture' } );
  42790. document.on( 'arrowKey', ( eventInfo, data ) => {
  42791. const selection = document.selection;
  42792. if ( selection.isFake && this.isEnabled ) {
  42793. this._handleSelectionMove( data.keyCode );
  42794. }
  42795. }, { priority: 'lowest' } );
  42796. }
  42797. /**
  42798. * @inheritDoc
  42799. */
  42800. destroy() {
  42801. super.destroy();
  42802. this._fireSelectionChangeDoneDebounced.cancel();
  42803. }
  42804. /**
  42805. * Handles collapsing view selection according to given key code. If left or up key is provided - new selection will be
  42806. * collapsed to left. If right or down key is pressed - new selection will be collapsed to right.
  42807. *
  42808. * This method fires {@link module:engine/view/document~Document#event:selectionChange} and
  42809. * {@link module:engine/view/document~Document#event:selectionChangeDone} events imitating behaviour of
  42810. * {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
  42811. *
  42812. * @private
  42813. * @param {Number} keyCode
  42814. * @fires module:engine/view/document~Document#event:selectionChange
  42815. * @fires module:engine/view/document~Document#event:selectionChangeDone
  42816. */
  42817. _handleSelectionMove( keyCode ) {
  42818. const selection = this.document.selection;
  42819. const newSelection = new _selection__WEBPACK_IMPORTED_MODULE_1__["default"]( selection.getRanges(), { backward: selection.isBackward, fake: false } );
  42820. // Left or up arrow pressed - move selection to start.
  42821. if ( keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].arrowleft || keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].arrowup ) {
  42822. newSelection.setTo( newSelection.getFirstPosition() );
  42823. }
  42824. // Right or down arrow pressed - move selection to end.
  42825. if ( keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].arrowright || keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].arrowdown ) {
  42826. newSelection.setTo( newSelection.getLastPosition() );
  42827. }
  42828. const data = {
  42829. oldSelection: selection,
  42830. newSelection,
  42831. domSelection: null
  42832. };
  42833. // Fire dummy selection change event.
  42834. this.document.fire( 'selectionChange', data );
  42835. // Call` #_fireSelectionChangeDoneDebounced` every time when `selectionChange` event is fired.
  42836. // This function is debounced what means that `selectionChangeDone` event will be fired only when
  42837. // defined int the function time will elapse since the last time the function was called.
  42838. // So `selectionChangeDone` will be fired when selection will stop changing.
  42839. this._fireSelectionChangeDoneDebounced( data );
  42840. }
  42841. }
  42842. /***/ }),
  42843. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/focusobserver.js":
  42844. /*!************************************************************************************!*\
  42845. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/focusobserver.js ***!
  42846. \************************************************************************************/
  42847. /*! exports provided: default */
  42848. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42849. "use strict";
  42850. __webpack_require__.r(__webpack_exports__);
  42851. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FocusObserver; });
  42852. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  42853. /**
  42854. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  42855. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  42856. */
  42857. /**
  42858. * @module engine/view/observer/focusobserver
  42859. */
  42860. /* globals setTimeout, clearTimeout */
  42861. /**
  42862. * {@link module:engine/view/document~Document#event:focus Focus}
  42863. * and {@link module:engine/view/document~Document#event:blur blur} events observer.
  42864. * Focus observer handle also {@link module:engine/view/rooteditableelement~RootEditableElement#isFocused isFocused} property of the
  42865. * {@link module:engine/view/rooteditableelement~RootEditableElement root elements}.
  42866. *
  42867. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  42868. *
  42869. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  42870. */
  42871. class FocusObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  42872. constructor( view ) {
  42873. super( view );
  42874. this.domEventType = [ 'focus', 'blur' ];
  42875. this.useCapture = true;
  42876. const document = this.document;
  42877. document.on( 'focus', () => {
  42878. document.isFocused = true;
  42879. // Unfortunately native `selectionchange` event is fired asynchronously.
  42880. // We need to wait until `SelectionObserver` handle the event and then render. Otherwise rendering will
  42881. // overwrite new DOM selection with selection from the view.
  42882. // See https://github.com/ckeditor/ckeditor5-engine/issues/795 for more details.
  42883. // Long timeout is needed to solve #676 and https://github.com/ckeditor/ckeditor5-engine/issues/1157 issues.
  42884. //
  42885. // Using `view.change()` instead of `view.forceRender()` to prevent double rendering
  42886. // in a situation where `selectionchange` already caused selection change.
  42887. this._renderTimeoutId = setTimeout( () => view.change( () => {} ), 50 );
  42888. } );
  42889. document.on( 'blur', ( evt, data ) => {
  42890. const selectedEditable = document.selection.editableElement;
  42891. if ( selectedEditable === null || selectedEditable === data.target ) {
  42892. document.isFocused = false;
  42893. // Re-render the document to update view elements
  42894. // (changing document.isFocused already marked view as changed since last rendering).
  42895. view.change( () => {} );
  42896. }
  42897. } );
  42898. /**
  42899. * Identifier of the timeout currently used by focus listener to delay rendering execution.
  42900. *
  42901. * @private
  42902. * @member {Number} #_renderTimeoutId
  42903. */
  42904. }
  42905. onDomEvent( domEvent ) {
  42906. this.fire( domEvent.type, domEvent );
  42907. }
  42908. /**
  42909. * @inheritDoc
  42910. */
  42911. destroy() {
  42912. if ( this._renderTimeoutId ) {
  42913. clearTimeout( this._renderTimeoutId );
  42914. }
  42915. super.destroy();
  42916. }
  42917. }
  42918. /**
  42919. * Fired when one of the editables gets focus.
  42920. *
  42921. * Introduced by {@link module:engine/view/observer/focusobserver~FocusObserver}.
  42922. *
  42923. * Note that because {@link module:engine/view/observer/focusobserver~FocusObserver} is attached by the
  42924. * {@link module:engine/view/view~View} this event is available by default.
  42925. *
  42926. * @see module:engine/view/observer/focusobserver~FocusObserver
  42927. * @event module:engine/view/document~Document#event:focus
  42928. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  42929. */
  42930. /**
  42931. * Fired when one of the editables loses focus.
  42932. *
  42933. * Introduced by {@link module:engine/view/observer/focusobserver~FocusObserver}.
  42934. *
  42935. * Note that because {@link module:engine/view/observer/focusobserver~FocusObserver} is attached by the
  42936. * {@link module:engine/view/view~View} this event is available by default.
  42937. *
  42938. * @see module:engine/view/observer/focusobserver~FocusObserver
  42939. * @event module:engine/view/document~Document#event:blur
  42940. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  42941. */
  42942. /***/ }),
  42943. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/inputobserver.js":
  42944. /*!************************************************************************************!*\
  42945. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/inputobserver.js ***!
  42946. \************************************************************************************/
  42947. /*! exports provided: default */
  42948. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42949. "use strict";
  42950. __webpack_require__.r(__webpack_exports__);
  42951. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InputObserver; });
  42952. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  42953. /**
  42954. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  42955. * For licensing, see LICENSE.md.
  42956. */
  42957. /**
  42958. * @module engine/view/observer/inputobserver
  42959. */
  42960. /**
  42961. * Observer for events connected with data input.
  42962. *
  42963. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  42964. *
  42965. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  42966. */
  42967. class InputObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  42968. constructor( view ) {
  42969. super( view );
  42970. this.domEventType = [ 'beforeinput' ];
  42971. }
  42972. onDomEvent( domEvent ) {
  42973. this.fire( domEvent.type, domEvent );
  42974. }
  42975. }
  42976. /**
  42977. * Fired before browser inputs (or deletes) some data.
  42978. *
  42979. * This event is available only on browsers which support DOM `beforeinput` event.
  42980. *
  42981. * Introduced by {@link module:engine/view/observer/inputobserver~InputObserver}.
  42982. *
  42983. * Note that because {@link module:engine/view/observer/inputobserver~InputObserver} is attached by the
  42984. * {@link module:engine/view/view~View} this event is available by default.
  42985. *
  42986. * @see module:engine/view/observer/inputobserver~InputObserver
  42987. * @event module:engine/view/document~Document#event:beforeinput
  42988. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  42989. */
  42990. /***/ }),
  42991. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/keyobserver.js":
  42992. /*!**********************************************************************************!*\
  42993. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/keyobserver.js ***!
  42994. \**********************************************************************************/
  42995. /*! exports provided: default */
  42996. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42997. "use strict";
  42998. __webpack_require__.r(__webpack_exports__);
  42999. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return KeyObserver; });
  43000. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  43001. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  43002. /**
  43003. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  43004. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  43005. */
  43006. /**
  43007. * @module engine/view/observer/keyobserver
  43008. */
  43009. /**
  43010. * Observer for events connected with pressing keyboard keys.
  43011. *
  43012. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  43013. *
  43014. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  43015. */
  43016. class KeyObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  43017. constructor( view ) {
  43018. super( view );
  43019. this.domEventType = [ 'keydown', 'keyup' ];
  43020. }
  43021. onDomEvent( domEvt ) {
  43022. this.fire( domEvt.type, domEvt, {
  43023. keyCode: domEvt.keyCode,
  43024. altKey: domEvt.altKey,
  43025. ctrlKey: domEvt.ctrlKey,
  43026. shiftKey: domEvt.shiftKey,
  43027. metaKey: domEvt.metaKey,
  43028. get keystroke() {
  43029. return Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["getCode"])( this );
  43030. }
  43031. } );
  43032. }
  43033. }
  43034. /**
  43035. * Fired when a key has been pressed.
  43036. *
  43037. * Introduced by {@link module:engine/view/observer/keyobserver~KeyObserver}.
  43038. *
  43039. * Note that because {@link module:engine/view/observer/keyobserver~KeyObserver} is attached by the
  43040. * {@link module:engine/view/view~View} this event is available by default.
  43041. *
  43042. * @see module:engine/view/observer/keyobserver~KeyObserver
  43043. * @event module:engine/view/document~Document#event:keydown
  43044. * @param {module:engine/view/observer/keyobserver~KeyEventData} keyEventData
  43045. */
  43046. /**
  43047. * Fired when a key has been released.
  43048. *
  43049. * Introduced by {@link module:engine/view/observer/keyobserver~KeyObserver}.
  43050. *
  43051. * Note that because {@link module:engine/view/observer/keyobserver~KeyObserver} is attached by the
  43052. * {@link module:engine/view/view~View} this event is available by default.
  43053. *
  43054. * @see module:engine/view/observer/keyobserver~KeyObserver
  43055. * @event module:engine/view/document~Document#event:keyup
  43056. * @param {module:engine/view/observer/keyobserver~KeyEventData} keyEventData
  43057. */
  43058. /**
  43059. * The value of both events - {@link module:engine/view/document~Document#event:keydown} and
  43060. * {@link module:engine/view/document~Document#event:keyup}.
  43061. *
  43062. * @class module:engine/view/observer/keyobserver~KeyEventData
  43063. * @extends module:engine/view/observer/domeventdata~DomEventData
  43064. * @implements module:utils/keyboard~KeystrokeInfo
  43065. */
  43066. /**
  43067. * Code of the whole keystroke. See {@link module:utils/keyboard~getCode}.
  43068. *
  43069. * @readonly
  43070. * @member {Number} module:engine/view/observer/keyobserver~KeyEventData#keystroke
  43071. */
  43072. /***/ }),
  43073. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js":
  43074. /*!************************************************************************************!*\
  43075. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js ***!
  43076. \************************************************************************************/
  43077. /*! exports provided: default */
  43078. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43079. "use strict";
  43080. __webpack_require__.r(__webpack_exports__);
  43081. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MouseObserver; });
  43082. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  43083. /**
  43084. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  43085. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  43086. */
  43087. /**
  43088. * @module engine/view/observer/mouseobserver
  43089. */
  43090. /**
  43091. * Mouse events observer.
  43092. *
  43093. * Note that this observer is not available by default. To make it available it needs to be added to
  43094. * {@link module:engine/view/view~View} by {@link module:engine/view/view~View#addObserver} method.
  43095. *
  43096. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  43097. */
  43098. class MouseObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  43099. constructor( view ) {
  43100. super( view );
  43101. this.domEventType = [ 'mousedown', 'mouseup', 'mouseover', 'mouseout' ];
  43102. }
  43103. onDomEvent( domEvent ) {
  43104. this.fire( domEvent.type, domEvent );
  43105. }
  43106. }
  43107. /**
  43108. * Fired when the mouse button is pressed down on one of the editing roots of the editor.
  43109. *
  43110. * Introduced by {@link module:engine/view/observer/mouseobserver~MouseObserver}.
  43111. *
  43112. * Note that this event is not available by default. To make it available, {@link module:engine/view/observer/mouseobserver~MouseObserver}
  43113. * needs to be added to {@link module:engine/view/view~View} by the {@link module:engine/view/view~View#addObserver} method.
  43114. *
  43115. * @see module:engine/view/observer/mouseobserver~MouseObserver
  43116. * @event module:engine/view/document~Document#event:mousedown
  43117. * @param {module:engine/view/observer/domeventdata~DomEventData} data The event data.
  43118. */
  43119. /**
  43120. * Fired when the mouse button is released over one of the editing roots of the editor.
  43121. *
  43122. * Introduced by {@link module:engine/view/observer/mouseobserver~MouseObserver}.
  43123. *
  43124. * Note that this event is not available by default. To make it available, {@link module:engine/view/observer/mouseobserver~MouseObserver}
  43125. * needs to be added to {@link module:engine/view/view~View} by the {@link module:engine/view/view~View#addObserver} method.
  43126. *
  43127. * @see module:engine/view/observer/mouseobserver~MouseObserver
  43128. * @event module:engine/view/document~Document#event:mouseup
  43129. * @param {module:engine/view/observer/domeventdata~DomEventData} data The event data.
  43130. */
  43131. /***/ }),
  43132. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js":
  43133. /*!***************************************************************************************!*\
  43134. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js ***!
  43135. \***************************************************************************************/
  43136. /*! exports provided: default */
  43137. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43138. "use strict";
  43139. __webpack_require__.r(__webpack_exports__);
  43140. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MutationObserver; });
  43141. /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  43142. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  43143. /* harmony import */ var _filler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../filler */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js");
  43144. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  43145. /**
  43146. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  43147. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  43148. */
  43149. /**
  43150. * @module engine/view/observer/mutationobserver
  43151. */
  43152. /* globals window */
  43153. /**
  43154. * Mutation observer class observes changes in the DOM, fires {@link module:engine/view/document~Document#event:mutations} event, mark view
  43155. * elements as changed and call {@link module:engine/view/renderer~Renderer#render}.
  43156. * Because all mutated nodes are marked as "to be rendered" and the
  43157. * {@link module:engine/view/renderer~Renderer#render} is called, all changes will be reverted, unless the mutation will be handled by the
  43158. * {@link module:engine/view/document~Document#event:mutations} event listener. It means user will see only handled changes, and the editor
  43159. * will block all changes which are not handled.
  43160. *
  43161. * Mutation Observer also take care of reducing number of mutations which are fired. It removes duplicates and
  43162. * mutations on elements which do not have corresponding view elements. Also
  43163. * {@link module:engine/view/observer/mutationobserver~MutatedText text mutation} is fired only if parent element do not change child list.
  43164. *
  43165. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  43166. *
  43167. * @extends module:engine/view/observer/observer~Observer
  43168. */
  43169. class MutationObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  43170. constructor( view ) {
  43171. super( view );
  43172. /**
  43173. * Native mutation observer config.
  43174. *
  43175. * @private
  43176. * @member {Object}
  43177. */
  43178. this._config = {
  43179. childList: true,
  43180. characterData: true,
  43181. characterDataOldValue: true,
  43182. subtree: true
  43183. };
  43184. /**
  43185. * Reference to the {@link module:engine/view/view~View#domConverter}.
  43186. *
  43187. * @member {module:engine/view/domconverter~DomConverter}
  43188. */
  43189. this.domConverter = view.domConverter;
  43190. /**
  43191. * Reference to the {@link module:engine/view/view~View#_renderer}.
  43192. *
  43193. * @member {module:engine/view/renderer~Renderer}
  43194. */
  43195. this.renderer = view._renderer;
  43196. /**
  43197. * Observed DOM elements.
  43198. *
  43199. * @private
  43200. * @member {Array.<HTMLElement>}
  43201. */
  43202. this._domElements = [];
  43203. /**
  43204. * Native mutation observer.
  43205. *
  43206. * @private
  43207. * @member {MutationObserver}
  43208. */
  43209. this._mutationObserver = new window.MutationObserver( this._onMutations.bind( this ) );
  43210. }
  43211. /**
  43212. * Synchronously fires {@link module:engine/view/document~Document#event:mutations} event with all mutations in record queue.
  43213. * At the same time empties the queue so mutations will not be fired twice.
  43214. */
  43215. flush() {
  43216. this._onMutations( this._mutationObserver.takeRecords() );
  43217. }
  43218. /**
  43219. * @inheritDoc
  43220. */
  43221. observe( domElement ) {
  43222. this._domElements.push( domElement );
  43223. if ( this.isEnabled ) {
  43224. this._mutationObserver.observe( domElement, this._config );
  43225. }
  43226. }
  43227. /**
  43228. * @inheritDoc
  43229. */
  43230. enable() {
  43231. super.enable();
  43232. for ( const domElement of this._domElements ) {
  43233. this._mutationObserver.observe( domElement, this._config );
  43234. }
  43235. }
  43236. /**
  43237. * @inheritDoc
  43238. */
  43239. disable() {
  43240. super.disable();
  43241. this._mutationObserver.disconnect();
  43242. }
  43243. /**
  43244. * @inheritDoc
  43245. */
  43246. destroy() {
  43247. super.destroy();
  43248. this._mutationObserver.disconnect();
  43249. }
  43250. /**
  43251. * Handles mutations. Deduplicates, mark view elements to sync, fire event and call render.
  43252. *
  43253. * @private
  43254. * @param {Array.<Object>} domMutations Array of native mutations.
  43255. */
  43256. _onMutations( domMutations ) {
  43257. // As a result of this.flush() we can have an empty collection.
  43258. if ( domMutations.length === 0 ) {
  43259. return;
  43260. }
  43261. const domConverter = this.domConverter;
  43262. // Use map and set for deduplication.
  43263. const mutatedTexts = new Map();
  43264. const mutatedElements = new Set();
  43265. // Handle `childList` mutations first, so we will be able to check if the `characterData` mutation is in the
  43266. // element with changed structure anyway.
  43267. for ( const mutation of domMutations ) {
  43268. if ( mutation.type === 'childList' ) {
  43269. const element = domConverter.mapDomToView( mutation.target );
  43270. // Do not collect mutations from UIElements and RawElements.
  43271. if ( element && ( element.is( 'uiElement' ) || element.is( 'rawElement' ) ) ) {
  43272. continue;
  43273. }
  43274. if ( element && !this._isBogusBrMutation( mutation ) ) {
  43275. mutatedElements.add( element );
  43276. }
  43277. }
  43278. }
  43279. // Handle `characterData` mutations later, when we have the full list of nodes which changed structure.
  43280. for ( const mutation of domMutations ) {
  43281. const element = domConverter.mapDomToView( mutation.target );
  43282. // Do not collect mutations from UIElements and RawElements.
  43283. if ( element && ( element.is( 'uiElement' ) || element.is( 'rawElement' ) ) ) {
  43284. continue;
  43285. }
  43286. if ( mutation.type === 'characterData' ) {
  43287. const text = domConverter.findCorrespondingViewText( mutation.target );
  43288. if ( text && !mutatedElements.has( text.parent ) ) {
  43289. // Use text as a key, for deduplication. If there will be another mutation on the same text element
  43290. // we will have only one in the map.
  43291. mutatedTexts.set( text, {
  43292. type: 'text',
  43293. oldText: text.data,
  43294. newText: Object(_filler__WEBPACK_IMPORTED_MODULE_2__["getDataWithoutFiller"])( mutation.target ),
  43295. node: text
  43296. } );
  43297. }
  43298. // When we added first letter to the text node which had only inline filler, for the DOM it is mutation
  43299. // on text, but for the view, where filler text node did not existed, new text node was created, so we
  43300. // need to fire 'children' mutation instead of 'text'.
  43301. else if ( !text && Object(_filler__WEBPACK_IMPORTED_MODULE_2__["startsWithFiller"])( mutation.target ) ) {
  43302. mutatedElements.add( domConverter.mapDomToView( mutation.target.parentNode ) );
  43303. }
  43304. }
  43305. }
  43306. // Now we build the list of mutations to fire and mark elements. We did not do it earlier to avoid marking the
  43307. // same node multiple times in case of duplication.
  43308. // List of mutations we will fire.
  43309. const viewMutations = [];
  43310. for ( const mutatedText of mutatedTexts.values() ) {
  43311. this.renderer.markToSync( 'text', mutatedText.node );
  43312. viewMutations.push( mutatedText );
  43313. }
  43314. for ( const viewElement of mutatedElements ) {
  43315. const domElement = domConverter.mapViewToDom( viewElement );
  43316. const viewChildren = Array.from( viewElement.getChildren() );
  43317. const newViewChildren = Array.from( domConverter.domChildrenToView( domElement, { withChildren: false } ) );
  43318. // It may happen that as a result of many changes (sth was inserted and then removed),
  43319. // both elements haven't really changed. #1031
  43320. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_3__["isEqualWith"])( viewChildren, newViewChildren, sameNodes ) ) {
  43321. this.renderer.markToSync( 'children', viewElement );
  43322. viewMutations.push( {
  43323. type: 'children',
  43324. oldChildren: viewChildren,
  43325. newChildren: newViewChildren,
  43326. node: viewElement
  43327. } );
  43328. }
  43329. }
  43330. // Retrieve `domSelection` using `ownerDocument` of one of mutated nodes.
  43331. // There should not be simultaneous mutation in multiple documents, so it's fine.
  43332. const domSelection = domMutations[ 0 ].target.ownerDocument.getSelection();
  43333. let viewSelection = null;
  43334. if ( domSelection && domSelection.anchorNode ) {
  43335. // If `domSelection` is inside a dom node that is already bound to a view node from view tree, get
  43336. // corresponding selection in the view and pass it together with `viewMutations`. The `viewSelection` may
  43337. // be used by features handling mutations.
  43338. // Only one range is supported.
  43339. const viewSelectionAnchor = domConverter.domPositionToView( domSelection.anchorNode, domSelection.anchorOffset );
  43340. const viewSelectionFocus = domConverter.domPositionToView( domSelection.focusNode, domSelection.focusOffset );
  43341. // Anchor and focus has to be properly mapped to view.
  43342. if ( viewSelectionAnchor && viewSelectionFocus ) {
  43343. viewSelection = new _selection__WEBPACK_IMPORTED_MODULE_1__["default"]( viewSelectionAnchor );
  43344. viewSelection.setFocus( viewSelectionFocus );
  43345. }
  43346. }
  43347. // In case only non-relevant mutations were recorded it skips the event and force render (#5600).
  43348. if ( viewMutations.length ) {
  43349. this.document.fire( 'mutations', viewMutations, viewSelection );
  43350. // If nothing changes on `mutations` event, at this point we have "dirty DOM" (changed) and de-synched
  43351. // view (which has not been changed). In order to "reset DOM" we render the view again.
  43352. this.view.forceRender();
  43353. }
  43354. function sameNodes( child1, child2 ) {
  43355. // First level of comparison (array of children vs array of children) – use the Lodash's default behavior.
  43356. if ( Array.isArray( child1 ) ) {
  43357. return;
  43358. }
  43359. // Elements.
  43360. if ( child1 === child2 ) {
  43361. return true;
  43362. }
  43363. // Texts.
  43364. else if ( child1.is( '$text' ) && child2.is( '$text' ) ) {
  43365. return child1.data === child2.data;
  43366. }
  43367. // Not matching types.
  43368. return false;
  43369. }
  43370. }
  43371. /**
  43372. * Checks if mutation was generated by the browser inserting bogus br on the end of the block element.
  43373. * Such mutations are generated while pressing space or performing native spellchecker correction
  43374. * on the end of the block element in Firefox browser.
  43375. *
  43376. * @private
  43377. * @param {Object} mutation Native mutation object.
  43378. * @returns {Boolean}
  43379. */
  43380. _isBogusBrMutation( mutation ) {
  43381. let addedNode = null;
  43382. // Check if mutation added only one node on the end of its parent.
  43383. if ( mutation.nextSibling === null && mutation.removedNodes.length === 0 && mutation.addedNodes.length == 1 ) {
  43384. addedNode = this.domConverter.domToView( mutation.addedNodes[ 0 ], {
  43385. withChildren: false
  43386. } );
  43387. }
  43388. return addedNode && addedNode.is( 'element', 'br' );
  43389. }
  43390. }
  43391. /**
  43392. * Fired when mutation occurred. If tree view is not changed on this event, DOM will be reverted to the state before
  43393. * mutation, so all changes which should be applied, should be handled on this event.
  43394. *
  43395. * Introduced by {@link module:engine/view/observer/mutationobserver~MutationObserver}.
  43396. *
  43397. * Note that because {@link module:engine/view/observer/mutationobserver~MutationObserver} is attached by the
  43398. * {@link module:engine/view/view~View} this event is available by default.
  43399. *
  43400. * @see module:engine/view/observer/mutationobserver~MutationObserver
  43401. * @event module:engine/view/document~Document#event:mutations
  43402. * @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|module:engine/view/observer/mutationobserver~MutatedChildren>}
  43403. * viewMutations Array of mutations.
  43404. * For mutated texts it will be {@link module:engine/view/observer/mutationobserver~MutatedText} and for mutated elements it will be
  43405. * {@link module:engine/view/observer/mutationobserver~MutatedChildren}. You can recognize the type based on the `type` property.
  43406. * @param {module:engine/view/selection~Selection|null} viewSelection View selection that is a result of converting DOM selection to view.
  43407. * Keep in
  43408. * mind that the DOM selection is already "updated", meaning that it already acknowledges changes done in mutation.
  43409. */
  43410. /**
  43411. * Mutation item for text.
  43412. *
  43413. * @see module:engine/view/document~Document#event:mutations
  43414. * @see module:engine/view/observer/mutationobserver~MutatedChildren
  43415. *
  43416. * @typedef {Object} module:engine/view/observer/mutationobserver~MutatedText
  43417. *
  43418. * @property {String} type For text mutations it is always 'text'.
  43419. * @property {module:engine/view/text~Text} node Mutated text node.
  43420. * @property {String} oldText Old text.
  43421. * @property {String} newText New text.
  43422. */
  43423. /**
  43424. * Mutation item for child nodes.
  43425. *
  43426. * @see module:engine/view/document~Document#event:mutations
  43427. * @see module:engine/view/observer/mutationobserver~MutatedText
  43428. *
  43429. * @typedef {Object} module:engine/view/observer/mutationobserver~MutatedChildren
  43430. *
  43431. * @property {String} type For child nodes mutations it is always 'children'.
  43432. * @property {module:engine/view/element~Element} node Parent of the mutated children.
  43433. * @property {Array.<module:engine/view/node~Node>} oldChildren Old child nodes.
  43434. * @property {Array.<module:engine/view/node~Node>} newChildren New child nodes.
  43435. */
  43436. /***/ }),
  43437. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js":
  43438. /*!*******************************************************************************!*\
  43439. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js ***!
  43440. \*******************************************************************************/
  43441. /*! exports provided: default */
  43442. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43443. "use strict";
  43444. __webpack_require__.r(__webpack_exports__);
  43445. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Observer; });
  43446. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
  43447. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  43448. /**
  43449. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  43450. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  43451. */
  43452. /**
  43453. * @module engine/view/observer/observer
  43454. */
  43455. /**
  43456. * Abstract base observer class. Observers are classes which listen to DOM events, do the preliminary
  43457. * processing and fire events on the {@link module:engine/view/document~Document} objects.
  43458. * Observers can also add features to the view, for instance by updating its status or marking elements
  43459. * which need a refresh on DOM events.
  43460. *
  43461. * @abstract
  43462. */
  43463. class Observer {
  43464. /**
  43465. * Creates an instance of the observer.
  43466. *
  43467. * @param {module:engine/view/view~View} view
  43468. */
  43469. constructor( view ) {
  43470. /**
  43471. * An instance of the view controller.
  43472. *
  43473. * @readonly
  43474. * @member {module:engine/view/view~View}
  43475. */
  43476. this.view = view;
  43477. /**
  43478. * A reference to the {@link module:engine/view/document~Document} object.
  43479. *
  43480. * @readonly
  43481. * @member {module:engine/view/document~Document}
  43482. */
  43483. this.document = view.document;
  43484. /**
  43485. * The state of the observer. If it is disabled, no events will be fired.
  43486. *
  43487. * @readonly
  43488. * @member {Boolean}
  43489. */
  43490. this.isEnabled = false;
  43491. }
  43492. /**
  43493. * Enables the observer. This method is called when the observer is registered to the
  43494. * {@link module:engine/view/view~View} and after {@link module:engine/view/view~View#forceRender rendering}
  43495. * (all observers are {@link #disable disabled} before rendering).
  43496. *
  43497. * A typical use case for disabling observers is that mutation observers need to be disabled for the rendering.
  43498. * However, a child class may not need to be disabled, so it can implement an empty method.
  43499. *
  43500. * @see module:engine/view/observer/observer~Observer#disable
  43501. */
  43502. enable() {
  43503. this.isEnabled = true;
  43504. }
  43505. /**
  43506. * Disables the observer. This method is called before
  43507. * {@link module:engine/view/view~View#forceRender rendering} to prevent firing events during rendering.
  43508. *
  43509. * @see module:engine/view/observer/observer~Observer#enable
  43510. */
  43511. disable() {
  43512. this.isEnabled = false;
  43513. }
  43514. /**
  43515. * Disables and destroys the observer, among others removes event listeners created by the observer.
  43516. */
  43517. destroy() {
  43518. this.disable();
  43519. this.stopListening();
  43520. }
  43521. /**
  43522. * Checks whether a given DOM event should be ignored (should not be turned into a synthetic view document event).
  43523. *
  43524. * Currently, an event will be ignored only if its target or any of its ancestors has the `data-cke-ignore-events` attribute.
  43525. * This attribute can be used inside the structures generated by
  43526. * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `DowncastWriter#createUIElement()`} to ignore events
  43527. * fired within a UI that should be excluded from CKEditor 5's realms.
  43528. *
  43529. * @param {Node} domTarget The DOM event target to check (usually an element, sometimes a text node and
  43530. * potentially sometimes a document, too).
  43531. * @returns {Boolean} Whether this event should be ignored by the observer.
  43532. */
  43533. checkShouldIgnoreEventFromTarget( domTarget ) {
  43534. if ( domTarget && domTarget.nodeType === 3 ) {
  43535. domTarget = domTarget.parentNode;
  43536. }
  43537. if ( !domTarget || domTarget.nodeType !== 1 ) {
  43538. return false;
  43539. }
  43540. return domTarget.matches( '[data-cke-ignore-events], [data-cke-ignore-events] *' );
  43541. }
  43542. /**
  43543. * Starts observing the given root element.
  43544. *
  43545. * @method #observe
  43546. * @param {HTMLElement} domElement
  43547. * @param {String} name The name of the root element.
  43548. */
  43549. }
  43550. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( Observer, _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  43551. /***/ }),
  43552. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/selectionobserver.js":
  43553. /*!****************************************************************************************!*\
  43554. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/selectionobserver.js ***!
  43555. \****************************************************************************************/
  43556. /*! exports provided: default */
  43557. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43558. "use strict";
  43559. __webpack_require__.r(__webpack_exports__);
  43560. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectionObserver; });
  43561. /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  43562. /* harmony import */ var _mutationobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mutationobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js");
  43563. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  43564. /**
  43565. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  43566. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  43567. */
  43568. /**
  43569. * @module engine/view/observer/selectionobserver
  43570. */
  43571. /* global setInterval, clearInterval */
  43572. /**
  43573. * Selection observer class observes selection changes in the document. If a selection changes on the document this
  43574. * observer checks if there are any mutations and if the DOM selection is different from the
  43575. * {@link module:engine/view/document~Document#selection view selection}. The selection observer fires
  43576. * {@link module:engine/view/document~Document#event:selectionChange} event only if a selection change was the only change in the document
  43577. * and the DOM selection is different then the view selection.
  43578. *
  43579. * This observer also manages the {@link module:engine/view/document~Document#isSelecting} property of the view document.
  43580. *
  43581. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  43582. *
  43583. * @see module:engine/view/observer/mutationobserver~MutationObserver
  43584. * @extends module:engine/view/observer/observer~Observer
  43585. */
  43586. class SelectionObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  43587. constructor( view ) {
  43588. super( view );
  43589. /**
  43590. * Instance of the mutation observer. Selection observer calls
  43591. * {@link module:engine/view/observer/mutationobserver~MutationObserver#flush} to ensure that the mutations will be handled
  43592. * before the {@link module:engine/view/document~Document#event:selectionChange} event is fired.
  43593. *
  43594. * @readonly
  43595. * @member {module:engine/view/observer/mutationobserver~MutationObserver}
  43596. * module:engine/view/observer/selectionobserver~SelectionObserver#mutationObserver
  43597. */
  43598. this.mutationObserver = view.getObserver( _mutationobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
  43599. /**
  43600. * Reference to the view {@link module:engine/view/documentselection~DocumentSelection} object used to compare
  43601. * new selection with it.
  43602. *
  43603. * @readonly
  43604. * @member {module:engine/view/documentselection~DocumentSelection}
  43605. * module:engine/view/observer/selectionobserver~SelectionObserver#selection
  43606. */
  43607. this.selection = this.document.selection;
  43608. /* eslint-disable max-len */
  43609. /**
  43610. * Reference to the {@link module:engine/view/view~View#domConverter}.
  43611. *
  43612. * @readonly
  43613. * @member {module:engine/view/domconverter~DomConverter} module:engine/view/observer/selectionobserver~SelectionObserver#domConverter
  43614. */
  43615. /* eslint-enable max-len */
  43616. this.domConverter = view.domConverter;
  43617. /**
  43618. * A set of documents which have added `selectionchange` listener to avoid adding a listener twice to the same
  43619. * document.
  43620. *
  43621. * @private
  43622. * @member {WeakSet.<Document>} module:engine/view/observer/selectionobserver~SelectionObserver#_documents
  43623. */
  43624. this._documents = new WeakSet();
  43625. /**
  43626. * Fires debounced event `selectionChangeDone`. It uses `lodash#debounce` method to delay function call.
  43627. *
  43628. * @private
  43629. * @param {Object} data Selection change data.
  43630. * @method #_fireSelectionChangeDoneDebounced
  43631. */
  43632. this._fireSelectionChangeDoneDebounced = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["debounce"])( data => this.document.fire( 'selectionChangeDone', data ), 200 );
  43633. /**
  43634. * When called, starts clearing the {@link #_loopbackCounter} counter in time intervals. When the number of selection
  43635. * changes exceeds a certain limit within the interval of time, the observer will not fire `selectionChange` but warn about
  43636. * possible infinite selection loop.
  43637. *
  43638. * @private
  43639. * @member {Number} #_clearInfiniteLoopInterval
  43640. */
  43641. this._clearInfiniteLoopInterval = setInterval( () => this._clearInfiniteLoop(), 1000 );
  43642. /**
  43643. * Unlocks the `isSelecting` state of the view document in case the selection observer did not record this fact
  43644. * correctly (for whatever reason). It is a safeguard (paranoid check), that returns document to the normal state
  43645. * after a certain period of time (debounced, postponed by each selectionchange event).
  43646. *
  43647. * @private
  43648. * @method #_documentIsSelectingInactivityTimeoutDebounced
  43649. */
  43650. this._documentIsSelectingInactivityTimeoutDebounced = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["debounce"])( () => ( this.document.isSelecting = false ), 5000 );
  43651. /**
  43652. * Private property to check if the code does not enter infinite loop.
  43653. *
  43654. * @private
  43655. * @member {Number} module:engine/view/observer/selectionobserver~SelectionObserver#_loopbackCounter
  43656. */
  43657. this._loopbackCounter = 0;
  43658. }
  43659. /**
  43660. * @inheritDoc
  43661. */
  43662. observe( domElement ) {
  43663. const domDocument = domElement.ownerDocument;
  43664. const startDocumentIsSelecting = () => {
  43665. this.document.isSelecting = true;
  43666. // Let's activate the safety timeout each time the document enters the "is selecting" state.
  43667. this._documentIsSelectingInactivityTimeoutDebounced();
  43668. };
  43669. const endDocumentIsSelecting = () => {
  43670. this.document.isSelecting = false;
  43671. // The safety timeout can be canceled when the document leaves the "is selecting" state.
  43672. this._documentIsSelectingInactivityTimeoutDebounced.cancel();
  43673. };
  43674. // The document has the "is selecting" state while the user keeps making (extending) the selection
  43675. // (e.g. by holding the mouse button and moving the cursor). The state resets when they either released
  43676. // the mouse button or interrupted the process by pressing or releasing any key.
  43677. this.listenTo( domElement, 'selectstart', startDocumentIsSelecting, { priority: 'highest' } );
  43678. this.listenTo( domElement, 'keydown', endDocumentIsSelecting, { priority: 'highest' } );
  43679. this.listenTo( domElement, 'keyup', endDocumentIsSelecting, { priority: 'highest' } );
  43680. // Add document-wide listeners only once. This method could be called for multiple editing roots.
  43681. if ( this._documents.has( domDocument ) ) {
  43682. return;
  43683. }
  43684. this.listenTo( domDocument, 'mouseup', endDocumentIsSelecting, { priority: 'highest' } );
  43685. this.listenTo( domDocument, 'selectionchange', ( evt, domEvent ) => {
  43686. this._handleSelectionChange( domEvent, domDocument );
  43687. // Defer the safety timeout when the selection changes (e.g. the user keeps extending the selection
  43688. // using their mouse).
  43689. this._documentIsSelectingInactivityTimeoutDebounced();
  43690. } );
  43691. this._documents.add( domDocument );
  43692. }
  43693. /**
  43694. * @inheritDoc
  43695. */
  43696. destroy() {
  43697. super.destroy();
  43698. clearInterval( this._clearInfiniteLoopInterval );
  43699. this._fireSelectionChangeDoneDebounced.cancel();
  43700. this._documentIsSelectingInactivityTimeoutDebounced.cancel();
  43701. }
  43702. /**
  43703. * Selection change listener. {@link module:engine/view/observer/mutationobserver~MutationObserver#flush Flush} mutations, check if
  43704. * a selection changes and fires {@link module:engine/view/document~Document#event:selectionChange} event on every change
  43705. * and {@link module:engine/view/document~Document#event:selectionChangeDone} when a selection stop changing.
  43706. *
  43707. * @private
  43708. * @param {Event} domEvent DOM event.
  43709. * @param {Document} domDocument DOM document.
  43710. */
  43711. _handleSelectionChange( domEvent, domDocument ) {
  43712. if ( !this.isEnabled ) {
  43713. return;
  43714. }
  43715. const domSelection = domDocument.defaultView.getSelection();
  43716. if ( this.checkShouldIgnoreEventFromTarget( domSelection.anchorNode ) ) {
  43717. return;
  43718. }
  43719. // Ensure the mutation event will be before selection event on all browsers.
  43720. this.mutationObserver.flush();
  43721. // If there were mutations then the view will be re-rendered by the mutation observer and the selection
  43722. // will be updated, so the selections will equal and the event will not be fired, as expected.
  43723. const newViewSelection = this.domConverter.domSelectionToView( domSelection );
  43724. // Do not convert selection change if the new view selection has no ranges in it.
  43725. //
  43726. // It means that the DOM selection is in some way incorrect. Ranges that were in the DOM selection could not be
  43727. // converted to the view. This happens when the DOM selection was moved outside of the editable element.
  43728. if ( newViewSelection.rangeCount == 0 ) {
  43729. this.view.hasDomSelection = false;
  43730. return;
  43731. }
  43732. this.view.hasDomSelection = true;
  43733. if ( this.selection.isEqual( newViewSelection ) && this.domConverter.isDomSelectionCorrect( domSelection ) ) {
  43734. return;
  43735. }
  43736. // Ensure we are not in the infinite loop (#400).
  43737. // This counter is reset each second. 60 selection changes in 1 second is enough high number
  43738. // to be very difficult (impossible) to achieve using just keyboard keys (during normal editor use).
  43739. if ( ++this._loopbackCounter > 60 ) {
  43740. // Selection change observer detected an infinite rendering loop.
  43741. // Most probably you try to put the selection in the position which is not allowed
  43742. // by the browser and browser fixes it automatically what causes `selectionchange` event on
  43743. // which a loopback through a model tries to re-render the wrong selection and again.
  43744. //
  43745. // @if CK_DEBUG // console.warn( 'Selection change observer detected an infinite rendering loop.' );
  43746. return;
  43747. }
  43748. if ( this.selection.isSimilar( newViewSelection ) ) {
  43749. // If selection was equal and we are at this point of algorithm, it means that it was incorrect.
  43750. // Just re-render it, no need to fire any events, etc.
  43751. this.view.forceRender();
  43752. } else {
  43753. const data = {
  43754. oldSelection: this.selection,
  43755. newSelection: newViewSelection,
  43756. domSelection
  43757. };
  43758. // Prepare data for new selection and fire appropriate events.
  43759. this.document.fire( 'selectionChange', data );
  43760. // Call `#_fireSelectionChangeDoneDebounced` every time when `selectionChange` event is fired.
  43761. // This function is debounced what means that `selectionChangeDone` event will be fired only when
  43762. // defined int the function time will elapse since the last time the function was called.
  43763. // So `selectionChangeDone` will be fired when selection will stop changing.
  43764. this._fireSelectionChangeDoneDebounced( data );
  43765. }
  43766. }
  43767. /**
  43768. * Clears `SelectionObserver` internal properties connected with preventing infinite loop.
  43769. *
  43770. * @protected
  43771. */
  43772. _clearInfiniteLoop() {
  43773. this._loopbackCounter = 0;
  43774. }
  43775. }
  43776. /**
  43777. * Fired when a selection has changed. This event is fired only when the selection change was the only change that happened
  43778. * in the document, and the old selection is different then the new selection.
  43779. *
  43780. * Introduced by {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
  43781. *
  43782. * Note that because {@link module:engine/view/observer/selectionobserver~SelectionObserver} is attached by the
  43783. * {@link module:engine/view/view~View} this event is available by default.
  43784. *
  43785. * @see module:engine/view/observer/selectionobserver~SelectionObserver
  43786. * @event module:engine/view/document~Document#event:selectionChange
  43787. * @param {Object} data
  43788. * @param {module:engine/view/documentselection~DocumentSelection} data.oldSelection Old View selection which is
  43789. * {@link module:engine/view/document~Document#selection}.
  43790. * @param {module:engine/view/selection~Selection} data.newSelection New View selection which is converted DOM selection.
  43791. * @param {Selection} data.domSelection Native DOM selection.
  43792. */
  43793. /**
  43794. * Fired when selection stops changing.
  43795. *
  43796. * Introduced by {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
  43797. *
  43798. * Note that because {@link module:engine/view/observer/selectionobserver~SelectionObserver} is attached by the
  43799. * {@link module:engine/view/view~View} this event is available by default.
  43800. *
  43801. * @see module:engine/view/observer/selectionobserver~SelectionObserver
  43802. * @event module:engine/view/document~Document#event:selectionChangeDone
  43803. * @param {Object} data
  43804. * @param {module:engine/view/documentselection~DocumentSelection} data.oldSelection Old View selection which is
  43805. * {@link module:engine/view/document~Document#selection}.
  43806. * @param {module:engine/view/selection~Selection} data.newSelection New View selection which is converted DOM selection.
  43807. * @param {Selection} data.domSelection Native DOM selection.
  43808. */
  43809. /***/ }),
  43810. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.js":
  43811. /*!*************************************************************************!*\
  43812. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.js ***!
  43813. \*************************************************************************/
  43814. /*! exports provided: enablePlaceholder, disablePlaceholder, showPlaceholder, hidePlaceholder, needsPlaceholder */
  43815. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43816. "use strict";
  43817. __webpack_require__.r(__webpack_exports__);
  43818. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enablePlaceholder", function() { return enablePlaceholder; });
  43819. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disablePlaceholder", function() { return disablePlaceholder; });
  43820. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showPlaceholder", function() { return showPlaceholder; });
  43821. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hidePlaceholder", function() { return hidePlaceholder; });
  43822. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "needsPlaceholder", function() { return needsPlaceholder; });
  43823. /* harmony import */ var _theme_placeholder_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../theme/placeholder.css */ "./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css");
  43824. /**
  43825. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  43826. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  43827. */
  43828. /**
  43829. * @module engine/view/placeholder
  43830. */
  43831. // Each document stores information about its placeholder elements and check functions.
  43832. const documentPlaceholders = new WeakMap();
  43833. /**
  43834. * A helper that enables a placeholder on the provided view element (also updates its visibility).
  43835. * The placeholder is a CSS pseudo–element (with a text content) attached to the element.
  43836. *
  43837. * To change the placeholder text, simply call this method again with new options.
  43838. *
  43839. * To disable the placeholder, use {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} helper.
  43840. *
  43841. * @param {Object} [options] Configuration options of the placeholder.
  43842. * @param {module:engine/view/view~View} options.view Editing view instance.
  43843. * @param {module:engine/view/element~Element} options.element Element that will gain a placeholder.
  43844. * See `options.isDirectHost` to learn more.
  43845. * @param {String} options.text Placeholder text.
  43846. * @param {Boolean} [options.isDirectHost=true] If set `false`, the placeholder will not be enabled directly
  43847. * in the passed `element` but in one of its children (selected automatically, i.e. a first empty child element).
  43848. * Useful when attaching placeholders to elements that can host other elements (not just text), for instance,
  43849. * editable root elements.
  43850. * @param {Boolean} [options.keepOnFocus=false] If set `true`, the placeholder stay visible when the host element is focused.
  43851. */
  43852. function enablePlaceholder( options ) {
  43853. const { view, element, text, isDirectHost = true, keepOnFocus = false } = options;
  43854. const doc = view.document;
  43855. // Use a single a single post fixer per—document to update all placeholders.
  43856. if ( !documentPlaceholders.has( doc ) ) {
  43857. documentPlaceholders.set( doc, new Map() );
  43858. // If a post-fixer callback makes a change, it should return `true` so other post–fixers
  43859. // can re–evaluate the document again.
  43860. doc.registerPostFixer( writer => updateDocumentPlaceholders( doc, writer ) );
  43861. }
  43862. // Store information about the element placeholder under its document.
  43863. documentPlaceholders.get( doc ).set( element, {
  43864. text,
  43865. isDirectHost,
  43866. keepOnFocus,
  43867. hostElement: isDirectHost ? element : null
  43868. } );
  43869. // Update the placeholders right away.
  43870. view.change( writer => updateDocumentPlaceholders( doc, writer ) );
  43871. }
  43872. /**
  43873. * Disables the placeholder functionality from a given element.
  43874. *
  43875. * See {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} to learn more.
  43876. *
  43877. * @param {module:engine/view/view~View} view
  43878. * @param {module:engine/view/element~Element} element
  43879. */
  43880. function disablePlaceholder( view, element ) {
  43881. const doc = element.document;
  43882. view.change( writer => {
  43883. if ( !documentPlaceholders.has( doc ) ) {
  43884. return;
  43885. }
  43886. const placeholders = documentPlaceholders.get( doc );
  43887. const config = placeholders.get( element );
  43888. writer.removeAttribute( 'data-placeholder', config.hostElement );
  43889. hidePlaceholder( writer, config.hostElement );
  43890. placeholders.delete( element );
  43891. } );
  43892. }
  43893. /**
  43894. * Shows a placeholder in the provided element by changing related attributes and CSS classes.
  43895. *
  43896. * **Note**: This helper will not update the placeholder visibility nor manage the
  43897. * it in any way in the future. What it does is a one–time state change of an element. Use
  43898. * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} and
  43899. * {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} for full
  43900. * placeholder functionality.
  43901. *
  43902. * **Note**: This helper will blindly show the placeholder directly in the root editable element if
  43903. * one is passed, which could result in a visual clash if the editable element has some children
  43904. * (for instance, an empty paragraph). Use {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`}
  43905. * in that case or make sure the correct element is passed to the helper.
  43906. *
  43907. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  43908. * @param {module:engine/view/element~Element} element
  43909. * @returns {Boolean} `true`, if any changes were made to the `element`.
  43910. */
  43911. function showPlaceholder( writer, element ) {
  43912. if ( !element.hasClass( 'ck-placeholder' ) ) {
  43913. writer.addClass( 'ck-placeholder', element );
  43914. return true;
  43915. }
  43916. return false;
  43917. }
  43918. /**
  43919. * Hides a placeholder in the element by changing related attributes and CSS classes.
  43920. *
  43921. * **Note**: This helper will not update the placeholder visibility nor manage the
  43922. * it in any way in the future. What it does is a one–time state change of an element. Use
  43923. * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} and
  43924. * {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} for full
  43925. * placeholder functionality.
  43926. *
  43927. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  43928. * @param {module:engine/view/element~Element} element
  43929. * @returns {Boolean} `true`, if any changes were made to the `element`.
  43930. */
  43931. function hidePlaceholder( writer, element ) {
  43932. if ( element.hasClass( 'ck-placeholder' ) ) {
  43933. writer.removeClass( 'ck-placeholder', element );
  43934. return true;
  43935. }
  43936. return false;
  43937. }
  43938. /**
  43939. * Checks if a placeholder should be displayed in the element.
  43940. *
  43941. * **Note**: This helper will blindly check the possibility of showing a placeholder directly in the
  43942. * root editable element if one is passed, which may not be the expected result. If an element can
  43943. * host other elements (not just text), most likely one of its children should be checked instead
  43944. * because it will be the final host for the placeholder. Use
  43945. * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} in that case or make
  43946. * sure the correct element is passed to the helper.
  43947. *
  43948. * @param {module:engine/view/element~Element} element Element that holds the placeholder.
  43949. * @param {Boolean} keepOnFocus Focusing the element will keep the placeholder visible.
  43950. * @returns {Boolean}
  43951. */
  43952. function needsPlaceholder( element, keepOnFocus ) {
  43953. if ( !element.isAttached() ) {
  43954. return false;
  43955. }
  43956. // Anything but uiElement(s) counts as content.
  43957. const hasContent = Array.from( element.getChildren() )
  43958. .some( element => !element.is( 'uiElement' ) );
  43959. if ( hasContent ) {
  43960. return false;
  43961. }
  43962. // Skip the focus check and make the placeholder visible already regardless of document focus state.
  43963. if ( keepOnFocus ) {
  43964. return true;
  43965. }
  43966. const doc = element.document;
  43967. // If the document is blurred.
  43968. if ( !doc.isFocused ) {
  43969. return true;
  43970. }
  43971. const viewSelection = doc.selection;
  43972. const selectionAnchor = viewSelection.anchor;
  43973. // If document is focused and the element is empty but the selection is not anchored inside it.
  43974. return selectionAnchor && selectionAnchor.parent !== element;
  43975. }
  43976. // Updates all placeholders associated with a document in a post–fixer callback.
  43977. //
  43978. // @private
  43979. // @param { module:engine/view/document~Document} doc
  43980. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  43981. // @returns {Boolean} True if any changes were made to the view document.
  43982. function updateDocumentPlaceholders( doc, writer ) {
  43983. const placeholders = documentPlaceholders.get( doc );
  43984. const directHostElements = [];
  43985. let wasViewModified = false;
  43986. // First set placeholders on the direct hosts.
  43987. for ( const [ element, config ] of placeholders ) {
  43988. if ( config.isDirectHost ) {
  43989. directHostElements.push( element );
  43990. if ( updatePlaceholder( writer, element, config ) ) {
  43991. wasViewModified = true;
  43992. }
  43993. }
  43994. }
  43995. // Then set placeholders on the indirect hosts but only on those that does not already have an direct host placeholder.
  43996. for ( const [ element, config ] of placeholders ) {
  43997. if ( config.isDirectHost ) {
  43998. continue;
  43999. }
  44000. const hostElement = getChildPlaceholderHostSubstitute( element );
  44001. // When not a direct host, it could happen that there is no child element
  44002. // capable of displaying a placeholder.
  44003. if ( !hostElement ) {
  44004. continue;
  44005. }
  44006. // Don't override placeholder if the host element already has some direct placeholder.
  44007. if ( directHostElements.includes( hostElement ) ) {
  44008. continue;
  44009. }
  44010. // Update the host element (used for setting and removing the placeholder).
  44011. config.hostElement = hostElement;
  44012. if ( updatePlaceholder( writer, element, config ) ) {
  44013. wasViewModified = true;
  44014. }
  44015. }
  44016. return wasViewModified;
  44017. }
  44018. // Updates a single placeholder in a post–fixer callback.
  44019. //
  44020. // @private
  44021. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  44022. // @param {module:engine/view/element~Element} element
  44023. // @param {Object} config Configuration of the placeholder
  44024. // @param {String} config.text
  44025. // @param {Boolean} config.isDirectHost
  44026. // @returns {Boolean} True if any changes were made to the view document.
  44027. function updatePlaceholder( writer, element, config ) {
  44028. const { text, isDirectHost, hostElement } = config;
  44029. let wasViewModified = false;
  44030. // This may be necessary when updating the placeholder text to something else.
  44031. if ( hostElement.getAttribute( 'data-placeholder' ) !== text ) {
  44032. writer.setAttribute( 'data-placeholder', text, hostElement );
  44033. wasViewModified = true;
  44034. }
  44035. // If the host element is not a direct host then placeholder is needed only when there is only one element.
  44036. const isOnlyChild = isDirectHost || element.childCount == 1;
  44037. if ( isOnlyChild && needsPlaceholder( hostElement, config.keepOnFocus ) ) {
  44038. if ( showPlaceholder( writer, hostElement ) ) {
  44039. wasViewModified = true;
  44040. }
  44041. } else if ( hidePlaceholder( writer, hostElement ) ) {
  44042. wasViewModified = true;
  44043. }
  44044. return wasViewModified;
  44045. }
  44046. // Gets a child element capable of displaying a placeholder if a parent element can host more
  44047. // than just text (for instance, when it is a root editable element). The child element
  44048. // can then be used in other placeholder helpers as a substitute of its parent.
  44049. //
  44050. // @private
  44051. // @param {module:engine/view/element~Element} parent
  44052. // @returns {module:engine/view/element~Element|null}
  44053. function getChildPlaceholderHostSubstitute( parent ) {
  44054. if ( parent.childCount ) {
  44055. const firstChild = parent.getChild( 0 );
  44056. if ( firstChild.is( 'element' ) && !firstChild.is( 'uiElement' ) ) {
  44057. return firstChild;
  44058. }
  44059. }
  44060. return null;
  44061. }
  44062. /***/ }),
  44063. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js":
  44064. /*!**********************************************************************!*\
  44065. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js ***!
  44066. \**********************************************************************/
  44067. /*! exports provided: default */
  44068. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44069. "use strict";
  44070. __webpack_require__.r(__webpack_exports__);
  44071. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Position; });
  44072. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js");
  44073. /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
  44074. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  44075. /* harmony import */ var _editableelement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editableelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js");
  44076. /* harmony import */ var _ckeditor_ckeditor5_utils_src_version__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
  44077. /**
  44078. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  44079. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  44080. */
  44081. /**
  44082. * @module engine/view/position
  44083. */
  44084. // To check if component is loaded more than once.
  44085. /**
  44086. * Position in the view tree. Position is represented by its parent node and an offset in this parent.
  44087. *
  44088. * In order to create a new position instance use the `createPosition*()` factory methods available in:
  44089. *
  44090. * * {@link module:engine/view/view~View}
  44091. * * {@link module:engine/view/downcastwriter~DowncastWriter}
  44092. * * {@link module:engine/view/upcastwriter~UpcastWriter}
  44093. */
  44094. class Position {
  44095. /**
  44096. * Creates a position.
  44097. *
  44098. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} parent Position parent.
  44099. * @param {Number} offset Position offset.
  44100. */
  44101. constructor( parent, offset ) {
  44102. /**
  44103. * Position parent.
  44104. *
  44105. * @readonly
  44106. * @member {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
  44107. * module:engine/view/position~Position#parent
  44108. */
  44109. this.parent = parent;
  44110. /**
  44111. * Position offset.
  44112. *
  44113. * @readonly
  44114. * @member {Number} module:engine/view/position~Position#offset
  44115. */
  44116. this.offset = offset;
  44117. }
  44118. /**
  44119. * Node directly after the position. Equals `null` when there is no node after position or position is located
  44120. * inside text node.
  44121. *
  44122. * @readonly
  44123. * @type {module:engine/view/node~Node|null}
  44124. */
  44125. get nodeAfter() {
  44126. if ( this.parent.is( '$text' ) ) {
  44127. return null;
  44128. }
  44129. return this.parent.getChild( this.offset ) || null;
  44130. }
  44131. /**
  44132. * Node directly before the position. Equals `null` when there is no node before position or position is located
  44133. * inside text node.
  44134. *
  44135. * @readonly
  44136. * @type {module:engine/view/node~Node|null}
  44137. */
  44138. get nodeBefore() {
  44139. if ( this.parent.is( '$text' ) ) {
  44140. return null;
  44141. }
  44142. return this.parent.getChild( this.offset - 1 ) || null;
  44143. }
  44144. /**
  44145. * Is `true` if position is at the beginning of its {@link module:engine/view/position~Position#parent parent}, `false` otherwise.
  44146. *
  44147. * @readonly
  44148. * @type {Boolean}
  44149. */
  44150. get isAtStart() {
  44151. return this.offset === 0;
  44152. }
  44153. /**
  44154. * Is `true` if position is at the end of its {@link module:engine/view/position~Position#parent parent}, `false` otherwise.
  44155. *
  44156. * @readonly
  44157. * @type {Boolean}
  44158. */
  44159. get isAtEnd() {
  44160. const endOffset = this.parent.is( '$text' ) ? this.parent.data.length : this.parent.childCount;
  44161. return this.offset === endOffset;
  44162. }
  44163. /**
  44164. * Position's root, that is the root of the position's parent element.
  44165. *
  44166. * @readonly
  44167. * @type {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
  44168. */
  44169. get root() {
  44170. return this.parent.root;
  44171. }
  44172. /**
  44173. * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this position, or `null` if
  44174. * position is not inside an editable element.
  44175. *
  44176. * @type {module:engine/view/editableelement~EditableElement|null}
  44177. */
  44178. get editableElement() {
  44179. let editable = this.parent;
  44180. while ( !( editable instanceof _editableelement__WEBPACK_IMPORTED_MODULE_3__["default"] ) ) {
  44181. if ( editable.parent ) {
  44182. editable = editable.parent;
  44183. } else {
  44184. return null;
  44185. }
  44186. }
  44187. return editable;
  44188. }
  44189. /**
  44190. * Returns a new instance of Position with offset incremented by `shift` value.
  44191. *
  44192. * @param {Number} shift How position offset should get changed. Accepts negative values.
  44193. * @returns {module:engine/view/position~Position} Shifted position.
  44194. */
  44195. getShiftedBy( shift ) {
  44196. const shifted = Position._createAt( this );
  44197. const offset = shifted.offset + shift;
  44198. shifted.offset = offset < 0 ? 0 : offset;
  44199. return shifted;
  44200. }
  44201. /**
  44202. * Gets the farthest position which matches the callback using
  44203. * {@link module:engine/view/treewalker~TreeWalker TreeWalker}.
  44204. *
  44205. * For example:
  44206. *
  44207. * getLastMatchingPosition( value => value.type == 'text' ); // <p>{}foo</p> -> <p>foo[]</p>
  44208. * getLastMatchingPosition( value => value.type == 'text', { direction: 'backward' } ); // <p>foo[]</p> -> <p>{}foo</p>
  44209. * getLastMatchingPosition( value => false ); // Do not move the position.
  44210. *
  44211. * @param {Function} skip Callback function. Gets {@link module:engine/view/treewalker~TreeWalkerValue} and should
  44212. * return `true` if the value should be skipped or `false` if not.
  44213. * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.
  44214. *
  44215. * @returns {module:engine/view/position~Position} The position after the last item which matches the `skip` callback test.
  44216. */
  44217. getLastMatchingPosition( skip, options = {} ) {
  44218. options.startPosition = this;
  44219. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( options );
  44220. treeWalker.skip( skip );
  44221. return treeWalker.position;
  44222. }
  44223. /**
  44224. * Returns ancestors array of this position, that is this position's parent and it's ancestors.
  44225. *
  44226. * @returns {Array} Array with ancestors.
  44227. */
  44228. getAncestors() {
  44229. if ( this.parent.is( 'documentFragment' ) ) {
  44230. return [ this.parent ];
  44231. } else {
  44232. return this.parent.getAncestors( { includeSelf: true } );
  44233. }
  44234. }
  44235. /**
  44236. * Returns a {@link module:engine/view/node~Node} or {@link module:engine/view/documentfragment~DocumentFragment}
  44237. * which is a common ancestor of both positions.
  44238. *
  44239. * @param {module:engine/view/position~Position} position
  44240. * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null}
  44241. */
  44242. getCommonAncestor( position ) {
  44243. const ancestorsA = this.getAncestors();
  44244. const ancestorsB = position.getAncestors();
  44245. let i = 0;
  44246. while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
  44247. i++;
  44248. }
  44249. return i === 0 ? null : ancestorsA[ i - 1 ];
  44250. }
  44251. /**
  44252. * Checks whether this object is of the given type.
  44253. *
  44254. * position.is( 'position' ); // -> true
  44255. * position.is( 'view:position' ); // -> true
  44256. *
  44257. * position.is( 'model:position' ); // -> false
  44258. * position.is( 'element' ); // -> false
  44259. * position.is( 'range' ); // -> false
  44260. *
  44261. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  44262. *
  44263. * @param {String} type
  44264. * @returns {Boolean}
  44265. */
  44266. is( type ) {
  44267. return type === 'position' || type === 'view:position';
  44268. }
  44269. /**
  44270. * Checks whether this position equals given position.
  44271. *
  44272. * @param {module:engine/view/position~Position} otherPosition Position to compare with.
  44273. * @returns {Boolean} True if positions are same.
  44274. */
  44275. isEqual( otherPosition ) {
  44276. return ( this.parent == otherPosition.parent && this.offset == otherPosition.offset );
  44277. }
  44278. /**
  44279. * Checks whether this position is located before given position. When method returns `false` it does not mean that
  44280. * this position is after give one. Two positions may be located inside separate roots and in that situation this
  44281. * method will still return `false`.
  44282. *
  44283. * @see module:engine/view/position~Position#isAfter
  44284. * @see module:engine/view/position~Position#compareWith
  44285. * @param {module:engine/view/position~Position} otherPosition Position to compare with.
  44286. * @returns {Boolean} Returns `true` if this position is before given position.
  44287. */
  44288. isBefore( otherPosition ) {
  44289. return this.compareWith( otherPosition ) == 'before';
  44290. }
  44291. /**
  44292. * Checks whether this position is located after given position. When method returns `false` it does not mean that
  44293. * this position is before give one. Two positions may be located inside separate roots and in that situation this
  44294. * method will still return `false`.
  44295. *
  44296. * @see module:engine/view/position~Position#isBefore
  44297. * @see module:engine/view/position~Position#compareWith
  44298. * @param {module:engine/view/position~Position} otherPosition Position to compare with.
  44299. * @returns {Boolean} Returns `true` if this position is after given position.
  44300. */
  44301. isAfter( otherPosition ) {
  44302. return this.compareWith( otherPosition ) == 'after';
  44303. }
  44304. /**
  44305. * Checks whether this position is before, after or in same position that other position. Two positions may be also
  44306. * different when they are located in separate roots.
  44307. *
  44308. * @param {module:engine/view/position~Position} otherPosition Position to compare with.
  44309. * @returns {module:engine/view/position~PositionRelation}
  44310. */
  44311. compareWith( otherPosition ) {
  44312. if ( this.root !== otherPosition.root ) {
  44313. return 'different';
  44314. }
  44315. if ( this.isEqual( otherPosition ) ) {
  44316. return 'same';
  44317. }
  44318. // Get path from root to position's parent element.
  44319. const thisPath = this.parent.is( 'node' ) ? this.parent.getPath() : [];
  44320. const otherPath = otherPosition.parent.is( 'node' ) ? otherPosition.parent.getPath() : [];
  44321. // Add the positions' offsets to the parents offsets.
  44322. thisPath.push( this.offset );
  44323. otherPath.push( otherPosition.offset );
  44324. // Compare both path arrays to find common ancestor.
  44325. const result = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( thisPath, otherPath );
  44326. switch ( result ) {
  44327. case 'prefix':
  44328. return 'before';
  44329. case 'extension':
  44330. return 'after';
  44331. default:
  44332. return thisPath[ result ] < otherPath[ result ] ? 'before' : 'after';
  44333. }
  44334. }
  44335. /**
  44336. * Creates a {@link module:engine/view/treewalker~TreeWalker TreeWalker} instance with this positions as a start position.
  44337. *
  44338. * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}
  44339. * @param {module:engine/view/range~Range} [options.boundaries=null] Range to define boundaries of the iterator.
  44340. * @param {Boolean} [options.singleCharacters=false]
  44341. * @param {Boolean} [options.shallow=false]
  44342. * @param {Boolean} [options.ignoreElementEnd=false]
  44343. */
  44344. getWalker( options = {} ) {
  44345. options.startPosition = this;
  44346. return new _treewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( options );
  44347. }
  44348. clone() {
  44349. return new Position( this.parent, this.offset );
  44350. }
  44351. /**
  44352. * Creates position at the given location. The location can be specified as:
  44353. *
  44354. * * a {@link module:engine/view/position~Position position},
  44355. * * parent element and offset (offset defaults to `0`),
  44356. * * parent element and `'end'` (sets position at the end of that element),
  44357. * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).
  44358. *
  44359. * This method is a shortcut to other constructors such as:
  44360. *
  44361. * * {@link module:engine/view/position~Position._createBefore},
  44362. * * {@link module:engine/view/position~Position._createAfter}.
  44363. *
  44364. * @protected
  44365. * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
  44366. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  44367. * first parameter is a {@link module:engine/view/item~Item view item}.
  44368. */
  44369. static _createAt( itemOrPosition, offset ) {
  44370. if ( itemOrPosition instanceof Position ) {
  44371. return new this( itemOrPosition.parent, itemOrPosition.offset );
  44372. } else {
  44373. const node = itemOrPosition;
  44374. if ( offset == 'end' ) {
  44375. offset = node.is( '$text' ) ? node.data.length : node.childCount;
  44376. } else if ( offset == 'before' ) {
  44377. return this._createBefore( node );
  44378. } else if ( offset == 'after' ) {
  44379. return this._createAfter( node );
  44380. } else if ( offset !== 0 && !offset ) {
  44381. /**
  44382. * {@link module:engine/view/view~View#createPositionAt `View#createPositionAt()`}
  44383. * requires the offset to be specified when the first parameter is a view item.
  44384. *
  44385. * @error view-createpositionat-offset-required
  44386. */
  44387. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'view-createpositionat-offset-required', node );
  44388. }
  44389. return new Position( node, offset );
  44390. }
  44391. }
  44392. /**
  44393. * Creates a new position after given view item.
  44394. *
  44395. * @protected
  44396. * @param {module:engine/view/item~Item} item View item after which the position should be located.
  44397. * @returns {module:engine/view/position~Position}
  44398. */
  44399. static _createAfter( item ) {
  44400. // TextProxy is not a instance of Node so we need do handle it in specific way.
  44401. if ( item.is( '$textProxy' ) ) {
  44402. return new Position( item.textNode, item.offsetInText + item.data.length );
  44403. }
  44404. if ( !item.parent ) {
  44405. /**
  44406. * You can not make a position after a root.
  44407. *
  44408. * @error view-position-after-root
  44409. * @param {module:engine/view/node~Node} root
  44410. */
  44411. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'view-position-after-root', item, { root: item } );
  44412. }
  44413. return new Position( item.parent, item.index + 1 );
  44414. }
  44415. /**
  44416. * Creates a new position before given view item.
  44417. *
  44418. * @protected
  44419. * @param {module:engine/view/item~Item} item View item before which the position should be located.
  44420. * @returns {module:engine/view/position~Position}
  44421. */
  44422. static _createBefore( item ) {
  44423. // TextProxy is not a instance of Node so we need do handle it in specific way.
  44424. if ( item.is( '$textProxy' ) ) {
  44425. return new Position( item.textNode, item.offsetInText );
  44426. }
  44427. if ( !item.parent ) {
  44428. /**
  44429. * You cannot make a position before a root.
  44430. *
  44431. * @error view-position-before-root
  44432. * @param {module:engine/view/node~Node} root
  44433. */
  44434. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'view-position-before-root', item, { root: item } );
  44435. }
  44436. return new Position( item.parent, item.index );
  44437. }
  44438. }
  44439. /**
  44440. * A flag indicating whether this position is `'before'` or `'after'` or `'same'` as given position.
  44441. * If positions are in different roots `'different'` flag is returned.
  44442. *
  44443. * @typedef {String} module:engine/view/position~PositionRelation
  44444. */
  44445. /***/ }),
  44446. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js":
  44447. /*!*******************************************************************!*\
  44448. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js ***!
  44449. \*******************************************************************/
  44450. /*! exports provided: default */
  44451. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44452. "use strict";
  44453. __webpack_require__.r(__webpack_exports__);
  44454. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Range; });
  44455. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  44456. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js");
  44457. /**
  44458. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  44459. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  44460. */
  44461. /**
  44462. * @module engine/view/range
  44463. */
  44464. /**
  44465. * Range in the view tree. A range is represented by its start and end {@link module:engine/view/position~Position positions}.
  44466. *
  44467. * In order to create a new position instance use the `createPosition*()` factory methods available in:
  44468. *
  44469. * * {@link module:engine/view/view~View}
  44470. * * {@link module:engine/view/downcastwriter~DowncastWriter}
  44471. * * {@link module:engine/view/upcastwriter~UpcastWriter}
  44472. */
  44473. class Range {
  44474. /**
  44475. * Creates a range spanning from `start` position to `end` position.
  44476. *
  44477. * **Note:** Constructor creates it's own {@link module:engine/view/position~Position} instances basing on passed values.
  44478. *
  44479. * @param {module:engine/view/position~Position} start Start position.
  44480. * @param {module:engine/view/position~Position} [end] End position. If not set, range will be collapsed at the `start` position.
  44481. */
  44482. constructor( start, end = null ) {
  44483. /**
  44484. * Start position.
  44485. *
  44486. * @readonly
  44487. * @member {module:engine/view/position~Position}
  44488. */
  44489. this.start = start.clone();
  44490. /**
  44491. * End position.
  44492. *
  44493. * @readonly
  44494. * @member {module:engine/view/position~Position}
  44495. */
  44496. this.end = end ? end.clone() : start.clone();
  44497. }
  44498. /**
  44499. * Iterable interface.
  44500. *
  44501. * Iterates over all {@link module:engine/view/item~Item view items} that are in this range and returns
  44502. * them together with additional information like length or {@link module:engine/view/position~Position positions},
  44503. * grouped as {@link module:engine/view/treewalker~TreeWalkerValue}.
  44504. *
  44505. * This iterator uses {@link module:engine/view/treewalker~TreeWalker TreeWalker} with `boundaries` set to this range and
  44506. * `ignoreElementEnd` option
  44507. * set to `true`.
  44508. *
  44509. * @returns {Iterable.<module:engine/view/treewalker~TreeWalkerValue>}
  44510. */
  44511. * [ Symbol.iterator ]() {
  44512. yield* new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( { boundaries: this, ignoreElementEnd: true } );
  44513. }
  44514. /**
  44515. * Returns whether the range is collapsed, that is it start and end positions are equal.
  44516. *
  44517. * @type {Boolean}
  44518. */
  44519. get isCollapsed() {
  44520. return this.start.isEqual( this.end );
  44521. }
  44522. /**
  44523. * Returns whether this range is flat, that is if {@link module:engine/view/range~Range#start start} position and
  44524. * {@link module:engine/view/range~Range#end end} position are in the same {@link module:engine/view/position~Position#parent parent}.
  44525. *
  44526. * @type {Boolean}
  44527. */
  44528. get isFlat() {
  44529. return this.start.parent === this.end.parent;
  44530. }
  44531. /**
  44532. * Range root element.
  44533. *
  44534. * @type {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment}
  44535. */
  44536. get root() {
  44537. return this.start.root;
  44538. }
  44539. /**
  44540. * Creates a maximal range that has the same content as this range but is expanded in both ways (at the beginning
  44541. * and at the end).
  44542. *
  44543. * For example:
  44544. *
  44545. * <p>Foo</p><p><b>{Bar}</b></p> -> <p>Foo</p>[<p><b>Bar</b>]</p>
  44546. * <p><b>foo</b>{bar}<span></span></p> -> <p><b>foo[</b>bar<span></span>]</p>
  44547. *
  44548. * Note that in the sample above:
  44549. *
  44550. * - `<p>` have type of {@link module:engine/view/containerelement~ContainerElement},
  44551. * - `<b>` have type of {@link module:engine/view/attributeelement~AttributeElement},
  44552. * - `<span>` have type of {@link module:engine/view/uielement~UIElement}.
  44553. *
  44554. * @returns {module:engine/view/range~Range} Enlarged range.
  44555. */
  44556. getEnlarged() {
  44557. let start = this.start.getLastMatchingPosition( enlargeTrimSkip, { direction: 'backward' } );
  44558. let end = this.end.getLastMatchingPosition( enlargeTrimSkip );
  44559. // Fix positions, in case if they are in Text node.
  44560. if ( start.parent.is( '$text' ) && start.isAtStart ) {
  44561. start = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( start.parent );
  44562. }
  44563. if ( end.parent.is( '$text' ) && end.isAtEnd ) {
  44564. end = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( end.parent );
  44565. }
  44566. return new Range( start, end );
  44567. }
  44568. /**
  44569. * Creates a minimum range that has the same content as this range but is trimmed in both ways (at the beginning
  44570. * and at the end).
  44571. *
  44572. * For example:
  44573. *
  44574. * <p>Foo</p>[<p><b>Bar</b>]</p> -> <p>Foo</p><p><b>{Bar}</b></p>
  44575. * <p><b>foo[</b>bar<span></span>]</p> -> <p><b>foo</b>{bar}<span></span></p>
  44576. *
  44577. * Note that in the sample above:
  44578. *
  44579. * - `<p>` have type of {@link module:engine/view/containerelement~ContainerElement},
  44580. * - `<b>` have type of {@link module:engine/view/attributeelement~AttributeElement},
  44581. * - `<span>` have type of {@link module:engine/view/uielement~UIElement}.
  44582. *
  44583. * @returns {module:engine/view/range~Range} Shrink range.
  44584. */
  44585. getTrimmed() {
  44586. let start = this.start.getLastMatchingPosition( enlargeTrimSkip );
  44587. if ( start.isAfter( this.end ) || start.isEqual( this.end ) ) {
  44588. return new Range( start, start );
  44589. }
  44590. let end = this.end.getLastMatchingPosition( enlargeTrimSkip, { direction: 'backward' } );
  44591. const nodeAfterStart = start.nodeAfter;
  44592. const nodeBeforeEnd = end.nodeBefore;
  44593. // Because TreeWalker prefers positions next to text node, we need to move them manually into these text nodes.
  44594. if ( nodeAfterStart && nodeAfterStart.is( '$text' ) ) {
  44595. start = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeAfterStart, 0 );
  44596. }
  44597. if ( nodeBeforeEnd && nodeBeforeEnd.is( '$text' ) ) {
  44598. end = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeBeforeEnd, nodeBeforeEnd.data.length );
  44599. }
  44600. return new Range( start, end );
  44601. }
  44602. /**
  44603. * Two ranges are equal if their start and end positions are equal.
  44604. *
  44605. * @param {module:engine/view/range~Range} otherRange Range to compare with.
  44606. * @returns {Boolean} `true` if ranges are equal, `false` otherwise
  44607. */
  44608. isEqual( otherRange ) {
  44609. return this == otherRange || ( this.start.isEqual( otherRange.start ) && this.end.isEqual( otherRange.end ) );
  44610. }
  44611. /**
  44612. * Checks whether this range contains given {@link module:engine/view/position~Position position}.
  44613. *
  44614. * @param {module:engine/view/position~Position} position Position to check.
  44615. * @returns {Boolean} `true` if given {@link module:engine/view/position~Position position} is contained in this range,
  44616. * `false` otherwise.
  44617. */
  44618. containsPosition( position ) {
  44619. return position.isAfter( this.start ) && position.isBefore( this.end );
  44620. }
  44621. /**
  44622. * Checks whether this range contains given {@link module:engine/view/range~Range range}.
  44623. *
  44624. * @param {module:engine/view/range~Range} otherRange Range to check.
  44625. * @param {Boolean} [loose=false] Whether the check is loose or strict. If the check is strict (`false`), compared range cannot
  44626. * start or end at the same position as this range boundaries. If the check is loose (`true`), compared range can start, end or
  44627. * even be equal to this range. Note that collapsed ranges are always compared in strict mode.
  44628. * @returns {Boolean} `true` if given {@link module:engine/view/range~Range range} boundaries are contained by this range, `false`
  44629. * otherwise.
  44630. */
  44631. containsRange( otherRange, loose = false ) {
  44632. if ( otherRange.isCollapsed ) {
  44633. loose = false;
  44634. }
  44635. const containsStart = this.containsPosition( otherRange.start ) || ( loose && this.start.isEqual( otherRange.start ) );
  44636. const containsEnd = this.containsPosition( otherRange.end ) || ( loose && this.end.isEqual( otherRange.end ) );
  44637. return containsStart && containsEnd;
  44638. }
  44639. /**
  44640. * Computes which part(s) of this {@link module:engine/view/range~Range range} is not a part of given
  44641. * {@link module:engine/view/range~Range range}.
  44642. * Returned array contains zero, one or two {@link module:engine/view/range~Range ranges}.
  44643. *
  44644. * Examples:
  44645. *
  44646. * let foo = downcastWriter.createText( 'foo' );
  44647. * let img = downcastWriter.createContainerElement( 'img' );
  44648. * let bar = downcastWriter.createText( 'bar' );
  44649. * let p = downcastWriter.createContainerElement( 'p', null, [ foo, img, bar ] );
  44650. *
  44651. * let range = view.createRange( view.createPositionAt( foo, 2 ), view.createPositionAt( bar, 1 ); // "o", img, "b" are in range.
  44652. * let otherRange = view.createRange( // "oo", img, "ba" are in range.
  44653. * view.createPositionAt( foo, 1 ),
  44654. * view.createPositionAt( bar, 2 )
  44655. * );
  44656. * let transformed = range.getDifference( otherRange );
  44657. * // transformed array has no ranges because `otherRange` contains `range`
  44658. *
  44659. * otherRange = view.createRange( view.createPositionAt( foo, 1 ), view.createPositionAt( p, 2 ); // "oo", img are in range.
  44660. * transformed = range.getDifference( otherRange );
  44661. * // transformed array has one range: from ( p, 2 ) to ( bar, 1 )
  44662. *
  44663. * otherRange = view.createRange( view.createPositionAt( p, 1 ), view.createPositionAt( p, 2 ) ); // img is in range.
  44664. * transformed = range.getDifference( otherRange );
  44665. * // transformed array has two ranges: from ( foo, 1 ) to ( p, 1 ) and from ( p, 2 ) to ( bar, 1 )
  44666. *
  44667. * @param {module:engine/view/range~Range} otherRange Range to differentiate against.
  44668. * @returns {Array.<module:engine/view/range~Range>} The difference between ranges.
  44669. */
  44670. getDifference( otherRange ) {
  44671. const ranges = [];
  44672. if ( this.isIntersecting( otherRange ) ) {
  44673. // Ranges intersect.
  44674. if ( this.containsPosition( otherRange.start ) ) {
  44675. // Given range start is inside this range. This means that we have to
  44676. // add shrunken range - from the start to the middle of this range.
  44677. ranges.push( new Range( this.start, otherRange.start ) );
  44678. }
  44679. if ( this.containsPosition( otherRange.end ) ) {
  44680. // Given range end is inside this range. This means that we have to
  44681. // add shrunken range - from the middle of this range to the end.
  44682. ranges.push( new Range( otherRange.end, this.end ) );
  44683. }
  44684. } else {
  44685. // Ranges do not intersect, return the original range.
  44686. ranges.push( this.clone() );
  44687. }
  44688. return ranges;
  44689. }
  44690. /**
  44691. * Returns an intersection of this {@link module:engine/view/range~Range range} and given {@link module:engine/view/range~Range range}.
  44692. * Intersection is a common part of both of those ranges. If ranges has no common part, returns `null`.
  44693. *
  44694. * Examples:
  44695. *
  44696. * let foo = downcastWriter.createText( 'foo' );
  44697. * let img = downcastWriter.createContainerElement( 'img' );
  44698. * let bar = downcastWriter.createText( 'bar' );
  44699. * let p = downcastWriter.createContainerElement( 'p', null, [ foo, img, bar ] );
  44700. *
  44701. * let range = view.createRange( view.createPositionAt( foo, 2 ), view.createPositionAt( bar, 1 ); // "o", img, "b" are in range.
  44702. * let otherRange = view.createRange( view.createPositionAt( foo, 1 ), view.createPositionAt( p, 2 ); // "oo", img are in range.
  44703. * let transformed = range.getIntersection( otherRange ); // range from ( foo, 1 ) to ( p, 2 ).
  44704. *
  44705. * otherRange = view.createRange( view.createPositionAt( bar, 1 ), view.createPositionAt( bar, 3 ); "ar" is in range.
  44706. * transformed = range.getIntersection( otherRange ); // null - no common part.
  44707. *
  44708. * @param {module:engine/view/range~Range} otherRange Range to check for intersection.
  44709. * @returns {module:engine/view/range~Range|null} A common part of given ranges or `null` if ranges have no common part.
  44710. */
  44711. getIntersection( otherRange ) {
  44712. if ( this.isIntersecting( otherRange ) ) {
  44713. // Ranges intersect, so a common range will be returned.
  44714. // At most, it will be same as this range.
  44715. let commonRangeStart = this.start;
  44716. let commonRangeEnd = this.end;
  44717. if ( this.containsPosition( otherRange.start ) ) {
  44718. // Given range start is inside this range. This means thaNt we have to
  44719. // shrink common range to the given range start.
  44720. commonRangeStart = otherRange.start;
  44721. }
  44722. if ( this.containsPosition( otherRange.end ) ) {
  44723. // Given range end is inside this range. This means that we have to
  44724. // shrink common range to the given range end.
  44725. commonRangeEnd = otherRange.end;
  44726. }
  44727. return new Range( commonRangeStart, commonRangeEnd );
  44728. }
  44729. // Ranges do not intersect, so they do not have common part.
  44730. return null;
  44731. }
  44732. /**
  44733. * Creates a {@link module:engine/view/treewalker~TreeWalker TreeWalker} instance with this range as a boundary.
  44734. *
  44735. * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.
  44736. * @param {module:engine/view/position~Position} [options.startPosition]
  44737. * @param {Boolean} [options.singleCharacters=false]
  44738. * @param {Boolean} [options.shallow=false]
  44739. * @param {Boolean} [options.ignoreElementEnd=false]
  44740. * @returns {module:engine/view/treewalker~TreeWalker}
  44741. */
  44742. getWalker( options = {} ) {
  44743. options.boundaries = this;
  44744. return new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  44745. }
  44746. /**
  44747. * Returns a {@link module:engine/view/node~Node} or {@link module:engine/view/documentfragment~DocumentFragment}
  44748. * which is a common ancestor of range's both ends (in which the entire range is contained).
  44749. *
  44750. * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null}
  44751. */
  44752. getCommonAncestor() {
  44753. return this.start.getCommonAncestor( this.end );
  44754. }
  44755. /**
  44756. * Returns an {@link module:engine/view/element~Element Element} contained by the range.
  44757. * The element will be returned when it is the **only** node within the range and **fully–contained**
  44758. * at the same time.
  44759. *
  44760. * @returns {module:engine/view/element~Element|null}
  44761. */
  44762. getContainedElement() {
  44763. if ( this.isCollapsed ) {
  44764. return null;
  44765. }
  44766. let nodeAfterStart = this.start.nodeAfter;
  44767. let nodeBeforeEnd = this.end.nodeBefore;
  44768. // Handle the situation when the range position is at the beginning / at the end of a text node.
  44769. // In such situation `.nodeAfter` and `.nodeBefore` are `null` but the range still might be spanning
  44770. // over one element.
  44771. //
  44772. // <p>Foo{<span class="widget"></span>}bar</p> vs <p>Foo[<span class="widget"></span>]bar</p>
  44773. //
  44774. // These are basically the same range, only the difference is if the range position is at
  44775. // at the end/at the beginning of a text node or just before/just after the text node.
  44776. //
  44777. if ( this.start.parent.is( '$text' ) && this.start.isAtEnd && this.start.parent.nextSibling ) {
  44778. nodeAfterStart = this.start.parent.nextSibling;
  44779. }
  44780. if ( this.end.parent.is( '$text' ) && this.end.isAtStart && this.end.parent.previousSibling ) {
  44781. nodeBeforeEnd = this.end.parent.previousSibling;
  44782. }
  44783. if ( nodeAfterStart && nodeAfterStart.is( 'element' ) && nodeAfterStart === nodeBeforeEnd ) {
  44784. return nodeAfterStart;
  44785. }
  44786. return null;
  44787. }
  44788. /**
  44789. * Clones this range.
  44790. *
  44791. * @returns {module:engine/view/range~Range}
  44792. */
  44793. clone() {
  44794. return new Range( this.start, this.end );
  44795. }
  44796. /**
  44797. * Returns an iterator that iterates over all {@link module:engine/view/item~Item view items} that are in this range and returns
  44798. * them.
  44799. *
  44800. * This method uses {@link module:engine/view/treewalker~TreeWalker} with `boundaries` set to this range and `ignoreElementEnd` option
  44801. * set to `true`. However it returns only {@link module:engine/view/item~Item items},
  44802. * not {@link module:engine/view/treewalker~TreeWalkerValue}.
  44803. *
  44804. * You may specify additional options for the tree walker. See {@link module:engine/view/treewalker~TreeWalker} for
  44805. * a full list of available options.
  44806. *
  44807. * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.
  44808. * @returns {Iterable.<module:engine/view/item~Item>}
  44809. */
  44810. * getItems( options = {} ) {
  44811. options.boundaries = this;
  44812. options.ignoreElementEnd = true;
  44813. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  44814. for ( const value of treeWalker ) {
  44815. yield value.item;
  44816. }
  44817. }
  44818. /**
  44819. * Returns an iterator that iterates over all {@link module:engine/view/position~Position positions} that are boundaries or
  44820. * contained in this range.
  44821. *
  44822. * This method uses {@link module:engine/view/treewalker~TreeWalker} with `boundaries` set to this range. However it returns only
  44823. * {@link module:engine/view/position~Position positions}, not {@link module:engine/view/treewalker~TreeWalkerValue}.
  44824. *
  44825. * You may specify additional options for the tree walker. See {@link module:engine/view/treewalker~TreeWalker} for
  44826. * a full list of available options.
  44827. *
  44828. * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.
  44829. * @returns {Iterable.<module:engine/view/position~Position>}
  44830. */
  44831. * getPositions( options = {} ) {
  44832. options.boundaries = this;
  44833. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  44834. yield treeWalker.position;
  44835. for ( const value of treeWalker ) {
  44836. yield value.nextPosition;
  44837. }
  44838. }
  44839. /**
  44840. * Checks whether this object is of the given type.
  44841. *
  44842. * range.is( 'range' ); // -> true
  44843. * range.is( 'view:range' ); // -> true
  44844. *
  44845. * range.is( 'model:range' ); // -> false
  44846. * range.is( 'element' ); // -> false
  44847. * range.is( 'selection' ); // -> false
  44848. *
  44849. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  44850. *
  44851. * @param {String} type
  44852. * @returns {Boolean}
  44853. */
  44854. is( type ) {
  44855. return type === 'range' || type === 'view:range';
  44856. }
  44857. /**
  44858. * Checks and returns whether this range intersects with the given range.
  44859. *
  44860. * @param {module:engine/view/range~Range} otherRange Range to compare with.
  44861. * @returns {Boolean} True if ranges intersect.
  44862. */
  44863. isIntersecting( otherRange ) {
  44864. return this.start.isBefore( otherRange.end ) && this.end.isAfter( otherRange.start );
  44865. }
  44866. /**
  44867. * Creates a range from the given parents and offsets.
  44868. *
  44869. * @protected
  44870. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} startElement Start position
  44871. * parent element.
  44872. * @param {Number} startOffset Start position offset.
  44873. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} endElement End position
  44874. * parent element.
  44875. * @param {Number} endOffset End position offset.
  44876. * @returns {module:engine/view/range~Range} Created range.
  44877. */
  44878. static _createFromParentsAndOffsets( startElement, startOffset, endElement, endOffset ) {
  44879. return new this(
  44880. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( startElement, startOffset ),
  44881. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( endElement, endOffset )
  44882. );
  44883. }
  44884. /**
  44885. * Creates a new range, spreading from specified {@link module:engine/view/position~Position position} to a position moved by
  44886. * given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.
  44887. *
  44888. * @protected
  44889. * @param {module:engine/view/position~Position} position Beginning of the range.
  44890. * @param {Number} shift How long the range should be.
  44891. * @returns {module:engine/view/range~Range}
  44892. */
  44893. static _createFromPositionAndShift( position, shift ) {
  44894. const start = position;
  44895. const end = position.getShiftedBy( shift );
  44896. return shift > 0 ? new this( start, end ) : new this( end, start );
  44897. }
  44898. /**
  44899. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  44900. * that element and ends after the last child of that element.
  44901. *
  44902. * @protected
  44903. * @param {module:engine/view/element~Element} element Element which is a parent for the range.
  44904. * @returns {module:engine/view/range~Range}
  44905. */
  44906. static _createIn( element ) {
  44907. return this._createFromParentsAndOffsets( element, 0, element, element.childCount );
  44908. }
  44909. /**
  44910. * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.
  44911. *
  44912. * @protected
  44913. * @param {module:engine/view/item~Item} item
  44914. * @returns {module:engine/view/range~Range}
  44915. */
  44916. static _createOn( item ) {
  44917. const size = item.is( '$textProxy' ) ? item.offsetSize : 1;
  44918. return this._createFromPositionAndShift( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( item ), size );
  44919. }
  44920. }
  44921. // Function used by getEnlarged and getTrimmed methods.
  44922. function enlargeTrimSkip( value ) {
  44923. if ( value.item.is( 'attributeElement' ) || value.item.is( 'uiElement' ) ) {
  44924. return true;
  44925. }
  44926. return false;
  44927. }
  44928. /***/ }),
  44929. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/rawelement.js":
  44930. /*!************************************************************************!*\
  44931. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/rawelement.js ***!
  44932. \************************************************************************/
  44933. /*! exports provided: default */
  44934. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44935. "use strict";
  44936. __webpack_require__.r(__webpack_exports__);
  44937. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RawElement; });
  44938. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  44939. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  44940. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  44941. /**
  44942. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  44943. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  44944. */
  44945. /**
  44946. * @module engine/view/rawelement
  44947. */
  44948. /**
  44949. * The raw element class.
  44950. *
  44951. * The raw elements work as data containers ("wrappers", "sandboxes") but their children are not managed or
  44952. * even recognized by the editor. This encapsulation allows integrations to maintain custom DOM structures
  44953. * in the editor content without, for instance, worrying about compatibility with other editor features.
  44954. * Raw elements are a perfect tool for integration with external frameworks and data sources.
  44955. *
  44956. * Unlike {@link module:engine/view/uielement~UIElement UI elements}, raw elements act like real editor
  44957. * content (similar to {@link module:engine/view/containerelement~ContainerElement} or
  44958. * {@link module:engine/view/emptyelement~EmptyElement}), they are considered by the editor selection and
  44959. * {@link module:widget/utils~toWidget they can work as widgets}.
  44960. *
  44961. * To create a new raw element, use the
  44962. * {@link module:engine/view/downcastwriter~DowncastWriter#createRawElement `downcastWriter#createRawElement()`} method.
  44963. *
  44964. * @extends module:engine/view/element~Element
  44965. */
  44966. class RawElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  44967. /**
  44968. * Creates a new instance of a raw element.
  44969. *
  44970. * Throws the `view-rawelement-cannot-add` {@link module:utils/ckeditorerror~CKEditorError CKEditorError} when the `children`
  44971. * parameter is passed to inform that the usage of `RawElement` is incorrect (adding child nodes to `RawElement` is forbidden).
  44972. *
  44973. * @see module:engine/view/downcastwriter~DowncastWriter#createRawElement
  44974. * @protected
  44975. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  44976. * @param {String} name A node name.
  44977. * @param {Object|Iterable} [attrs] The collection of attributes.
  44978. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  44979. * A list of nodes to be inserted into the created element.
  44980. */
  44981. constructor( document, name, attrs, children ) {
  44982. super( document, name, attrs, children );
  44983. // Override the default of the base class.
  44984. this._isAllowedInsideAttributeElement = true;
  44985. /**
  44986. * Returns `null` because filler is not needed for raw elements.
  44987. *
  44988. * @method #getFillerOffset
  44989. * @returns {null} Always returns null.
  44990. */
  44991. this.getFillerOffset = getFillerOffset;
  44992. }
  44993. /**
  44994. * Checks whether this object is of the given type or name.
  44995. *
  44996. * rawElement.is( 'rawElement' ); // -> true
  44997. * rawElement.is( 'element' ); // -> true
  44998. * rawElement.is( 'node' ); // -> true
  44999. * rawElement.is( 'view:rawElement' ); // -> true
  45000. * rawElement.is( 'view:element' ); // -> true
  45001. * rawElement.is( 'view:node' ); // -> true
  45002. *
  45003. * rawElement.is( 'model:element' ); // -> false
  45004. * rawElement.is( 'documentFragment' ); // -> false
  45005. *
  45006. * Assuming that the object being checked is a raw element, you can also check its
  45007. * {@link module:engine/view/rawelement~RawElement#name name}:
  45008. *
  45009. * rawElement.is( 'img' ); // -> true if this is an img element
  45010. * rawElement.is( 'rawElement', 'img' ); // -> same as above
  45011. * text.is( 'img' ); -> false
  45012. *
  45013. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  45014. *
  45015. * @param {String} type The type to check when the `name` parameter is present.
  45016. * Otherwise, it acts like the `name` parameter.
  45017. * @param {String} [name] The element name.
  45018. * @returns {Boolean}
  45019. */
  45020. is( type, name = null ) {
  45021. if ( !name ) {
  45022. return type === 'rawElement' || type === 'view:rawElement' ||
  45023. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  45024. type === this.name || type === 'view:' + this.name ||
  45025. type === 'element' || type === 'view:element' ||
  45026. type === 'node' || type === 'view:node';
  45027. } else {
  45028. return name === this.name && (
  45029. type === 'rawElement' || type === 'view:rawElement' ||
  45030. type === 'element' || type === 'view:element'
  45031. );
  45032. }
  45033. }
  45034. /**
  45035. * Overrides the {@link module:engine/view/element~Element#_insertChild} method.
  45036. * Throws the `view-rawelement-cannot-add` {@link module:utils/ckeditorerror~CKEditorError CKEditorError} to prevent
  45037. * adding any child nodes to a raw element.
  45038. *
  45039. * @protected
  45040. */
  45041. _insertChild( index, nodes ) {
  45042. if ( nodes && ( nodes instanceof _node__WEBPACK_IMPORTED_MODULE_2__["default"] || Array.from( nodes ).length > 0 ) ) {
  45043. /**
  45044. * Cannot add children to a {@link module:engine/view/rawelement~RawElement} instance.
  45045. *
  45046. * @error view-rawelement-cannot-add
  45047. */
  45048. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  45049. 'view-rawelement-cannot-add',
  45050. [ this, nodes ]
  45051. );
  45052. }
  45053. }
  45054. /**
  45055. * This allows rendering the children of a {@link module:engine/view/rawelement~RawElement} on the DOM level.
  45056. * This method is called by the {@link module:engine/view/domconverter~DomConverter} with the raw DOM element
  45057. * passed as an argument, leaving the number and shape of the children up to the integrator.
  45058. *
  45059. * This method **must be defined** for the raw element to work:
  45060. *
  45061. * const myRawElement = downcastWriter.createRawElement( 'div' );
  45062. *
  45063. * myRawElement.render = function( domElement, domConverter ) {
  45064. * domConverter.setContentOf( domElement, '<b>This is the raw content of myRawElement.</b>' );
  45065. * };
  45066. *
  45067. * @method #render
  45068. * @param {HTMLElement} domElement The native DOM element representing the raw view element.
  45069. * @param {module:engine/view/domconverter~DomConverter} domConverter Instance of the DomConverter used to optimize the output.
  45070. */
  45071. }
  45072. // Returns `null` because block filler is not needed for raw elements.
  45073. //
  45074. // @returns {null}
  45075. function getFillerOffset() {
  45076. return null;
  45077. }
  45078. /***/ }),
  45079. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/renderer.js":
  45080. /*!**********************************************************************!*\
  45081. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/renderer.js ***!
  45082. \**********************************************************************/
  45083. /*! exports provided: default */
  45084. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45085. "use strict";
  45086. __webpack_require__.r(__webpack_exports__);
  45087. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Renderer; });
  45088. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  45089. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  45090. /* harmony import */ var _filler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filler */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js");
  45091. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  45092. /* harmony import */ var _ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/diff */ "./node_modules/@ckeditor/ckeditor5-utils/src/diff.js");
  45093. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_insertat__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/insertat */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/insertat.js");
  45094. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_remove__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/remove */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/remove.js");
  45095. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  45096. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  45097. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
  45098. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/isnode */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js");
  45099. /* harmony import */ var _ckeditor_ckeditor5_utils_src_fastdiff__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/fastdiff */ "./node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js");
  45100. /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  45101. /* harmony import */ var _theme_renderer_css__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../theme/renderer.css */ "./node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css");
  45102. /**
  45103. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  45104. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  45105. */
  45106. /* globals Node */
  45107. /**
  45108. * @module engine/view/renderer
  45109. */
  45110. /**
  45111. * Renderer is responsible for updating the DOM structure and the DOM selection based on
  45112. * the {@link module:engine/view/renderer~Renderer#markToSync information about updated view nodes}.
  45113. * In other words, it renders the view to the DOM.
  45114. *
  45115. * Its main responsibility is to make only the necessary, minimal changes to the DOM. However, unlike in many
  45116. * virtual DOM implementations, the primary reason for doing minimal changes is not the performance but ensuring
  45117. * that native editing features such as text composition, autocompletion, spell checking, selection's x-index are
  45118. * affected as little as possible.
  45119. *
  45120. * Renderer uses {@link module:engine/view/domconverter~DomConverter} to transform view nodes and positions
  45121. * to and from the DOM.
  45122. */
  45123. class Renderer {
  45124. /**
  45125. * Creates a renderer instance.
  45126. *
  45127. * @param {module:engine/view/domconverter~DomConverter} domConverter Converter instance.
  45128. * @param {module:engine/view/documentselection~DocumentSelection} selection View selection.
  45129. */
  45130. constructor( domConverter, selection ) {
  45131. /**
  45132. * Set of DOM Documents instances.
  45133. *
  45134. * @readonly
  45135. * @member {Set.<Document>}
  45136. */
  45137. this.domDocuments = new Set();
  45138. /**
  45139. * Converter instance.
  45140. *
  45141. * @readonly
  45142. * @member {module:engine/view/domconverter~DomConverter}
  45143. */
  45144. this.domConverter = domConverter;
  45145. /**
  45146. * Set of nodes which attributes changed and may need to be rendered.
  45147. *
  45148. * @readonly
  45149. * @member {Set.<module:engine/view/node~Node>}
  45150. */
  45151. this.markedAttributes = new Set();
  45152. /**
  45153. * Set of elements which child lists changed and may need to be rendered.
  45154. *
  45155. * @readonly
  45156. * @member {Set.<module:engine/view/node~Node>}
  45157. */
  45158. this.markedChildren = new Set();
  45159. /**
  45160. * Set of text nodes which text data changed and may need to be rendered.
  45161. *
  45162. * @readonly
  45163. * @member {Set.<module:engine/view/node~Node>}
  45164. */
  45165. this.markedTexts = new Set();
  45166. /**
  45167. * View selection. Renderer updates DOM selection based on the view selection.
  45168. *
  45169. * @readonly
  45170. * @member {module:engine/view/documentselection~DocumentSelection}
  45171. */
  45172. this.selection = selection;
  45173. /**
  45174. * Indicates if the view document is focused and selection can be rendered. Selection will not be rendered if
  45175. * this is set to `false`.
  45176. *
  45177. * @member {Boolean}
  45178. * @observable
  45179. */
  45180. this.set( 'isFocused', false );
  45181. /**
  45182. * Indicates whether the user is making a selection in the document (e.g. holding the mouse button and moving the cursor).
  45183. * When they stop selecting, the property goes back to `false`.
  45184. *
  45185. * Note: In some browsers, the renderer will stop rendering the selection and inline fillers while the user is making
  45186. * a selection to avoid glitches in DOM selection
  45187. * (https://github.com/ckeditor/ckeditor5/issues/10562, https://github.com/ckeditor/ckeditor5/issues/10723).
  45188. *
  45189. * @member {Boolean}
  45190. * @observable
  45191. */
  45192. this.set( 'isSelecting', false );
  45193. // Rendering the selection and inline filler manipulation should be postponed in (non-Android) Blink until the user finishes
  45194. // creating the selection in DOM to avoid accidental selection collapsing
  45195. // (https://github.com/ckeditor/ckeditor5/issues/10562, https://github.com/ckeditor/ckeditor5/issues/10723).
  45196. // When the user stops selecting, all pending changes should be rendered ASAP, though.
  45197. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_12__["default"].isBlink && !_ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_12__["default"].isAndroid ) {
  45198. this.on( 'change:isSelecting', () => {
  45199. if ( !this.isSelecting ) {
  45200. this.render();
  45201. }
  45202. } );
  45203. }
  45204. /**
  45205. * The text node in which the inline filler was rendered.
  45206. *
  45207. * @private
  45208. * @member {Text}
  45209. */
  45210. this._inlineFiller = null;
  45211. /**
  45212. * DOM element containing fake selection.
  45213. *
  45214. * @private
  45215. * @type {null|HTMLElement}
  45216. */
  45217. this._fakeSelectionContainer = null;
  45218. }
  45219. /**
  45220. * Marks a view node to be updated in the DOM by {@link #render `render()`}.
  45221. *
  45222. * Note that only view nodes whose parents have corresponding DOM elements need to be marked to be synchronized.
  45223. *
  45224. * @see #markedAttributes
  45225. * @see #markedChildren
  45226. * @see #markedTexts
  45227. *
  45228. * @param {module:engine/view/document~ChangeType} type Type of the change.
  45229. * @param {module:engine/view/node~Node} node Node to be marked.
  45230. */
  45231. markToSync( type, node ) {
  45232. if ( type === 'text' ) {
  45233. if ( this.domConverter.mapViewToDom( node.parent ) ) {
  45234. this.markedTexts.add( node );
  45235. }
  45236. } else {
  45237. // If the node has no DOM element it is not rendered yet,
  45238. // its children/attributes do not need to be marked to be sync.
  45239. if ( !this.domConverter.mapViewToDom( node ) ) {
  45240. return;
  45241. }
  45242. if ( type === 'attributes' ) {
  45243. this.markedAttributes.add( node );
  45244. } else if ( type === 'children' ) {
  45245. this.markedChildren.add( node );
  45246. } else {
  45247. /**
  45248. * Unknown type passed to Renderer.markToSync.
  45249. *
  45250. * @error view-renderer-unknown-type
  45251. */
  45252. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-renderer-unknown-type', this );
  45253. }
  45254. }
  45255. }
  45256. /**
  45257. * Renders all buffered changes ({@link #markedAttributes}, {@link #markedChildren} and {@link #markedTexts}) and
  45258. * the current view selection (if needed) to the DOM by applying a minimal set of changes to it.
  45259. *
  45260. * Renderer tries not to break the text composition (e.g. IME) and x-index of the selection,
  45261. * so it does as little as it is needed to update the DOM.
  45262. *
  45263. * Renderer also handles {@link module:engine/view/filler fillers}. Especially, it checks if the inline filler is needed
  45264. * at the selection position and adds or removes it. To prevent breaking text composition inline filler will not be
  45265. * removed as long as the selection is in the text node which needed it at first.
  45266. */
  45267. render() {
  45268. let inlineFillerPosition;
  45269. const isInlineFillerRenderingPossible = _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_12__["default"].isBlink && !_ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_12__["default"].isAndroid ? !this.isSelecting : true;
  45270. // Refresh mappings.
  45271. for ( const element of this.markedChildren ) {
  45272. this._updateChildrenMappings( element );
  45273. }
  45274. // Don't manipulate inline fillers while the selection is being made in (non-Android) Blink to prevent accidental
  45275. // DOM selection collapsing
  45276. // (https://github.com/ckeditor/ckeditor5/issues/10562, https://github.com/ckeditor/ckeditor5/issues/10723).
  45277. if ( isInlineFillerRenderingPossible ) {
  45278. // There was inline filler rendered in the DOM but it's not
  45279. // at the selection position any more, so we can remove it
  45280. // (cause even if it's needed, it must be placed in another location).
  45281. if ( this._inlineFiller && !this._isSelectionInInlineFiller() ) {
  45282. this._removeInlineFiller();
  45283. }
  45284. // If we've got the filler, let's try to guess its position in the view.
  45285. if ( this._inlineFiller ) {
  45286. inlineFillerPosition = this._getInlineFillerPosition();
  45287. }
  45288. // Otherwise, if it's needed, create it at the selection position.
  45289. else if ( this._needsInlineFillerAtSelection() ) {
  45290. inlineFillerPosition = this.selection.getFirstPosition();
  45291. // Do not use `markToSync` so it will be added even if the parent is already added.
  45292. this.markedChildren.add( inlineFillerPosition.parent );
  45293. }
  45294. }
  45295. // Paranoid check: we make sure the inline filler has any parent so it can be mapped to view position
  45296. // by DomConverter.
  45297. else if ( this._inlineFiller && this._inlineFiller.parentNode ) {
  45298. // While the user is making selection, preserve the inline filler at its original position.
  45299. inlineFillerPosition = this.domConverter.domPositionToView( this._inlineFiller );
  45300. }
  45301. for ( const element of this.markedAttributes ) {
  45302. this._updateAttrs( element );
  45303. }
  45304. for ( const element of this.markedChildren ) {
  45305. this._updateChildren( element, { inlineFillerPosition } );
  45306. }
  45307. for ( const node of this.markedTexts ) {
  45308. if ( !this.markedChildren.has( node.parent ) && this.domConverter.mapViewToDom( node.parent ) ) {
  45309. this._updateText( node, { inlineFillerPosition } );
  45310. }
  45311. }
  45312. // * Check whether the inline filler is required and where it really is in the DOM.
  45313. // At this point in most cases it will be in the DOM, but there are exceptions.
  45314. // For example, if the inline filler was deep in the created DOM structure, it will not be created.
  45315. // Similarly, if it was removed at the beginning of this function and then neither text nor children were updated,
  45316. // it will not be present. Fix those and similar scenarios.
  45317. // * Don't manipulate inline fillers while the selection is being made in (non-Android) Blink to prevent accidental
  45318. // DOM selection collapsing
  45319. // (https://github.com/ckeditor/ckeditor5/issues/10562, https://github.com/ckeditor/ckeditor5/issues/10723).
  45320. if ( isInlineFillerRenderingPossible ) {
  45321. if ( inlineFillerPosition ) {
  45322. const fillerDomPosition = this.domConverter.viewPositionToDom( inlineFillerPosition );
  45323. const domDocument = fillerDomPosition.parent.ownerDocument;
  45324. if ( !Object(_filler__WEBPACK_IMPORTED_MODULE_2__["startsWithFiller"])( fillerDomPosition.parent ) ) {
  45325. // Filler has not been created at filler position. Create it now.
  45326. this._inlineFiller = addInlineFiller( domDocument, fillerDomPosition.parent, fillerDomPosition.offset );
  45327. } else {
  45328. // Filler has been found, save it.
  45329. this._inlineFiller = fillerDomPosition.parent;
  45330. }
  45331. } else {
  45332. // There is no filler needed.
  45333. this._inlineFiller = null;
  45334. }
  45335. }
  45336. // First focus the new editing host, then update the selection.
  45337. // Otherwise, FF may throw an error (https://github.com/ckeditor/ckeditor5/issues/721).
  45338. this._updateFocus();
  45339. this._updateSelection();
  45340. this.markedTexts.clear();
  45341. this.markedAttributes.clear();
  45342. this.markedChildren.clear();
  45343. }
  45344. /**
  45345. * Updates mappings of view element's children.
  45346. *
  45347. * Children that were replaced in the view structure by similar elements (same tag name) are treated as 'replaced'.
  45348. * This means that their mappings can be updated so the new view elements are mapped to the existing DOM elements.
  45349. * Thanks to that these elements do not need to be re-rendered completely.
  45350. *
  45351. * @private
  45352. * @param {module:engine/view/node~Node} viewElement The view element whose children mappings will be updated.
  45353. */
  45354. _updateChildrenMappings( viewElement ) {
  45355. const domElement = this.domConverter.mapViewToDom( viewElement );
  45356. if ( !domElement ) {
  45357. // If there is no `domElement` it means that it was already removed from DOM and there is no need to process it.
  45358. return;
  45359. }
  45360. // Removing nodes from the DOM as we iterate can cause `actualDomChildren`
  45361. // (which is a live-updating `NodeList`) to get out of sync with the
  45362. // indices that we compute as we iterate over `actions`.
  45363. // This would produce incorrect element mappings.
  45364. //
  45365. // Converting live list to an array to make the list static.
  45366. const actualDomChildren = Array.from(
  45367. this.domConverter.mapViewToDom( viewElement ).childNodes
  45368. );
  45369. const expectedDomChildren = Array.from(
  45370. this.domConverter.viewChildrenToDom( viewElement, domElement.ownerDocument, { withChildren: false } )
  45371. );
  45372. const diff = this._diffNodeLists( actualDomChildren, expectedDomChildren );
  45373. const actions = this._findReplaceActions( diff, actualDomChildren, expectedDomChildren );
  45374. if ( actions.indexOf( 'replace' ) !== -1 ) {
  45375. const counter = { equal: 0, insert: 0, delete: 0 };
  45376. for ( const action of actions ) {
  45377. if ( action === 'replace' ) {
  45378. const insertIndex = counter.equal + counter.insert;
  45379. const deleteIndex = counter.equal + counter.delete;
  45380. const viewChild = viewElement.getChild( insertIndex );
  45381. // UIElement and RawElement are special cases. Their children are not stored in a view (#799)
  45382. // so we cannot use them with replacing flow (since they use view children during rendering
  45383. // which will always result in rendering empty elements).
  45384. if ( viewChild && !( viewChild.is( 'uiElement' ) || viewChild.is( 'rawElement' ) ) ) {
  45385. this._updateElementMappings( viewChild, actualDomChildren[ deleteIndex ] );
  45386. }
  45387. Object(_ckeditor_ckeditor5_utils_src_dom_remove__WEBPACK_IMPORTED_MODULE_6__["default"])( expectedDomChildren[ insertIndex ] );
  45388. counter.equal++;
  45389. } else {
  45390. counter[ action ]++;
  45391. }
  45392. }
  45393. }
  45394. }
  45395. /**
  45396. * Updates mappings of a given view element.
  45397. *
  45398. * @private
  45399. * @param {module:engine/view/node~Node} viewElement The view element whose mappings will be updated.
  45400. * @param {Node} domElement The DOM element representing the given view element.
  45401. */
  45402. _updateElementMappings( viewElement, domElement ) {
  45403. // Remap 'DomConverter' bindings.
  45404. this.domConverter.unbindDomElement( domElement );
  45405. this.domConverter.bindElements( domElement, viewElement );
  45406. // View element may have children which needs to be updated, but are not marked, mark them to update.
  45407. this.markedChildren.add( viewElement );
  45408. // Because we replace new view element mapping with the existing one, the corresponding DOM element
  45409. // will not be rerendered. The new view element may have different attributes than the previous one.
  45410. // Since its corresponding DOM element will not be rerendered, new attributes will not be added
  45411. // to the DOM, so we need to mark it here to make sure its attributes gets updated. See #1427 for more
  45412. // detailed case study.
  45413. // Also there are cases where replaced element is removed from the view structure and then has
  45414. // its attributes changed or removed. In such cases the element will not be present in `markedAttributes`
  45415. // and also may be the same (`element.isSimilar()`) as the reused element not having its attributes updated.
  45416. // To prevent such situations we always mark reused element to have its attributes rerenderd (#1560).
  45417. this.markedAttributes.add( viewElement );
  45418. }
  45419. /**
  45420. * Gets the position of the inline filler based on the current selection.
  45421. * Here, we assume that we know that the filler is needed and
  45422. * {@link #_isSelectionInInlineFiller is at the selection position}, and, since it is needed,
  45423. * it is somewhere at the selection position.
  45424. *
  45425. * Note: The filler position cannot be restored based on the filler's DOM text node, because
  45426. * when this method is called (before rendering), the bindings will often be broken. View-to-DOM
  45427. * bindings are only dependable after rendering.
  45428. *
  45429. * @private
  45430. * @returns {module:engine/view/position~Position}
  45431. */
  45432. _getInlineFillerPosition() {
  45433. const firstPos = this.selection.getFirstPosition();
  45434. if ( firstPos.parent.is( '$text' ) ) {
  45435. return _position__WEBPACK_IMPORTED_MODULE_1__["default"]._createBefore( this.selection.getFirstPosition().parent );
  45436. } else {
  45437. return firstPos;
  45438. }
  45439. }
  45440. /**
  45441. * Returns `true` if the selection has not left the inline filler's text node.
  45442. * If it is `true`, it means that the filler had been added for a reason and the selection did not
  45443. * leave the filler's text node. For example, the user can be in the middle of a composition so it should not be touched.
  45444. *
  45445. * @private
  45446. * @returns {Boolean} `true` if the inline filler and selection are in the same place.
  45447. */
  45448. _isSelectionInInlineFiller() {
  45449. if ( this.selection.rangeCount != 1 || !this.selection.isCollapsed ) {
  45450. return false;
  45451. }
  45452. // Note, we can't check if selection's position equals position of the
  45453. // this._inlineFiller node, because of #663. We may not be able to calculate
  45454. // the filler's position in the view at this stage.
  45455. // Instead, we check it the other way – whether selection is anchored in
  45456. // that text node or next to it.
  45457. // Possible options are:
  45458. // "FILLER{}"
  45459. // "FILLERadded-text{}"
  45460. const selectionPosition = this.selection.getFirstPosition();
  45461. const position = this.domConverter.viewPositionToDom( selectionPosition );
  45462. if ( position && Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( position.parent ) && Object(_filler__WEBPACK_IMPORTED_MODULE_2__["startsWithFiller"])( position.parent ) ) {
  45463. return true;
  45464. }
  45465. return false;
  45466. }
  45467. /**
  45468. * Removes the inline filler.
  45469. *
  45470. * @private
  45471. */
  45472. _removeInlineFiller() {
  45473. const domFillerNode = this._inlineFiller;
  45474. // Something weird happened and the stored node doesn't contain the filler's text.
  45475. if ( !Object(_filler__WEBPACK_IMPORTED_MODULE_2__["startsWithFiller"])( domFillerNode ) ) {
  45476. /**
  45477. * The inline filler node was lost. Most likely, something overwrote the filler text node
  45478. * in the DOM.
  45479. *
  45480. * @error view-renderer-filler-was-lost
  45481. */
  45482. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-renderer-filler-was-lost', this );
  45483. }
  45484. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_2__["isInlineFiller"])( domFillerNode ) ) {
  45485. domFillerNode.remove();
  45486. } else {
  45487. domFillerNode.data = domFillerNode.data.substr( _filler__WEBPACK_IMPORTED_MODULE_2__["INLINE_FILLER_LENGTH"] );
  45488. }
  45489. this._inlineFiller = null;
  45490. }
  45491. /**
  45492. * Checks if the inline {@link module:engine/view/filler filler} should be added.
  45493. *
  45494. * @private
  45495. * @returns {Boolean} `true` if the inline filler should be added.
  45496. */
  45497. _needsInlineFillerAtSelection() {
  45498. if ( this.selection.rangeCount != 1 || !this.selection.isCollapsed ) {
  45499. return false;
  45500. }
  45501. const selectionPosition = this.selection.getFirstPosition();
  45502. const selectionParent = selectionPosition.parent;
  45503. const selectionOffset = selectionPosition.offset;
  45504. // If there is no DOM root we do not care about fillers.
  45505. if ( !this.domConverter.mapViewToDom( selectionParent.root ) ) {
  45506. return false;
  45507. }
  45508. if ( !( selectionParent.is( 'element' ) ) ) {
  45509. return false;
  45510. }
  45511. // Prevent adding inline filler inside elements with contenteditable=false.
  45512. // https://github.com/ckeditor/ckeditor5-engine/issues/1170
  45513. if ( !isEditable( selectionParent ) ) {
  45514. return false;
  45515. }
  45516. // We have block filler, we do not need inline one.
  45517. if ( selectionOffset === selectionParent.getFillerOffset() ) {
  45518. return false;
  45519. }
  45520. const nodeBefore = selectionPosition.nodeBefore;
  45521. const nodeAfter = selectionPosition.nodeAfter;
  45522. if ( nodeBefore instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] || nodeAfter instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  45523. return false;
  45524. }
  45525. return true;
  45526. }
  45527. /**
  45528. * Checks if text needs to be updated and possibly updates it.
  45529. *
  45530. * @private
  45531. * @param {module:engine/view/text~Text} viewText View text to update.
  45532. * @param {Object} options
  45533. * @param {module:engine/view/position~Position} options.inlineFillerPosition The position where the inline
  45534. * filler should be rendered.
  45535. */
  45536. _updateText( viewText, options ) {
  45537. const domText = this.domConverter.findCorrespondingDomText( viewText );
  45538. const newDomText = this.domConverter.viewToDom( viewText, domText.ownerDocument );
  45539. const actualText = domText.data;
  45540. let expectedText = newDomText.data;
  45541. const filler = options.inlineFillerPosition;
  45542. if ( filler && filler.parent == viewText.parent && filler.offset == viewText.index ) {
  45543. expectedText = _filler__WEBPACK_IMPORTED_MODULE_2__["INLINE_FILLER"] + expectedText;
  45544. }
  45545. if ( actualText != expectedText ) {
  45546. const actions = Object(_ckeditor_ckeditor5_utils_src_fastdiff__WEBPACK_IMPORTED_MODULE_11__["default"])( actualText, expectedText );
  45547. for ( const action of actions ) {
  45548. if ( action.type === 'insert' ) {
  45549. domText.insertData( action.index, action.values.join( '' ) );
  45550. } else { // 'delete'
  45551. domText.deleteData( action.index, action.howMany );
  45552. }
  45553. }
  45554. }
  45555. }
  45556. /**
  45557. * Checks if attribute list needs to be updated and possibly updates it.
  45558. *
  45559. * @private
  45560. * @param {module:engine/view/element~Element} viewElement The view element to update.
  45561. */
  45562. _updateAttrs( viewElement ) {
  45563. const domElement = this.domConverter.mapViewToDom( viewElement );
  45564. if ( !domElement ) {
  45565. // If there is no `domElement` it means that 'viewElement' is outdated as its mapping was updated
  45566. // in 'this._updateChildrenMappings()'. There is no need to process it as new view element which
  45567. // replaced old 'viewElement' mapping was also added to 'this.markedAttributes'
  45568. // in 'this._updateChildrenMappings()' so it will be processed separately.
  45569. return;
  45570. }
  45571. const domAttrKeys = Array.from( domElement.attributes ).map( attr => attr.name );
  45572. const viewAttrKeys = viewElement.getAttributeKeys();
  45573. // Add or overwrite attributes.
  45574. for ( const key of viewAttrKeys ) {
  45575. this.domConverter.setDomElementAttribute( domElement, key, viewElement.getAttribute( key ), viewElement );
  45576. }
  45577. // Remove from DOM attributes which do not exists in the view.
  45578. for ( const key of domAttrKeys ) {
  45579. // All other attributes not present in the DOM should be removed.
  45580. if ( !viewElement.hasAttribute( key ) ) {
  45581. this.domConverter.removeDomElementAttribute( domElement, key );
  45582. }
  45583. }
  45584. }
  45585. /**
  45586. * Checks if elements child list needs to be updated and possibly updates it.
  45587. *
  45588. * @private
  45589. * @param {module:engine/view/element~Element} viewElement View element to update.
  45590. * @param {Object} options
  45591. * @param {module:engine/view/position~Position} options.inlineFillerPosition The position where the inline
  45592. * filler should be rendered.
  45593. */
  45594. _updateChildren( viewElement, options ) {
  45595. const domElement = this.domConverter.mapViewToDom( viewElement );
  45596. if ( !domElement ) {
  45597. // If there is no `domElement` it means that it was already removed from DOM.
  45598. // There is no need to process it. It will be processed when re-inserted.
  45599. return;
  45600. }
  45601. const inlineFillerPosition = options.inlineFillerPosition;
  45602. const actualDomChildren = this.domConverter.mapViewToDom( viewElement ).childNodes;
  45603. const expectedDomChildren = Array.from(
  45604. this.domConverter.viewChildrenToDom( viewElement, domElement.ownerDocument, { bind: true } )
  45605. );
  45606. // Inline filler element has to be created as it is present in the DOM, but not in the view. It is required
  45607. // during diffing so text nodes could be compared correctly and also during rendering to maintain
  45608. // proper order and indexes while updating the DOM.
  45609. if ( inlineFillerPosition && inlineFillerPosition.parent === viewElement ) {
  45610. addInlineFiller( domElement.ownerDocument, expectedDomChildren, inlineFillerPosition.offset );
  45611. }
  45612. const diff = this._diffNodeLists( actualDomChildren, expectedDomChildren );
  45613. let i = 0;
  45614. const nodesToUnbind = new Set();
  45615. // Handle deletions first.
  45616. // This is to prevent a situation where an element that already exists in `actualDomChildren` is inserted at a different
  45617. // index in `actualDomChildren`. Since `actualDomChildren` is a `NodeList`, this works like move, not like an insert,
  45618. // and it disrupts the whole algorithm. See https://github.com/ckeditor/ckeditor5/issues/6367.
  45619. //
  45620. // It doesn't matter in what order we remove or add nodes, as long as we remove and add correct nodes at correct indexes.
  45621. for ( const action of diff ) {
  45622. if ( action === 'delete' ) {
  45623. nodesToUnbind.add( actualDomChildren[ i ] );
  45624. Object(_ckeditor_ckeditor5_utils_src_dom_remove__WEBPACK_IMPORTED_MODULE_6__["default"])( actualDomChildren[ i ] );
  45625. } else if ( action === 'equal' ) {
  45626. i++;
  45627. }
  45628. }
  45629. i = 0;
  45630. for ( const action of diff ) {
  45631. if ( action === 'insert' ) {
  45632. Object(_ckeditor_ckeditor5_utils_src_dom_insertat__WEBPACK_IMPORTED_MODULE_5__["default"])( domElement, i, expectedDomChildren[ i ] );
  45633. i++;
  45634. } else if ( action === 'equal' ) {
  45635. // Force updating text nodes inside elements which did not change and do not need to be re-rendered (#1125).
  45636. // Do it here (not in the loop above) because only after insertions the `i` index is correct.
  45637. this._markDescendantTextToSync( this.domConverter.domToView( expectedDomChildren[ i ] ) );
  45638. i++;
  45639. }
  45640. }
  45641. // Unbind removed nodes. When node does not have a parent it means that it was removed from DOM tree during
  45642. // comparison with the expected DOM. We don't need to check child nodes, because if child node was reinserted,
  45643. // it was moved to DOM tree out of the removed node.
  45644. for ( const node of nodesToUnbind ) {
  45645. if ( !node.parentNode ) {
  45646. this.domConverter.unbindDomElement( node );
  45647. }
  45648. }
  45649. }
  45650. /**
  45651. * Shorthand for diffing two arrays or node lists of DOM nodes.
  45652. *
  45653. * @private
  45654. * @param {Array.<Node>|NodeList} actualDomChildren Actual DOM children
  45655. * @param {Array.<Node>|NodeList} expectedDomChildren Expected DOM children.
  45656. * @returns {Array.<String>} The list of actions based on the {@link module:utils/diff~diff} function.
  45657. */
  45658. _diffNodeLists( actualDomChildren, expectedDomChildren ) {
  45659. actualDomChildren = filterOutFakeSelectionContainer( actualDomChildren, this._fakeSelectionContainer );
  45660. return Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_4__["default"])( actualDomChildren, expectedDomChildren, sameNodes.bind( null, this.domConverter ) );
  45661. }
  45662. /**
  45663. * Finds DOM nodes that were replaced with the similar nodes (same tag name) in the view. All nodes are compared
  45664. * within one `insert`/`delete` action group, for example:
  45665. *
  45666. * Actual DOM: <p><b>Foo</b>Bar<i>Baz</i><b>Bax</b></p>
  45667. * Expected DOM: <p>Bar<b>123</b><i>Baz</i><b>456</b></p>
  45668. * Input actions: [ insert, insert, delete, delete, equal, insert, delete ]
  45669. * Output actions: [ insert, replace, delete, equal, replace ]
  45670. *
  45671. * @private
  45672. * @param {Array.<String>} actions Actions array which is a result of the {@link module:utils/diff~diff} function.
  45673. * @param {Array.<Node>|NodeList} actualDom Actual DOM children
  45674. * @param {Array.<Node>} expectedDom Expected DOM children.
  45675. * @returns {Array.<String>} Actions array modified with the `replace` actions.
  45676. */
  45677. _findReplaceActions( actions, actualDom, expectedDom ) {
  45678. // If there is no both 'insert' and 'delete' actions, no need to check for replaced elements.
  45679. if ( actions.indexOf( 'insert' ) === -1 || actions.indexOf( 'delete' ) === -1 ) {
  45680. return actions;
  45681. }
  45682. let newActions = [];
  45683. let actualSlice = [];
  45684. let expectedSlice = [];
  45685. const counter = { equal: 0, insert: 0, delete: 0 };
  45686. for ( const action of actions ) {
  45687. if ( action === 'insert' ) {
  45688. expectedSlice.push( expectedDom[ counter.equal + counter.insert ] );
  45689. } else if ( action === 'delete' ) {
  45690. actualSlice.push( actualDom[ counter.equal + counter.delete ] );
  45691. } else { // equal
  45692. newActions = newActions.concat( Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_4__["default"])( actualSlice, expectedSlice, areSimilar ).map( x => x === 'equal' ? 'replace' : x ) );
  45693. newActions.push( 'equal' );
  45694. // Reset stored elements on 'equal'.
  45695. actualSlice = [];
  45696. expectedSlice = [];
  45697. }
  45698. counter[ action ]++;
  45699. }
  45700. return newActions.concat( Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_4__["default"])( actualSlice, expectedSlice, areSimilar ).map( x => x === 'equal' ? 'replace' : x ) );
  45701. }
  45702. /**
  45703. * Marks text nodes to be synchronized.
  45704. *
  45705. * If a text node is passed, it will be marked. If an element is passed, all descendant text nodes inside it will be marked.
  45706. *
  45707. * @private
  45708. * @param {module:engine/view/node~Node} viewNode View node to sync.
  45709. */
  45710. _markDescendantTextToSync( viewNode ) {
  45711. if ( !viewNode ) {
  45712. return;
  45713. }
  45714. if ( viewNode.is( '$text' ) ) {
  45715. this.markedTexts.add( viewNode );
  45716. } else if ( viewNode.is( 'element' ) ) {
  45717. for ( const child of viewNode.getChildren() ) {
  45718. this._markDescendantTextToSync( child );
  45719. }
  45720. }
  45721. }
  45722. /**
  45723. * Checks if the selection needs to be updated and possibly updates it.
  45724. *
  45725. * @private
  45726. */
  45727. _updateSelection() {
  45728. // Block updating DOM selection in (non-Android) Blink while the user is selecting to prevent accidental selection collapsing.
  45729. // Note: Structural changes in DOM must trigger selection rendering, though. Nodes the selection was anchored
  45730. // to, may disappear in DOM which would break the selection (e.g. in real-time collaboration scenarios).
  45731. // https://github.com/ckeditor/ckeditor5/issues/10562, https://github.com/ckeditor/ckeditor5/issues/10723
  45732. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_12__["default"].isBlink && !_ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_12__["default"].isAndroid && this.isSelecting && !this.markedChildren.size ) {
  45733. return;
  45734. }
  45735. // If there is no selection - remove DOM and fake selections.
  45736. if ( this.selection.rangeCount === 0 ) {
  45737. this._removeDomSelection();
  45738. this._removeFakeSelection();
  45739. return;
  45740. }
  45741. const domRoot = this.domConverter.mapViewToDom( this.selection.editableElement );
  45742. // Do nothing if there is no focus, or there is no DOM element corresponding to selection's editable element.
  45743. if ( !this.isFocused || !domRoot ) {
  45744. return;
  45745. }
  45746. // Render selection.
  45747. if ( this.selection.isFake ) {
  45748. this._updateFakeSelection( domRoot );
  45749. } else {
  45750. this._removeFakeSelection();
  45751. this._updateDomSelection( domRoot );
  45752. }
  45753. }
  45754. /**
  45755. * Updates the fake selection.
  45756. *
  45757. * @private
  45758. * @param {HTMLElement} domRoot A valid DOM root where the fake selection container should be added.
  45759. */
  45760. _updateFakeSelection( domRoot ) {
  45761. const domDocument = domRoot.ownerDocument;
  45762. if ( !this._fakeSelectionContainer ) {
  45763. this._fakeSelectionContainer = createFakeSelectionContainer( domDocument );
  45764. }
  45765. const container = this._fakeSelectionContainer;
  45766. // Bind fake selection container with the current selection *position*.
  45767. this.domConverter.bindFakeSelection( container, this.selection );
  45768. if ( !this._fakeSelectionNeedsUpdate( domRoot ) ) {
  45769. return;
  45770. }
  45771. if ( !container.parentElement || container.parentElement != domRoot ) {
  45772. domRoot.appendChild( container );
  45773. }
  45774. container.textContent = this.selection.fakeSelectionLabel || '\u00A0';
  45775. const domSelection = domDocument.getSelection();
  45776. const domRange = domDocument.createRange();
  45777. domSelection.removeAllRanges();
  45778. domRange.selectNodeContents( container );
  45779. domSelection.addRange( domRange );
  45780. }
  45781. /**
  45782. * Updates the DOM selection.
  45783. *
  45784. * @private
  45785. * @param {HTMLElement} domRoot A valid DOM root where the DOM selection should be rendered.
  45786. */
  45787. _updateDomSelection( domRoot ) {
  45788. const domSelection = domRoot.ownerDocument.defaultView.getSelection();
  45789. // Let's check whether DOM selection needs updating at all.
  45790. if ( !this._domSelectionNeedsUpdate( domSelection ) ) {
  45791. return;
  45792. }
  45793. // Multi-range selection is not available in most browsers, and, at least in Chrome, trying to
  45794. // set such selection, that is not continuous, throws an error. Because of that, we will just use anchor
  45795. // and focus of view selection.
  45796. // Since we are not supporting multi-range selection, we also do not need to check if proper editable is
  45797. // selected. If there is any editable selected, it is okay (editable is taken from selection anchor).
  45798. const anchor = this.domConverter.viewPositionToDom( this.selection.anchor );
  45799. const focus = this.domConverter.viewPositionToDom( this.selection.focus );
  45800. domSelection.collapse( anchor.parent, anchor.offset );
  45801. domSelection.extend( focus.parent, focus.offset );
  45802. // Firefox–specific hack (https://github.com/ckeditor/ckeditor5-engine/issues/1439).
  45803. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_12__["default"].isGecko ) {
  45804. fixGeckoSelectionAfterBr( focus, domSelection );
  45805. }
  45806. }
  45807. /**
  45808. * Checks whether a given DOM selection needs to be updated.
  45809. *
  45810. * @private
  45811. * @param {Selection} domSelection The DOM selection to check.
  45812. * @returns {Boolean}
  45813. */
  45814. _domSelectionNeedsUpdate( domSelection ) {
  45815. if ( !this.domConverter.isDomSelectionCorrect( domSelection ) ) {
  45816. // Current DOM selection is in incorrect position. We need to update it.
  45817. return true;
  45818. }
  45819. const oldViewSelection = domSelection && this.domConverter.domSelectionToView( domSelection );
  45820. if ( oldViewSelection && this.selection.isEqual( oldViewSelection ) ) {
  45821. return false;
  45822. }
  45823. // If selection is not collapsed, it does not need to be updated if it is similar.
  45824. if ( !this.selection.isCollapsed && this.selection.isSimilar( oldViewSelection ) ) {
  45825. // Selection did not changed and is correct, do not update.
  45826. return false;
  45827. }
  45828. // Selections are not similar.
  45829. return true;
  45830. }
  45831. /**
  45832. * Checks whether the fake selection needs to be updated.
  45833. *
  45834. * @private
  45835. * @param {HTMLElement} domRoot A valid DOM root where a new fake selection container should be added.
  45836. * @returns {Boolean}
  45837. */
  45838. _fakeSelectionNeedsUpdate( domRoot ) {
  45839. const container = this._fakeSelectionContainer;
  45840. const domSelection = domRoot.ownerDocument.getSelection();
  45841. // Fake selection needs to be updated if there's no fake selection container, or the container currently sits
  45842. // in a different root.
  45843. if ( !container || container.parentElement !== domRoot ) {
  45844. return true;
  45845. }
  45846. // Make sure that the selection actually is within the fake selection.
  45847. if ( domSelection.anchorNode !== container && !container.contains( domSelection.anchorNode ) ) {
  45848. return true;
  45849. }
  45850. return container.textContent !== this.selection.fakeSelectionLabel;
  45851. }
  45852. /**
  45853. * Removes the DOM selection.
  45854. *
  45855. * @private
  45856. */
  45857. _removeDomSelection() {
  45858. for ( const doc of this.domDocuments ) {
  45859. const domSelection = doc.getSelection();
  45860. if ( domSelection.rangeCount ) {
  45861. const activeDomElement = doc.activeElement;
  45862. const viewElement = this.domConverter.mapDomToView( activeDomElement );
  45863. if ( activeDomElement && viewElement ) {
  45864. doc.getSelection().removeAllRanges();
  45865. }
  45866. }
  45867. }
  45868. }
  45869. /**
  45870. * Removes the fake selection.
  45871. *
  45872. * @private
  45873. */
  45874. _removeFakeSelection() {
  45875. const container = this._fakeSelectionContainer;
  45876. if ( container ) {
  45877. container.remove();
  45878. }
  45879. }
  45880. /**
  45881. * Checks if focus needs to be updated and possibly updates it.
  45882. *
  45883. * @private
  45884. */
  45885. _updateFocus() {
  45886. if ( this.isFocused ) {
  45887. const editable = this.selection.editableElement;
  45888. if ( editable ) {
  45889. this.domConverter.focus( editable );
  45890. }
  45891. }
  45892. }
  45893. }
  45894. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( Renderer, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_7__["default"] );
  45895. // Checks if provided element is editable.
  45896. //
  45897. // @private
  45898. // @param {module:engine/view/element~Element} element
  45899. // @returns {Boolean}
  45900. function isEditable( element ) {
  45901. if ( element.getAttribute( 'contenteditable' ) == 'false' ) {
  45902. return false;
  45903. }
  45904. const parent = element.findAncestor( element => element.hasAttribute( 'contenteditable' ) );
  45905. return !parent || parent.getAttribute( 'contenteditable' ) == 'true';
  45906. }
  45907. // Adds inline filler at a given position.
  45908. //
  45909. // The position can be given as an array of DOM nodes and an offset in that array,
  45910. // or a DOM parent element and an offset in that element.
  45911. //
  45912. // @private
  45913. // @param {Document} domDocument
  45914. // @param {Element|Array.<Node>} domParentOrArray
  45915. // @param {Number} offset
  45916. // @returns {Text} The DOM text node that contains an inline filler.
  45917. function addInlineFiller( domDocument, domParentOrArray, offset ) {
  45918. const childNodes = domParentOrArray instanceof Array ? domParentOrArray : domParentOrArray.childNodes;
  45919. const nodeAfterFiller = childNodes[ offset ];
  45920. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( nodeAfterFiller ) ) {
  45921. nodeAfterFiller.data = _filler__WEBPACK_IMPORTED_MODULE_2__["INLINE_FILLER"] + nodeAfterFiller.data;
  45922. return nodeAfterFiller;
  45923. } else {
  45924. const fillerNode = domDocument.createTextNode( _filler__WEBPACK_IMPORTED_MODULE_2__["INLINE_FILLER"] );
  45925. if ( Array.isArray( domParentOrArray ) ) {
  45926. childNodes.splice( offset, 0, fillerNode );
  45927. } else {
  45928. Object(_ckeditor_ckeditor5_utils_src_dom_insertat__WEBPACK_IMPORTED_MODULE_5__["default"])( domParentOrArray, offset, fillerNode );
  45929. }
  45930. return fillerNode;
  45931. }
  45932. }
  45933. // Whether two DOM nodes should be considered as similar.
  45934. // Nodes are considered similar if they have the same tag name.
  45935. //
  45936. // @private
  45937. // @param {Node} node1
  45938. // @param {Node} node2
  45939. // @returns {Boolean}
  45940. function areSimilar( node1, node2 ) {
  45941. return Object(_ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_10__["default"])( node1 ) && Object(_ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_10__["default"])( node2 ) &&
  45942. !Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( node1 ) && !Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( node2 ) &&
  45943. node1.nodeType !== Node.COMMENT_NODE && node2.nodeType !== Node.COMMENT_NODE &&
  45944. node1.tagName.toLowerCase() === node2.tagName.toLowerCase();
  45945. }
  45946. // Whether two dom nodes should be considered as the same.
  45947. // Two nodes which are considered the same are:
  45948. //
  45949. // * Text nodes with the same text.
  45950. // * Element nodes represented by the same object.
  45951. // * Two block filler elements.
  45952. //
  45953. // @private
  45954. // @param {String} blockFillerMode Block filler mode, see {@link module:engine/view/domconverter~DomConverter#blockFillerMode}.
  45955. // @param {Node} node1
  45956. // @param {Node} node2
  45957. // @returns {Boolean}
  45958. function sameNodes( domConverter, actualDomChild, expectedDomChild ) {
  45959. // Elements.
  45960. if ( actualDomChild === expectedDomChild ) {
  45961. return true;
  45962. }
  45963. // Texts.
  45964. else if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( actualDomChild ) && Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( expectedDomChild ) ) {
  45965. return actualDomChild.data === expectedDomChild.data;
  45966. }
  45967. // Block fillers.
  45968. else if ( domConverter.isBlockFiller( actualDomChild ) &&
  45969. domConverter.isBlockFiller( expectedDomChild ) ) {
  45970. return true;
  45971. }
  45972. // Not matching types.
  45973. return false;
  45974. }
  45975. // The following is a Firefox–specific hack (https://github.com/ckeditor/ckeditor5-engine/issues/1439).
  45976. // When the native DOM selection is at the end of the block and preceded by <br /> e.g.
  45977. //
  45978. // <p>foo<br/>[]</p>
  45979. //
  45980. // which happens a lot when using the soft line break, the browser fails to (visually) move the
  45981. // caret to the new line. A quick fix is as simple as force–refreshing the selection with the same range.
  45982. function fixGeckoSelectionAfterBr( focus, domSelection ) {
  45983. const parent = focus.parent;
  45984. // This fix works only when the focus point is at the very end of an element.
  45985. // There is no point in running it in cases unrelated to the browser bug.
  45986. if ( parent.nodeType != Node.ELEMENT_NODE || focus.offset != parent.childNodes.length - 1 ) {
  45987. return;
  45988. }
  45989. const childAtOffset = parent.childNodes[ focus.offset ];
  45990. // To stay on the safe side, the fix being as specific as possible, it targets only the
  45991. // selection which is at the very end of the element and preceded by <br />.
  45992. if ( childAtOffset && childAtOffset.tagName == 'BR' ) {
  45993. domSelection.addRange( domSelection.getRangeAt( 0 ) );
  45994. }
  45995. }
  45996. function filterOutFakeSelectionContainer( domChildList, fakeSelectionContainer ) {
  45997. const childList = Array.from( domChildList );
  45998. if ( childList.length == 0 || !fakeSelectionContainer ) {
  45999. return childList;
  46000. }
  46001. const last = childList[ childList.length - 1 ];
  46002. if ( last == fakeSelectionContainer ) {
  46003. childList.pop();
  46004. }
  46005. return childList;
  46006. }
  46007. // Creates a fake selection container for a given document.
  46008. //
  46009. // @private
  46010. // @param {Document} domDocument
  46011. // @returns {HTMLElement}
  46012. function createFakeSelectionContainer( domDocument ) {
  46013. const container = domDocument.createElement( 'div' );
  46014. container.className = 'ck-fake-selection-container';
  46015. Object.assign( container.style, {
  46016. position: 'fixed',
  46017. top: 0,
  46018. left: '-9999px',
  46019. // See https://github.com/ckeditor/ckeditor5/issues/752.
  46020. width: '42px'
  46021. } );
  46022. // Fill it with a text node so we can update it later.
  46023. container.textContent = '\u00A0';
  46024. return container;
  46025. }
  46026. /***/ }),
  46027. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.js":
  46028. /*!*********************************************************************************!*\
  46029. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.js ***!
  46030. \*********************************************************************************/
  46031. /*! exports provided: default */
  46032. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46033. "use strict";
  46034. __webpack_require__.r(__webpack_exports__);
  46035. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RootEditableElement; });
  46036. /* harmony import */ var _editableelement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editableelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js");
  46037. /**
  46038. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  46039. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  46040. */
  46041. /**
  46042. * @module engine/view/rooteditableelement
  46043. */
  46044. const rootNameSymbol = Symbol( 'rootName' );
  46045. /**
  46046. * Class representing a single root in the data view. A root can be either {@link ~RootEditableElement#isReadOnly editable or read-only},
  46047. * but in both cases it is called "an editable". Roots can contain other {@link module:engine/view/editableelement~EditableElement
  46048. * editable elements} making them "nested editables".
  46049. *
  46050. * @extends module:engine/view/editableelement~EditableElement
  46051. */
  46052. class RootEditableElement extends _editableelement__WEBPACK_IMPORTED_MODULE_0__["default"] {
  46053. /**
  46054. * Creates root editable element.
  46055. *
  46056. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  46057. * @param {String} name Node name.
  46058. */
  46059. constructor( document, name ) {
  46060. super( document, name );
  46061. /**
  46062. * Name of this root inside {@link module:engine/view/document~Document} that is an owner of this root. If no
  46063. * other name is set, `main` name is used.
  46064. *
  46065. * @readonly
  46066. * @member {String}
  46067. */
  46068. this.rootName = 'main';
  46069. }
  46070. /**
  46071. * Checks whether this object is of the given.
  46072. *
  46073. * rootEditableElement.is( 'rootElement' ); // -> true
  46074. * rootEditableElement.is( 'editableElement' ); // -> true
  46075. * rootEditableElement.is( 'element' ); // -> true
  46076. * rootEditableElement.is( 'node' ); // -> true
  46077. * rootEditableElement.is( 'view:editableElement' ); // -> true
  46078. * rootEditableElement.is( 'view:element' ); // -> true
  46079. * rootEditableElement.is( 'view:node' ); // -> true
  46080. *
  46081. * rootEditableElement.is( 'model:element' ); // -> false
  46082. * rootEditableElement.is( 'documentFragment' ); // -> false
  46083. *
  46084. * Assuming that the object being checked is a root editable element, you can also check its
  46085. * {@link module:engine/view/rooteditableelement~RootEditableElement#name name}:
  46086. *
  46087. * rootEditableElement.is( 'element', 'div' ); // -> true if this is a div root editable element
  46088. * rootEditableElement.is( 'rootElement', 'div' ); // -> same as above
  46089. * text.is( 'element', 'div' ); -> false
  46090. *
  46091. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  46092. *
  46093. * @param {String} type Type to check.
  46094. * @param {String} [name] Element name.
  46095. * @returns {Boolean}
  46096. */
  46097. is( type, name = null ) {
  46098. if ( !name ) {
  46099. return type === 'rootElement' || type === 'view:rootElement' ||
  46100. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  46101. type === 'editableElement' || type === 'view:editableElement' ||
  46102. type === 'containerElement' || type === 'view:containerElement' ||
  46103. type === 'element' || type === 'view:element' ||
  46104. type === 'node' || type === 'view:node';
  46105. } else {
  46106. return name === this.name && (
  46107. type === 'rootElement' || type === 'view:rootElement' ||
  46108. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  46109. type === 'editableElement' || type === 'view:editableElement' ||
  46110. type === 'containerElement' || type === 'view:containerElement' ||
  46111. type === 'element' || type === 'view:element'
  46112. );
  46113. }
  46114. }
  46115. get rootName() {
  46116. return this.getCustomProperty( rootNameSymbol );
  46117. }
  46118. set rootName( rootName ) {
  46119. this._setCustomProperty( rootNameSymbol, rootName );
  46120. }
  46121. /**
  46122. * Overrides old element name and sets new one.
  46123. * This is needed because view roots are created before they are attached to the DOM.
  46124. * The name of the root element is temporary at this stage. It has to be changed when the
  46125. * view root element is attached to the DOM element.
  46126. *
  46127. * @protected
  46128. * @param {String} name The new name of element.
  46129. */
  46130. set _name( name ) {
  46131. this.name = name;
  46132. }
  46133. }
  46134. /***/ }),
  46135. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js":
  46136. /*!***********************************************************************!*\
  46137. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js ***!
  46138. \***********************************************************************/
  46139. /*! exports provided: default */
  46140. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46141. "use strict";
  46142. __webpack_require__.r(__webpack_exports__);
  46143. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Selection; });
  46144. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  46145. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  46146. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  46147. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  46148. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  46149. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  46150. /* harmony import */ var _ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/count */ "./node_modules/@ckeditor/ckeditor5-utils/src/count.js");
  46151. /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  46152. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js");
  46153. /**
  46154. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  46155. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  46156. */
  46157. /**
  46158. * @module engine/view/selection
  46159. */
  46160. /**
  46161. * Class representing an arbirtary selection in the view.
  46162. * See also {@link module:engine/view/documentselection~DocumentSelection}.
  46163. *
  46164. * New selection instances can be created via the constructor or one these methods:
  46165. *
  46166. * * {@link module:engine/view/view~View#createSelection `View#createSelection()`},
  46167. * * {@link module:engine/view/upcastwriter~UpcastWriter#createSelection `UpcastWriter#createSelection()`}.
  46168. *
  46169. * A selection can consist of {@link module:engine/view/range~Range ranges} that can be set by using
  46170. * the {@link module:engine/view/selection~Selection#setTo `Selection#setTo()`} method.
  46171. */
  46172. class Selection {
  46173. /**
  46174. * Creates new selection instance.
  46175. *
  46176. * **Note**: The selection constructor is available as a factory method:
  46177. *
  46178. * * {@link module:engine/view/view~View#createSelection `View#createSelection()`},
  46179. * * {@link module:engine/view/upcastwriter~UpcastWriter#createSelection `UpcastWriter#createSelection()`}.
  46180. *
  46181. * // Creates empty selection without ranges.
  46182. * const selection = writer.createSelection();
  46183. *
  46184. * // Creates selection at the given range.
  46185. * const range = writer.createRange( start, end );
  46186. * const selection = writer.createSelection( range );
  46187. *
  46188. * // Creates selection at the given ranges
  46189. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  46190. * const selection = writer.createSelection( ranges );
  46191. *
  46192. * // Creates selection from the other selection.
  46193. * const otherSelection = writer.createSelection();
  46194. * const selection = writer.createSelection( otherSelection );
  46195. *
  46196. * // Creates selection from the document selection.
  46197. * const selection = writer.createSelection( editor.editing.view.document.selection );
  46198. *
  46199. * // Creates selection at the given position.
  46200. * const position = writer.createPositionFromPath( root, path );
  46201. * const selection = writer.createSelection( position );
  46202. *
  46203. * // Creates collapsed selection at the position of given item and offset.
  46204. * const paragraph = writer.createContainerElement( 'paragraph' );
  46205. * const selection = writer.createSelection( paragraph, offset );
  46206. *
  46207. * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
  46208. * // first child of that element and ends after the last child of that element.
  46209. * const selection = writer.createSelection( paragraph, 'in' );
  46210. *
  46211. * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
  46212. * // just after the item.
  46213. * const selection = writer.createSelection( paragraph, 'on' );
  46214. *
  46215. * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  46216. *
  46217. * // Creates backward selection.
  46218. * const selection = writer.createSelection( range, { backward: true } );
  46219. *
  46220. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  46221. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  46222. * represented in other way, for example by applying proper CSS class.
  46223. *
  46224. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  46225. * (and be properly handled by screen readers).
  46226. *
  46227. * // Creates fake selection with label.
  46228. * const selection = writer.createSelection( range, { fake: true, label: 'foo' } );
  46229. *
  46230. * @param {module:engine/view/selection~Selectable} [selectable=null]
  46231. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
  46232. * @param {Object} [options]
  46233. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  46234. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  46235. * @param {String} [options.label] Label for the fake selection.
  46236. */
  46237. constructor( selectable = null, placeOrOffset, options ) {
  46238. /**
  46239. * Stores all ranges that are selected.
  46240. *
  46241. * @protected
  46242. * @member {Array.<module:engine/view/range~Range>}
  46243. */
  46244. this._ranges = [];
  46245. /**
  46246. * Specifies whether the last added range was added as a backward or forward range.
  46247. *
  46248. * @protected
  46249. * @member {Boolean}
  46250. */
  46251. this._lastRangeBackward = false;
  46252. /**
  46253. * Specifies whether selection instance is fake.
  46254. *
  46255. * @private
  46256. * @member {Boolean}
  46257. */
  46258. this._isFake = false;
  46259. /**
  46260. * Fake selection's label.
  46261. *
  46262. * @private
  46263. * @member {String}
  46264. */
  46265. this._fakeSelectionLabel = '';
  46266. this.setTo( selectable, placeOrOffset, options );
  46267. }
  46268. /**
  46269. * Returns true if selection instance is marked as `fake`.
  46270. *
  46271. * @see #setTo
  46272. * @type {Boolean}
  46273. */
  46274. get isFake() {
  46275. return this._isFake;
  46276. }
  46277. /**
  46278. * Returns fake selection label.
  46279. *
  46280. * @see #setTo
  46281. * @type {String}
  46282. */
  46283. get fakeSelectionLabel() {
  46284. return this._fakeSelectionLabel;
  46285. }
  46286. /**
  46287. * Selection anchor. Anchor may be described as a position where the selection starts. Together with
  46288. * {@link #focus focus} they define the direction of selection, which is important
  46289. * when expanding/shrinking selection. Anchor is always the start or end of the most recent added range.
  46290. * It may be a bit unintuitive when there are multiple ranges in selection.
  46291. *
  46292. * @see #focus
  46293. * @type {module:engine/view/position~Position}
  46294. */
  46295. get anchor() {
  46296. if ( !this._ranges.length ) {
  46297. return null;
  46298. }
  46299. const range = this._ranges[ this._ranges.length - 1 ];
  46300. const anchor = this._lastRangeBackward ? range.end : range.start;
  46301. return anchor.clone();
  46302. }
  46303. /**
  46304. * Selection focus. Focus is a position where the selection ends.
  46305. *
  46306. * @see #anchor
  46307. * @type {module:engine/view/position~Position}
  46308. */
  46309. get focus() {
  46310. if ( !this._ranges.length ) {
  46311. return null;
  46312. }
  46313. const range = this._ranges[ this._ranges.length - 1 ];
  46314. const focus = this._lastRangeBackward ? range.start : range.end;
  46315. return focus.clone();
  46316. }
  46317. /**
  46318. * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is
  46319. * collapsed.
  46320. *
  46321. * @type {Boolean}
  46322. */
  46323. get isCollapsed() {
  46324. return this.rangeCount === 1 && this._ranges[ 0 ].isCollapsed;
  46325. }
  46326. /**
  46327. * Returns number of ranges in selection.
  46328. *
  46329. * @type {Number}
  46330. */
  46331. get rangeCount() {
  46332. return this._ranges.length;
  46333. }
  46334. /**
  46335. * Specifies whether the {@link #focus} precedes {@link #anchor}.
  46336. *
  46337. * @type {Boolean}
  46338. */
  46339. get isBackward() {
  46340. return !this.isCollapsed && this._lastRangeBackward;
  46341. }
  46342. /**
  46343. * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this selection, or `null`
  46344. * if the selection is not inside an editable element.
  46345. *
  46346. * @type {module:engine/view/editableelement~EditableElement|null}
  46347. */
  46348. get editableElement() {
  46349. if ( this.anchor ) {
  46350. return this.anchor.editableElement;
  46351. }
  46352. return null;
  46353. }
  46354. /**
  46355. * Returns an iterable that contains copies of all ranges added to the selection.
  46356. *
  46357. * @returns {Iterable.<module:engine/view/range~Range>}
  46358. */
  46359. * getRanges() {
  46360. for ( const range of this._ranges ) {
  46361. yield range.clone();
  46362. }
  46363. }
  46364. /**
  46365. * Returns copy of the first range in the selection. First range is the one which
  46366. * {@link module:engine/view/range~Range#start start} position {@link module:engine/view/position~Position#isBefore is before} start
  46367. * position of all other ranges (not to confuse with the first range added to the selection).
  46368. * Returns `null` if no ranges are added to selection.
  46369. *
  46370. * @returns {module:engine/view/range~Range|null}
  46371. */
  46372. getFirstRange() {
  46373. let first = null;
  46374. for ( const range of this._ranges ) {
  46375. if ( !first || range.start.isBefore( first.start ) ) {
  46376. first = range;
  46377. }
  46378. }
  46379. return first ? first.clone() : null;
  46380. }
  46381. /**
  46382. * Returns copy of the last range in the selection. Last range is the one which {@link module:engine/view/range~Range#end end}
  46383. * position {@link module:engine/view/position~Position#isAfter is after} end position of all other ranges (not to confuse
  46384. * with the last range added to the selection). Returns `null` if no ranges are added to selection.
  46385. *
  46386. * @returns {module:engine/view/range~Range|null}
  46387. */
  46388. getLastRange() {
  46389. let last = null;
  46390. for ( const range of this._ranges ) {
  46391. if ( !last || range.end.isAfter( last.end ) ) {
  46392. last = range;
  46393. }
  46394. }
  46395. return last ? last.clone() : null;
  46396. }
  46397. /**
  46398. * Returns copy of the first position in the selection. First position is the position that
  46399. * {@link module:engine/view/position~Position#isBefore is before} any other position in the selection ranges.
  46400. * Returns `null` if no ranges are added to selection.
  46401. *
  46402. * @returns {module:engine/view/position~Position|null}
  46403. */
  46404. getFirstPosition() {
  46405. const firstRange = this.getFirstRange();
  46406. return firstRange ? firstRange.start.clone() : null;
  46407. }
  46408. /**
  46409. * Returns copy of the last position in the selection. Last position is the position that
  46410. * {@link module:engine/view/position~Position#isAfter is after} any other position in the selection ranges.
  46411. * Returns `null` if no ranges are added to selection.
  46412. *
  46413. * @returns {module:engine/view/position~Position|null}
  46414. */
  46415. getLastPosition() {
  46416. const lastRange = this.getLastRange();
  46417. return lastRange ? lastRange.end.clone() : null;
  46418. }
  46419. /**
  46420. * Checks whether, this selection is equal to given selection. Selections are equal if they have same directions,
  46421. * same number of ranges and all ranges from one selection equal to a range from other selection.
  46422. *
  46423. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} otherSelection
  46424. * Selection to compare with.
  46425. * @returns {Boolean} `true` if selections are equal, `false` otherwise.
  46426. */
  46427. isEqual( otherSelection ) {
  46428. if ( this.isFake != otherSelection.isFake ) {
  46429. return false;
  46430. }
  46431. if ( this.isFake && this.fakeSelectionLabel != otherSelection.fakeSelectionLabel ) {
  46432. return false;
  46433. }
  46434. if ( this.rangeCount != otherSelection.rangeCount ) {
  46435. return false;
  46436. } else if ( this.rangeCount === 0 ) {
  46437. return true;
  46438. }
  46439. if ( !this.anchor.isEqual( otherSelection.anchor ) || !this.focus.isEqual( otherSelection.focus ) ) {
  46440. return false;
  46441. }
  46442. for ( const thisRange of this._ranges ) {
  46443. let found = false;
  46444. for ( const otherRange of otherSelection._ranges ) {
  46445. if ( thisRange.isEqual( otherRange ) ) {
  46446. found = true;
  46447. break;
  46448. }
  46449. }
  46450. if ( !found ) {
  46451. return false;
  46452. }
  46453. }
  46454. return true;
  46455. }
  46456. /**
  46457. * Checks whether this selection is similar to given selection. Selections are similar if they have same directions, same
  46458. * number of ranges, and all {@link module:engine/view/range~Range#getTrimmed trimmed} ranges from one selection are
  46459. * equal to any trimmed range from other selection.
  46460. *
  46461. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} otherSelection
  46462. * Selection to compare with.
  46463. * @returns {Boolean} `true` if selections are similar, `false` otherwise.
  46464. */
  46465. isSimilar( otherSelection ) {
  46466. if ( this.isBackward != otherSelection.isBackward ) {
  46467. return false;
  46468. }
  46469. const numOfRangesA = Object(_ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_6__["default"])( this.getRanges() );
  46470. const numOfRangesB = Object(_ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_6__["default"])( otherSelection.getRanges() );
  46471. // If selections have different number of ranges, they cannot be similar.
  46472. if ( numOfRangesA != numOfRangesB ) {
  46473. return false;
  46474. }
  46475. // If both selections have no ranges, they are similar.
  46476. if ( numOfRangesA == 0 ) {
  46477. return true;
  46478. }
  46479. // Check if each range in one selection has a similar range in other selection.
  46480. for ( let rangeA of this.getRanges() ) {
  46481. rangeA = rangeA.getTrimmed();
  46482. let found = false;
  46483. for ( let rangeB of otherSelection.getRanges() ) {
  46484. rangeB = rangeB.getTrimmed();
  46485. if ( rangeA.start.isEqual( rangeB.start ) && rangeA.end.isEqual( rangeB.end ) ) {
  46486. found = true;
  46487. break;
  46488. }
  46489. }
  46490. // For `rangeA`, neither range in `otherSelection` was similar. So selections are not similar.
  46491. if ( !found ) {
  46492. return false;
  46493. }
  46494. }
  46495. // There were no ranges that weren't matched. Selections are similar.
  46496. return true;
  46497. }
  46498. /**
  46499. * Returns the selected element. {@link module:engine/view/element~Element Element} is considered as selected if there is only
  46500. * one range in the selection, and that range contains exactly one element.
  46501. * Returns `null` if there is no selected element.
  46502. *
  46503. * @returns {module:engine/view/element~Element|null}
  46504. */
  46505. getSelectedElement() {
  46506. if ( this.rangeCount !== 1 ) {
  46507. return null;
  46508. }
  46509. return this.getFirstRange().getContainedElement();
  46510. }
  46511. /**
  46512. * Sets this selection's ranges and direction to the specified location based on the given
  46513. * {@link module:engine/view/selection~Selectable selectable}.
  46514. *
  46515. * // Sets selection to the given range.
  46516. * const range = writer.createRange( start, end );
  46517. * selection.setTo( range );
  46518. *
  46519. * // Sets selection to given ranges.
  46520. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  46521. * selection.setTo( range );
  46522. *
  46523. * // Sets selection to the other selection.
  46524. * const otherSelection = writer.createSelection();
  46525. * selection.setTo( otherSelection );
  46526. *
  46527. * // Sets selection to contents of DocumentSelection.
  46528. * selection.setTo( editor.editing.view.document.selection );
  46529. *
  46530. * // Sets collapsed selection at the given position.
  46531. * const position = writer.createPositionAt( root, path );
  46532. * selection.setTo( position );
  46533. *
  46534. * // Sets collapsed selection at the position of given item and offset.
  46535. * selection.setTo( paragraph, offset );
  46536. *
  46537. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  46538. * that element and ends after the last child of that element.
  46539. *
  46540. * selection.setTo( paragraph, 'in' );
  46541. *
  46542. * Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends just after the item.
  46543. *
  46544. * selection.setTo( paragraph, 'on' );
  46545. *
  46546. * // Clears selection. Removes all ranges.
  46547. * selection.setTo( null );
  46548. *
  46549. * `Selection#setTo()` method allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  46550. *
  46551. * // Sets selection as backward.
  46552. * selection.setTo( range, { backward: true } );
  46553. *
  46554. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  46555. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  46556. * represented in other way, for example by applying proper CSS class.
  46557. *
  46558. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  46559. * (and be properly handled by screen readers).
  46560. *
  46561. * // Creates fake selection with label.
  46562. * selection.setTo( range, { fake: true, label: 'foo' } );
  46563. *
  46564. * @fires change
  46565. * @param {module:engine/view/selection~Selectable} selectable
  46566. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  46567. * @param {Object} [options]
  46568. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  46569. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  46570. * @param {String} [options.label] Label for the fake selection.
  46571. */
  46572. setTo( selectable, placeOrOffset, options ) {
  46573. if ( selectable === null ) {
  46574. this._setRanges( [] );
  46575. this._setFakeOptions( placeOrOffset );
  46576. } else if ( selectable instanceof Selection || selectable instanceof _documentselection__WEBPACK_IMPORTED_MODULE_8__["default"] ) {
  46577. this._setRanges( selectable.getRanges(), selectable.isBackward );
  46578. this._setFakeOptions( { fake: selectable.isFake, label: selectable.fakeSelectionLabel } );
  46579. } else if ( selectable instanceof _range__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  46580. this._setRanges( [ selectable ], placeOrOffset && placeOrOffset.backward );
  46581. this._setFakeOptions( placeOrOffset );
  46582. } else if ( selectable instanceof _position__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  46583. this._setRanges( [ new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( selectable ) ] );
  46584. this._setFakeOptions( placeOrOffset );
  46585. } else if ( selectable instanceof _node__WEBPACK_IMPORTED_MODULE_5__["default"] ) {
  46586. const backward = !!options && !!options.backward;
  46587. let range;
  46588. if ( placeOrOffset === undefined ) {
  46589. /**
  46590. * selection.setTo requires the second parameter when the first parameter is a node.
  46591. *
  46592. * @error view-selection-setto-required-second-parameter
  46593. */
  46594. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-selection-setto-required-second-parameter', this );
  46595. } else if ( placeOrOffset == 'in' ) {
  46596. range = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( selectable );
  46597. } else if ( placeOrOffset == 'on' ) {
  46598. range = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( selectable );
  46599. } else {
  46600. range = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( selectable, placeOrOffset ) );
  46601. }
  46602. this._setRanges( [ range ], backward );
  46603. this._setFakeOptions( options );
  46604. } else if ( Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__["default"])( selectable ) ) {
  46605. // We assume that the selectable is an iterable of ranges.
  46606. // Array.from() is used to prevent setting ranges to the old iterable
  46607. this._setRanges( selectable, placeOrOffset && placeOrOffset.backward );
  46608. this._setFakeOptions( placeOrOffset );
  46609. } else {
  46610. /**
  46611. * Cannot set selection to given place.
  46612. *
  46613. * @error view-selection-setto-not-selectable
  46614. */
  46615. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-selection-setto-not-selectable', this );
  46616. }
  46617. this.fire( 'change' );
  46618. }
  46619. /**
  46620. * Moves {@link #focus} to the specified location.
  46621. *
  46622. * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}
  46623. * parameters.
  46624. *
  46625. * @fires change
  46626. * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
  46627. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  46628. * first parameter is a {@link module:engine/view/item~Item view item}.
  46629. */
  46630. setFocus( itemOrPosition, offset ) {
  46631. if ( this.anchor === null ) {
  46632. /**
  46633. * Cannot set selection focus if there are no ranges in selection.
  46634. *
  46635. * @error view-selection-setfocus-no-ranges
  46636. */
  46637. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-selection-setfocus-no-ranges', this );
  46638. }
  46639. const newFocus = _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( itemOrPosition, offset );
  46640. if ( newFocus.compareWith( this.focus ) == 'same' ) {
  46641. return;
  46642. }
  46643. const anchor = this.anchor;
  46644. this._ranges.pop();
  46645. if ( newFocus.compareWith( anchor ) == 'before' ) {
  46646. this._addRange( new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( newFocus, anchor ), true );
  46647. } else {
  46648. this._addRange( new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( anchor, newFocus ) );
  46649. }
  46650. this.fire( 'change' );
  46651. }
  46652. /**
  46653. * Checks whether this object is of the given type.
  46654. *
  46655. * selection.is( 'selection' ); // -> true
  46656. * selection.is( 'view:selection' ); // -> true
  46657. *
  46658. * selection.is( 'model:selection' ); // -> false
  46659. * selection.is( 'element' ); // -> false
  46660. * selection.is( 'range' ); // -> false
  46661. *
  46662. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  46663. *
  46664. * @param {String} type
  46665. * @returns {Boolean}
  46666. */
  46667. is( type ) {
  46668. return type === 'selection' || type === 'view:selection';
  46669. }
  46670. /**
  46671. * Replaces all ranges that were added to the selection with given array of ranges. Last range of the array
  46672. * is treated like the last added range and is used to set {@link #anchor anchor} and {@link #focus focus}.
  46673. * Accepts a flag describing in which way the selection is made.
  46674. *
  46675. * @private
  46676. * @param {Iterable.<module:engine/view/range~Range>} newRanges Iterable object of ranges to set.
  46677. * @param {Boolean} [isLastBackward=false] Flag describing if last added range was selected forward - from start to end
  46678. * (`false`) or backward - from end to start (`true`). Defaults to `false`.
  46679. */
  46680. _setRanges( newRanges, isLastBackward = false ) {
  46681. // New ranges should be copied to prevent removing them by setting them to `[]` first.
  46682. // Only applies to situations when selection is set to the same selection or same selection's ranges.
  46683. newRanges = Array.from( newRanges );
  46684. this._ranges = [];
  46685. for ( const range of newRanges ) {
  46686. this._addRange( range );
  46687. }
  46688. this._lastRangeBackward = !!isLastBackward;
  46689. }
  46690. /**
  46691. * Sets this selection instance to be marked as `fake`. A fake selection does not render as browser native selection
  46692. * over selected elements and is hidden to the user. This way, no native selection UI artifacts are displayed to
  46693. * the user and selection over elements can be represented in other way, for example by applying proper CSS class.
  46694. *
  46695. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM (and be
  46696. * properly handled by screen readers).
  46697. *
  46698. * @private
  46699. * @param {Object} [options] Options.
  46700. * @param {Boolean} [options.fake] If set to true selection will be marked as `fake`.
  46701. * @param {String} [options.label=''] Fake selection label.
  46702. */
  46703. _setFakeOptions( options = {} ) {
  46704. this._isFake = !!options.fake;
  46705. this._fakeSelectionLabel = options.fake ? options.label || '' : '';
  46706. }
  46707. /**
  46708. * Adds a range to the selection. Added range is copied. This means that passed range is not saved in the
  46709. * selection instance and you can safely operate on it.
  46710. *
  46711. * Accepts a flag describing in which way the selection is made - passed range might be selected from
  46712. * {@link module:engine/view/range~Range#start start} to {@link module:engine/view/range~Range#end end}
  46713. * or from {@link module:engine/view/range~Range#end end} to {@link module:engine/view/range~Range#start start}.
  46714. * The flag is used to set {@link #anchor anchor} and {@link #focus focus} properties.
  46715. *
  46716. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-selection-range-intersects` if added range intersects
  46717. * with ranges already stored in Selection instance.
  46718. *
  46719. * @private
  46720. * @fires change
  46721. * @param {module:engine/view/range~Range} range
  46722. * @param {Boolean} [isBackward]
  46723. */
  46724. _addRange( range, isBackward = false ) {
  46725. if ( !( range instanceof _range__WEBPACK_IMPORTED_MODULE_1__["default"] ) ) {
  46726. /**
  46727. * Selection range set to an object that is not an instance of {@link module:engine/view/range~Range}.
  46728. *
  46729. * @error view-selection-add-range-not-range
  46730. */
  46731. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  46732. 'view-selection-add-range-not-range',
  46733. this
  46734. );
  46735. }
  46736. this._pushRange( range );
  46737. this._lastRangeBackward = !!isBackward;
  46738. }
  46739. /**
  46740. * Adds range to selection - creates copy of given range so it can be safely used and modified.
  46741. *
  46742. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-selection-range-intersects` if added range intersects
  46743. * with ranges already stored in selection instance.
  46744. *
  46745. * @private
  46746. * @param {module:engine/view/range~Range} range
  46747. */
  46748. _pushRange( range ) {
  46749. for ( const storedRange of this._ranges ) {
  46750. if ( range.isIntersecting( storedRange ) ) {
  46751. /**
  46752. * Trying to add a range that intersects with another range from selection.
  46753. *
  46754. * @error view-selection-range-intersects
  46755. * @param {module:engine/view/range~Range} addedRange Range that was added to the selection.
  46756. * @param {module:engine/view/range~Range} intersectingRange Range from selection that intersects with `addedRange`.
  46757. */
  46758. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  46759. 'view-selection-range-intersects',
  46760. this,
  46761. { addedRange: range, intersectingRange: storedRange }
  46762. );
  46763. }
  46764. }
  46765. this._ranges.push( new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( range.start, range.end ) );
  46766. }
  46767. /**
  46768. * Fired whenever selection ranges are changed through {@link ~Selection Selection API}.
  46769. *
  46770. * @event change
  46771. */
  46772. }
  46773. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( Selection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
  46774. /**
  46775. * An entity that is used to set selection.
  46776. *
  46777. * See also {@link module:engine/view/selection~Selection#setTo}
  46778. *
  46779. * @typedef {
  46780. * module:engine/view/selection~Selection|
  46781. * module:engine/view/documentselection~DocumentSelection|
  46782. * module:engine/view/position~Position|
  46783. * Iterable.<module:engine/view/range~Range>|
  46784. * module:engine/view/range~Range|
  46785. * module:engine/view/item~Item|
  46786. * null
  46787. * } module:engine/view/selection~Selectable
  46788. */
  46789. /***/ }),
  46790. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/background.js":
  46791. /*!*******************************************************************************!*\
  46792. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/background.js ***!
  46793. \*******************************************************************************/
  46794. /*! exports provided: addBackgroundRules */
  46795. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46796. "use strict";
  46797. __webpack_require__.r(__webpack_exports__);
  46798. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addBackgroundRules", function() { return addBackgroundRules; });
  46799. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js");
  46800. /**
  46801. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  46802. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  46803. */
  46804. /**
  46805. * @module engine/view/styles/background
  46806. */
  46807. /**
  46808. * Adds a background CSS styles processing rules.
  46809. *
  46810. * editor.data.addStyleProcessorRules( addBackgroundRules );
  46811. *
  46812. * The normalized value is stored as:
  46813. *
  46814. * const styles = {
  46815. * background: {
  46816. * color,
  46817. * repeat,
  46818. * position,
  46819. * attachment,
  46820. * image
  46821. * }
  46822. * };
  46823. *
  46824. * **Note**: Currently only `'background-color'` longhand value is parsed besides `'background'` shorthand. The reducer also supports only
  46825. * `'background-color'` value.
  46826. *
  46827. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
  46828. */
  46829. function addBackgroundRules( stylesProcessor ) {
  46830. stylesProcessor.setNormalizer( 'background', normalizeBackground );
  46831. stylesProcessor.setNormalizer( 'background-color', value => ( { path: 'background.color', value } ) );
  46832. stylesProcessor.setReducer( 'background', value => {
  46833. const ret = [];
  46834. ret.push( [ 'background-color', value.color ] );
  46835. return ret;
  46836. } );
  46837. stylesProcessor.setStyleRelation( 'background', [ 'background-color' ] );
  46838. }
  46839. function normalizeBackground( value ) {
  46840. const background = {};
  46841. const parts = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getShorthandValues"])( value );
  46842. for ( const part of parts ) {
  46843. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isRepeat"])( part ) ) {
  46844. background.repeat = background.repeat || [];
  46845. background.repeat.push( part );
  46846. } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isPosition"])( part ) ) {
  46847. background.position = background.position || [];
  46848. background.position.push( part );
  46849. } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isAttachment"])( part ) ) {
  46850. background.attachment = part;
  46851. } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isColor"])( part ) ) {
  46852. background.color = part;
  46853. } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isURL"])( part ) ) {
  46854. background.image = part;
  46855. }
  46856. }
  46857. return {
  46858. path: 'background',
  46859. value: background
  46860. };
  46861. }
  46862. /***/ }),
  46863. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/border.js":
  46864. /*!***************************************************************************!*\
  46865. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/border.js ***!
  46866. \***************************************************************************/
  46867. /*! exports provided: addBorderRules */
  46868. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46869. "use strict";
  46870. __webpack_require__.r(__webpack_exports__);
  46871. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addBorderRules", function() { return addBorderRules; });
  46872. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js");
  46873. /**
  46874. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  46875. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  46876. */
  46877. /**
  46878. * @module engine/view/styles/border
  46879. */
  46880. /**
  46881. * Adds a border CSS styles processing rules.
  46882. *
  46883. * editor.data.addStyleProcessorRules( addBorderRules );
  46884. *
  46885. * This rules merges all [border](https://developer.mozilla.org/en-US/docs/Web/CSS/border) styles notation shorthands:
  46886. *
  46887. * - border
  46888. * - border-top
  46889. * - border-right
  46890. * - border-bottom
  46891. * - border-left
  46892. * - border-color
  46893. * - border-style
  46894. * - border-width
  46895. *
  46896. * and all corresponding longhand forms (like `border-top-color`, `border-top-style`, etc).
  46897. *
  46898. * It does not handle other shorthands (like `border-radius` or `border-image`).
  46899. *
  46900. * The normalized model stores border values as:
  46901. *
  46902. * const styles = {
  46903. * border: {
  46904. * color: { top, right, bottom, left },
  46905. * style: { top, right, bottom, left },
  46906. * width: { top, right, bottom, left },
  46907. * }
  46908. * };
  46909. *
  46910. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
  46911. */
  46912. function addBorderRules( stylesProcessor ) {
  46913. stylesProcessor.setNormalizer( 'border', borderNormalizer );
  46914. // Border-position shorthands.
  46915. stylesProcessor.setNormalizer( 'border-top', getBorderPositionNormalizer( 'top' ) );
  46916. stylesProcessor.setNormalizer( 'border-right', getBorderPositionNormalizer( 'right' ) );
  46917. stylesProcessor.setNormalizer( 'border-bottom', getBorderPositionNormalizer( 'bottom' ) );
  46918. stylesProcessor.setNormalizer( 'border-left', getBorderPositionNormalizer( 'left' ) );
  46919. // Border-property shorthands.
  46920. stylesProcessor.setNormalizer( 'border-color', getBorderPropertyNormalizer( 'color' ) );
  46921. stylesProcessor.setNormalizer( 'border-width', getBorderPropertyNormalizer( 'width' ) );
  46922. stylesProcessor.setNormalizer( 'border-style', getBorderPropertyNormalizer( 'style' ) );
  46923. // Border longhands.
  46924. stylesProcessor.setNormalizer( 'border-top-color', getBorderPropertyPositionNormalizer( 'color', 'top' ) );
  46925. stylesProcessor.setNormalizer( 'border-top-style', getBorderPropertyPositionNormalizer( 'style', 'top' ) );
  46926. stylesProcessor.setNormalizer( 'border-top-width', getBorderPropertyPositionNormalizer( 'width', 'top' ) );
  46927. stylesProcessor.setNormalizer( 'border-right-color', getBorderPropertyPositionNormalizer( 'color', 'right' ) );
  46928. stylesProcessor.setNormalizer( 'border-right-style', getBorderPropertyPositionNormalizer( 'style', 'right' ) );
  46929. stylesProcessor.setNormalizer( 'border-right-width', getBorderPropertyPositionNormalizer( 'width', 'right' ) );
  46930. stylesProcessor.setNormalizer( 'border-bottom-color', getBorderPropertyPositionNormalizer( 'color', 'bottom' ) );
  46931. stylesProcessor.setNormalizer( 'border-bottom-style', getBorderPropertyPositionNormalizer( 'style', 'bottom' ) );
  46932. stylesProcessor.setNormalizer( 'border-bottom-width', getBorderPropertyPositionNormalizer( 'width', 'bottom' ) );
  46933. stylesProcessor.setNormalizer( 'border-left-color', getBorderPropertyPositionNormalizer( 'color', 'left' ) );
  46934. stylesProcessor.setNormalizer( 'border-left-style', getBorderPropertyPositionNormalizer( 'style', 'left' ) );
  46935. stylesProcessor.setNormalizer( 'border-left-width', getBorderPropertyPositionNormalizer( 'width', 'left' ) );
  46936. stylesProcessor.setExtractor( 'border-top', getBorderPositionExtractor( 'top' ) );
  46937. stylesProcessor.setExtractor( 'border-right', getBorderPositionExtractor( 'right' ) );
  46938. stylesProcessor.setExtractor( 'border-bottom', getBorderPositionExtractor( 'bottom' ) );
  46939. stylesProcessor.setExtractor( 'border-left', getBorderPositionExtractor( 'left' ) );
  46940. stylesProcessor.setExtractor( 'border-top-color', 'border.color.top' );
  46941. stylesProcessor.setExtractor( 'border-right-color', 'border.color.right' );
  46942. stylesProcessor.setExtractor( 'border-bottom-color', 'border.color.bottom' );
  46943. stylesProcessor.setExtractor( 'border-left-color', 'border.color.left' );
  46944. stylesProcessor.setExtractor( 'border-top-width', 'border.width.top' );
  46945. stylesProcessor.setExtractor( 'border-right-width', 'border.width.right' );
  46946. stylesProcessor.setExtractor( 'border-bottom-width', 'border.width.bottom' );
  46947. stylesProcessor.setExtractor( 'border-left-width', 'border.width.left' );
  46948. stylesProcessor.setExtractor( 'border-top-style', 'border.style.top' );
  46949. stylesProcessor.setExtractor( 'border-right-style', 'border.style.right' );
  46950. stylesProcessor.setExtractor( 'border-bottom-style', 'border.style.bottom' );
  46951. stylesProcessor.setExtractor( 'border-left-style', 'border.style.left' );
  46952. stylesProcessor.setReducer( 'border-color', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"])( 'border-color' ) );
  46953. stylesProcessor.setReducer( 'border-style', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"])( 'border-style' ) );
  46954. stylesProcessor.setReducer( 'border-width', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"])( 'border-width' ) );
  46955. stylesProcessor.setReducer( 'border-top', getBorderPositionReducer( 'top' ) );
  46956. stylesProcessor.setReducer( 'border-right', getBorderPositionReducer( 'right' ) );
  46957. stylesProcessor.setReducer( 'border-bottom', getBorderPositionReducer( 'bottom' ) );
  46958. stylesProcessor.setReducer( 'border-left', getBorderPositionReducer( 'left' ) );
  46959. stylesProcessor.setReducer( 'border', getBorderReducer() );
  46960. stylesProcessor.setStyleRelation( 'border', [
  46961. 'border-color', 'border-style', 'border-width',
  46962. 'border-top', 'border-right', 'border-bottom', 'border-left',
  46963. 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color',
  46964. 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style',
  46965. 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width'
  46966. ] );
  46967. stylesProcessor.setStyleRelation( 'border-color', [
  46968. 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color'
  46969. ] );
  46970. stylesProcessor.setStyleRelation( 'border-style', [
  46971. 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style'
  46972. ] );
  46973. stylesProcessor.setStyleRelation( 'border-width', [
  46974. 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width'
  46975. ] );
  46976. stylesProcessor.setStyleRelation( 'border-top', [ 'border-top-color', 'border-top-style', 'border-top-width' ] );
  46977. stylesProcessor.setStyleRelation( 'border-right', [ 'border-right-color', 'border-right-style', 'border-right-width' ] );
  46978. stylesProcessor.setStyleRelation( 'border-bottom', [ 'border-bottom-color', 'border-bottom-style', 'border-bottom-width' ] );
  46979. stylesProcessor.setStyleRelation( 'border-left', [ 'border-left-color', 'border-left-style', 'border-left-width' ] );
  46980. }
  46981. function borderNormalizer( value ) {
  46982. const { color, style, width } = normalizeBorderShorthand( value );
  46983. return {
  46984. path: 'border',
  46985. value: {
  46986. color: Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValues"])( color ),
  46987. style: Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValues"])( style ),
  46988. width: Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValues"])( width )
  46989. }
  46990. };
  46991. }
  46992. function getBorderPositionNormalizer( side ) {
  46993. return value => {
  46994. const { color, style, width } = normalizeBorderShorthand( value );
  46995. const border = {};
  46996. if ( color !== undefined ) {
  46997. border.color = { [ side ]: color };
  46998. }
  46999. if ( style !== undefined ) {
  47000. border.style = { [ side ]: style };
  47001. }
  47002. if ( width !== undefined ) {
  47003. border.width = { [ side ]: width };
  47004. }
  47005. return {
  47006. path: 'border',
  47007. value: border
  47008. };
  47009. };
  47010. }
  47011. function getBorderPropertyNormalizer( propertyName ) {
  47012. return value => {
  47013. return {
  47014. path: 'border',
  47015. value: toBorderPropertyShorthand( value, propertyName )
  47016. };
  47017. };
  47018. }
  47019. function toBorderPropertyShorthand( value, property ) {
  47020. return {
  47021. [ property ]: Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValues"])( value )
  47022. };
  47023. }
  47024. function getBorderPropertyPositionNormalizer( property, side ) {
  47025. return value => {
  47026. return {
  47027. path: 'border',
  47028. value: {
  47029. [ property ]: {
  47030. [ side ]: value
  47031. }
  47032. }
  47033. };
  47034. };
  47035. }
  47036. function getBorderPositionExtractor( which ) {
  47037. return ( name, styles ) => {
  47038. if ( styles.border ) {
  47039. return extractBorderPosition( styles.border, which );
  47040. }
  47041. };
  47042. }
  47043. function extractBorderPosition( border, which ) {
  47044. const value = {};
  47045. if ( border.width && border.width[ which ] ) {
  47046. value.width = border.width[ which ];
  47047. }
  47048. if ( border.style && border.style[ which ] ) {
  47049. value.style = border.style[ which ];
  47050. }
  47051. if ( border.color && border.color[ which ] ) {
  47052. value.color = border.color[ which ];
  47053. }
  47054. return value;
  47055. }
  47056. function normalizeBorderShorthand( string ) {
  47057. const result = {};
  47058. const parts = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getShorthandValues"])( string );
  47059. for ( const part of parts ) {
  47060. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isLength"])( part ) || /thin|medium|thick/.test( part ) ) {
  47061. result.width = part;
  47062. } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isLineStyle"])( part ) ) {
  47063. result.style = part;
  47064. } else {
  47065. result.color = part;
  47066. }
  47067. }
  47068. return result;
  47069. }
  47070. // The border reducer factory.
  47071. //
  47072. // It tries to produce the most optimal output for the specified styles.
  47073. //
  47074. // For a border style:
  47075. //
  47076. // style: {top: "solid", bottom: "solid", right: "solid", left: "solid"}
  47077. //
  47078. // It will produce: `border-style: solid`.
  47079. // For a border style and color:
  47080. //
  47081. // color: {top: "#ff0", bottom: "#ff0", right: "#ff0", left: "#ff0"}
  47082. // style: {top: "solid", bottom: "solid", right: "solid", left: "solid"}
  47083. //
  47084. // It will produce: `border-color: #ff0; border-style: solid`.
  47085. // If all border parameters are specified:
  47086. //
  47087. // color: {top: "#ff0", bottom: "#ff0", right: "#ff0", left: "#ff0"}
  47088. // style: {top: "solid", bottom: "solid", right: "solid", left: "solid"}
  47089. // width: {top: "2px", bottom: "2px", right: "2px", left: "2px"}
  47090. //
  47091. // It will combine everything into a single property: `border: 2px solid #ff0`.
  47092. //
  47093. // The definitions are merged only if all border selectors have the same values.
  47094. //
  47095. // @returns {Function}
  47096. function getBorderReducer() {
  47097. return value => {
  47098. const topStyles = extractBorderPosition( value, 'top' );
  47099. const rightStyles = extractBorderPosition( value, 'right' );
  47100. const bottomStyles = extractBorderPosition( value, 'bottom' );
  47101. const leftStyles = extractBorderPosition( value, 'left' );
  47102. const borderStyles = [ topStyles, rightStyles, bottomStyles, leftStyles ];
  47103. const borderStylesByType = {
  47104. width: getReducedStyleValueForType( borderStyles, 'width' ),
  47105. style: getReducedStyleValueForType( borderStyles, 'style' ),
  47106. color: getReducedStyleValueForType( borderStyles, 'color' )
  47107. };
  47108. // Try reducing to a single `border:` property.
  47109. const reducedBorderStyle = reduceBorderPosition( borderStylesByType, 'all' );
  47110. if ( reducedBorderStyle.length ) {
  47111. return reducedBorderStyle;
  47112. }
  47113. // Try reducing to `border-style:`, `border-width:`, `border-color:` properties.
  47114. const reducedStyleTypes = Object.entries( borderStylesByType ).reduce( ( reducedStyleTypes, [ type, value ] ) => {
  47115. if ( value ) {
  47116. reducedStyleTypes.push( [ `border-${ type }`, value ] );
  47117. // Remove it from the full set to not include it in the most specific properties later.
  47118. borderStyles.forEach( style => ( style[ type ] = null ) );
  47119. }
  47120. return reducedStyleTypes;
  47121. }, [] );
  47122. // The reduced properties (by type) and all that remains that could not be reduced.
  47123. return [
  47124. ...reducedStyleTypes,
  47125. ...reduceBorderPosition( topStyles, 'top' ),
  47126. ...reduceBorderPosition( rightStyles, 'right' ),
  47127. ...reduceBorderPosition( bottomStyles, 'bottom' ),
  47128. ...reduceBorderPosition( leftStyles, 'left' )
  47129. ];
  47130. };
  47131. // @param {Array.<Object>} styles The array of objects with `style`, `color`, `width` properties.
  47132. // @param {'width'|'style'|'color'} type
  47133. function getReducedStyleValueForType( styles, type ) {
  47134. return styles
  47135. .map( style => style[ type ] )
  47136. .reduce( ( result, style ) => result == style ? result : null );
  47137. }
  47138. }
  47139. function getBorderPositionReducer( which ) {
  47140. return value => reduceBorderPosition( value, which );
  47141. }
  47142. // Returns an array with reduced border styles depending on the specified values.
  47143. //
  47144. // If all border properties (width, style, color) are specified, the returned selector will be
  47145. // merged into a group: `border-*: [width] [style] [color]`.
  47146. //
  47147. // Otherwise, the specific definitions will be returned: `border-(width|style|color)-*: [value]`.
  47148. //
  47149. // @param {Object|null} value Styles if defined.
  47150. // @param {'top'|'right'|'bottom'|'left'|'all'} which The border position.
  47151. // @returns {Array}
  47152. function reduceBorderPosition( value, which ) {
  47153. const borderTypes = [];
  47154. if ( value && value.width ) {
  47155. borderTypes.push( 'width' );
  47156. }
  47157. if ( value && value.style ) {
  47158. borderTypes.push( 'style' );
  47159. }
  47160. if ( value && value.color ) {
  47161. borderTypes.push( 'color' );
  47162. }
  47163. if ( borderTypes.length == 3 ) {
  47164. const borderValue = borderTypes.map( item => value[ item ] ).join( ' ' );
  47165. return [
  47166. which == 'all' ? [ 'border', borderValue ] : [ `border-${ which }`, borderValue ]
  47167. ];
  47168. }
  47169. // We are unable to reduce to a single `border:` property.
  47170. if ( which == 'all' ) {
  47171. return [];
  47172. }
  47173. return borderTypes.map( type => {
  47174. return [ `border-${ which }-${ type }`, value[ type ] ];
  47175. } );
  47176. }
  47177. /***/ }),
  47178. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/margin.js":
  47179. /*!***************************************************************************!*\
  47180. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/margin.js ***!
  47181. \***************************************************************************/
  47182. /*! exports provided: addMarginRules */
  47183. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47184. "use strict";
  47185. __webpack_require__.r(__webpack_exports__);
  47186. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addMarginRules", function() { return addMarginRules; });
  47187. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js");
  47188. /**
  47189. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  47190. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47191. */
  47192. /**
  47193. * @module engine/view/styles/margin
  47194. */
  47195. /**
  47196. * Adds a margin CSS styles processing rules.
  47197. *
  47198. * editor.data.addStyleProcessorRules( addMarginRules );
  47199. *
  47200. * The normalized value is stored as:
  47201. *
  47202. * const styles = {
  47203. * margin: {
  47204. * top,
  47205. * right,
  47206. * bottom,
  47207. * left
  47208. * }
  47209. * };
  47210. *
  47211. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
  47212. */
  47213. function addMarginRules( stylesProcessor ) {
  47214. stylesProcessor.setNormalizer( 'margin', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getPositionShorthandNormalizer"])( 'margin' ) );
  47215. stylesProcessor.setNormalizer( 'margin-top', value => ( { path: 'margin.top', value } ) );
  47216. stylesProcessor.setNormalizer( 'margin-right', value => ( { path: 'margin.right', value } ) );
  47217. stylesProcessor.setNormalizer( 'margin-bottom', value => ( { path: 'margin.bottom', value } ) );
  47218. stylesProcessor.setNormalizer( 'margin-left', value => ( { path: 'margin.left', value } ) );
  47219. stylesProcessor.setReducer( 'margin', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"])( 'margin' ) );
  47220. stylesProcessor.setStyleRelation( 'margin', [ 'margin-top', 'margin-right', 'margin-bottom', 'margin-left' ] );
  47221. }
  47222. /***/ }),
  47223. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/padding.js":
  47224. /*!****************************************************************************!*\
  47225. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/padding.js ***!
  47226. \****************************************************************************/
  47227. /*! exports provided: addPaddingRules */
  47228. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47229. "use strict";
  47230. __webpack_require__.r(__webpack_exports__);
  47231. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addPaddingRules", function() { return addPaddingRules; });
  47232. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js");
  47233. /**
  47234. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  47235. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47236. */
  47237. /**
  47238. * @module engine/view/styles/padding
  47239. */
  47240. /**
  47241. * Adds a margin CSS styles processing rules.
  47242. *
  47243. * editor.data.addStyleProcessorRules( addPaddingRules );
  47244. *
  47245. * The normalized value is stored as:
  47246. *
  47247. * const styles = {
  47248. * padding: {
  47249. * top,
  47250. * right,
  47251. * bottom,
  47252. * left
  47253. * }
  47254. * };
  47255. *
  47256. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
  47257. */
  47258. function addPaddingRules( stylesProcessor ) {
  47259. stylesProcessor.setNormalizer( 'padding', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getPositionShorthandNormalizer"])( 'padding' ) );
  47260. stylesProcessor.setNormalizer( 'padding-top', value => ( { path: 'padding.top', value } ) );
  47261. stylesProcessor.setNormalizer( 'padding-right', value => ( { path: 'padding.right', value } ) );
  47262. stylesProcessor.setNormalizer( 'padding-bottom', value => ( { path: 'padding.bottom', value } ) );
  47263. stylesProcessor.setNormalizer( 'padding-left', value => ( { path: 'padding.left', value } ) );
  47264. stylesProcessor.setReducer( 'padding', Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"])( 'padding' ) );
  47265. stylesProcessor.setStyleRelation( 'padding', [ 'padding-top', 'padding-right', 'padding-bottom', 'padding-left' ] );
  47266. }
  47267. /***/ }),
  47268. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js":
  47269. /*!**************************************************************************!*\
  47270. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js ***!
  47271. \**************************************************************************/
  47272. /*! exports provided: isColor, isLineStyle, isLength, isPercentage, isRepeat, isPosition, isAttachment, isURL, getBoxSidesValues, getBoxSidesValueReducer, getBoxSidesShorthandValue, getPositionShorthandNormalizer, getShorthandValues */
  47273. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47274. "use strict";
  47275. __webpack_require__.r(__webpack_exports__);
  47276. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isColor", function() { return isColor; });
  47277. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLineStyle", function() { return isLineStyle; });
  47278. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return isLength; });
  47279. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPercentage", function() { return isPercentage; });
  47280. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRepeat", function() { return isRepeat; });
  47281. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPosition", function() { return isPosition; });
  47282. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAttachment", function() { return isAttachment; });
  47283. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isURL", function() { return isURL; });
  47284. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValues", function() { return getBoxSidesValues; });
  47285. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValueReducer", function() { return getBoxSidesValueReducer; });
  47286. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesShorthandValue", function() { return getBoxSidesShorthandValue; });
  47287. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPositionShorthandNormalizer", function() { return getPositionShorthandNormalizer; });
  47288. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getShorthandValues", function() { return getShorthandValues; });
  47289. /**
  47290. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  47291. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47292. */
  47293. /**
  47294. * @module engine/view/styles/utils
  47295. */
  47296. const HEX_COLOR_REGEXP = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
  47297. const RGB_COLOR_REGEXP = /^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i;
  47298. const RGBA_COLOR_REGEXP = /^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i;
  47299. const HSL_COLOR_REGEXP = /^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i;
  47300. const HSLA_COLOR_REGEXP = /^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i;
  47301. const COLOR_NAMES = new Set( [
  47302. // CSS Level 1
  47303. 'black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia',
  47304. 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua',
  47305. // CSS Level 2 (Revision 1)
  47306. 'orange',
  47307. // CSS Color Module Level 3
  47308. 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown',
  47309. 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan',
  47310. 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta',
  47311. 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue',
  47312. 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey',
  47313. 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod',
  47314. 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush',
  47315. 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray',
  47316. 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray',
  47317. 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine',
  47318. 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen',
  47319. 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite',
  47320. 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred',
  47321. 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon',
  47322. 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow',
  47323. 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen',
  47324. // CSS Color Module Level 3 (System Colors)
  47325. 'activeborder', 'activecaption', 'appworkspace', 'background', 'buttonface', 'buttonhighlight', 'buttonshadow',
  47326. 'buttontext', 'captiontext', 'graytext', 'highlight', 'highlighttext', 'inactiveborder', 'inactivecaption',
  47327. 'inactivecaptiontext', 'infobackground', 'infotext', 'menu', 'menutext', 'scrollbar', 'threeddarkshadow',
  47328. 'threedface', 'threedhighlight', 'threedlightshadow', 'threedshadow', 'window', 'windowframe', 'windowtext',
  47329. // CSS Color Module Level 4
  47330. 'rebeccapurple',
  47331. // Keywords
  47332. 'currentcolor', 'transparent'
  47333. ] );
  47334. /**
  47335. * Checks if string contains [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) CSS value.
  47336. *
  47337. * isColor( '#f00' ); // true
  47338. * isColor( '#AA00BB33' ); // true
  47339. * isColor( 'rgb(0, 0, 250)' ); // true
  47340. * isColor( 'hsla(240, 100%, 50%, .7)' ); // true
  47341. * isColor( 'deepskyblue' ); // true
  47342. *
  47343. * **Note**: It does not support CSS Level 4 whitespace syntax, system colors and radius values for HSL colors.
  47344. *
  47345. * @param {String} string
  47346. * @returns {Boolean}
  47347. */
  47348. function isColor( string ) {
  47349. // As far as I was able to test checking some pre-conditions is faster than joining each test with ||.
  47350. if ( string.startsWith( '#' ) ) {
  47351. return HEX_COLOR_REGEXP.test( string );
  47352. }
  47353. if ( string.startsWith( 'rgb' ) ) {
  47354. return RGB_COLOR_REGEXP.test( string ) || RGBA_COLOR_REGEXP.test( string );
  47355. }
  47356. if ( string.startsWith( 'hsl' ) ) {
  47357. return HSL_COLOR_REGEXP.test( string ) || HSLA_COLOR_REGEXP.test( string );
  47358. }
  47359. // Array check > RegExp test.
  47360. return COLOR_NAMES.has( string.toLowerCase() );
  47361. }
  47362. const lineStyleValues = [ 'none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset' ];
  47363. /**
  47364. * Checks if string contains [line style](https://developer.mozilla.org/en-US/docs/Web/CSS/border-style) CSS value.
  47365. *
  47366. * @param {String} string
  47367. * @returns {Boolean}
  47368. */
  47369. function isLineStyle( string ) {
  47370. return lineStyleValues.includes( string );
  47371. }
  47372. const lengthRegExp = /^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;
  47373. /**
  47374. * Checks if string contains [length](https://developer.mozilla.org/en-US/docs/Web/CSS/length) CSS value.
  47375. *
  47376. * @param {String} string
  47377. * @returns {Boolean}
  47378. */
  47379. function isLength( string ) {
  47380. return lengthRegExp.test( string );
  47381. }
  47382. const PERCENTAGE_VALUE_REGEXP = /^[+-]?[0-9]*([.][0-9]+)?%$/;
  47383. /**
  47384. * Checks if string contains [percentage](https://developer.mozilla.org/en-US/docs/Web/CSS/percentage) CSS value.
  47385. *
  47386. * @param {String} string
  47387. * @returns {Boolean}
  47388. */
  47389. function isPercentage( string ) {
  47390. return PERCENTAGE_VALUE_REGEXP.test( string );
  47391. }
  47392. const repeatValues = [ 'repeat-x', 'repeat-y', 'repeat', 'space', 'round', 'no-repeat' ];
  47393. /**
  47394. * Checks if string contains [background repeat](https://developer.mozilla.org/en-US/docs/Web/CSS/background-repeat) CSS value.
  47395. *
  47396. * @param {String} string
  47397. * @returns {Boolean}
  47398. */
  47399. function isRepeat( string ) {
  47400. return repeatValues.includes( string );
  47401. }
  47402. const positionValues = [ 'center', 'top', 'bottom', 'left', 'right' ];
  47403. /**
  47404. * Checks if string contains [background position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position) CSS value.
  47405. *
  47406. * @param {String} string
  47407. * @returns {Boolean}
  47408. */
  47409. function isPosition( string ) {
  47410. return positionValues.includes( string );
  47411. }
  47412. const attachmentValues = [ 'fixed', 'scroll', 'local' ];
  47413. /**
  47414. * Checks if string contains [background attachment](https://developer.mozilla.org/en-US/docs/Web/CSS/background-attachment) CSS value.
  47415. *
  47416. * @param {String} string
  47417. * @returns {Boolean}
  47418. */
  47419. function isAttachment( string ) {
  47420. return attachmentValues.includes( string );
  47421. }
  47422. const urlRegExp = /^url\(/;
  47423. /**
  47424. * Checks if string contains [URL](https://developer.mozilla.org/en-US/docs/Web/CSS/url) CSS value.
  47425. *
  47426. * @param {String} string
  47427. * @returns {Boolean}
  47428. */
  47429. function isURL( string ) {
  47430. return urlRegExp.test( string );
  47431. }
  47432. function getBoxSidesValues( value = '' ) {
  47433. if ( value === '' ) {
  47434. return { top: undefined, right: undefined, bottom: undefined, left: undefined };
  47435. }
  47436. const values = getShorthandValues( value );
  47437. const top = values[ 0 ];
  47438. const bottom = values[ 2 ] || top;
  47439. const right = values[ 1 ] || top;
  47440. const left = values[ 3 ] || right;
  47441. return { top, bottom, right, left };
  47442. }
  47443. /**
  47444. * Default reducer for CSS properties that concerns edges of a box
  47445. * [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) notations:
  47446. *
  47447. * stylesProcessor.setReducer( 'padding', getBoxSidesValueReducer( 'padding' ) );
  47448. *
  47449. * @param {String} styleShorthand
  47450. * @returns {Function}
  47451. */
  47452. function getBoxSidesValueReducer( styleShorthand ) {
  47453. return value => {
  47454. const { top, right, bottom, left } = value;
  47455. const reduced = [];
  47456. if ( ![ top, right, left, bottom ].every( value => !!value ) ) {
  47457. if ( top ) {
  47458. reduced.push( [ styleShorthand + '-top', top ] );
  47459. }
  47460. if ( right ) {
  47461. reduced.push( [ styleShorthand + '-right', right ] );
  47462. }
  47463. if ( bottom ) {
  47464. reduced.push( [ styleShorthand + '-bottom', bottom ] );
  47465. }
  47466. if ( left ) {
  47467. reduced.push( [ styleShorthand + '-left', left ] );
  47468. }
  47469. } else {
  47470. reduced.push( [ styleShorthand, getBoxSidesShorthandValue( value ) ] );
  47471. }
  47472. return reduced;
  47473. };
  47474. }
  47475. /**
  47476. * Returns a [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) notation
  47477. * of a CSS property value.
  47478. *
  47479. * getBoxSidesShorthandValue( { top: '1px', right: '1px', bottom: '2px', left: '1px' } );
  47480. * // will return '1px 1px 2px'
  47481. *
  47482. * @param {module:engine/view/stylesmap~BoxSides} styleShorthand
  47483. * @returns {String}
  47484. */
  47485. function getBoxSidesShorthandValue( { top, right, bottom, left } ) {
  47486. const out = [];
  47487. if ( left !== right ) {
  47488. out.push( top, right, bottom, left );
  47489. } else if ( bottom !== top ) {
  47490. out.push( top, right, bottom );
  47491. } else if ( right !== top ) {
  47492. out.push( top, right );
  47493. } else {
  47494. out.push( top );
  47495. }
  47496. return out.join( ' ' );
  47497. }
  47498. /**
  47499. * Creates a normalizer for a [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) 1-to-4 value.
  47500. *
  47501. * stylesProcessor.setNormalizer( 'margin', getPositionShorthandNormalizer( 'margin' ) );
  47502. *
  47503. * @param {String} shorthand
  47504. * @returns {Function}
  47505. */
  47506. function getPositionShorthandNormalizer( shorthand ) {
  47507. return value => {
  47508. return {
  47509. path: shorthand,
  47510. value: getBoxSidesValues( value )
  47511. };
  47512. };
  47513. }
  47514. /**
  47515. * Parses parts of a 1-to-4 value notation - handles some CSS values with spaces (like RGB()).
  47516. *
  47517. * getShorthandValues( 'red blue RGB(0, 0, 0)');
  47518. * // will return [ 'red', 'blue', 'RGB(0, 0, 0)' ]
  47519. *
  47520. * @param {String} string
  47521. * @returns {Array.<String>}
  47522. */
  47523. function getShorthandValues( string ) {
  47524. return string
  47525. .replace( /, /g, ',' ) // Exclude comma from spaces evaluation as values are separated by spaces.
  47526. .split( ' ' )
  47527. .map( string => string.replace( /,/g, ', ' ) ); // Restore original notation.
  47528. }
  47529. /***/ }),
  47530. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js":
  47531. /*!***********************************************************************!*\
  47532. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js ***!
  47533. \***********************************************************************/
  47534. /*! exports provided: default, StylesProcessor */
  47535. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47536. "use strict";
  47537. __webpack_require__.r(__webpack_exports__);
  47538. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return StylesMap; });
  47539. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StylesProcessor", function() { return StylesProcessor; });
  47540. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  47541. /**
  47542. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  47543. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47544. */
  47545. /**
  47546. * @module engine/view/stylesmap
  47547. */
  47548. /**
  47549. * Styles map. Allows handling (adding, removing, retrieving) a set of style rules (usually, of an element).
  47550. *
  47551. * The styles map is capable of normalizing style names so e.g. the following operations are possible:
  47552. */
  47553. class StylesMap {
  47554. /**
  47555. * Creates Styles instance.
  47556. *
  47557. * @param {module:engine/view/stylesmap~StylesProcessor} styleProcessor
  47558. */
  47559. constructor( styleProcessor ) {
  47560. /**
  47561. * Keeps an internal representation of styles map. Normalized styles are kept as object tree to allow unified modification and
  47562. * value access model using lodash's get, set, unset, etc methods.
  47563. *
  47564. * When no style processor rules are defined it acts as simple key-value storage.
  47565. *
  47566. * @private
  47567. * @type {Object}
  47568. */
  47569. this._styles = {};
  47570. /**
  47571. * An instance of the {@link module:engine/view/stylesmap~StylesProcessor}.
  47572. *
  47573. * @private
  47574. * @member {module:engine/view/stylesmap~StylesProcessor}
  47575. */
  47576. this._styleProcessor = styleProcessor;
  47577. }
  47578. /**
  47579. * Returns true if style map has no styles set.
  47580. *
  47581. * @type {Boolean}
  47582. */
  47583. get isEmpty() {
  47584. const entries = Object.entries( this._styles );
  47585. const from = Array.from( entries );
  47586. return !from.length;
  47587. }
  47588. /**
  47589. * Number of styles defined.
  47590. *
  47591. * @type {Number}
  47592. */
  47593. get size() {
  47594. if ( this.isEmpty ) {
  47595. return 0;
  47596. }
  47597. return this.getStyleNames().length;
  47598. }
  47599. /**
  47600. * Set styles map to a new value.
  47601. *
  47602. * styles.setTo( 'border:1px solid blue;margin-top:1px;' );
  47603. *
  47604. * @param {String} inlineStyle
  47605. */
  47606. setTo( inlineStyle ) {
  47607. this.clear();
  47608. const parsedStyles = Array.from( parseInlineStyles( inlineStyle ).entries() );
  47609. for ( const [ key, value ] of parsedStyles ) {
  47610. this._styleProcessor.toNormalizedForm( key, value, this._styles );
  47611. }
  47612. }
  47613. /**
  47614. * Checks if a given style is set.
  47615. *
  47616. * styles.setTo( 'margin-left:1px;' );
  47617. *
  47618. * styles.has( 'margin-left' ); // -> true
  47619. * styles.has( 'padding' ); // -> false
  47620. *
  47621. * **Note**: This check supports normalized style names.
  47622. *
  47623. * // Enable 'margin' shorthand processing:
  47624. * editor.data.addStyleProcessorRules( addMarginRules );
  47625. *
  47626. * styles.setTo( 'margin:2px;' );
  47627. *
  47628. * styles.has( 'margin' ); // -> true
  47629. * styles.has( 'margin-top' ); // -> true
  47630. * styles.has( 'margin-left' ); // -> true
  47631. *
  47632. * styles.remove( 'margin-top' );
  47633. *
  47634. * styles.has( 'margin' ); // -> false
  47635. * styles.has( 'margin-top' ); // -> false
  47636. * styles.has( 'margin-left' ); // -> true
  47637. *
  47638. * @param {String} name Style name.
  47639. * @returns {Boolean}
  47640. */
  47641. has( name ) {
  47642. if ( this.isEmpty ) {
  47643. return false;
  47644. }
  47645. const styles = this._styleProcessor.getReducedForm( name, this._styles );
  47646. const propertyDescriptor = styles.find( ( [ property ] ) => property === name );
  47647. // Only return a value if it is set;
  47648. return Array.isArray( propertyDescriptor );
  47649. }
  47650. /**
  47651. * Sets a given style.
  47652. *
  47653. * Can insert one by one:
  47654. *
  47655. * styles.set( 'color', 'blue' );
  47656. * styles.set( 'margin-right', '1em' );
  47657. *
  47658. * or many styles at once:
  47659. *
  47660. * styles.set( {
  47661. * color: 'blue',
  47662. * 'margin-right': '1em'
  47663. * } );
  47664. *
  47665. * ***Note**:* This method uses {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules
  47666. * enabled style processor rules} to normalize passed values.
  47667. *
  47668. * // Enable 'margin' shorthand processing:
  47669. * editor.data.addStyleProcessorRules( addMarginRules );
  47670. *
  47671. * styles.set( 'margin', '2px' );
  47672. *
  47673. * The above code will set margin to:
  47674. *
  47675. * styles.getNormalized( 'margin' );
  47676. * // -> { top: '2px', right: '2px', bottom: '2px', left: '2px' }
  47677. *
  47678. * Which makes it possible to retrieve a "sub-value":
  47679. *
  47680. * styles.get( 'margin-left' ); // -> '2px'
  47681. *
  47682. * Or modify it:
  47683. *
  47684. * styles.remove( 'margin-left' );
  47685. *
  47686. * styles.getNormalized( 'margin' ); // -> { top: '1px', bottom: '1px', right: '1px' }
  47687. * styles.toString(); // -> 'margin-bottom:1px;margin-right:1px;margin-top:1px;'
  47688. *
  47689. * This method also allows to set normalized values directly (if a particular styles processor rule was enabled):
  47690. *
  47691. * styles.set( 'border-color', { top: 'blue' } );
  47692. * styles.set( 'margin', { right: '2em' } );
  47693. *
  47694. * styles.toString(); // -> 'border-color-top:blue;margin-right:2em;'
  47695. *
  47696. * @param {String|Object} nameOrObject Style property name or object with multiple properties.
  47697. * @param {String|Object} valueOrObject Value to set.
  47698. */
  47699. set( nameOrObject, valueOrObject ) {
  47700. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isObject"])( nameOrObject ) ) {
  47701. for ( const [ key, value ] of Object.entries( nameOrObject ) ) {
  47702. this._styleProcessor.toNormalizedForm( key, value, this._styles );
  47703. }
  47704. } else {
  47705. this._styleProcessor.toNormalizedForm( nameOrObject, valueOrObject, this._styles );
  47706. }
  47707. }
  47708. /**
  47709. * Removes given style.
  47710. *
  47711. * styles.setTo( 'background:#f00;margin-right:2px;' );
  47712. *
  47713. * styles.remove( 'background' );
  47714. *
  47715. * styles.toString(); // -> 'margin-right:2px;'
  47716. *
  47717. * ***Note**:* This method uses {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules
  47718. * enabled style processor rules} to normalize passed values.
  47719. *
  47720. * // Enable 'margin' shorthand processing:
  47721. * editor.data.addStyleProcessorRules( addMarginRules );
  47722. *
  47723. * styles.setTo( 'margin:1px' );
  47724. *
  47725. * styles.remove( 'margin-top' );
  47726. * styles.remove( 'margin-right' );
  47727. *
  47728. * styles.toString(); // -> 'margin-bottom:1px;margin-left:1px;'
  47729. *
  47730. * @param {String} name Style name.
  47731. */
  47732. remove( name ) {
  47733. const path = toPath( name );
  47734. Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["unset"])( this._styles, path );
  47735. delete this._styles[ name ];
  47736. this._cleanEmptyObjectsOnPath( path );
  47737. }
  47738. /**
  47739. * Returns a normalized style object or a single value.
  47740. *
  47741. * // Enable 'margin' shorthand processing:
  47742. * editor.data.addStyleProcessorRules( addMarginRules );
  47743. *
  47744. * const styles = new Styles();
  47745. * styles.setTo( 'margin:1px 2px 3em;' );
  47746. *
  47747. * styles.getNormalized( 'margin' );
  47748. * // will log:
  47749. * // {
  47750. * // top: '1px',
  47751. * // right: '2px',
  47752. * // bottom: '3em',
  47753. * // left: '2px' // normalized value from margin shorthand
  47754. * // }
  47755. *
  47756. * styles.getNormalized( 'margin-left' ); // -> '2px'
  47757. *
  47758. * **Note**: This method will only return normalized styles if a style processor was defined.
  47759. *
  47760. * @param {String} name Style name.
  47761. * @returns {Object|String|undefined}
  47762. */
  47763. getNormalized( name ) {
  47764. return this._styleProcessor.getNormalized( name, this._styles );
  47765. }
  47766. /**
  47767. * Returns a normalized style string. Styles are sorted by name.
  47768. *
  47769. * styles.set( 'margin' , '1px' );
  47770. * styles.set( 'background', '#f00' );
  47771. *
  47772. * styles.toString(); // -> 'background:#f00;margin:1px;'
  47773. *
  47774. * **Note**: This method supports normalized styles if defined.
  47775. *
  47776. * // Enable 'margin' shorthand processing:
  47777. * editor.data.addStyleProcessorRules( addMarginRules );
  47778. *
  47779. * styles.set( 'margin' , '1px' );
  47780. * styles.set( 'background', '#f00' );
  47781. * styles.remove( 'margin-top' );
  47782. * styles.remove( 'margin-right' );
  47783. *
  47784. * styles.toString(); // -> 'background:#f00;margin-bottom:1px;margin-left:1px;'
  47785. *
  47786. * @returns {String}
  47787. */
  47788. toString() {
  47789. if ( this.isEmpty ) {
  47790. return '';
  47791. }
  47792. return this._getStylesEntries()
  47793. .map( arr => arr.join( ':' ) )
  47794. .sort()
  47795. .join( ';' ) + ';';
  47796. }
  47797. /**
  47798. * Returns property as a value string or undefined if property is not set.
  47799. *
  47800. * // Enable 'margin' shorthand processing:
  47801. * editor.data.addStyleProcessorRules( addMarginRules );
  47802. *
  47803. * const styles = new Styles();
  47804. * styles.setTo( 'margin:1px;' );
  47805. * styles.set( 'margin-bottom', '3em' );
  47806. *
  47807. * styles.getAsString( 'margin' ); // -> 'margin: 1px 1px 3em;'
  47808. *
  47809. * Note, however, that all sub-values must be set for the longhand property name to return a value:
  47810. *
  47811. * const styles = new Styles();
  47812. * styles.setTo( 'margin:1px;' );
  47813. * styles.remove( 'margin-bottom' );
  47814. *
  47815. * styles.getAsString( 'margin' ); // -> undefined
  47816. *
  47817. * In the above scenario, it is not possible to return a `margin` value, so `undefined` is returned.
  47818. * Instead, you should use:
  47819. *
  47820. * const styles = new Styles();
  47821. * styles.setTo( 'margin:1px;' );
  47822. * styles.remove( 'margin-bottom' );
  47823. *
  47824. * for ( const styleName of styles.getStyleNames() ) {
  47825. * console.log( styleName, styles.getAsString( styleName ) );
  47826. * }
  47827. * // 'margin-top', '1px'
  47828. * // 'margin-right', '1px'
  47829. * // 'margin-left', '1px'
  47830. *
  47831. * In general, it is recommend to iterate over style names like in the example above. This way, you will always get all
  47832. * the currently set style values. So, if all the 4 margin values would be set
  47833. * the for-of loop above would yield only `'margin'`, `'1px'`:
  47834. *
  47835. * const styles = new Styles();
  47836. * styles.setTo( 'margin:1px;' );
  47837. *
  47838. * for ( const styleName of styles.getStyleNames() ) {
  47839. * console.log( styleName, styles.getAsString( styleName ) );
  47840. * }
  47841. * // 'margin', '1px'
  47842. *
  47843. * **Note**: To get a normalized version of a longhand property use the {@link #getNormalized `#getNormalized()`} method.
  47844. *
  47845. * @param {String} propertyName
  47846. * @returns {String|undefined}
  47847. */
  47848. getAsString( propertyName ) {
  47849. if ( this.isEmpty ) {
  47850. return;
  47851. }
  47852. if ( this._styles[ propertyName ] && !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isObject"])( this._styles[ propertyName ] ) ) {
  47853. // Try return styles set directly - values that are not parsed.
  47854. return this._styles[ propertyName ];
  47855. }
  47856. const styles = this._styleProcessor.getReducedForm( propertyName, this._styles );
  47857. const propertyDescriptor = styles.find( ( [ property ] ) => property === propertyName );
  47858. // Only return a value if it is set;
  47859. if ( Array.isArray( propertyDescriptor ) ) {
  47860. return propertyDescriptor[ 1 ];
  47861. }
  47862. }
  47863. /**
  47864. * Returns all style properties names as they would appear when using {@link #toString `#toString()`}.
  47865. *
  47866. * When `expand` is set to true and there's a shorthand style property set, it will also return all equivalent styles:
  47867. *
  47868. * stylesMap.setTo( 'margin: 1em' )
  47869. *
  47870. * will be expanded to:
  47871. *
  47872. * [ 'margin', 'margin-top', 'margin-right', 'margin-bottom', 'margin-left' ]
  47873. *
  47874. * @param {Boolean} [expand=false] Expand shorthand style properties and all return equivalent style representations.
  47875. * @returns {Array.<String>}
  47876. */
  47877. getStyleNames( expand = false ) {
  47878. if ( this.isEmpty ) {
  47879. return [];
  47880. }
  47881. if ( expand ) {
  47882. return this._styleProcessor.getStyleNames( this._styles );
  47883. }
  47884. const entries = this._getStylesEntries();
  47885. return entries.map( ( [ key ] ) => key );
  47886. }
  47887. /**
  47888. * Removes all styles.
  47889. */
  47890. clear() {
  47891. this._styles = {};
  47892. }
  47893. /**
  47894. * Returns normalized styles entries for further processing.
  47895. *
  47896. * @private
  47897. * @returns {Array.<module:engine/view/stylesmap~PropertyDescriptor>}
  47898. */
  47899. _getStylesEntries() {
  47900. const parsed = [];
  47901. const keys = Object.keys( this._styles );
  47902. for ( const key of keys ) {
  47903. parsed.push( ...this._styleProcessor.getReducedForm( key, this._styles ) );
  47904. }
  47905. return parsed;
  47906. }
  47907. /**
  47908. * Removes empty objects upon removing an entry from internal object.
  47909. *
  47910. * @param {String} path
  47911. * @private
  47912. */
  47913. _cleanEmptyObjectsOnPath( path ) {
  47914. const pathParts = path.split( '.' );
  47915. const isChildPath = pathParts.length > 1;
  47916. if ( !isChildPath ) {
  47917. return;
  47918. }
  47919. const parentPath = pathParts.splice( 0, pathParts.length - 1 ).join( '.' );
  47920. const parentObject = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["get"])( this._styles, parentPath );
  47921. if ( !parentObject ) {
  47922. return;
  47923. }
  47924. const isParentEmpty = !Array.from( Object.keys( parentObject ) ).length;
  47925. if ( isParentEmpty ) {
  47926. this.remove( parentPath );
  47927. }
  47928. }
  47929. }
  47930. /**
  47931. * Style processor is responsible for writing and reading a normalized styles object.
  47932. */
  47933. class StylesProcessor {
  47934. /**
  47935. * Creates StylesProcessor instance.
  47936. *
  47937. * @private
  47938. */
  47939. constructor() {
  47940. this._normalizers = new Map();
  47941. this._extractors = new Map();
  47942. this._reducers = new Map();
  47943. this._consumables = new Map();
  47944. }
  47945. /**
  47946. * Parse style string value to a normalized object and appends it to styles object.
  47947. *
  47948. * const styles = {};
  47949. *
  47950. * stylesProcessor.toNormalizedForm( 'margin', '1px', styles );
  47951. *
  47952. * // styles will consist: { margin: { top: '1px', right: '1px', bottom: '1px', left: '1px; } }
  47953. *
  47954. * **Note**: To define normalizer callbacks use {@link #setNormalizer}.
  47955. *
  47956. * @param {String} name Name of style property.
  47957. * @param {String} propertyValue Value of style property.
  47958. * @param {Object} styles Object holding normalized styles.
  47959. */
  47960. toNormalizedForm( name, propertyValue, styles ) {
  47961. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isObject"])( propertyValue ) ) {
  47962. appendStyleValue( styles, toPath( name ), propertyValue );
  47963. return;
  47964. }
  47965. if ( this._normalizers.has( name ) ) {
  47966. const normalizer = this._normalizers.get( name );
  47967. const { path, value } = normalizer( propertyValue );
  47968. appendStyleValue( styles, path, value );
  47969. } else {
  47970. appendStyleValue( styles, name, propertyValue );
  47971. }
  47972. }
  47973. /**
  47974. * Returns a normalized version of a style property.
  47975. * const styles = {
  47976. * margin: { top: '1px', right: '1px', bottom: '1px', left: '1px; },
  47977. * background: { color: '#f00' }
  47978. * };
  47979. *
  47980. * stylesProcessor.getNormalized( 'background' );
  47981. * // will return: { color: '#f00' }
  47982. *
  47983. * stylesProcessor.getNormalized( 'margin-top' );
  47984. * // will return: '1px'
  47985. *
  47986. * **Note**: In some cases extracting single value requires defining an extractor callback {@link #setExtractor}.
  47987. *
  47988. * @param {String} name Name of style property.
  47989. * @param {Object} styles Object holding normalized styles.
  47990. * @returns {*}
  47991. */
  47992. getNormalized( name, styles ) {
  47993. if ( !name ) {
  47994. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["merge"])( {}, styles );
  47995. }
  47996. // Might be empty string.
  47997. if ( styles[ name ] !== undefined ) {
  47998. return styles[ name ];
  47999. }
  48000. if ( this._extractors.has( name ) ) {
  48001. const extractor = this._extractors.get( name );
  48002. if ( typeof extractor === 'string' ) {
  48003. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["get"])( styles, extractor );
  48004. }
  48005. const value = extractor( name, styles );
  48006. if ( value ) {
  48007. return value;
  48008. }
  48009. }
  48010. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["get"])( styles, toPath( name ) );
  48011. }
  48012. /**
  48013. * Returns a reduced form of style property form normalized object.
  48014. *
  48015. * For default margin reducer, the below code:
  48016. *
  48017. * stylesProcessor.getReducedForm( 'margin', {
  48018. * margin: { top: '1px', right: '1px', bottom: '2px', left: '1px; }
  48019. * } );
  48020. *
  48021. * will return:
  48022. *
  48023. * [
  48024. * [ 'margin', '1px 1px 2px' ]
  48025. * ]
  48026. *
  48027. * because it might be represented as a shorthand 'margin' value. However if one of margin long hand values is missing it should return:
  48028. *
  48029. * [
  48030. * [ 'margin-top', '1px' ],
  48031. * [ 'margin-right', '1px' ],
  48032. * [ 'margin-bottom', '2px' ]
  48033. * // the 'left' value is missing - cannot use 'margin' shorthand.
  48034. * ]
  48035. *
  48036. * **Note**: To define reducer callbacks use {@link #setReducer}.
  48037. *
  48038. * @param {String} name Name of style property.
  48039. * @param {Object} styles Object holding normalized styles.
  48040. * @returns {Array.<module:engine/view/stylesmap~PropertyDescriptor>}
  48041. */
  48042. getReducedForm( name, styles ) {
  48043. const normalizedValue = this.getNormalized( name, styles );
  48044. // Might be empty string.
  48045. if ( normalizedValue === undefined ) {
  48046. return [];
  48047. }
  48048. if ( this._reducers.has( name ) ) {
  48049. const reducer = this._reducers.get( name );
  48050. return reducer( normalizedValue );
  48051. }
  48052. return [ [ name, normalizedValue ] ];
  48053. }
  48054. /**
  48055. * Return all style properties. Also expand shorthand properties (e.g. `margin`, `background`) if respective extractor is available.
  48056. *
  48057. * @param {Object} styles Object holding normalized styles.
  48058. * @returns {Array.<String>}
  48059. */
  48060. getStyleNames( styles ) {
  48061. // Find all extractable styles that have a value.
  48062. const expandedStyleNames = Array.from( this._consumables.keys() ).filter( name => {
  48063. const style = this.getNormalized( name, styles );
  48064. if ( style && typeof style == 'object' ) {
  48065. return Object.keys( style ).length;
  48066. }
  48067. return style;
  48068. } );
  48069. // For simple styles (for example `color`) we don't have a map of those styles
  48070. // but they are 1 to 1 with normalized object keys.
  48071. const styleNamesKeysSet = new Set( [
  48072. ...expandedStyleNames,
  48073. ...Object.keys( styles )
  48074. ] );
  48075. return Array.from( styleNamesKeysSet.values() );
  48076. }
  48077. /**
  48078. * Returns related style names.
  48079. *
  48080. * stylesProcessor.getRelatedStyles( 'margin' );
  48081. * // will return: [ 'margin-top', 'margin-right', 'margin-bottom', 'margin-left' ];
  48082. *
  48083. * stylesProcessor.getRelatedStyles( 'margin-top' );
  48084. * // will return: [ 'margin' ];
  48085. *
  48086. * **Note**: To define new style relations load an existing style processor or use
  48087. * {@link module:engine/view/stylesmap~StylesProcessor#setStyleRelation `StylesProcessor.setStyleRelation()`}.
  48088. *
  48089. * @param {String} name
  48090. * @returns {Array.<String>}
  48091. */
  48092. getRelatedStyles( name ) {
  48093. return this._consumables.get( name ) || [];
  48094. }
  48095. /**
  48096. * Adds a normalizer method for a style property.
  48097. *
  48098. * A normalizer returns describing how the value should be normalized.
  48099. *
  48100. * For instance 'margin' style is a shorthand for four margin values:
  48101. *
  48102. * - 'margin-top'
  48103. * - 'margin-right'
  48104. * - 'margin-bottom'
  48105. * - 'margin-left'
  48106. *
  48107. * and can be written in various ways if some values are equal to others. For instance `'margin: 1px 2em;'` is a shorthand for
  48108. * `'margin-top: 1px;margin-right: 2em;margin-bottom: 1px;margin-left: 2em'`.
  48109. *
  48110. * A normalizer should parse various margin notations as a single object:
  48111. *
  48112. * const styles = {
  48113. * margin: {
  48114. * top: '1px',
  48115. * right: '2em',
  48116. * bottom: '1px',
  48117. * left: '2em'
  48118. * }
  48119. * };
  48120. *
  48121. * Thus a normalizer for 'margin' style should return an object defining style path and value to store:
  48122. *
  48123. * const returnValue = {
  48124. * path: 'margin',
  48125. * value: {
  48126. * top: '1px',
  48127. * right: '2em',
  48128. * bottom: '1px',
  48129. * left: '2em'
  48130. * }
  48131. * };
  48132. *
  48133. * Additionally to fully support all margin notations there should be also defined 4 normalizers for longhand margin notations. Below
  48134. * is an example for 'margin-top' style property normalizer:
  48135. *
  48136. * stylesProcessor.setNormalizer( 'margin-top', valueString => {
  48137. * return {
  48138. * path: 'margin.top',
  48139. * value: valueString
  48140. * }
  48141. * } );
  48142. *
  48143. * @param {String} name
  48144. * @param {Function} callback
  48145. */
  48146. setNormalizer( name, callback ) {
  48147. this._normalizers.set( name, callback );
  48148. }
  48149. /**
  48150. * Adds a extractor callback for a style property.
  48151. *
  48152. * Most normalized style values are stored as one level objects. It is assumed that `'margin-top'` style will be stored as:
  48153. *
  48154. * const styles = {
  48155. * margin: {
  48156. * top: 'value'
  48157. * }
  48158. * }
  48159. *
  48160. * However, some styles can have conflicting notations and thus it might be harder to extract a style value from shorthand. For instance
  48161. * the 'border-top-style' can be defined using `'border-top:solid'`, `'border-style:solid none none none'` or by `'border:solid'`
  48162. * shorthands. The default border styles processors stores styles as:
  48163. *
  48164. * const styles = {
  48165. * border: {
  48166. * style: {
  48167. * top: 'solid'
  48168. * }
  48169. * }
  48170. * }
  48171. *
  48172. * as it is better to modify border style independently from other values. On the other part the output of the border might be
  48173. * desired as `border-top`, `border-left`, etc notation.
  48174. *
  48175. * In the above example a reducer should return a side border value that combines style, color and width:
  48176. *
  48177. * styleProcessor.setExtractor( 'border-top', styles => {
  48178. * return {
  48179. * color: styles.border.color.top,
  48180. * style: styles.border.style.top,
  48181. * width: styles.border.width.top
  48182. * }
  48183. * } );
  48184. *
  48185. * @param {String} name
  48186. * @param {Function|String} callbackOrPath Callback that return a requested value or path string for single values.
  48187. */
  48188. setExtractor( name, callbackOrPath ) {
  48189. this._extractors.set( name, callbackOrPath );
  48190. }
  48191. /**
  48192. * Adds a reducer callback for a style property.
  48193. *
  48194. * Reducer returns a minimal notation for given style name. For longhand properties it is not required to write a reducer as
  48195. * by default the direct value from style path is taken.
  48196. *
  48197. * For shorthand styles a reducer should return minimal style notation either by returning single name-value tuple or multiple tuples
  48198. * if a shorthand cannot be used. For instance for a margin shorthand a reducer might return:
  48199. *
  48200. * const marginShortHandTuple = [
  48201. * [ 'margin', '1px 1px 2px' ]
  48202. * ];
  48203. *
  48204. * or a longhand tuples for defined values:
  48205. *
  48206. * // Considering margin.bottom and margin.left are undefined.
  48207. * const marginLonghandsTuples = [
  48208. * [ 'margin-top', '1px' ],
  48209. * [ 'margin-right', '1px' ]
  48210. * ];
  48211. *
  48212. * A reducer obtains a normalized style value:
  48213. *
  48214. * // Simplified reducer that always outputs 4 values which are always present:
  48215. * stylesProcessor.setReducer( 'margin', margin => {
  48216. * return [
  48217. * [ 'margin', `${ margin.top } ${ margin.right } ${ margin.bottom } ${ margin.left }` ]
  48218. * ]
  48219. * } );
  48220. *
  48221. * @param {String} name
  48222. * @param {Function} callback
  48223. */
  48224. setReducer( name, callback ) {
  48225. this._reducers.set( name, callback );
  48226. }
  48227. /**
  48228. * Defines a style shorthand relation to other style notations.
  48229. *
  48230. * stylesProcessor.setStyleRelation( 'margin', [
  48231. * 'margin-top',
  48232. * 'margin-right',
  48233. * 'margin-bottom',
  48234. * 'margin-left'
  48235. * ] );
  48236. *
  48237. * This enables expanding of style names for shorthands. For instance, if defined,
  48238. * {@link module:engine/conversion/viewconsumable~ViewConsumable view consumable} items are automatically created
  48239. * for long-hand margin style notation alongside the `'margin'` item.
  48240. *
  48241. * This means that when an element being converted has a style `margin`, a converter for `margin-left` will work just
  48242. * fine since the view consumable will contain a consumable `margin-left` item (thanks to the relation) and
  48243. * `element.getStyle( 'margin-left' )` will work as well assuming that the style processor was correctly configured.
  48244. * However, once `margin-left` is consumed, `margin` will not be consumable anymore.
  48245. *
  48246. * @param {String} shorthandName
  48247. * @param {Array.<String>} styleNames
  48248. */
  48249. setStyleRelation( shorthandName, styleNames ) {
  48250. this._mapStyleNames( shorthandName, styleNames );
  48251. for ( const alsoName of styleNames ) {
  48252. this._mapStyleNames( alsoName, [ shorthandName ] );
  48253. }
  48254. }
  48255. /**
  48256. * Set two-way binding of style names.
  48257. *
  48258. * @param {String} name
  48259. * @param {Array.<String>} styleNames
  48260. * @private
  48261. */
  48262. _mapStyleNames( name, styleNames ) {
  48263. if ( !this._consumables.has( name ) ) {
  48264. this._consumables.set( name, [] );
  48265. }
  48266. this._consumables.get( name ).push( ...styleNames );
  48267. }
  48268. }
  48269. // Parses inline styles and puts property - value pairs into styles map.
  48270. //
  48271. // @param {String} stylesString Styles to parse.
  48272. // @returns {Map.<String, String>} stylesMap Map of parsed properties and values.
  48273. function parseInlineStyles( stylesString ) {
  48274. // `null` if no quote was found in input string or last found quote was a closing quote. See below.
  48275. let quoteType = null;
  48276. let propertyNameStart = 0;
  48277. let propertyValueStart = 0;
  48278. let propertyName = null;
  48279. const stylesMap = new Map();
  48280. // Do not set anything if input string is empty.
  48281. if ( stylesString === '' ) {
  48282. return stylesMap;
  48283. }
  48284. // Fix inline styles that do not end with `;` so they are compatible with algorithm below.
  48285. if ( stylesString.charAt( stylesString.length - 1 ) != ';' ) {
  48286. stylesString = stylesString + ';';
  48287. }
  48288. // Seek the whole string for "special characters".
  48289. for ( let i = 0; i < stylesString.length; i++ ) {
  48290. const char = stylesString.charAt( i );
  48291. if ( quoteType === null ) {
  48292. // No quote found yet or last found quote was a closing quote.
  48293. switch ( char ) {
  48294. case ':':
  48295. // Most of time colon means that property name just ended.
  48296. // Sometimes however `:` is found inside property value (for example in background image url).
  48297. if ( !propertyName ) {
  48298. // Treat this as end of property only if property name is not already saved.
  48299. // Save property name.
  48300. propertyName = stylesString.substr( propertyNameStart, i - propertyNameStart );
  48301. // Save this point as the start of property value.
  48302. propertyValueStart = i + 1;
  48303. }
  48304. break;
  48305. case '"':
  48306. case '\'':
  48307. // Opening quote found (this is an opening quote, because `quoteType` is `null`).
  48308. quoteType = char;
  48309. break;
  48310. case ';': {
  48311. // Property value just ended.
  48312. // Use previously stored property value start to obtain property value.
  48313. const propertyValue = stylesString.substr( propertyValueStart, i - propertyValueStart );
  48314. if ( propertyName ) {
  48315. // Save parsed part.
  48316. stylesMap.set( propertyName.trim(), propertyValue.trim() );
  48317. }
  48318. propertyName = null;
  48319. // Save this point as property name start. Property name starts immediately after previous property value ends.
  48320. propertyNameStart = i + 1;
  48321. break;
  48322. }
  48323. }
  48324. } else if ( char === quoteType ) {
  48325. // If a quote char is found and it is a closing quote, mark this fact by `null`-ing `quoteType`.
  48326. quoteType = null;
  48327. }
  48328. }
  48329. return stylesMap;
  48330. }
  48331. // Return lodash compatible path from style name.
  48332. function toPath( name ) {
  48333. return name.replace( '-', '.' );
  48334. }
  48335. // Appends style definition to the styles object.
  48336. //
  48337. // @param {String} nameOrPath
  48338. // @param {String|Object} valueOrObject
  48339. // @private
  48340. function appendStyleValue( stylesObject, nameOrPath, valueOrObject ) {
  48341. let valueToSet = valueOrObject;
  48342. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isObject"])( valueOrObject ) ) {
  48343. valueToSet = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["merge"])( {}, Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["get"])( stylesObject, nameOrPath ), valueOrObject );
  48344. }
  48345. Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["set"])( stylesObject, nameOrPath, valueToSet );
  48346. }
  48347. /**
  48348. * A CSS style property descriptor that contains tuplet of two strings:
  48349. *
  48350. * - first string describes property name
  48351. * - second string describes property value
  48352. *
  48353. * const marginDescriptor = [ 'margin', '2px 3em' ];
  48354. * const marginTopDescriptor = [ 'margin-top', '2px' ];
  48355. *
  48356. * @typedef {Array.<String, String>} module:engine/view/stylesmap~PropertyDescriptor
  48357. */
  48358. /**
  48359. * An object describing values associated with the sides of a box, for instance margins, paddings,
  48360. * border widths, border colors, etc.
  48361. *
  48362. * const margin = {
  48363. * top: '1px',
  48364. * right: '3px',
  48365. * bottom: '3px',
  48366. * left: '7px'
  48367. * };
  48368. *
  48369. * const borderColor = {
  48370. * top: 'red',
  48371. * right: 'blue',
  48372. * bottom: 'blue',
  48373. * left: 'red'
  48374. * };
  48375. *
  48376. * @typedef {Object} module:engine/view/stylesmap~BoxSides
  48377. *
  48378. * @property {String} top Top side value.
  48379. * @property {String} right Right side value.
  48380. * @property {String} bottom Bottom side value.
  48381. * @property {String} left Left side value.
  48382. */
  48383. /***/ }),
  48384. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js":
  48385. /*!******************************************************************!*\
  48386. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js ***!
  48387. \******************************************************************/
  48388. /*! exports provided: default */
  48389. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48390. "use strict";
  48391. __webpack_require__.r(__webpack_exports__);
  48392. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Text; });
  48393. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  48394. /**
  48395. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  48396. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  48397. */
  48398. /**
  48399. * @module engine/view/text
  48400. */
  48401. /**
  48402. * Tree view text node.
  48403. *
  48404. * The constructor of this class should not be used directly. To create a new text node instance
  48405. * use the {@link module:engine/view/downcastwriter~DowncastWriter#createText `DowncastWriter#createText()`}
  48406. * method when working on data downcasted from the model or the
  48407. * {@link module:engine/view/upcastwriter~UpcastWriter#createText `UpcastWriter#createText()`}
  48408. * method when working on non-semantic views.
  48409. *
  48410. * @extends module:engine/view/node~Node
  48411. */
  48412. class Text extends _node__WEBPACK_IMPORTED_MODULE_0__["default"] {
  48413. /**
  48414. * Creates a tree view text node.
  48415. *
  48416. * @protected
  48417. * @param {module:engine/view/document~Document} document The document instance to which this text node belongs.
  48418. * @param {String} data The text's data.
  48419. */
  48420. constructor( document, data ) {
  48421. super( document );
  48422. /**
  48423. * The text content.
  48424. *
  48425. * Setting the data fires the {@link module:engine/view/node~Node#event:change:text change event}.
  48426. *
  48427. * @protected
  48428. * @member {String} module:engine/view/text~Text#_textData
  48429. */
  48430. this._textData = data;
  48431. }
  48432. /**
  48433. * Checks whether this object is of the given type.
  48434. *
  48435. * text.is( '$text' ); // -> true
  48436. * text.is( 'node' ); // -> true
  48437. * text.is( 'view:$text' ); // -> true
  48438. * text.is( 'view:node' ); // -> true
  48439. *
  48440. * text.is( 'model:$text' ); // -> false
  48441. * text.is( 'element' ); // -> false
  48442. * text.is( 'range' ); // -> false
  48443. *
  48444. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  48445. *
  48446. * **Note:** Until version 20.0.0 this method wasn't accepting `'$text'` type. The legacy `'text'` type is still
  48447. * accepted for backward compatibility.
  48448. *
  48449. * @param {String} type Type to check.
  48450. * @returns {Boolean}
  48451. */
  48452. is( type ) {
  48453. return type === '$text' || type === 'view:$text' ||
  48454. // This are legacy values kept for backward compatibility.
  48455. type === 'text' || type === 'view:text' ||
  48456. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  48457. type === 'node' || type === 'view:node';
  48458. }
  48459. /**
  48460. * The text content.
  48461. *
  48462. * @readonly
  48463. * @type {String}
  48464. */
  48465. get data() {
  48466. return this._textData;
  48467. }
  48468. /**
  48469. * The `_data` property is controlled by a getter and a setter.
  48470. *
  48471. * The getter is required when using the addition assignment operator on protected property:
  48472. *
  48473. * const foo = downcastWriter.createText( 'foo' );
  48474. * const bar = downcastWriter.createText( 'bar' );
  48475. *
  48476. * foo._data += bar.data; // executes: `foo._data = foo._data + bar.data`
  48477. * console.log( foo.data ); // prints: 'foobar'
  48478. *
  48479. * If the protected getter didn't exist, `foo._data` will return `undefined` and result of the merge will be invalid.
  48480. *
  48481. * The setter sets data and fires the {@link module:engine/view/node~Node#event:change:text change event}.
  48482. *
  48483. * @protected
  48484. * @type {String}
  48485. */
  48486. get _data() {
  48487. return this.data;
  48488. }
  48489. set _data( data ) {
  48490. this._fireChange( 'text', this );
  48491. this._textData = data;
  48492. }
  48493. /**
  48494. * Checks if this text node is similar to other text node.
  48495. * Both nodes should have the same data to be considered as similar.
  48496. *
  48497. * @param {module:engine/view/text~Text} otherNode Node to check if it is same as this node.
  48498. * @returns {Boolean}
  48499. */
  48500. isSimilar( otherNode ) {
  48501. if ( !( otherNode instanceof Text ) ) {
  48502. return false;
  48503. }
  48504. return this === otherNode || this.data === otherNode.data;
  48505. }
  48506. /**
  48507. * Clones this node.
  48508. *
  48509. * @protected
  48510. * @returns {module:engine/view/text~Text} Text node that is a clone of this node.
  48511. */
  48512. _clone() {
  48513. return new Text( this.document, this.data );
  48514. }
  48515. // @if CK_DEBUG_ENGINE // toString() {
  48516. // @if CK_DEBUG_ENGINE // return `#${ this.data }`;
  48517. // @if CK_DEBUG_ENGINE // }
  48518. // @if CK_DEBUG_ENGINE // log() {
  48519. // @if CK_DEBUG_ENGINE // console.log( 'ViewText: ' + this );
  48520. // @if CK_DEBUG_ENGINE // }
  48521. // @if CK_DEBUG_ENGINE // logExtended() {
  48522. // @if CK_DEBUG_ENGINE // console.log( 'ViewText: ' + this );
  48523. // @if CK_DEBUG_ENGINE // }
  48524. }
  48525. /***/ }),
  48526. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js":
  48527. /*!***********************************************************************!*\
  48528. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js ***!
  48529. \***********************************************************************/
  48530. /*! exports provided: default */
  48531. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48532. "use strict";
  48533. __webpack_require__.r(__webpack_exports__);
  48534. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextProxy; });
  48535. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  48536. /**
  48537. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  48538. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  48539. */
  48540. /**
  48541. * @module engine/view/textproxy
  48542. */
  48543. /**
  48544. * TextProxy is a wrapper for substring of {@link module:engine/view/text~Text}. Instance of this class is created by
  48545. * {@link module:engine/view/treewalker~TreeWalker} when only a part of {@link module:engine/view/text~Text} needs to be returned.
  48546. *
  48547. * `TextProxy` has an API similar to {@link module:engine/view/text~Text Text} and allows to do most of the common tasks performed
  48548. * on view nodes.
  48549. *
  48550. * **Note:** Some `TextProxy` instances may represent whole text node, not just a part of it.
  48551. * See {@link module:engine/view/textproxy~TextProxy#isPartial}.
  48552. *
  48553. * **Note:** `TextProxy` is a readonly interface.
  48554. *
  48555. * **Note:** `TextProxy` instances are created on the fly basing on the current state of parent {@link module:engine/view/text~Text}.
  48556. * Because of this it is highly unrecommended to store references to `TextProxy instances because they might get
  48557. * invalidated due to operations on Document. Also TextProxy is not a {@link module:engine/view/node~Node} so it can not be
  48558. * inserted as a child of {@link module:engine/view/element~Element}.
  48559. *
  48560. * `TextProxy` instances are created by {@link module:engine/view/treewalker~TreeWalker view tree walker}. You should not need to create
  48561. * an instance of this class by your own.
  48562. */
  48563. class TextProxy {
  48564. /**
  48565. * Creates a text proxy.
  48566. *
  48567. * @protected
  48568. * @param {module:engine/view/text~Text} textNode Text node which part is represented by this text proxy.
  48569. * @param {Number} offsetInText Offset in {@link module:engine/view/textproxy~TextProxy#textNode text node}
  48570. * from which the text proxy starts.
  48571. * @param {Number} length Text proxy length, that is how many text node's characters, starting from `offsetInText` it represents.
  48572. * @constructor
  48573. */
  48574. constructor( textNode, offsetInText, length ) {
  48575. /**
  48576. * Reference to the {@link module:engine/view/text~Text} element which TextProxy is a substring.
  48577. *
  48578. * @readonly
  48579. * @member {module:engine/view/text~Text} module:engine/view/textproxy~TextProxy#textNode
  48580. */
  48581. this.textNode = textNode;
  48582. if ( offsetInText < 0 || offsetInText > textNode.data.length ) {
  48583. /**
  48584. * Given offsetInText value is incorrect.
  48585. *
  48586. * @error view-textproxy-wrong-offsetintext
  48587. */
  48588. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-textproxy-wrong-offsetintext', this );
  48589. }
  48590. if ( length < 0 || offsetInText + length > textNode.data.length ) {
  48591. /**
  48592. * Given length value is incorrect.
  48593. *
  48594. * @error view-textproxy-wrong-length
  48595. */
  48596. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-textproxy-wrong-length', this );
  48597. }
  48598. /**
  48599. * Text data represented by this text proxy.
  48600. *
  48601. * @readonly
  48602. * @member {String} module:engine/view/textproxy~TextProxy#data
  48603. */
  48604. this.data = textNode.data.substring( offsetInText, offsetInText + length );
  48605. /**
  48606. * Offset in the `textNode` where this `TextProxy` instance starts.
  48607. *
  48608. * @readonly
  48609. * @member {Number} module:engine/view/textproxy~TextProxy#offsetInText
  48610. */
  48611. this.offsetInText = offsetInText;
  48612. }
  48613. /**
  48614. * Offset size of this node.
  48615. *
  48616. * @readonly
  48617. * @type {Number}
  48618. */
  48619. get offsetSize() {
  48620. return this.data.length;
  48621. }
  48622. /**
  48623. * Flag indicating whether `TextProxy` instance covers only part of the original {@link module:engine/view/text~Text text node}
  48624. * (`true`) or the whole text node (`false`).
  48625. *
  48626. * This is `false` when text proxy starts at the very beginning of {@link module:engine/view/textproxy~TextProxy#textNode textNode}
  48627. * ({@link module:engine/view/textproxy~TextProxy#offsetInText offsetInText} equals `0`) and text proxy sizes is equal to
  48628. * text node size.
  48629. *
  48630. * @readonly
  48631. * @type {Boolean}
  48632. */
  48633. get isPartial() {
  48634. return this.data.length !== this.textNode.data.length;
  48635. }
  48636. /**
  48637. * Parent of this text proxy, which is same as parent of text node represented by this text proxy.
  48638. *
  48639. * @readonly
  48640. * @type {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment|null}
  48641. */
  48642. get parent() {
  48643. return this.textNode.parent;
  48644. }
  48645. /**
  48646. * Root of this text proxy, which is same as root of text node represented by this text proxy.
  48647. *
  48648. * @readonly
  48649. * @type {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
  48650. */
  48651. get root() {
  48652. return this.textNode.root;
  48653. }
  48654. /**
  48655. * {@link module:engine/view/document~Document View document} that owns this text proxy, or `null` if the text proxy is inside
  48656. * {@link module:engine/view/documentfragment~DocumentFragment document fragment}.
  48657. *
  48658. * @readonly
  48659. * @type {module:engine/view/document~Document|null}
  48660. */
  48661. get document() {
  48662. return this.textNode.document;
  48663. }
  48664. /**
  48665. * Checks whether this object is of the given type.
  48666. *
  48667. * textProxy.is( '$textProxy' ); // -> true
  48668. * textProxy.is( 'view:$textProxy' ); // -> true
  48669. *
  48670. * textProxy.is( 'model:$textProxy' ); // -> false
  48671. * textProxy.is( 'element' ); // -> false
  48672. * textProxy.is( 'range' ); // -> false
  48673. *
  48674. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  48675. *
  48676. * **Note:** Until version 20.0.0 this method wasn't accepting `'$textProxy'` type. The legacy `'textProxy'` type is still
  48677. * accepted for backward compatibility.
  48678. *
  48679. * @param {String} type Type to check.
  48680. * @returns {Boolean}
  48681. */
  48682. is( type ) {
  48683. return type === '$textProxy' || type === 'view:$textProxy' ||
  48684. // This are legacy values kept for backward compatibility.
  48685. type === 'textProxy' || type === 'view:textProxy';
  48686. }
  48687. /**
  48688. * Returns ancestors array of this text proxy.
  48689. *
  48690. * @param {Object} options Options object.
  48691. * @param {Boolean} [options.includeSelf=false] When set to `true` {#textNode} will be also included in parent's array.
  48692. * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from text proxy parent to
  48693. * root element, otherwise root element will be the first item in the array.
  48694. * @returns {Array} Array with ancestors.
  48695. */
  48696. getAncestors( options = { includeSelf: false, parentFirst: false } ) {
  48697. const ancestors = [];
  48698. let parent = options.includeSelf ? this.textNode : this.parent;
  48699. while ( parent !== null ) {
  48700. ancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );
  48701. parent = parent.parent;
  48702. }
  48703. return ancestors;
  48704. }
  48705. // @if CK_DEBUG_ENGINE // toString() {
  48706. // @if CK_DEBUG_ENGINE // return `#${ this.data }`;
  48707. // @if CK_DEBUG_ENGINE // }
  48708. // @if CK_DEBUG_ENGINE // log() {
  48709. // @if CK_DEBUG_ENGINE // console.log( 'ViewTextProxy: ' + this );
  48710. // @if CK_DEBUG_ENGINE // }
  48711. // @if CK_DEBUG_ENGINE // logExtended() {
  48712. // @if CK_DEBUG_ENGINE // console.log( 'ViewTextProxy: ' + this );
  48713. // @if CK_DEBUG_ENGINE // }
  48714. }
  48715. /***/ }),
  48716. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js":
  48717. /*!************************************************************************!*\
  48718. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js ***!
  48719. \************************************************************************/
  48720. /*! exports provided: default */
  48721. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48722. "use strict";
  48723. __webpack_require__.r(__webpack_exports__);
  48724. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TreeWalker; });
  48725. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  48726. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  48727. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js");
  48728. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  48729. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  48730. /**
  48731. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  48732. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  48733. */
  48734. /**
  48735. * @module engine/view/treewalker
  48736. */
  48737. /**
  48738. * Position iterator class. It allows to iterate forward and backward over the document.
  48739. */
  48740. class TreeWalker {
  48741. /**
  48742. * Creates a range iterator. All parameters are optional, but you have to specify either `boundaries` or `startPosition`.
  48743. *
  48744. * @constructor
  48745. * @param {Object} options Object with configuration.
  48746. * @param {module:engine/view/range~Range} [options.boundaries=null] Range to define boundaries of the iterator.
  48747. * @param {module:engine/view/position~Position} [options.startPosition] Starting position.
  48748. * @param {'forward'|'backward'} [options.direction='forward'] Walking direction.
  48749. * @param {Boolean} [options.singleCharacters=false] Flag indicating whether all characters from
  48750. * {@link module:engine/view/text~Text} should be returned as one {@link module:engine/view/text~Text} (`false`) ore one by one as
  48751. * {@link module:engine/view/textproxy~TextProxy} (`true`).
  48752. * @param {Boolean} [options.shallow=false] Flag indicating whether iterator should enter elements or not. If the
  48753. * iterator is shallow child nodes of any iterated node will not be returned along with `elementEnd` tag.
  48754. * @param {Boolean} [options.ignoreElementEnd=false] Flag indicating whether iterator should ignore `elementEnd`
  48755. * tags. If the option is true walker will not return a parent node of start position. If this option is `true`
  48756. * each {@link module:engine/view/element~Element} will be returned once, while if the option is `false` they might be returned
  48757. * twice: for `'elementStart'` and `'elementEnd'`.
  48758. */
  48759. constructor( options = {} ) {
  48760. if ( !options.boundaries && !options.startPosition ) {
  48761. /**
  48762. * Neither boundaries nor starting position have been defined.
  48763. *
  48764. * @error view-tree-walker-no-start-position
  48765. */
  48766. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  48767. 'view-tree-walker-no-start-position',
  48768. null
  48769. );
  48770. }
  48771. if ( options.direction && options.direction != 'forward' && options.direction != 'backward' ) {
  48772. /**
  48773. * Only `backward` and `forward` direction allowed.
  48774. *
  48775. * @error view-tree-walker-unknown-direction
  48776. */
  48777. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'view-tree-walker-unknown-direction', options.startPosition, { direction: options.direction } );
  48778. }
  48779. /**
  48780. * Iterator boundaries.
  48781. *
  48782. * When the iterator is walking `'forward'` on the end of boundary or is walking `'backward'`
  48783. * on the start of boundary, then `{ done: true }` is returned.
  48784. *
  48785. * If boundaries are not defined they are set before first and after last child of the root node.
  48786. *
  48787. * @readonly
  48788. * @member {module:engine/view/range~Range} module:engine/view/treewalker~TreeWalker#boundaries
  48789. */
  48790. this.boundaries = options.boundaries || null;
  48791. /**
  48792. * Iterator position. If start position is not defined then position depends on {@link #direction}. If direction is
  48793. * `'forward'` position starts form the beginning, when direction is `'backward'` position starts from the end.
  48794. *
  48795. * @readonly
  48796. * @member {module:engine/view/position~Position} module:engine/view/treewalker~TreeWalker#position
  48797. */
  48798. if ( options.startPosition ) {
  48799. this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAt( options.startPosition );
  48800. } else {
  48801. this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAt( options.boundaries[ options.direction == 'backward' ? 'end' : 'start' ] );
  48802. }
  48803. /**
  48804. * Walking direction. Defaults `'forward'`.
  48805. *
  48806. * @readonly
  48807. * @member {'backward'|'forward'} module:engine/view/treewalker~TreeWalker#direction
  48808. */
  48809. this.direction = options.direction || 'forward';
  48810. /**
  48811. * Flag indicating whether all characters from {@link module:engine/view/text~Text} should be returned as one
  48812. * {@link module:engine/view/text~Text} or one by one as {@link module:engine/view/textproxy~TextProxy}.
  48813. *
  48814. * @readonly
  48815. * @member {Boolean} module:engine/view/treewalker~TreeWalker#singleCharacters
  48816. */
  48817. this.singleCharacters = !!options.singleCharacters;
  48818. /**
  48819. * Flag indicating whether iterator should enter elements or not. If the iterator is shallow child nodes of any
  48820. * iterated node will not be returned along with `elementEnd` tag.
  48821. *
  48822. * @readonly
  48823. * @member {Boolean} module:engine/view/treewalker~TreeWalker#shallow
  48824. */
  48825. this.shallow = !!options.shallow;
  48826. /**
  48827. * Flag indicating whether iterator should ignore `elementEnd` tags. If set to `true`, walker will not
  48828. * return a parent node of the start position. Each {@link module:engine/view/element~Element} will be returned once.
  48829. * When set to `false` each element might be returned twice: for `'elementStart'` and `'elementEnd'`.
  48830. *
  48831. * @readonly
  48832. * @member {Boolean} module:engine/view/treewalker~TreeWalker#ignoreElementEnd
  48833. */
  48834. this.ignoreElementEnd = !!options.ignoreElementEnd;
  48835. /**
  48836. * Start boundary parent.
  48837. *
  48838. * @private
  48839. * @member {module:engine/view/node~Node} module:engine/view/treewalker~TreeWalker#_boundaryStartParent
  48840. */
  48841. this._boundaryStartParent = this.boundaries ? this.boundaries.start.parent : null;
  48842. /**
  48843. * End boundary parent.
  48844. *
  48845. * @private
  48846. * @member {module:engine/view/node~Node} module:engine/view/treewalker~TreeWalker#_boundaryEndParent
  48847. */
  48848. this._boundaryEndParent = this.boundaries ? this.boundaries.end.parent : null;
  48849. }
  48850. /**
  48851. * Iterable interface.
  48852. *
  48853. * @returns {Iterable.<module:engine/view/treewalker~TreeWalkerValue>}
  48854. */
  48855. [ Symbol.iterator ]() {
  48856. return this;
  48857. }
  48858. /**
  48859. * Moves {@link #position} in the {@link #direction} skipping values as long as the callback function returns `true`.
  48860. *
  48861. * For example:
  48862. *
  48863. * walker.skip( value => value.type == 'text' ); // <p>{}foo</p> -> <p>foo[]</p>
  48864. * walker.skip( value => true ); // Move the position to the end: <p>{}foo</p> -> <p>foo</p>[]
  48865. * walker.skip( value => false ); // Do not move the position.
  48866. *
  48867. * @param {Function} skip Callback function. Gets {@link module:engine/view/treewalker~TreeWalkerValue} and should
  48868. * return `true` if the value should be skipped or `false` if not.
  48869. */
  48870. skip( skip ) {
  48871. let done, value, prevPosition;
  48872. do {
  48873. prevPosition = this.position;
  48874. ( { done, value } = this.next() );
  48875. } while ( !done && skip( value ) );
  48876. if ( !done ) {
  48877. this.position = prevPosition;
  48878. }
  48879. }
  48880. /**
  48881. * Gets the next tree walker's value.
  48882. *
  48883. * @returns {module:engine/view/treewalker~TreeWalkerValue} Object implementing iterator interface, returning
  48884. * information about taken step.
  48885. */
  48886. next() {
  48887. if ( this.direction == 'forward' ) {
  48888. return this._next();
  48889. } else {
  48890. return this._previous();
  48891. }
  48892. }
  48893. /**
  48894. * Makes a step forward in view. Moves the {@link #position} to the next position and returns the encountered value.
  48895. *
  48896. * @private
  48897. * @returns {Object}
  48898. * @returns {Boolean} return.done `true` if iterator is done, `false` otherwise.
  48899. * @returns {module:engine/view/treewalker~TreeWalkerValue} return.value Information about taken step.
  48900. */
  48901. _next() {
  48902. let position = this.position.clone();
  48903. const previousPosition = this.position;
  48904. const parent = position.parent;
  48905. // We are at the end of the root.
  48906. if ( parent.parent === null && position.offset === parent.childCount ) {
  48907. return { done: true };
  48908. }
  48909. // We reached the walker boundary.
  48910. if ( parent === this._boundaryEndParent && position.offset == this.boundaries.end.offset ) {
  48911. return { done: true };
  48912. }
  48913. // Get node just after current position.
  48914. let node;
  48915. // Text is a specific parent because it contains string instead of child nodes.
  48916. if ( parent instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  48917. if ( position.isAtEnd ) {
  48918. // Prevent returning "elementEnd" for Text node. Skip that value and return the next walker step.
  48919. this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( parent );
  48920. return this._next();
  48921. }
  48922. node = parent.data[ position.offset ];
  48923. } else {
  48924. node = parent.getChild( position.offset );
  48925. }
  48926. if ( node instanceof _element__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  48927. if ( !this.shallow ) {
  48928. position = new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( node, 0 );
  48929. } else {
  48930. position.offset++;
  48931. }
  48932. this.position = position;
  48933. return this._formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
  48934. } else if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  48935. if ( this.singleCharacters ) {
  48936. position = new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( node, 0 );
  48937. this.position = position;
  48938. return this._next();
  48939. } else {
  48940. let charactersCount = node.data.length;
  48941. let item;
  48942. // If text stick out of walker range, we need to cut it and wrap in TextProxy.
  48943. if ( node == this._boundaryEndParent ) {
  48944. charactersCount = this.boundaries.end.offset;
  48945. item = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( node, 0, charactersCount );
  48946. position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( item );
  48947. } else {
  48948. item = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( node, 0, node.data.length );
  48949. // If not just keep moving forward.
  48950. position.offset++;
  48951. }
  48952. this.position = position;
  48953. return this._formatReturnValue( 'text', item, previousPosition, position, charactersCount );
  48954. }
  48955. } else if ( typeof node == 'string' ) {
  48956. let textLength;
  48957. if ( this.singleCharacters ) {
  48958. textLength = 1;
  48959. } else {
  48960. // Check if text stick out of walker range.
  48961. const endOffset = parent === this._boundaryEndParent ? this.boundaries.end.offset : parent.data.length;
  48962. textLength = endOffset - position.offset;
  48963. }
  48964. const textProxy = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( parent, position.offset, textLength );
  48965. position.offset += textLength;
  48966. this.position = position;
  48967. return this._formatReturnValue( 'text', textProxy, previousPosition, position, textLength );
  48968. } else {
  48969. // `node` is not set, we reached the end of current `parent`.
  48970. position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( parent );
  48971. this.position = position;
  48972. if ( this.ignoreElementEnd ) {
  48973. return this._next();
  48974. } else {
  48975. return this._formatReturnValue( 'elementEnd', parent, previousPosition, position );
  48976. }
  48977. }
  48978. }
  48979. /**
  48980. * Makes a step backward in view. Moves the {@link #position} to the previous position and returns the encountered value.
  48981. *
  48982. * @private
  48983. * @returns {Object}
  48984. * @returns {Boolean} return.done True if iterator is done.
  48985. * @returns {module:engine/view/treewalker~TreeWalkerValue} return.value Information about taken step.
  48986. */
  48987. _previous() {
  48988. let position = this.position.clone();
  48989. const previousPosition = this.position;
  48990. const parent = position.parent;
  48991. // We are at the beginning of the root.
  48992. if ( parent.parent === null && position.offset === 0 ) {
  48993. return { done: true };
  48994. }
  48995. // We reached the walker boundary.
  48996. if ( parent == this._boundaryStartParent && position.offset == this.boundaries.start.offset ) {
  48997. return { done: true };
  48998. }
  48999. // Get node just before current position.
  49000. let node;
  49001. // Text {@link module:engine/view/text~Text} element is a specific parent because contains string instead of child nodes.
  49002. if ( parent instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  49003. if ( position.isAtStart ) {
  49004. // Prevent returning "elementStart" for Text node. Skip that value and return the next walker step.
  49005. this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( parent );
  49006. return this._previous();
  49007. }
  49008. node = parent.data[ position.offset - 1 ];
  49009. } else {
  49010. node = parent.getChild( position.offset - 1 );
  49011. }
  49012. if ( node instanceof _element__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  49013. if ( !this.shallow ) {
  49014. position = new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( node, node.childCount );
  49015. this.position = position;
  49016. if ( this.ignoreElementEnd ) {
  49017. return this._previous();
  49018. } else {
  49019. return this._formatReturnValue( 'elementEnd', node, previousPosition, position );
  49020. }
  49021. } else {
  49022. position.offset--;
  49023. this.position = position;
  49024. return this._formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
  49025. }
  49026. } else if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  49027. if ( this.singleCharacters ) {
  49028. position = new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( node, node.data.length );
  49029. this.position = position;
  49030. return this._previous();
  49031. } else {
  49032. let charactersCount = node.data.length;
  49033. let item;
  49034. // If text stick out of walker range, we need to cut it and wrap in TextProxy.
  49035. if ( node == this._boundaryStartParent ) {
  49036. const offset = this.boundaries.start.offset;
  49037. item = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( node, offset, node.data.length - offset );
  49038. charactersCount = item.data.length;
  49039. position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( item );
  49040. } else {
  49041. item = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( node, 0, node.data.length );
  49042. // If not just keep moving backward.
  49043. position.offset--;
  49044. }
  49045. this.position = position;
  49046. return this._formatReturnValue( 'text', item, previousPosition, position, charactersCount );
  49047. }
  49048. } else if ( typeof node == 'string' ) {
  49049. let textLength;
  49050. if ( !this.singleCharacters ) {
  49051. // Check if text stick out of walker range.
  49052. const startOffset = parent === this._boundaryStartParent ? this.boundaries.start.offset : 0;
  49053. textLength = position.offset - startOffset;
  49054. } else {
  49055. textLength = 1;
  49056. }
  49057. position.offset -= textLength;
  49058. const textProxy = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( parent, position.offset, textLength );
  49059. this.position = position;
  49060. return this._formatReturnValue( 'text', textProxy, previousPosition, position, textLength );
  49061. } else {
  49062. // `node` is not set, we reached the beginning of current `parent`.
  49063. position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( parent );
  49064. this.position = position;
  49065. return this._formatReturnValue( 'elementStart', parent, previousPosition, position, 1 );
  49066. }
  49067. }
  49068. /**
  49069. * Format returned data and adjust `previousPosition` and `nextPosition` if reach the bound of the {@link module:engine/view/text~Text}.
  49070. *
  49071. * @private
  49072. * @param {module:engine/view/treewalker~TreeWalkerValueType} type Type of step.
  49073. * @param {module:engine/view/item~Item} item Item between old and new position.
  49074. * @param {module:engine/view/position~Position} previousPosition Previous position of iterator.
  49075. * @param {module:engine/view/position~Position} nextPosition Next position of iterator.
  49076. * @param {Number} [length] Length of the item.
  49077. * @returns {module:engine/view/treewalker~TreeWalkerValue}
  49078. */
  49079. _formatReturnValue( type, item, previousPosition, nextPosition, length ) {
  49080. // Text is a specific parent, because contains string instead of children.
  49081. // Walker doesn't enter to the Text except situations when walker is iterating over every single character,
  49082. // or the bound starts/ends inside the Text. So when the position is at the beginning or at the end of the Text
  49083. // we move it just before or just after Text.
  49084. if ( item instanceof _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  49085. // Position is at the end of Text.
  49086. if ( item.offsetInText + item.data.length == item.textNode.data.length ) {
  49087. if ( this.direction == 'forward' && !( this.boundaries && this.boundaries.end.isEqual( this.position ) ) ) {
  49088. nextPosition = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( item.textNode );
  49089. // When we change nextPosition of returned value we need also update walker current position.
  49090. this.position = nextPosition;
  49091. } else {
  49092. previousPosition = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( item.textNode );
  49093. }
  49094. }
  49095. // Position is at the begining ot the text.
  49096. if ( item.offsetInText === 0 ) {
  49097. if ( this.direction == 'backward' && !( this.boundaries && this.boundaries.start.isEqual( this.position ) ) ) {
  49098. nextPosition = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( item.textNode );
  49099. // When we change nextPosition of returned value we need also update walker current position.
  49100. this.position = nextPosition;
  49101. } else {
  49102. previousPosition = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( item.textNode );
  49103. }
  49104. }
  49105. }
  49106. return {
  49107. done: false,
  49108. value: {
  49109. type,
  49110. item,
  49111. previousPosition,
  49112. nextPosition,
  49113. length
  49114. }
  49115. };
  49116. }
  49117. }
  49118. /**
  49119. * Type of the step made by {@link module:engine/view/treewalker~TreeWalker}.
  49120. * Possible values: `'elementStart'` if walker is at the beginning of a node, `'elementEnd'` if walker is at the end
  49121. * of node, or `'text'` if walker traversed over single and multiple characters.
  49122. * For {@link module:engine/view/text~Text} `elementStart` and `elementEnd` is not returned.
  49123. *
  49124. * @typedef {String} module:engine/view/treewalker~TreeWalkerValueType
  49125. */
  49126. /**
  49127. * Object returned by {@link module:engine/view/treewalker~TreeWalker} when traversing tree view.
  49128. *
  49129. * @typedef {Object} module:engine/view/treewalker~TreeWalkerValue
  49130. * @property {module:engine/view/treewalker~TreeWalkerValueType} type
  49131. * @property {module:engine/view/item~Item} item Item between the old and the new positions
  49132. * of the tree walker.
  49133. * @property {module:engine/view/position~Position} previousPosition Previous position of the iterator.
  49134. * * Forward iteration: For `'elementEnd'` it is the last position inside the element. For all other types it is the
  49135. * position before the item.
  49136. * * Backward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
  49137. * the position after item.
  49138. * * If the position is at the beginning or at the end of the {@link module:engine/view/text~Text} it is always moved from the
  49139. * inside of the text to its parent just before or just after that text.
  49140. * @property {module:engine/view/position~Position} nextPosition Next position of the iterator.
  49141. * * Forward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
  49142. * the position after the item.
  49143. * * Backward iteration: For `'elementEnd'` it is last position inside element. For all other types it is the position
  49144. * before the item.
  49145. * * If the position is at the beginning or at the end of the {@link module:engine/view/text~Text} it is always moved from the
  49146. * inside of the text to its parent just before or just after that text.
  49147. * @property {Number} [length] Length of the item. For `'elementStart'` it is `1`. For `'text'` it is
  49148. * the length of that text. For `'elementEnd'` it is `undefined`.
  49149. */
  49150. /**
  49151. * Tree walking directions.
  49152. *
  49153. * @typedef {'forward'|'backward'} module:engine/view/treewalker~TreeWalkerDirection
  49154. */
  49155. /***/ }),
  49156. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js":
  49157. /*!***********************************************************************!*\
  49158. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js ***!
  49159. \***********************************************************************/
  49160. /*! exports provided: default, injectUiElementHandling */
  49161. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49162. "use strict";
  49163. __webpack_require__.r(__webpack_exports__);
  49164. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UIElement; });
  49165. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectUiElementHandling", function() { return injectUiElementHandling; });
  49166. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  49167. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  49168. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  49169. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  49170. /**
  49171. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  49172. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49173. */
  49174. /**
  49175. * @module engine/view/uielement
  49176. */
  49177. /**
  49178. * UI element class. It should be used to represent editing UI which needs to be injected into the editing view
  49179. * If possible, you should keep your UI outside the editing view. However, if that is not possible,
  49180. * UI elements can be used.
  49181. *
  49182. * How a UI element is rendered is in your control (you pass a callback to
  49183. * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`}).
  49184. * The editor will ignore your UI element – the selection cannot be placed in it, it is skipped (invisible) when
  49185. * the user modifies the selection by using arrow keys and the editor does not listen to any mutations which
  49186. * happen inside your UI elements.
  49187. *
  49188. * The limitation is that you cannot convert a model element to a UI element. UI elements need to be
  49189. * created for {@link module:engine/model/markercollection~Marker markers} or as additinal elements
  49190. * inside normal {@link module:engine/view/containerelement~ContainerElement container elements}.
  49191. *
  49192. * To create a new UI element use the
  49193. * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`} method.
  49194. *
  49195. * @extends module:engine/view/element~Element
  49196. */
  49197. class UIElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  49198. /**
  49199. * Creates new instance of UIElement.
  49200. *
  49201. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-uielement-cannot-add` when third parameter is passed,
  49202. * to inform that usage of UIElement is incorrect (adding child nodes to UIElement is forbidden).
  49203. *
  49204. * @see module:engine/view/downcastwriter~DowncastWriter#createUIElement
  49205. * @protected
  49206. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  49207. * @param {String} name Node name.
  49208. * @param {Object|Iterable} [attributes] Collection of attributes.
  49209. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  49210. * A list of nodes to be inserted into created element.
  49211. */
  49212. constructor( document, name, attributes, children ) {
  49213. super( document, name, attributes, children );
  49214. // Override the default of the base class.
  49215. this._isAllowedInsideAttributeElement = true;
  49216. /**
  49217. * Returns `null` because filler is not needed for UIElements.
  49218. *
  49219. * @method #getFillerOffset
  49220. * @returns {null} Always returns null.
  49221. */
  49222. this.getFillerOffset = getFillerOffset;
  49223. }
  49224. /**
  49225. * Checks whether this object is of the given.
  49226. *
  49227. * uiElement.is( 'uiElement' ); // -> true
  49228. * uiElement.is( 'element' ); // -> true
  49229. * uiElement.is( 'node' ); // -> true
  49230. * uiElement.is( 'view:uiElement' ); // -> true
  49231. * uiElement.is( 'view:element' ); // -> true
  49232. * uiElement.is( 'view:node' ); // -> true
  49233. *
  49234. * uiElement.is( 'model:element' ); // -> false
  49235. * uiElement.is( 'documentFragment' ); // -> false
  49236. *
  49237. * Assuming that the object being checked is an ui element, you can also check its
  49238. * {@link module:engine/view/uielement~UIElement#name name}:
  49239. *
  49240. * uiElement.is( 'element', 'span' ); // -> true if this is a span ui element
  49241. * uiElement.is( 'uiElement', 'span' ); // -> same as above
  49242. * text.is( 'element', 'span' ); -> false
  49243. *
  49244. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  49245. *
  49246. * @param {String} type Type to check.
  49247. * @param {String} [name] Element name.
  49248. * @returns {Boolean}
  49249. */
  49250. is( type, name = null ) {
  49251. if ( !name ) {
  49252. return type === 'uiElement' || type === 'view:uiElement' ||
  49253. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  49254. type === 'element' || type === 'view:element' ||
  49255. type === 'node' || type === 'view:node';
  49256. } else {
  49257. return name === this.name && (
  49258. type === 'uiElement' || type === 'view:uiElement' ||
  49259. type === 'element' || type === 'view:element'
  49260. );
  49261. }
  49262. }
  49263. /**
  49264. * Overrides {@link module:engine/view/element~Element#_insertChild} method.
  49265. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-uielement-cannot-add` to prevent adding any child nodes
  49266. * to UIElement.
  49267. *
  49268. * @protected
  49269. */
  49270. _insertChild( index, nodes ) {
  49271. if ( nodes && ( nodes instanceof _node__WEBPACK_IMPORTED_MODULE_2__["default"] || Array.from( nodes ).length > 0 ) ) {
  49272. /**
  49273. * Cannot add children to {@link module:engine/view/uielement~UIElement}.
  49274. *
  49275. * @error view-uielement-cannot-add
  49276. */
  49277. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'view-uielement-cannot-add', this );
  49278. }
  49279. }
  49280. /**
  49281. * Renders this {@link module:engine/view/uielement~UIElement} to DOM. This method is called by
  49282. * {@link module:engine/view/domconverter~DomConverter}.
  49283. * Do not use inheritance to create custom rendering method, replace `render()` method instead:
  49284. *
  49285. * const myUIElement = downcastWriter.createUIElement( 'span' );
  49286. * myUIElement.render = function( domDocument, domConverter ) {
  49287. * const domElement = this.toDomElement( domDocument );
  49288. *
  49289. * domConverter.setContentOf( domElement, '<b>this is ui element</b>' );
  49290. *
  49291. * return domElement;
  49292. * };
  49293. *
  49294. * If changes in your UI element should trigger some editor UI update you should call
  49295. * the {@link module:core/editor/editorui~EditorUI#update `editor.ui.update()`} method
  49296. * after rendering your UI element.
  49297. *
  49298. * @param {Document} domDocument
  49299. * @param {module:engine/view/domconverter~DomConverter} domConverter Instance of the DomConverter used to optimize the output.
  49300. * @returns {HTMLElement}
  49301. */
  49302. render( domDocument ) {
  49303. // Provide basic, default output.
  49304. return this.toDomElement( domDocument );
  49305. }
  49306. /**
  49307. * Creates DOM element based on this view UIElement.
  49308. * Note that each time this method is called new DOM element is created.
  49309. *
  49310. * @param {Document} domDocument
  49311. * @returns {HTMLElement}
  49312. */
  49313. toDomElement( domDocument ) {
  49314. const domElement = domDocument.createElement( this.name );
  49315. for ( const key of this.getAttributeKeys() ) {
  49316. domElement.setAttribute( key, this.getAttribute( key ) );
  49317. }
  49318. return domElement;
  49319. }
  49320. }
  49321. /**
  49322. * This function injects UI element handling to the given {@link module:engine/view/document~Document document}.
  49323. *
  49324. * A callback is added to {@link module:engine/view/document~Document#event:keydown document keydown event}.
  49325. * The callback handles the situation when right arrow key is pressed and selection is collapsed before a UI element.
  49326. * Without this handler, it would be impossible to "jump over" UI element using right arrow key.
  49327. *
  49328. * @param {module:engine/view/view~View} view View controller to which the quirks handling will be injected.
  49329. */
  49330. function injectUiElementHandling( view ) {
  49331. view.document.on( 'arrowKey', ( evt, data ) => jumpOverUiElement( evt, data, view.domConverter ), { priority: 'low' } );
  49332. }
  49333. // Returns `null` because block filler is not needed for UIElements.
  49334. //
  49335. // @returns {null}
  49336. function getFillerOffset() {
  49337. return null;
  49338. }
  49339. // Selection cannot be placed in a `UIElement`. Whenever it is placed there, it is moved before it. This
  49340. // causes a situation when it is impossible to jump over `UIElement` using right arrow key, because the selection
  49341. // ends up in ui element (in DOM) and is moved back to the left. This handler fixes this situation.
  49342. function jumpOverUiElement( evt, data, domConverter ) {
  49343. if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].arrowright ) {
  49344. const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
  49345. const domSelectionCollapsed = domSelection.rangeCount == 1 && domSelection.getRangeAt( 0 ).collapsed;
  49346. // Jump over UI element if selection is collapsed or shift key is pressed. These are the cases when selection would extend.
  49347. if ( domSelectionCollapsed || data.shiftKey ) {
  49348. const domParent = domSelection.focusNode;
  49349. const domOffset = domSelection.focusOffset;
  49350. const viewPosition = domConverter.domPositionToView( domParent, domOffset );
  49351. // In case if dom element is not converted to view or is not mapped or something. Happens for example in some tests.
  49352. if ( viewPosition === null ) {
  49353. return;
  49354. }
  49355. // Skip all following ui elements.
  49356. let jumpedOverAnyUiElement = false;
  49357. const nextViewPosition = viewPosition.getLastMatchingPosition( value => {
  49358. if ( value.item.is( 'uiElement' ) ) {
  49359. // Remember that there was at least one ui element.
  49360. jumpedOverAnyUiElement = true;
  49361. }
  49362. // Jump over ui elements, jump over empty attribute elements, move up from inside of attribute element.
  49363. if ( value.item.is( 'uiElement' ) || value.item.is( 'attributeElement' ) ) {
  49364. return true;
  49365. }
  49366. // Don't jump over text or don't get out of container element.
  49367. return false;
  49368. } );
  49369. // If anything has been skipped, fix position.
  49370. // This `if` could be possibly omitted but maybe it is better not to mess with DOM selection if not needed.
  49371. if ( jumpedOverAnyUiElement ) {
  49372. const newDomPosition = domConverter.viewPositionToDom( nextViewPosition );
  49373. if ( domSelectionCollapsed ) {
  49374. // Selection was collapsed, so collapse it at further position.
  49375. domSelection.collapse( newDomPosition.parent, newDomPosition.offset );
  49376. } else {
  49377. // Selection was not collapse, so extend it instead of collapsing.
  49378. domSelection.extend( newDomPosition.parent, newDomPosition.offset );
  49379. }
  49380. }
  49381. }
  49382. }
  49383. }
  49384. /***/ }),
  49385. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js":
  49386. /*!**************************************************************************!*\
  49387. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js ***!
  49388. \**************************************************************************/
  49389. /*! exports provided: default */
  49390. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49391. "use strict";
  49392. __webpack_require__.r(__webpack_exports__);
  49393. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UpcastWriter; });
  49394. /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js");
  49395. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  49396. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  49397. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  49398. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  49399. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  49400. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  49401. /**
  49402. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  49403. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49404. */
  49405. /**
  49406. * @module module:engine/view/upcastwriter
  49407. */
  49408. /**
  49409. * View upcast writer. It provides a set of methods used to manipulate non-semantic view trees.
  49410. *
  49411. * It should be used only while working on a non-semantic view
  49412. * (e.g. a view created from HTML string on paste).
  49413. * To manipulate a view which was or is being downcasted from the the model use the
  49414. * {@link module:engine/view/downcastwriter~DowncastWriter downcast writer}.
  49415. *
  49416. * Read more about changing the view in the {@glink framework/guides/architecture/editing-engine#changing-the-view Changing the view}
  49417. * section of the {@glink framework/guides/architecture/editing-engine Editing engine architecture} guide.
  49418. *
  49419. * Unlike `DowncastWriter`, which is available in the {@link module:engine/view/view~View#change `View#change()`} block,
  49420. * `UpcastWriter` can be created wherever you need it:
  49421. *
  49422. * const writer = new UpcastWriter( viewDocument );
  49423. * const text = writer.createText( 'foo!' );
  49424. *
  49425. * writer.appendChild( text, someViewElement );
  49426. */
  49427. class UpcastWriter {
  49428. /**
  49429. * @param {module:engine/view/document~Document} document The view document instance in which this upcast writer operates.
  49430. */
  49431. constructor( document ) {
  49432. /**
  49433. * The view document instance in which this upcast writer operates.
  49434. *
  49435. * @readonly
  49436. * @type {module:engine/view/document~Document}
  49437. */
  49438. this.document = document;
  49439. }
  49440. /**
  49441. * Creates a new {@link module:engine/view/documentfragment~DocumentFragment} instance.
  49442. *
  49443. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  49444. * A list of nodes to be inserted into the created document fragment.
  49445. * @returns {module:engine/view/documentfragment~DocumentFragment} The created document fragment.
  49446. */
  49447. createDocumentFragment( children ) {
  49448. return new _documentfragment__WEBPACK_IMPORTED_MODULE_0__["default"]( this.document, children );
  49449. }
  49450. /**
  49451. * Creates a new {@link module:engine/view/element~Element} instance.
  49452. *
  49453. * Attributes can be passed in various formats:
  49454. *
  49455. * upcastWriter.createElement( 'div', { class: 'editor', contentEditable: 'true' } ); // object
  49456. * upcastWriter.createElement( 'div', [ [ 'class', 'editor' ], [ 'contentEditable', 'true' ] ] ); // map-like iterator
  49457. * upcastWriter.createElement( 'div', mapOfAttributes ); // map
  49458. *
  49459. * @param {String} name Node name.
  49460. * @param {Object|Iterable} [attrs] Collection of attributes.
  49461. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  49462. * A list of nodes to be inserted into created element.
  49463. * @returns {module:engine/view/element~Element} Created element.
  49464. */
  49465. createElement( name, attrs, children ) {
  49466. return new _element__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document, name, attrs, children );
  49467. }
  49468. /**
  49469. * Creates a new {@link module:engine/view/text~Text} instance.
  49470. *
  49471. * @param {String} data The text's data.
  49472. * @returns {module:engine/view/text~Text} The created text node.
  49473. */
  49474. createText( data ) {
  49475. return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( this.document, data );
  49476. }
  49477. /**
  49478. * Clones the provided element.
  49479. *
  49480. * @see module:engine/view/element~Element#_clone
  49481. * @param {module:engine/view/element~Element} element Element to be cloned.
  49482. * @param {Boolean} [deep=false] If set to `true` clones element and all its children recursively. When set to `false`,
  49483. * element will be cloned without any children.
  49484. * @returns {module:engine/view/element~Element} Clone of this element.
  49485. */
  49486. clone( element, deep = false ) {
  49487. return element._clone( deep );
  49488. }
  49489. /**
  49490. * Appends a child node or a list of child nodes at the end of this node
  49491. * and sets the parent of these nodes to this element.
  49492. *
  49493. * @see module:engine/view/element~Element#_appendChild
  49494. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  49495. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} element Element
  49496. * to which items will be appended.
  49497. * @fires module:engine/view/node~Node#event:change
  49498. * @returns {Number} Number of appended nodes.
  49499. */
  49500. appendChild( items, element ) {
  49501. return element._appendChild( items );
  49502. }
  49503. /**
  49504. * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to
  49505. * this element.
  49506. *
  49507. * @see module:engine/view/element~Element#_insertChild
  49508. * @param {Number} index Offset at which nodes should be inserted.
  49509. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  49510. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} element Element
  49511. * to which items will be inserted.
  49512. * @fires module:engine/view/node~Node#event:change
  49513. * @returns {Number} Number of inserted nodes.
  49514. */
  49515. insertChild( index, items, element ) {
  49516. return element._insertChild( index, items );
  49517. }
  49518. /**
  49519. * Removes the given number of child nodes starting at the given index and set the parent of these nodes to `null`.
  49520. *
  49521. * @see module:engine/view/element~Element#_removeChildren
  49522. * @param {Number} index Offset from which nodes will be removed.
  49523. * @param {Number} howMany Number of nodes to remove.
  49524. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} element Element
  49525. * which children will be removed.
  49526. * @fires module:engine/view/node~Node#event:change
  49527. * @returns {Array.<module:engine/view/node~Node>} The array containing removed nodes.
  49528. */
  49529. removeChildren( index, howMany, element ) {
  49530. return element._removeChildren( index, howMany );
  49531. }
  49532. /**
  49533. * Removes given element from the view structure. Will not have effect on detached elements.
  49534. *
  49535. * @param {module:engine/view/element~Element} element Element which will be removed.
  49536. * @returns {Array.<module:engine/view/node~Node>} The array containing removed nodes.
  49537. */
  49538. remove( element ) {
  49539. const parent = element.parent;
  49540. if ( parent ) {
  49541. return this.removeChildren( parent.getChildIndex( element ), 1, parent );
  49542. }
  49543. return [];
  49544. }
  49545. /**
  49546. * Replaces given element with the new one in the view structure. Will not have effect on detached elements.
  49547. *
  49548. * @param {module:engine/view/element~Element} oldElement Element which will be replaced.
  49549. * @param {module:engine/view/element~Element} newElement Element which will be inserted in the place of the old element.
  49550. * @returns {Boolean} Whether old element was successfully replaced.
  49551. */
  49552. replace( oldElement, newElement ) {
  49553. const parent = oldElement.parent;
  49554. if ( parent ) {
  49555. const index = parent.getChildIndex( oldElement );
  49556. this.removeChildren( index, 1, parent );
  49557. this.insertChild( index, newElement, parent );
  49558. return true;
  49559. }
  49560. return false;
  49561. }
  49562. /**
  49563. * Removes given element from view structure and places its children in its position.
  49564. * It does nothing if element has no parent.
  49565. *
  49566. * @param {module:engine/view/element~Element} element Element to unwrap.
  49567. */
  49568. unwrapElement( element ) {
  49569. const parent = element.parent;
  49570. if ( parent ) {
  49571. const index = parent.getChildIndex( element );
  49572. this.remove( element );
  49573. this.insertChild( index, element.getChildren(), parent );
  49574. }
  49575. }
  49576. /**
  49577. * Renames element by creating a copy of a given element but with its name changed and then moving contents of the
  49578. * old element to the new one.
  49579. *
  49580. * Since this function creates a new element and removes the given one, the new element is returned to keep reference.
  49581. *
  49582. * @param {String} newName New element name.
  49583. * @param {module:engine/view/element~Element} element Element to be renamed.
  49584. * @returns {module:engine/view/element~Element|null} New element or null if the old element
  49585. * was not replaced (happens for detached elements).
  49586. */
  49587. rename( newName, element ) {
  49588. const newElement = new _element__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document, newName, element.getAttributes(), element.getChildren() );
  49589. return this.replace( element, newElement ) ? newElement : null;
  49590. }
  49591. /**
  49592. * Adds or overwrites element's attribute with a specified key and value.
  49593. *
  49594. * writer.setAttribute( 'href', 'http://ckeditor.com', linkElement );
  49595. *
  49596. * @see module:engine/view/element~Element#_setAttribute
  49597. * @param {String} key Attribute key.
  49598. * @param {String} value Attribute value.
  49599. * @param {module:engine/view/element~Element} element Element for which attribute will be set.
  49600. */
  49601. setAttribute( key, value, element ) {
  49602. element._setAttribute( key, value );
  49603. }
  49604. /**
  49605. * Removes attribute from the element.
  49606. *
  49607. * writer.removeAttribute( 'href', linkElement );
  49608. *
  49609. * @see module:engine/view/element~Element#_removeAttribute
  49610. * @param {String} key Attribute key.
  49611. * @param {module:engine/view/element~Element} element Element from which attribute will be removed.
  49612. */
  49613. removeAttribute( key, element ) {
  49614. element._removeAttribute( key );
  49615. }
  49616. /**
  49617. * Adds specified class to the element.
  49618. *
  49619. * writer.addClass( 'foo', linkElement );
  49620. * writer.addClass( [ 'foo', 'bar' ], linkElement );
  49621. *
  49622. * @see module:engine/view/element~Element#_addClass
  49623. * @param {Array.<String>|String} className Single class name or array of class names which will be added.
  49624. * @param {module:engine/view/element~Element} element Element for which class will be added.
  49625. */
  49626. addClass( className, element ) {
  49627. element._addClass( className );
  49628. }
  49629. /**
  49630. * Removes specified class from the element.
  49631. *
  49632. * writer.removeClass( 'foo', linkElement );
  49633. * writer.removeClass( [ 'foo', 'bar' ], linkElement );
  49634. *
  49635. * @see module:engine/view/element~Element#_removeClass
  49636. * @param {Array.<String>|String} className Single class name or array of class names which will be removed.
  49637. * @param {module:engine/view/element~Element} element Element from which class will be removed.
  49638. */
  49639. removeClass( className, element ) {
  49640. element._removeClass( className );
  49641. }
  49642. /**
  49643. * Adds style to the element.
  49644. *
  49645. * writer.setStyle( 'color', 'red', element );
  49646. * writer.setStyle( {
  49647. * color: 'red',
  49648. * position: 'fixed'
  49649. * }, element );
  49650. *
  49651. * **Note**: This method can work with normalized style names if
  49652. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  49653. * See {@link module:engine/view/stylesmap~StylesMap#set `StylesMap#set()`} for details.
  49654. *
  49655. * @see module:engine/view/element~Element#_setStyle
  49656. * @param {String|Object} property Property name or object with key - value pairs.
  49657. * @param {String} [value] Value to set. This parameter is ignored if object is provided as the first parameter.
  49658. * @param {module:engine/view/element~Element} element Element for which style will be added.
  49659. */
  49660. setStyle( property, value, element ) {
  49661. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_3__["isPlainObject"])( property ) && element === undefined ) {
  49662. element = value;
  49663. }
  49664. element._setStyle( property, value );
  49665. }
  49666. /**
  49667. * Removes specified style from the element.
  49668. *
  49669. * writer.removeStyle( 'color', element ); // Removes 'color' style.
  49670. * writer.removeStyle( [ 'color', 'border-top' ], element ); // Removes both 'color' and 'border-top' styles.
  49671. *
  49672. * **Note**: This method can work with normalized style names if
  49673. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  49674. * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.
  49675. *
  49676. * @see module:engine/view/element~Element#_removeStyle
  49677. * @param {Array.<String>|String} property Style property name or names to be removed.
  49678. * @param {module:engine/view/element~Element} element Element from which style will be removed.
  49679. */
  49680. removeStyle( property, element ) {
  49681. element._removeStyle( property );
  49682. }
  49683. /**
  49684. * Sets a custom property on element. Unlike attributes, custom properties are not rendered to the DOM,
  49685. * so they can be used to add special data to elements.
  49686. *
  49687. * @see module:engine/view/element~Element#_setCustomProperty
  49688. * @param {String|Symbol} key Custom property name/key.
  49689. * @param {*} value Custom property value to be stored.
  49690. * @param {module:engine/view/element~Element} element Element for which custom property will be set.
  49691. */
  49692. setCustomProperty( key, value, element ) {
  49693. element._setCustomProperty( key, value );
  49694. }
  49695. /**
  49696. * Removes a custom property stored under the given key.
  49697. *
  49698. * @see module:engine/view/element~Element#_removeCustomProperty
  49699. * @param {String|Symbol} key Name/key of the custom property to be removed.
  49700. * @param {module:engine/view/element~Element} element Element from which the custom property will be removed.
  49701. * @returns {Boolean} Returns true if property was removed.
  49702. */
  49703. removeCustomProperty( key, element ) {
  49704. return element._removeCustomProperty( key );
  49705. }
  49706. /**
  49707. * Creates position at the given location. The location can be specified as:
  49708. *
  49709. * * a {@link module:engine/view/position~Position position},
  49710. * * parent element and offset (offset defaults to `0`),
  49711. * * parent element and `'end'` (sets position at the end of that element),
  49712. * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).
  49713. *
  49714. * This method is a shortcut to other constructors such as:
  49715. *
  49716. * * {@link #createPositionBefore},
  49717. * * {@link #createPositionAfter},
  49718. *
  49719. * @param {module:engine/view/item~Item|module:engine/model/position~Position} itemOrPosition
  49720. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  49721. * first parameter is a {@link module:engine/view/item~Item view item}.
  49722. * @returns {module:engine/view/position~Position}
  49723. */
  49724. createPositionAt( itemOrPosition, offset ) {
  49725. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAt( itemOrPosition, offset );
  49726. }
  49727. /**
  49728. * Creates a new position after given view item.
  49729. *
  49730. * @param {module:engine/view/item~Item} item View item after which the position should be located.
  49731. * @returns {module:engine/view/position~Position}
  49732. */
  49733. createPositionAfter( item ) {
  49734. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAfter( item );
  49735. }
  49736. /**
  49737. * Creates a new position before given view item.
  49738. *
  49739. * @param {module:engine/view/item~Item} item View item before which the position should be located.
  49740. * @returns {module:engine/view/position~Position}
  49741. */
  49742. createPositionBefore( item ) {
  49743. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createBefore( item );
  49744. }
  49745. /**
  49746. * Creates a range spanning from `start` position to `end` position.
  49747. *
  49748. * **Note:** This factory method creates it's own {@link module:engine/view/position~Position} instances basing on passed values.
  49749. *
  49750. * @param {module:engine/view/position~Position} start Start position.
  49751. * @param {module:engine/view/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
  49752. * @returns {module:engine/view/range~Range}
  49753. */
  49754. createRange( start, end ) {
  49755. return new _range__WEBPACK_IMPORTED_MODULE_5__["default"]( start, end );
  49756. }
  49757. /**
  49758. * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.
  49759. *
  49760. * @param {module:engine/view/item~Item} item
  49761. * @returns {module:engine/view/range~Range}
  49762. */
  49763. createRangeOn( item ) {
  49764. return _range__WEBPACK_IMPORTED_MODULE_5__["default"]._createOn( item );
  49765. }
  49766. /**
  49767. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  49768. * that element and ends after the last child of that element.
  49769. *
  49770. * @param {module:engine/view/element~Element} element Element which is a parent for the range.
  49771. * @returns {module:engine/view/range~Range}
  49772. */
  49773. createRangeIn( element ) {
  49774. return _range__WEBPACK_IMPORTED_MODULE_5__["default"]._createIn( element );
  49775. }
  49776. /**
  49777. * Creates a new {@link module:engine/view/selection~Selection} instance.
  49778. *
  49779. * // Creates empty selection without ranges.
  49780. * const selection = writer.createSelection();
  49781. *
  49782. * // Creates selection at the given range.
  49783. * const range = writer.createRange( start, end );
  49784. * const selection = writer.createSelection( range );
  49785. *
  49786. * // Creates selection at the given ranges
  49787. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  49788. * const selection = writer.createSelection( ranges );
  49789. *
  49790. * // Creates selection from the other selection.
  49791. * const otherSelection = writer.createSelection();
  49792. * const selection = writer.createSelection( otherSelection );
  49793. *
  49794. * // Creates selection from the document selection.
  49795. * const selection = writer.createSelection( editor.editing.view.document.selection );
  49796. *
  49797. * // Creates selection at the given position.
  49798. * const position = writer.createPositionFromPath( root, path );
  49799. * const selection = writer.createSelection( position );
  49800. *
  49801. * // Creates collapsed selection at the position of given item and offset.
  49802. * const paragraph = writer.createContainerElement( 'paragraph' );
  49803. * const selection = writer.createSelection( paragraph, offset );
  49804. *
  49805. * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
  49806. * // first child of that element and ends after the last child of that element.
  49807. * const selection = writer.createSelection( paragraph, 'in' );
  49808. *
  49809. * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
  49810. * // just after the item.
  49811. * const selection = writer.createSelection( paragraph, 'on' );
  49812. *
  49813. * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  49814. *
  49815. * // Creates backward selection.
  49816. * const selection = writer.createSelection( range, { backward: true } );
  49817. *
  49818. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  49819. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  49820. * represented in other way, for example by applying proper CSS class.
  49821. *
  49822. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  49823. * (and be properly handled by screen readers).
  49824. *
  49825. * // Creates fake selection with label.
  49826. * const selection = writer.createSelection( range, { fake: true, label: 'foo' } );
  49827. *
  49828. * @param {module:engine/view/selection~Selectable} [selectable=null]
  49829. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
  49830. * @param {Object} [options]
  49831. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  49832. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  49833. * @param {String} [options.label] Label for the fake selection.
  49834. * @returns {module:engine/view/selection~Selection}
  49835. */
  49836. createSelection( selectable, placeOrOffset, options ) {
  49837. return new _selection__WEBPACK_IMPORTED_MODULE_6__["default"]( selectable, placeOrOffset, options );
  49838. }
  49839. }
  49840. /***/ }),
  49841. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/view.js":
  49842. /*!******************************************************************!*\
  49843. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/view.js ***!
  49844. \******************************************************************/
  49845. /*! exports provided: default */
  49846. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49847. "use strict";
  49848. __webpack_require__.r(__webpack_exports__);
  49849. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return View; });
  49850. /* harmony import */ var _document__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./document */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js");
  49851. /* harmony import */ var _downcastwriter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./downcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js");
  49852. /* harmony import */ var _renderer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./renderer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/renderer.js");
  49853. /* harmony import */ var _domconverter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./domconverter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js");
  49854. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  49855. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  49856. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  49857. /* harmony import */ var _observer_mutationobserver__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./observer/mutationobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js");
  49858. /* harmony import */ var _observer_keyobserver__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./observer/keyobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/keyobserver.js");
  49859. /* harmony import */ var _observer_fakeselectionobserver__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./observer/fakeselectionobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.js");
  49860. /* harmony import */ var _observer_selectionobserver__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./observer/selectionobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/selectionobserver.js");
  49861. /* harmony import */ var _observer_focusobserver__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./observer/focusobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/focusobserver.js");
  49862. /* harmony import */ var _observer_compositionobserver__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./observer/compositionobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/compositionobserver.js");
  49863. /* harmony import */ var _observer_inputobserver__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./observer/inputobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/inputobserver.js");
  49864. /* harmony import */ var _observer_arrowkeysobserver__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./observer/arrowkeysobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/arrowkeysobserver.js");
  49865. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  49866. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  49867. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_scroll__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/scroll */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/scroll.js");
  49868. /* harmony import */ var _uielement__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./uielement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js");
  49869. /* harmony import */ var _filler__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./filler */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js");
  49870. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  49871. /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  49872. /**
  49873. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  49874. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49875. */
  49876. /**
  49877. * @module engine/view/view
  49878. */
  49879. /**
  49880. * Editor's view controller class. Its main responsibility is DOM - View management for editing purposes, to provide
  49881. * abstraction over the DOM structure and events and hide all browsers quirks.
  49882. *
  49883. * View controller renders view document to DOM whenever view structure changes. To determine when view can be rendered,
  49884. * all changes need to be done using the {@link module:engine/view/view~View#change} method, using
  49885. * {@link module:engine/view/downcastwriter~DowncastWriter}:
  49886. *
  49887. * view.change( writer => {
  49888. * writer.insert( position, writer.createText( 'foo' ) );
  49889. * } );
  49890. *
  49891. * View controller also register {@link module:engine/view/observer/observer~Observer observers} which observes changes
  49892. * on DOM and fire events on the {@link module:engine/view/document~Document Document}.
  49893. * Note that the following observers are added by the class constructor and are always available:
  49894. *
  49895. * * {@link module:engine/view/observer/mutationobserver~MutationObserver},
  49896. * * {@link module:engine/view/observer/selectionobserver~SelectionObserver},
  49897. * * {@link module:engine/view/observer/focusobserver~FocusObserver},
  49898. * * {@link module:engine/view/observer/keyobserver~KeyObserver},
  49899. * * {@link module:engine/view/observer/fakeselectionobserver~FakeSelectionObserver}.
  49900. * * {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
  49901. *
  49902. * This class also {@link module:engine/view/view~View#attachDomRoot binds the DOM and the view elements}.
  49903. *
  49904. * If you do not need full a DOM - view management, and only want to transform a tree of view elements to a tree of DOM
  49905. * elements you do not need this controller. You can use the {@link module:engine/view/domconverter~DomConverter DomConverter} instead.
  49906. *
  49907. * @mixes module:utils/observablemixin~ObservableMixin
  49908. */
  49909. class View {
  49910. /**
  49911. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor The styles processor instance.
  49912. */
  49913. constructor( stylesProcessor ) {
  49914. /**
  49915. * Instance of the {@link module:engine/view/document~Document} associated with this view controller.
  49916. *
  49917. * @readonly
  49918. * @type {module:engine/view/document~Document}
  49919. */
  49920. this.document = new _document__WEBPACK_IMPORTED_MODULE_0__["default"]( stylesProcessor );
  49921. /**
  49922. * Instance of the {@link module:engine/view/domconverter~DomConverter domConverter} used by
  49923. * {@link module:engine/view/view~View#_renderer renderer}
  49924. * and {@link module:engine/view/observer/observer~Observer observers}.
  49925. *
  49926. * @readonly
  49927. * @type {module:engine/view/domconverter~DomConverter}
  49928. */
  49929. this.domConverter = new _domconverter__WEBPACK_IMPORTED_MODULE_3__["default"]( this.document );
  49930. /**
  49931. * Roots of the DOM tree. Map on the `HTMLElement`s with roots names as keys.
  49932. *
  49933. * @readonly
  49934. * @type {Map.<String, HTMLElement>}
  49935. */
  49936. this.domRoots = new Map();
  49937. /**
  49938. * Used to prevent calling {@link #forceRender} and {@link #change} during rendering view to the DOM.
  49939. *
  49940. * @readonly
  49941. * @member {Boolean} #isRenderingInProgress
  49942. */
  49943. this.set( 'isRenderingInProgress', false );
  49944. /**
  49945. * Informs whether the DOM selection is inside any of the DOM roots managed by the view.
  49946. *
  49947. * @readonly
  49948. * @member {Boolean} #hasDomSelection
  49949. */
  49950. this.set( 'hasDomSelection', false );
  49951. /**
  49952. * Instance of the {@link module:engine/view/renderer~Renderer renderer}.
  49953. *
  49954. * @protected
  49955. * @type {module:engine/view/renderer~Renderer}
  49956. */
  49957. this._renderer = new _renderer__WEBPACK_IMPORTED_MODULE_2__["default"]( this.domConverter, this.document.selection );
  49958. this._renderer.bind( 'isFocused', 'isSelecting' ).to( this.document );
  49959. /**
  49960. * A DOM root attributes cache. It saves the initial values of DOM root attributes before the DOM element
  49961. * is {@link module:engine/view/view~View#attachDomRoot attached} to the view so later on, when
  49962. * the view is destroyed ({@link module:engine/view/view~View#detachDomRoot}), they can be easily restored.
  49963. * This way, the DOM element can go back to the (clean) state as if the editing view never used it.
  49964. *
  49965. * @private
  49966. * @member {WeakMap.<HTMLElement,Object>}
  49967. */
  49968. this._initialDomRootAttributes = new WeakMap();
  49969. /**
  49970. * Map of registered {@link module:engine/view/observer/observer~Observer observers}.
  49971. *
  49972. * @private
  49973. * @type {Map.<Function, module:engine/view/observer/observer~Observer>}
  49974. */
  49975. this._observers = new Map();
  49976. /**
  49977. * Is set to `true` when {@link #change view changes} are currently in progress.
  49978. *
  49979. * @private
  49980. * @type {Boolean}
  49981. */
  49982. this._ongoingChange = false;
  49983. /**
  49984. * Used to prevent calling {@link #forceRender} and {@link #change} during rendering view to the DOM.
  49985. *
  49986. * @private
  49987. * @type {Boolean}
  49988. */
  49989. this._postFixersInProgress = false;
  49990. /**
  49991. * Internal flag to temporary disable rendering. See the usage in the {@link #_disableRendering}.
  49992. *
  49993. * @private
  49994. * @type {Boolean}
  49995. */
  49996. this._renderingDisabled = false;
  49997. /**
  49998. * Internal flag that disables rendering when there are no changes since the last rendering.
  49999. * It stores information about changed selection and changed elements from attached document roots.
  50000. *
  50001. * @private
  50002. * @type {Boolean}
  50003. */
  50004. this._hasChangedSinceTheLastRendering = false;
  50005. /**
  50006. * DowncastWriter instance used in {@link #change change method} callbacks.
  50007. *
  50008. * @private
  50009. * @type {module:engine/view/downcastwriter~DowncastWriter}
  50010. */
  50011. this._writer = new _downcastwriter__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document );
  50012. // Add default observers.
  50013. this.addObserver( _observer_mutationobserver__WEBPACK_IMPORTED_MODULE_7__["default"] );
  50014. this.addObserver( _observer_selectionobserver__WEBPACK_IMPORTED_MODULE_10__["default"] );
  50015. this.addObserver( _observer_focusobserver__WEBPACK_IMPORTED_MODULE_11__["default"] );
  50016. this.addObserver( _observer_keyobserver__WEBPACK_IMPORTED_MODULE_8__["default"] );
  50017. this.addObserver( _observer_fakeselectionobserver__WEBPACK_IMPORTED_MODULE_9__["default"] );
  50018. this.addObserver( _observer_compositionobserver__WEBPACK_IMPORTED_MODULE_12__["default"] );
  50019. this.addObserver( _observer_arrowkeysobserver__WEBPACK_IMPORTED_MODULE_14__["default"] );
  50020. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_21__["default"].isAndroid ) {
  50021. this.addObserver( _observer_inputobserver__WEBPACK_IMPORTED_MODULE_13__["default"] );
  50022. }
  50023. // Inject quirks handlers.
  50024. Object(_filler__WEBPACK_IMPORTED_MODULE_19__["injectQuirksHandling"])( this );
  50025. Object(_uielement__WEBPACK_IMPORTED_MODULE_18__["injectUiElementHandling"])( this );
  50026. // Use 'normal' priority so that rendering is performed as first when using that priority.
  50027. this.on( 'render', () => {
  50028. this._render();
  50029. // Informs that layout has changed after render.
  50030. this.document.fire( 'layoutChanged' );
  50031. // Reset the `_hasChangedSinceTheLastRendering` flag after rendering.
  50032. this._hasChangedSinceTheLastRendering = false;
  50033. } );
  50034. // Listen to the document selection changes directly.
  50035. this.listenTo( this.document.selection, 'change', () => {
  50036. this._hasChangedSinceTheLastRendering = true;
  50037. } );
  50038. // Trigger re-render if only the focus changed.
  50039. this.listenTo( this.document, 'change:isFocused', () => {
  50040. this._hasChangedSinceTheLastRendering = true;
  50041. } );
  50042. }
  50043. /**
  50044. * Attaches a DOM root element to the view element and enable all observers on that element.
  50045. * Also {@link module:engine/view/renderer~Renderer#markToSync mark element} to be synchronized
  50046. * with the view what means that all child nodes will be removed and replaced with content of the view root.
  50047. *
  50048. * This method also will change view element name as the same as tag name of given dom root.
  50049. * Name is always transformed to lower case.
  50050. *
  50051. * **Note:** Use {@link #detachDomRoot `detachDomRoot()`} to revert this action.
  50052. *
  50053. * @param {Element} domRoot DOM root element.
  50054. * @param {String} [name='main'] Name of the root.
  50055. */
  50056. attachDomRoot( domRoot, name = 'main' ) {
  50057. const viewRoot = this.document.getRoot( name );
  50058. // Set view root name the same as DOM root tag name.
  50059. viewRoot._name = domRoot.tagName.toLowerCase();
  50060. const initialDomRootAttributes = {};
  50061. // 1. Copy and cache the attributes to remember the state of the element before attaching.
  50062. // The cached attributes will be restored in detachDomRoot() so the element goes to the
  50063. // clean state as if the editing view never used it.
  50064. // 2. Apply the attributes using the view writer, so they all go under the control of the engine.
  50065. // The editing view takes over the attribute management completely because various
  50066. // features (e.g. addPlaceholder()) require dynamic changes of those attributes and they
  50067. // cannot be managed by the engine and the UI library at the same time.
  50068. for ( const { name, value } of Array.from( domRoot.attributes ) ) {
  50069. initialDomRootAttributes[ name ] = value;
  50070. // Do not use writer.setAttribute() for the class attribute. The EditableUIView class
  50071. // and its descendants could have already set some using the writer.addClass() on the view
  50072. // document root. They haven't been rendered yet so they are not present in the DOM root.
  50073. // Using writer.setAttribute( 'class', ... ) would override them completely.
  50074. if ( name === 'class' ) {
  50075. this._writer.addClass( value.split( ' ' ), viewRoot );
  50076. } else {
  50077. this._writer.setAttribute( name, value, viewRoot );
  50078. }
  50079. }
  50080. this._initialDomRootAttributes.set( domRoot, initialDomRootAttributes );
  50081. const updateContenteditableAttribute = () => {
  50082. this._writer.setAttribute( 'contenteditable', !viewRoot.isReadOnly, viewRoot );
  50083. if ( viewRoot.isReadOnly ) {
  50084. this._writer.addClass( 'ck-read-only', viewRoot );
  50085. } else {
  50086. this._writer.removeClass( 'ck-read-only', viewRoot );
  50087. }
  50088. };
  50089. // Set initial value.
  50090. updateContenteditableAttribute();
  50091. this.domRoots.set( name, domRoot );
  50092. this.domConverter.bindElements( domRoot, viewRoot );
  50093. this._renderer.markToSync( 'children', viewRoot );
  50094. this._renderer.markToSync( 'attributes', viewRoot );
  50095. this._renderer.domDocuments.add( domRoot.ownerDocument );
  50096. viewRoot.on( 'change:children', ( evt, node ) => this._renderer.markToSync( 'children', node ) );
  50097. viewRoot.on( 'change:attributes', ( evt, node ) => this._renderer.markToSync( 'attributes', node ) );
  50098. viewRoot.on( 'change:text', ( evt, node ) => this._renderer.markToSync( 'text', node ) );
  50099. viewRoot.on( 'change:isReadOnly', () => this.change( updateContenteditableAttribute ) );
  50100. viewRoot.on( 'change', () => {
  50101. this._hasChangedSinceTheLastRendering = true;
  50102. } );
  50103. for ( const observer of this._observers.values() ) {
  50104. observer.observe( domRoot, name );
  50105. }
  50106. }
  50107. /**
  50108. * Detaches a DOM root element from the view element and restores its attributes to the state before
  50109. * {@link #attachDomRoot `attachDomRoot()`}.
  50110. *
  50111. * @param {String} name Name of the root to detach.
  50112. */
  50113. detachDomRoot( name ) {
  50114. const domRoot = this.domRoots.get( name );
  50115. // Remove all root attributes so the DOM element is "bare".
  50116. Array.from( domRoot.attributes ).forEach( ( { name } ) => domRoot.removeAttribute( name ) );
  50117. const initialDomRootAttributes = this._initialDomRootAttributes.get( domRoot );
  50118. // Revert all view root attributes back to the state before attachDomRoot was called.
  50119. for ( const attribute in initialDomRootAttributes ) {
  50120. domRoot.setAttribute( attribute, initialDomRootAttributes[ attribute ] );
  50121. }
  50122. this.domRoots.delete( name );
  50123. this.domConverter.unbindDomElement( domRoot );
  50124. }
  50125. /**
  50126. * Gets DOM root element.
  50127. *
  50128. * @param {String} [name='main'] Name of the root.
  50129. * @returns {Element} DOM root element instance.
  50130. */
  50131. getDomRoot( name = 'main' ) {
  50132. return this.domRoots.get( name );
  50133. }
  50134. /**
  50135. * Creates observer of the given type if not yet created, {@link module:engine/view/observer/observer~Observer#enable enables} it
  50136. * and {@link module:engine/view/observer/observer~Observer#observe attaches} to all existing and future
  50137. * {@link #domRoots DOM roots}.
  50138. *
  50139. * Note: Observers are recognized by their constructor (classes). A single observer will be instantiated and used only
  50140. * when registered for the first time. This means that features and other components can register a single observer
  50141. * multiple times without caring whether it has been already added or not.
  50142. *
  50143. * @param {Function} Observer The constructor of an observer to add.
  50144. * Should create an instance inheriting from {@link module:engine/view/observer/observer~Observer}.
  50145. * @returns {module:engine/view/observer/observer~Observer} Added observer instance.
  50146. */
  50147. addObserver( Observer ) {
  50148. let observer = this._observers.get( Observer );
  50149. if ( observer ) {
  50150. return observer;
  50151. }
  50152. observer = new Observer( this );
  50153. this._observers.set( Observer, observer );
  50154. for ( const [ name, domElement ] of this.domRoots ) {
  50155. observer.observe( domElement, name );
  50156. }
  50157. observer.enable();
  50158. return observer;
  50159. }
  50160. /**
  50161. * Returns observer of the given type or `undefined` if such observer has not been added yet.
  50162. *
  50163. * @param {Function} Observer The constructor of an observer to get.
  50164. * @returns {module:engine/view/observer/observer~Observer|undefined} Observer instance or undefined.
  50165. */
  50166. getObserver( Observer ) {
  50167. return this._observers.get( Observer );
  50168. }
  50169. /**
  50170. * Disables all added observers.
  50171. */
  50172. disableObservers() {
  50173. for ( const observer of this._observers.values() ) {
  50174. observer.disable();
  50175. }
  50176. }
  50177. /**
  50178. * Enables all added observers.
  50179. */
  50180. enableObservers() {
  50181. for ( const observer of this._observers.values() ) {
  50182. observer.enable();
  50183. }
  50184. }
  50185. /**
  50186. * Scrolls the page viewport and {@link #domRoots} with their ancestors to reveal the
  50187. * caret, if not already visible to the user.
  50188. */
  50189. scrollToTheSelection() {
  50190. const range = this.document.selection.getFirstRange();
  50191. if ( range ) {
  50192. Object(_ckeditor_ckeditor5_utils_src_dom_scroll__WEBPACK_IMPORTED_MODULE_17__["scrollViewportToShowTarget"])( {
  50193. target: this.domConverter.viewRangeToDom( range ),
  50194. viewportOffset: 20
  50195. } );
  50196. }
  50197. }
  50198. /**
  50199. * It will focus DOM element representing {@link module:engine/view/editableelement~EditableElement EditableElement}
  50200. * that is currently having selection inside.
  50201. */
  50202. focus() {
  50203. if ( !this.document.isFocused ) {
  50204. const editable = this.document.selection.editableElement;
  50205. if ( editable ) {
  50206. this.domConverter.focus( editable );
  50207. this.forceRender();
  50208. } else {
  50209. // Before focusing view document, selection should be placed inside one of the view's editables.
  50210. // Normally its selection will be converted from model document (which have default selection), but
  50211. // when using view document on its own, we need to manually place selection before focusing it.
  50212. //
  50213. // @if CK_DEBUG // console.warn( 'There is no selection in any editable to focus.' );
  50214. }
  50215. }
  50216. }
  50217. /**
  50218. * The `change()` method is the primary way of changing the view. You should use it to modify any node in the view tree.
  50219. * It makes sure that after all changes are made the view is rendered to the DOM (assuming that the view will be changed
  50220. * inside the callback). It prevents situations when the DOM is updated when the view state is not yet correct. It allows
  50221. * to nest calls one inside another and still performs a single rendering after all those changes are made.
  50222. * It also returns the return value of its callback.
  50223. *
  50224. * const text = view.change( writer => {
  50225. * const newText = writer.createText( 'foo' );
  50226. * writer.insert( position1, newText );
  50227. *
  50228. * view.change( writer => {
  50229. * writer.insert( position2, writer.createText( 'bar' ) );
  50230. * } );
  50231. *
  50232. * writer.remove( range );
  50233. *
  50234. * return newText;
  50235. * } );
  50236. *
  50237. * When the outermost change block is done and rendering to the DOM is over the
  50238. * {@link module:engine/view/view~View#event:render `View#render`} event is fired.
  50239. *
  50240. * This method throws a `applying-view-changes-on-rendering` error when
  50241. * the change block is used after rendering to the DOM has started.
  50242. *
  50243. * @param {Function} callback Callback function which may modify the view.
  50244. * @returns {*} Value returned by the callback.
  50245. */
  50246. change( callback ) {
  50247. if ( this.isRenderingInProgress || this._postFixersInProgress ) {
  50248. /**
  50249. * Thrown when there is an attempt to make changes to the view tree when it is in incorrect state. This may
  50250. * cause some unexpected behaviour and inconsistency between the DOM and the view.
  50251. * This may be caused by:
  50252. *
  50253. * * calling {@link #change} or {@link #forceRender} during rendering process,
  50254. * * calling {@link #change} or {@link #forceRender} inside of
  50255. * {@link module:engine/view/document~Document#registerPostFixer post-fixer function}.
  50256. *
  50257. * @error cannot-change-view-tree
  50258. */
  50259. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_20__["default"](
  50260. 'cannot-change-view-tree',
  50261. this
  50262. );
  50263. }
  50264. try {
  50265. // Recursive call to view.change() method - execute listener immediately.
  50266. if ( this._ongoingChange ) {
  50267. return callback( this._writer );
  50268. }
  50269. // This lock will assure that all recursive calls to view.change() will end up in same block - one "render"
  50270. // event for all nested calls.
  50271. this._ongoingChange = true;
  50272. const callbackResult = callback( this._writer );
  50273. this._ongoingChange = false;
  50274. // This lock is used by editing controller to render changes from outer most model.change() once. As plugins might call
  50275. // view.change() inside model.change() block - this will ensures that postfixers and rendering are called once after all
  50276. // changes. Also, we don't need to render anything if there're no changes since last rendering.
  50277. if ( !this._renderingDisabled && this._hasChangedSinceTheLastRendering ) {
  50278. this._postFixersInProgress = true;
  50279. this.document._callPostFixers( this._writer );
  50280. this._postFixersInProgress = false;
  50281. this.fire( 'render' );
  50282. }
  50283. return callbackResult;
  50284. } catch ( err ) {
  50285. // @if CK_DEBUG // throw err;
  50286. /* istanbul ignore next */
  50287. _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_20__["default"].rethrowUnexpectedError( err, this );
  50288. }
  50289. }
  50290. /**
  50291. * Forces rendering {@link module:engine/view/document~Document view document} to DOM. If any view changes are
  50292. * currently in progress, rendering will start after all {@link #change change blocks} are processed.
  50293. *
  50294. * Note that this method is dedicated for special cases. All view changes should be wrapped in the {@link #change}
  50295. * block and the view will automatically check whether it needs to render DOM or not.
  50296. *
  50297. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `applying-view-changes-on-rendering` when
  50298. * trying to re-render when rendering to DOM has already started.
  50299. */
  50300. forceRender() {
  50301. this._hasChangedSinceTheLastRendering = true;
  50302. this.change( () => {} );
  50303. }
  50304. /**
  50305. * Destroys this instance. Makes sure that all observers are destroyed and listeners removed.
  50306. */
  50307. destroy() {
  50308. for ( const observer of this._observers.values() ) {
  50309. observer.destroy();
  50310. }
  50311. this.document.destroy();
  50312. this.stopListening();
  50313. }
  50314. /**
  50315. * Creates position at the given location. The location can be specified as:
  50316. *
  50317. * * a {@link module:engine/view/position~Position position},
  50318. * * parent element and offset (offset defaults to `0`),
  50319. * * parent element and `'end'` (sets position at the end of that element),
  50320. * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).
  50321. *
  50322. * This method is a shortcut to other constructors such as:
  50323. *
  50324. * * {@link #createPositionBefore},
  50325. * * {@link #createPositionAfter},
  50326. *
  50327. * @param {module:engine/view/item~Item|module:engine/model/position~Position} itemOrPosition
  50328. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  50329. * first parameter is a {@link module:engine/view/item~Item view item}.
  50330. */
  50331. createPositionAt( itemOrPosition, offset ) {
  50332. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAt( itemOrPosition, offset );
  50333. }
  50334. /**
  50335. * Creates a new position after given view item.
  50336. *
  50337. * @param {module:engine/view/item~Item} item View item after which the position should be located.
  50338. * @returns {module:engine/view/position~Position}
  50339. */
  50340. createPositionAfter( item ) {
  50341. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAfter( item );
  50342. }
  50343. /**
  50344. * Creates a new position before given view item.
  50345. *
  50346. * @param {module:engine/view/item~Item} item View item before which the position should be located.
  50347. * @returns {module:engine/view/position~Position}
  50348. */
  50349. createPositionBefore( item ) {
  50350. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createBefore( item );
  50351. }
  50352. /**
  50353. * Creates a range spanning from `start` position to `end` position.
  50354. *
  50355. * **Note:** This factory method creates it's own {@link module:engine/view/position~Position} instances basing on passed values.
  50356. *
  50357. * @param {module:engine/view/position~Position} start Start position.
  50358. * @param {module:engine/view/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
  50359. * @returns {module:engine/view/range~Range}
  50360. */
  50361. createRange( start, end ) {
  50362. return new _range__WEBPACK_IMPORTED_MODULE_5__["default"]( start, end );
  50363. }
  50364. /**
  50365. * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.
  50366. *
  50367. * @param {module:engine/view/item~Item} item
  50368. * @returns {module:engine/view/range~Range}
  50369. */
  50370. createRangeOn( item ) {
  50371. return _range__WEBPACK_IMPORTED_MODULE_5__["default"]._createOn( item );
  50372. }
  50373. /**
  50374. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  50375. * that element and ends after the last child of that element.
  50376. *
  50377. * @param {module:engine/view/element~Element} element Element which is a parent for the range.
  50378. * @returns {module:engine/view/range~Range}
  50379. */
  50380. createRangeIn( element ) {
  50381. return _range__WEBPACK_IMPORTED_MODULE_5__["default"]._createIn( element );
  50382. }
  50383. /**
  50384. Creates new {@link module:engine/view/selection~Selection} instance.
  50385. *
  50386. * // Creates empty selection without ranges.
  50387. * const selection = view.createSelection();
  50388. *
  50389. * // Creates selection at the given range.
  50390. * const range = view.createRange( start, end );
  50391. * const selection = view.createSelection( range );
  50392. *
  50393. * // Creates selection at the given ranges
  50394. * const ranges = [ view.createRange( start1, end2 ), view.createRange( star2, end2 ) ];
  50395. * const selection = view.createSelection( ranges );
  50396. *
  50397. * // Creates selection from the other selection.
  50398. * const otherSelection = view.createSelection();
  50399. * const selection = view.createSelection( otherSelection );
  50400. *
  50401. * // Creates selection from the document selection.
  50402. * const selection = view.createSelection( editor.editing.view.document.selection );
  50403. *
  50404. * // Creates selection at the given position.
  50405. * const position = view.createPositionFromPath( root, path );
  50406. * const selection = view.createSelection( position );
  50407. *
  50408. * // Creates collapsed selection at the position of given item and offset.
  50409. * const paragraph = view.createContainerElement( 'paragraph' );
  50410. * const selection = view.createSelection( paragraph, offset );
  50411. *
  50412. * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
  50413. * // first child of that element and ends after the last child of that element.
  50414. * const selection = view.createSelection( paragraph, 'in' );
  50415. *
  50416. * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
  50417. * // just after the item.
  50418. * const selection = view.createSelection( paragraph, 'on' );
  50419. *
  50420. * `Selection`'s factory method allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  50421. *
  50422. * // Creates backward selection.
  50423. * const selection = view.createSelection( range, { backward: true } );
  50424. *
  50425. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  50426. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  50427. * represented in other way, for example by applying proper CSS class.
  50428. *
  50429. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  50430. * (and be properly handled by screen readers).
  50431. *
  50432. * // Creates fake selection with label.
  50433. * const selection = view.createSelection( range, { fake: true, label: 'foo' } );
  50434. *
  50435. * @param {module:engine/view/selection~Selectable} [selectable=null]
  50436. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
  50437. * @param {Object} [options]
  50438. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  50439. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  50440. * @param {String} [options.label] Label for the fake selection.
  50441. * @returns {module:engine/view/selection~Selection}
  50442. */
  50443. createSelection( selectable, placeOrOffset, options ) {
  50444. return new _selection__WEBPACK_IMPORTED_MODULE_6__["default"]( selectable, placeOrOffset, options );
  50445. }
  50446. /**
  50447. * Disables or enables rendering. If the flag is set to `true` then the rendering will be disabled.
  50448. * If the flag is set to `false` and if there was some change in the meantime, then the rendering action will be performed.
  50449. *
  50450. * @protected
  50451. * @param {Boolean} flag A flag indicates whether the rendering should be disabled.
  50452. */
  50453. _disableRendering( flag ) {
  50454. this._renderingDisabled = flag;
  50455. if ( flag == false ) {
  50456. // Render when you stop blocking rendering.
  50457. this.change( () => {} );
  50458. }
  50459. }
  50460. /**
  50461. * Renders all changes. In order to avoid triggering the observers (e.g. mutations) all observers are disabled
  50462. * before rendering and re-enabled after that.
  50463. *
  50464. * @private
  50465. */
  50466. _render() {
  50467. this.isRenderingInProgress = true;
  50468. this.disableObservers();
  50469. this._renderer.render();
  50470. this.enableObservers();
  50471. this.isRenderingInProgress = false;
  50472. }
  50473. /**
  50474. * Fired after a topmost {@link module:engine/view/view~View#change change block} and all
  50475. * {@link module:engine/view/document~Document#registerPostFixer post-fixers} are executed.
  50476. *
  50477. * Actual rendering is performed as a first listener on 'normal' priority.
  50478. *
  50479. * view.on( 'render', () => {
  50480. * // Rendering to the DOM is complete.
  50481. * } );
  50482. *
  50483. * This event is useful when you want to update interface elements after the rendering, e.g. position of the
  50484. * balloon panel. If you wants to change view structure use
  50485. * {@link module:engine/view/document~Document#registerPostFixer post-fixers}.
  50486. *
  50487. * @event module:engine/view/view~View#event:render
  50488. */
  50489. }
  50490. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_16__["default"])( View, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_15__["default"] );
  50491. /***/ }),
  50492. /***/ "./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css":
  50493. /*!***********************************************************************!*\
  50494. !*** ./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css ***!
  50495. \***********************************************************************/
  50496. /*! exports provided: default */
  50497. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50498. "use strict";
  50499. __webpack_require__.r(__webpack_exports__);
  50500. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  50501. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  50502. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_placeholder_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./placeholder.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css");
  50503. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  50504. options.insert = "head";
  50505. options.singleton = true;
  50506. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_placeholder_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  50507. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_placeholder_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  50508. /***/ }),
  50509. /***/ "./node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css":
  50510. /*!********************************************************************!*\
  50511. !*** ./node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css ***!
  50512. \********************************************************************/
  50513. /*! exports provided: default */
  50514. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50515. "use strict";
  50516. __webpack_require__.r(__webpack_exports__);
  50517. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  50518. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  50519. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_renderer_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./renderer.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css");
  50520. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  50521. options.insert = "head";
  50522. options.singleton = true;
  50523. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_renderer_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  50524. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_renderer_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  50525. /***/ }),
  50526. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/enter.js":
  50527. /*!*************************************************************!*\
  50528. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/enter.js ***!
  50529. \*************************************************************/
  50530. /*! exports provided: default */
  50531. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50532. "use strict";
  50533. __webpack_require__.r(__webpack_exports__);
  50534. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Enter; });
  50535. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  50536. /* harmony import */ var _entercommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./entercommand */ "./node_modules/@ckeditor/ckeditor5-enter/src/entercommand.js");
  50537. /* harmony import */ var _enterobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./enterobserver */ "./node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js");
  50538. /**
  50539. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  50540. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50541. */
  50542. /**
  50543. * @module enter/enter
  50544. */
  50545. /**
  50546. * This plugin handles the <kbd>Enter</kbd> key (hard line break) in the editor.
  50547. *
  50548. * See also the {@link module:enter/shiftenter~ShiftEnter} plugin.
  50549. *
  50550. * For more information about this feature see the {@glink api/enter package page}.
  50551. *
  50552. * @extends module:core/plugin~Plugin
  50553. */
  50554. class Enter extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  50555. /**
  50556. * @inheritDoc
  50557. */
  50558. static get pluginName() {
  50559. return 'Enter';
  50560. }
  50561. init() {
  50562. const editor = this.editor;
  50563. const view = editor.editing.view;
  50564. const viewDocument = view.document;
  50565. view.addObserver( _enterobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
  50566. editor.commands.add( 'enter', new _entercommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  50567. this.listenTo( viewDocument, 'enter', ( evt, data ) => {
  50568. data.preventDefault();
  50569. // The soft enter key is handled by the ShiftEnter plugin.
  50570. if ( data.isSoft ) {
  50571. return;
  50572. }
  50573. editor.execute( 'enter' );
  50574. view.scrollToTheSelection();
  50575. }, { priority: 'low' } );
  50576. }
  50577. }
  50578. /***/ }),
  50579. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/entercommand.js":
  50580. /*!********************************************************************!*\
  50581. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/entercommand.js ***!
  50582. \********************************************************************/
  50583. /*! exports provided: default */
  50584. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50585. "use strict";
  50586. __webpack_require__.r(__webpack_exports__);
  50587. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EnterCommand; });
  50588. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  50589. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-enter/src/utils.js");
  50590. /**
  50591. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  50592. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50593. */
  50594. /**
  50595. * @module enter/entercommand
  50596. */
  50597. /**
  50598. * Enter command. It is used by the {@link module:enter/enter~Enter Enter feature} to handle the <kbd>Enter</kbd> key.
  50599. *
  50600. * @extends module:core/command~Command
  50601. */
  50602. class EnterCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  50603. /**
  50604. * @inheritDoc
  50605. */
  50606. execute() {
  50607. const model = this.editor.model;
  50608. const doc = model.document;
  50609. model.change( writer => {
  50610. enterBlock( this.editor.model, writer, doc.selection, model.schema );
  50611. this.fire( 'afterExecute', { writer } );
  50612. } );
  50613. }
  50614. }
  50615. // Creates a new block in the way that the <kbd>Enter</kbd> key is expected to work.
  50616. //
  50617. // @param {module:engine/model~Model} model
  50618. // @param {module:engine/model/writer~Writer} writer
  50619. // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  50620. // Selection on which the action should be performed.
  50621. // @param {module:engine/model/schema~Schema} schema
  50622. function enterBlock( model, writer, selection, schema ) {
  50623. const isSelectionEmpty = selection.isCollapsed;
  50624. const range = selection.getFirstRange();
  50625. const startElement = range.start.parent;
  50626. const endElement = range.end.parent;
  50627. // Don't touch the roots and other limit elements.
  50628. if ( schema.isLimit( startElement ) || schema.isLimit( endElement ) ) {
  50629. // Delete the selected content but only if inside a single limit element.
  50630. // Abort, when crossing limit elements boundary (e.g. <limit1>x[x</limit1>donttouchme<limit2>y]y</limit2>).
  50631. // This is an edge case and it's hard to tell what should actually happen because such a selection
  50632. // is not entirely valid.
  50633. if ( !isSelectionEmpty && startElement == endElement ) {
  50634. model.deleteContent( selection );
  50635. }
  50636. return;
  50637. }
  50638. if ( isSelectionEmpty ) {
  50639. const attributesToCopy = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getCopyOnEnterAttributes"])( writer.model.schema, selection.getAttributes() );
  50640. splitBlock( writer, range.start );
  50641. writer.setSelectionAttribute( attributesToCopy );
  50642. } else {
  50643. const leaveUnmerged = !( range.start.isAtStart && range.end.isAtEnd );
  50644. const isContainedWithinOneElement = ( startElement == endElement );
  50645. model.deleteContent( selection, { leaveUnmerged } );
  50646. if ( leaveUnmerged ) {
  50647. // Partially selected elements.
  50648. //
  50649. // <h>x[xx]x</h> -> <h>x^x</h> -> <h>x</h><h>^x</h>
  50650. if ( isContainedWithinOneElement ) {
  50651. splitBlock( writer, selection.focus );
  50652. }
  50653. // Selection over multiple elements.
  50654. //
  50655. // <h>x[x</h><p>y]y<p> -> <h>x^</h><p>y</p> -> <h>x</h><p>^y</p>
  50656. else {
  50657. writer.setSelection( endElement, 0 );
  50658. }
  50659. }
  50660. }
  50661. }
  50662. function splitBlock( writer, splitPos ) {
  50663. writer.split( splitPos );
  50664. writer.setSelection( splitPos.parent.nextSibling, 0 );
  50665. }
  50666. /***/ }),
  50667. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js":
  50668. /*!*********************************************************************!*\
  50669. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js ***!
  50670. \*********************************************************************/
  50671. /*! exports provided: default */
  50672. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50673. "use strict";
  50674. __webpack_require__.r(__webpack_exports__);
  50675. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EnterObserver; });
  50676. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  50677. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/domeventdata */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js");
  50678. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_bubblingeventinfo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js");
  50679. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  50680. /**
  50681. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  50682. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50683. */
  50684. /**
  50685. * @module enter/enterobserver
  50686. */
  50687. /**
  50688. * Enter observer introduces the {@link module:engine/view/document~Document#event:enter} event.
  50689. *
  50690. * @extends module:engine/view/observer/observer~Observer
  50691. */
  50692. class EnterObserver extends _ckeditor_ckeditor5_engine_src_view_observer_observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  50693. /**
  50694. * @inheritDoc
  50695. */
  50696. constructor( view ) {
  50697. super( view );
  50698. const doc = this.document;
  50699. doc.on( 'keydown', ( evt, data ) => {
  50700. if ( this.isEnabled && data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].enter ) {
  50701. const event = new _ckeditor_ckeditor5_engine_src_view_observer_bubblingeventinfo__WEBPACK_IMPORTED_MODULE_2__["default"]( doc, 'enter', doc.selection.getFirstRange() );
  50702. doc.fire( event, new _ckeditor_ckeditor5_engine_src_view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_1__["default"]( doc, data.domEvent, {
  50703. isSoft: data.shiftKey
  50704. } ) );
  50705. // Stop `keydown` event if `enter` event was stopped.
  50706. // https://github.com/ckeditor/ckeditor5/issues/753
  50707. if ( event.stop.called ) {
  50708. evt.stop();
  50709. }
  50710. }
  50711. } );
  50712. }
  50713. /**
  50714. * @inheritDoc
  50715. */
  50716. observe() {}
  50717. }
  50718. /**
  50719. * Event fired when the user presses the <kbd>Enter</kbd> key.
  50720. *
  50721. * Note: This event is fired by the {@link module:enter/enterobserver~EnterObserver observer}
  50722. * (usually registered by the {@link module:enter/enter~Enter Enter feature} and
  50723. * {@link module:enter/shiftenter~ShiftEnter ShiftEnter feature}).
  50724. *
  50725. * @event module:engine/view/document~Document#event:enter
  50726. * @param {module:engine/view/observer/domeventdata~DomEventData} data
  50727. * @param {Boolean} data.isSoft Whether it's a soft enter (<kbd>Shift</kbd>+<kbd>Enter</kbd>) or hard enter (<kbd>Enter</kbd>).
  50728. */
  50729. /***/ }),
  50730. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/index.js":
  50731. /*!*************************************************************!*\
  50732. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/index.js ***!
  50733. \*************************************************************/
  50734. /*! exports provided: Enter, ShiftEnter */
  50735. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50736. "use strict";
  50737. __webpack_require__.r(__webpack_exports__);
  50738. /* harmony import */ var _enter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./enter */ "./node_modules/@ckeditor/ckeditor5-enter/src/enter.js");
  50739. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Enter", function() { return _enter__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  50740. /* harmony import */ var _shiftenter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shiftenter */ "./node_modules/@ckeditor/ckeditor5-enter/src/shiftenter.js");
  50741. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShiftEnter", function() { return _shiftenter__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  50742. /**
  50743. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  50744. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50745. */
  50746. /**
  50747. * @module enter
  50748. */
  50749. /***/ }),
  50750. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/shiftenter.js":
  50751. /*!******************************************************************!*\
  50752. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/shiftenter.js ***!
  50753. \******************************************************************/
  50754. /*! exports provided: default */
  50755. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50756. "use strict";
  50757. __webpack_require__.r(__webpack_exports__);
  50758. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ShiftEnter; });
  50759. /* harmony import */ var _shiftentercommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shiftentercommand */ "./node_modules/@ckeditor/ckeditor5-enter/src/shiftentercommand.js");
  50760. /* harmony import */ var _enterobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./enterobserver */ "./node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js");
  50761. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  50762. /**
  50763. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  50764. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50765. */
  50766. /**
  50767. * @module enter/shiftenter
  50768. */
  50769. /**
  50770. * This plugin handles the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke (soft line break) in the editor.
  50771. *
  50772. * See also the {@link module:enter/enter~Enter} plugin.
  50773. *
  50774. * For more information about this feature see the {@glink api/enter package page}.
  50775. *
  50776. * @extends module:core/plugin~Plugin
  50777. */
  50778. class ShiftEnter extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__["default"] {
  50779. /**
  50780. * @inheritDoc
  50781. */
  50782. static get pluginName() {
  50783. return 'ShiftEnter';
  50784. }
  50785. init() {
  50786. const editor = this.editor;
  50787. const schema = editor.model.schema;
  50788. const conversion = editor.conversion;
  50789. const view = editor.editing.view;
  50790. const viewDocument = view.document;
  50791. // Configure the schema.
  50792. schema.register( 'softBreak', {
  50793. allowWhere: '$text',
  50794. isInline: true
  50795. } );
  50796. // Configure converters.
  50797. conversion.for( 'upcast' )
  50798. .elementToElement( {
  50799. model: 'softBreak',
  50800. view: 'br'
  50801. } );
  50802. conversion.for( 'downcast' )
  50803. .elementToElement( {
  50804. model: 'softBreak',
  50805. view: ( modelElement, { writer } ) => writer.createEmptyElement( 'br' )
  50806. } );
  50807. view.addObserver( _enterobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
  50808. editor.commands.add( 'shiftEnter', new _shiftentercommand__WEBPACK_IMPORTED_MODULE_0__["default"]( editor ) );
  50809. this.listenTo( viewDocument, 'enter', ( evt, data ) => {
  50810. data.preventDefault();
  50811. // The hard enter key is handled by the Enter plugin.
  50812. if ( !data.isSoft ) {
  50813. return;
  50814. }
  50815. editor.execute( 'shiftEnter' );
  50816. view.scrollToTheSelection();
  50817. }, { priority: 'low' } );
  50818. }
  50819. }
  50820. /***/ }),
  50821. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/shiftentercommand.js":
  50822. /*!*************************************************************************!*\
  50823. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/shiftentercommand.js ***!
  50824. \*************************************************************************/
  50825. /*! exports provided: default */
  50826. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50827. "use strict";
  50828. __webpack_require__.r(__webpack_exports__);
  50829. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ShiftEnterCommand; });
  50830. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  50831. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-enter/src/utils.js");
  50832. /**
  50833. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  50834. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50835. */
  50836. /**
  50837. * @module enter/shiftentercommand
  50838. */
  50839. /**
  50840. * ShiftEnter command. It is used by the {@link module:enter/shiftenter~ShiftEnter ShiftEnter feature} to handle
  50841. * the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke.
  50842. *
  50843. * @extends module:core/command~Command
  50844. */
  50845. class ShiftEnterCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  50846. /**
  50847. * @inheritDoc
  50848. */
  50849. execute() {
  50850. const model = this.editor.model;
  50851. const doc = model.document;
  50852. model.change( writer => {
  50853. softBreakAction( model, writer, doc.selection );
  50854. this.fire( 'afterExecute', { writer } );
  50855. } );
  50856. }
  50857. refresh() {
  50858. const model = this.editor.model;
  50859. const doc = model.document;
  50860. this.isEnabled = isEnabled( model.schema, doc.selection );
  50861. }
  50862. }
  50863. // Checks whether the ShiftEnter command should be enabled in the specified selection.
  50864. //
  50865. // @param {module:engine/model/schema~Schema} schema
  50866. // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  50867. function isEnabled( schema, selection ) {
  50868. // At this moment it is okay to support single range selections only.
  50869. // But in the future we may need to change that.
  50870. if ( selection.rangeCount > 1 ) {
  50871. return false;
  50872. }
  50873. const anchorPos = selection.anchor;
  50874. // Check whether the break element can be inserted in the current selection anchor.
  50875. if ( !anchorPos || !schema.checkChild( anchorPos, 'softBreak' ) ) {
  50876. return false;
  50877. }
  50878. const range = selection.getFirstRange();
  50879. const startElement = range.start.parent;
  50880. const endElement = range.end.parent;
  50881. // Do not modify the content if selection is cross-limit elements.
  50882. if ( ( isInsideLimitElement( startElement, schema ) || isInsideLimitElement( endElement, schema ) ) && startElement !== endElement ) {
  50883. return false;
  50884. }
  50885. return true;
  50886. }
  50887. // Creates a break in the way that the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke is expected to work.
  50888. //
  50889. // @param {module:engine/model~Model} model
  50890. // @param {module:engine/model/writer~Writer} writer
  50891. // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  50892. // Selection on which the action should be performed.
  50893. function softBreakAction( model, writer, selection ) {
  50894. const isSelectionEmpty = selection.isCollapsed;
  50895. const range = selection.getFirstRange();
  50896. const startElement = range.start.parent;
  50897. const endElement = range.end.parent;
  50898. const isContainedWithinOneElement = ( startElement == endElement );
  50899. if ( isSelectionEmpty ) {
  50900. const attributesToCopy = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getCopyOnEnterAttributes"])( model.schema, selection.getAttributes() );
  50901. insertBreak( model, writer, range.end );
  50902. writer.removeSelectionAttribute( selection.getAttributeKeys() );
  50903. writer.setSelectionAttribute( attributesToCopy );
  50904. } else {
  50905. const leaveUnmerged = !( range.start.isAtStart && range.end.isAtEnd );
  50906. model.deleteContent( selection, { leaveUnmerged } );
  50907. // Selection within one element:
  50908. //
  50909. // <h>x[xx]x</h> -> <h>x^x</h> -> <h>x<br>^x</h>
  50910. if ( isContainedWithinOneElement ) {
  50911. insertBreak( model, writer, selection.focus );
  50912. }
  50913. // Selection over multiple elements.
  50914. //
  50915. // <h>x[x</h><p>y]y<p> -> <h>x^</h><p>y</p> -> <h>x</h><p>^y</p>
  50916. //
  50917. // We chose not to insert a line break in this case because:
  50918. //
  50919. // * it's not a very common scenario,
  50920. // * it actually surprised me when I saw the "expected behavior" in real life.
  50921. //
  50922. // It's ok if the user will need to be more specific where they want the <br> to be inserted.
  50923. else {
  50924. // Move the selection to the 2nd element (last step of the example above).
  50925. if ( leaveUnmerged ) {
  50926. writer.setSelection( endElement, 0 );
  50927. }
  50928. }
  50929. }
  50930. }
  50931. function insertBreak( model, writer, position ) {
  50932. const breakLineElement = writer.createElement( 'softBreak' );
  50933. model.insertContent( breakLineElement, position );
  50934. writer.setSelection( breakLineElement, 'after' );
  50935. }
  50936. // Checks whether the specified `element` is a child of the limit element.
  50937. //
  50938. // Checking whether the `<p>` element is inside a limit element:
  50939. // - <$root><p>Text.</p></$root> => false
  50940. // - <$root><limitElement><p>Text</p></limitElement></$root> => true
  50941. //
  50942. // @param {module:engine/model/element~Element} element
  50943. // @param {module:engine/schema~Schema} schema
  50944. // @returns {Boolean}
  50945. function isInsideLimitElement( element, schema ) {
  50946. // `$root` is a limit element but in this case is an invalid element.
  50947. if ( element.is( 'rootElement' ) ) {
  50948. return false;
  50949. }
  50950. return schema.isLimit( element ) || isInsideLimitElement( element.parent, schema );
  50951. }
  50952. /***/ }),
  50953. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/utils.js":
  50954. /*!*************************************************************!*\
  50955. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/utils.js ***!
  50956. \*************************************************************/
  50957. /*! exports provided: getCopyOnEnterAttributes */
  50958. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50959. "use strict";
  50960. __webpack_require__.r(__webpack_exports__);
  50961. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCopyOnEnterAttributes", function() { return getCopyOnEnterAttributes; });
  50962. /**
  50963. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  50964. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50965. */
  50966. /**
  50967. * @module enter/utils
  50968. */
  50969. /**
  50970. * Returns attributes that should be preserved on the enter key.
  50971. *
  50972. * Filtering is realized based on `copyOnEnter` attribute property. Read more about attribute properties
  50973. * {@link module:engine/model/schema~Schema#setAttributeProperties here}.
  50974. *
  50975. * @param {module:engine/model/schema~Schema} schema
  50976. * @param {Iterable.<*>} allAttributes attributes to filter.
  50977. * @returns {Iterable.<*>}
  50978. */
  50979. function* getCopyOnEnterAttributes( schema, allAttributes ) {
  50980. for ( const attribute of allAttributes ) {
  50981. if ( attribute && schema.getAttributeProperties( attribute[ 0 ] ).copyOnEnter ) {
  50982. yield attribute;
  50983. }
  50984. }
  50985. }
  50986. /***/ }),
  50987. /***/ "./node_modules/@ckeditor/ckeditor5-essentials/src/essentials.js":
  50988. /*!***********************************************************************!*\
  50989. !*** ./node_modules/@ckeditor/ckeditor5-essentials/src/essentials.js ***!
  50990. \***********************************************************************/
  50991. /*! exports provided: default */
  50992. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50993. "use strict";
  50994. __webpack_require__.r(__webpack_exports__);
  50995. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Essentials; });
  50996. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  50997. /* harmony import */ var ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/clipboard */ "./node_modules/ckeditor5/src/clipboard.js");
  50998. /* harmony import */ var ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/enter */ "./node_modules/ckeditor5/src/enter.js");
  50999. /* harmony import */ var ckeditor5_src_select_all__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/select-all */ "./node_modules/ckeditor5/src/select-all.js");
  51000. /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
  51001. /* harmony import */ var ckeditor5_src_undo__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ckeditor5/src/undo */ "./node_modules/ckeditor5/src/undo.js");
  51002. /**
  51003. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51004. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51005. */
  51006. /**
  51007. * @module essentials/essentials
  51008. */
  51009. /**
  51010. * A plugin including all essential editing features. It represents a set of features that enables similar functionalities
  51011. * to a `<textarea>` element.
  51012. *
  51013. * It includes:
  51014. *
  51015. * * {@link module:clipboard/clipboard~Clipboard},
  51016. * * {@link module:enter/enter~Enter},
  51017. * * {@link module:select-all/selectall~SelectAll},
  51018. * * {@link module:enter/shiftenter~ShiftEnter},
  51019. * * {@link module:typing/typing~Typing},
  51020. * * {@link module:undo/undo~Undo}.
  51021. *
  51022. * This plugin set does not define any block-level containers (such as {@link module:paragraph/paragraph~Paragraph}).
  51023. * If your editor is supposed to handle block content, make sure to include it.
  51024. *
  51025. * @extends module:core/plugin~Plugin
  51026. */
  51027. class Essentials extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  51028. /**
  51029. * @inheritDoc
  51030. */
  51031. static get requires() {
  51032. return [ ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_1__["Clipboard"], ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_2__["Enter"], ckeditor5_src_select_all__WEBPACK_IMPORTED_MODULE_3__["SelectAll"], ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_2__["ShiftEnter"], ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_4__["Typing"], ckeditor5_src_undo__WEBPACK_IMPORTED_MODULE_5__["Undo"] ];
  51033. }
  51034. /**
  51035. * @inheritDoc
  51036. */
  51037. static get pluginName() {
  51038. return 'Essentials';
  51039. }
  51040. }
  51041. /***/ }),
  51042. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/documentcolorcollection.js":
  51043. /*!******************************************************************************!*\
  51044. !*** ./node_modules/@ckeditor/ckeditor5-font/src/documentcolorcollection.js ***!
  51045. \******************************************************************************/
  51046. /*! exports provided: default */
  51047. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51048. "use strict";
  51049. __webpack_require__.r(__webpack_exports__);
  51050. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentColorCollection; });
  51051. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  51052. /**
  51053. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51054. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51055. */
  51056. /**
  51057. * @module font/documentcolorcollection
  51058. */
  51059. /**
  51060. * A collection to store document colors. It enforces colors to be unique.
  51061. *
  51062. * @mixes module:utils/observablemixin~ObservableMixin
  51063. * @extends module:utils/collection~Collection
  51064. */
  51065. class DocumentColorCollection extends ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["Collection"] {
  51066. constructor( options ) {
  51067. super( options );
  51068. /**
  51069. * Indicates whether the document color collection is empty.
  51070. *
  51071. * @observable
  51072. * @readonly
  51073. * @member {Boolean} #isEmpty
  51074. */
  51075. this.set( 'isEmpty', true );
  51076. this.on( 'change', () => {
  51077. this.set( 'isEmpty', this.length === 0 );
  51078. } );
  51079. }
  51080. /**
  51081. * Adds a color to the document color collection.
  51082. *
  51083. * This method ensures that no color duplicates are inserted (compared using
  51084. * the color value of the {@link module:ui/colorgrid/colorgrid~ColorDefinition}).
  51085. *
  51086. * If the item does not have an ID, it will be automatically generated and set on the item.
  51087. *
  51088. * @chainable
  51089. * @param {module:ui/colorgrid/colorgrid~ColorDefinition} item
  51090. * @param {Number} [index] The position of the item in the collection. The item
  51091. * is pushed to the collection when `index` is not specified.
  51092. * @fires add
  51093. * @fires change
  51094. */
  51095. add( item, index ) {
  51096. if ( this.find( element => element.color === item.color ) ) {
  51097. // No duplicates are allowed.
  51098. return;
  51099. }
  51100. super.add( item, index );
  51101. }
  51102. /**
  51103. * Checks if an object with given colors is present in the document color collection.
  51104. *
  51105. * @param {String} color
  51106. * @returns {Boolean}
  51107. */
  51108. hasColor( color ) {
  51109. return !!this.find( item => item.color === color );
  51110. }
  51111. }
  51112. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["mix"])( DocumentColorCollection, ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["ObservableMixin"] );
  51113. /***/ }),
  51114. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js":
  51115. /*!**************************************************************************!*\
  51116. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js ***!
  51117. \**************************************************************************/
  51118. /*! exports provided: default */
  51119. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51120. "use strict";
  51121. __webpack_require__.r(__webpack_exports__);
  51122. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontBackgroundColor; });
  51123. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  51124. /* harmony import */ var _fontbackgroundcolor_fontbackgroundcolorediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fontbackgroundcolor/fontbackgroundcolorediting */ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js");
  51125. /* harmony import */ var _fontbackgroundcolor_fontbackgroundcolorui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fontbackgroundcolor/fontbackgroundcolorui */ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorui.js");
  51126. /**
  51127. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51128. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51129. */
  51130. /**
  51131. * @module font/fontbackgroundcolor
  51132. */
  51133. /**
  51134. * The font background color plugin.
  51135. *
  51136. * For a detailed overview, check the {@glink features/font font feature} documentation
  51137. * and the {@glink api/font package page}.
  51138. *
  51139. * This is a "glue" plugin which loads
  51140. * the {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing} and
  51141. * {@link module:font/fontbackgroundcolor/fontbackgroundcolorui~FontBackgroundColorUI} features in the editor.
  51142. *
  51143. * @extends module:core/plugin~Plugin
  51144. */
  51145. class FontBackgroundColor extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  51146. /**
  51147. * @inheritDoc
  51148. */
  51149. static get requires() {
  51150. return [ _fontbackgroundcolor_fontbackgroundcolorediting__WEBPACK_IMPORTED_MODULE_1__["default"], _fontbackgroundcolor_fontbackgroundcolorui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  51151. }
  51152. /**
  51153. * @inheritDoc
  51154. */
  51155. static get pluginName() {
  51156. return 'FontBackgroundColor';
  51157. }
  51158. }
  51159. /**
  51160. * The configuration of the font background color feature.
  51161. * It is introduced by the {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing} feature.
  51162. *
  51163. * Read more in {@link module:font/fontbackgroundcolor~FontBackgroundColorConfig}.
  51164. *
  51165. * @member {module:font/fontbackgroundcolor~FontBackgroundColorConfig} module:core/editor/editorconfig~EditorConfig#fontBackgroundColor
  51166. */
  51167. /**
  51168. * The configuration of the font background color feature.
  51169. * This option is used by the {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing} feature.
  51170. *
  51171. * ClassicEditor
  51172. * .create( {
  51173. * fontBackgroundColor: ... // Font background color feature configuration.
  51174. * } )
  51175. * .then( ... )
  51176. * .catch( ... );
  51177. *
  51178. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  51179. *
  51180. * @interface module:font/fontbackgroundcolor~FontBackgroundColorConfig
  51181. */
  51182. /**
  51183. * Available font background colors defined as an array of strings or objects.
  51184. *
  51185. * The default value registers the following colors:
  51186. *
  51187. * const fontBackgroundColorConfig = {
  51188. * colors: [
  51189. * {
  51190. * color: 'hsl(0, 0%, 0%)',
  51191. * label: 'Black'
  51192. * },
  51193. * {
  51194. * color: 'hsl(0, 0%, 30%)',
  51195. * label: 'Dim grey'
  51196. * },
  51197. * {
  51198. * color: 'hsl(0, 0%, 60%)',
  51199. * label: 'Grey'
  51200. * },
  51201. * {
  51202. * color: 'hsl(0, 0%, 90%)',
  51203. * label: 'Light grey'
  51204. * },
  51205. * {
  51206. * color: 'hsl(0, 0%, 100%)',
  51207. * label: 'White',
  51208. * hasBorder: true
  51209. * },
  51210. * {
  51211. * color: 'hsl(0, 75%, 60%)',
  51212. * label: 'Red'
  51213. * },
  51214. * {
  51215. * color: 'hsl(30, 75%, 60%)',
  51216. * label: 'Orange'
  51217. * },
  51218. * {
  51219. * color: 'hsl(60, 75%, 60%)',
  51220. * label: 'Yellow'
  51221. * },
  51222. * {
  51223. * color: 'hsl(90, 75%, 60%)',
  51224. * label: 'Light green'
  51225. * },
  51226. * {
  51227. * color: 'hsl(120, 75%, 60%)',
  51228. * label: 'Green'
  51229. * },
  51230. * {
  51231. * color: 'hsl(150, 75%, 60%)',
  51232. * label: 'Aquamarine'
  51233. * },
  51234. * {
  51235. * color: 'hsl(180, 75%, 60%)',
  51236. * label: 'Turquoise'
  51237. * },
  51238. * {
  51239. * color: 'hsl(210, 75%, 60%)',
  51240. * label: 'Light blue'
  51241. * },
  51242. * {
  51243. * color: 'hsl(240, 75%, 60%)',
  51244. * label: 'Blue'
  51245. * },
  51246. * {
  51247. * color: 'hsl(270, 75%, 60%)',
  51248. * label: 'Purple'
  51249. * }
  51250. * ]
  51251. * };
  51252. *
  51253. * **Note**: The colors are displayed in the `'fontBackgroundColor'` dropdown.
  51254. *
  51255. * @member {Array.<String|Object>} module:font/fontbackgroundcolor~FontBackgroundColorConfig#colors
  51256. */
  51257. /**
  51258. * Represents the number of columns in the font background color dropdown.
  51259. *
  51260. * The default value is:
  51261. *
  51262. * const fontBackgroundColorConfig = {
  51263. * columns: 5
  51264. * }
  51265. *
  51266. * @member {Number} module:font/fontbackgroundcolor~FontBackgroundColorConfig#columns
  51267. */
  51268. /**
  51269. * Determines the maximum number of available document colors.
  51270. * Setting it to `0` will disable the document colors feature.
  51271. *
  51272. * By default it equals to the {@link module:font/fontbackgroundcolor~FontBackgroundColorConfig#columns} value.
  51273. *
  51274. * Examples:
  51275. *
  51276. * // 1) Neither document colors nor columns are defined in the configuration.
  51277. * // Document colors will equal 5,
  51278. * // because the value will be inherited from columns,
  51279. * // which has a predefined value of 5.
  51280. * const fontBackgroundColorConfig = {}
  51281. *
  51282. * // 2) Document colors will equal 8, because the value will be inherited from columns.
  51283. * const fontBackgroundColorConfig = {
  51284. * columns: 8
  51285. * }
  51286. *
  51287. * // 3) Document colors will equal 24, because it has its own value defined.
  51288. * const fontBackgroundColorConfig = {
  51289. * columns: 8,
  51290. * documentColors: 24
  51291. * }
  51292. *
  51293. * // 4) The document colors feature will be disabled.
  51294. * const fontBackgroundColorConfig = {
  51295. * columns: 8,
  51296. * documentColors: 0
  51297. * }
  51298. *
  51299. * @member {Number} module:font/fontbackgroundcolor~FontBackgroundColorConfig#documentColors
  51300. */
  51301. /***/ }),
  51302. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorcommand.js":
  51303. /*!*****************************************************************************************************!*\
  51304. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorcommand.js ***!
  51305. \*****************************************************************************************************/
  51306. /*! exports provided: default */
  51307. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51308. "use strict";
  51309. __webpack_require__.r(__webpack_exports__);
  51310. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontBackgroundColorCommand; });
  51311. /* harmony import */ var _fontcommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../fontcommand */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js");
  51312. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  51313. /**
  51314. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51315. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51316. */
  51317. /**
  51318. * @module font/fontbackgroundcolor/fontbackgroundcolorcommand
  51319. */
  51320. /**
  51321. * The font background color command. It is used by
  51322. * {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing}
  51323. * to apply the font background color.
  51324. *
  51325. * editor.execute( 'fontBackgroundColor', { value: 'rgb(250, 20, 20)' } );
  51326. *
  51327. * **Note**: Executing the command with the `null` value removes the attribute from the model.
  51328. *
  51329. * @extends module:font/fontcommand~FontCommand
  51330. */
  51331. class FontBackgroundColorCommand extends _fontcommand__WEBPACK_IMPORTED_MODULE_0__["default"] {
  51332. /**
  51333. * @inheritDoc
  51334. */
  51335. constructor( editor ) {
  51336. super( editor, _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_BACKGROUND_COLOR"] );
  51337. }
  51338. }
  51339. /***/ }),
  51340. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js":
  51341. /*!*****************************************************************************************************!*\
  51342. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js ***!
  51343. \*****************************************************************************************************/
  51344. /*! exports provided: default */
  51345. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51346. "use strict";
  51347. __webpack_require__.r(__webpack_exports__);
  51348. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontBackgroundColorEditing; });
  51349. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  51350. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  51351. /* harmony import */ var _fontbackgroundcolorcommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fontbackgroundcolorcommand */ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorcommand.js");
  51352. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  51353. /**
  51354. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51355. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51356. */
  51357. /**
  51358. * @module font/fontbackgroundcolor/fontbackgroundcolorediting
  51359. */
  51360. /**
  51361. * The font background color editing feature.
  51362. *
  51363. * It introduces the {@link module:font/fontbackgroundcolor/fontbackgroundcolorcommand~FontBackgroundColorCommand command} and
  51364. * the `fontBackgroundColor` attribute in the {@link module:engine/model/model~Model model} which renders
  51365. * in the {@link module:engine/view/view view} as a `<span>` element (`<span style="background-color: ...">`),
  51366. * depending on the {@link module:font/fontbackgroundcolor~FontBackgroundColorConfig configuration}.
  51367. *
  51368. * @extends module:core/plugin~Plugin
  51369. */
  51370. class FontBackgroundColorEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  51371. /**
  51372. * @inheritDoc
  51373. */
  51374. static get pluginName() {
  51375. return 'FontBackgroundColorEditing';
  51376. }
  51377. /**
  51378. * @inheritDoc
  51379. */
  51380. constructor( editor ) {
  51381. super( editor );
  51382. editor.config.define( _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"], {
  51383. colors: [
  51384. {
  51385. color: 'hsl(0, 0%, 0%)',
  51386. label: 'Black'
  51387. },
  51388. {
  51389. color: 'hsl(0, 0%, 30%)',
  51390. label: 'Dim grey'
  51391. },
  51392. {
  51393. color: 'hsl(0, 0%, 60%)',
  51394. label: 'Grey'
  51395. },
  51396. {
  51397. color: 'hsl(0, 0%, 90%)',
  51398. label: 'Light grey'
  51399. },
  51400. {
  51401. color: 'hsl(0, 0%, 100%)',
  51402. label: 'White',
  51403. hasBorder: true
  51404. },
  51405. {
  51406. color: 'hsl(0, 75%, 60%)',
  51407. label: 'Red'
  51408. },
  51409. {
  51410. color: 'hsl(30, 75%, 60%)',
  51411. label: 'Orange'
  51412. },
  51413. {
  51414. color: 'hsl(60, 75%, 60%)',
  51415. label: 'Yellow'
  51416. },
  51417. {
  51418. color: 'hsl(90, 75%, 60%)',
  51419. label: 'Light green'
  51420. },
  51421. {
  51422. color: 'hsl(120, 75%, 60%)',
  51423. label: 'Green'
  51424. },
  51425. {
  51426. color: 'hsl(150, 75%, 60%)',
  51427. label: 'Aquamarine'
  51428. },
  51429. {
  51430. color: 'hsl(180, 75%, 60%)',
  51431. label: 'Turquoise'
  51432. },
  51433. {
  51434. color: 'hsl(210, 75%, 60%)',
  51435. label: 'Light blue'
  51436. },
  51437. {
  51438. color: 'hsl(240, 75%, 60%)',
  51439. label: 'Blue'
  51440. },
  51441. {
  51442. color: 'hsl(270, 75%, 60%)',
  51443. label: 'Purple'
  51444. }
  51445. ],
  51446. columns: 5
  51447. } );
  51448. editor.data.addStyleProcessorRules( ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__["addBackgroundRules"] );
  51449. editor.conversion.for( 'upcast' ).elementToAttribute( {
  51450. view: {
  51451. name: 'span',
  51452. styles: {
  51453. 'background-color': /[\s\S]+/
  51454. }
  51455. },
  51456. model: {
  51457. key: _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"],
  51458. value: Object(_utils__WEBPACK_IMPORTED_MODULE_3__["renderUpcastAttribute"])( 'background-color' )
  51459. }
  51460. } );
  51461. editor.conversion.for( 'downcast' ).attributeToElement( {
  51462. model: _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"],
  51463. view: Object(_utils__WEBPACK_IMPORTED_MODULE_3__["renderDowncastElement"])( 'background-color' )
  51464. } );
  51465. editor.commands.add( _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"], new _fontbackgroundcolorcommand__WEBPACK_IMPORTED_MODULE_2__["default"]( editor ) );
  51466. // Allow the font backgroundColor attribute on text nodes.
  51467. editor.model.schema.extend( '$text', { allowAttributes: _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"] } );
  51468. editor.model.schema.setAttributeProperties( _utils__WEBPACK_IMPORTED_MODULE_3__["FONT_BACKGROUND_COLOR"], {
  51469. isFormatting: true,
  51470. copyOnEnter: true
  51471. } );
  51472. }
  51473. }
  51474. /***/ }),
  51475. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorui.js":
  51476. /*!************************************************************************************************!*\
  51477. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorui.js ***!
  51478. \************************************************************************************************/
  51479. /*! exports provided: default */
  51480. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51481. "use strict";
  51482. __webpack_require__.r(__webpack_exports__);
  51483. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontBackgroundColorUI; });
  51484. /* harmony import */ var _ui_colorui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ui/colorui */ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js");
  51485. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  51486. /* harmony import */ var _theme_icons_font_background_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/font-background.svg */ "./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-background.svg");
  51487. /**
  51488. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51489. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51490. */
  51491. /**
  51492. * @module font/fontbackgroundcolor/fontbackgroundcolorui
  51493. */
  51494. /**
  51495. * The font background color UI plugin. It introduces the `'fontBackgroundColor'` dropdown.
  51496. *
  51497. * @extends module:core/plugin~Plugin
  51498. */
  51499. class FontBackgroundColorUI extends _ui_colorui__WEBPACK_IMPORTED_MODULE_0__["default"] {
  51500. /**
  51501. * @inheritDoc
  51502. */
  51503. constructor( editor ) {
  51504. const t = editor.locale.t;
  51505. super( editor, {
  51506. commandName: _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_BACKGROUND_COLOR"],
  51507. componentName: _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_BACKGROUND_COLOR"],
  51508. icon: _theme_icons_font_background_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  51509. dropdownLabel: t( 'Font Background Color' )
  51510. } );
  51511. }
  51512. /**
  51513. * @inheritDoc
  51514. */
  51515. static get pluginName() {
  51516. return 'FontBackgroundColorUI';
  51517. }
  51518. }
  51519. /***/ }),
  51520. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor.js":
  51521. /*!****************************************************************!*\
  51522. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcolor.js ***!
  51523. \****************************************************************/
  51524. /*! exports provided: default */
  51525. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51526. "use strict";
  51527. __webpack_require__.r(__webpack_exports__);
  51528. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontColor; });
  51529. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  51530. /* harmony import */ var _fontcolor_fontcolorediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fontcolor/fontcolorediting */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorediting.js");
  51531. /* harmony import */ var _fontcolor_fontcolorui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fontcolor/fontcolorui */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorui.js");
  51532. /**
  51533. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51534. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51535. */
  51536. /**
  51537. * @module font/fontcolor
  51538. */
  51539. /**
  51540. * The font color plugin.
  51541. *
  51542. * For a detailed overview, check the {@glink features/font font feature} documentation
  51543. * and the {@glink api/font package page}.
  51544. *
  51545. * This is a "glue" plugin which loads the {@link module:font/fontcolor/fontcolorediting~FontColorEditing} and
  51546. * {@link module:font/fontcolor/fontcolorui~FontColorUI} features in the editor.
  51547. *
  51548. * @extends module:core/plugin~Plugin
  51549. */
  51550. class FontColor extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  51551. /**
  51552. * @inheritDoc
  51553. */
  51554. static get requires() {
  51555. return [ _fontcolor_fontcolorediting__WEBPACK_IMPORTED_MODULE_1__["default"], _fontcolor_fontcolorui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  51556. }
  51557. /**
  51558. * @inheritDoc
  51559. */
  51560. static get pluginName() {
  51561. return 'FontColor';
  51562. }
  51563. }
  51564. /**
  51565. * The configuration of the font color feature.
  51566. * It is introduced by the {@link module:font/fontcolor/fontcolorediting~FontColorEditing} feature.
  51567. *
  51568. * Read more in {@link module:font/fontcolor~FontColorConfig}.
  51569. *
  51570. * @member {module:font/fontcolor~FontColorConfig} module:core/editor/editorconfig~EditorConfig#fontColor
  51571. */
  51572. /**
  51573. * The configuration of the font color feature.
  51574. * This option is used by the {@link module:font/fontcolor/fontcolorediting~FontColorEditing} feature.
  51575. *
  51576. * ClassicEditor
  51577. * .create( {
  51578. * fontColor: ... // Font color feature configuration.
  51579. * } )
  51580. * .then( ... )
  51581. * .catch( ... );
  51582. *
  51583. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  51584. *
  51585. * @interface module:font/fontcolor~FontColorConfig
  51586. */
  51587. /**
  51588. * Available font colors defined as an array of strings or objects.
  51589. *
  51590. * The default value registers the following colors:
  51591. *
  51592. * const fontColorConfig = {
  51593. * colors: [
  51594. * {
  51595. * color: 'hsl(0, 0%, 0%)',
  51596. * label: 'Black'
  51597. * },
  51598. * {
  51599. * color: 'hsl(0, 0%, 30%)',
  51600. * label: 'Dim grey'
  51601. * },
  51602. * {
  51603. * color: 'hsl(0, 0%, 60%)',
  51604. * label: 'Grey'
  51605. * },
  51606. * {
  51607. * color: 'hsl(0, 0%, 90%)',
  51608. * label: 'Light grey'
  51609. * },
  51610. * {
  51611. * color: 'hsl(0, 0%, 100%)',
  51612. * label: 'White',
  51613. * hasBorder: true
  51614. * },
  51615. * {
  51616. * color: 'hsl(0, 75%, 60%)',
  51617. * label: 'Red'
  51618. * },
  51619. * {
  51620. * color: 'hsl(30, 75%, 60%)',
  51621. * label: 'Orange'
  51622. * },
  51623. * {
  51624. * color: 'hsl(60, 75%, 60%)',
  51625. * label: 'Yellow'
  51626. * },
  51627. * {
  51628. * color: 'hsl(90, 75%, 60%)',
  51629. * label: 'Light green'
  51630. * },
  51631. * {
  51632. * color: 'hsl(120, 75%, 60%)',
  51633. * label: 'Green'
  51634. * },
  51635. * {
  51636. * color: 'hsl(150, 75%, 60%)',
  51637. * label: 'Aquamarine'
  51638. * },
  51639. * {
  51640. * color: 'hsl(180, 75%, 60%)',
  51641. * label: 'Turquoise'
  51642. * },
  51643. * {
  51644. * color: 'hsl(210, 75%, 60%)',
  51645. * label: 'Light blue'
  51646. * },
  51647. * {
  51648. * color: 'hsl(240, 75%, 60%)',
  51649. * label: 'Blue'
  51650. * },
  51651. * {
  51652. * color: 'hsl(270, 75%, 60%)',
  51653. * label: 'Purple'
  51654. * }
  51655. * ]
  51656. * };
  51657. *
  51658. * **Note**: The colors are displayed in the `'fontColor'` dropdown.
  51659. *
  51660. * @member {Array.<String|Object>} module:font/fontcolor~FontColorConfig#colors
  51661. */
  51662. /**
  51663. * Represents the number of columns in the font color dropdown.
  51664. *
  51665. * The default value is:
  51666. *
  51667. * const fontColorConfig = {
  51668. * columns: 5
  51669. * }
  51670. *
  51671. * @member {Number} module:font/fontcolor~FontColorConfig#columns
  51672. */
  51673. /**
  51674. * Determines the maximum number of available document colors.
  51675. * Setting it to `0` will disable the document colors feature.
  51676. *
  51677. * By default it equals to the {@link module:font/fontcolor~FontColorConfig#columns} value.
  51678. *
  51679. * Examples:
  51680. *
  51681. * // 1) Neither document colors nor columns are defined in the configuration.
  51682. * // Document colors will equal 5,
  51683. * // because the value will be inherited from columns,
  51684. * // which has a predefined value of 5.
  51685. * const fontColorConfig = {}
  51686. *
  51687. * // 2) Document colors will equal 8, because the value will be inherited from columns.
  51688. * const fontColorConfig = {
  51689. * columns: 8
  51690. * }
  51691. *
  51692. * // 3) Document colors will equal 24, because it has its own value defined.
  51693. * const fontColorConfig = {
  51694. * columns: 8,
  51695. * documentColors: 24
  51696. * }
  51697. *
  51698. * // 4) The document colors feature will be disabled.
  51699. * const fontColorConfig = {
  51700. * columns: 8,
  51701. * documentColors: 0
  51702. * }
  51703. *
  51704. * @member {Number} module:font/fontcolor~FontColorConfig#documentColors
  51705. */
  51706. /***/ }),
  51707. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorcommand.js":
  51708. /*!*********************************************************************************!*\
  51709. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorcommand.js ***!
  51710. \*********************************************************************************/
  51711. /*! exports provided: default */
  51712. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51713. "use strict";
  51714. __webpack_require__.r(__webpack_exports__);
  51715. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontColorCommand; });
  51716. /* harmony import */ var _fontcommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../fontcommand */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js");
  51717. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  51718. /**
  51719. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51720. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51721. */
  51722. /**
  51723. * @module font/fontcolor/fontcolorcommand
  51724. */
  51725. /**
  51726. * The font color command. It is used by {@link module:font/fontcolor/fontcolorediting~FontColorEditing}
  51727. * to apply the font color.
  51728. *
  51729. * editor.execute( 'fontColor', { value: 'rgb(250, 20, 20)' } );
  51730. *
  51731. * **Note**: Executing the command with the `null` value removes the attribute from the model.
  51732. *
  51733. * @extends module:font/fontcommand~FontCommand
  51734. */
  51735. class FontColorCommand extends _fontcommand__WEBPACK_IMPORTED_MODULE_0__["default"] {
  51736. /**
  51737. * @inheritDoc
  51738. */
  51739. constructor( editor ) {
  51740. super( editor, _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_COLOR"] );
  51741. }
  51742. }
  51743. /***/ }),
  51744. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorediting.js":
  51745. /*!*********************************************************************************!*\
  51746. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorediting.js ***!
  51747. \*********************************************************************************/
  51748. /*! exports provided: default */
  51749. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51750. "use strict";
  51751. __webpack_require__.r(__webpack_exports__);
  51752. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontColorEditing; });
  51753. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  51754. /* harmony import */ var _fontcolorcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fontcolorcommand */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorcommand.js");
  51755. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  51756. /**
  51757. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51758. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51759. */
  51760. /**
  51761. * @module font/fontcolor/fontcolorediting
  51762. */
  51763. /**
  51764. * The font color editing feature.
  51765. *
  51766. * It introduces the {@link module:font/fontcolor/fontcolorcommand~FontColorCommand command} and
  51767. * the `fontColor` attribute in the {@link module:engine/model/model~Model model} which renders
  51768. * in the {@link module:engine/view/view view} as a `<span>` element (`<span style="color: ...">`),
  51769. * depending on the {@link module:font/fontcolor~FontColorConfig configuration}.
  51770. *
  51771. * @extends module:core/plugin~Plugin
  51772. */
  51773. class FontColorEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  51774. /**
  51775. * @inheritDoc
  51776. */
  51777. static get pluginName() {
  51778. return 'FontColorEditing';
  51779. }
  51780. /**
  51781. * @inheritDoc
  51782. */
  51783. constructor( editor ) {
  51784. super( editor );
  51785. editor.config.define( _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"], {
  51786. colors: [
  51787. {
  51788. color: 'hsl(0, 0%, 0%)',
  51789. label: 'Black'
  51790. },
  51791. {
  51792. color: 'hsl(0, 0%, 30%)',
  51793. label: 'Dim grey'
  51794. },
  51795. {
  51796. color: 'hsl(0, 0%, 60%)',
  51797. label: 'Grey'
  51798. },
  51799. {
  51800. color: 'hsl(0, 0%, 90%)',
  51801. label: 'Light grey'
  51802. },
  51803. {
  51804. color: 'hsl(0, 0%, 100%)',
  51805. label: 'White',
  51806. hasBorder: true
  51807. },
  51808. {
  51809. color: 'hsl(0, 75%, 60%)',
  51810. label: 'Red'
  51811. },
  51812. {
  51813. color: 'hsl(30, 75%, 60%)',
  51814. label: 'Orange'
  51815. },
  51816. {
  51817. color: 'hsl(60, 75%, 60%)',
  51818. label: 'Yellow'
  51819. },
  51820. {
  51821. color: 'hsl(90, 75%, 60%)',
  51822. label: 'Light green'
  51823. },
  51824. {
  51825. color: 'hsl(120, 75%, 60%)',
  51826. label: 'Green'
  51827. },
  51828. {
  51829. color: 'hsl(150, 75%, 60%)',
  51830. label: 'Aquamarine'
  51831. },
  51832. {
  51833. color: 'hsl(180, 75%, 60%)',
  51834. label: 'Turquoise'
  51835. },
  51836. {
  51837. color: 'hsl(210, 75%, 60%)',
  51838. label: 'Light blue'
  51839. },
  51840. {
  51841. color: 'hsl(240, 75%, 60%)',
  51842. label: 'Blue'
  51843. },
  51844. {
  51845. color: 'hsl(270, 75%, 60%)',
  51846. label: 'Purple'
  51847. }
  51848. ],
  51849. columns: 5
  51850. } );
  51851. editor.conversion.for( 'upcast' ).elementToAttribute( {
  51852. view: {
  51853. name: 'span',
  51854. styles: {
  51855. 'color': /[\s\S]+/
  51856. }
  51857. },
  51858. model: {
  51859. key: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"],
  51860. value: Object(_utils__WEBPACK_IMPORTED_MODULE_2__["renderUpcastAttribute"])( 'color' )
  51861. }
  51862. } );
  51863. // Support legacy `<font color="..">` formatting.
  51864. editor.conversion.for( 'upcast' ).elementToAttribute( {
  51865. view: {
  51866. name: 'font',
  51867. attributes: {
  51868. 'color': /^#?\w+$/
  51869. }
  51870. },
  51871. model: {
  51872. key: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"],
  51873. value: viewElement => viewElement.getAttribute( 'color' )
  51874. }
  51875. } );
  51876. editor.conversion.for( 'downcast' ).attributeToElement( {
  51877. model: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"],
  51878. view: Object(_utils__WEBPACK_IMPORTED_MODULE_2__["renderDowncastElement"])( 'color' )
  51879. } );
  51880. editor.commands.add( _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"], new _fontcolorcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  51881. // Allow the font color attribute on text nodes.
  51882. editor.model.schema.extend( '$text', { allowAttributes: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"] } );
  51883. editor.model.schema.setAttributeProperties( _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"], {
  51884. isFormatting: true,
  51885. copyOnEnter: true
  51886. } );
  51887. }
  51888. }
  51889. /***/ }),
  51890. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorui.js":
  51891. /*!****************************************************************************!*\
  51892. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorui.js ***!
  51893. \****************************************************************************/
  51894. /*! exports provided: default */
  51895. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51896. "use strict";
  51897. __webpack_require__.r(__webpack_exports__);
  51898. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontColorUI; });
  51899. /* harmony import */ var _ui_colorui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ui/colorui */ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js");
  51900. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  51901. /* harmony import */ var _theme_icons_font_color_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/font-color.svg */ "./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-color.svg");
  51902. /**
  51903. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51904. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51905. */
  51906. /**
  51907. * @module font/fontcolor/fontcolorui
  51908. */
  51909. /**
  51910. * The font color UI plugin. It introduces the `'fontColor'` dropdown.
  51911. *
  51912. * @extends module:core/plugin~Plugin
  51913. */
  51914. class FontColorUI extends _ui_colorui__WEBPACK_IMPORTED_MODULE_0__["default"] {
  51915. /**
  51916. * @inheritDoc
  51917. */
  51918. constructor( editor ) {
  51919. const t = editor.locale.t;
  51920. super( editor, {
  51921. commandName: _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_COLOR"],
  51922. componentName: _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_COLOR"],
  51923. icon: _theme_icons_font_color_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  51924. dropdownLabel: t( 'Font Color' )
  51925. } );
  51926. }
  51927. /**
  51928. * @inheritDoc
  51929. */
  51930. static get pluginName() {
  51931. return 'FontColorUI';
  51932. }
  51933. }
  51934. /***/ }),
  51935. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js":
  51936. /*!******************************************************************!*\
  51937. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js ***!
  51938. \******************************************************************/
  51939. /*! exports provided: default */
  51940. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51941. "use strict";
  51942. __webpack_require__.r(__webpack_exports__);
  51943. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontCommand; });
  51944. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  51945. /**
  51946. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  51947. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51948. */
  51949. /**
  51950. * @module font/fontcommand
  51951. */
  51952. /**
  51953. * The base font command.
  51954. *
  51955. * @extends module:core/command~Command
  51956. */
  51957. class FontCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  51958. /**
  51959. * Creates an instance of the command.
  51960. *
  51961. * @param {module:core/editor/editor~Editor} editor Editor instance.
  51962. * @param {String} attributeKey The name of a model attribute on which this command operates.
  51963. */
  51964. constructor( editor, attributeKey ) {
  51965. super( editor );
  51966. /**
  51967. * When set, it reflects the {@link #attributeKey} value of the selection.
  51968. *
  51969. * @observable
  51970. * @readonly
  51971. * @member {String} module:font/fontcommand~FontCommand#value
  51972. */
  51973. /**
  51974. * A model attribute on which this command operates.
  51975. *
  51976. * @readonly
  51977. * @member {Boolean} module:font/fontcommand~FontCommand#attributeKey
  51978. */
  51979. this.attributeKey = attributeKey;
  51980. }
  51981. /**
  51982. * @inheritDoc
  51983. */
  51984. refresh() {
  51985. const model = this.editor.model;
  51986. const doc = model.document;
  51987. this.value = doc.selection.getAttribute( this.attributeKey );
  51988. this.isEnabled = model.schema.checkAttributeInSelection( doc.selection, this.attributeKey );
  51989. }
  51990. /**
  51991. * Executes the command. Applies the `value` of the {@link #attributeKey} to the selection.
  51992. * If no `value` is passed, it removes the attribute from the selection.
  51993. *
  51994. * @protected
  51995. * @param {Object} [options] Options for the executed command.
  51996. * @param {String} [options.value] The value to apply.
  51997. * @fires execute
  51998. */
  51999. execute( options = {} ) {
  52000. const model = this.editor.model;
  52001. const document = model.document;
  52002. const selection = document.selection;
  52003. const value = options.value;
  52004. model.change( writer => {
  52005. if ( selection.isCollapsed ) {
  52006. if ( value ) {
  52007. writer.setSelectionAttribute( this.attributeKey, value );
  52008. } else {
  52009. writer.removeSelectionAttribute( this.attributeKey );
  52010. }
  52011. } else {
  52012. const ranges = model.schema.getValidRanges( selection.getRanges(), this.attributeKey );
  52013. for ( const range of ranges ) {
  52014. if ( value ) {
  52015. writer.setAttribute( this.attributeKey, value, range );
  52016. } else {
  52017. writer.removeAttribute( this.attributeKey, range );
  52018. }
  52019. }
  52020. }
  52021. } );
  52022. }
  52023. }
  52024. /***/ }),
  52025. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colortableview.js":
  52026. /*!************************************************************************!*\
  52027. !*** ./node_modules/@ckeditor/ckeditor5-font/src/ui/colortableview.js ***!
  52028. \************************************************************************/
  52029. /*! exports provided: default */
  52030. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52031. "use strict";
  52032. __webpack_require__.r(__webpack_exports__);
  52033. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ColorTableView; });
  52034. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  52035. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  52036. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  52037. /* harmony import */ var _documentcolorcollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../documentcolorcollection */ "./node_modules/@ckeditor/ckeditor5-font/src/documentcolorcollection.js");
  52038. /* harmony import */ var _theme_fontcolor_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/fontcolor.css */ "./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css");
  52039. /**
  52040. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  52041. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52042. */
  52043. /**
  52044. * @module font/ui/colortableview
  52045. */
  52046. /**
  52047. * A class which represents a view with the following sub–components:
  52048. *
  52049. * * A remove color button,
  52050. * * A static {@link module:ui/colorgrid/colorgrid~ColorGridView} of colors defined in the configuration,
  52051. * * A dynamic {@link module:ui/colorgrid/colorgrid~ColorGridView} of colors used in the document.
  52052. *
  52053. * @extends module:ui/view~View
  52054. */
  52055. class ColorTableView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["View"] {
  52056. /**
  52057. * Creates a view to be inserted as a child of {@link module:ui/dropdown/dropdownview~DropdownView}.
  52058. *
  52059. * @param {module:utils/locale~Locale} [locale] The localization services instance.
  52060. * @param {Object} config The configuration object.
  52061. * @param {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>} config.colors An array with definitions of colors to
  52062. * be displayed in the table.
  52063. * @param {Number} config.columns The number of columns in the color grid.
  52064. * @param {String} config.removeButtonLabel The label of the button responsible for removing the color.
  52065. * @param {String} config.documentColorsLabel The label for the section with the document colors.
  52066. * @param {Number} config.documentColorsCount The number of colors in the document colors section inside the color dropdown.
  52067. */
  52068. constructor( locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount } ) {
  52069. super( locale );
  52070. /**
  52071. * A collection of the children of the table.
  52072. *
  52073. * @readonly
  52074. * @member {module:ui/viewcollection~ViewCollection}
  52075. */
  52076. this.items = this.createCollection();
  52077. /**
  52078. * An array with objects representing colors to be displayed in the grid.
  52079. *
  52080. * @type {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>}
  52081. */
  52082. this.colorDefinitions = colors;
  52083. /**
  52084. * Tracks information about the DOM focus in the list.
  52085. *
  52086. * @readonly
  52087. * @member {module:utils/focustracker~FocusTracker}
  52088. */
  52089. this.focusTracker = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["FocusTracker"]();
  52090. /**
  52091. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  52092. *
  52093. * @readonly
  52094. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  52095. */
  52096. this.keystrokes = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["KeystrokeHandler"]();
  52097. /**
  52098. * Keeps the value of the command associated with the table for the current selection.
  52099. *
  52100. * @type {String}
  52101. */
  52102. this.set( 'selectedColor' );
  52103. /**
  52104. * The label of the button responsible for removing color attributes.
  52105. *
  52106. * @type {String}
  52107. */
  52108. this.removeButtonLabel = removeButtonLabel;
  52109. /**
  52110. * The number of columns in the color grid.
  52111. *
  52112. * @type {Number}
  52113. */
  52114. this.columns = columns;
  52115. /**
  52116. * A collection of definitions that store the document colors.
  52117. *
  52118. * @readonly
  52119. * @member {module:font/documentcolorcollection~DocumentColorCollection}
  52120. */
  52121. this.documentColors = new _documentcolorcollection__WEBPACK_IMPORTED_MODULE_3__["default"]();
  52122. /**
  52123. * The maximum number of colors in the document colors section.
  52124. * If it equals 0, the document colors section is not added.
  52125. *
  52126. * @readonly
  52127. * @type {Number}
  52128. */
  52129. this.documentColorsCount = documentColorsCount;
  52130. /**
  52131. * Preserves the reference to {@link module:ui/colorgrid/colorgrid~ColorGridView} used to create
  52132. * the default (static) color set.
  52133. *
  52134. * The property is loaded once the the parent dropdown is opened the first time.
  52135. *
  52136. * @readonly
  52137. * @member {module:ui/colorgrid/colorgrid~ColorGridView|undefined} #staticColorsGrid
  52138. */
  52139. /**
  52140. * Preserves the reference to {@link module:ui/colorgrid/colorgrid~ColorGridView} used to create
  52141. * the document colors. It remains undefined if the document colors feature is disabled.
  52142. *
  52143. * The property is loaded once the the parent dropdown is opened the first time.
  52144. *
  52145. * @readonly
  52146. * @member {module:ui/colorgrid/colorgrid~ColorGridView|undefined} #documentColorsGrid
  52147. */
  52148. /**
  52149. * Helps cycling over focusable {@link #items} in the list.
  52150. *
  52151. * @readonly
  52152. * @protected
  52153. * @member {module:ui/focuscycler~FocusCycler}
  52154. */
  52155. this._focusCycler = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["FocusCycler"]( {
  52156. focusables: this.items,
  52157. focusTracker: this.focusTracker,
  52158. keystrokeHandler: this.keystrokes,
  52159. actions: {
  52160. // Navigate list items backwards using the Arrow Up key.
  52161. focusPrevious: 'arrowup',
  52162. // Navigate list items forwards using the Arrow Down key.
  52163. focusNext: 'arrowdown'
  52164. }
  52165. } );
  52166. /**
  52167. * Document color section's label.
  52168. *
  52169. * @private
  52170. * @readonly
  52171. * @type {String}
  52172. */
  52173. this._documentColorsLabel = documentColorsLabel;
  52174. this.setTemplate( {
  52175. tag: 'div',
  52176. attributes: {
  52177. class: [
  52178. 'ck',
  52179. 'ck-color-table'
  52180. ]
  52181. },
  52182. children: this.items
  52183. } );
  52184. this.items.add( this._removeColorButton() );
  52185. }
  52186. /**
  52187. * Scans through the editor model and searches for text node attributes with the given attribute name.
  52188. * Found entries are set as document colors.
  52189. *
  52190. * All the previously stored document colors will be lost in the process.
  52191. *
  52192. * @param {module:engine/model/model~Model} model The model used as a source to obtain the document colors.
  52193. * @param {String} attributeName Determines the name of the related model's attribute for a given dropdown.
  52194. */
  52195. updateDocumentColors( model, attributeName ) {
  52196. const document = model.document;
  52197. const maxCount = this.documentColorsCount;
  52198. this.documentColors.clear();
  52199. for ( const rootName of document.getRootNames() ) {
  52200. const root = document.getRoot( rootName );
  52201. const range = model.createRangeIn( root );
  52202. for ( const node of range.getItems() ) {
  52203. if ( node.is( '$textProxy' ) && node.hasAttribute( attributeName ) ) {
  52204. this._addColorToDocumentColors( node.getAttribute( attributeName ) );
  52205. if ( this.documentColors.length >= maxCount ) {
  52206. return;
  52207. }
  52208. }
  52209. }
  52210. }
  52211. }
  52212. /**
  52213. * Refreshes the state of the selected color in one or both {@link module:ui/colorgrid/colorgrid~ColorGridView}s
  52214. * available in the {@link module:font/ui/colortableview~ColorTableView}. It guarantees that the selection will occur only in one
  52215. * of them.
  52216. */
  52217. updateSelectedColors() {
  52218. const documentColorsGrid = this.documentColorsGrid;
  52219. const staticColorsGrid = this.staticColorsGrid;
  52220. const selectedColor = this.selectedColor;
  52221. staticColorsGrid.selectedColor = selectedColor;
  52222. if ( documentColorsGrid ) {
  52223. documentColorsGrid.selectedColor = selectedColor;
  52224. }
  52225. }
  52226. /**
  52227. * @inheritDoc
  52228. */
  52229. render() {
  52230. super.render();
  52231. // Items added before rendering should be known to the #focusTracker.
  52232. for ( const item of this.items ) {
  52233. this.focusTracker.add( item.element );
  52234. }
  52235. // Start listening for the keystrokes coming from #element.
  52236. this.keystrokes.listenTo( this.element );
  52237. }
  52238. /**
  52239. * @inheritDoc
  52240. */
  52241. destroy() {
  52242. super.destroy();
  52243. this.focusTracker.destroy();
  52244. this.keystrokes.destroy();
  52245. }
  52246. /**
  52247. * Appends {@link #staticColorsGrid} and {@link #documentColorsGrid} views.
  52248. */
  52249. appendGrids() {
  52250. if ( this.staticColorsGrid ) {
  52251. return;
  52252. }
  52253. this.staticColorsGrid = this._createStaticColorsGrid();
  52254. this.items.add( this.staticColorsGrid );
  52255. if ( this.documentColorsCount ) {
  52256. // Create a label for document colors.
  52257. const bind = ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Template"].bind( this.documentColors, this.documentColors );
  52258. const label = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["LabelView"]( this.locale );
  52259. label.text = this._documentColorsLabel;
  52260. label.extendTemplate( {
  52261. attributes: {
  52262. class: [
  52263. 'ck',
  52264. 'ck-color-grid__label',
  52265. bind.if( 'isEmpty', 'ck-hidden' )
  52266. ]
  52267. }
  52268. } );
  52269. this.items.add( label );
  52270. this.documentColorsGrid = this._createDocumentColorsGrid();
  52271. this.items.add( this.documentColorsGrid );
  52272. }
  52273. }
  52274. /**
  52275. * Focuses the first focusable element in {@link #items}.
  52276. */
  52277. focus() {
  52278. this._focusCycler.focusFirst();
  52279. }
  52280. /**
  52281. * Focuses the last focusable element in {@link #items}.
  52282. */
  52283. focusLast() {
  52284. this._focusCycler.focusLast();
  52285. }
  52286. /**
  52287. * Adds the remove color button as a child of the current view.
  52288. *
  52289. * @private
  52290. * @returns {module:ui/button/buttonview~ButtonView}
  52291. */
  52292. _removeColorButton() {
  52293. const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]();
  52294. buttonView.set( {
  52295. withText: true,
  52296. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].eraser,
  52297. tooltip: true,
  52298. label: this.removeButtonLabel
  52299. } );
  52300. buttonView.class = 'ck-color-table__remove-color';
  52301. buttonView.on( 'execute', () => {
  52302. this.fire( 'execute', { value: null } );
  52303. } );
  52304. return buttonView;
  52305. }
  52306. /**
  52307. * Creates a static color table grid based on the editor configuration.
  52308. *
  52309. * @private
  52310. * @returns {module:ui/colorgrid/colorgrid~ColorGridView}
  52311. */
  52312. _createStaticColorsGrid() {
  52313. const colorGrid = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ColorGridView"]( this.locale, {
  52314. colorDefinitions: this.colorDefinitions,
  52315. columns: this.columns
  52316. } );
  52317. colorGrid.delegate( 'execute' ).to( this );
  52318. return colorGrid;
  52319. }
  52320. /**
  52321. * Creates the document colors section view and binds it to {@link #documentColors}.
  52322. *
  52323. * @private
  52324. * @returns {module:ui/colorgrid/colorgrid~ColorGridView}
  52325. */
  52326. _createDocumentColorsGrid() {
  52327. const bind = ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Template"].bind( this.documentColors, this.documentColors );
  52328. const documentColorsGrid = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ColorGridView"]( this.locale, {
  52329. columns: this.columns
  52330. } );
  52331. documentColorsGrid.delegate( 'execute' ).to( this );
  52332. documentColorsGrid.extendTemplate( {
  52333. attributes: {
  52334. class: bind.if( 'isEmpty', 'ck-hidden' )
  52335. }
  52336. } );
  52337. documentColorsGrid.items.bindTo( this.documentColors ).using(
  52338. colorObj => {
  52339. const colorTile = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ColorTileView"]();
  52340. colorTile.set( {
  52341. color: colorObj.color,
  52342. hasBorder: colorObj.options && colorObj.options.hasBorder
  52343. } );
  52344. if ( colorObj.label ) {
  52345. colorTile.set( {
  52346. label: colorObj.label,
  52347. tooltip: true
  52348. } );
  52349. }
  52350. colorTile.on( 'execute', () => {
  52351. this.fire( 'execute', {
  52352. value: colorObj.color
  52353. } );
  52354. } );
  52355. return colorTile;
  52356. }
  52357. );
  52358. // Selected color should be cleared when document colors became empty.
  52359. this.documentColors.on( 'change:isEmpty', ( evt, name, val ) => {
  52360. if ( val ) {
  52361. documentColorsGrid.selectedColor = null;
  52362. }
  52363. } );
  52364. return documentColorsGrid;
  52365. }
  52366. /**
  52367. * Adds a given color to the document colors list. If possible, the method will attempt to use
  52368. * data from the {@link #colorDefinitions} (label, color options).
  52369. *
  52370. * @private
  52371. * @param {String} color A string that stores the value of the recently applied color.
  52372. */
  52373. _addColorToDocumentColors( color ) {
  52374. const predefinedColor = this.colorDefinitions
  52375. .find( definition => definition.color === color );
  52376. if ( !predefinedColor ) {
  52377. this.documentColors.add( {
  52378. color,
  52379. label: color,
  52380. options: {
  52381. hasBorder: false
  52382. }
  52383. } );
  52384. } else {
  52385. this.documentColors.add( Object.assign( {}, predefinedColor ) );
  52386. }
  52387. }
  52388. }
  52389. /***/ }),
  52390. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js":
  52391. /*!*****************************************************************!*\
  52392. !*** ./node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js ***!
  52393. \*****************************************************************/
  52394. /*! exports provided: default */
  52395. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52396. "use strict";
  52397. __webpack_require__.r(__webpack_exports__);
  52398. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ColorUI; });
  52399. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  52400. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  52401. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  52402. /**
  52403. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  52404. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52405. */
  52406. /**
  52407. * @module font/ui/colorui
  52408. */
  52409. /**
  52410. * The color UI plugin which isolates the common logic responsible for displaying dropdowns with color grids.
  52411. *
  52412. * It is used to create the `'fontBackgroundColor'` and `'fontColor'` dropdowns, each hosting
  52413. * a {@link module:font/ui/colortableview~ColorTableView}.
  52414. *
  52415. * @extends module:core/plugin~Plugin
  52416. */
  52417. class ColorUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  52418. /**
  52419. * Creates a plugin which introduces a dropdown with a pre–configured {@link module:font/ui/colortableview~ColorTableView}.
  52420. *
  52421. * @param {module:core/editor/editor~Editor} editor
  52422. * @param {Object} config The configuration object.
  52423. * @param {String} config.commandName The name of the command which will be executed when a color tile is clicked.
  52424. * @param {String} config.componentName The name of the dropdown in the {@link module:ui/componentfactory~ComponentFactory}
  52425. * and the configuration scope name in `editor.config`.
  52426. * @param {String} config.icon The SVG icon used by the dropdown.
  52427. * @param {String} config.dropdownLabel The label used by the dropdown.
  52428. */
  52429. constructor( editor, { commandName, icon, componentName, dropdownLabel } ) {
  52430. super( editor );
  52431. /**
  52432. * The name of the command which will be executed when a color tile is clicked.
  52433. *
  52434. * @type {String}
  52435. */
  52436. this.commandName = commandName;
  52437. /**
  52438. * The name of this component in the {@link module:ui/componentfactory~ComponentFactory}.
  52439. * Also the configuration scope name in `editor.config`.
  52440. *
  52441. * @type {String}
  52442. */
  52443. this.componentName = componentName;
  52444. /**
  52445. * The SVG icon used by the dropdown.
  52446. * @type {String}
  52447. */
  52448. this.icon = icon;
  52449. /**
  52450. * The label used by the dropdown.
  52451. *
  52452. * @type {String}
  52453. */
  52454. this.dropdownLabel = dropdownLabel;
  52455. /**
  52456. * The number of columns in the color grid.
  52457. *
  52458. * @type {Number}
  52459. */
  52460. this.columns = editor.config.get( `${ this.componentName }.columns` );
  52461. /**
  52462. * Keeps a reference to {@link module:font/ui/colortableview~ColorTableView}.
  52463. *
  52464. * @member {module:font/ui/colortableview~ColorTableView}
  52465. */
  52466. this.colorTableView = undefined;
  52467. }
  52468. /**
  52469. * @inheritDoc
  52470. */
  52471. init() {
  52472. const editor = this.editor;
  52473. const locale = editor.locale;
  52474. const t = locale.t;
  52475. const command = editor.commands.get( this.commandName );
  52476. const colorsConfig = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["normalizeColorOptions"])( editor.config.get( this.componentName ).colors );
  52477. const localizedColors = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["getLocalizedColorOptions"])( locale, colorsConfig );
  52478. const documentColorsCount = editor.config.get( `${ this.componentName }.documentColors` );
  52479. // Register the UI component.
  52480. editor.ui.componentFactory.add( this.componentName, locale => {
  52481. const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
  52482. this.colorTableView = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["addColorTableToDropdown"])( {
  52483. dropdownView,
  52484. colors: localizedColors.map( option => ( {
  52485. label: option.label,
  52486. color: option.model,
  52487. options: {
  52488. hasBorder: option.hasBorder
  52489. }
  52490. } ) ),
  52491. columns: this.columns,
  52492. removeButtonLabel: t( 'Remove color' ),
  52493. documentColorsLabel: documentColorsCount !== 0 ? t( 'Document colors' ) : undefined,
  52494. documentColorsCount: documentColorsCount === undefined ? this.columns : documentColorsCount
  52495. } );
  52496. this.colorTableView.bind( 'selectedColor' ).to( command, 'value' );
  52497. dropdownView.buttonView.set( {
  52498. label: this.dropdownLabel,
  52499. icon: this.icon,
  52500. tooltip: true
  52501. } );
  52502. dropdownView.extendTemplate( {
  52503. attributes: {
  52504. class: 'ck-color-ui-dropdown'
  52505. }
  52506. } );
  52507. dropdownView.bind( 'isEnabled' ).to( command );
  52508. dropdownView.on( 'execute', ( evt, data ) => {
  52509. editor.execute( this.commandName, data );
  52510. editor.editing.view.focus();
  52511. } );
  52512. dropdownView.on( 'change:isOpen', ( evt, name, isVisible ) => {
  52513. // Grids rendering is deferred (#6192).
  52514. dropdownView.colorTableView.appendGrids();
  52515. if ( isVisible ) {
  52516. if ( documentColorsCount !== 0 ) {
  52517. this.colorTableView.updateDocumentColors( editor.model, this.componentName );
  52518. }
  52519. this.colorTableView.updateSelectedColors();
  52520. }
  52521. } );
  52522. return dropdownView;
  52523. } );
  52524. }
  52525. }
  52526. /***/ }),
  52527. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js":
  52528. /*!************************************************************!*\
  52529. !*** ./node_modules/@ckeditor/ckeditor5-font/src/utils.js ***!
  52530. \************************************************************/
  52531. /*! exports provided: FONT_SIZE, FONT_FAMILY, FONT_COLOR, FONT_BACKGROUND_COLOR, buildDefinition, renderUpcastAttribute, renderDowncastElement, addColorTableToDropdown */
  52532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52533. "use strict";
  52534. __webpack_require__.r(__webpack_exports__);
  52535. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FONT_SIZE", function() { return FONT_SIZE; });
  52536. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FONT_FAMILY", function() { return FONT_FAMILY; });
  52537. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FONT_COLOR", function() { return FONT_COLOR; });
  52538. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FONT_BACKGROUND_COLOR", function() { return FONT_BACKGROUND_COLOR; });
  52539. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildDefinition", function() { return buildDefinition; });
  52540. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderUpcastAttribute", function() { return renderUpcastAttribute; });
  52541. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderDowncastElement", function() { return renderDowncastElement; });
  52542. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addColorTableToDropdown", function() { return addColorTableToDropdown; });
  52543. /* harmony import */ var _ui_colortableview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ui/colortableview */ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colortableview.js");
  52544. /**
  52545. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  52546. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52547. */
  52548. /**
  52549. * @module font/utils
  52550. */
  52551. /**
  52552. * The name of the font size plugin.
  52553. */
  52554. const FONT_SIZE = 'fontSize';
  52555. /**
  52556. * The name of the font family plugin.
  52557. */
  52558. const FONT_FAMILY = 'fontFamily';
  52559. /**
  52560. * The name of the font color plugin.
  52561. */
  52562. const FONT_COLOR = 'fontColor';
  52563. /**
  52564. * The name of the font background color plugin.
  52565. */
  52566. const FONT_BACKGROUND_COLOR = 'fontBackgroundColor';
  52567. /**
  52568. * Builds a proper {@link module:engine/conversion/conversion~ConverterDefinition converter definition} out of input data.
  52569. *
  52570. * @param {String} modelAttributeKey Key
  52571. * @param {Array.<module:font/fontfamily~FontFamilyOption>|Array.<module:font/fontsize~FontSizeOption>} options
  52572. * @returns {module:engine/conversion/conversion~ConverterDefinition}
  52573. */
  52574. function buildDefinition( modelAttributeKey, options ) {
  52575. const definition = {
  52576. model: {
  52577. key: modelAttributeKey,
  52578. values: []
  52579. },
  52580. view: {},
  52581. upcastAlso: {}
  52582. };
  52583. for ( const option of options ) {
  52584. definition.model.values.push( option.model );
  52585. definition.view[ option.model ] = option.view;
  52586. if ( option.upcastAlso ) {
  52587. definition.upcastAlso[ option.model ] = option.upcastAlso;
  52588. }
  52589. }
  52590. return definition;
  52591. }
  52592. /**
  52593. * A {@link module:font/fontcolor~FontColor font color} and
  52594. * {@link module:font/fontbackgroundcolor~FontBackgroundColor font background color} helper
  52595. * responsible for upcasting data to the model.
  52596. *
  52597. * **Note**: The `styleAttr` parameter should be either `'color'` or `'background-color'`.
  52598. *
  52599. * @param {String} styleAttr
  52600. * @return {String}
  52601. */
  52602. function renderUpcastAttribute( styleAttr ) {
  52603. return viewElement => normalizeColorCode( viewElement.getStyle( styleAttr ) );
  52604. }
  52605. /**
  52606. * A {@link module:font/fontcolor~FontColor font color} and
  52607. * {@link module:font/fontbackgroundcolor~FontBackgroundColor font background color} helper
  52608. * responsible for downcasting a color attribute to a `<span>` element.
  52609. *
  52610. * **Note**: The `styleAttr` parameter should be either `'color'` or `'background-color'`.
  52611. *
  52612. * @param {String} styleAttr
  52613. */
  52614. function renderDowncastElement( styleAttr ) {
  52615. return ( modelAttributeValue, { writer } ) => writer.createAttributeElement( 'span', {
  52616. style: `${ styleAttr }:${ modelAttributeValue }`
  52617. }, { priority: 7 } );
  52618. }
  52619. /**
  52620. * A helper that adds {@link module:font/ui/colortableview~ColorTableView} to the color dropdown with proper initial values.
  52621. *
  52622. * @param {Object} config The configuration object.
  52623. * @param {module:ui/dropdown/dropdownview~DropdownView} config.dropdownView The dropdown view to which
  52624. * a {@link module:font/ui/colortableview~ColorTableView} will be added.
  52625. * @param {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>} config.colors An array with definitions
  52626. * representing colors to be displayed in the color table.
  52627. * @param {String} config.removeButtonLabel The label for the button responsible for removing the color.
  52628. * @param {String} config.documentColorsLabel The label for the section with document colors.
  52629. * @param {String} config.documentColorsCount The number of document colors inside the dropdown.
  52630. * @returns {module:font/ui/colortableview~ColorTableView} The new color table view.
  52631. */
  52632. function addColorTableToDropdown( { dropdownView, colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount } ) {
  52633. const locale = dropdownView.locale;
  52634. const colorTableView = new _ui_colortableview__WEBPACK_IMPORTED_MODULE_0__["default"]( locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount } );
  52635. dropdownView.colorTableView = colorTableView;
  52636. dropdownView.panelView.children.add( colorTableView );
  52637. colorTableView.delegate( 'execute' ).to( dropdownView, 'execute' );
  52638. return colorTableView;
  52639. }
  52640. // Fixes the color value string.
  52641. //
  52642. // @param {String} value
  52643. // @returns {String}
  52644. function normalizeColorCode( value ) {
  52645. return value.replace( /\s/g, '' );
  52646. }
  52647. /***/ }),
  52648. /***/ "./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css":
  52649. /*!*******************************************************************!*\
  52650. !*** ./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css ***!
  52651. \*******************************************************************/
  52652. /*! exports provided: default */
  52653. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52654. "use strict";
  52655. __webpack_require__.r(__webpack_exports__);
  52656. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  52657. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  52658. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_fontcolor_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./fontcolor.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css");
  52659. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  52660. options.insert = "head";
  52661. options.singleton = true;
  52662. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_fontcolor_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  52663. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_fontcolor_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  52664. /***/ }),
  52665. /***/ "./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-background.svg":
  52666. /*!*******************************************************************************!*\
  52667. !*** ./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-background.svg ***!
  52668. \*******************************************************************************/
  52669. /*! exports provided: default */
  52670. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52671. "use strict";
  52672. __webpack_require__.r(__webpack_exports__);
  52673. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M4 2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8.38 9.262H7.62L10 5.506l2.38 5.756zm.532 1.285L14.34 16h1.426L10.804 4H9.196L4.234 16H5.66l1.428-3.453h5.824z\"/></svg>");
  52674. /***/ }),
  52675. /***/ "./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-color.svg":
  52676. /*!**************************************************************************!*\
  52677. !*** ./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-color.svg ***!
  52678. \**************************************************************************/
  52679. /*! exports provided: default */
  52680. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52681. "use strict";
  52682. __webpack_require__.r(__webpack_exports__);
  52683. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.4 10.3 10 4.5l-2.4 5.8h4.8zm.5 1.2H7.1L5.7 15H4.2l5-12h1.6l5 12h-1.5L13 11.5zm3.1 7H4a1 1 0 0 1 0-2h12a1 1 0 0 1 0 2z\"/></svg>");
  52684. /***/ }),
  52685. /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/heading.js":
  52686. /*!*****************************************************************!*\
  52687. !*** ./node_modules/@ckeditor/ckeditor5-heading/src/heading.js ***!
  52688. \*****************************************************************/
  52689. /*! exports provided: default */
  52690. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52691. "use strict";
  52692. __webpack_require__.r(__webpack_exports__);
  52693. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Heading; });
  52694. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  52695. /* harmony import */ var _headingediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./headingediting */ "./node_modules/@ckeditor/ckeditor5-heading/src/headingediting.js");
  52696. /* harmony import */ var _headingui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./headingui */ "./node_modules/@ckeditor/ckeditor5-heading/src/headingui.js");
  52697. /* harmony import */ var _theme_heading_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/heading.css */ "./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css");
  52698. /**
  52699. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  52700. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52701. */
  52702. /**
  52703. * @module heading/heading
  52704. */
  52705. /**
  52706. * The headings feature.
  52707. *
  52708. * For a detailed overview, check the {@glink features/headings Headings feature documentation}
  52709. * and the {@glink api/heading package page}.
  52710. *
  52711. * This is a "glue" plugin which loads the {@link module:heading/headingediting~HeadingEditing heading editing feature}
  52712. * and {@link module:heading/headingui~HeadingUI heading UI feature}.
  52713. *
  52714. * @extends module:core/plugin~Plugin
  52715. */
  52716. class Heading extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  52717. /**
  52718. * @inheritDoc
  52719. */
  52720. static get requires() {
  52721. return [ _headingediting__WEBPACK_IMPORTED_MODULE_1__["default"], _headingui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  52722. }
  52723. /**
  52724. * @inheritDoc
  52725. */
  52726. static get pluginName() {
  52727. return 'Heading';
  52728. }
  52729. }
  52730. /**
  52731. * The configuration of the heading feature. Introduced by the {@link module:heading/headingediting~HeadingEditing} feature.
  52732. *
  52733. * Read more in {@link module:heading/heading~HeadingConfig}.
  52734. *
  52735. * @member {module:heading/heading~HeadingConfig} module:core/editor/editorconfig~EditorConfig#heading
  52736. */
  52737. /**
  52738. * The configuration of the heading feature.
  52739. * The option is used by the {@link module:heading/headingediting~HeadingEditing} feature.
  52740. *
  52741. * ClassicEditor
  52742. * .create( {
  52743. * heading: ... // Heading feature config.
  52744. * } )
  52745. * .then( ... )
  52746. * .catch( ... );
  52747. *
  52748. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  52749. *
  52750. * @interface HeadingConfig
  52751. */
  52752. /**
  52753. * The available heading options.
  52754. *
  52755. * The default value is:
  52756. *
  52757. * const headingConfig = {
  52758. * options: [
  52759. * { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
  52760. * { model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
  52761. * { model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
  52762. * { model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' }
  52763. * ]
  52764. * };
  52765. *
  52766. * It defines 3 levels of headings. In the editor model they will use `heading1`, `heading2`, and `heading3` elements.
  52767. * Their respective view elements (so the elements output by the editor) will be: `h2`, `h3`, and `h4`. This means that
  52768. * if you choose "Heading 1" in the headings dropdown the editor will turn the current block to `<heading1>` in the model
  52769. * which will result in rendering (and outputting to data) the `<h2>` element.
  52770. *
  52771. * The `title` and `class` properties will be used by the `headings` dropdown to render available options.
  52772. * Usually, the first option in the headings dropdown is the "Paragraph" option, hence it's also defined on the list.
  52773. * However, you don't need to define its view representation because it's handled by
  52774. * the {@link module:paragraph/paragraph~Paragraph} feature (which is required by
  52775. * the {@link module:heading/headingediting~HeadingEditing} feature).
  52776. *
  52777. * You can **read more** about configuring heading levels and **see more examples** in
  52778. * the {@glink features/headings Headings} guide.
  52779. *
  52780. * Note: In the model you should always start from `heading1`, regardless of how the headings are represented in the view.
  52781. * That's assumption is used by features like {@link module:autoformat/autoformat~Autoformat} to know which element
  52782. * they should use when applying the first level heading.
  52783. *
  52784. * The defined headings are also available as values passed to the `'heading'` command under their model names.
  52785. * For example, the below code will apply `<heading1>` to the current selection:
  52786. *
  52787. * editor.execute( 'heading', { value: 'heading1' } );
  52788. *
  52789. * @member {Array.<module:heading/heading~HeadingOption>} module:heading/heading~HeadingConfig#options
  52790. */
  52791. /**
  52792. * Heading option descriptor.
  52793. *
  52794. * @typedef {Object} module:heading/heading~HeadingOption
  52795. * @property {String} model Name of the model element to convert.
  52796. * @property {module:engine/view/elementdefinition~ElementDefinition} view Definition of a view element to convert from/to.
  52797. * @property {String} title The user-readable title of the option.
  52798. * @property {String} class The class which will be added to the dropdown item representing this option.
  52799. * @property {String} [icon] Icon used by {@link module:heading/headingbuttonsui~HeadingButtonsUI}. It can be omitted when using
  52800. * the default configuration.
  52801. * @extends module:engine/conversion/conversion~ConverterDefinition
  52802. */
  52803. /***/ }),
  52804. /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/headingcommand.js":
  52805. /*!************************************************************************!*\
  52806. !*** ./node_modules/@ckeditor/ckeditor5-heading/src/headingcommand.js ***!
  52807. \************************************************************************/
  52808. /*! exports provided: default */
  52809. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52810. "use strict";
  52811. __webpack_require__.r(__webpack_exports__);
  52812. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HeadingCommand; });
  52813. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  52814. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  52815. /**
  52816. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  52817. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52818. */
  52819. /**
  52820. * @module heading/headingcommand
  52821. */
  52822. /**
  52823. * The heading command. It is used by the {@link module:heading/heading~Heading heading feature} to apply headings.
  52824. *
  52825. * @extends module:core/command~Command
  52826. */
  52827. class HeadingCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  52828. /**
  52829. * Creates an instance of the command.
  52830. *
  52831. * @param {module:core/editor/editor~Editor} editor Editor instance.
  52832. * @param {Array.<String>} modelElements Names of the element which this command can apply in the model.
  52833. */
  52834. constructor( editor, modelElements ) {
  52835. super( editor );
  52836. /**
  52837. * If the selection starts in a heading (which {@link #modelElements is supported by this command})
  52838. * the value is set to the name of that heading model element.
  52839. * It is set to `false` otherwise.
  52840. *
  52841. * @observable
  52842. * @readonly
  52843. * @member {Boolean|String} #value
  52844. */
  52845. /**
  52846. * Set of defined model's elements names that this command support.
  52847. * See {@link module:heading/heading~HeadingOption}.
  52848. *
  52849. * @readonly
  52850. * @member {Array.<String>}
  52851. */
  52852. this.modelElements = modelElements;
  52853. }
  52854. /**
  52855. * @inheritDoc
  52856. */
  52857. refresh() {
  52858. const block = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this.editor.model.document.selection.getSelectedBlocks() );
  52859. this.value = !!block && this.modelElements.includes( block.name ) && block.name;
  52860. this.isEnabled = !!block && this.modelElements.some( heading => checkCanBecomeHeading( block, heading, this.editor.model.schema ) );
  52861. }
  52862. /**
  52863. * Executes the command. Applies the heading to the selected blocks or, if the first selected
  52864. * block is a heading already, turns selected headings (of this level only) to paragraphs.
  52865. *
  52866. * @param {Object} options
  52867. * @param {String} options.value Name of the element which this command will apply in the model.
  52868. * @fires execute
  52869. */
  52870. execute( options ) {
  52871. const model = this.editor.model;
  52872. const document = model.document;
  52873. const modelElement = options.value;
  52874. model.change( writer => {
  52875. const blocks = Array.from( document.selection.getSelectedBlocks() )
  52876. .filter( block => {
  52877. return checkCanBecomeHeading( block, modelElement, model.schema );
  52878. } );
  52879. for ( const block of blocks ) {
  52880. if ( !block.is( 'element', modelElement ) ) {
  52881. writer.rename( block, modelElement );
  52882. }
  52883. }
  52884. } );
  52885. }
  52886. }
  52887. // Checks whether the given block can be replaced by a specific heading.
  52888. //
  52889. // @private
  52890. // @param {module:engine/model/element~Element} block A block to be tested.
  52891. // @param {module:heading/headingcommand~HeadingCommand#modelElement} heading Command element name in the model.
  52892. // @param {module:engine/model/schema~Schema} schema The schema of the document.
  52893. // @returns {Boolean}
  52894. function checkCanBecomeHeading( block, heading, schema ) {
  52895. return schema.checkChild( block.parent, heading ) && !schema.isObject( block );
  52896. }
  52897. /***/ }),
  52898. /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/headingediting.js":
  52899. /*!************************************************************************!*\
  52900. !*** ./node_modules/@ckeditor/ckeditor5-heading/src/headingediting.js ***!
  52901. \************************************************************************/
  52902. /*! exports provided: default */
  52903. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52904. "use strict";
  52905. __webpack_require__.r(__webpack_exports__);
  52906. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HeadingEditing; });
  52907. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  52908. /* harmony import */ var ckeditor5_src_paragraph__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/paragraph */ "./node_modules/ckeditor5/src/paragraph.js");
  52909. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  52910. /* harmony import */ var _headingcommand__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./headingcommand */ "./node_modules/@ckeditor/ckeditor5-heading/src/headingcommand.js");
  52911. /**
  52912. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  52913. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52914. */
  52915. /**
  52916. * @module heading/headingediting
  52917. */
  52918. const defaultModelElement = 'paragraph';
  52919. /**
  52920. * The headings engine feature. It handles switching between block formats &ndash; headings and paragraph.
  52921. * This class represents the engine part of the heading feature. See also {@link module:heading/heading~Heading}.
  52922. * It introduces `heading1`-`headingN` commands which allow to convert paragraphs into headings.
  52923. *
  52924. * @extends module:core/plugin~Plugin
  52925. */
  52926. class HeadingEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  52927. /**
  52928. * @inheritDoc
  52929. */
  52930. static get pluginName() {
  52931. return 'HeadingEditing';
  52932. }
  52933. /**
  52934. * @inheritDoc
  52935. */
  52936. constructor( editor ) {
  52937. super( editor );
  52938. editor.config.define( 'heading', {
  52939. options: [
  52940. { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
  52941. { model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
  52942. { model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
  52943. { model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' }
  52944. ]
  52945. } );
  52946. }
  52947. /**
  52948. * @inheritDoc
  52949. */
  52950. static get requires() {
  52951. return [ ckeditor5_src_paragraph__WEBPACK_IMPORTED_MODULE_1__["Paragraph"] ];
  52952. }
  52953. /**
  52954. * @inheritDoc
  52955. */
  52956. init() {
  52957. const editor = this.editor;
  52958. const options = editor.config.get( 'heading.options' );
  52959. const modelElements = [];
  52960. for ( const option of options ) {
  52961. // Skip paragraph - it is defined in required Paragraph feature.
  52962. if ( option.model !== defaultModelElement ) {
  52963. // Schema.
  52964. editor.model.schema.register( option.model, {
  52965. inheritAllFrom: '$block'
  52966. } );
  52967. editor.conversion.elementToElement( option );
  52968. modelElements.push( option.model );
  52969. }
  52970. }
  52971. this._addDefaultH1Conversion( editor );
  52972. // Register the heading command for this option.
  52973. editor.commands.add( 'heading', new _headingcommand__WEBPACK_IMPORTED_MODULE_3__["default"]( editor, modelElements ) );
  52974. }
  52975. /**
  52976. * @inheritDoc
  52977. */
  52978. afterInit() {
  52979. // If the enter command is added to the editor, alter its behavior.
  52980. // Enter at the end of a heading element should create a paragraph.
  52981. const editor = this.editor;
  52982. const enterCommand = editor.commands.get( 'enter' );
  52983. const options = editor.config.get( 'heading.options' );
  52984. if ( enterCommand ) {
  52985. this.listenTo( enterCommand, 'afterExecute', ( evt, data ) => {
  52986. const positionParent = editor.model.document.selection.getFirstPosition().parent;
  52987. const isHeading = options.some( option => positionParent.is( 'element', option.model ) );
  52988. if ( isHeading && !positionParent.is( 'element', defaultModelElement ) && positionParent.childCount === 0 ) {
  52989. data.writer.rename( positionParent, defaultModelElement );
  52990. }
  52991. } );
  52992. }
  52993. }
  52994. /**
  52995. * Adds default conversion for `h1` -> `heading1` with a low priority.
  52996. *
  52997. * @private
  52998. * @param {module:core/editor/editor~Editor} editor Editor instance on which to add the `h1` conversion.
  52999. */
  53000. _addDefaultH1Conversion( editor ) {
  53001. editor.conversion.for( 'upcast' ).elementToElement( {
  53002. model: 'heading1',
  53003. view: 'h1',
  53004. // With a `low` priority, `paragraph` plugin autoparagraphing mechanism is executed. Make sure
  53005. // this listener is called before it. If not, `h1` will be transformed into a paragraph.
  53006. converterPriority: ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["priorities"].get( 'low' ) + 1
  53007. } );
  53008. }
  53009. }
  53010. /***/ }),
  53011. /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/headingui.js":
  53012. /*!*******************************************************************!*\
  53013. !*** ./node_modules/@ckeditor/ckeditor5-heading/src/headingui.js ***!
  53014. \*******************************************************************/
  53015. /*! exports provided: default */
  53016. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53017. "use strict";
  53018. __webpack_require__.r(__webpack_exports__);
  53019. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HeadingUI; });
  53020. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  53021. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  53022. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  53023. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-heading/src/utils.js");
  53024. /* harmony import */ var _theme_heading_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../theme/heading.css */ "./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css");
  53025. /**
  53026. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  53027. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53028. */
  53029. /**
  53030. * @module heading/headingui
  53031. */
  53032. /**
  53033. * The headings UI feature. It introduces the `headings` dropdown.
  53034. *
  53035. * @extends module:core/plugin~Plugin
  53036. */
  53037. class HeadingUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  53038. /**
  53039. * @inheritDoc
  53040. */
  53041. static get pluginName() {
  53042. return 'HeadingUI';
  53043. }
  53044. /**
  53045. * @inheritDoc
  53046. */
  53047. init() {
  53048. const editor = this.editor;
  53049. const t = editor.t;
  53050. const options = Object(_utils__WEBPACK_IMPORTED_MODULE_3__["getLocalizedOptions"])( editor );
  53051. const defaultTitle = t( 'Choose heading' );
  53052. const dropdownTooltip = t( 'Heading' );
  53053. // Register UI component.
  53054. editor.ui.componentFactory.add( 'heading', locale => {
  53055. const titles = {};
  53056. const itemDefinitions = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["Collection"]();
  53057. const headingCommand = editor.commands.get( 'heading' );
  53058. const paragraphCommand = editor.commands.get( 'paragraph' );
  53059. const commands = [ headingCommand ];
  53060. for ( const option of options ) {
  53061. const def = {
  53062. type: 'button',
  53063. model: new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Model"]( {
  53064. label: option.title,
  53065. class: option.class,
  53066. withText: true
  53067. } )
  53068. };
  53069. if ( option.model === 'paragraph' ) {
  53070. def.model.bind( 'isOn' ).to( paragraphCommand, 'value' );
  53071. def.model.set( 'commandName', 'paragraph' );
  53072. commands.push( paragraphCommand );
  53073. } else {
  53074. def.model.bind( 'isOn' ).to( headingCommand, 'value', value => value === option.model );
  53075. def.model.set( {
  53076. commandName: 'heading',
  53077. commandValue: option.model
  53078. } );
  53079. }
  53080. // Add the option to the collection.
  53081. itemDefinitions.add( def );
  53082. titles[ option.model ] = option.title;
  53083. }
  53084. const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
  53085. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["addListToDropdown"])( dropdownView, itemDefinitions );
  53086. dropdownView.buttonView.set( {
  53087. isOn: false,
  53088. withText: true,
  53089. tooltip: dropdownTooltip
  53090. } );
  53091. dropdownView.extendTemplate( {
  53092. attributes: {
  53093. class: [
  53094. 'ck-heading-dropdown'
  53095. ]
  53096. }
  53097. } );
  53098. dropdownView.bind( 'isEnabled' ).toMany( commands, 'isEnabled', ( ...areEnabled ) => {
  53099. return areEnabled.some( isEnabled => isEnabled );
  53100. } );
  53101. dropdownView.buttonView.bind( 'label' ).to( headingCommand, 'value', paragraphCommand, 'value', ( value, para ) => {
  53102. const whichModel = value || para && 'paragraph';
  53103. // If none of the commands is active, display default title.
  53104. return titles[ whichModel ] ? titles[ whichModel ] : defaultTitle;
  53105. } );
  53106. // Execute command when an item from the dropdown is selected.
  53107. this.listenTo( dropdownView, 'execute', evt => {
  53108. editor.execute( evt.source.commandName, evt.source.commandValue ? { value: evt.source.commandValue } : undefined );
  53109. editor.editing.view.focus();
  53110. } );
  53111. return dropdownView;
  53112. } );
  53113. }
  53114. }
  53115. /***/ }),
  53116. /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/utils.js":
  53117. /*!***************************************************************!*\
  53118. !*** ./node_modules/@ckeditor/ckeditor5-heading/src/utils.js ***!
  53119. \***************************************************************/
  53120. /*! exports provided: getLocalizedOptions */
  53121. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53122. "use strict";
  53123. __webpack_require__.r(__webpack_exports__);
  53124. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalizedOptions", function() { return getLocalizedOptions; });
  53125. /**
  53126. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  53127. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53128. */
  53129. /**
  53130. * @module heading/utils
  53131. */
  53132. /**
  53133. * Returns heading options as defined in `config.heading.options` but processed to consider
  53134. * the editor localization, i.e. to display {@link module:heading/heading~HeadingOption}
  53135. * in the correct language.
  53136. *
  53137. * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
  53138. * when the user configuration is defined because the editor does not exist yet.
  53139. *
  53140. * @param {module:core/editor/editor~Editor} editor
  53141. * @returns {Array.<module:heading/heading~HeadingOption>}.
  53142. */
  53143. function getLocalizedOptions( editor ) {
  53144. const t = editor.t;
  53145. const localizedTitles = {
  53146. Paragraph: t( 'Paragraph' ),
  53147. 'Heading 1': t( 'Heading 1' ),
  53148. 'Heading 2': t( 'Heading 2' ),
  53149. 'Heading 3': t( 'Heading 3' ),
  53150. 'Heading 4': t( 'Heading 4' ),
  53151. 'Heading 5': t( 'Heading 5' ),
  53152. 'Heading 6': t( 'Heading 6' )
  53153. };
  53154. return editor.config.get( 'heading.options' ).map( option => {
  53155. const title = localizedTitles[ option.title ];
  53156. if ( title && title != option.title ) {
  53157. option.title = title;
  53158. }
  53159. return option;
  53160. } );
  53161. }
  53162. /***/ }),
  53163. /***/ "./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css":
  53164. /*!********************************************************************!*\
  53165. !*** ./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css ***!
  53166. \********************************************************************/
  53167. /*! exports provided: default */
  53168. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53169. "use strict";
  53170. __webpack_require__.r(__webpack_exports__);
  53171. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  53172. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  53173. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_heading_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./heading.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css");
  53174. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  53175. options.insert = "head";
  53176. options.singleton = true;
  53177. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_heading_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  53178. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_heading_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  53179. /***/ }),
  53180. /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembed.js":
  53181. /*!**********************************************************************!*\
  53182. !*** ./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembed.js ***!
  53183. \**********************************************************************/
  53184. /*! exports provided: default */
  53185. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53186. "use strict";
  53187. __webpack_require__.r(__webpack_exports__);
  53188. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HtmlEmbed; });
  53189. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  53190. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  53191. /* harmony import */ var _htmlembedediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./htmlembedediting */ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedediting.js");
  53192. /* harmony import */ var _htmlembedui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./htmlembedui */ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedui.js");
  53193. /**
  53194. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  53195. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53196. */
  53197. /**
  53198. * @module html-embed/htmlembed
  53199. */
  53200. /**
  53201. * The HTML embed feature.
  53202. *
  53203. * It allows inserting HTML snippets directly into the editor.
  53204. *
  53205. * For a detailed overview, check the {@glink features/html-embed HTML embed feature} documentation.
  53206. *
  53207. * @extends module:core/plugin~Plugin
  53208. */
  53209. class HtmlEmbed extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  53210. /**
  53211. * @inheritDoc
  53212. */
  53213. static get requires() {
  53214. return [ _htmlembedediting__WEBPACK_IMPORTED_MODULE_2__["default"], _htmlembedui__WEBPACK_IMPORTED_MODULE_3__["default"], ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["Widget"] ];
  53215. }
  53216. /**
  53217. * @inheritDoc
  53218. */
  53219. static get pluginName() {
  53220. return 'HtmlEmbed';
  53221. }
  53222. }
  53223. /**
  53224. * The configuration of the HTML embed feature.
  53225. *
  53226. * ClassicEditor
  53227. * .create( editorElement, {
  53228. * htmlEmbed: ... // HTML embed feature options.
  53229. * } )
  53230. * .then( ... )
  53231. * .catch( ... );
  53232. *
  53233. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  53234. *
  53235. * @interface HtmlEmbedConfig
  53236. */
  53237. /**
  53238. * Whether the feature should render previews of the embedded HTML.
  53239. *
  53240. * When set to `true`, the feature will produce a preview of the inserted HTML based on a sanitized
  53241. * version of the HTML provided by the user.
  53242. *
  53243. * The function responsible for sanitizing the HTML needs to be specified in
  53244. * {@link module:html-embed/htmlembed~HtmlEmbedConfig#sanitizeHtml `config.htmlEmbed.sanitizeHtml()`}.
  53245. *
  53246. * Read more about the security aspect of this feature in the {@glink features/html-embed#security "Security"} section of
  53247. * the {@glink features/html-embed HTML embed} feature guide.
  53248. *
  53249. * @member {Boolean} [module:html-embed/htmlembed~HtmlEmbedConfig#showPreviews=false]
  53250. */
  53251. /**
  53252. * Callback used to sanitize the HTML provided by the user when generating previews of it in the editor.
  53253. *
  53254. * We strongly recommend overwriting the default function to avoid XSS vulnerabilities.
  53255. *
  53256. * Read more about the security aspect of this feature in the {@glink features/html-embed#security "Security"} section of
  53257. * the {@glink features/html-embed HTML embed} feature guide.
  53258. *
  53259. * The function receives the input HTML (as a string), and should return an object
  53260. * that matches the {@link module:html-embed/htmlembed~HtmlEmbedSanitizeOutput} interface.
  53261. *
  53262. * ClassicEditor
  53263. * .create( editorElement, {
  53264. * htmlEmbed: {
  53265. * showPreviews: true,
  53266. * sanitizeHtml( inputHtml ) {
  53267. * // Strip unsafe elements and attributes, e.g.:
  53268. * // the `<script>` elements and `on*` attributes.
  53269. * const outputHtml = sanitize( inputHtml );
  53270. *
  53271. * return {
  53272. * html: outputHtml,
  53273. * // true or false depending on whether the sanitizer stripped anything.
  53274. * hasChanged: ...
  53275. * };
  53276. * },
  53277. * }
  53278. * } )
  53279. * .then( ... )
  53280. * .catch( ... );
  53281. *
  53282. * **Note:** The function is used only when the feature
  53283. * {@link module:html-embed/htmlembed~HtmlEmbedConfig#showPreviews is configured to render previews}.
  53284. *
  53285. * @member {Function} [module:html-embed/htmlembed~HtmlEmbedConfig#sanitizeHtml]
  53286. */
  53287. /**
  53288. * An object returned by the {@link module:html-embed/htmlembed~HtmlEmbedConfig#sanitizeHtml} function.
  53289. *
  53290. * @interface HtmlEmbedSanitizeOutput
  53291. */
  53292. /**
  53293. * An output (safe) HTML that will be inserted into the {@glink framework/guides/architecture/editing-engine editing view}.
  53294. *
  53295. * @member {String} module:html-embed/htmlembed~HtmlEmbedSanitizeOutput#html
  53296. */
  53297. /**
  53298. * A flag that indicates whether the output HTML is different than the input value.
  53299. *
  53300. * @member {Boolean} [module:html-embed/htmlembed~HtmlEmbedSanitizeOutput#hasChanged]
  53301. */
  53302. /***/ }),
  53303. /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedcommand.js":
  53304. /*!*****************************************************************************!*\
  53305. !*** ./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedcommand.js ***!
  53306. \*****************************************************************************/
  53307. /*! exports provided: default */
  53308. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53309. "use strict";
  53310. __webpack_require__.r(__webpack_exports__);
  53311. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HtmlEmbedCommand; });
  53312. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  53313. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  53314. /**
  53315. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  53316. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53317. */
  53318. /**
  53319. * @module html-embed/htmlembedcommand
  53320. */
  53321. /**
  53322. * The insert HTML embed element command.
  53323. *
  53324. * The command is registered by {@link module:html-embed/htmlembedediting~HtmlEmbedEditing} as `'htmlEmbed'`.
  53325. *
  53326. * To insert an empty HTML embed element at the current selection, execute the command:
  53327. *
  53328. * editor.execute( 'htmlEmbed' );
  53329. *
  53330. * You can specify the initial content of a new HTML embed in the argument:
  53331. *
  53332. * editor.execute( 'htmlEmbed', '<b>Initial content.</b>' );
  53333. *
  53334. * To update the content of the HTML embed, select it in the model and pass the content in the argument:
  53335. *
  53336. * editor.execute( 'htmlEmbed', '<b>New content of an existing embed.</b>' );
  53337. *
  53338. * @extends module:core/command~Command
  53339. */
  53340. class HtmlEmbedCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  53341. /**
  53342. * @inheritDoc
  53343. */
  53344. refresh() {
  53345. const model = this.editor.model;
  53346. const schema = model.schema;
  53347. const selection = model.document.selection;
  53348. const selectedRawHtmlElement = getSelectedRawHtmlModelWidget( selection );
  53349. this.isEnabled = isHtmlEmbedAllowedInParent( selection, schema, model );
  53350. this.value = selectedRawHtmlElement ? selectedRawHtmlElement.getAttribute( 'value' ) || '' : null;
  53351. }
  53352. /**
  53353. * Executes the command, which either:
  53354. *
  53355. * * creates and inserts a new HTML embed element if none was selected,
  53356. * * updates the content of the HTML embed if one was selected.
  53357. *
  53358. * @fires execute
  53359. * @param {String} [value] When passed, the value (content) will be set on a new embed or a selected one.
  53360. */
  53361. execute( value ) {
  53362. const model = this.editor.model;
  53363. const selection = model.document.selection;
  53364. model.change( writer => {
  53365. let htmlEmbedElement;
  53366. // If the command has a non-null value, there must be some HTML embed selected in the model.
  53367. if ( this.value !== null ) {
  53368. htmlEmbedElement = getSelectedRawHtmlModelWidget( selection );
  53369. } else {
  53370. htmlEmbedElement = writer.createElement( 'rawHtml' );
  53371. model.insertContent( htmlEmbedElement );
  53372. writer.setSelection( htmlEmbedElement, 'on' );
  53373. }
  53374. writer.setAttribute( 'value', value, htmlEmbedElement );
  53375. } );
  53376. }
  53377. }
  53378. // Checks if an HTML embed is allowed by the schema in the optimal insertion parent.
  53379. //
  53380. // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  53381. // @param {module:engine/model/schema~Schema} schema
  53382. // @param {module:engine/model/model~Model} model
  53383. // @returns {Boolean}
  53384. function isHtmlEmbedAllowedInParent( selection, schema, model ) {
  53385. const parent = getInsertHtmlEmbedParent( selection, model );
  53386. return schema.checkChild( parent, 'rawHtml' );
  53387. }
  53388. // Returns a node that will be used to insert a html embed with `model.insertContent` to check if a html embed element can be placed there.
  53389. //
  53390. // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  53391. // @param {module:engine/model/model~Model} model
  53392. // @returns {module:engine/model/element~Element}
  53393. function getInsertHtmlEmbedParent( selection, model ) {
  53394. const insertionRange = Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["findOptimalInsertionRange"])( selection, model );
  53395. const parent = insertionRange.start.parent;
  53396. if ( parent.isEmpty && !parent.is( 'element', '$root' ) ) {
  53397. return parent.parent;
  53398. }
  53399. return parent;
  53400. }
  53401. // Returns the selected HTML embed element in the model, if any.
  53402. //
  53403. // @param {module:engine/model/selection~Selection} selection
  53404. // @returns {module:engine/model/element~Element|null}
  53405. function getSelectedRawHtmlModelWidget( selection ) {
  53406. const selectedElement = selection.getSelectedElement();
  53407. if ( selectedElement && selectedElement.is( 'element', 'rawHtml' ) ) {
  53408. return selectedElement;
  53409. }
  53410. return null;
  53411. }
  53412. /***/ }),
  53413. /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedediting.js":
  53414. /*!*****************************************************************************!*\
  53415. !*** ./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedediting.js ***!
  53416. \*****************************************************************************/
  53417. /*! exports provided: default */
  53418. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53419. "use strict";
  53420. __webpack_require__.r(__webpack_exports__);
  53421. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HtmlEmbedEditing; });
  53422. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  53423. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  53424. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  53425. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  53426. /* harmony import */ var _htmlembedcommand__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./htmlembedcommand */ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedcommand.js");
  53427. /* harmony import */ var _theme_htmlembed_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../theme/htmlembed.css */ "./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css");
  53428. /**
  53429. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  53430. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53431. */
  53432. /**
  53433. * @module html-embed/htmlembedediting
  53434. */
  53435. /**
  53436. * The HTML embed editing feature.
  53437. *
  53438. * @extends module:core/plugin~Plugin
  53439. */
  53440. class HtmlEmbedEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  53441. /**
  53442. * @inheritDoc
  53443. */
  53444. static get pluginName() {
  53445. return 'HtmlEmbedEditing';
  53446. }
  53447. /**
  53448. * @inheritDoc
  53449. */
  53450. constructor( editor ) {
  53451. super( editor );
  53452. editor.config.define( 'htmlEmbed', {
  53453. showPreviews: false,
  53454. sanitizeHtml: rawHtml => {
  53455. /**
  53456. * When using the HTML embed feature with the `htmlEmbed.showPreviews=true` option, it is strongly recommended to
  53457. * define a sanitize function that will clean up the input HTML in order to avoid XSS vulnerability.
  53458. *
  53459. * For a detailed overview, check the {@glink features/html-embed HTML embed feature} documentation.
  53460. *
  53461. * @error html-embed-provide-sanitize-function
  53462. */
  53463. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["logWarning"])( 'html-embed-provide-sanitize-function' );
  53464. return {
  53465. html: rawHtml,
  53466. hasChanged: false
  53467. };
  53468. }
  53469. } );
  53470. /**
  53471. * Keeps references to {@link module:ui/button/buttonview~ButtonView edit, save, and cancel} button instances created for
  53472. * each widget so they can be destroyed if they are no longer in DOM after the editing view was re-rendered.
  53473. *
  53474. * @private
  53475. * @member {Set.<module:ui/button/buttonview~ButtonView>} #_widgetButtonViewReferences
  53476. */
  53477. this._widgetButtonViewReferences = new Set();
  53478. }
  53479. /**
  53480. * @inheritDoc
  53481. */
  53482. init() {
  53483. const editor = this.editor;
  53484. const schema = editor.model.schema;
  53485. schema.register( 'rawHtml', {
  53486. isObject: true,
  53487. allowWhere: '$block',
  53488. allowAttributes: [ 'value' ]
  53489. } );
  53490. editor.commands.add( 'htmlEmbed', new _htmlembedcommand__WEBPACK_IMPORTED_MODULE_4__["default"]( editor ) );
  53491. this._setupConversion();
  53492. }
  53493. /**
  53494. * Prepares converters for the feature.
  53495. *
  53496. * @private
  53497. */
  53498. _setupConversion() {
  53499. const editor = this.editor;
  53500. const t = editor.t;
  53501. const view = editor.editing.view;
  53502. const widgetButtonViewReferences = this._widgetButtonViewReferences;
  53503. const htmlEmbedConfig = editor.config.get( 'htmlEmbed' );
  53504. // Destroy UI buttons created for widgets that have been removed from the view document (e.g. in the previous conversion).
  53505. // This prevents unexpected memory leaks from UI views.
  53506. this.editor.editing.view.on( 'render', () => {
  53507. for ( const buttonView of widgetButtonViewReferences ) {
  53508. if ( buttonView.element.isConnected ) {
  53509. return;
  53510. }
  53511. buttonView.destroy();
  53512. widgetButtonViewReferences.delete( buttonView );
  53513. }
  53514. }, { priority: 'lowest' } );
  53515. // Register div.raw-html-embed as a raw content element so all of it's content will be provided
  53516. // as a view element's custom property while data upcasting.
  53517. editor.data.registerRawContentMatcher( {
  53518. name: 'div',
  53519. classes: 'raw-html-embed'
  53520. } );
  53521. editor.conversion.for( 'upcast' ).elementToElement( {
  53522. view: {
  53523. name: 'div',
  53524. classes: 'raw-html-embed'
  53525. },
  53526. model: ( viewElement, { writer } ) => {
  53527. // The div.raw-html-embed is registered as a raw content element,
  53528. // so all it's content is available in a custom property.
  53529. return writer.createElement( 'rawHtml', {
  53530. value: viewElement.getCustomProperty( '$rawContent' )
  53531. } );
  53532. }
  53533. } );
  53534. editor.conversion.for( 'dataDowncast' ).elementToElement( {
  53535. model: 'rawHtml',
  53536. view: ( modelElement, { writer } ) => {
  53537. return writer.createRawElement( 'div', { class: 'raw-html-embed' }, function( domElement ) {
  53538. domElement.innerHTML = modelElement.getAttribute( 'value' ) || '';
  53539. } );
  53540. }
  53541. } );
  53542. editor.conversion.for( 'editingDowncast' ).elementToElement( {
  53543. triggerBy: {
  53544. attributes: [ 'value' ]
  53545. },
  53546. model: 'rawHtml',
  53547. view: ( modelElement, { writer } ) => {
  53548. let domContentWrapper, state, props;
  53549. const viewContainer = writer.createContainerElement( 'div', {
  53550. class: 'raw-html-embed',
  53551. 'data-html-embed-label': t( 'HTML snippet' ),
  53552. dir: editor.locale.uiLanguageDirection
  53553. } );
  53554. // Widget cannot be a raw element because the widget system would not be able
  53555. // to add its UI to it. Thus, we need this wrapper.
  53556. const viewContentWrapper = writer.createRawElement( 'div', {
  53557. class: 'raw-html-embed__content-wrapper'
  53558. }, function( domElement ) {
  53559. domContentWrapper = domElement;
  53560. renderContent( { domElement, editor, state, props } );
  53561. // Since there is a `data-cke-ignore-events` attribute set on the wrapper element in the editable mode,
  53562. // the explicit `mousedown` handler on the `capture` phase is needed to move the selection onto the whole
  53563. // HTML embed widget.
  53564. domContentWrapper.addEventListener( 'mousedown', () => {
  53565. if ( state.isEditable ) {
  53566. const model = editor.model;
  53567. const selectedElement = model.document.selection.getSelectedElement();
  53568. // Move the selection onto the whole HTML embed widget if it's currently not selected.
  53569. if ( selectedElement !== modelElement ) {
  53570. model.change( writer => writer.setSelection( modelElement, 'on' ) );
  53571. }
  53572. }
  53573. }, true );
  53574. } );
  53575. // API exposed on each raw HTML embed widget so other features can control a particular widget.
  53576. const rawHtmlApi = {
  53577. makeEditable() {
  53578. state = Object.assign( {}, state, {
  53579. isEditable: true
  53580. } );
  53581. renderContent( { domElement: domContentWrapper, editor, state, props } );
  53582. view.change( writer => {
  53583. writer.setAttribute( 'data-cke-ignore-events', 'true', viewContentWrapper );
  53584. } );
  53585. // This could be potentially pulled to a separate method called focusTextarea().
  53586. domContentWrapper.querySelector( 'textarea' ).focus();
  53587. },
  53588. save( newValue ) {
  53589. // If the value didn't change, we just cancel. If it changed,
  53590. // it's enough to update the model – the entire widget will be reconverted.
  53591. if ( newValue !== state.getRawHtmlValue() ) {
  53592. editor.execute( 'htmlEmbed', newValue );
  53593. editor.editing.view.focus();
  53594. } else {
  53595. this.cancel();
  53596. }
  53597. },
  53598. cancel() {
  53599. state = Object.assign( {}, state, {
  53600. isEditable: false
  53601. } );
  53602. renderContent( { domElement: domContentWrapper, editor, state, props } );
  53603. editor.editing.view.focus();
  53604. view.change( writer => {
  53605. writer.removeAttribute( 'data-cke-ignore-events', viewContentWrapper );
  53606. } );
  53607. }
  53608. };
  53609. state = {
  53610. showPreviews: htmlEmbedConfig.showPreviews,
  53611. isEditable: false,
  53612. getRawHtmlValue: () => modelElement.getAttribute( 'value' ) || ''
  53613. };
  53614. props = {
  53615. sanitizeHtml: htmlEmbedConfig.sanitizeHtml,
  53616. textareaPlaceholder: t( 'Paste raw HTML here...' ),
  53617. onEditClick() {
  53618. rawHtmlApi.makeEditable();
  53619. },
  53620. onSaveClick( newValue ) {
  53621. rawHtmlApi.save( newValue );
  53622. },
  53623. onCancelClick() {
  53624. rawHtmlApi.cancel();
  53625. }
  53626. };
  53627. writer.insert( writer.createPositionAt( viewContainer, 0 ), viewContentWrapper );
  53628. writer.setCustomProperty( 'rawHtmlApi', rawHtmlApi, viewContainer );
  53629. writer.setCustomProperty( 'rawHtml', true, viewContainer );
  53630. return Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_2__["toWidget"])( viewContainer, writer, {
  53631. widgetLabel: t( 'HTML snippet' ),
  53632. hasSelectionHandle: true
  53633. } );
  53634. }
  53635. } );
  53636. function renderContent( { domElement, editor, state, props } ) {
  53637. // Remove all children;
  53638. domElement.textContent = '';
  53639. const domDocument = domElement.ownerDocument;
  53640. let domTextarea;
  53641. if ( state.isEditable ) {
  53642. const textareaProps = {
  53643. isDisabled: false,
  53644. placeholder: props.textareaPlaceholder
  53645. };
  53646. domTextarea = createDomTextarea( { domDocument, state, props: textareaProps } );
  53647. domElement.append( domTextarea );
  53648. } else if ( state.showPreviews ) {
  53649. const previewContainerProps = {
  53650. sanitizeHtml: props.sanitizeHtml
  53651. };
  53652. domElement.append( createPreviewContainer( { domDocument, state, props: previewContainerProps, editor } ) );
  53653. } else {
  53654. const textareaProps = {
  53655. isDisabled: true,
  53656. placeholder: props.textareaPlaceholder
  53657. };
  53658. domElement.append( createDomTextarea( { domDocument, state, props: textareaProps } ) );
  53659. }
  53660. const buttonsWrapperProps = {
  53661. onEditClick: props.onEditClick,
  53662. onSaveClick: () => {
  53663. props.onSaveClick( domTextarea.value );
  53664. },
  53665. onCancelClick: props.onCancelClick
  53666. };
  53667. domElement.prepend( createDomButtonsWrapper( { editor, domDocument, state, props: buttonsWrapperProps } ) );
  53668. }
  53669. function createDomButtonsWrapper( { editor, domDocument, state, props } ) {
  53670. const domButtonsWrapper = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["createElement"])( domDocument, 'div', {
  53671. class: 'raw-html-embed__buttons-wrapper'
  53672. } );
  53673. if ( state.isEditable ) {
  53674. const saveButtonView = createUIButton( editor, 'save', props.onSaveClick );
  53675. const cancelButtonView = createUIButton( editor, 'cancel', props.onCancelClick );
  53676. domButtonsWrapper.append( saveButtonView.element, cancelButtonView.element );
  53677. widgetButtonViewReferences.add( saveButtonView ).add( cancelButtonView );
  53678. } else {
  53679. const editButtonView = createUIButton( editor, 'edit', props.onEditClick );
  53680. domButtonsWrapper.append( editButtonView.element );
  53681. widgetButtonViewReferences.add( editButtonView );
  53682. }
  53683. return domButtonsWrapper;
  53684. }
  53685. function createDomTextarea( { domDocument, state, props } ) {
  53686. const domTextarea = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["createElement"])( domDocument, 'textarea', {
  53687. placeholder: props.placeholder,
  53688. class: 'ck ck-reset ck-input ck-input-text raw-html-embed__source'
  53689. } );
  53690. domTextarea.disabled = props.isDisabled;
  53691. domTextarea.value = state.getRawHtmlValue();
  53692. return domTextarea;
  53693. }
  53694. function createPreviewContainer( { domDocument, state, props, editor } ) {
  53695. const sanitizedOutput = props.sanitizeHtml( state.getRawHtmlValue() );
  53696. const placeholderText = state.getRawHtmlValue().length > 0 ?
  53697. t( 'No preview available' ) :
  53698. t( 'Empty snippet content' );
  53699. const domPreviewPlaceholder = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["createElement"])( domDocument, 'div', {
  53700. class: 'ck ck-reset_all raw-html-embed__preview-placeholder'
  53701. }, placeholderText );
  53702. const domPreviewContent = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["createElement"])( domDocument, 'div', {
  53703. class: 'raw-html-embed__preview-content',
  53704. dir: editor.locale.contentLanguageDirection
  53705. } );
  53706. // Creating a contextual document fragment allows executing scripts when inserting into the preview element.
  53707. // See: #8326.
  53708. const domRange = domDocument.createRange();
  53709. const domDocumentFragment = domRange.createContextualFragment( sanitizedOutput.html );
  53710. domPreviewContent.appendChild( domDocumentFragment );
  53711. const domPreviewContainer = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["createElement"])( domDocument, 'div', {
  53712. class: 'raw-html-embed__preview'
  53713. }, [
  53714. domPreviewPlaceholder, domPreviewContent
  53715. ] );
  53716. return domPreviewContainer;
  53717. }
  53718. }
  53719. }
  53720. // Returns a UI button view that can be used in conversion.
  53721. //
  53722. // @param {module:utils/locale~Locale} locale Editor locale.
  53723. // @param {'edit'|'save'|'cancel'} type Type of button to create.
  53724. // @param {Function} onClick The callback executed on button click.
  53725. // @returns {module:ui/button/buttonview~ButtonView}
  53726. function createUIButton( editor, type, onClick ) {
  53727. const t = editor.locale.t;
  53728. const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( editor.locale );
  53729. const command = editor.commands.get( 'htmlEmbed' );
  53730. buttonView.set( {
  53731. class: `raw-html-embed__${ type }-button`,
  53732. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].pencil,
  53733. tooltip: true,
  53734. tooltipPosition: editor.locale.uiLanguageDirection === 'rtl' ? 'e' : 'w'
  53735. } );
  53736. buttonView.render();
  53737. if ( type === 'edit' ) {
  53738. buttonView.set( {
  53739. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].pencil,
  53740. label: t( 'Edit source' )
  53741. } );
  53742. buttonView.bind( 'isEnabled' ).to( command );
  53743. } else if ( type === 'save' ) {
  53744. buttonView.set( {
  53745. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].check,
  53746. label: t( 'Save changes' )
  53747. } );
  53748. buttonView.bind( 'isEnabled' ).to( command );
  53749. } else {
  53750. buttonView.set( {
  53751. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].cancel,
  53752. label: t( 'Cancel' )
  53753. } );
  53754. }
  53755. buttonView.on( 'execute', onClick );
  53756. return buttonView;
  53757. }
  53758. /***/ }),
  53759. /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedui.js":
  53760. /*!************************************************************************!*\
  53761. !*** ./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedui.js ***!
  53762. \************************************************************************/
  53763. /*! exports provided: default */
  53764. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53765. "use strict";
  53766. __webpack_require__.r(__webpack_exports__);
  53767. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HtmlEmbedUI; });
  53768. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  53769. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  53770. /* harmony import */ var _theme_icons_html_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/html.svg */ "./node_modules/@ckeditor/ckeditor5-html-embed/theme/icons/html.svg");
  53771. /**
  53772. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  53773. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53774. */
  53775. /**
  53776. * @module html-embed/htmlembedui
  53777. */
  53778. /**
  53779. * The HTML embed UI plugin.
  53780. *
  53781. * @extends module:core/plugin~Plugin
  53782. */
  53783. class HtmlEmbedUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  53784. /**
  53785. * @inheritDoc
  53786. */
  53787. static get pluginName() {
  53788. return 'HtmlEmbedUI';
  53789. }
  53790. /**
  53791. * @inheritDoc
  53792. */
  53793. init() {
  53794. const editor = this.editor;
  53795. const t = editor.t;
  53796. // Add the `htmlEmbed` button to feature components.
  53797. editor.ui.componentFactory.add( 'htmlEmbed', locale => {
  53798. const command = editor.commands.get( 'htmlEmbed' );
  53799. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  53800. view.set( {
  53801. label: t( 'Insert HTML' ),
  53802. icon: _theme_icons_html_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  53803. tooltip: true
  53804. } );
  53805. view.bind( 'isEnabled' ).to( command, 'isEnabled' );
  53806. // Execute the command.
  53807. this.listenTo( view, 'execute', () => {
  53808. editor.execute( 'htmlEmbed' );
  53809. editor.editing.view.focus();
  53810. const widgetWrapper = editor.editing.view.document.selection.getSelectedElement();
  53811. widgetWrapper.getCustomProperty( 'rawHtmlApi' ).makeEditable();
  53812. } );
  53813. return view;
  53814. } );
  53815. }
  53816. }
  53817. /***/ }),
  53818. /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css":
  53819. /*!*************************************************************************!*\
  53820. !*** ./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css ***!
  53821. \*************************************************************************/
  53822. /*! exports provided: default */
  53823. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53824. "use strict";
  53825. __webpack_require__.r(__webpack_exports__);
  53826. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  53827. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  53828. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_htmlembed_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./htmlembed.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css");
  53829. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  53830. options.insert = "head";
  53831. options.singleton = true;
  53832. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_htmlembed_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  53833. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_htmlembed_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  53834. /***/ }),
  53835. /***/ "./node_modules/@ckeditor/ckeditor5-html-embed/theme/icons/html.svg":
  53836. /*!**************************************************************************!*\
  53837. !*** ./node_modules/@ckeditor/ckeditor5-html-embed/theme/icons/html.svg ***!
  53838. \**************************************************************************/
  53839. /*! exports provided: default */
  53840. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53841. "use strict";
  53842. __webpack_require__.r(__webpack_exports__);
  53843. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17 0a2 2 0 0 1 2 2v7a1 1 0 0 1 1 1v5a1 1 0 0 1-.883.993l-.118.006L19 17a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2l-.001-1.001-.116-.006A1 1 0 0 1 0 15v-5a1 1 0 0 1 .999-1L1 2a2 2 0 0 1 2-2h14zm.499 15.999h-15L2.5 17a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5l-.001-1.001zm-3.478-6.013-.014.014H14v.007l-1.525 1.525-1.46-1.46-.015.013V10h-1v5h1v-3.53l1.428 1.43.048.043.131-.129L14 11.421V15h1v-5h-.965l-.014-.014zM2 10H1v5h1v-2h2v2h1v-5H4v2H2v-2zm7 0H6v1h1v4h1v-4h1v-1zm8 0h-1v5h3v-1h-2v-4zm0-8.5H3a.5.5 0 0 0-.5.5l-.001 6.999h15L17.5 2a.5.5 0 0 0-.5-.5zM10 7v1H4V7h6zm3-2v1H4V5h9zm-3-2v1H4V3h6z\"/></svg>");
  53844. /***/ }),
  53845. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image.js":
  53846. /*!*************************************************************!*\
  53847. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image.js ***!
  53848. \*************************************************************/
  53849. /*! exports provided: default */
  53850. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53851. "use strict";
  53852. __webpack_require__.r(__webpack_exports__);
  53853. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Image; });
  53854. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  53855. /* harmony import */ var _imageblock__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imageblock */ "./node_modules/@ckeditor/ckeditor5-image/src/imageblock.js");
  53856. /* harmony import */ var _imageinline__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imageinline */ "./node_modules/@ckeditor/ckeditor5-image/src/imageinline.js");
  53857. /* harmony import */ var _theme_image_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/image.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/image.css");
  53858. /**
  53859. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  53860. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53861. */
  53862. /**
  53863. * @module image/image
  53864. */
  53865. /**
  53866. * The image plugin.
  53867. *
  53868. * For a detailed overview, check the {@glink features/images/images-overview image feature} documentation.
  53869. *
  53870. * This is a "glue" plugin which loads the following plugins:
  53871. *
  53872. * * {@link module:image/imageblock~ImageBlock},
  53873. * * {@link module:image/imageinline~ImageInline},
  53874. *
  53875. * Usually, it is used in conjunction with other plugins from this package. See the {@glink api/image package page}
  53876. * for more information.
  53877. *
  53878. * @extends module:core/plugin~Plugin
  53879. */
  53880. class Image extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  53881. /**
  53882. * @inheritDoc
  53883. */
  53884. static get requires() {
  53885. return [ _imageblock__WEBPACK_IMPORTED_MODULE_1__["default"], _imageinline__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  53886. }
  53887. /**
  53888. * @inheritDoc
  53889. */
  53890. static get pluginName() {
  53891. return 'Image';
  53892. }
  53893. }
  53894. /**
  53895. * The configuration of the image features. Used by the image features in the `@ckeditor/ckeditor5-image` package.
  53896. *
  53897. * Read more in {@link module:image/image~ImageConfig}.
  53898. *
  53899. * @member {module:image/image~ImageConfig} module:core/editor/editorconfig~EditorConfig#image
  53900. */
  53901. /**
  53902. * The configuration of the image features. Used by the image features in the `@ckeditor/ckeditor5-image` package.
  53903. *
  53904. * ClassicEditor
  53905. * .create( editorElement, {
  53906. * image: ... // Image feature options.
  53907. * } )
  53908. * .then( ... )
  53909. * .catch( ... );
  53910. *
  53911. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  53912. *
  53913. * @interface ImageConfig
  53914. */
  53915. /***/ }),
  53916. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/converters.js":
  53917. /*!************************************************************************!*\
  53918. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/converters.js ***!
  53919. \************************************************************************/
  53920. /*! exports provided: upcastImageFigure, upcastPicture, downcastSrcsetAttribute, downcastSourcesAttribute, downcastImageAttribute */
  53921. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53922. "use strict";
  53923. __webpack_require__.r(__webpack_exports__);
  53924. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "upcastImageFigure", function() { return upcastImageFigure; });
  53925. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "upcastPicture", function() { return upcastPicture; });
  53926. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastSrcsetAttribute", function() { return downcastSrcsetAttribute; });
  53927. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastSourcesAttribute", function() { return downcastSourcesAttribute; });
  53928. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastImageAttribute", function() { return downcastImageAttribute; });
  53929. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  53930. /**
  53931. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  53932. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53933. */
  53934. /**
  53935. * @module image/image/converters
  53936. */
  53937. /**
  53938. * Returns a function that converts the image view representation:
  53939. *
  53940. * <figure class="image"><img src="..." alt="..."></img></figure>
  53941. *
  53942. * to the model representation:
  53943. *
  53944. * <imageBlock src="..." alt="..."></imageBlock>
  53945. *
  53946. * The entire content of the `<figure>` element except the first `<img>` is being converted as children
  53947. * of the `<imageBlock>` model element.
  53948. *
  53949. * @protected
  53950. * @param {module:image/imageutils~ImageUtils} imageUtils
  53951. * @returns {Function}
  53952. */
  53953. function upcastImageFigure( imageUtils ) {
  53954. return dispatcher => {
  53955. dispatcher.on( 'element:figure', converter );
  53956. };
  53957. function converter( evt, data, conversionApi ) {
  53958. // Do not convert if this is not an "image figure".
  53959. if ( !conversionApi.consumable.test( data.viewItem, { name: true, classes: 'image' } ) ) {
  53960. return;
  53961. }
  53962. // Find an image element inside the figure element.
  53963. const viewImage = imageUtils.findViewImgElement( data.viewItem );
  53964. // Do not convert if image element is absent or was already converted.
  53965. if ( !viewImage || !conversionApi.consumable.test( viewImage, { name: true } ) ) {
  53966. return;
  53967. }
  53968. // Consume the figure to prevent other converters from processing it again.
  53969. conversionApi.consumable.consume( data.viewItem, { name: true, classes: 'image' } );
  53970. // Convert view image to model image.
  53971. const conversionResult = conversionApi.convertItem( viewImage, data.modelCursor );
  53972. // Get image element from conversion result.
  53973. const modelImage = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["first"])( conversionResult.modelRange.getItems() );
  53974. // When image wasn't successfully converted then finish conversion.
  53975. if ( !modelImage ) {
  53976. // Revert consumed figure so other features can convert it.
  53977. conversionApi.consumable.revert( data.viewItem, { name: true, classes: 'image' } );
  53978. return;
  53979. }
  53980. // Convert rest of the figure element's children as an image children.
  53981. conversionApi.convertChildren( data.viewItem, modelImage );
  53982. conversionApi.updateConversionResult( modelImage, data );
  53983. }
  53984. }
  53985. /**
  53986. * Returns a function that converts the image view representation:
  53987. *
  53988. * <picture><source ... /><source ... />...<img ... /></picture>
  53989. *
  53990. * to the model representation as the `sources` attribute:
  53991. *
  53992. * <image[Block|Inline] ... sources="..."></image[Block|Inline]>
  53993. *
  53994. * @protected
  53995. * @param {module:image/imageutils~ImageUtils} imageUtils
  53996. * @returns {Function}
  53997. */
  53998. function upcastPicture( imageUtils ) {
  53999. const sourceAttributeNames = [ 'srcset', 'media', 'type' ];
  54000. return dispatcher => {
  54001. dispatcher.on( 'element:picture', converter );
  54002. };
  54003. function converter( evt, data, conversionApi ) {
  54004. const pictureViewElement = data.viewItem;
  54005. // Do not convert <picture> if already consumed.
  54006. if ( !conversionApi.consumable.test( pictureViewElement, { name: true } ) ) {
  54007. return;
  54008. }
  54009. const sources = new Map();
  54010. // Collect all <source /> elements attribute values.
  54011. for ( const childSourceElement of pictureViewElement.getChildren() ) {
  54012. if ( childSourceElement.is( 'element', 'source' ) ) {
  54013. const attributes = {};
  54014. for ( const name of sourceAttributeNames ) {
  54015. if ( childSourceElement.hasAttribute( name ) ) {
  54016. // Don't collect <source /> attribute if already consumed somewhere else.
  54017. if ( conversionApi.consumable.test( childSourceElement, { attributes: name } ) ) {
  54018. attributes[ name ] = childSourceElement.getAttribute( name );
  54019. }
  54020. }
  54021. }
  54022. if ( Object.keys( attributes ).length ) {
  54023. sources.set( childSourceElement, attributes );
  54024. }
  54025. }
  54026. }
  54027. const imgViewElement = imageUtils.findViewImgElement( pictureViewElement );
  54028. // Don't convert when a picture has no <img/> inside (it is broken).
  54029. if ( !imgViewElement ) {
  54030. return;
  54031. }
  54032. let modelImage = data.modelCursor.parent;
  54033. // - In case of an inline image (cursor parent in a <paragraph>), the <img/> must be converted right away
  54034. // because no converter handled it yet and otherwise there would be no model element to set the sources attribute on.
  54035. // - In case of a block image, the <figure class="image"> converter (in ImageBlockEditing) converts the
  54036. // <img/> right away on its own and the modelCursor is already inside an imageBlock and there's nothing special
  54037. // to do here.
  54038. if ( !modelImage.is( 'element', 'imageBlock' ) ) {
  54039. const conversionResult = conversionApi.convertItem( imgViewElement, data.modelCursor );
  54040. // Set image range as conversion result.
  54041. data.modelRange = conversionResult.modelRange;
  54042. // Continue conversion where image conversion ends.
  54043. data.modelCursor = conversionResult.modelCursor;
  54044. modelImage = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["first"])( conversionResult.modelRange.getItems() );
  54045. }
  54046. conversionApi.consumable.consume( pictureViewElement, { name: true } );
  54047. // Consume only these <source/> attributes that were actually collected and will be passed on
  54048. // to the image model element.
  54049. for ( const [ sourceElement, attributes ] of sources ) {
  54050. conversionApi.consumable.consume( sourceElement, { attributes: Object.keys( attributes ) } );
  54051. }
  54052. if ( sources.size ) {
  54053. conversionApi.writer.setAttribute( 'sources', Array.from( sources.values() ), modelImage );
  54054. }
  54055. // Convert rest of the <picture> children as an image children. Other converters may want to consume them.
  54056. conversionApi.convertChildren( pictureViewElement, modelImage );
  54057. }
  54058. }
  54059. /**
  54060. * Converter used to convert the `srcset` model image attribute to the `srcset`, `sizes` and `width` attributes in the view.
  54061. *
  54062. * @protected
  54063. * @param {module:image/imageutils~ImageUtils} imageUtils
  54064. * @param {'imageBlock'|'imageInline'} imageType The type of the image.
  54065. * @returns {Function}
  54066. */
  54067. function downcastSrcsetAttribute( imageUtils, imageType ) {
  54068. return dispatcher => {
  54069. dispatcher.on( `attribute:srcset:${ imageType }`, converter );
  54070. };
  54071. function converter( evt, data, conversionApi ) {
  54072. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  54073. return;
  54074. }
  54075. const writer = conversionApi.writer;
  54076. const element = conversionApi.mapper.toViewElement( data.item );
  54077. const img = imageUtils.findViewImgElement( element );
  54078. if ( data.attributeNewValue === null ) {
  54079. const srcset = data.attributeOldValue;
  54080. if ( srcset.data ) {
  54081. writer.removeAttribute( 'srcset', img );
  54082. writer.removeAttribute( 'sizes', img );
  54083. if ( srcset.width ) {
  54084. writer.removeAttribute( 'width', img );
  54085. }
  54086. }
  54087. } else {
  54088. const srcset = data.attributeNewValue;
  54089. if ( srcset.data ) {
  54090. writer.setAttribute( 'srcset', srcset.data, img );
  54091. // Always outputting `100vw`. See https://github.com/ckeditor/ckeditor5-image/issues/2.
  54092. writer.setAttribute( 'sizes', '100vw', img );
  54093. if ( srcset.width ) {
  54094. writer.setAttribute( 'width', srcset.width, img );
  54095. }
  54096. }
  54097. }
  54098. }
  54099. }
  54100. /**
  54101. * Converts the `source` model attribute to the `<picture><source /><source />...<img /></picture>`
  54102. * view structure.
  54103. *
  54104. * @protected
  54105. * @param {module:image/imageutils~ImageUtils} imageUtils
  54106. * @returns {Function}
  54107. */
  54108. function downcastSourcesAttribute( imageUtils ) {
  54109. return dispatcher => {
  54110. dispatcher.on( 'attribute:sources:imageBlock', converter );
  54111. dispatcher.on( 'attribute:sources:imageInline', converter );
  54112. };
  54113. function converter( evt, data, conversionApi ) {
  54114. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  54115. return;
  54116. }
  54117. const viewWriter = conversionApi.writer;
  54118. const element = conversionApi.mapper.toViewElement( data.item );
  54119. const imgElement = imageUtils.findViewImgElement( element );
  54120. if ( data.attributeNewValue && data.attributeNewValue.length ) {
  54121. // Make sure <picture> does not break attribute elements, for instance <a> in linked images.
  54122. const pictureElement = viewWriter.createContainerElement( 'picture', {}, { isAllowedInsideAttributeElement: true } );
  54123. for ( const sourceAttributes of data.attributeNewValue ) {
  54124. const sourceElement = viewWriter.createEmptyElement( 'source', sourceAttributes );
  54125. viewWriter.insert( viewWriter.createPositionAt( pictureElement, 'end' ), sourceElement );
  54126. }
  54127. // Collect all wrapping attribute elements.
  54128. const attributeElements = [];
  54129. let viewElement = imgElement.parent;
  54130. while ( viewElement && viewElement.is( 'attributeElement' ) ) {
  54131. const parentElement = viewElement.parent;
  54132. viewWriter.unwrap( viewWriter.createRangeOn( imgElement ), viewElement );
  54133. attributeElements.unshift( viewElement );
  54134. viewElement = parentElement;
  54135. }
  54136. // Insert the picture and move img into it.
  54137. viewWriter.insert( viewWriter.createPositionBefore( imgElement ), pictureElement );
  54138. viewWriter.move( viewWriter.createRangeOn( imgElement ), viewWriter.createPositionAt( pictureElement, 'end' ) );
  54139. // Apply collected attribute elements over the new picture element.
  54140. for ( const attributeElement of attributeElements ) {
  54141. viewWriter.wrap( viewWriter.createRangeOn( pictureElement ), attributeElement );
  54142. }
  54143. }
  54144. // Both setting "sources" to an empty array and removing the attribute should unwrap the <img />.
  54145. // Unwrap once if the latter followed the former, though.
  54146. else if ( imgElement.parent.is( 'element', 'picture' ) ) {
  54147. const pictureElement = imgElement.parent;
  54148. viewWriter.move( viewWriter.createRangeOn( imgElement ), viewWriter.createPositionBefore( pictureElement ) );
  54149. viewWriter.remove( pictureElement );
  54150. }
  54151. }
  54152. }
  54153. /**
  54154. * Converter used to convert a given image attribute from the model to the view.
  54155. *
  54156. * @protected
  54157. * @param {module:image/imageutils~ImageUtils} imageUtils
  54158. * @param {'imageBlock'|'imageInline'} imageType The type of the image.
  54159. * @param {String} attributeKey The name of the attribute to convert.
  54160. * @returns {Function}
  54161. */
  54162. function downcastImageAttribute( imageUtils, imageType, attributeKey ) {
  54163. return dispatcher => {
  54164. dispatcher.on( `attribute:${ attributeKey }:${ imageType }`, converter );
  54165. };
  54166. function converter( evt, data, conversionApi ) {
  54167. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  54168. return;
  54169. }
  54170. const viewWriter = conversionApi.writer;
  54171. const element = conversionApi.mapper.toViewElement( data.item );
  54172. const img = imageUtils.findViewImgElement( element );
  54173. viewWriter.setAttribute( data.attributeKey, data.attributeNewValue || '', img );
  54174. }
  54175. }
  54176. /***/ }),
  54177. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageblockediting.js":
  54178. /*!*******************************************************************************!*\
  54179. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/imageblockediting.js ***!
  54180. \*******************************************************************************/
  54181. /*! exports provided: default */
  54182. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54183. "use strict";
  54184. __webpack_require__.r(__webpack_exports__);
  54185. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageBlockEditing; });
  54186. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  54187. /* harmony import */ var ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/clipboard */ "./node_modules/ckeditor5/src/clipboard.js");
  54188. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  54189. /* harmony import */ var _converters__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./converters */ "./node_modules/@ckeditor/ckeditor5-image/src/image/converters.js");
  54190. /* harmony import */ var _imageediting__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./imageediting */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js");
  54191. /* harmony import */ var _imagetypecommand__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./imagetypecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imagetypecommand.js");
  54192. /* harmony import */ var _imageutils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../imageutils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageutils.js");
  54193. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  54194. /**
  54195. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  54196. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54197. */
  54198. /**
  54199. * @module image/image/imageblockediting
  54200. */
  54201. /**
  54202. * The image block plugin.
  54203. *
  54204. * It registers:
  54205. *
  54206. * * `<imageBlock>` as a block element in the document schema, and allows `alt`, `src` and `srcset` attributes.
  54207. * * converters for editing and data pipelines.,
  54208. * * {@link module:image/image/imagetypecommand~ImageTypeCommand `'imageTypeBlock'`} command that converts inline images into
  54209. * block images.
  54210. *
  54211. * @extends module:core/plugin~Plugin
  54212. */
  54213. class ImageBlockEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  54214. /**
  54215. * @inheritDoc
  54216. */
  54217. static get requires() {
  54218. return [ _imageediting__WEBPACK_IMPORTED_MODULE_4__["default"], _imageutils__WEBPACK_IMPORTED_MODULE_6__["default"], ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_1__["ClipboardPipeline"] ];
  54219. }
  54220. /**
  54221. * @inheritDoc
  54222. */
  54223. static get pluginName() {
  54224. return 'ImageBlockEditing';
  54225. }
  54226. /**
  54227. * @inheritDoc
  54228. */
  54229. init() {
  54230. const editor = this.editor;
  54231. const schema = editor.model.schema;
  54232. // Converters 'alt' and 'srcset' are added in 'ImageEditing' plugin.
  54233. schema.register( 'imageBlock', {
  54234. isObject: true,
  54235. isBlock: true,
  54236. allowWhere: '$block',
  54237. allowAttributes: [ 'alt', 'src', 'srcset' ]
  54238. } );
  54239. this._setupConversion();
  54240. if ( editor.plugins.has( 'ImageInlineEditing' ) ) {
  54241. editor.commands.add( 'imageTypeBlock', new _imagetypecommand__WEBPACK_IMPORTED_MODULE_5__["default"]( this.editor, 'imageBlock' ) );
  54242. this._setupClipboardIntegration();
  54243. }
  54244. }
  54245. /**
  54246. * Configures conversion pipelines to support upcasting and downcasting
  54247. * block images (block image widgets) and their attributes.
  54248. *
  54249. * @private
  54250. */
  54251. _setupConversion() {
  54252. const editor = this.editor;
  54253. const t = editor.t;
  54254. const conversion = editor.conversion;
  54255. const imageUtils = editor.plugins.get( 'ImageUtils' );
  54256. conversion.for( 'dataDowncast' )
  54257. .elementToElement( {
  54258. model: 'imageBlock',
  54259. view: ( modelElement, { writer } ) => Object(_image_utils__WEBPACK_IMPORTED_MODULE_7__["createImageViewElement"])( writer, 'imageBlock' )
  54260. } );
  54261. conversion.for( 'editingDowncast' )
  54262. .elementToElement( {
  54263. model: 'imageBlock',
  54264. view: ( modelElement, { writer } ) => imageUtils.toImageWidget(
  54265. Object(_image_utils__WEBPACK_IMPORTED_MODULE_7__["createImageViewElement"])( writer, 'imageBlock' ), writer, t( 'image widget' )
  54266. )
  54267. } );
  54268. conversion.for( 'downcast' )
  54269. .add( Object(_converters__WEBPACK_IMPORTED_MODULE_3__["downcastImageAttribute"])( imageUtils, 'imageBlock', 'src' ) )
  54270. .add( Object(_converters__WEBPACK_IMPORTED_MODULE_3__["downcastImageAttribute"])( imageUtils, 'imageBlock', 'alt' ) )
  54271. .add( Object(_converters__WEBPACK_IMPORTED_MODULE_3__["downcastSrcsetAttribute"])( imageUtils, 'imageBlock' ) );
  54272. // More image related upcasts are in 'ImageEditing' plugin.
  54273. conversion.for( 'upcast' )
  54274. .elementToElement( {
  54275. view: Object(_image_utils__WEBPACK_IMPORTED_MODULE_7__["getImgViewElementMatcher"])( editor, 'imageBlock' ),
  54276. model: ( viewImage, { writer } ) => writer.createElement(
  54277. 'imageBlock',
  54278. viewImage.hasAttribute( 'src' ) ? { src: viewImage.getAttribute( 'src' ) } : null
  54279. )
  54280. } )
  54281. .add( Object(_converters__WEBPACK_IMPORTED_MODULE_3__["upcastImageFigure"])( imageUtils ) );
  54282. }
  54283. /**
  54284. * Integrates the plugin with the clipboard pipeline.
  54285. *
  54286. * Idea is that the feature should recognize the user's intent when an **inline** image is
  54287. * pasted or dropped. If such an image is pasted/dropped:
  54288. *
  54289. * * into an empty block (e.g. an empty paragraph),
  54290. * * on another object (e.g. some block widget).
  54291. *
  54292. * it gets converted into a block image on the fly. We assume this is the user's intent
  54293. * if they decided to put their image there.
  54294. *
  54295. * See the `ImageInlineEditing` for the similar integration that works in the opposite direction.
  54296. *
  54297. * @private
  54298. */
  54299. _setupClipboardIntegration() {
  54300. const editor = this.editor;
  54301. const model = editor.model;
  54302. const editingView = editor.editing.view;
  54303. const imageUtils = editor.plugins.get( 'ImageUtils' );
  54304. this.listenTo( editor.plugins.get( 'ClipboardPipeline' ), 'inputTransformation', ( evt, data ) => {
  54305. const docFragmentChildren = Array.from( data.content.getChildren() );
  54306. let modelRange;
  54307. // Make sure only <img> elements are dropped or pasted. Otherwise, if there some other HTML
  54308. // mixed up, this should be handled as a regular paste.
  54309. if ( !docFragmentChildren.every( imageUtils.isInlineImageView ) ) {
  54310. return;
  54311. }
  54312. // When drag and dropping, data.targetRanges specifies where to drop because
  54313. // this is usually a different place than the current model selection (the user
  54314. // uses a drop marker to specify the drop location).
  54315. if ( data.targetRanges ) {
  54316. modelRange = editor.editing.mapper.toModelRange( data.targetRanges[ 0 ] );
  54317. }
  54318. // Pasting, however, always occurs at the current model selection.
  54319. else {
  54320. modelRange = model.document.selection.getFirstRange();
  54321. }
  54322. const selection = model.createSelection( modelRange );
  54323. // Convert inline images into block images only when the currently selected block is empty
  54324. // (e.g. an empty paragraph) or some object is selected (to replace it).
  54325. if ( Object(_image_utils__WEBPACK_IMPORTED_MODULE_7__["determineImageTypeForInsertionAtSelection"])( model.schema, selection ) === 'imageBlock' ) {
  54326. const writer = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_2__["UpcastWriter"]( editingView.document );
  54327. // Wrap <img ... /> -> <figure class="image"><img .../></figure>
  54328. const blockViewImages = docFragmentChildren.map(
  54329. inlineViewImage => writer.createElement( 'figure', { class: 'image' }, inlineViewImage )
  54330. );
  54331. data.content = writer.createDocumentFragment( blockViewImages );
  54332. }
  54333. } );
  54334. }
  54335. }
  54336. /***/ }),
  54337. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js":
  54338. /*!**************************************************************************!*\
  54339. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js ***!
  54340. \**************************************************************************/
  54341. /*! exports provided: default */
  54342. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54343. "use strict";
  54344. __webpack_require__.r(__webpack_exports__);
  54345. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageEditing; });
  54346. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  54347. /* harmony import */ var _imageloadobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imageloadobserver */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js");
  54348. /* harmony import */ var _insertimagecommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./insertimagecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/image/insertimagecommand.js");
  54349. /* harmony import */ var _imageutils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../imageutils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageutils.js");
  54350. /**
  54351. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  54352. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54353. */
  54354. /**
  54355. * @module image/image/imageediting
  54356. */
  54357. /**
  54358. * The image engine plugin. This module loads common code shared between
  54359. * {@link module:image/image/imageinlineediting~ImageInlineEditing} and
  54360. * {@link module:image/image/imageblockediting~ImageBlockEditing} plugins.
  54361. *
  54362. * This plugin registers the {@link module:image/image/insertimagecommand~InsertImageCommand 'insertImage'} command.
  54363. *
  54364. * @extends module:core/plugin~Plugin
  54365. */
  54366. class ImageEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  54367. /**
  54368. * @inheritDoc
  54369. */
  54370. static get requires() {
  54371. return [ _imageutils__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  54372. }
  54373. /**
  54374. * @inheritDoc
  54375. */
  54376. static get pluginName() {
  54377. return 'ImageEditing';
  54378. }
  54379. /**
  54380. * @inheritDoc
  54381. */
  54382. init() {
  54383. const editor = this.editor;
  54384. const conversion = editor.conversion;
  54385. // See https://github.com/ckeditor/ckeditor5-image/issues/142.
  54386. editor.editing.view.addObserver( _imageloadobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
  54387. conversion.for( 'upcast' )
  54388. .attributeToAttribute( {
  54389. view: {
  54390. name: 'img',
  54391. key: 'alt'
  54392. },
  54393. model: 'alt'
  54394. } )
  54395. .attributeToAttribute( {
  54396. view: {
  54397. name: 'img',
  54398. key: 'srcset'
  54399. },
  54400. model: {
  54401. key: 'srcset',
  54402. value: viewImage => {
  54403. const value = {
  54404. data: viewImage.getAttribute( 'srcset' )
  54405. };
  54406. if ( viewImage.hasAttribute( 'width' ) ) {
  54407. value.width = viewImage.getAttribute( 'width' );
  54408. }
  54409. return value;
  54410. }
  54411. }
  54412. } );
  54413. const insertImageCommand = new _insertimagecommand__WEBPACK_IMPORTED_MODULE_2__["default"]( editor );
  54414. // Register `insertImage` command and add `imageInsert` command as an alias for backward compatibility.
  54415. editor.commands.add( 'insertImage', insertImageCommand );
  54416. editor.commands.add( 'imageInsert', insertImageCommand );
  54417. }
  54418. }
  54419. /***/ }),
  54420. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageinlineediting.js":
  54421. /*!********************************************************************************!*\
  54422. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/imageinlineediting.js ***!
  54423. \********************************************************************************/
  54424. /*! exports provided: default */
  54425. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54426. "use strict";
  54427. __webpack_require__.r(__webpack_exports__);
  54428. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageInlineEditing; });
  54429. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  54430. /* harmony import */ var ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/clipboard */ "./node_modules/ckeditor5/src/clipboard.js");
  54431. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  54432. /* harmony import */ var _converters__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./converters */ "./node_modules/@ckeditor/ckeditor5-image/src/image/converters.js");
  54433. /* harmony import */ var _imageediting__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./imageediting */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js");
  54434. /* harmony import */ var _imagetypecommand__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./imagetypecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imagetypecommand.js");
  54435. /* harmony import */ var _imageutils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../imageutils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageutils.js");
  54436. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  54437. /**
  54438. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  54439. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54440. */
  54441. /**
  54442. * @module image/image/imageinlineediting
  54443. */
  54444. /**
  54445. * The image inline plugin.
  54446. *
  54447. * It registers:
  54448. *
  54449. * * `<imageInline>` as an inline element in the document schema, and allows `alt`, `src` and `srcset` attributes.
  54450. * * converters for editing and data pipelines.
  54451. * * {@link module:image/image/imagetypecommand~ImageTypeCommand `'imageTypeInline'`} command that converts block images into
  54452. * inline images.
  54453. *
  54454. * @extends module:core/plugin~Plugin
  54455. */
  54456. class ImageInlineEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  54457. /**
  54458. * @inheritDoc
  54459. */
  54460. static get requires() {
  54461. return [ _imageediting__WEBPACK_IMPORTED_MODULE_4__["default"], _imageutils__WEBPACK_IMPORTED_MODULE_6__["default"], ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_1__["ClipboardPipeline"] ];
  54462. }
  54463. /**
  54464. * @inheritDoc
  54465. */
  54466. static get pluginName() {
  54467. return 'ImageInlineEditing';
  54468. }
  54469. /**
  54470. * @inheritDoc
  54471. */
  54472. init() {
  54473. const editor = this.editor;
  54474. const schema = editor.model.schema;
  54475. // Converters 'alt' and 'srcset' are added in 'ImageEditing' plugin.
  54476. schema.register( 'imageInline', {
  54477. isObject: true,
  54478. isInline: true,
  54479. allowWhere: '$text',
  54480. allowAttributesOf: '$text',
  54481. allowAttributes: [ 'alt', 'src', 'srcset' ]
  54482. } );
  54483. // Disallow inline images in captions (for now). This is the best spot to do that because
  54484. // independent packages can introduce captions (ImageCaption, TableCaption, etc.) so better this
  54485. // be future-proof.
  54486. schema.addChildCheck( ( context, childDefinition ) => {
  54487. if ( context.endsWith( 'caption' ) && childDefinition.name === 'imageInline' ) {
  54488. return false;
  54489. }
  54490. } );
  54491. this._setupConversion();
  54492. if ( editor.plugins.has( 'ImageBlockEditing' ) ) {
  54493. editor.commands.add( 'imageTypeInline', new _imagetypecommand__WEBPACK_IMPORTED_MODULE_5__["default"]( this.editor, 'imageInline' ) );
  54494. this._setupClipboardIntegration();
  54495. }
  54496. }
  54497. /**
  54498. * Configures conversion pipelines to support upcasting and downcasting
  54499. * inline images (inline image widgets) and their attributes.
  54500. *
  54501. * @private
  54502. */
  54503. _setupConversion() {
  54504. const editor = this.editor;
  54505. const t = editor.t;
  54506. const conversion = editor.conversion;
  54507. const imageUtils = editor.plugins.get( 'ImageUtils' );
  54508. conversion.for( 'dataDowncast' )
  54509. .elementToElement( {
  54510. model: 'imageInline',
  54511. view: ( modelElement, { writer } ) => writer.createEmptyElement( 'img' )
  54512. } );
  54513. conversion.for( 'editingDowncast' )
  54514. .elementToElement( {
  54515. model: 'imageInline',
  54516. view: ( modelElement, { writer } ) => imageUtils.toImageWidget(
  54517. Object(_image_utils__WEBPACK_IMPORTED_MODULE_7__["createImageViewElement"])( writer, 'imageInline' ), writer, t( 'image widget' )
  54518. )
  54519. } );
  54520. conversion.for( 'downcast' )
  54521. .add( Object(_converters__WEBPACK_IMPORTED_MODULE_3__["downcastImageAttribute"])( imageUtils, 'imageInline', 'src' ) )
  54522. .add( Object(_converters__WEBPACK_IMPORTED_MODULE_3__["downcastImageAttribute"])( imageUtils, 'imageInline', 'alt' ) )
  54523. .add( Object(_converters__WEBPACK_IMPORTED_MODULE_3__["downcastSrcsetAttribute"])( imageUtils, 'imageInline' ) );
  54524. // More image related upcasts are in 'ImageEditing' plugin.
  54525. conversion.for( 'upcast' )
  54526. .elementToElement( {
  54527. view: Object(_image_utils__WEBPACK_IMPORTED_MODULE_7__["getImgViewElementMatcher"])( editor, 'imageInline' ),
  54528. model: ( viewImage, { writer } ) => writer.createElement(
  54529. 'imageInline',
  54530. viewImage.hasAttribute( 'src' ) ? { src: viewImage.getAttribute( 'src' ) } : null
  54531. )
  54532. } );
  54533. }
  54534. /**
  54535. * Integrates the plugin with the clipboard pipeline.
  54536. *
  54537. * Idea is that the feature should recognize the user's intent when an **block** image is
  54538. * pasted or dropped. If such an image is pasted/dropped into a non-empty block
  54539. * (e.g. a paragraph with some text) it gets converted into an inline image on the fly.
  54540. *
  54541. * We assume this is the user's intent if they decided to put their image there.
  54542. *
  54543. * **Note**: If a block image has a caption, it will not be converted to an inline image
  54544. * to avoid the confusion. Captions are added on purpose and they should never be lost
  54545. * in the clipboard pipeline.
  54546. *
  54547. * See the `ImageBlockEditing` for the similar integration that works in the opposite direction.
  54548. *
  54549. * @private
  54550. */
  54551. _setupClipboardIntegration() {
  54552. const editor = this.editor;
  54553. const model = editor.model;
  54554. const editingView = editor.editing.view;
  54555. const imageUtils = editor.plugins.get( 'ImageUtils' );
  54556. this.listenTo( editor.plugins.get( 'ClipboardPipeline' ), 'inputTransformation', ( evt, data ) => {
  54557. const docFragmentChildren = Array.from( data.content.getChildren() );
  54558. let modelRange;
  54559. // Make sure only <figure class="image"></figure> elements are dropped or pasted. Otherwise, if there some other HTML
  54560. // mixed up, this should be handled as a regular paste.
  54561. if ( !docFragmentChildren.every( imageUtils.isBlockImageView ) ) {
  54562. return;
  54563. }
  54564. // When drag and dropping, data.targetRanges specifies where to drop because
  54565. // this is usually a different place than the current model selection (the user
  54566. // uses a drop marker to specify the drop location).
  54567. if ( data.targetRanges ) {
  54568. modelRange = editor.editing.mapper.toModelRange( data.targetRanges[ 0 ] );
  54569. }
  54570. // Pasting, however, always occurs at the current model selection.
  54571. else {
  54572. modelRange = model.document.selection.getFirstRange();
  54573. }
  54574. const selection = model.createSelection( modelRange );
  54575. // Convert block images into inline images only when pasting or dropping into non-empty blocks
  54576. // and when the block is not an object (e.g. pasting to replace another widget).
  54577. if ( Object(_image_utils__WEBPACK_IMPORTED_MODULE_7__["determineImageTypeForInsertionAtSelection"])( model.schema, selection ) === 'imageInline' ) {
  54578. const writer = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_2__["UpcastWriter"]( editingView.document );
  54579. // Unwrap <figure class="image"><img .../></figure> -> <img ... />
  54580. // but <figure class="image"><img .../><figcaption>...</figcaption></figure> -> stays the same
  54581. const inlineViewImages = docFragmentChildren.map( blockViewImage => {
  54582. // If there's just one child, it can be either <img /> or <a><img></a>.
  54583. // If there are other children than <img>, this means that the block image
  54584. // has a caption or some other features and this kind of image should be
  54585. // pasted/dropped without modifications.
  54586. if ( blockViewImage.childCount === 1 ) {
  54587. // Pass the attributes which are present only in the <figure> to the <img>
  54588. // (e.g. the style="width:10%" attribute applied by the ImageResize plugin).
  54589. Array.from( blockViewImage.getAttributes() )
  54590. .forEach( attribute => writer.setAttribute(
  54591. ...attribute,
  54592. imageUtils.findViewImgElement( blockViewImage )
  54593. ) );
  54594. return blockViewImage.getChild( 0 );
  54595. } else {
  54596. return blockViewImage;
  54597. }
  54598. } );
  54599. data.content = writer.createDocumentFragment( inlineViewImages );
  54600. }
  54601. } );
  54602. }
  54603. }
  54604. /***/ }),
  54605. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js":
  54606. /*!*******************************************************************************!*\
  54607. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js ***!
  54608. \*******************************************************************************/
  54609. /*! exports provided: default */
  54610. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54611. "use strict";
  54612. __webpack_require__.r(__webpack_exports__);
  54613. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageLoadObserver; });
  54614. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  54615. /**
  54616. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  54617. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54618. */
  54619. /**
  54620. * @module image/image/imageloadobserver
  54621. */
  54622. /**
  54623. * Observes all new images added to the {@link module:engine/view/document~Document},
  54624. * fires {@link module:engine/view/document~Document#event:imageLoaded} and
  54625. * {@link module:engine/view/document~Document#event:layoutChanged} event every time when the new image
  54626. * has been loaded.
  54627. *
  54628. * **Note:** This event is not fired for images that has been added to the document and rendered as `complete` (already loaded).
  54629. *
  54630. * @extends module:engine/view/observer/observer~Observer
  54631. */
  54632. class ImageLoadObserver extends ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Observer"] {
  54633. /**
  54634. * @inheritDoc
  54635. */
  54636. observe( domRoot ) {
  54637. this.listenTo( domRoot, 'load', ( event, domEvent ) => {
  54638. const domElement = domEvent.target;
  54639. if ( this.checkShouldIgnoreEventFromTarget( domElement ) ) {
  54640. return;
  54641. }
  54642. if ( domElement.tagName == 'IMG' ) {
  54643. this._fireEvents( domEvent );
  54644. }
  54645. // Use capture phase for better performance (#4504).
  54646. }, { useCapture: true } );
  54647. }
  54648. /**
  54649. * Fires {@link module:engine/view/document~Document#event:layoutChanged} and
  54650. * {@link module:engine/view/document~Document#event:imageLoaded}
  54651. * if observer {@link #isEnabled is enabled}.
  54652. *
  54653. * @protected
  54654. * @param {Event} domEvent The DOM event.
  54655. */
  54656. _fireEvents( domEvent ) {
  54657. if ( this.isEnabled ) {
  54658. this.document.fire( 'layoutChanged' );
  54659. this.document.fire( 'imageLoaded', domEvent );
  54660. }
  54661. }
  54662. }
  54663. /**
  54664. * Fired when an <img/> DOM element has been loaded in the DOM root.
  54665. *
  54666. * Introduced by {@link module:image/image/imageloadobserver~ImageLoadObserver}.
  54667. *
  54668. * @see module:image/image/imageloadobserver~ImageLoadObserver
  54669. * @event module:engine/view/document~Document#event:imageLoaded
  54670. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  54671. */
  54672. /***/ }),
  54673. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/imagetypecommand.js":
  54674. /*!******************************************************************************!*\
  54675. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/imagetypecommand.js ***!
  54676. \******************************************************************************/
  54677. /*! exports provided: default */
  54678. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54679. "use strict";
  54680. __webpack_require__.r(__webpack_exports__);
  54681. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageTypeCommand; });
  54682. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  54683. /**
  54684. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  54685. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54686. */
  54687. /**
  54688. * @module image/image/imagetypecommand
  54689. */
  54690. /**
  54691. * The image type command. It changes the type of a selected image, depending on the configuration.
  54692. *
  54693. * @extends module:core/command~Command
  54694. */
  54695. class ImageTypeCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  54696. /**
  54697. * @inheritDoc
  54698. *
  54699. * @param {module:core/editor/editor~Editor} editor
  54700. * @param {'imageBlock'|'imageInline'} modelElementName Model element name the command converts to.
  54701. */
  54702. constructor( editor, modelElementName ) {
  54703. super( editor );
  54704. /**
  54705. * Model element name the command converts to.
  54706. *
  54707. * @readonly
  54708. * @private
  54709. * @member {'imageBlock'|'imageInline'}
  54710. */
  54711. this._modelElementName = modelElementName;
  54712. }
  54713. /**
  54714. * @inheritDoc
  54715. */
  54716. refresh() {
  54717. const editor = this.editor;
  54718. const imageUtils = editor.plugins.get( 'ImageUtils' );
  54719. const element = imageUtils.getClosestSelectedImageElement( this.editor.model.document.selection );
  54720. if ( this._modelElementName === 'imageBlock' ) {
  54721. this.isEnabled = imageUtils.isInlineImage( element );
  54722. } else {
  54723. this.isEnabled = imageUtils.isBlockImage( element );
  54724. }
  54725. }
  54726. /**
  54727. * Executes the command and changes the type of a selected image.
  54728. *
  54729. * @fires execute
  54730. * @returns {Object|null} An object containing references to old and new model image elements
  54731. * (for before and after the change) so external integrations can hook into the decorated
  54732. * `execute` event and handle this change. `null` if the type change failed.
  54733. */
  54734. execute() {
  54735. const editor = this.editor;
  54736. const model = this.editor.model;
  54737. const imageUtils = editor.plugins.get( 'ImageUtils' );
  54738. const oldElement = imageUtils.getClosestSelectedImageElement( model.document.selection );
  54739. const attributes = Object.fromEntries( oldElement.getAttributes() );
  54740. // Don't change image type if "src" is missing (a broken image), unless there's "uploadId" set.
  54741. // This state may happen during image upload (before it finishes) and it should be possible to change type
  54742. // of the image in the meantime.
  54743. if ( !attributes.src && !attributes.uploadId ) {
  54744. return null;
  54745. }
  54746. return model.change( writer => {
  54747. // Get all markers that contain the old image element.
  54748. const markers = Array.from( model.markers )
  54749. .filter( marker => marker.getRange().containsItem( oldElement ) );
  54750. const newElement = imageUtils.insertImage( attributes, model.createSelection( oldElement, 'on' ), this._modelElementName );
  54751. if ( !newElement ) {
  54752. return null;
  54753. }
  54754. const newElementRange = writer.createRangeOn( newElement );
  54755. // Expand the previously intersecting markers' ranges to include the new image element.
  54756. for ( const marker of markers ) {
  54757. const markerRange = marker.getRange();
  54758. // Join the survived part of the old marker range with the new element range
  54759. // (loosely because there could be some new paragraph or the existing one might got split).
  54760. const range = markerRange.root.rootName != '$graveyard' ?
  54761. markerRange.getJoined( newElementRange, true ) : newElementRange;
  54762. writer.updateMarker( marker, { range } );
  54763. }
  54764. return {
  54765. oldElement,
  54766. newElement
  54767. };
  54768. } );
  54769. }
  54770. }
  54771. /***/ }),
  54772. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/insertimagecommand.js":
  54773. /*!********************************************************************************!*\
  54774. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/insertimagecommand.js ***!
  54775. \********************************************************************************/
  54776. /*! exports provided: default */
  54777. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54778. "use strict";
  54779. __webpack_require__.r(__webpack_exports__);
  54780. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertImageCommand; });
  54781. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  54782. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  54783. /**
  54784. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  54785. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54786. */
  54787. /**
  54788. * @module image/image/insertimagecommand
  54789. */
  54790. /**
  54791. * Insert image command.
  54792. *
  54793. * The command is registered by the {@link module:image/image/imageediting~ImageEditing} plugin as `insertImage`
  54794. * and it is also available via aliased `imageInsert` name.
  54795. *
  54796. * In order to insert an image at the current selection position
  54797. * (according to the {@link module:widget/utils~findOptimalInsertionRange} algorithm),
  54798. * execute the command and specify the image source:
  54799. *
  54800. * editor.execute( 'insertImage', { source: 'http://url.to.the/image' } );
  54801. *
  54802. * It is also possible to insert multiple images at once:
  54803. *
  54804. * editor.execute( 'insertImage', {
  54805. * source: [
  54806. * 'path/to/image.jpg',
  54807. * 'path/to/other-image.jpg'
  54808. * ]
  54809. * } );
  54810. *
  54811. * If you want to take the full control over the process, you can specify individual model attributes:
  54812. *
  54813. * editor.execute( 'insertImage', {
  54814. * source: [
  54815. * { src: 'path/to/image.jpg', alt: 'First alt text' },
  54816. * { src: 'path/to/other-image.jpg', alt: 'Second alt text', customAttribute: 'My attribute value' }
  54817. * ]
  54818. * } );
  54819. *
  54820. * @extends module:core/command~Command
  54821. */
  54822. class InsertImageCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  54823. /**
  54824. * @inheritDoc
  54825. */
  54826. constructor( editor ) {
  54827. super( editor );
  54828. const configImageInsertType = editor.config.get( 'image.insert.type' );
  54829. if ( !editor.plugins.has( 'ImageBlockEditing' ) ) {
  54830. if ( configImageInsertType === 'block' ) {
  54831. /**
  54832. * The {@link module:image/imageblock~ImageBlock} plugin must be enabled to allow inserting block images. See
  54833. * {@link module:image/imageinsert~ImageInsertConfig#type} to learn more.
  54834. *
  54835. * @error image-block-plugin-required
  54836. */
  54837. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["logWarning"])( 'image-block-plugin-required' );
  54838. }
  54839. }
  54840. if ( !editor.plugins.has( 'ImageInlineEditing' ) ) {
  54841. if ( configImageInsertType === 'inline' ) {
  54842. /**
  54843. * The {@link module:image/imageinline~ImageInline} plugin must be enabled to allow inserting inline images. See
  54844. * {@link module:image/imageinsert~ImageInsertConfig#type} to learn more.
  54845. *
  54846. * @error image-inline-plugin-required
  54847. */
  54848. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["logWarning"])( 'image-inline-plugin-required' );
  54849. }
  54850. }
  54851. }
  54852. /**
  54853. * @inheritDoc
  54854. */
  54855. refresh() {
  54856. this.isEnabled = this.editor.plugins.get( 'ImageUtils' ).isImageAllowed();
  54857. }
  54858. /**
  54859. * Executes the command.
  54860. *
  54861. * @fires execute
  54862. * @param {Object} options Options for the executed command.
  54863. * @param {String|Array.<String>|Array.<Object>} options.source The image source or an array of image sources to insert.
  54864. * See the documentation of the command to learn more about accepted formats.
  54865. */
  54866. execute( options ) {
  54867. const sourceDefinitions = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["toArray"])( options.source );
  54868. const selection = this.editor.model.document.selection;
  54869. const imageUtils = this.editor.plugins.get( 'ImageUtils' );
  54870. // In case of multiple images, each image (starting from the 2nd) will be inserted at a position that
  54871. // follows the previous one. That will move the selection and, to stay on the safe side and make sure
  54872. // all images inherit the same selection attributes, they are collected beforehand.
  54873. //
  54874. // Applying these attributes ensures, for instance, that inserting an (inline) image into a link does
  54875. // not split that link but preserves its continuity.
  54876. //
  54877. // Note: Selection attributes that do not make sense for images will be filtered out by insertImage() anyway.
  54878. const selectionAttributes = Object.fromEntries( selection.getAttributes() );
  54879. sourceDefinitions.forEach( ( sourceDefinition, index ) => {
  54880. const selectedElement = selection.getSelectedElement();
  54881. if ( typeof sourceDefinition === 'string' ) {
  54882. sourceDefinition = { src: sourceDefinition };
  54883. }
  54884. // Inserting of an inline image replace the selected element and make a selection on the inserted image.
  54885. // Therefore inserting multiple inline images requires creating position after each element.
  54886. if ( index && selectedElement && imageUtils.isImage( selectedElement ) ) {
  54887. const position = this.editor.model.createPositionAfter( selectedElement );
  54888. imageUtils.insertImage( { ...sourceDefinition, ...selectionAttributes }, position );
  54889. } else {
  54890. imageUtils.insertImage( { ...sourceDefinition, ...selectionAttributes } );
  54891. }
  54892. } );
  54893. }
  54894. }
  54895. /***/ }),
  54896. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/ui/utils.js":
  54897. /*!**********************************************************************!*\
  54898. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/ui/utils.js ***!
  54899. \**********************************************************************/
  54900. /*! exports provided: repositionContextualBalloon, getBalloonPositionData */
  54901. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54902. "use strict";
  54903. __webpack_require__.r(__webpack_exports__);
  54904. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repositionContextualBalloon", function() { return repositionContextualBalloon; });
  54905. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBalloonPositionData", function() { return getBalloonPositionData; });
  54906. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  54907. /**
  54908. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  54909. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54910. */
  54911. /**
  54912. * @module image/image/ui/utils
  54913. */
  54914. /**
  54915. * A helper utility that positions the
  54916. * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} instance
  54917. * with respect to the image in the editor content, if one is selected.
  54918. *
  54919. * @param {module:core/editor/editor~Editor} editor The editor instance.
  54920. */
  54921. function repositionContextualBalloon( editor ) {
  54922. const balloon = editor.plugins.get( 'ContextualBalloon' );
  54923. if ( editor.plugins.get( 'ImageUtils' ).getClosestSelectedImageWidget( editor.editing.view.document.selection ) ) {
  54924. const position = getBalloonPositionData( editor );
  54925. balloon.updatePosition( position );
  54926. }
  54927. }
  54928. /**
  54929. * Returns the positioning options that control the geometry of the
  54930. * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect
  54931. * to the selected element in the editor content.
  54932. *
  54933. * @param {module:core/editor/editor~Editor} editor The editor instance.
  54934. * @returns {module:utils/dom/position~Options}
  54935. */
  54936. function getBalloonPositionData( editor ) {
  54937. const editingView = editor.editing.view;
  54938. const defaultPositions = ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["BalloonPanelView"].defaultPositions;
  54939. const imageUtils = editor.plugins.get( 'ImageUtils' );
  54940. return {
  54941. target: editingView.domConverter.viewToDom( imageUtils.getClosestSelectedImageWidget( editingView.document.selection ) ),
  54942. positions: [
  54943. defaultPositions.northArrowSouth,
  54944. defaultPositions.northArrowSouthWest,
  54945. defaultPositions.northArrowSouthEast,
  54946. defaultPositions.southArrowNorth,
  54947. defaultPositions.southArrowNorthWest,
  54948. defaultPositions.southArrowNorthEast,
  54949. defaultPositions.viewportStickyNorth
  54950. ]
  54951. };
  54952. }
  54953. /***/ }),
  54954. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js":
  54955. /*!*******************************************************************!*\
  54956. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js ***!
  54957. \*******************************************************************/
  54958. /*! exports provided: createImageViewElement, getImgViewElementMatcher, determineImageTypeForInsertionAtSelection */
  54959. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54960. "use strict";
  54961. __webpack_require__.r(__webpack_exports__);
  54962. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createImageViewElement", function() { return createImageViewElement; });
  54963. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getImgViewElementMatcher", function() { return getImgViewElementMatcher; });
  54964. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "determineImageTypeForInsertionAtSelection", function() { return determineImageTypeForInsertionAtSelection; });
  54965. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  54966. /**
  54967. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  54968. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54969. */
  54970. /**
  54971. * @module image/image/utils
  54972. */
  54973. /**
  54974. * Creates a view element representing the image of provided image type.
  54975. *
  54976. * An 'imageBlock' type (block image):
  54977. *
  54978. * <figure class="image"><img></img></figure>
  54979. *
  54980. * An 'imageInline' type (inline image):
  54981. *
  54982. * <span class="image-inline"><img></img></span>
  54983. *
  54984. * Note that `alt` and `src` attributes are converted separately, so they are not included.
  54985. *
  54986. * @protected
  54987. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  54988. * @param {'imageBlock'|'imageInline'} imageType The type of created image.
  54989. * @returns {module:engine/view/containerelement~ContainerElement}
  54990. */
  54991. function createImageViewElement( writer, imageType ) {
  54992. const emptyElement = writer.createEmptyElement( 'img' );
  54993. const container = imageType === 'imageBlock' ?
  54994. writer.createContainerElement( 'figure', { class: 'image' } ) :
  54995. writer.createContainerElement( 'span', { class: 'image-inline' }, { isAllowedInsideAttributeElement: true } );
  54996. writer.insert( writer.createPositionAt( container, 0 ), emptyElement );
  54997. return container;
  54998. }
  54999. /**
  55000. * A function returning a `MatcherPattern` for a particular type of View images.
  55001. *
  55002. * @protected
  55003. * @param {module:core/editor/editor~Editor} editor
  55004. * @param {'imageBlock'|'imageInline'} matchImageType The type of created image.
  55005. * @returns {module:engine/view/matcher~MatcherPattern}
  55006. */
  55007. function getImgViewElementMatcher( editor, matchImageType ) {
  55008. if ( editor.plugins.has( 'ImageInlineEditing' ) !== editor.plugins.has( 'ImageBlockEditing' ) ) {
  55009. return { name: 'img' };
  55010. }
  55011. const imageUtils = editor.plugins.get( 'ImageUtils' );
  55012. return element => {
  55013. // Check if view element is an `img`.
  55014. if ( !imageUtils.isInlineImageView( element ) ) {
  55015. return null;
  55016. }
  55017. // The <img> can be standalone, wrapped in <figure>...</figure> (ImageBlock plugin) or
  55018. // wrapped in <figure><a>...</a></figure> (LinkImage plugin).
  55019. const imageType = element.findAncestor( imageUtils.isBlockImageView ) ? 'imageBlock' : 'imageInline';
  55020. if ( imageType !== matchImageType ) {
  55021. return null;
  55022. }
  55023. return { name: true };
  55024. };
  55025. }
  55026. /**
  55027. * Considering the current model selection, it returns the name of the model image element
  55028. * (`'imageBlock'` or `'imageInline'`) that will make most sense from the UX perspective if a new
  55029. * image was inserted (also: uploaded, dropped, pasted) at that selection.
  55030. *
  55031. * The assumption is that inserting images into empty blocks or on other block widgets should
  55032. * produce block images. Inline images should be inserted in other cases, e.g. in paragraphs
  55033. * that already contain some text.
  55034. *
  55035. * @protected
  55036. * @param {module:engine/model/schema~Schema} schema
  55037. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  55038. * @returns {'imageBlock'|'imageInline'}
  55039. */
  55040. function determineImageTypeForInsertionAtSelection( schema, selection ) {
  55041. const firstBlock = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["first"])( selection.getSelectedBlocks() );
  55042. // Insert a block image if the selection is not in/on block elements or it's on a block widget.
  55043. if ( !firstBlock || schema.isObject( firstBlock ) ) {
  55044. return 'imageBlock';
  55045. }
  55046. // A block image should also be inserted into an empty block element
  55047. // (that is not an empty list item so the list won't get split).
  55048. if ( firstBlock.isEmpty && firstBlock.name != 'listItem' ) {
  55049. return 'imageBlock';
  55050. }
  55051. // Otherwise insert an inline image.
  55052. return 'imageInline';
  55053. }
  55054. /***/ }),
  55055. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageblock.js":
  55056. /*!******************************************************************!*\
  55057. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageblock.js ***!
  55058. \******************************************************************/
  55059. /*! exports provided: default */
  55060. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55061. "use strict";
  55062. __webpack_require__.r(__webpack_exports__);
  55063. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageBlock; });
  55064. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  55065. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  55066. /* harmony import */ var _imagetextalternative__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imagetextalternative */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative.js");
  55067. /* harmony import */ var _image_imageblockediting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./image/imageblockediting */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageblockediting.js");
  55068. /* harmony import */ var _theme_image_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../theme/image.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/image.css");
  55069. /**
  55070. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55071. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55072. */
  55073. /**
  55074. * @module image/imageblock
  55075. */
  55076. /**
  55077. * The image inline plugin.
  55078. *
  55079. * This is a "glue" plugin which loads the following plugins:
  55080. *
  55081. * * {@link module:image/image/imageblockediting~ImageBlockEditing},
  55082. * * {@link module:image/imagetextalternative~ImageTextAlternative}.
  55083. *
  55084. * Usually, it is used in conjunction with other plugins from this package. See the {@glink api/image package page}
  55085. * for more information.
  55086. *
  55087. * @extends module:core/plugin~Plugin
  55088. */
  55089. class ImageBlock extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  55090. /**
  55091. * @inheritDoc
  55092. */
  55093. static get requires() {
  55094. return [ _image_imageblockediting__WEBPACK_IMPORTED_MODULE_3__["default"], ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["Widget"], _imagetextalternative__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  55095. }
  55096. /**
  55097. * @inheritDoc
  55098. */
  55099. static get pluginName() {
  55100. return 'ImageBlock';
  55101. }
  55102. }
  55103. /***/ }),
  55104. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption.js":
  55105. /*!********************************************************************!*\
  55106. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagecaption.js ***!
  55107. \********************************************************************/
  55108. /*! exports provided: default */
  55109. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55110. "use strict";
  55111. __webpack_require__.r(__webpack_exports__);
  55112. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageCaption; });
  55113. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  55114. /* harmony import */ var _imagecaption_imagecaptionediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imagecaption/imagecaptionediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionediting.js");
  55115. /* harmony import */ var _imagecaption_imagecaptionui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imagecaption/imagecaptionui */ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionui.js");
  55116. /* harmony import */ var _theme_imagecaption_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/imagecaption.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css");
  55117. /**
  55118. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55119. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55120. */
  55121. /**
  55122. * @module image/imagecaption
  55123. */
  55124. /**
  55125. * The image caption plugin.
  55126. *
  55127. * For a detailed overview, check the {@glink features/images/images-captions image caption} documentation.
  55128. *
  55129. * @extends module:core/plugin~Plugin
  55130. */
  55131. class ImageCaption extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  55132. /**
  55133. * @inheritDoc
  55134. */
  55135. static get requires() {
  55136. return [ _imagecaption_imagecaptionediting__WEBPACK_IMPORTED_MODULE_1__["default"], _imagecaption_imagecaptionui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  55137. }
  55138. /**
  55139. * @inheritDoc
  55140. */
  55141. static get pluginName() {
  55142. return 'ImageCaption';
  55143. }
  55144. }
  55145. /***/ }),
  55146. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionediting.js":
  55147. /*!****************************************************************************************!*\
  55148. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionediting.js ***!
  55149. \****************************************************************************************/
  55150. /*! exports provided: default */
  55151. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55152. "use strict";
  55153. __webpack_require__.r(__webpack_exports__);
  55154. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageCaptionEditing; });
  55155. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  55156. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  55157. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  55158. /* harmony import */ var _toggleimagecaptioncommand__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toggleimagecaptioncommand */ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/toggleimagecaptioncommand.js");
  55159. /* harmony import */ var _imageutils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../imageutils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageutils.js");
  55160. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/utils.js");
  55161. /**
  55162. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55163. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55164. */
  55165. /**
  55166. * @module image/imagecaption/imagecaptionediting
  55167. */
  55168. /**
  55169. * The image caption engine plugin. It is responsible for:
  55170. *
  55171. * * registering converters for the caption element,
  55172. * * registering converters for the caption model attribute,
  55173. * * registering the {@link module:image/imagecaption/toggleimagecaptioncommand~ToggleImageCaptionCommand `toggleImageCaption`} command.
  55174. *
  55175. * @extends module:core/plugin~Plugin
  55176. */
  55177. class ImageCaptionEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  55178. /**
  55179. * @inheritDoc
  55180. */
  55181. static get requires() {
  55182. return [ _imageutils__WEBPACK_IMPORTED_MODULE_4__["default"] ];
  55183. }
  55184. /**
  55185. * @inheritDoc
  55186. */
  55187. static get pluginName() {
  55188. return 'ImageCaptionEditing';
  55189. }
  55190. /**
  55191. * @inheritDoc
  55192. */
  55193. constructor( editor ) {
  55194. super( editor );
  55195. /**
  55196. * A map that keeps saved JSONified image captions and image model elements they are
  55197. * associated with.
  55198. *
  55199. * To learn more about this system, see {@link #_saveCaption}.
  55200. *
  55201. * @member {WeakMap.<module:engine/model/element~Element,Object>}
  55202. */
  55203. this._savedCaptionsMap = new WeakMap();
  55204. }
  55205. /**
  55206. * @inheritDoc
  55207. */
  55208. init() {
  55209. const editor = this.editor;
  55210. const schema = editor.model.schema;
  55211. // Schema configuration.
  55212. if ( !schema.isRegistered( 'caption' ) ) {
  55213. schema.register( 'caption', {
  55214. allowIn: 'imageBlock',
  55215. allowContentOf: '$block',
  55216. isLimit: true
  55217. } );
  55218. } else {
  55219. schema.extend( 'caption', {
  55220. allowIn: 'imageBlock'
  55221. } );
  55222. }
  55223. editor.commands.add( 'toggleImageCaption', new _toggleimagecaptioncommand__WEBPACK_IMPORTED_MODULE_3__["default"]( this.editor ) );
  55224. this._setupConversion();
  55225. this._setupImageTypeCommandsIntegration();
  55226. }
  55227. /**
  55228. * Configures conversion pipelines to support upcasting and downcasting
  55229. * image captions.
  55230. *
  55231. * @private
  55232. */
  55233. _setupConversion() {
  55234. const editor = this.editor;
  55235. const view = editor.editing.view;
  55236. const imageUtils = editor.plugins.get( 'ImageUtils' );
  55237. const t = editor.t;
  55238. // View -> model converter for the data pipeline.
  55239. editor.conversion.for( 'upcast' ).elementToElement( {
  55240. view: element => Object(_utils__WEBPACK_IMPORTED_MODULE_5__["matchImageCaptionViewElement"])( imageUtils, element ),
  55241. model: 'caption'
  55242. } );
  55243. // Model -> view converter for the data pipeline.
  55244. editor.conversion.for( 'dataDowncast' ).elementToElement( {
  55245. model: 'caption',
  55246. view: ( modelElement, { writer } ) => {
  55247. if ( !imageUtils.isBlockImage( modelElement.parent ) ) {
  55248. return null;
  55249. }
  55250. return writer.createContainerElement( 'figcaption' );
  55251. }
  55252. } );
  55253. // Model -> view converter for the editing pipeline.
  55254. editor.conversion.for( 'editingDowncast' ).elementToElement( {
  55255. model: 'caption',
  55256. view: ( modelElement, { writer } ) => {
  55257. if ( !imageUtils.isBlockImage( modelElement.parent ) ) {
  55258. return null;
  55259. }
  55260. const figcaptionElement = writer.createEditableElement( 'figcaption' );
  55261. writer.setCustomProperty( 'imageCaption', true, figcaptionElement );
  55262. Object(ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__["enablePlaceholder"])( {
  55263. view,
  55264. element: figcaptionElement,
  55265. text: t( 'Enter image caption' ),
  55266. keepOnFocus: true
  55267. } );
  55268. return Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_2__["toWidgetEditable"])( figcaptionElement, writer );
  55269. }
  55270. } );
  55271. editor.editing.mapper.on( 'modelToViewPosition', mapModelPositionToView( view ) );
  55272. editor.data.mapper.on( 'modelToViewPosition', mapModelPositionToView( view ) );
  55273. }
  55274. /**
  55275. * Integrates with {@link module:image/image/imagetypecommand~ImageTypeCommand image type commands}
  55276. * to make sure the caption is preserved when the type of an image changes so it can be restored
  55277. * in the future if the user decides they want their caption back.
  55278. *
  55279. * @private
  55280. */
  55281. _setupImageTypeCommandsIntegration() {
  55282. const editor = this.editor;
  55283. const imageUtils = editor.plugins.get( 'ImageUtils' );
  55284. const imageTypeInlineCommand = editor.commands.get( 'imageTypeInline' );
  55285. const imageTypeBlockCommand = editor.commands.get( 'imageTypeBlock' );
  55286. const handleImageTypeChange = evt => {
  55287. // The image type command execution can be unsuccessful.
  55288. if ( !evt.return ) {
  55289. return;
  55290. }
  55291. const { oldElement, newElement } = evt.return;
  55292. /* istanbul ignore if: paranoid check */
  55293. if ( !oldElement ) {
  55294. return;
  55295. }
  55296. if ( imageUtils.isBlockImage( oldElement ) ) {
  55297. const oldCaptionElement = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getCaptionFromImageModelElement"])( oldElement );
  55298. // If the old element was a captioned block image (the caption was visible),
  55299. // simply save it so it can be restored.
  55300. if ( oldCaptionElement ) {
  55301. this._saveCaption( newElement, oldCaptionElement );
  55302. return;
  55303. }
  55304. }
  55305. const savedOldElementCaption = this._getSavedCaption( oldElement );
  55306. // If either:
  55307. //
  55308. // * the block image didn't have a visible caption,
  55309. // * the block image caption was hidden (and already saved),
  55310. // * the inline image was passed
  55311. //
  55312. // just try to "pass" the saved caption from the old image to the new image
  55313. // so it can be retrieved in the future if the user wants it back.
  55314. if ( savedOldElementCaption ) {
  55315. // Note: Since we're writing to a WeakMap, we don't bother with removing the
  55316. // [ oldElement, savedOldElementCaption ] pair from it.
  55317. this._saveCaption( newElement, savedOldElementCaption );
  55318. }
  55319. };
  55320. // Presence of the commands depends on the Image(Inline|Block)Editing plugins loaded in the editor.
  55321. if ( imageTypeInlineCommand ) {
  55322. this.listenTo( imageTypeInlineCommand, 'execute', handleImageTypeChange, { priority: 'low' } );
  55323. }
  55324. if ( imageTypeBlockCommand ) {
  55325. this.listenTo( imageTypeBlockCommand, 'execute', handleImageTypeChange, { priority: 'low' } );
  55326. }
  55327. }
  55328. /**
  55329. * Returns the saved {@link module:engine/model/element~Element#toJSON JSONified} caption
  55330. * of an image model element.
  55331. *
  55332. * See {@link #_saveCaption}.
  55333. *
  55334. * @protected
  55335. * @param {module:engine/model/element~Element} imageModelElement The model element the
  55336. * caption should be returned for.
  55337. * @returns {module:engine/model/element~Element|null} The model caption element or `null` if there is none.
  55338. */
  55339. _getSavedCaption( imageModelElement ) {
  55340. const jsonObject = this._savedCaptionsMap.get( imageModelElement );
  55341. return jsonObject ? ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__["Element"].fromJSON( jsonObject ) : null;
  55342. }
  55343. /**
  55344. * Saves a {@link module:engine/model/element~Element#toJSON JSONified} caption for
  55345. * an image element to allow restoring it in the future.
  55346. *
  55347. * A caption is saved every time it gets hidden and/or the type of an image changes. The
  55348. * user should be able to restore it on demand.
  55349. *
  55350. * **Note**: The caption cannot be stored in the image model element attribute because,
  55351. * for instance, when the model state propagates to collaborators, the attribute would get
  55352. * lost (mainly because it does not convert to anything when the caption is hidden) and
  55353. * the states of collaborators' models would de-synchronize causing numerous issues.
  55354. *
  55355. * See {@link #_getSavedCaption}.
  55356. *
  55357. * @protected
  55358. * @param {module:engine/model/element~Element} imageModelElement The model element the
  55359. * caption is saved for.
  55360. * @param {module:engine/model/element~Element} caption The caption model element to be saved.
  55361. */
  55362. _saveCaption( imageModelElement, caption ) {
  55363. this._savedCaptionsMap.set( imageModelElement, caption.toJSON() );
  55364. }
  55365. }
  55366. // Creates a mapper callback that reverses the order of `<img>` and `<figcaption>` in the image.
  55367. // Without it, `<figcaption>` would precede the `<img>` in the conversion.
  55368. //
  55369. // <imageBlock>^</imageBlock> -> <figure><img>^<caption></caption></figure>
  55370. //
  55371. // @private
  55372. // @param {module:engine/view/view~View} editingView
  55373. // @returns {Function}
  55374. function mapModelPositionToView( editingView ) {
  55375. return ( evt, data ) => {
  55376. const modelPosition = data.modelPosition;
  55377. const parent = modelPosition.parent;
  55378. if ( !parent.is( 'element', 'imageBlock' ) ) {
  55379. return;
  55380. }
  55381. const viewElement = data.mapper.toViewElement( parent );
  55382. // The "img" element is inserted by ImageBlockEditing during the downcast conversion via
  55383. // an explicit view position so the "0" position does not need any mapping.
  55384. data.viewPosition = editingView.createPositionAt( viewElement, modelPosition.offset + 1 );
  55385. };
  55386. }
  55387. /***/ }),
  55388. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionui.js":
  55389. /*!***********************************************************************************!*\
  55390. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionui.js ***!
  55391. \***********************************************************************************/
  55392. /*! exports provided: default */
  55393. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55394. "use strict";
  55395. __webpack_require__.r(__webpack_exports__);
  55396. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageCaptionUI; });
  55397. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  55398. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  55399. /* harmony import */ var _imageutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../imageutils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageutils.js");
  55400. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/utils.js");
  55401. /**
  55402. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55403. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55404. */
  55405. /**
  55406. * @module image/imagecaption/imagecaptionui
  55407. */
  55408. /**
  55409. * The image caption UI plugin. It introduces the `'toggleImageCaption'` UI button.
  55410. *
  55411. * @extends module:core/plugin~Plugin
  55412. */
  55413. class ImageCaptionUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  55414. /**
  55415. * @inheritDoc
  55416. */
  55417. static get requires() {
  55418. return [ _imageutils__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  55419. }
  55420. /**
  55421. * @inheritDoc
  55422. */
  55423. static get pluginName() {
  55424. return 'ImageCaptionUI';
  55425. }
  55426. /**
  55427. * @inheritDoc
  55428. */
  55429. init() {
  55430. const editor = this.editor;
  55431. const editingView = editor.editing.view;
  55432. const imageUtils = editor.plugins.get( 'ImageUtils' );
  55433. const t = editor.t;
  55434. editor.ui.componentFactory.add( 'toggleImageCaption', locale => {
  55435. const command = editor.commands.get( 'toggleImageCaption' );
  55436. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  55437. view.set( {
  55438. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].caption,
  55439. tooltip: true,
  55440. isToggleable: true
  55441. } );
  55442. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  55443. view.bind( 'label' ).to( command, 'value', value => value ? t( 'Toggle caption off' ) : t( 'Toggle caption on' ) );
  55444. this.listenTo( view, 'execute', () => {
  55445. editor.execute( 'toggleImageCaption', { focusCaptionOnShow: true } );
  55446. // Scroll to the selection and highlight the caption if the caption showed up.
  55447. const modelCaptionElement = Object(_utils__WEBPACK_IMPORTED_MODULE_3__["getCaptionFromModelSelection"])( imageUtils, editor.model.document.selection );
  55448. if ( modelCaptionElement ) {
  55449. const figcaptionElement = editor.editing.mapper.toViewElement( modelCaptionElement );
  55450. editingView.scrollToTheSelection();
  55451. editingView.change( writer => {
  55452. writer.addClass( 'image__caption_highlighted', figcaptionElement );
  55453. } );
  55454. }
  55455. } );
  55456. return view;
  55457. } );
  55458. }
  55459. }
  55460. /***/ }),
  55461. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/toggleimagecaptioncommand.js":
  55462. /*!**********************************************************************************************!*\
  55463. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/toggleimagecaptioncommand.js ***!
  55464. \**********************************************************************************************/
  55465. /*! exports provided: default */
  55466. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55467. "use strict";
  55468. __webpack_require__.r(__webpack_exports__);
  55469. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ToggleImageCaptionCommand; });
  55470. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  55471. /* harmony import */ var _image_imageblockediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../image/imageblockediting */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageblockediting.js");
  55472. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/utils.js");
  55473. /**
  55474. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55475. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55476. */
  55477. /**
  55478. * @module image/imagecaption/toggleimagecaptioncommand
  55479. */
  55480. /**
  55481. * The toggle image caption command.
  55482. *
  55483. * This command is registered by {@link module:image/imagecaption/imagecaptionediting~ImageCaptionEditing} as the
  55484. * `'toggleImageCaption'` editor command.
  55485. *
  55486. * Executing this command:
  55487. *
  55488. * * either adds or removes the image caption of a selected image (depending on whether the caption is present or not),
  55489. * * removes the image caption if the selection is anchored in one.
  55490. *
  55491. * // Toggle the presence of the caption.
  55492. * editor.execute( 'toggleImageCaption' );
  55493. *
  55494. * **Note**: Upon executing this command, the selection will be set on the image if previously anchored in the caption element.
  55495. *
  55496. * **Note**: You can move the selection to the caption right away as it shows up upon executing this command by using
  55497. * the `focusCaptionOnShow` option:
  55498. *
  55499. * editor.execute( 'toggleImageCaption', { focusCaptionOnShow: true } );
  55500. *
  55501. * @extends module:core/command~Command
  55502. */
  55503. class ToggleImageCaptionCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  55504. /**
  55505. * @inheritDoc
  55506. */
  55507. refresh() {
  55508. const editor = this.editor;
  55509. const imageUtils = editor.plugins.get( 'ImageUtils' );
  55510. // Only block images can get captions.
  55511. if ( !editor.plugins.has( _image_imageblockediting__WEBPACK_IMPORTED_MODULE_1__["default"] ) ) {
  55512. this.isEnabled = false;
  55513. this.value = false;
  55514. return;
  55515. }
  55516. const selection = editor.model.document.selection;
  55517. const selectedElement = selection.getSelectedElement();
  55518. if ( !selectedElement ) {
  55519. const ancestorCaptionElement = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getCaptionFromModelSelection"])( imageUtils, selection );
  55520. this.isEnabled = !!ancestorCaptionElement;
  55521. this.value = !!ancestorCaptionElement;
  55522. return;
  55523. }
  55524. // Block images support captions by default but the command should also be enabled for inline
  55525. // images because toggling the caption when one is selected should convert it into a block image.
  55526. this.isEnabled = this.editor.plugins.get( 'ImageUtils' ).isImage( selectedElement );
  55527. if ( !this.isEnabled ) {
  55528. this.value = false;
  55529. } else {
  55530. this.value = !!Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getCaptionFromImageModelElement"])( selectedElement );
  55531. }
  55532. }
  55533. /**
  55534. * Executes the command.
  55535. *
  55536. * editor.execute( 'toggleImageCaption' );
  55537. *
  55538. * @param {Object} [options] Options for the executed command.
  55539. * @param {String} [options.focusCaptionOnShow] When true and the caption shows up, the selection will be moved into it straight away.
  55540. * @fires execute
  55541. */
  55542. execute( options = {} ) {
  55543. const { focusCaptionOnShow } = options;
  55544. this.editor.model.change( writer => {
  55545. if ( this.value ) {
  55546. this._hideImageCaption( writer );
  55547. } else {
  55548. this._showImageCaption( writer, focusCaptionOnShow );
  55549. }
  55550. } );
  55551. }
  55552. /**
  55553. * Shows the caption of the `<imageBlock>` or `<imageInline>`. Also:
  55554. *
  55555. * * it converts `<imageInline>` to `<imageBlock>` to show the caption,
  55556. * * it attempts to restore the caption content from the `ImageCaptionEditing` caption registry,
  55557. * * it moves the selection to the caption right away, it the `focusCaptionOnShow` option was set.
  55558. *
  55559. * @private
  55560. * @param {module:engine/model/writer~Writer} writer
  55561. */
  55562. _showImageCaption( writer, focusCaptionOnShow ) {
  55563. const model = this.editor.model;
  55564. const selection = model.document.selection;
  55565. const imageCaptionEditing = this.editor.plugins.get( 'ImageCaptionEditing' );
  55566. let selectedImage = selection.getSelectedElement();
  55567. const savedCaption = imageCaptionEditing._getSavedCaption( selectedImage );
  55568. // Convert imageInline -> image first.
  55569. if ( this.editor.plugins.get( 'ImageUtils' ).isInlineImage( selectedImage ) ) {
  55570. this.editor.execute( 'imageTypeBlock' );
  55571. // Executing the command created a new model element. Let's pick it again.
  55572. selectedImage = selection.getSelectedElement();
  55573. }
  55574. // Try restoring the caption from the ImageCaptionEditing plugin storage.
  55575. const newCaptionElement = savedCaption || writer.createElement( 'caption' );
  55576. writer.append( newCaptionElement, selectedImage );
  55577. if ( focusCaptionOnShow ) {
  55578. writer.setSelection( newCaptionElement, 'in' );
  55579. }
  55580. }
  55581. /**
  55582. * Hides the caption of a selected image (or an image caption the selection is anchored to).
  55583. *
  55584. * The content of the caption is stored in the `ImageCaptionEditing` caption registry to make this
  55585. * a reversible action.
  55586. *
  55587. * @private
  55588. * @param {module:engine/model/writer~Writer} writer
  55589. */
  55590. _hideImageCaption( writer ) {
  55591. const editor = this.editor;
  55592. const selection = editor.model.document.selection;
  55593. const imageCaptionEditing = editor.plugins.get( 'ImageCaptionEditing' );
  55594. const imageUtils = editor.plugins.get( 'ImageUtils' );
  55595. let selectedImage = selection.getSelectedElement();
  55596. let captionElement;
  55597. if ( selectedImage ) {
  55598. captionElement = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getCaptionFromImageModelElement"])( selectedImage );
  55599. } else {
  55600. captionElement = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getCaptionFromModelSelection"])( imageUtils, selection );
  55601. selectedImage = captionElement.parent;
  55602. }
  55603. // Store the caption content so it can be restored quickly if the user changes their mind even if they toggle image<->imageInline.
  55604. imageCaptionEditing._saveCaption( selectedImage, captionElement );
  55605. writer.setSelection( selectedImage, 'on' );
  55606. writer.remove( captionElement );
  55607. }
  55608. }
  55609. /***/ }),
  55610. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/utils.js":
  55611. /*!**************************************************************************!*\
  55612. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/utils.js ***!
  55613. \**************************************************************************/
  55614. /*! exports provided: getCaptionFromImageModelElement, getCaptionFromModelSelection, matchImageCaptionViewElement */
  55615. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55616. "use strict";
  55617. __webpack_require__.r(__webpack_exports__);
  55618. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCaptionFromImageModelElement", function() { return getCaptionFromImageModelElement; });
  55619. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCaptionFromModelSelection", function() { return getCaptionFromModelSelection; });
  55620. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matchImageCaptionViewElement", function() { return matchImageCaptionViewElement; });
  55621. /**
  55622. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55623. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55624. */
  55625. /**
  55626. * @module image/imagecaption/utils
  55627. */
  55628. /**
  55629. * Returns the caption model element from a given image element. Returns `null` if no caption is found.
  55630. *
  55631. * @param {module:engine/model/element~Element} imageModelElement
  55632. * @returns {module:engine/model/element~Element|null}
  55633. */
  55634. function getCaptionFromImageModelElement( imageModelElement ) {
  55635. for ( const node of imageModelElement.getChildren() ) {
  55636. if ( !!node && node.is( 'element', 'caption' ) ) {
  55637. return node;
  55638. }
  55639. }
  55640. return null;
  55641. }
  55642. /**
  55643. * Returns the caption model element for a model selection. Returns `null` if the selection has no caption element ancestor.
  55644. *
  55645. * @param {module:image/imageutils~ImageUtils} imageUtils
  55646. * @param {module:engine/model/selection~Selection} selection
  55647. * @returns {module:engine/model/element~Element|null}
  55648. */
  55649. function getCaptionFromModelSelection( imageUtils, selection ) {
  55650. const captionElement = selection.getFirstPosition().findAncestor( 'caption' );
  55651. if ( !captionElement ) {
  55652. return null;
  55653. }
  55654. if ( imageUtils.isBlockImage( captionElement.parent ) ) {
  55655. return captionElement;
  55656. }
  55657. return null;
  55658. }
  55659. /**
  55660. * {@link module:engine/view/matcher~Matcher} pattern. Checks if a given element is a `<figcaption>` element that is placed
  55661. * inside the image `<figure>` element.
  55662. *
  55663. * @param {module:image/imageutils~ImageUtils} imageUtils
  55664. * @param {module:engine/view/element~Element} element
  55665. * @returns {Object|null} Returns the object accepted by {@link module:engine/view/matcher~Matcher} or `null` if the element
  55666. * cannot be matched.
  55667. */
  55668. function matchImageCaptionViewElement( imageUtils, element ) {
  55669. // Convert only captions for images.
  55670. if ( element.name == 'figcaption' && imageUtils.isBlockImageView( element.parent ) ) {
  55671. return { name: true };
  55672. }
  55673. return null;
  55674. }
  55675. /***/ }),
  55676. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageinline.js":
  55677. /*!*******************************************************************!*\
  55678. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageinline.js ***!
  55679. \*******************************************************************/
  55680. /*! exports provided: default */
  55681. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55682. "use strict";
  55683. __webpack_require__.r(__webpack_exports__);
  55684. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageInline; });
  55685. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  55686. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  55687. /* harmony import */ var _imagetextalternative__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imagetextalternative */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative.js");
  55688. /* harmony import */ var _image_imageinlineediting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./image/imageinlineediting */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageinlineediting.js");
  55689. /* harmony import */ var _theme_image_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../theme/image.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/image.css");
  55690. /**
  55691. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55692. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55693. */
  55694. /**
  55695. * @module image/imageinline
  55696. */
  55697. /**
  55698. * The image inline plugin.
  55699. *
  55700. * This is a "glue" plugin which loads the following plugins:
  55701. *
  55702. * * {@link module:image/image/imageinlineediting~ImageInlineEditing},
  55703. * * {@link module:image/imagetextalternative~ImageTextAlternative}.
  55704. *
  55705. * Usually, it is used in conjunction with other plugins from this package. See the {@glink api/image package page}
  55706. * for more information.
  55707. *
  55708. * @extends module:core/plugin~Plugin
  55709. */
  55710. class ImageInline extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  55711. /**
  55712. * @inheritDoc
  55713. */
  55714. static get requires() {
  55715. return [ _image_imageinlineediting__WEBPACK_IMPORTED_MODULE_3__["default"], ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["Widget"], _imagetextalternative__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  55716. }
  55717. /**
  55718. * @inheritDoc
  55719. */
  55720. static get pluginName() {
  55721. return 'ImageInline';
  55722. }
  55723. }
  55724. /***/ }),
  55725. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize.js":
  55726. /*!*******************************************************************!*\
  55727. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize.js ***!
  55728. \*******************************************************************/
  55729. /*! exports provided: default */
  55730. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55731. "use strict";
  55732. __webpack_require__.r(__webpack_exports__);
  55733. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageResize; });
  55734. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  55735. /* harmony import */ var _imageresize_imageresizebuttons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imageresize/imageresizebuttons */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizebuttons.js");
  55736. /* harmony import */ var _imageresize_imageresizeediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imageresize/imageresizeediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js");
  55737. /* harmony import */ var _imageresize_imageresizehandles__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./imageresize/imageresizehandles */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizehandles.js");
  55738. /* harmony import */ var _theme_imageresize_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../theme/imageresize.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css");
  55739. /**
  55740. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55741. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55742. */
  55743. /**
  55744. * @module image/imageresize
  55745. */
  55746. /**
  55747. * The image resize plugin.
  55748. *
  55749. * It adds a possibility to resize each image using handles.
  55750. *
  55751. * @extends module:core/plugin~Plugin
  55752. */
  55753. class ImageResize extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  55754. /**
  55755. * @inheritDoc
  55756. */
  55757. static get requires() {
  55758. return [ _imageresize_imageresizeediting__WEBPACK_IMPORTED_MODULE_2__["default"], _imageresize_imageresizehandles__WEBPACK_IMPORTED_MODULE_3__["default"], _imageresize_imageresizebuttons__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  55759. }
  55760. /**
  55761. * @inheritDoc
  55762. */
  55763. static get pluginName() {
  55764. return 'ImageResize';
  55765. }
  55766. }
  55767. /**
  55768. * The available options are `'px'` or `'%'`.
  55769. *
  55770. * Determines the size unit applied to the resized image.
  55771. *
  55772. * ClassicEditor
  55773. * .create( editorElement, {
  55774. * image: {
  55775. * resizeUnit: 'px'
  55776. * }
  55777. * } )
  55778. * .then( ... )
  55779. * .catch( ... );
  55780. *
  55781. *
  55782. * This option is used by the {@link module:image/imageresize~ImageResize} feature.
  55783. *
  55784. * @default '%'
  55785. * @member {String} module:image/image~ImageConfig#resizeUnit
  55786. */
  55787. /**
  55788. * The image resize options.
  55789. *
  55790. * Each option should have at least these two properties:
  55791. *
  55792. * * name: The name of the UI component registered in the global
  55793. * {@link module:core/editor/editorui~EditorUI#componentFactory component factory} of the editor,
  55794. * representing the button a user can click to change the size of an image,
  55795. * * value: An actual image width applied when a user clicks the mentioned button
  55796. * ({@link module:image/imageresize/resizeimagecommand~ResizeImageCommand} gets executed).
  55797. * The value property is combined with the {@link module:image/image~ImageConfig#resizeUnit `config.image.resizeUnit`} (`%` by default).
  55798. * For instance: `value: '50'` and `resizeUnit: '%'` will render as `'50%'` in the UI.
  55799. *
  55800. * **Resetting the image size**
  55801. *
  55802. * If you want to set an option that will reset image to its original size, you need to pass a `null` value
  55803. * to one of the options. The `:original` token is not mandatory, you can call it anything you wish, but it must reflect
  55804. * in the standalone buttons configuration for the image toolbar.
  55805. *
  55806. * ClassicEditor
  55807. * .create( editorElement, {
  55808. * image: {
  55809. * resizeUnit: "%",
  55810. * resizeOptions: [ {
  55811. * name: 'resizeImage:original',
  55812. * value: null
  55813. * },
  55814. * {
  55815. * name: 'resizeImage:50',
  55816. * value: '50'
  55817. * },
  55818. * {
  55819. * name: 'resizeImage:75',
  55820. * value: '75'
  55821. * } ]
  55822. * }
  55823. * } )
  55824. * .then( ... )
  55825. * .catch( ... );
  55826. *
  55827. * **Resizing images using a dropdown**
  55828. *
  55829. * With resize options defined, you can decide whether you want to display them as a dropdown or as standalone buttons.
  55830. * For the dropdown, you need to pass only the `resizeImage` token to the
  55831. {@link module:image/image~ImageConfig#toolbar `config.image.toolbar`}. The dropdown contains all defined options by default:
  55832. *
  55833. * ClassicEditor
  55834. * .create( editorElement, {
  55835. * image: {
  55836. * resizeUnit: "%",
  55837. * resizeOptions: [ {
  55838. * name: 'resizeImage:original',
  55839. * value: null
  55840. * },
  55841. * {
  55842. * name: 'resizeImage:50',
  55843. * value: '50'
  55844. * },
  55845. * {
  55846. * name: 'resizeImage:75',
  55847. * value: '75'
  55848. * } ],
  55849. * toolbar: [ 'resizeImage', ... ],
  55850. * }
  55851. * } )
  55852. * .then( ... )
  55853. * .catch( ... );
  55854. *
  55855. * **Resizing images using individual buttons**
  55856. *
  55857. * If you want to have separate buttons for {@link module:image/imageresize/imageresizebuttons~ImageResizeOption each option},
  55858. * pass their names to the {@link module:image/image~ImageConfig#toolbar `config.image.toolbar`} instead. Please keep in mind
  55859. * that this time **you must define the additional
  55860. * {@link module:image/imageresize/imageresizebuttons~ImageResizeOption `icon` property}**:
  55861. *
  55862. * ClassicEditor
  55863. * .create( editorElement, {
  55864. * image: {
  55865. * resizeUnit: "%",
  55866. * resizeOptions: [ {
  55867. * name: 'resizeImage:original',
  55868. * value: null,
  55869. * icon: 'original'
  55870. * },
  55871. * {
  55872. * name: 'resizeImage:25',
  55873. * value: '25',
  55874. * icon: 'small'
  55875. * },
  55876. * {
  55877. * name: 'resizeImage:50',
  55878. * value: '50',
  55879. * icon: 'medium'
  55880. * },
  55881. * {
  55882. * name: 'resizeImage:75',
  55883. * value: '75',
  55884. * icon: 'large'
  55885. * } ],
  55886. * toolbar: [ 'resizeImage:25', 'resizeImage:50', 'resizeImage:75', 'resizeImage:original', ... ],
  55887. * }
  55888. * } )
  55889. * .then( ... )
  55890. * .catch( ... );
  55891. *
  55892. * **Customizing resize button labels**
  55893. *
  55894. * You can set your own label for each resize button. To do that, add the `label` property like in the example below.
  55895. *
  55896. * * When using the **dropdown**, the labels are displayed on the list of all options when you open the dropdown.
  55897. * * When using **standalone buttons**, the labels will are displayed as tooltips when a user hovers over the button.
  55898. *
  55899. * ClassicEditor
  55900. * .create( editorElement, {
  55901. * image: {
  55902. * resizeUnit: "%",
  55903. * resizeOptions: [ {
  55904. * name: 'resizeImage:original',
  55905. * value: null,
  55906. * label: 'Original size'
  55907. * // Note: add the "icon" property if you're configuring a standalone button.
  55908. * },
  55909. * {
  55910. * name: 'resizeImage:50',
  55911. * value: '50',
  55912. * label: 'Medium size'
  55913. * // Note: add the "icon" property if you're configuring a standalone button.
  55914. * },
  55915. * {
  55916. * name: 'resizeImage:75',
  55917. * value: '75',
  55918. * label: 'Large size'
  55919. * // Note: add the "icon" property if you're configuring a standalone button.
  55920. * } ]
  55921. * }
  55922. * } )
  55923. * .then( ... )
  55924. * .catch( ... );
  55925. *
  55926. * **Default value**
  55927. *
  55928. * The following configuration is used by default:
  55929. *
  55930. * resizeOptions = [
  55931. * {
  55932. * name: 'resizeImage:original',
  55933. * value: null,
  55934. * icon: 'original'
  55935. * },
  55936. * {
  55937. * name: 'resizeImage:25',
  55938. * value: '25',
  55939. * icon: 'small'
  55940. * },
  55941. * {
  55942. * name: 'resizeImage:50',
  55943. * value: '50',
  55944. * icon: 'medium'
  55945. * },
  55946. * {
  55947. * name: 'resizeImage:75',
  55948. * value: '75',
  55949. * icon: 'large'
  55950. * }
  55951. * ];
  55952. *
  55953. * @member {Array.<module:image/imageresize/imageresizebuttons~ImageResizeOption>} module:image/image~ImageConfig#resizeOptions
  55954. */
  55955. /***/ }),
  55956. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizebuttons.js":
  55957. /*!**************************************************************************************!*\
  55958. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizebuttons.js ***!
  55959. \**************************************************************************************/
  55960. /*! exports provided: default */
  55961. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55962. "use strict";
  55963. __webpack_require__.r(__webpack_exports__);
  55964. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageResizeButtons; });
  55965. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  55966. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  55967. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  55968. /* harmony import */ var _imageresizeediting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./imageresizeediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js");
  55969. /**
  55970. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  55971. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55972. */
  55973. /**
  55974. * @module image/imageresize/imageresizebuttons
  55975. */
  55976. const RESIZE_ICONS = {
  55977. small: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].objectSizeSmall,
  55978. medium: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].objectSizeMedium,
  55979. large: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].objectSizeLarge,
  55980. original: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].objectSizeFull
  55981. };
  55982. /**
  55983. * The image resize buttons plugin.
  55984. *
  55985. * It adds a possibility to resize images using the toolbar dropdown or individual buttons, depending on the plugin configuration.
  55986. *
  55987. * @extends module:core/plugin~Plugin
  55988. */
  55989. class ImageResizeButtons extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  55990. /**
  55991. * @inheritDoc
  55992. */
  55993. static get requires() {
  55994. return [ _imageresizeediting__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  55995. }
  55996. /**
  55997. * @inheritDoc
  55998. */
  55999. static get pluginName() {
  56000. return 'ImageResizeButtons';
  56001. }
  56002. /**
  56003. * @inheritDoc
  56004. */
  56005. constructor( editor ) {
  56006. super( editor );
  56007. /**
  56008. * The resize unit.
  56009. *
  56010. * @readonly
  56011. * @private
  56012. * @type {module:image/image~ImageConfig#resizeUnit}
  56013. * @default '%'
  56014. */
  56015. this._resizeUnit = editor.config.get( 'image.resizeUnit' );
  56016. }
  56017. /**
  56018. * @inheritDoc
  56019. */
  56020. init() {
  56021. const editor = this.editor;
  56022. const options = editor.config.get( 'image.resizeOptions' );
  56023. const command = editor.commands.get( 'resizeImage' );
  56024. this.bind( 'isEnabled' ).to( command );
  56025. for ( const option of options ) {
  56026. this._registerImageResizeButton( option );
  56027. }
  56028. this._registerImageResizeDropdown( options );
  56029. }
  56030. /**
  56031. * A helper function that creates a standalone button component for the plugin.
  56032. *
  56033. * @private
  56034. * @param {module:image/imageresize/imageresizebuttons~ImageResizeOption} resizeOption A model of the resize option.
  56035. */
  56036. _registerImageResizeButton( option ) {
  56037. const editor = this.editor;
  56038. const { name, value, icon } = option;
  56039. const optionValueWithUnit = value ? value + this._resizeUnit : null;
  56040. editor.ui.componentFactory.add( name, locale => {
  56041. const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  56042. const command = editor.commands.get( 'resizeImage' );
  56043. const labelText = this._getOptionLabelValue( option, true );
  56044. if ( !RESIZE_ICONS[ icon ] ) {
  56045. /**
  56046. * When configuring {@link module:image/image~ImageConfig#resizeOptions `config.image.resizeOptions`} for standalone
  56047. * buttons, a valid `icon` token must be set for each option.
  56048. *
  56049. * See all valid options described in the
  56050. * {@link module:image/imageresize/imageresizebuttons~ImageResizeOption plugin configuration}.
  56051. *
  56052. * @error imageresizebuttons-missing-icon
  56053. * @param {module:image/imageresize/imageresizebuttons~ImageResizeOption} option Invalid image resize option.
  56054. */
  56055. throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["CKEditorError"](
  56056. 'imageresizebuttons-missing-icon',
  56057. editor,
  56058. option
  56059. );
  56060. }
  56061. button.set( {
  56062. // Use the `label` property for a verbose description (because of ARIA).
  56063. label: labelText,
  56064. icon: RESIZE_ICONS[ icon ],
  56065. tooltip: labelText,
  56066. isToggleable: true
  56067. } );
  56068. // Bind button to the command.
  56069. button.bind( 'isEnabled' ).to( this );
  56070. button.bind( 'isOn' ).to( command, 'value', getIsOnButtonCallback( optionValueWithUnit ) );
  56071. this.listenTo( button, 'execute', () => {
  56072. editor.execute( 'resizeImage', { width: optionValueWithUnit } );
  56073. } );
  56074. return button;
  56075. } );
  56076. }
  56077. /**
  56078. * A helper function that creates a dropdown component for the plugin containing all the resize options defined in
  56079. * the editor configuration.
  56080. *
  56081. * @private
  56082. * @param {Array.<module:image/imageresize/imageresizebuttons~ImageResizeOption>} options An array of configured options.
  56083. */
  56084. _registerImageResizeDropdown( options ) {
  56085. const editor = this.editor;
  56086. const t = editor.t;
  56087. const originalSizeOption = options.find( option => !option.value );
  56088. const componentCreator = locale => {
  56089. const command = editor.commands.get( 'resizeImage' );
  56090. const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale, ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["DropdownButtonView"] );
  56091. const dropdownButton = dropdownView.buttonView;
  56092. dropdownButton.set( {
  56093. tooltip: t( 'Resize image' ),
  56094. commandValue: originalSizeOption.value,
  56095. icon: RESIZE_ICONS.medium,
  56096. isToggleable: true,
  56097. label: this._getOptionLabelValue( originalSizeOption ),
  56098. withText: true,
  56099. class: 'ck-resize-image-button'
  56100. } );
  56101. dropdownButton.bind( 'label' ).to( command, 'value', commandValue => {
  56102. if ( commandValue && commandValue.width ) {
  56103. return commandValue.width;
  56104. } else {
  56105. return this._getOptionLabelValue( originalSizeOption );
  56106. }
  56107. } );
  56108. dropdownView.bind( 'isOn' ).to( command );
  56109. dropdownView.bind( 'isEnabled' ).to( this );
  56110. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["addListToDropdown"])( dropdownView, this._getResizeDropdownListItemDefinitions( options, command ) );
  56111. dropdownView.listView.ariaLabel = t( 'Image resize list' );
  56112. // Execute command when an item from the dropdown is selected.
  56113. this.listenTo( dropdownView, 'execute', evt => {
  56114. editor.execute( evt.source.commandName, { width: evt.source.commandValue } );
  56115. editor.editing.view.focus();
  56116. } );
  56117. return dropdownView;
  56118. };
  56119. // Register `resizeImage` dropdown and add `imageResize` dropdown as an alias for backward compatibility.
  56120. editor.ui.componentFactory.add( 'resizeImage', componentCreator );
  56121. editor.ui.componentFactory.add( 'imageResize', componentCreator );
  56122. }
  56123. /**
  56124. * A helper function for creating an option label value string.
  56125. *
  56126. * @private
  56127. * @param {module:image/imageresize/imageresizebuttons~ImageResizeOption} option A resize option object.
  56128. * @param {Boolean} [forTooltip] An optional flag for creating a tooltip label.
  56129. * @returns {String} A user-defined label combined from the numeric value and the resize unit or the default label
  56130. * for reset options (`Original`).
  56131. */
  56132. _getOptionLabelValue( option, forTooltip ) {
  56133. const t = this.editor.t;
  56134. if ( option.label ) {
  56135. return option.label;
  56136. } else if ( forTooltip ) {
  56137. if ( option.value ) {
  56138. return t( 'Resize image to %0', option.value + this._resizeUnit );
  56139. } else {
  56140. return t( 'Resize image to the original size' );
  56141. }
  56142. } else {
  56143. if ( option.value ) {
  56144. return option.value + this._resizeUnit;
  56145. } else {
  56146. return t( 'Original' );
  56147. }
  56148. }
  56149. }
  56150. /**
  56151. * A helper function that parses the resize options and returns list item definitions ready for use in the dropdown.
  56152. *
  56153. * @private
  56154. * @param {Array.<module:image/imageresize/imageresizebuttons~ImageResizeOption>} options The resize options.
  56155. * @param {module:image/imageresize/resizeimagecommand~ResizeImageCommand} command The resize image command.
  56156. * @returns {Iterable.<module:ui/dropdown/utils~ListDropdownItemDefinition>} Dropdown item definitions.
  56157. */
  56158. _getResizeDropdownListItemDefinitions( options, command ) {
  56159. const itemDefinitions = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["Collection"]();
  56160. options.map( option => {
  56161. const optionValueWithUnit = option.value ? option.value + this._resizeUnit : null;
  56162. const definition = {
  56163. type: 'button',
  56164. model: new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Model"]( {
  56165. commandName: 'resizeImage',
  56166. commandValue: optionValueWithUnit,
  56167. label: this._getOptionLabelValue( option ),
  56168. withText: true,
  56169. icon: null
  56170. } )
  56171. };
  56172. definition.model.bind( 'isOn' ).to( command, 'value', getIsOnButtonCallback( optionValueWithUnit ) );
  56173. itemDefinitions.add( definition );
  56174. } );
  56175. return itemDefinitions;
  56176. }
  56177. }
  56178. // A helper function for setting the `isOn` state of buttons in value bindings.
  56179. function getIsOnButtonCallback( value ) {
  56180. return commandValue => {
  56181. if ( value === null && commandValue === value ) {
  56182. return true;
  56183. }
  56184. return commandValue && commandValue.width === value;
  56185. };
  56186. }
  56187. /**
  56188. * The image resize option used in the {@link module:image/image~ImageConfig#resizeOptions image resize configuration}.
  56189. *
  56190. * @typedef {Object} module:image/imageresize/imageresizebuttons~ImageResizeOption
  56191. * @property {String} name The name of the UI component that changes the image size.
  56192. * * If you configure the feature using individual resize buttons, you can refer to this name in the
  56193. * {@link module:image/image~ImageConfig#toolbar image toolbar configuration}.
  56194. * * If you configure the feature using the resize dropdown, this name will be used for a list item in the dropdown.
  56195. * @property {String} value The value of the resize option without the unit
  56196. * ({@link module:image/image~ImageConfig#resizeUnit configured separately}). `null` resets an image to its original size.
  56197. * @property {String} [icon] An icon used by an individual resize button (see the `name` property to learn more).
  56198. * Available icons are: `'small'`, `'medium'`, `'large'`, `'original'`.
  56199. * @property {String} [label] An option label displayed in the dropdown or, if the feature is configured using
  56200. * individual buttons, a {@link module:ui/button/buttonview~ButtonView#tooltip} and an ARIA attribute of a button.
  56201. * If not specified, the label is generated automatically based on the `value` option and the
  56202. * {@link module:image/image~ImageConfig#resizeUnit `config.image.resizeUnit`}.
  56203. */
  56204. /***/ }),
  56205. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js":
  56206. /*!**************************************************************************************!*\
  56207. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js ***!
  56208. \**************************************************************************************/
  56209. /*! exports provided: default */
  56210. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56211. "use strict";
  56212. __webpack_require__.r(__webpack_exports__);
  56213. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageResizeEditing; });
  56214. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  56215. /* harmony import */ var _imageutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../imageutils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageutils.js");
  56216. /* harmony import */ var _resizeimagecommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resizeimagecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/resizeimagecommand.js");
  56217. /**
  56218. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  56219. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  56220. */
  56221. /**
  56222. * @module image/imageresize/imageresizeediting
  56223. */
  56224. /**
  56225. * The image resize editing feature.
  56226. *
  56227. * It adds the ability to resize each image using handles or manually by
  56228. * {@link module:image/imageresize/imageresizebuttons~ImageResizeButtons} buttons.
  56229. *
  56230. * @extends module:core/plugin~Plugin
  56231. */
  56232. class ImageResizeEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  56233. /**
  56234. * @inheritDoc
  56235. */
  56236. static get requires() {
  56237. return [ _imageutils__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  56238. }
  56239. /**
  56240. * @inheritDoc
  56241. */
  56242. static get pluginName() {
  56243. return 'ImageResizeEditing';
  56244. }
  56245. /**
  56246. * @inheritDoc
  56247. */
  56248. constructor( editor ) {
  56249. super( editor );
  56250. editor.config.define( 'image', {
  56251. resizeUnit: '%',
  56252. resizeOptions: [ {
  56253. name: 'resizeImage:original',
  56254. value: null,
  56255. icon: 'original'
  56256. },
  56257. {
  56258. name: 'resizeImage:25',
  56259. value: '25',
  56260. icon: 'small'
  56261. },
  56262. {
  56263. name: 'resizeImage:50',
  56264. value: '50',
  56265. icon: 'medium'
  56266. },
  56267. {
  56268. name: 'resizeImage:75',
  56269. value: '75',
  56270. icon: 'large'
  56271. } ]
  56272. } );
  56273. }
  56274. /**
  56275. * @inheritDoc
  56276. */
  56277. init() {
  56278. const editor = this.editor;
  56279. const resizeImageCommand = new _resizeimagecommand__WEBPACK_IMPORTED_MODULE_2__["default"]( editor );
  56280. this._registerSchema();
  56281. this._registerConverters( 'imageBlock' );
  56282. this._registerConverters( 'imageInline' );
  56283. // Register `resizeImage` command and add `imageResize` command as an alias for backward compatibility.
  56284. editor.commands.add( 'resizeImage', resizeImageCommand );
  56285. editor.commands.add( 'imageResize', resizeImageCommand );
  56286. }
  56287. /**
  56288. * @private
  56289. */
  56290. _registerSchema() {
  56291. if ( this.editor.plugins.has( 'ImageBlockEditing' ) ) {
  56292. this.editor.model.schema.extend( 'imageBlock', { allowAttributes: 'width' } );
  56293. }
  56294. if ( this.editor.plugins.has( 'ImageInlineEditing' ) ) {
  56295. this.editor.model.schema.extend( 'imageInline', { allowAttributes: 'width' } );
  56296. }
  56297. }
  56298. /**
  56299. * Registers image resize converters.
  56300. *
  56301. * @private
  56302. * @param {'imageBlock'|'imageInline'} imageType The type of the image.
  56303. */
  56304. _registerConverters( imageType ) {
  56305. const editor = this.editor;
  56306. // Dedicated converter to propagate image's attribute to the img tag.
  56307. editor.conversion.for( 'downcast' ).add( dispatcher =>
  56308. dispatcher.on( `attribute:width:${ imageType }`, ( evt, data, conversionApi ) => {
  56309. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  56310. return;
  56311. }
  56312. const viewWriter = conversionApi.writer;
  56313. const figure = conversionApi.mapper.toViewElement( data.item );
  56314. if ( data.attributeNewValue !== null ) {
  56315. viewWriter.setStyle( 'width', data.attributeNewValue, figure );
  56316. viewWriter.addClass( 'image_resized', figure );
  56317. } else {
  56318. viewWriter.removeStyle( 'width', figure );
  56319. viewWriter.removeClass( 'image_resized', figure );
  56320. }
  56321. } )
  56322. );
  56323. editor.conversion.for( 'upcast' )
  56324. .attributeToAttribute( {
  56325. view: {
  56326. name: imageType === 'imageBlock' ? 'figure' : 'img',
  56327. styles: {
  56328. width: /.+/
  56329. }
  56330. },
  56331. model: {
  56332. key: 'width',
  56333. value: viewElement => viewElement.getStyle( 'width' )
  56334. }
  56335. } );
  56336. }
  56337. }
  56338. /***/ }),
  56339. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizehandles.js":
  56340. /*!**************************************************************************************!*\
  56341. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizehandles.js ***!
  56342. \**************************************************************************************/
  56343. /*! exports provided: default */
  56344. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56345. "use strict";
  56346. __webpack_require__.r(__webpack_exports__);
  56347. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageResizeHandles; });
  56348. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  56349. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  56350. /* harmony import */ var _image_imageloadobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../image/imageloadobserver */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js");
  56351. /**
  56352. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  56353. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  56354. */
  56355. /**
  56356. * @module image/imageresize/imageresizehandles
  56357. */
  56358. const RESIZABLE_IMAGES_CSS_SELECTOR =
  56359. 'figure.image.ck-widget > img,' +
  56360. 'figure.image.ck-widget > picture > img,' +
  56361. 'figure.image.ck-widget > a > img,' +
  56362. 'figure.image.ck-widget > a > picture > img,' +
  56363. 'span.image-inline.ck-widget > img,' +
  56364. 'span.image-inline.ck-widget > picture > img';
  56365. const IMAGE_WIDGETS_CLASSES_MATCH_REGEXP = /(image|image-inline)/;
  56366. const RESIZED_IMAGE_CLASS = 'image_resized';
  56367. /**
  56368. * The image resize by handles feature.
  56369. *
  56370. * It adds the ability to resize each image using handles or manually by
  56371. * {@link module:image/imageresize/imageresizebuttons~ImageResizeButtons} buttons.
  56372. *
  56373. * @extends module:core/plugin~Plugin
  56374. */
  56375. class ImageResizeHandles extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  56376. /**
  56377. * @inheritDoc
  56378. */
  56379. static get requires() {
  56380. return [ ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetResize"] ];
  56381. }
  56382. /**
  56383. * @inheritDoc
  56384. */
  56385. static get pluginName() {
  56386. return 'ImageResizeHandles';
  56387. }
  56388. /**
  56389. * @inheritDoc
  56390. */
  56391. init() {
  56392. const command = this.editor.commands.get( 'resizeImage' );
  56393. this.bind( 'isEnabled' ).to( command );
  56394. this._setupResizerCreator();
  56395. }
  56396. /**
  56397. * Attaches the listeners responsible for creating a resizer for each image, except for images inside the HTML embed preview.
  56398. *
  56399. * @private
  56400. */
  56401. _setupResizerCreator() {
  56402. const editor = this.editor;
  56403. const editingView = editor.editing.view;
  56404. editingView.addObserver( _image_imageloadobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
  56405. this.listenTo( editingView.document, 'imageLoaded', ( evt, domEvent ) => {
  56406. // The resizer must be attached only to images loaded by the `ImageInsert`, `ImageUpload` or `LinkImage` plugins.
  56407. if ( !domEvent.target.matches( RESIZABLE_IMAGES_CSS_SELECTOR ) ) {
  56408. return;
  56409. }
  56410. const domConverter = editor.editing.view.domConverter;
  56411. const imageView = domConverter.domToView( domEvent.target );
  56412. const widgetView = imageView.findAncestor( { classes: IMAGE_WIDGETS_CLASSES_MATCH_REGEXP } );
  56413. let resizer = this.editor.plugins.get( ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetResize"] ).getResizerByViewElement( widgetView );
  56414. if ( resizer ) {
  56415. // There are rare cases when the image will be triggered multiple times for the same widget, e.g. when
  56416. // the image's source was changed after upload (https://github.com/ckeditor/ckeditor5/pull/8108#issuecomment-708302992).
  56417. resizer.redraw();
  56418. return;
  56419. }
  56420. const mapper = editor.editing.mapper;
  56421. const imageModel = mapper.toModelElement( widgetView );
  56422. resizer = editor.plugins
  56423. .get( ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetResize"] )
  56424. .attachTo( {
  56425. unit: editor.config.get( 'image.resizeUnit' ),
  56426. modelElement: imageModel,
  56427. viewElement: widgetView,
  56428. editor,
  56429. getHandleHost( domWidgetElement ) {
  56430. return domWidgetElement.querySelector( 'img' );
  56431. },
  56432. getResizeHost() {
  56433. // Return the model image element parent to avoid setting an inline element (<a>/<span>) as a resize host.
  56434. return domConverter.viewToDom( mapper.toViewElement( imageModel.parent ) );
  56435. },
  56436. // TODO consider other positions.
  56437. isCentered() {
  56438. const imageStyle = imageModel.getAttribute( 'imageStyle' );
  56439. return !imageStyle || imageStyle == 'block' || imageStyle == 'alignCenter';
  56440. },
  56441. onCommit( newValue ) {
  56442. // Get rid of the CSS class in case the command execution that follows is unsuccessful
  56443. // (e.g. Track Changes can override it and the new dimensions will not apply). Otherwise,
  56444. // the presence of the class and the absence of the width style will cause it to take 100%
  56445. // of the horizontal space.
  56446. editingView.change( writer => {
  56447. writer.removeClass( RESIZED_IMAGE_CLASS, widgetView );
  56448. } );
  56449. editor.execute( 'resizeImage', { width: newValue } );
  56450. }
  56451. } );
  56452. resizer.on( 'updateSize', () => {
  56453. if ( !widgetView.hasClass( RESIZED_IMAGE_CLASS ) ) {
  56454. editingView.change( writer => {
  56455. writer.addClass( RESIZED_IMAGE_CLASS, widgetView );
  56456. } );
  56457. }
  56458. } );
  56459. resizer.bind( 'isEnabled' ).to( this );
  56460. } );
  56461. }
  56462. }
  56463. /***/ }),
  56464. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/resizeimagecommand.js":
  56465. /*!**************************************************************************************!*\
  56466. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize/resizeimagecommand.js ***!
  56467. \**************************************************************************************/
  56468. /*! exports provided: default */
  56469. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56470. "use strict";
  56471. __webpack_require__.r(__webpack_exports__);
  56472. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ResizeImageCommand; });
  56473. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  56474. /**
  56475. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  56476. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  56477. */
  56478. /**
  56479. * @module image/imageresize/resizeimagecommand
  56480. */
  56481. /**
  56482. * The resize image command. Currently, it only supports the width attribute.
  56483. *
  56484. * @extends module:core/command~Command
  56485. */
  56486. class ResizeImageCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  56487. /**
  56488. * @inheritDoc
  56489. */
  56490. refresh() {
  56491. const editor = this.editor;
  56492. const imageUtils = editor.plugins.get( 'ImageUtils' );
  56493. const element = imageUtils.getClosestSelectedImageElement( editor.model.document.selection );
  56494. this.isEnabled = !!element;
  56495. if ( !element || !element.hasAttribute( 'width' ) ) {
  56496. this.value = null;
  56497. } else {
  56498. this.value = {
  56499. width: element.getAttribute( 'width' ),
  56500. height: null
  56501. };
  56502. }
  56503. }
  56504. /**
  56505. * Executes the command.
  56506. *
  56507. * // Sets the width to 50%:
  56508. * editor.execute( 'resizeImage', { width: '50%' } );
  56509. *
  56510. * // Removes the width attribute:
  56511. * editor.execute( 'resizeImage', { width: null } );
  56512. *
  56513. * @param {Object} options
  56514. * @param {String|null} options.width The new width of the image.
  56515. * @fires execute
  56516. */
  56517. execute( options ) {
  56518. const editor = this.editor;
  56519. const model = editor.model;
  56520. const imageUtils = editor.plugins.get( 'ImageUtils' );
  56521. const imageElement = imageUtils.getClosestSelectedImageElement( model.document.selection );
  56522. this.value = {
  56523. width: options.width,
  56524. height: null
  56525. };
  56526. if ( imageElement ) {
  56527. model.change( writer => {
  56528. writer.setAttribute( 'width', options.width, imageElement );
  56529. } );
  56530. }
  56531. }
  56532. }
  56533. /***/ }),
  56534. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle.js":
  56535. /*!******************************************************************!*\
  56536. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle.js ***!
  56537. \******************************************************************/
  56538. /*! exports provided: default */
  56539. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56540. "use strict";
  56541. __webpack_require__.r(__webpack_exports__);
  56542. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageStyle; });
  56543. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  56544. /* harmony import */ var _imagestyle_imagestyleediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imagestyle/imagestyleediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleediting.js");
  56545. /* harmony import */ var _imagestyle_imagestyleui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imagestyle/imagestyleui */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleui.js");
  56546. /**
  56547. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  56548. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  56549. */
  56550. /**
  56551. * @module image/imagestyle
  56552. */
  56553. /**
  56554. * The image style plugin.
  56555. *
  56556. * For a detailed overview of the image styles feature, check the {@glink features/images/images-styles documentation}.
  56557. *
  56558. * This is a "glue" plugin which loads the following plugins:
  56559. * * {@link module:image/imagestyle/imagestyleediting~ImageStyleEditing},
  56560. * * {@link module:image/imagestyle/imagestyleui~ImageStyleUI}
  56561. *
  56562. * It provides a default configuration, which can be extended or overwritten.
  56563. * Read more about the {@link module:image/image~ImageConfig#styles image styles configuration}.
  56564. *
  56565. * @extends module:core/plugin~Plugin
  56566. */
  56567. class ImageStyle extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  56568. /**
  56569. * @inheritDoc
  56570. */
  56571. static get requires() {
  56572. return [ _imagestyle_imagestyleediting__WEBPACK_IMPORTED_MODULE_1__["default"], _imagestyle_imagestyleui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  56573. }
  56574. /**
  56575. * @inheritDoc
  56576. */
  56577. static get pluginName() {
  56578. return 'ImageStyle';
  56579. }
  56580. }
  56581. /**
  56582. * The configuration for the {@link module:image/imagestyle~ImageStyle} plugin that should be provided
  56583. * while creating the editor instance.
  56584. *
  56585. * A detailed information about the default configuration and customization can be found in
  56586. * {@link module:image/image~ImageConfig#styles `ImageConfig#styles`}.
  56587. *
  56588. * @interface ImageStyleConfig
  56589. */
  56590. /**
  56591. * A list of the image style options.
  56592. *
  56593. * @member {Array.<module:image/imagestyle~ImageStyleOptionDefinition>} module:image/imagestyle~ImageStyleConfig#options
  56594. */
  56595. /**
  56596. * The {@link module:image/imagestyle `ImageStyle`} plugin requires a list of the
  56597. * {@link module:image/imagestyle~ImageStyleConfig#options image style options} to work properly.
  56598. * The default configuration is provided (listed below) and can be customized while creating the editor instance.
  56599. *
  56600. * # **Command**
  56601. *
  56602. * The {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand `imageStyleCommand`}
  56603. * is configured based on the defined options,
  56604. * so you can change the style of the selected image by executing the following command:
  56605. *
  56606. * editor.execute( 'imageStyle' { value: 'alignLeft' } );
  56607. *
  56608. * # **Buttons**
  56609. *
  56610. * All of the image style options provided in the configuration are registered
  56611. * in the {@link module:ui/componentfactory~ComponentFactory UI components factory} with the "imageStyle:" prefixes and can be used
  56612. * in the {@link module:image/image~ImageConfig#toolbar image toolbar configuration}. The buttons available by default depending
  56613. * on the loaded plugins are listed in the next section.
  56614. *
  56615. * Read more about styling images in the {@glink features/images/images-styles Image styles guide}.
  56616. *
  56617. * # **Default options and buttons**
  56618. *
  56619. * If the custom configuration is not provided, the default configuration will be used depending on the loaded
  56620. * image editing plugins.
  56621. *
  56622. * * If both {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`} and
  56623. * {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`} plugins are loaded
  56624. * (which is usually the default editor configuration), the following options will be available for the toolbar
  56625. * configuration. These options will be registered as the buttons with the "imageStyle:" prefixes.
  56626. *
  56627. * const imageDefaultConfig = {
  56628. * styles: {
  56629. * options: [
  56630. * 'inline', 'alignLeft', 'alignRight',
  56631. * 'alignCenter', 'alignBlockLeft', 'alignBlockRight',
  56632. * 'block', 'side'
  56633. * ]
  56634. * }
  56635. * };
  56636. *
  56637. * * If only the {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`} plugin is loaded,
  56638. * the following buttons (options) and groups will be available for the toolbar configuration.
  56639. * These options will be registered as the buttons with the "imageStyle:" prefixes.
  56640. *
  56641. * const imageDefaultConfig = {
  56642. * styles: {
  56643. * options: [ 'block', 'side' ]
  56644. * }
  56645. * };
  56646. *
  56647. * * If only the {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`} plugin is loaded,
  56648. * the following buttons (options) and groups will available for the toolbar configuration.
  56649. * These options will be registered as the buttons with the "imageStyle:" prefixes.
  56650. *
  56651. * const imageDefaultConfig = {
  56652. * styles: {
  56653. * options: [ 'inline', 'alignLeft', 'alignRight' ]
  56654. * }
  56655. * };
  56656. *
  56657. * Read more about the {@link module:image/imagestyle/utils~DEFAULT_OPTIONS default styling options}.
  56658. *
  56659. * # **Custom configuration**
  56660. *
  56661. * The image styles configuration can be customized in several ways:
  56662. *
  56663. * * Any of the {@link module:image/imagestyle/utils~DEFAULT_OPTIONS default styling options}
  56664. * can be loaded by the reference to its name as follows:
  56665. *
  56666. * ClassicEditor
  56667. * .create( editorElement, {
  56668. * image: {
  56669. * styles: {
  56670. * options: [ 'alignLeft', 'alignRight' ]
  56671. * }
  56672. * }
  56673. * } );
  56674. *
  56675. * * Each of the {@link module:image/imagestyle/utils~DEFAULT_OPTIONS default image style options} can be customized,
  56676. * e.g. to change the `icon`, `title` or CSS `className` of the style. The feature also provides several
  56677. * {@link module:image/imagestyle/utils~DEFAULT_ICONS default icons} to choose from.
  56678. *
  56679. * import customIcon from 'custom-icon.svg';
  56680. *
  56681. * // ...
  56682. *
  56683. * ClassicEditor.create( editorElement, { image:
  56684. * styles: {
  56685. * options: {
  56686. * // This will only customize the icon of the "block" style.
  56687. * // Note: 'right' is one of default icons provided by the feature.
  56688. * {
  56689. * name: 'block',
  56690. * icon: 'right'
  56691. * },
  56692. *
  56693. * // This will customize the icon, title and CSS class of the default "side" style.
  56694. * {
  56695. * name: 'side',
  56696. * icon: customIcon,
  56697. * title: 'My side style',
  56698. * className: 'custom-side-image'
  56699. * }
  56700. * }
  56701. * }
  56702. * } );
  56703. *
  56704. * * If none of the {@link module:image/imagestyle/utils~DEFAULT_OPTIONS default image style options}
  56705. * works for the integration, it is possible to define independent custom styles, too.
  56706. *
  56707. * See the documentation about the image style {@link module:image/imagestyle~ImageStyleOptionDefinition options}
  56708. * to define the custom image style configuration properly.
  56709. *
  56710. * import redIcon from 'red-icon.svg';
  56711. * import blueIcon from 'blue-icon.svg';
  56712. *
  56713. * // ...
  56714. *
  56715. * ClassicEditor.create( editorElement, { image:
  56716. * styles: {
  56717. * // A list of completely custom styling options.
  56718. * options: [
  56719. * {
  56720. * name: 'regular',
  56721. * modelElements: [ 'imageBlock', 'imageInline' ],
  56722. * title: 'Regular image',
  56723. * icon: 'full',
  56724. * isDefault: true
  56725. * }, {
  56726. * name: 'blue',
  56727. * modelElements: [ 'imageInline' ],
  56728. * title: 'Blue image',
  56729. * icon: blueIcon,
  56730. * className: 'image-blue'
  56731. * }, {
  56732. * name: 'red',
  56733. * modelElements: [ 'imageBlock' ],
  56734. * title: 'Red image',
  56735. * icon: redIcon,
  56736. * className: 'image-red'
  56737. * }
  56738. * ]
  56739. * }
  56740. * } );
  56741. *
  56742. * @member {module:image/imagestyle~ImageStyleConfig} module:image/image~ImageConfig#styles
  56743. */
  56744. /**
  56745. * The image styling option definition descriptor.
  56746. *
  56747. * This definition should be implemented in the `Image` plugin {@link module:image/image~ImageConfig#styles configuration} for:
  56748. *
  56749. * * customizing one of the {@link module:image/imagestyle/utils~DEFAULT_OPTIONS default styling options} by providing the proper name
  56750. * of the default style and the properties that should be overridden,
  56751. * * or defining a completely custom styling option by providing a custom name and implementing the following properties.
  56752. *
  56753. * import fullSizeIcon from 'path/to/icon.svg';
  56754. *
  56755. * const imageStyleOptionDefinition = {
  56756. * name: 'fullSize',
  56757. * icon: fullSizeIcon,
  56758. * title: 'Full size image',
  56759. * className: 'image-full-size',
  56760. * modelElements: [ 'imageBlock', 'imageInline' ]
  56761. * }
  56762. *
  56763. * The styling option will be registered as the button under the name `'imageStyle:{name}'` in the
  56764. * {@link module:ui/componentfactory~ComponentFactory UI components factory} (this functionality is provided by the
  56765. * {@link module:image/imagestyle/imagestyleui~ImageStyleUI} plugin).
  56766. *
  56767. * @property {String} name The unique name of the styling option. It will be used to:
  56768. *
  56769. * * refer to one of the {@link module:image/imagestyle/utils~DEFAULT_OPTIONS default styling options} or define the custom style,
  56770. * * store the chosen style in the model by setting the `imageStyle` attribute of the model image element,
  56771. * * as a value of the {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand#execute `imageStyle` command},
  56772. * * when registering a button for the style in the following manner: (`'imageStyle:{name}'`).
  56773. *
  56774. * @property {Boolean} [isDefault] When set, the style will be used as the default one for the model elements
  56775. * listed in the `modelElements` property. A default style does not apply any CSS class to the view element.
  56776. *
  56777. * If this property is not defined, its value is inherited
  56778. * from the {@link module:image/imagestyle/utils~DEFAULT_OPTIONS default styling options} addressed in the name property.
  56779. *
  56780. * @property {String} icon One of the following to be used when creating the styles's button:
  56781. *
  56782. * * an SVG icon source (as an XML string),
  56783. * * one of the keys in {@link module:image/imagestyle/utils~DEFAULT_ICONS} to use one of default icons provided by the plugin.
  56784. *
  56785. * If this property is not defined, its value is inherited
  56786. * from the {@link module:image/imagestyle/utils~DEFAULT_OPTIONS default styling options} addressed in the name property.
  56787. *
  56788. * @property {String} title The styles's title. Setting `title` to one of
  56789. * {@link module:image/imagestyle/imagestyleui~ImageStyleUI#localizedDefaultStylesTitles}
  56790. * will automatically translate it to the language of the editor.
  56791. *
  56792. * If this property is not defined, its value is inherited
  56793. * from the {@link module:image/imagestyle/utils~DEFAULT_OPTIONS default styling options} addressed in the name property.
  56794. *
  56795. * @property {String} [className] The CSS class used to represent the style in the view.
  56796. * It should be used only for the non-default styles.
  56797. *
  56798. * If this property is not defined, its value is inherited
  56799. * from the {@link module:image/imagestyle/utils~DEFAULT_OPTIONS default styling options} addressed in the name property.
  56800. *
  56801. * @property {Array.<String>} modelElements The list of the names of the model elements that are supported by the style.
  56802. * The possible values are:
  56803. * * `[ 'imageBlock' ]` if the style can be applied to the image type introduced by the
  56804. * {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`} plugin,
  56805. * * `[ 'imageInline' ]` if the style can be applied to the image type introduced by the
  56806. * {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`} plugin,
  56807. * * `[ 'imageInline', 'imageBlock' ]` if the style can be applied to both image types introduced by the plugins mentioned above.
  56808. *
  56809. * This property determines which model element names work with the style. If the model element name of the currently selected
  56810. * image is different, upon executing the
  56811. * {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand#execute `imageStyle`} command the image type (model element name)
  56812. * will automatically change.
  56813. *
  56814. * If this property is not defined, its value is inherited
  56815. * from the {@link module:image/imagestyle/utils~DEFAULT_OPTIONS default styling options} addressed in the name property.
  56816. *
  56817. * @typedef {Object} module:image/imagestyle~ImageStyleOptionDefinition
  56818. */
  56819. /***/ }),
  56820. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/converters.js":
  56821. /*!*****************************************************************************!*\
  56822. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/converters.js ***!
  56823. \*****************************************************************************/
  56824. /*! exports provided: modelToViewStyleAttribute, viewToModelStyleAttribute */
  56825. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56826. "use strict";
  56827. __webpack_require__.r(__webpack_exports__);
  56828. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelToViewStyleAttribute", function() { return modelToViewStyleAttribute; });
  56829. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewToModelStyleAttribute", function() { return viewToModelStyleAttribute; });
  56830. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  56831. /**
  56832. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  56833. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  56834. */
  56835. /**
  56836. * @module image/imagestyle/converters
  56837. */
  56838. /**
  56839. * Returns a converter for the `imageStyle` attribute. It can be used for adding, changing and removing the attribute.
  56840. *
  56841. * @param {Array.<module:image/imagestyle~ImageStyleOptionDefinition>} styles
  56842. * An array containing available image style options.
  56843. * @returns {Function} A model-to-view attribute converter.
  56844. */
  56845. function modelToViewStyleAttribute( styles ) {
  56846. return ( evt, data, conversionApi ) => {
  56847. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  56848. return;
  56849. }
  56850. // Check if there is class name associated with given value.
  56851. const newStyle = getStyleDefinitionByName( data.attributeNewValue, styles );
  56852. const oldStyle = getStyleDefinitionByName( data.attributeOldValue, styles );
  56853. const viewElement = conversionApi.mapper.toViewElement( data.item );
  56854. const viewWriter = conversionApi.writer;
  56855. if ( oldStyle ) {
  56856. viewWriter.removeClass( oldStyle.className, viewElement );
  56857. }
  56858. if ( newStyle ) {
  56859. viewWriter.addClass( newStyle.className, viewElement );
  56860. }
  56861. };
  56862. }
  56863. /**
  56864. * Returns a view-to-model converter converting image CSS classes to a proper value in the model.
  56865. *
  56866. * @param {Array.<module:image/imagestyle~ImageStyleOptionDefinition>} styles
  56867. * Image style options for which the converter is created.
  56868. * @returns {Function} A view-to-model converter.
  56869. */
  56870. function viewToModelStyleAttribute( styles ) {
  56871. // Convert only non–default styles.
  56872. const nonDefaultStyles = {
  56873. imageInline: styles.filter( style => !style.isDefault && style.modelElements.includes( 'imageInline' ) ),
  56874. imageBlock: styles.filter( style => !style.isDefault && style.modelElements.includes( 'imageBlock' ) )
  56875. };
  56876. return ( evt, data, conversionApi ) => {
  56877. if ( !data.modelRange ) {
  56878. return;
  56879. }
  56880. const viewElement = data.viewItem;
  56881. const modelImageElement = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["first"])( data.modelRange.getItems() );
  56882. // Run this converter only if an image has been found in the model.
  56883. // In some cases it may not be found (for example if we run this on a figure with different type than image).
  56884. if ( !modelImageElement ) {
  56885. return;
  56886. }
  56887. // ...and the `imageStyle` attribute is allowed for that element, otherwise stop conversion early.
  56888. if ( !conversionApi.schema.checkAttribute( modelImageElement, 'imageStyle' ) ) {
  56889. return;
  56890. }
  56891. // Convert styles one by one.
  56892. for ( const style of nonDefaultStyles[ modelImageElement.name ] ) {
  56893. // Try to consume class corresponding with the style.
  56894. if ( conversionApi.consumable.consume( viewElement, { classes: style.className } ) ) {
  56895. // And convert this style to model attribute.
  56896. conversionApi.writer.setAttribute( 'imageStyle', style.name, modelImageElement );
  56897. }
  56898. }
  56899. };
  56900. }
  56901. // Returns the style with a given `name` from an array of styles.
  56902. //
  56903. // @param {String} name
  56904. // @param {Array.<module:image/imagestyle~ImageStyleOptionDefinition> } styles
  56905. // @returns {module:image/imagestyle~ImageStyleOptionDefinition|undefined}
  56906. function getStyleDefinitionByName( name, styles ) {
  56907. for ( const style of styles ) {
  56908. if ( style.name === name ) {
  56909. return style;
  56910. }
  56911. }
  56912. }
  56913. /***/ }),
  56914. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestylecommand.js":
  56915. /*!************************************************************************************!*\
  56916. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestylecommand.js ***!
  56917. \************************************************************************************/
  56918. /*! exports provided: default */
  56919. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56920. "use strict";
  56921. __webpack_require__.r(__webpack_exports__);
  56922. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageStyleCommand; });
  56923. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  56924. /**
  56925. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  56926. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  56927. */
  56928. /**
  56929. * @module image/imagestyle/imagestylecommand
  56930. */
  56931. /**
  56932. * The image style command. It is used to apply {@link module:image/imagestyle~ImageStyleConfig#options image style option}
  56933. * to a selected image.
  56934. *
  56935. * **Note**: Executing this command may change the image model element if the desired style requires an image of a different
  56936. * type. See {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand#execute} to learn more.
  56937. *
  56938. * @extends module:core/command~Command
  56939. */
  56940. class ImageStyleCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  56941. /**
  56942. * Creates an instance of the image style command. When executed, the command applies one of
  56943. * {@link module:image/imagestyle~ImageStyleConfig#options style options} to the currently selected image.
  56944. *
  56945. * @param {module:core/editor/editor~Editor} editor The editor instance.
  56946. * @param {Array.<module:image/imagestyle~ImageStyleOptionDefinition>} styles
  56947. * The style options that this command supports.
  56948. */
  56949. constructor( editor, styles ) {
  56950. super( editor );
  56951. /**
  56952. * An object containing names of default style options for the inline and block images.
  56953. * If there is no default style option for the given image type in the configuration,
  56954. * the name will be `false`.
  56955. *
  56956. * @private
  56957. * @type {Object.<String,module:image/imagestyle~ImageStyleOptionDefinition#name>}
  56958. */
  56959. this._defaultStyles = {
  56960. imageBlock: false,
  56961. imageInline: false
  56962. };
  56963. /**
  56964. * The styles handled by this command.
  56965. *
  56966. * @private
  56967. * @type {module:image/imagestyle~ImageStyleConfig#options}
  56968. */
  56969. this._styles = new Map( styles.map( style => {
  56970. if ( style.isDefault ) {
  56971. for ( const modelElementName of style.modelElements ) {
  56972. this._defaultStyles[ modelElementName ] = style.name;
  56973. }
  56974. }
  56975. return [ style.name, style ];
  56976. } ) );
  56977. }
  56978. /**
  56979. * @inheritDoc
  56980. */
  56981. refresh() {
  56982. const editor = this.editor;
  56983. const imageUtils = editor.plugins.get( 'ImageUtils' );
  56984. const element = imageUtils.getClosestSelectedImageElement( this.editor.model.document.selection );
  56985. this.isEnabled = !!element;
  56986. if ( !this.isEnabled ) {
  56987. this.value = false;
  56988. } else if ( element.hasAttribute( 'imageStyle' ) ) {
  56989. this.value = element.getAttribute( 'imageStyle' );
  56990. } else {
  56991. this.value = this._defaultStyles[ element.name ];
  56992. }
  56993. }
  56994. /**
  56995. * Executes the command and applies the style to the currently selected image:
  56996. *
  56997. * editor.execute( 'imageStyle', { value: 'side' } );
  56998. *
  56999. * **Note**: Executing this command may change the image model element if the desired style requires an image
  57000. * of a different type. Learn more about {@link module:image/imagestyle~ImageStyleOptionDefinition#modelElements model element}
  57001. * configuration for the style option.
  57002. *
  57003. * @param {Object} options
  57004. * @param {module:image/imagestyle~ImageStyleOptionDefinition#name} options.value The name of the style (as configured in
  57005. * {@link module:image/imagestyle~ImageStyleConfig#options}).
  57006. * @fires execute
  57007. */
  57008. execute( options = {} ) {
  57009. const editor = this.editor;
  57010. const model = editor.model;
  57011. const imageUtils = editor.plugins.get( 'ImageUtils' );
  57012. model.change( writer => {
  57013. const requestedStyle = options.value;
  57014. let imageElement = imageUtils.getClosestSelectedImageElement( model.document.selection );
  57015. // Change the image type if a style requires it.
  57016. if ( requestedStyle && this.shouldConvertImageType( requestedStyle, imageElement ) ) {
  57017. this.editor.execute( imageUtils.isBlockImage( imageElement ) ? 'imageTypeInline' : 'imageTypeBlock' );
  57018. // Update the imageElement to the newly created image.
  57019. imageElement = imageUtils.getClosestSelectedImageElement( model.document.selection );
  57020. }
  57021. // Default style means that there is no `imageStyle` attribute in the model.
  57022. // https://github.com/ckeditor/ckeditor5-image/issues/147
  57023. if ( !requestedStyle || this._styles.get( requestedStyle ).isDefault ) {
  57024. writer.removeAttribute( 'imageStyle', imageElement );
  57025. } else {
  57026. writer.setAttribute( 'imageStyle', requestedStyle, imageElement );
  57027. }
  57028. } );
  57029. }
  57030. /**
  57031. * Returns `true` if requested style change would trigger the image type change.
  57032. *
  57033. * @param {module:image/imagestyle~ImageStyleOptionDefinition} requestedStyle The name of the style (as configured in
  57034. * {@link module:image/imagestyle~ImageStyleConfig#options}).
  57035. * @param {module:engine/model/element~Element} imageElement The image model element.
  57036. * @returns {Boolean}
  57037. */
  57038. shouldConvertImageType( requestedStyle, imageElement ) {
  57039. const supportedTypes = this._styles.get( requestedStyle ).modelElements;
  57040. return !supportedTypes.includes( imageElement.name );
  57041. }
  57042. }
  57043. /***/ }),
  57044. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleediting.js":
  57045. /*!************************************************************************************!*\
  57046. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleediting.js ***!
  57047. \************************************************************************************/
  57048. /*! exports provided: default */
  57049. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57050. "use strict";
  57051. __webpack_require__.r(__webpack_exports__);
  57052. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageStyleEditing; });
  57053. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  57054. /* harmony import */ var _imagestylecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imagestylecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestylecommand.js");
  57055. /* harmony import */ var _imageutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../imageutils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageutils.js");
  57056. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js");
  57057. /* harmony import */ var _converters__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./converters */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/converters.js");
  57058. /**
  57059. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  57060. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  57061. */
  57062. /**
  57063. * @module image/imagestyle/imagestyleediting
  57064. */
  57065. /**
  57066. * The image style engine plugin. It sets the default configuration, creates converters and registers
  57067. * {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand ImageStyleCommand}.
  57068. *
  57069. * @extends module:core/plugin~Plugin
  57070. */
  57071. class ImageStyleEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  57072. /**
  57073. * @inheritDoc
  57074. */
  57075. static get pluginName() {
  57076. return 'ImageStyleEditing';
  57077. }
  57078. /**
  57079. * @inheritDoc
  57080. */
  57081. static get requires() {
  57082. return [ _imageutils__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  57083. }
  57084. /**
  57085. * @inheritDoc
  57086. */
  57087. init() {
  57088. const { normalizeStyles, getDefaultStylesConfiguration } = _utils__WEBPACK_IMPORTED_MODULE_3__["default"];
  57089. const editor = this.editor;
  57090. const isBlockPluginLoaded = editor.plugins.has( 'ImageBlockEditing' );
  57091. const isInlinePluginLoaded = editor.plugins.has( 'ImageInlineEditing' );
  57092. editor.config.define( 'image.styles', getDefaultStylesConfiguration( isBlockPluginLoaded, isInlinePluginLoaded ) );
  57093. /**
  57094. * It contains a list of the normalized and validated style options.
  57095. *
  57096. * * Each option contains a complete icon markup.
  57097. * * The style options not supported by any of the loaded image editing plugins (
  57098. * {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`} or
  57099. * {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`}) are filtered out.
  57100. *
  57101. * @protected
  57102. * @readonly
  57103. * @type {module:image/imagestyle~ImageStyleConfig}
  57104. */
  57105. this.normalizedStyles = normalizeStyles( {
  57106. configuredStyles: editor.config.get( 'image.styles' ),
  57107. isBlockPluginLoaded,
  57108. isInlinePluginLoaded
  57109. } );
  57110. this._setupConversion( isBlockPluginLoaded, isInlinePluginLoaded );
  57111. this._setupPostFixer();
  57112. // Register imageStyle command.
  57113. editor.commands.add( 'imageStyle', new _imagestylecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, this.normalizedStyles ) );
  57114. }
  57115. /**
  57116. * Sets the editor conversion taking the presence of
  57117. * {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`}
  57118. * and {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`} plugins into consideration.
  57119. *
  57120. * @private
  57121. * @param {Boolean} isBlockPluginLoaded
  57122. * @param {Boolean} isInlinePluginLoaded
  57123. */
  57124. _setupConversion( isBlockPluginLoaded, isInlinePluginLoaded ) {
  57125. const editor = this.editor;
  57126. const schema = editor.model.schema;
  57127. const modelToViewConverter = Object(_converters__WEBPACK_IMPORTED_MODULE_4__["modelToViewStyleAttribute"])( this.normalizedStyles );
  57128. const viewToModelConverter = Object(_converters__WEBPACK_IMPORTED_MODULE_4__["viewToModelStyleAttribute"])( this.normalizedStyles );
  57129. editor.editing.downcastDispatcher.on( 'attribute:imageStyle', modelToViewConverter );
  57130. editor.data.downcastDispatcher.on( 'attribute:imageStyle', modelToViewConverter );
  57131. // Allow imageStyle attribute in image and imageInline.
  57132. // We could call it 'style' but https://github.com/ckeditor/ckeditor5-engine/issues/559.
  57133. if ( isBlockPluginLoaded ) {
  57134. schema.extend( 'imageBlock', { allowAttributes: 'imageStyle' } );
  57135. // Converter for figure element from view to model.
  57136. editor.data.upcastDispatcher.on( 'element:figure', viewToModelConverter, { priority: 'low' } );
  57137. }
  57138. if ( isInlinePluginLoaded ) {
  57139. schema.extend( 'imageInline', { allowAttributes: 'imageStyle' } );
  57140. // Converter for the img element from view to model.
  57141. editor.data.upcastDispatcher.on( 'element:img', viewToModelConverter, { priority: 'low' } );
  57142. }
  57143. }
  57144. /**
  57145. * Registers a post-fixer that will make sure that the style attribute value is correct for a specific image type (block vs inline).
  57146. *
  57147. * @private
  57148. */
  57149. _setupPostFixer() {
  57150. const editor = this.editor;
  57151. const document = editor.model.document;
  57152. const imageUtils = editor.plugins.get( _imageutils__WEBPACK_IMPORTED_MODULE_2__["default"] );
  57153. const stylesMap = new Map( this.normalizedStyles.map( style => [ style.name, style ] ) );
  57154. // Make sure that style attribute is valid for the image type.
  57155. document.registerPostFixer( writer => {
  57156. let changed = false;
  57157. for ( const change of document.differ.getChanges() ) {
  57158. if ( change.type == 'insert' || change.type == 'attribute' && change.attributeKey == 'imageStyle' ) {
  57159. let element = change.type == 'insert' ? change.position.nodeAfter : change.range.start.nodeAfter;
  57160. if ( element && element.is( 'element', 'paragraph' ) && element.childCount > 0 ) {
  57161. element = element.getChild( 0 );
  57162. }
  57163. if ( !imageUtils.isImage( element ) ) {
  57164. continue;
  57165. }
  57166. const imageStyle = element.getAttribute( 'imageStyle' );
  57167. if ( !imageStyle ) {
  57168. continue;
  57169. }
  57170. const imageStyleDefinition = stylesMap.get( imageStyle );
  57171. if ( !imageStyleDefinition || !imageStyleDefinition.modelElements.includes( element.name ) ) {
  57172. writer.removeAttribute( 'imageStyle', element );
  57173. changed = true;
  57174. }
  57175. }
  57176. }
  57177. return changed;
  57178. } );
  57179. }
  57180. }
  57181. /***/ }),
  57182. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleui.js":
  57183. /*!*******************************************************************************!*\
  57184. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleui.js ***!
  57185. \*******************************************************************************/
  57186. /*! exports provided: default */
  57187. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57188. "use strict";
  57189. __webpack_require__.r(__webpack_exports__);
  57190. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageStyleUI; });
  57191. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  57192. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  57193. /* harmony import */ var _imagestyleediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imagestyleediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleediting.js");
  57194. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js");
  57195. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  57196. /* harmony import */ var _theme_imagestyle_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/imagestyle.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css");
  57197. /**
  57198. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  57199. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  57200. */
  57201. /**
  57202. * @module image/imagestyle/imagestyleui
  57203. */
  57204. /**
  57205. * The image style UI plugin.
  57206. *
  57207. * It registers buttons corresponding to the {@link module:image/image~ImageConfig#styles} configuration.
  57208. * It also registers the {@link module:image/imagestyle/utils~DEFAULT_DROPDOWN_DEFINITIONS default drop-downs} and the
  57209. * custom drop-downs defined by the developer in the {@link module:image/image~ImageConfig#toolbar} configuration.
  57210. *
  57211. * @extends module:core/plugin~Plugin
  57212. */
  57213. class ImageStyleUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  57214. /**
  57215. * @inheritDoc
  57216. */
  57217. static get requires() {
  57218. return [ _imagestyleediting__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  57219. }
  57220. /**
  57221. * @inheritDoc
  57222. */
  57223. static get pluginName() {
  57224. return 'ImageStyleUI';
  57225. }
  57226. /**
  57227. * Returns the default localized style titles provided by the plugin.
  57228. *
  57229. * The following localized titles corresponding with
  57230. * {@link module:image/imagestyle/utils~DEFAULT_OPTIONS} are available:
  57231. *
  57232. * * `'Wrap text'`,
  57233. * * `'Break text'`,
  57234. * * `'In line'`,
  57235. * * `'Full size image'`,
  57236. * * `'Side image'`,
  57237. * * `'Left aligned image'`,
  57238. * * `'Centered image'`,
  57239. * * `'Right aligned image'`
  57240. *
  57241. * @returns {Object.<String,String>}
  57242. */
  57243. get localizedDefaultStylesTitles() {
  57244. const t = this.editor.t;
  57245. return {
  57246. 'Wrap text': t( 'Wrap text' ),
  57247. 'Break text': t( 'Break text' ),
  57248. 'In line': t( 'In line' ),
  57249. 'Full size image': t( 'Full size image' ),
  57250. 'Side image': t( 'Side image' ),
  57251. 'Left aligned image': t( 'Left aligned image' ),
  57252. 'Centered image': t( 'Centered image' ),
  57253. 'Right aligned image': t( 'Right aligned image' )
  57254. };
  57255. }
  57256. /**
  57257. * @inheritDoc
  57258. */
  57259. init() {
  57260. const plugins = this.editor.plugins;
  57261. const toolbarConfig = this.editor.config.get( 'image.toolbar' ) || [];
  57262. const definedStyles = translateStyles(
  57263. plugins.get( 'ImageStyleEditing' ).normalizedStyles,
  57264. this.localizedDefaultStylesTitles
  57265. );
  57266. for ( const styleConfig of definedStyles ) {
  57267. this._createButton( styleConfig );
  57268. }
  57269. const definedDropdowns = translateStyles(
  57270. [ ...toolbarConfig.filter( lodash_es__WEBPACK_IMPORTED_MODULE_4__["isObject"] ), ..._utils__WEBPACK_IMPORTED_MODULE_3__["default"].getDefaultDropdownDefinitions( plugins ) ],
  57271. this.localizedDefaultStylesTitles
  57272. );
  57273. for ( const dropdownConfig of definedDropdowns ) {
  57274. this._createDropdown( dropdownConfig, definedStyles );
  57275. }
  57276. }
  57277. /**
  57278. * Creates a dropdown and stores it in the editor {@link module:ui/componentfactory~ComponentFactory}.
  57279. *
  57280. * @private
  57281. * @param {module:image/imagestyle/imagestyleui~ImageStyleDropdownDefinition} dropdownConfig
  57282. * @param {Array.<module:image/imagestyle~ImageStyleOptionDefinition>} definedStyles
  57283. */
  57284. _createDropdown( dropdownConfig, definedStyles ) {
  57285. const factory = this.editor.ui.componentFactory;
  57286. factory.add( dropdownConfig.name, locale => {
  57287. let defaultButton;
  57288. const { defaultItem, items, title } = dropdownConfig;
  57289. const buttonViews = items
  57290. .filter( itemName => definedStyles.find( ( { name } ) => getUIComponentName( name ) === itemName ) )
  57291. .map( buttonName => {
  57292. const button = factory.create( buttonName );
  57293. if ( buttonName === defaultItem ) {
  57294. defaultButton = button;
  57295. }
  57296. return button;
  57297. } );
  57298. if ( items.length !== buttonViews.length ) {
  57299. _utils__WEBPACK_IMPORTED_MODULE_3__["default"].warnInvalidStyle( { dropdown: dropdownConfig } );
  57300. }
  57301. const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale, ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["SplitButtonView"] );
  57302. const splitButtonView = dropdownView.buttonView;
  57303. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["addToolbarToDropdown"])( dropdownView, buttonViews );
  57304. splitButtonView.set( {
  57305. label: getDropdownButtonTitle( title, defaultButton.label ),
  57306. class: null,
  57307. tooltip: true
  57308. } );
  57309. splitButtonView.bind( 'icon' ).toMany( buttonViews, 'isOn', ( ...areOn ) => {
  57310. const index = areOn.findIndex( lodash_es__WEBPACK_IMPORTED_MODULE_4__["identity"] );
  57311. return ( index < 0 ) ? defaultButton.icon : buttonViews[ index ].icon;
  57312. } );
  57313. splitButtonView.bind( 'label' ).toMany( buttonViews, 'isOn', ( ...areOn ) => {
  57314. const index = areOn.findIndex( lodash_es__WEBPACK_IMPORTED_MODULE_4__["identity"] );
  57315. return getDropdownButtonTitle( title, ( index < 0 ) ? defaultButton.label : buttonViews[ index ].label );
  57316. } );
  57317. splitButtonView.bind( 'isOn' ).toMany( buttonViews, 'isOn', ( ...areOn ) => areOn.some( lodash_es__WEBPACK_IMPORTED_MODULE_4__["identity"] ) );
  57318. splitButtonView.bind( 'class' )
  57319. .toMany( buttonViews, 'isOn', ( ...areOn ) => areOn.some( lodash_es__WEBPACK_IMPORTED_MODULE_4__["identity"] ) ? 'ck-splitbutton_flatten' : null );
  57320. splitButtonView.on( 'execute', () => {
  57321. if ( !buttonViews.some( ( { isOn } ) => isOn ) ) {
  57322. defaultButton.fire( 'execute' );
  57323. } else {
  57324. dropdownView.isOpen = !dropdownView.isOpen;
  57325. }
  57326. } );
  57327. dropdownView.bind( 'isEnabled' )
  57328. .toMany( buttonViews, 'isEnabled', ( ...areEnabled ) => areEnabled.some( lodash_es__WEBPACK_IMPORTED_MODULE_4__["identity"] ) );
  57329. return dropdownView;
  57330. } );
  57331. }
  57332. /**
  57333. * Creates a button and stores it in the editor {@link module:ui/componentfactory~ComponentFactory}.
  57334. *
  57335. * @private
  57336. * @param {module:image/imagestyle~ImageStyleOptionDefinition} buttonConfig
  57337. */
  57338. _createButton( buttonConfig ) {
  57339. const buttonName = buttonConfig.name;
  57340. this.editor.ui.componentFactory.add( getUIComponentName( buttonName ), locale => {
  57341. const command = this.editor.commands.get( 'imageStyle' );
  57342. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  57343. view.set( {
  57344. label: buttonConfig.title,
  57345. icon: buttonConfig.icon,
  57346. tooltip: true,
  57347. isToggleable: true
  57348. } );
  57349. view.bind( 'isEnabled' ).to( command, 'isEnabled' );
  57350. view.bind( 'isOn' ).to( command, 'value', value => value === buttonName );
  57351. view.on( 'execute', this._executeCommand.bind( this, buttonName ) );
  57352. return view;
  57353. } );
  57354. }
  57355. _executeCommand( name ) {
  57356. this.editor.execute( 'imageStyle', { value: name } );
  57357. this.editor.editing.view.focus();
  57358. }
  57359. }
  57360. // Returns the translated `title` from the passed styles array.
  57361. //
  57362. // @param {Array.<module:image/imagestyle~ImageStyleOptionDefinition|
  57363. // module:image/imagestyle/imagestyleui~ImageStyleDropdownDefinition>} styles
  57364. // @param {Object.<String,String>} titles
  57365. //
  57366. // @returns {Array.<module:image/imagestyle~ImageStyleOptionDefinition|module:image/imagestyle/imagestyleui~ImageStyleDropdownDefinition>}
  57367. function translateStyles( styles, titles ) {
  57368. for ( const style of styles ) {
  57369. // Localize the titles of the styles, if a title corresponds with
  57370. // a localized default provided by the plugin.
  57371. if ( titles[ style.title ] ) {
  57372. style.title = titles[ style.title ];
  57373. }
  57374. }
  57375. return styles;
  57376. }
  57377. // Returns the image style component name with the "imageStyle:" prefix.
  57378. //
  57379. // @param {String} name
  57380. // @returns {String}
  57381. function getUIComponentName( name ) {
  57382. return `imageStyle:${ name }`;
  57383. }
  57384. // Returns title for the splitbutton containing the dropdown title and default action item title.
  57385. //
  57386. // @param {String|undefined} dropdownTitle
  57387. // @param {String} buttonTitle
  57388. // @returns {String}
  57389. function getDropdownButtonTitle( dropdownTitle, buttonTitle ) {
  57390. return ( dropdownTitle ? dropdownTitle + ': ' : '' ) + buttonTitle;
  57391. }
  57392. /**
  57393. * # **The image style custom drop-down definition descriptor**
  57394. *
  57395. * This definition can be implemented in the {@link module:image/image~ImageConfig#toolbar image toolbar configuration}
  57396. * to define a completely custom drop-down in the image toolbar.
  57397. *
  57398. * ClassicEditor.create( editorElement, {
  57399. * image: { toolbar: [
  57400. * // One of the predefined drop-downs
  57401. * 'imageStyle:wrapText',
  57402. * // Custom drop-down
  57403. * {
  57404. * name: 'imageStyle:customDropdown',
  57405. * title: Custom drop-down title,
  57406. * items: [ 'imageStyle:alignLeft', 'imageStyle:alignRight' ],
  57407. * defaultItem: 'imageStyle:alignLeft'
  57408. * }
  57409. * ] }
  57410. * } );
  57411. *
  57412. * **Note:** At the moment it is possible to populate the custom drop-down with only the buttons registered by the `ImageStyle` plugin.
  57413. *
  57414. * The defined drop-down will be registered
  57415. * as the {@link module:ui/dropdown/dropdownview~DropdownView}
  57416. * with the {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView} under the provided name in the
  57417. * {@link module:ui/componentfactory~ComponentFactory}
  57418. *
  57419. * @property {String} name The unique name of the drop-down. It is recommended to precede it with the "imageStyle:" prefix
  57420. * to avoid collision with the components' names registered by other plugins.
  57421. *
  57422. * @property {String} [title] The drop-down's title. It will be used as the split button label along with the title of the default item
  57423. * in the following manner: "Custom drop-down title: Default item title".
  57424. *
  57425. * Setting `title` to one of
  57426. * {@link module:image/imagestyle/imagestyleui~ImageStyleUI#localizedDefaultStylesTitles}
  57427. * will automatically translate it to the language of the editor.
  57428. *
  57429. * @property {Array.<String>} items The list of the names of the buttons that will be placed in the drop-down's toolbar.
  57430. * Each of the buttons has to be one of the {@link module:image/image~ImageConfig#styles default image style buttons}
  57431. * or to be defined as the {@link module:image/imagestyle~ImageStyleOptionDefinition image styling option}.
  57432. *
  57433. * @property {String} defaultItem The name of one of the buttons from the items list,
  57434. * which will be used as a default button for the drop-down's split button.
  57435. *
  57436. * @typedef {Object} module:image/imagestyle/imagestyleui~ImageStyleDropdownDefinition
  57437. */
  57438. /***/ }),
  57439. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js":
  57440. /*!************************************************************************!*\
  57441. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js ***!
  57442. \************************************************************************/
  57443. /*! exports provided: default */
  57444. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57445. "use strict";
  57446. __webpack_require__.r(__webpack_exports__);
  57447. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  57448. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  57449. /**
  57450. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  57451. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  57452. */
  57453. /**
  57454. * @module image/imagestyle/utils
  57455. */
  57456. const {
  57457. objectFullWidth,
  57458. objectInline,
  57459. objectLeft, objectRight, objectCenter,
  57460. objectBlockLeft, objectBlockRight
  57461. } = ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"];
  57462. /**
  57463. * Default image style options provided by the plugin that can be referred in the {@link module:image/image~ImageConfig#styles}
  57464. * configuration.
  57465. *
  57466. * There are available 5 styles focused on formatting:
  57467. *
  57468. * * **`'alignLeft'`** aligns the inline or block image to the left and wraps it with the text using the `image-style-align-left` class,
  57469. * * **`'alignRight'`** aligns the inline or block image to the right and wraps it with the text using the `image-style-align-right` class,
  57470. * * **`'alignCenter'`** centers the block image using the `image-style-align-center` class,
  57471. * * **`'alignBlockLeft'`** aligns the block image to the left using the `image-style-block-align-left` class,
  57472. * * **`'alignBlockRight'`** aligns the block image to the right using the `image-style-block-align-right` class,
  57473. *
  57474. * and 3 semantic styles:
  57475. *
  57476. * * **`'inline'`** is an inline image without any CSS class,
  57477. * * **`'block'`** is a block image without any CSS class,
  57478. * * **`'side'`** is a block image styled with the `image-style-side` CSS class.
  57479. *
  57480. * @readonly
  57481. * @type {Object.<String,module:image/imagestyle~ImageStyleOptionDefinition>}
  57482. */
  57483. const DEFAULT_OPTIONS = {
  57484. // This style represents an image placed in the line of text.
  57485. inline: {
  57486. name: 'inline',
  57487. title: 'In line',
  57488. icon: objectInline,
  57489. modelElements: [ 'imageInline' ],
  57490. isDefault: true
  57491. },
  57492. // This style represents an image aligned to the left and wrapped with text.
  57493. alignLeft: {
  57494. name: 'alignLeft',
  57495. title: 'Left aligned image',
  57496. icon: objectLeft,
  57497. modelElements: [ 'imageBlock', 'imageInline' ],
  57498. className: 'image-style-align-left'
  57499. },
  57500. // This style represents an image aligned to the left.
  57501. alignBlockLeft: {
  57502. name: 'alignBlockLeft',
  57503. title: 'Left aligned image',
  57504. icon: objectBlockLeft,
  57505. modelElements: [ 'imageBlock' ],
  57506. className: 'image-style-block-align-left'
  57507. },
  57508. // This style represents a centered image.
  57509. alignCenter: {
  57510. name: 'alignCenter',
  57511. title: 'Centered image',
  57512. icon: objectCenter,
  57513. modelElements: [ 'imageBlock' ],
  57514. className: 'image-style-align-center'
  57515. },
  57516. // This style represents an image aligned to the right and wrapped with text.
  57517. alignRight: {
  57518. name: 'alignRight',
  57519. title: 'Right aligned image',
  57520. icon: objectRight,
  57521. modelElements: [ 'imageBlock', 'imageInline' ],
  57522. className: 'image-style-align-right'
  57523. },
  57524. // This style represents an image aligned to the right.
  57525. alignBlockRight: {
  57526. name: 'alignBlockRight',
  57527. title: 'Right aligned image',
  57528. icon: objectBlockRight,
  57529. modelElements: [ 'imageBlock' ],
  57530. className: 'image-style-block-align-right'
  57531. },
  57532. // This option is equal to the situation when no style is applied.
  57533. block: {
  57534. name: 'block',
  57535. title: 'Centered image',
  57536. icon: objectCenter,
  57537. modelElements: [ 'imageBlock' ],
  57538. isDefault: true
  57539. },
  57540. // This represents a side image.
  57541. side: {
  57542. name: 'side',
  57543. title: 'Side image',
  57544. icon: objectRight,
  57545. modelElements: [ 'imageBlock' ],
  57546. className: 'image-style-side'
  57547. }
  57548. };
  57549. /**
  57550. * Default image style icons provided by the plugin that can be referred in the {@link module:image/image~ImageConfig#styles}
  57551. * configuration.
  57552. *
  57553. * See {@link module:image/imagestyle~ImageStyleOptionDefinition#icon} to learn more.
  57554. *
  57555. * There are 7 default icons available: `'full'`, `'left'`, `'inlineLeft'`, `'center'`, `'right'`, `'inlineRight'`, and `'inline'`.
  57556. *
  57557. * @readonly
  57558. * @type {Object.<String,String>}
  57559. */
  57560. const DEFAULT_ICONS = {
  57561. full: objectFullWidth,
  57562. left: objectBlockLeft,
  57563. right: objectBlockRight,
  57564. center: objectCenter,
  57565. inlineLeft: objectLeft,
  57566. inlineRight: objectRight,
  57567. inline: objectInline
  57568. };
  57569. /**
  57570. * Default drop-downs provided by the plugin that can be referred in the {@link module:image/image~ImageConfig#toolbar}
  57571. * configuration. The drop-downs are containers for the {@link module:image/imagestyle~ImageStyleConfig#options image style options}.
  57572. *
  57573. * If both of the `ImageEditing` plugins are loaded, there are 2 predefined drop-downs available:
  57574. *
  57575. * * **`'imageStyle:wrapText'`**, which contains the `alignLeft` and `alignRight` options, that is,
  57576. * those that wraps the text around the image,
  57577. * * **`'imageStyle:breakText'`**, which contains the `alignBlockLeft`, `alignCenter` and `alignBlockRight` options, that is,
  57578. * those that breaks the text around the image.
  57579. *
  57580. * @readonly
  57581. * @type {Array.<module:image/imagestyle/imagestyleui~ImageStyleDropdownDefinition>}
  57582. */
  57583. const DEFAULT_DROPDOWN_DEFINITIONS = [ {
  57584. name: 'imageStyle:wrapText',
  57585. title: 'Wrap text',
  57586. defaultItem: 'imageStyle:alignLeft',
  57587. items: [ 'imageStyle:alignLeft', 'imageStyle:alignRight' ]
  57588. }, {
  57589. name: 'imageStyle:breakText',
  57590. title: 'Break text',
  57591. defaultItem: 'imageStyle:block',
  57592. items: [ 'imageStyle:alignBlockLeft', 'imageStyle:block', 'imageStyle:alignBlockRight' ]
  57593. } ];
  57594. /**
  57595. * Returns a list of the normalized and validated image style options.
  57596. *
  57597. * @protected
  57598. * @param {Object} config
  57599. * @param {Boolean} config.isInlinePluginLoaded
  57600. * Determines whether the {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`} plugin has been loaded.
  57601. * @param {Boolean} config.isBlockPluginLoaded
  57602. * Determines whether the {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`} plugin has been loaded.
  57603. * @param {module:image/imagestyle~ImageStyleConfig} config.configuredStyles
  57604. * The image styles configuration provided in the image styles {@link module:image/image~ImageConfig#styles configuration}
  57605. * as a default or custom value.
  57606. * @returns {module:image/imagestyle~ImageStyleConfig}
  57607. * * Each of options contains a complete icon markup.
  57608. * * The image style options not supported by any of the loaded plugins are filtered out.
  57609. */
  57610. function normalizeStyles( config ) {
  57611. const configuredStyles = config.configuredStyles.options || [];
  57612. const styles = configuredStyles
  57613. .map( arrangement => normalizeDefinition( arrangement ) )
  57614. .filter( arrangement => isValidOption( arrangement, config ) );
  57615. return styles;
  57616. }
  57617. /**
  57618. * Returns the default image styles configuration depending on the loaded image editing plugins.
  57619. * @protected
  57620. *
  57621. * @param {Boolean} isInlinePluginLoaded
  57622. * Determines whether the {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`} plugin has been loaded.
  57623. *
  57624. * @param {Boolean} isBlockPluginLoaded
  57625. * Determines whether the {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`} plugin has been loaded.
  57626. *
  57627. * @returns {Object<String,Array>}
  57628. * It returns an object with the lists of the image style options and groups defined as strings related to the
  57629. * {@link module:image/imagestyle/utils~DEFAULT_OPTIONS default options}
  57630. */
  57631. function getDefaultStylesConfiguration( isBlockPluginLoaded, isInlinePluginLoaded ) {
  57632. if ( isBlockPluginLoaded && isInlinePluginLoaded ) {
  57633. return {
  57634. options: [
  57635. 'inline', 'alignLeft', 'alignRight',
  57636. 'alignCenter', 'alignBlockLeft', 'alignBlockRight',
  57637. 'block', 'side'
  57638. ]
  57639. };
  57640. } else if ( isBlockPluginLoaded ) {
  57641. return {
  57642. options: [ 'block', 'side' ]
  57643. };
  57644. } else if ( isInlinePluginLoaded ) {
  57645. return {
  57646. options: [ 'inline', 'alignLeft', 'alignRight' ]
  57647. };
  57648. }
  57649. return {};
  57650. }
  57651. /**
  57652. * Returns a list of the available predefined drop-downs' definitions depending on the loaded image editing plugins.
  57653. * @protected
  57654. *
  57655. * @param {module:core/plugincollection~PluginCollection} pluginCollection
  57656. * @returns {Array.<module:image/imagestyle/imagestyleui~ImageStyleDropdownDefinition>}
  57657. */
  57658. function getDefaultDropdownDefinitions( pluginCollection ) {
  57659. if ( pluginCollection.has( 'ImageBlockEditing' ) && pluginCollection.has( 'ImageInlineEditing' ) ) {
  57660. return [ ...DEFAULT_DROPDOWN_DEFINITIONS ];
  57661. } else {
  57662. return [];
  57663. }
  57664. }
  57665. // Normalizes an image style option or group provided in the {@link module:image/image~ImageConfig#styles}
  57666. // and returns it in a {@link module:image/imagestyle~ImageStyleOptionDefinition}/
  57667. //
  57668. // @param {Object|String} definition
  57669. //
  57670. // @returns {module:image/imagestyle~ImageStyleOptionDefinition}}
  57671. function normalizeDefinition( definition ) {
  57672. if ( typeof definition === 'string' ) {
  57673. // Just the name of the style has been passed, but none of the defaults.
  57674. if ( !DEFAULT_OPTIONS[ definition ] ) {
  57675. // Normalize the style anyway to prevent errors.
  57676. definition = { name: definition };
  57677. }
  57678. // Just the name of the style has been passed and it's one of the defaults, just use it.
  57679. // Clone the style to avoid overriding defaults.
  57680. else {
  57681. definition = { ...DEFAULT_OPTIONS[ definition ] };
  57682. }
  57683. } else {
  57684. // If an object style has been passed and if the name matches one of the defaults,
  57685. // extend it with defaults – the user wants to customize a default style.
  57686. // Note: Don't override the user–defined style object, clone it instead.
  57687. definition = extendStyle( DEFAULT_OPTIONS[ definition.name ], definition );
  57688. }
  57689. // If an icon is defined as a string and correspond with a name
  57690. // in default icons, use the default icon provided by the plugin.
  57691. if ( typeof definition.icon === 'string' ) {
  57692. definition.icon = DEFAULT_ICONS[ definition.icon ] || definition.icon;
  57693. }
  57694. return definition;
  57695. }
  57696. // Checks if the image style option is valid:
  57697. // * if it has the modelElements fields defined and filled,
  57698. // * if the defined modelElements are supported by any of the loaded image editing plugins.
  57699. // It also displays a console warning these conditions are not met.
  57700. //
  57701. // @param {module:image/imagestyle~ImageStyleOptionDefinition} image style option
  57702. // @param {Object.<String,Boolean>} { isBlockPluginLoaded, isInlinePluginLoaded }
  57703. //
  57704. // @returns Boolean
  57705. function isValidOption( option, { isBlockPluginLoaded, isInlinePluginLoaded } ) {
  57706. const { modelElements, name } = option;
  57707. if ( !modelElements || !modelElements.length || !name ) {
  57708. warnInvalidStyle( { style: option } );
  57709. return false;
  57710. } else {
  57711. const supportedElements = [ isBlockPluginLoaded ? 'imageBlock' : null, isInlinePluginLoaded ? 'imageInline' : null ];
  57712. // Check if the option is supported by any of the loaded plugins.
  57713. if ( !modelElements.some( elementName => supportedElements.includes( elementName ) ) ) {
  57714. /**
  57715. * In order to work correctly, each image style {@link module:image/imagestyle~ImageStyleOptionDefinition option}
  57716. * requires specific model elements (also: types of images) to be supported by the editor.
  57717. *
  57718. * Model element names to which the image style option can be applied are defined in the
  57719. * {@link module:image/imagestyle~ImageStyleOptionDefinition#modelElements} property of the style option
  57720. * definition.
  57721. *
  57722. * Explore the warning in the console to find out precisely which option is not supported and which editor plugins
  57723. * are missing. Make sure these plugins are loaded in your editor to get this image style option working.
  57724. *
  57725. * @error image-style-missing-dependency
  57726. * @param {String} [option] The name of the unsupported option.
  57727. * @param {String} [missingPlugins] The names of the plugins one of which has to be loaded for the particular option.
  57728. */
  57729. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["logWarning"])( 'image-style-missing-dependency', {
  57730. style: option,
  57731. missingPlugins: modelElements.map( name => name === 'imageBlock' ? 'ImageBlockEditing' : 'ImageInlineEditing' )
  57732. } );
  57733. return false;
  57734. }
  57735. }
  57736. return true;
  57737. }
  57738. // Extends the default style with a style provided by the developer.
  57739. // Note: Don't override the custom–defined style object, clone it instead.
  57740. //
  57741. // @param {module:image/imagestyle~ImageStyleOptionDefinition} source
  57742. // @param {Object} style
  57743. //
  57744. // @returns {module:image/imagestyle~ImageStyleOptionDefinition}
  57745. function extendStyle( source, style ) {
  57746. const extendedStyle = { ...style };
  57747. for ( const prop in source ) {
  57748. if ( !Object.prototype.hasOwnProperty.call( style, prop ) ) {
  57749. extendedStyle[ prop ] = source[ prop ];
  57750. }
  57751. }
  57752. return extendedStyle;
  57753. }
  57754. // Displays a console warning with the 'image-style-configuration-definition-invalid' error.
  57755. // @param {Object} info
  57756. function warnInvalidStyle( info ) {
  57757. /**
  57758. * The image style definition provided in the configuration is invalid.
  57759. *
  57760. * Please make sure the definition implements properly one of the following:
  57761. *
  57762. * * {@link module:image/imagestyle~ImageStyleOptionDefinition image style option definition},
  57763. * * {@link module:image/imagestyle/imagestyleui~ImageStyleDropdownDefinition image style dropdown definition}
  57764. *
  57765. * @error image-style-configuration-definition-invalid
  57766. * @param {String} [dropdown] The name of the invalid drop-down
  57767. * @param {String} [style] The name of the invalid image style option
  57768. */
  57769. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["logWarning"])( 'image-style-configuration-definition-invalid', info );
  57770. }
  57771. /* harmony default export */ __webpack_exports__["default"] = ({
  57772. normalizeStyles,
  57773. getDefaultStylesConfiguration,
  57774. getDefaultDropdownDefinitions,
  57775. warnInvalidStyle,
  57776. DEFAULT_OPTIONS,
  57777. DEFAULT_ICONS,
  57778. DEFAULT_DROPDOWN_DEFINITIONS
  57779. });
  57780. /***/ }),
  57781. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative.js":
  57782. /*!****************************************************************************!*\
  57783. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative.js ***!
  57784. \****************************************************************************/
  57785. /*! exports provided: default */
  57786. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57787. "use strict";
  57788. __webpack_require__.r(__webpack_exports__);
  57789. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageTextAlternative; });
  57790. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  57791. /* harmony import */ var _imagetextalternative_imagetextalternativeediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imagetextalternative/imagetextalternativeediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js");
  57792. /* harmony import */ var _imagetextalternative_imagetextalternativeui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imagetextalternative/imagetextalternativeui */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js");
  57793. /**
  57794. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  57795. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  57796. */
  57797. /**
  57798. * @module image/imagetextalternative
  57799. */
  57800. /**
  57801. * The image text alternative plugin.
  57802. *
  57803. * For a detailed overview, check the {@glink features/images/images-styles image styles} documentation.
  57804. *
  57805. * This is a "glue" plugin which loads the
  57806. * {@link module:image/imagetextalternative/imagetextalternativeediting~ImageTextAlternativeEditing}
  57807. * and {@link module:image/imagetextalternative/imagetextalternativeui~ImageTextAlternativeUI} plugins.
  57808. *
  57809. * @extends module:core/plugin~Plugin
  57810. */
  57811. class ImageTextAlternative extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  57812. /**
  57813. * @inheritDoc
  57814. */
  57815. static get requires() {
  57816. return [ _imagetextalternative_imagetextalternativeediting__WEBPACK_IMPORTED_MODULE_1__["default"], _imagetextalternative_imagetextalternativeui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  57817. }
  57818. /**
  57819. * @inheritDoc
  57820. */
  57821. static get pluginName() {
  57822. return 'ImageTextAlternative';
  57823. }
  57824. }
  57825. /***/ }),
  57826. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js":
  57827. /*!********************************************************************************************************!*\
  57828. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js ***!
  57829. \********************************************************************************************************/
  57830. /*! exports provided: default */
  57831. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57832. "use strict";
  57833. __webpack_require__.r(__webpack_exports__);
  57834. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageTextAlternativeCommand; });
  57835. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  57836. /**
  57837. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  57838. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  57839. */
  57840. /**
  57841. * @module image/imagetextalternative/imagetextalternativecommand
  57842. */
  57843. /**
  57844. * The image text alternative command. It is used to change the `alt` attribute of `<imageBlock>` and `<imageInline>` model elements.
  57845. *
  57846. * @extends module:core/command~Command
  57847. */
  57848. class ImageTextAlternativeCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  57849. /**
  57850. * The command value: `false` if there is no `alt` attribute, otherwise the value of the `alt` attribute.
  57851. *
  57852. * @readonly
  57853. * @observable
  57854. * @member {String|Boolean} #value
  57855. */
  57856. /**
  57857. * @inheritDoc
  57858. */
  57859. refresh() {
  57860. const editor = this.editor;
  57861. const imageUtils = editor.plugins.get( 'ImageUtils' );
  57862. const element = imageUtils.getClosestSelectedImageElement( this.editor.model.document.selection );
  57863. this.isEnabled = !!element;
  57864. if ( this.isEnabled && element.hasAttribute( 'alt' ) ) {
  57865. this.value = element.getAttribute( 'alt' );
  57866. } else {
  57867. this.value = false;
  57868. }
  57869. }
  57870. /**
  57871. * Executes the command.
  57872. *
  57873. * @fires execute
  57874. * @param {Object} options
  57875. * @param {String} options.newValue The new value of the `alt` attribute to set.
  57876. */
  57877. execute( options ) {
  57878. const editor = this.editor;
  57879. const imageUtils = editor.plugins.get( 'ImageUtils' );
  57880. const model = editor.model;
  57881. const imageElement = imageUtils.getClosestSelectedImageElement( model.document.selection );
  57882. model.change( writer => {
  57883. writer.setAttribute( 'alt', options.newValue, imageElement );
  57884. } );
  57885. }
  57886. }
  57887. /***/ }),
  57888. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js":
  57889. /*!********************************************************************************************************!*\
  57890. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js ***!
  57891. \********************************************************************************************************/
  57892. /*! exports provided: default */
  57893. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57894. "use strict";
  57895. __webpack_require__.r(__webpack_exports__);
  57896. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageTextAlternativeEditing; });
  57897. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  57898. /* harmony import */ var _imagetextalternativecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imagetextalternativecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js");
  57899. /* harmony import */ var _imageutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../imageutils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageutils.js");
  57900. /**
  57901. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  57902. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  57903. */
  57904. /**
  57905. * @module image/imagetextalternative/imagetextalternativeediting
  57906. */
  57907. /**
  57908. * The image text alternative editing plugin.
  57909. *
  57910. * Registers the `'imageTextAlternative'` command.
  57911. *
  57912. * @extends module:core/plugin~Plugin
  57913. */
  57914. class ImageTextAlternativeEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  57915. /**
  57916. * @inheritDoc
  57917. */
  57918. static get requires() {
  57919. return [ _imageutils__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  57920. }
  57921. /**
  57922. * @inheritDoc
  57923. */
  57924. static get pluginName() {
  57925. return 'ImageTextAlternativeEditing';
  57926. }
  57927. /**
  57928. * @inheritDoc
  57929. */
  57930. init() {
  57931. this.editor.commands.add( 'imageTextAlternative', new _imagetextalternativecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( this.editor ) );
  57932. }
  57933. }
  57934. /***/ }),
  57935. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js":
  57936. /*!***************************************************************************************************!*\
  57937. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js ***!
  57938. \***************************************************************************************************/
  57939. /*! exports provided: default */
  57940. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57941. "use strict";
  57942. __webpack_require__.r(__webpack_exports__);
  57943. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageTextAlternativeUI; });
  57944. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  57945. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  57946. /* harmony import */ var _ui_textalternativeformview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ui/textalternativeformview */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js");
  57947. /* harmony import */ var _image_ui_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../image/ui/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/ui/utils.js");
  57948. /**
  57949. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  57950. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  57951. */
  57952. /**
  57953. * @module image/imagetextalternative/imagetextalternativeui
  57954. */
  57955. /**
  57956. * The image text alternative UI plugin.
  57957. *
  57958. * The plugin uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
  57959. *
  57960. * @extends module:core/plugin~Plugin
  57961. */
  57962. class ImageTextAlternativeUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  57963. /**
  57964. * @inheritDoc
  57965. */
  57966. static get requires() {
  57967. return [ ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ContextualBalloon"] ];
  57968. }
  57969. /**
  57970. * @inheritDoc
  57971. */
  57972. static get pluginName() {
  57973. return 'ImageTextAlternativeUI';
  57974. }
  57975. /**
  57976. * @inheritDoc
  57977. */
  57978. init() {
  57979. this._createButton();
  57980. this._createForm();
  57981. }
  57982. /**
  57983. * @inheritDoc
  57984. */
  57985. destroy() {
  57986. super.destroy();
  57987. // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).
  57988. this._form.destroy();
  57989. }
  57990. /**
  57991. * Creates a button showing the balloon panel for changing the image text alternative and
  57992. * registers it in the editor {@link module:ui/componentfactory~ComponentFactory ComponentFactory}.
  57993. *
  57994. * @private
  57995. */
  57996. _createButton() {
  57997. const editor = this.editor;
  57998. const t = editor.t;
  57999. editor.ui.componentFactory.add( 'imageTextAlternative', locale => {
  58000. const command = editor.commands.get( 'imageTextAlternative' );
  58001. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  58002. view.set( {
  58003. label: t( 'Change image text alternative' ),
  58004. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].lowVision,
  58005. tooltip: true
  58006. } );
  58007. view.bind( 'isEnabled' ).to( command, 'isEnabled' );
  58008. this.listenTo( view, 'execute', () => {
  58009. this._showForm();
  58010. } );
  58011. return view;
  58012. } );
  58013. }
  58014. /**
  58015. * Creates the {@link module:image/imagetextalternative/ui/textalternativeformview~TextAlternativeFormView}
  58016. * form.
  58017. *
  58018. * @private
  58019. */
  58020. _createForm() {
  58021. const editor = this.editor;
  58022. const view = editor.editing.view;
  58023. const viewDocument = view.document;
  58024. const imageUtils = editor.plugins.get( 'ImageUtils' );
  58025. /**
  58026. * The contextual balloon plugin instance.
  58027. *
  58028. * @private
  58029. * @member {module:ui/panel/balloon/contextualballoon~ContextualBalloon}
  58030. */
  58031. this._balloon = this.editor.plugins.get( 'ContextualBalloon' );
  58032. /**
  58033. * A form containing a textarea and buttons, used to change the `alt` text value.
  58034. *
  58035. * @member {module:image/imagetextalternative/ui/textalternativeformview~TextAlternativeFormView}
  58036. */
  58037. this._form = new _ui_textalternativeformview__WEBPACK_IMPORTED_MODULE_2__["default"]( editor.locale );
  58038. // Render the form so its #element is available for clickOutsideHandler.
  58039. this._form.render();
  58040. this.listenTo( this._form, 'submit', () => {
  58041. editor.execute( 'imageTextAlternative', {
  58042. newValue: this._form.labeledInput.fieldView.element.value
  58043. } );
  58044. this._hideForm( true );
  58045. } );
  58046. this.listenTo( this._form, 'cancel', () => {
  58047. this._hideForm( true );
  58048. } );
  58049. // Close the form on Esc key press.
  58050. this._form.keystrokes.set( 'Esc', ( data, cancel ) => {
  58051. this._hideForm( true );
  58052. cancel();
  58053. } );
  58054. // Reposition the balloon or hide the form if an image widget is no longer selected.
  58055. this.listenTo( editor.ui, 'update', () => {
  58056. if ( !imageUtils.getClosestSelectedImageWidget( viewDocument.selection ) ) {
  58057. this._hideForm( true );
  58058. } else if ( this._isVisible ) {
  58059. Object(_image_ui_utils__WEBPACK_IMPORTED_MODULE_3__["repositionContextualBalloon"])( editor );
  58060. }
  58061. } );
  58062. // Close on click outside of balloon panel element.
  58063. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["clickOutsideHandler"])( {
  58064. emitter: this._form,
  58065. activator: () => this._isVisible,
  58066. contextElements: [ this._balloon.view.element ],
  58067. callback: () => this._hideForm()
  58068. } );
  58069. }
  58070. /**
  58071. * Shows the {@link #_form} in the {@link #_balloon}.
  58072. *
  58073. * @private
  58074. */
  58075. _showForm() {
  58076. if ( this._isVisible ) {
  58077. return;
  58078. }
  58079. const editor = this.editor;
  58080. const command = editor.commands.get( 'imageTextAlternative' );
  58081. const labeledInput = this._form.labeledInput;
  58082. this._form.disableCssTransitions();
  58083. if ( !this._isInBalloon ) {
  58084. this._balloon.add( {
  58085. view: this._form,
  58086. position: Object(_image_ui_utils__WEBPACK_IMPORTED_MODULE_3__["getBalloonPositionData"])( editor )
  58087. } );
  58088. }
  58089. // Make sure that each time the panel shows up, the field remains in sync with the value of
  58090. // the command. If the user typed in the input, then canceled the balloon (`labeledInput#value`
  58091. // stays unaltered) and re-opened it without changing the value of the command, they would see the
  58092. // old value instead of the actual value of the command.
  58093. // https://github.com/ckeditor/ckeditor5-image/issues/114
  58094. labeledInput.fieldView.value = labeledInput.fieldView.element.value = command.value || '';
  58095. this._form.labeledInput.fieldView.select();
  58096. this._form.enableCssTransitions();
  58097. }
  58098. /**
  58099. * Removes the {@link #_form} from the {@link #_balloon}.
  58100. *
  58101. * @param {Boolean} [focusEditable=false] Controls whether the editing view is focused afterwards.
  58102. * @private
  58103. */
  58104. _hideForm( focusEditable ) {
  58105. if ( !this._isInBalloon ) {
  58106. return;
  58107. }
  58108. // Blur the input element before removing it from DOM to prevent issues in some browsers.
  58109. // See https://github.com/ckeditor/ckeditor5/issues/1501.
  58110. if ( this._form.focusTracker.isFocused ) {
  58111. this._form.saveButtonView.focus();
  58112. }
  58113. this._balloon.remove( this._form );
  58114. if ( focusEditable ) {
  58115. this.editor.editing.view.focus();
  58116. }
  58117. }
  58118. /**
  58119. * Returns `true` when the {@link #_form} is the visible view in the {@link #_balloon}.
  58120. *
  58121. * @private
  58122. * @type {Boolean}
  58123. */
  58124. get _isVisible() {
  58125. return this._balloon.visibleView === this._form;
  58126. }
  58127. /**
  58128. * Returns `true` when the {@link #_form} is in the {@link #_balloon}.
  58129. *
  58130. * @private
  58131. * @type {Boolean}
  58132. */
  58133. get _isInBalloon() {
  58134. return this._balloon.hasView( this._form );
  58135. }
  58136. }
  58137. /***/ }),
  58138. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js":
  58139. /*!*******************************************************************************************************!*\
  58140. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js ***!
  58141. \*******************************************************************************************************/
  58142. /*! exports provided: default */
  58143. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58144. "use strict";
  58145. __webpack_require__.r(__webpack_exports__);
  58146. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextAlternativeFormView; });
  58147. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  58148. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  58149. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  58150. /* harmony import */ var _theme_textalternativeform_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../theme/textalternativeform.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css");
  58151. /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css");
  58152. /**
  58153. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  58154. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  58155. */
  58156. /**
  58157. * @module image/imagetextalternative/ui/textalternativeformview
  58158. */
  58159. // See: #8833.
  58160. // eslint-disable-next-line ckeditor5-rules/ckeditor-imports
  58161. /**
  58162. * The TextAlternativeFormView class.
  58163. *
  58164. * @extends module:ui/view~View
  58165. */
  58166. class TextAlternativeFormView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"] {
  58167. /**
  58168. * @inheritDoc
  58169. */
  58170. constructor( locale ) {
  58171. super( locale );
  58172. const t = this.locale.t;
  58173. /**
  58174. * Tracks information about the DOM focus in the form.
  58175. *
  58176. * @readonly
  58177. * @member {module:utils/focustracker~FocusTracker}
  58178. */
  58179. this.focusTracker = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["FocusTracker"]();
  58180. /**
  58181. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  58182. *
  58183. * @readonly
  58184. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  58185. */
  58186. this.keystrokes = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["KeystrokeHandler"]();
  58187. /**
  58188. * An input with a label.
  58189. *
  58190. * @member {module:ui/labeledfield/labeledfieldview~LabeledFieldView} #labeledInput
  58191. */
  58192. this.labeledInput = this._createLabeledInputView();
  58193. /**
  58194. * A button used to submit the form.
  58195. *
  58196. * @member {module:ui/button/buttonview~ButtonView} #saveButtonView
  58197. */
  58198. this.saveButtonView = this._createButton( t( 'Save' ), ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["icons"].check, 'ck-button-save' );
  58199. this.saveButtonView.type = 'submit';
  58200. /**
  58201. * A button used to cancel the form.
  58202. *
  58203. * @member {module:ui/button/buttonview~ButtonView} #cancelButtonView
  58204. */
  58205. this.cancelButtonView = this._createButton( t( 'Cancel' ), ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["icons"].cancel, 'ck-button-cancel', 'cancel' );
  58206. /**
  58207. * A collection of views which can be focused in the form.
  58208. *
  58209. * @readonly
  58210. * @protected
  58211. * @member {module:ui/viewcollection~ViewCollection}
  58212. */
  58213. this._focusables = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ViewCollection"]();
  58214. /**
  58215. * Helps cycling over {@link #_focusables} in the form.
  58216. *
  58217. * @readonly
  58218. * @protected
  58219. * @member {module:ui/focuscycler~FocusCycler}
  58220. */
  58221. this._focusCycler = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["FocusCycler"]( {
  58222. focusables: this._focusables,
  58223. focusTracker: this.focusTracker,
  58224. keystrokeHandler: this.keystrokes,
  58225. actions: {
  58226. // Navigate form fields backwards using the Shift + Tab keystroke.
  58227. focusPrevious: 'shift + tab',
  58228. // Navigate form fields forwards using the Tab key.
  58229. focusNext: 'tab'
  58230. }
  58231. } );
  58232. this.setTemplate( {
  58233. tag: 'form',
  58234. attributes: {
  58235. class: [
  58236. 'ck',
  58237. 'ck-text-alternative-form',
  58238. 'ck-responsive-form'
  58239. ],
  58240. // https://github.com/ckeditor/ckeditor5-image/issues/40
  58241. tabindex: '-1'
  58242. },
  58243. children: [
  58244. this.labeledInput,
  58245. this.saveButtonView,
  58246. this.cancelButtonView
  58247. ]
  58248. } );
  58249. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["injectCssTransitionDisabler"])( this );
  58250. }
  58251. /**
  58252. * @inheritDoc
  58253. */
  58254. render() {
  58255. super.render();
  58256. this.keystrokes.listenTo( this.element );
  58257. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["submitHandler"])( { view: this } );
  58258. [ this.labeledInput, this.saveButtonView, this.cancelButtonView ]
  58259. .forEach( v => {
  58260. // Register the view as focusable.
  58261. this._focusables.add( v );
  58262. // Register the view in the focus tracker.
  58263. this.focusTracker.add( v.element );
  58264. } );
  58265. }
  58266. /**
  58267. * @inheritDoc
  58268. */
  58269. destroy() {
  58270. super.destroy();
  58271. this.focusTracker.destroy();
  58272. this.keystrokes.destroy();
  58273. }
  58274. /**
  58275. * Creates the button view.
  58276. *
  58277. * @private
  58278. * @param {String} label The button label
  58279. * @param {String} icon The button's icon.
  58280. * @param {String} className The additional button CSS class name.
  58281. * @param {String} [eventName] The event name that the ButtonView#execute event will be delegated to.
  58282. * @returns {module:ui/button/buttonview~ButtonView} The button view instance.
  58283. */
  58284. _createButton( label, icon, className, eventName ) {
  58285. const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( this.locale );
  58286. button.set( {
  58287. label,
  58288. icon,
  58289. tooltip: true
  58290. } );
  58291. button.extendTemplate( {
  58292. attributes: {
  58293. class: className
  58294. }
  58295. } );
  58296. if ( eventName ) {
  58297. button.delegate( 'execute' ).to( this, eventName );
  58298. }
  58299. return button;
  58300. }
  58301. /**
  58302. * Creates an input with a label.
  58303. *
  58304. * @private
  58305. * @returns {module:ui/labeledfield/labeledfieldview~LabeledFieldView} Labeled field view instance.
  58306. */
  58307. _createLabeledInputView() {
  58308. const t = this.locale.t;
  58309. const labeledInput = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["LabeledFieldView"]( this.locale, ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["createLabeledInputText"] );
  58310. labeledInput.label = t( 'Text alternative' );
  58311. return labeledInput;
  58312. }
  58313. }
  58314. /***/ }),
  58315. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetoolbar.js":
  58316. /*!********************************************************************!*\
  58317. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetoolbar.js ***!
  58318. \********************************************************************/
  58319. /*! exports provided: default */
  58320. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58321. "use strict";
  58322. __webpack_require__.r(__webpack_exports__);
  58323. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageToolbar; });
  58324. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  58325. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  58326. /* harmony import */ var _imageutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imageutils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageutils.js");
  58327. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  58328. /**
  58329. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  58330. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  58331. */
  58332. /**
  58333. * @module image/imagetoolbar
  58334. */
  58335. /**
  58336. * The image toolbar plugin. It creates and manages the image toolbar (the toolbar displayed when an image is selected).
  58337. *
  58338. * For an overview, check the {@glink features/images/images-overview#image-contextual-toolbar image contextual toolbar} documentation.
  58339. *
  58340. * Instances of toolbar components (e.g. buttons) are created using the editor's
  58341. * {@link module:ui/componentfactory~ComponentFactory component factory}
  58342. * based on the {@link module:image/image~ImageConfig#toolbar `image.toolbar` configuration option}.
  58343. *
  58344. * The toolbar uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
  58345. *
  58346. * @extends module:core/plugin~Plugin
  58347. */
  58348. class ImageToolbar extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  58349. /**
  58350. * @inheritDoc
  58351. */
  58352. static get requires() {
  58353. return [ ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetToolbarRepository"], _imageutils__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  58354. }
  58355. /**
  58356. * @inheritDoc
  58357. */
  58358. static get pluginName() {
  58359. return 'ImageToolbar';
  58360. }
  58361. /**
  58362. * @inheritDoc
  58363. */
  58364. afterInit() {
  58365. const editor = this.editor;
  58366. const t = editor.t;
  58367. const widgetToolbarRepository = editor.plugins.get( ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetToolbarRepository"] );
  58368. const imageUtils = editor.plugins.get( 'ImageUtils' );
  58369. widgetToolbarRepository.register( 'image', {
  58370. ariaLabel: t( 'Image toolbar' ),
  58371. items: normalizeDeclarativeConfig( editor.config.get( 'image.toolbar' ) || [] ),
  58372. getRelatedElement: selection => imageUtils.getClosestSelectedImageWidget( selection )
  58373. } );
  58374. }
  58375. }
  58376. /**
  58377. * Items to be placed in the image toolbar.
  58378. * This option is used by the {@link module:image/imagetoolbar~ImageToolbar} feature.
  58379. *
  58380. * Assuming that you use the following features:
  58381. *
  58382. * * {@link module:image/imagestyle~ImageStyle} (with a default configuration),
  58383. * * {@link module:image/imagetextalternative~ImageTextAlternative},
  58384. * * {@link module:image/imagecaption~ImageCaption},
  58385. *
  58386. * the following toolbar items will be available in {@link module:ui/componentfactory~ComponentFactory}:
  58387. * * `'imageTextAlternative'`,
  58388. * * `'toggleImageCaption'`,
  58389. * * {@link module:image/image~ImageConfig#styles buttons provided by the `ImageStyle` plugin},
  58390. * * {@link module:image/imagestyle/utils~DEFAULT_DROPDOWN_DEFINITIONS drop-downs provided by the `ImageStyle` plugin},
  58391. *
  58392. * so you can configure the toolbar like this:
  58393. *
  58394. * const imageConfig = {
  58395. * toolbar: [
  58396. * 'imageStyle:inline', 'imageStyle:wrapText', 'imageStyle:breakText', '|',
  58397. * 'toggleImageCaption', 'imageTextAlternative'
  58398. * ]
  58399. * };
  58400. *
  58401. * Besides that, the `ImageStyle` plugin allows to define a
  58402. * {@link module:image/imagestyle/imagestyleui~ImageStyleDropdownDefinition custom drop-down} while configuring the toolbar.
  58403. *
  58404. * The same items can also be used in the {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
  58405. *
  58406. * Read more about configuring toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
  58407. *
  58408. * @member {Array.<String>} module:image/image~ImageConfig#toolbar
  58409. */
  58410. // Convert the dropdown definitions to their keys registered in the ComponentFactory.
  58411. // The registration precess should be handled by the plugin which handles the UI of a particular feature.
  58412. //
  58413. // @param {Array.<String|module:image/imagestyle/imagestyleui~ImageStyleDropdownDefinition>} config
  58414. //
  58415. // @returns {Array.<String>}
  58416. function normalizeDeclarativeConfig( config ) {
  58417. return config.map( item => Object(lodash_es__WEBPACK_IMPORTED_MODULE_3__["isObject"])( item ) ? item.name : item );
  58418. }
  58419. /***/ }),
  58420. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload.js":
  58421. /*!*******************************************************************!*\
  58422. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload.js ***!
  58423. \*******************************************************************/
  58424. /*! exports provided: default */
  58425. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58426. "use strict";
  58427. __webpack_require__.r(__webpack_exports__);
  58428. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUpload; });
  58429. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  58430. /* harmony import */ var _imageupload_imageuploadui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imageupload/imageuploadui */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadui.js");
  58431. /* harmony import */ var _imageupload_imageuploadprogress__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imageupload/imageuploadprogress */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadprogress.js");
  58432. /* harmony import */ var _imageupload_imageuploadediting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./imageupload/imageuploadediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadediting.js");
  58433. /**
  58434. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  58435. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  58436. */
  58437. /**
  58438. * @module image/imageupload
  58439. */
  58440. /**
  58441. * The image upload plugin.
  58442. *
  58443. * For a detailed overview, check the {@glink features/images/image-upload/image-upload image upload feature} documentation.
  58444. *
  58445. * This plugin does not do anything directly, but it loads a set of specific plugins to enable image uploading:
  58446. *
  58447. * * {@link module:image/imageupload/imageuploadediting~ImageUploadEditing},
  58448. * * {@link module:image/imageupload/imageuploadui~ImageUploadUI},
  58449. * * {@link module:image/imageupload/imageuploadprogress~ImageUploadProgress}.
  58450. *
  58451. * @extends module:core/plugin~Plugin
  58452. */
  58453. class ImageUpload extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  58454. /**
  58455. * @inheritDoc
  58456. */
  58457. static get pluginName() {
  58458. return 'ImageUpload';
  58459. }
  58460. /**
  58461. * @inheritDoc
  58462. */
  58463. static get requires() {
  58464. return [ _imageupload_imageuploadediting__WEBPACK_IMPORTED_MODULE_3__["default"], _imageupload_imageuploadui__WEBPACK_IMPORTED_MODULE_1__["default"], _imageupload_imageuploadprogress__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  58465. }
  58466. }
  58467. /**
  58468. * The image upload configuration.
  58469. *
  58470. * @member {module:image/imageupload~ImageUploadConfig} module:image/image~ImageConfig#upload
  58471. */
  58472. /**
  58473. * The configuration of the image upload feature. Used by the image upload feature in the `@ckeditor/ckeditor5-image` package.
  58474. *
  58475. * ClassicEditor
  58476. * .create( editorElement, {
  58477. * image: {
  58478. * upload: ... // Image upload feature options.
  58479. * }
  58480. * } )
  58481. * .then( ... )
  58482. * .catch( ... );
  58483. *
  58484. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  58485. *
  58486. * @interface module:image/imageupload~ImageUploadConfig
  58487. */
  58488. /**
  58489. * The list of accepted image types.
  58490. *
  58491. * The accepted types of images can be customized to allow only certain types of images:
  58492. *
  58493. * // Allow only JPEG and PNG images:
  58494. * const imageUploadConfig = {
  58495. * types: [ 'png', 'jpeg' ]
  58496. * };
  58497. *
  58498. * The type string should match [one of the sub-types](https://www.iana.org/assignments/media-types/media-types.xhtml#image)
  58499. * of the image MIME type. For example, for the `image/jpeg` MIME type, add `'jpeg'` to your image upload configuration.
  58500. *
  58501. * **Note:** This setting only restricts some image types to be selected and uploaded through the CKEditor UI and commands. Image type
  58502. * recognition and filtering should also be implemented on the server which accepts image uploads.
  58503. *
  58504. * @member {Array.<String>} module:image/imageupload~ImageUploadConfig#types
  58505. * @default [ 'jpeg', 'png', 'gif', 'bmp', 'webp', 'tiff' ]
  58506. */
  58507. /***/ }),
  58508. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadediting.js":
  58509. /*!**************************************************************************************!*\
  58510. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadediting.js ***!
  58511. \**************************************************************************************/
  58512. /*! exports provided: default, isHtmlIncluded */
  58513. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58514. "use strict";
  58515. __webpack_require__.r(__webpack_exports__);
  58516. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUploadEditing; });
  58517. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHtmlIncluded", function() { return isHtmlIncluded; });
  58518. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  58519. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  58520. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  58521. /* harmony import */ var ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/clipboard */ "./node_modules/ckeditor5/src/clipboard.js");
  58522. /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
  58523. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  58524. /* harmony import */ var _imageutils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../imageutils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageutils.js");
  58525. /* harmony import */ var _uploadimagecommand__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./uploadimagecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/uploadimagecommand.js");
  58526. /* harmony import */ var _src_imageupload_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../src/imageupload/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js");
  58527. /**
  58528. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  58529. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  58530. */
  58531. /**
  58532. * @module image/imageupload/imageuploadediting
  58533. */
  58534. /**
  58535. * The editing part of the image upload feature. It registers the `'uploadImage'` command
  58536. * and the `imageUpload` command as an aliased name.
  58537. *
  58538. * When an image is uploaded, it fires the {@link ~ImageUploadEditing#event:uploadComplete `uploadComplete`} event
  58539. * that allows adding custom attributes to the {@link module:engine/model/element~Element image element}.
  58540. *
  58541. * @extends module:core/plugin~Plugin
  58542. */
  58543. class ImageUploadEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  58544. /**
  58545. * @inheritDoc
  58546. */
  58547. static get requires() {
  58548. return [ ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_4__["FileRepository"], ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["Notification"], ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_3__["ClipboardPipeline"], _imageutils__WEBPACK_IMPORTED_MODULE_6__["default"] ];
  58549. }
  58550. static get pluginName() {
  58551. return 'ImageUploadEditing';
  58552. }
  58553. /**
  58554. * @inheritDoc
  58555. */
  58556. constructor( editor ) {
  58557. super( editor );
  58558. editor.config.define( 'image', {
  58559. upload: {
  58560. types: [ 'jpeg', 'png', 'gif', 'bmp', 'webp', 'tiff' ]
  58561. }
  58562. } );
  58563. /**
  58564. * An internal mapping of {@link module:upload/filerepository~FileLoader#id file loader UIDs} and
  58565. * model elements during the upload.
  58566. *
  58567. * Model element of the uploaded image can change, for instance, when {@link module:image/image/imagetypecommand~ImageTypeCommand}
  58568. * is executed as a result of adding caption or changing image style. As a result, the upload logic must keep track of the model
  58569. * element (reference) and resolve the upload for the correct model element (instead of the one that landed in the `$graveyard`
  58570. * after image type changed).
  58571. *
  58572. * @private
  58573. * @readonly
  58574. * @member {Map.<String,module:engine/model/element~Element>}
  58575. */
  58576. this._uploadImageElements = new Map();
  58577. }
  58578. /**
  58579. * @inheritDoc
  58580. */
  58581. init() {
  58582. const editor = this.editor;
  58583. const doc = editor.model.document;
  58584. const conversion = editor.conversion;
  58585. const fileRepository = editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_4__["FileRepository"] );
  58586. const imageUtils = editor.plugins.get( 'ImageUtils' );
  58587. const imageTypes = Object(_src_imageupload_utils__WEBPACK_IMPORTED_MODULE_8__["createImageTypeRegExp"])( editor.config.get( 'image.upload.types' ) );
  58588. const uploadImageCommand = new _uploadimagecommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor );
  58589. // Register `uploadImage` command and add `imageUpload` command as an alias for backward compatibility.
  58590. editor.commands.add( 'uploadImage', uploadImageCommand );
  58591. editor.commands.add( 'imageUpload', uploadImageCommand );
  58592. // Register upcast converter for uploadId.
  58593. conversion.for( 'upcast' )
  58594. .attributeToAttribute( {
  58595. view: {
  58596. name: 'img',
  58597. key: 'uploadId'
  58598. },
  58599. model: 'uploadId'
  58600. } );
  58601. // Handle pasted images.
  58602. // For every image file, a new file loader is created and a placeholder image is
  58603. // inserted into the content. Then, those images are uploaded once they appear in the model
  58604. // (see Document#change listener below).
  58605. this.listenTo( editor.editing.view.document, 'clipboardInput', ( evt, data ) => {
  58606. // Skip if non empty HTML data is included.
  58607. // https://github.com/ckeditor/ckeditor5-upload/issues/68
  58608. if ( isHtmlIncluded( data.dataTransfer ) ) {
  58609. return;
  58610. }
  58611. const images = Array.from( data.dataTransfer.files ).filter( file => {
  58612. // See https://github.com/ckeditor/ckeditor5-image/pull/254.
  58613. if ( !file ) {
  58614. return false;
  58615. }
  58616. return imageTypes.test( file.type );
  58617. } );
  58618. if ( !images.length ) {
  58619. return;
  58620. }
  58621. evt.stop();
  58622. editor.model.change( writer => {
  58623. // Set selection to paste target.
  58624. if ( data.targetRanges ) {
  58625. writer.setSelection( data.targetRanges.map( viewRange => editor.editing.mapper.toModelRange( viewRange ) ) );
  58626. }
  58627. // Upload images after the selection has changed in order to ensure the command's state is refreshed.
  58628. editor.model.enqueueChange( 'default', () => {
  58629. editor.execute( 'uploadImage', { file: images } );
  58630. } );
  58631. } );
  58632. } );
  58633. // Handle HTML pasted with images with base64 or blob sources.
  58634. // For every image file, a new file loader is created and a placeholder image is
  58635. // inserted into the content. Then, those images are uploaded once they appear in the model
  58636. // (see Document#change listener below).
  58637. this.listenTo( editor.plugins.get( 'ClipboardPipeline' ), 'inputTransformation', ( evt, data ) => {
  58638. const fetchableImages = Array.from( editor.editing.view.createRangeIn( data.content ) )
  58639. .filter( value => Object(_src_imageupload_utils__WEBPACK_IMPORTED_MODULE_8__["isLocalImage"])( imageUtils, value.item ) && !value.item.getAttribute( 'uploadProcessed' ) )
  58640. .map( value => { return { promise: Object(_src_imageupload_utils__WEBPACK_IMPORTED_MODULE_8__["fetchLocalImage"])( value.item ), imageElement: value.item }; } );
  58641. if ( !fetchableImages.length ) {
  58642. return;
  58643. }
  58644. const writer = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__["UpcastWriter"]( editor.editing.view.document );
  58645. for ( const fetchableImage of fetchableImages ) {
  58646. // Set attribute marking that the image was processed already.
  58647. writer.setAttribute( 'uploadProcessed', true, fetchableImage.imageElement );
  58648. const loader = fileRepository.createLoader( fetchableImage.promise );
  58649. if ( loader ) {
  58650. writer.setAttribute( 'src', '', fetchableImage.imageElement );
  58651. writer.setAttribute( 'uploadId', loader.id, fetchableImage.imageElement );
  58652. }
  58653. }
  58654. } );
  58655. // Prevents from the browser redirecting to the dropped image.
  58656. editor.editing.view.document.on( 'dragover', ( evt, data ) => {
  58657. data.preventDefault();
  58658. } );
  58659. // Upload placeholder images that appeared in the model.
  58660. doc.on( 'change', () => {
  58661. // Note: Reversing changes to start with insertions and only then handle removals. If it was the other way around,
  58662. // loaders for **all** images that land in the $graveyard would abort while in fact only those that were **not** replaced
  58663. // by other images should be aborted.
  58664. const changes = doc.differ.getChanges( { includeChangesInGraveyard: true } ).reverse();
  58665. const insertedImagesIds = new Set();
  58666. for ( const entry of changes ) {
  58667. if ( entry.type == 'insert' && entry.name != '$text' ) {
  58668. const item = entry.position.nodeAfter;
  58669. const isInsertedInGraveyard = entry.position.root.rootName == '$graveyard';
  58670. for ( const imageElement of getImagesFromChangeItem( editor, item ) ) {
  58671. // Check if the image element still has upload id.
  58672. const uploadId = imageElement.getAttribute( 'uploadId' );
  58673. if ( !uploadId ) {
  58674. continue;
  58675. }
  58676. // Check if the image is loaded on this client.
  58677. const loader = fileRepository.loaders.get( uploadId );
  58678. if ( !loader ) {
  58679. continue;
  58680. }
  58681. if ( isInsertedInGraveyard ) {
  58682. // If the image was inserted to the graveyard for good (**not** replaced by another image),
  58683. // only then abort the loading process.
  58684. if ( !insertedImagesIds.has( uploadId ) ) {
  58685. loader.abort();
  58686. }
  58687. } else {
  58688. // Remember the upload id of the inserted image. If it acted as a replacement for another
  58689. // image (which landed in the $graveyard), the related loader will not be aborted because
  58690. // this is still the same image upload.
  58691. insertedImagesIds.add( uploadId );
  58692. // Keep the mapping between the upload ID and the image model element so the upload
  58693. // can later resolve in the context of the correct model element. The model element could
  58694. // change for the same upload if one image was replaced by another (e.g. image type was changed),
  58695. // so this may also replace an existing mapping.
  58696. this._uploadImageElements.set( uploadId, imageElement );
  58697. if ( loader.status == 'idle' ) {
  58698. // If the image was inserted into content and has not been loaded yet, start loading it.
  58699. this._readAndUpload( loader );
  58700. }
  58701. }
  58702. }
  58703. }
  58704. }
  58705. } );
  58706. // Set the default handler for feeding the image element with `src` and `srcset` attributes.
  58707. this.on( 'uploadComplete', ( evt, { imageElement, data } ) => {
  58708. const urls = data.urls ? data.urls : data;
  58709. this.editor.model.change( writer => {
  58710. writer.setAttribute( 'src', urls.default, imageElement );
  58711. this._parseAndSetSrcsetAttributeOnImage( urls, imageElement, writer );
  58712. } );
  58713. }, { priority: 'low' } );
  58714. }
  58715. /**
  58716. * @inheritDoc
  58717. */
  58718. afterInit() {
  58719. const schema = this.editor.model.schema;
  58720. // Setup schema to allow uploadId and uploadStatus for images.
  58721. // Wait for ImageBlockEditing or ImageInlineEditing to register their elements first,
  58722. // that's why doing this in afterInit() instead of init().
  58723. if ( this.editor.plugins.has( 'ImageBlockEditing' ) ) {
  58724. schema.extend( 'imageBlock', {
  58725. allowAttributes: [ 'uploadId', 'uploadStatus' ]
  58726. } );
  58727. }
  58728. if ( this.editor.plugins.has( 'ImageInlineEditing' ) ) {
  58729. schema.extend( 'imageInline', {
  58730. allowAttributes: [ 'uploadId', 'uploadStatus' ]
  58731. } );
  58732. }
  58733. }
  58734. /**
  58735. * Reads and uploads an image.
  58736. *
  58737. * The image is read from the disk and as a Base64-encoded string it is set temporarily to
  58738. * `image[src]`. When the image is successfully uploaded, the temporary data is replaced with the target
  58739. * image's URL (the URL to the uploaded image on the server).
  58740. *
  58741. * @protected
  58742. * @param {module:upload/filerepository~FileLoader} loader
  58743. * @returns {Promise}
  58744. */
  58745. _readAndUpload( loader ) {
  58746. const editor = this.editor;
  58747. const model = editor.model;
  58748. const t = editor.locale.t;
  58749. const fileRepository = editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_4__["FileRepository"] );
  58750. const notification = editor.plugins.get( ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["Notification"] );
  58751. const imageUtils = editor.plugins.get( 'ImageUtils' );
  58752. const imageUploadElements = this._uploadImageElements;
  58753. model.enqueueChange( 'transparent', writer => {
  58754. writer.setAttribute( 'uploadStatus', 'reading', imageUploadElements.get( loader.id ) );
  58755. } );
  58756. return loader.read()
  58757. .then( () => {
  58758. const promise = loader.upload();
  58759. const imageElement = imageUploadElements.get( loader.id );
  58760. // Force re–paint in Safari. Without it, the image will display with a wrong size.
  58761. // https://github.com/ckeditor/ckeditor5/issues/1975
  58762. /* istanbul ignore next */
  58763. if ( ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_5__["env"].isSafari ) {
  58764. const viewFigure = editor.editing.mapper.toViewElement( imageElement );
  58765. const viewImg = imageUtils.findViewImgElement( viewFigure );
  58766. editor.editing.view.once( 'render', () => {
  58767. // Early returns just to be safe. There might be some code ran
  58768. // in between the outer scope and this callback.
  58769. if ( !viewImg.parent ) {
  58770. return;
  58771. }
  58772. const domFigure = editor.editing.view.domConverter.mapViewToDom( viewImg.parent );
  58773. if ( !domFigure ) {
  58774. return;
  58775. }
  58776. const originalDisplay = domFigure.style.display;
  58777. domFigure.style.display = 'none';
  58778. // Make sure this line will never be removed during minification for having "no effect".
  58779. domFigure._ckHack = domFigure.offsetHeight;
  58780. domFigure.style.display = originalDisplay;
  58781. } );
  58782. }
  58783. model.enqueueChange( 'transparent', writer => {
  58784. writer.setAttribute( 'uploadStatus', 'uploading', imageElement );
  58785. } );
  58786. return promise;
  58787. } )
  58788. .then( data => {
  58789. model.enqueueChange( 'transparent', writer => {
  58790. const imageElement = imageUploadElements.get( loader.id );
  58791. writer.setAttribute( 'uploadStatus', 'complete', imageElement );
  58792. /**
  58793. * An event fired when an image is uploaded. You can hook into this event to provide
  58794. * custom attributes to the {@link module:engine/model/element~Element image element} based on the data from
  58795. * the server.
  58796. *
  58797. * const imageUploadEditing = editor.plugins.get( 'ImageUploadEditing' );
  58798. *
  58799. * imageUploadEditing.on( 'uploadComplete', ( evt, { data, imageElement } ) => {
  58800. * editor.model.change( writer => {
  58801. * writer.setAttribute( 'someAttribute', 'foo', imageElement );
  58802. * } );
  58803. * } );
  58804. *
  58805. * You can also stop the default handler that sets the `src` and `srcset` attributes
  58806. * if you want to provide custom values for these attributes.
  58807. *
  58808. * imageUploadEditing.on( 'uploadComplete', ( evt, { data, imageElement } ) => {
  58809. * evt.stop();
  58810. * } );
  58811. *
  58812. * **Note**: This event is fired by the {@link module:image/imageupload/imageuploadediting~ImageUploadEditing} plugin.
  58813. *
  58814. * @event uploadComplete
  58815. * @param {Object} data The `uploadComplete` event data.
  58816. * @param {Object} data.data The data coming from the upload adapter.
  58817. * @param {module:engine/model/element~Element} data.imageElement The
  58818. * model {@link module:engine/model/element~Element image element} that can be customized.
  58819. */
  58820. this.fire( 'uploadComplete', { data, imageElement } );
  58821. } );
  58822. clean();
  58823. } )
  58824. .catch( error => {
  58825. // If status is not 'error' nor 'aborted' - throw error because it means that something else went wrong,
  58826. // it might be generic error and it would be real pain to find what is going on.
  58827. if ( loader.status !== 'error' && loader.status !== 'aborted' ) {
  58828. throw error;
  58829. }
  58830. // Might be 'aborted'.
  58831. if ( loader.status == 'error' && error ) {
  58832. notification.showWarning( error, {
  58833. title: t( 'Upload failed' ),
  58834. namespace: 'upload'
  58835. } );
  58836. }
  58837. // Permanently remove image from insertion batch.
  58838. model.enqueueChange( 'transparent', writer => {
  58839. writer.remove( imageUploadElements.get( loader.id ) );
  58840. } );
  58841. clean();
  58842. } );
  58843. function clean() {
  58844. model.enqueueChange( 'transparent', writer => {
  58845. const imageElement = imageUploadElements.get( loader.id );
  58846. writer.removeAttribute( 'uploadId', imageElement );
  58847. writer.removeAttribute( 'uploadStatus', imageElement );
  58848. imageUploadElements.delete( loader.id );
  58849. } );
  58850. fileRepository.destroyLoader( loader );
  58851. }
  58852. }
  58853. /**
  58854. * Creates the `srcset` attribute based on a given file upload response and sets it as an attribute to a specific image element.
  58855. *
  58856. * @protected
  58857. * @param {Object} data Data object from which `srcset` will be created.
  58858. * @param {module:engine/model/element~Element} image The image element on which the `srcset` attribute will be set.
  58859. * @param {module:engine/model/writer~Writer} writer
  58860. */
  58861. _parseAndSetSrcsetAttributeOnImage( data, image, writer ) {
  58862. // Srcset attribute for responsive images support.
  58863. let maxWidth = 0;
  58864. const srcsetAttribute = Object.keys( data )
  58865. // Filter out keys that are not integers.
  58866. .filter( key => {
  58867. const width = parseInt( key, 10 );
  58868. if ( !isNaN( width ) ) {
  58869. maxWidth = Math.max( maxWidth, width );
  58870. return true;
  58871. }
  58872. } )
  58873. // Convert each key to srcset entry.
  58874. .map( key => `${ data[ key ] } ${ key }w` )
  58875. // Join all entries.
  58876. .join( ', ' );
  58877. if ( srcsetAttribute != '' ) {
  58878. writer.setAttribute( 'srcset', {
  58879. data: srcsetAttribute,
  58880. width: maxWidth
  58881. }, image );
  58882. }
  58883. }
  58884. }
  58885. // Returns `true` if non-empty `text/html` is included in the data transfer.
  58886. //
  58887. // @param {module:clipboard/datatransfer~DataTransfer} dataTransfer
  58888. // @returns {Boolean}
  58889. function isHtmlIncluded( dataTransfer ) {
  58890. return Array.from( dataTransfer.types ).includes( 'text/html' ) && dataTransfer.getData( 'text/html' ) !== '';
  58891. }
  58892. function getImagesFromChangeItem( editor, item ) {
  58893. const imageUtils = editor.plugins.get( 'ImageUtils' );
  58894. return Array.from( editor.model.createRangeOn( item ) )
  58895. .filter( value => imageUtils.isImage( value.item ) )
  58896. .map( value => value.item );
  58897. }
  58898. /***/ }),
  58899. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadprogress.js":
  58900. /*!***************************************************************************************!*\
  58901. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadprogress.js ***!
  58902. \***************************************************************************************/
  58903. /*! exports provided: default */
  58904. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58905. "use strict";
  58906. __webpack_require__.r(__webpack_exports__);
  58907. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUploadProgress; });
  58908. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  58909. /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
  58910. /* harmony import */ var _theme_imageuploadprogress_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/imageuploadprogress.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css");
  58911. /* harmony import */ var _theme_imageuploadicon_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/imageuploadicon.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css");
  58912. /* harmony import */ var _theme_imageuploadloader_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/imageuploadloader.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css");
  58913. /**
  58914. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  58915. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  58916. */
  58917. /**
  58918. * @module image/imageupload/imageuploadprogress
  58919. */
  58920. /* globals setTimeout */
  58921. /**
  58922. * The image upload progress plugin.
  58923. * It shows a placeholder when the image is read from the disk and a progress bar while the image is uploading.
  58924. *
  58925. * @extends module:core/plugin~Plugin
  58926. */
  58927. class ImageUploadProgress extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  58928. /**
  58929. * @inheritDoc
  58930. */
  58931. static get pluginName() {
  58932. return 'ImageUploadProgress';
  58933. }
  58934. /**
  58935. * @inheritDoc
  58936. */
  58937. constructor( editor ) {
  58938. super( editor );
  58939. /**
  58940. * The image placeholder that is displayed before real image data can be accessed.
  58941. *
  58942. * For the record, this image is a 1x1 px GIF with an aspect ratio set by CSS.
  58943. *
  58944. * @protected
  58945. * @member {String} #placeholder
  58946. */
  58947. this.placeholder = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
  58948. }
  58949. /**
  58950. * @inheritDoc
  58951. */
  58952. init() {
  58953. const editor = this.editor;
  58954. // Upload status change - update image's view according to that status.
  58955. if ( editor.plugins.has( 'ImageBlockEditing' ) ) {
  58956. editor.editing.downcastDispatcher.on( 'attribute:uploadStatus:imageBlock', ( ...args ) => this.uploadStatusChange( ...args ) );
  58957. }
  58958. if ( editor.plugins.has( 'ImageInlineEditing' ) ) {
  58959. editor.editing.downcastDispatcher.on( 'attribute:uploadStatus:imageInline', ( ...args ) => this.uploadStatusChange( ...args ) );
  58960. }
  58961. }
  58962. /**
  58963. * This method is called each time the image `uploadStatus` attribute is changed.
  58964. *
  58965. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  58966. * @param {Object} data Additional information about the change.
  58967. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  58968. */
  58969. uploadStatusChange( evt, data, conversionApi ) {
  58970. const editor = this.editor;
  58971. const modelImage = data.item;
  58972. const uploadId = modelImage.getAttribute( 'uploadId' );
  58973. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  58974. return;
  58975. }
  58976. const imageUtils = editor.plugins.get( 'ImageUtils' );
  58977. const fileRepository = editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileRepository"] );
  58978. const status = uploadId ? data.attributeNewValue : null;
  58979. const placeholder = this.placeholder;
  58980. const viewFigure = editor.editing.mapper.toViewElement( modelImage );
  58981. const viewWriter = conversionApi.writer;
  58982. if ( status == 'reading' ) {
  58983. // Start "appearing" effect and show placeholder with infinite progress bar on the top
  58984. // while image is read from disk.
  58985. _startAppearEffect( viewFigure, viewWriter );
  58986. _showPlaceholder( imageUtils, placeholder, viewFigure, viewWriter );
  58987. return;
  58988. }
  58989. // Show progress bar on the top of the image when image is uploading.
  58990. if ( status == 'uploading' ) {
  58991. const loader = fileRepository.loaders.get( uploadId );
  58992. // Start appear effect if needed - see https://github.com/ckeditor/ckeditor5-image/issues/191.
  58993. _startAppearEffect( viewFigure, viewWriter );
  58994. if ( !loader ) {
  58995. // There is no loader associated with uploadId - this means that image came from external changes.
  58996. // In such cases we still want to show the placeholder until image is fully uploaded.
  58997. // Show placeholder if needed - see https://github.com/ckeditor/ckeditor5-image/issues/191.
  58998. _showPlaceholder( imageUtils, placeholder, viewFigure, viewWriter );
  58999. } else {
  59000. // Hide placeholder and initialize progress bar showing upload progress.
  59001. _hidePlaceholder( viewFigure, viewWriter );
  59002. _showProgressBar( viewFigure, viewWriter, loader, editor.editing.view );
  59003. _displayLocalImage( imageUtils, viewFigure, viewWriter, loader );
  59004. }
  59005. return;
  59006. }
  59007. if ( status == 'complete' && fileRepository.loaders.get( uploadId ) ) {
  59008. _showCompleteIcon( viewFigure, viewWriter, editor.editing.view );
  59009. }
  59010. // Clean up.
  59011. _hideProgressBar( viewFigure, viewWriter );
  59012. _hidePlaceholder( viewFigure, viewWriter );
  59013. _stopAppearEffect( viewFigure, viewWriter );
  59014. }
  59015. }
  59016. // Adds ck-appear class to the image figure if one is not already applied.
  59017. //
  59018. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  59019. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  59020. function _startAppearEffect( viewFigure, writer ) {
  59021. if ( !viewFigure.hasClass( 'ck-appear' ) ) {
  59022. writer.addClass( 'ck-appear', viewFigure );
  59023. }
  59024. }
  59025. // Removes ck-appear class to the image figure if one is not already removed.
  59026. //
  59027. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  59028. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  59029. function _stopAppearEffect( viewFigure, writer ) {
  59030. writer.removeClass( 'ck-appear', viewFigure );
  59031. }
  59032. // Shows placeholder together with infinite progress bar on given image figure.
  59033. //
  59034. // @param {module:image/imageutils~ImageUtils} imageUtils
  59035. // @param {String} Data-uri with a svg placeholder.
  59036. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  59037. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  59038. function _showPlaceholder( imageUtils, placeholder, viewFigure, writer ) {
  59039. if ( !viewFigure.hasClass( 'ck-image-upload-placeholder' ) ) {
  59040. writer.addClass( 'ck-image-upload-placeholder', viewFigure );
  59041. }
  59042. const viewImg = imageUtils.findViewImgElement( viewFigure );
  59043. if ( viewImg.getAttribute( 'src' ) !== placeholder ) {
  59044. writer.setAttribute( 'src', placeholder, viewImg );
  59045. }
  59046. if ( !_getUIElement( viewFigure, 'placeholder' ) ) {
  59047. writer.insert( writer.createPositionAfter( viewImg ), _createPlaceholder( writer ) );
  59048. }
  59049. }
  59050. // Removes placeholder together with infinite progress bar on given image figure.
  59051. //
  59052. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  59053. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  59054. function _hidePlaceholder( viewFigure, writer ) {
  59055. if ( viewFigure.hasClass( 'ck-image-upload-placeholder' ) ) {
  59056. writer.removeClass( 'ck-image-upload-placeholder', viewFigure );
  59057. }
  59058. _removeUIElement( viewFigure, writer, 'placeholder' );
  59059. }
  59060. // Shows progress bar displaying upload progress.
  59061. // Attaches it to the file loader to update when upload percentace is changed.
  59062. //
  59063. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  59064. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  59065. // @param {module:upload/filerepository~FileLoader} loader
  59066. // @param {module:engine/view/view~View} view
  59067. function _showProgressBar( viewFigure, writer, loader, view ) {
  59068. const progressBar = _createProgressBar( writer );
  59069. writer.insert( writer.createPositionAt( viewFigure, 'end' ), progressBar );
  59070. // Update progress bar width when uploadedPercent is changed.
  59071. loader.on( 'change:uploadedPercent', ( evt, name, value ) => {
  59072. view.change( writer => {
  59073. writer.setStyle( 'width', value + '%', progressBar );
  59074. } );
  59075. } );
  59076. }
  59077. // Hides upload progress bar.
  59078. //
  59079. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  59080. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  59081. function _hideProgressBar( viewFigure, writer ) {
  59082. _removeUIElement( viewFigure, writer, 'progressBar' );
  59083. }
  59084. // Shows complete icon and hides after a certain amount of time.
  59085. //
  59086. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  59087. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  59088. // @param {module:engine/view/view~View} view
  59089. function _showCompleteIcon( viewFigure, writer, view ) {
  59090. const completeIcon = writer.createUIElement( 'div', { class: 'ck-image-upload-complete-icon' } );
  59091. writer.insert( writer.createPositionAt( viewFigure, 'end' ), completeIcon );
  59092. setTimeout( () => {
  59093. view.change( writer => writer.remove( writer.createRangeOn( completeIcon ) ) );
  59094. }, 3000 );
  59095. }
  59096. // Create progress bar element using {@link module:engine/view/uielement~UIElement}.
  59097. //
  59098. // @private
  59099. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  59100. // @returns {module:engine/view/uielement~UIElement}
  59101. function _createProgressBar( writer ) {
  59102. const progressBar = writer.createUIElement( 'div', { class: 'ck-progress-bar' } );
  59103. writer.setCustomProperty( 'progressBar', true, progressBar );
  59104. return progressBar;
  59105. }
  59106. // Create placeholder element using {@link module:engine/view/uielement~UIElement}.
  59107. //
  59108. // @private
  59109. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  59110. // @returns {module:engine/view/uielement~UIElement}
  59111. function _createPlaceholder( writer ) {
  59112. const placeholder = writer.createUIElement( 'div', { class: 'ck-upload-placeholder-loader' } );
  59113. writer.setCustomProperty( 'placeholder', true, placeholder );
  59114. return placeholder;
  59115. }
  59116. // Returns {@link module:engine/view/uielement~UIElement} of given unique property from image figure element.
  59117. // Returns `undefined` if element is not found.
  59118. //
  59119. // @private
  59120. // @param {module:engine/view/element~Element} imageFigure
  59121. // @param {String} uniqueProperty
  59122. // @returns {module:engine/view/uielement~UIElement|undefined}
  59123. function _getUIElement( imageFigure, uniqueProperty ) {
  59124. for ( const child of imageFigure.getChildren() ) {
  59125. if ( child.getCustomProperty( uniqueProperty ) ) {
  59126. return child;
  59127. }
  59128. }
  59129. }
  59130. // Removes {@link module:engine/view/uielement~UIElement} of given unique property from image figure element.
  59131. //
  59132. // @private
  59133. // @param {module:engine/view/element~Element} imageFigure
  59134. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  59135. // @param {String} uniqueProperty
  59136. function _removeUIElement( viewFigure, writer, uniqueProperty ) {
  59137. const element = _getUIElement( viewFigure, uniqueProperty );
  59138. if ( element ) {
  59139. writer.remove( writer.createRangeOn( element ) );
  59140. }
  59141. }
  59142. // Displays local data from file loader.
  59143. //
  59144. // @param {module:image/imageutils~ImageUtils} imageUtils
  59145. // @param {module:engine/view/element~Element} imageFigure
  59146. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  59147. // @param {module:upload/filerepository~FileLoader} loader
  59148. function _displayLocalImage( imageUtils, viewFigure, writer, loader ) {
  59149. if ( loader.data ) {
  59150. const viewImg = imageUtils.findViewImgElement( viewFigure );
  59151. writer.setAttribute( 'src', loader.data, viewImg );
  59152. }
  59153. }
  59154. /***/ }),
  59155. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadui.js":
  59156. /*!*********************************************************************************!*\
  59157. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadui.js ***!
  59158. \*********************************************************************************/
  59159. /*! exports provided: default */
  59160. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59161. "use strict";
  59162. __webpack_require__.r(__webpack_exports__);
  59163. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUploadUI; });
  59164. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  59165. /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
  59166. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js");
  59167. /**
  59168. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  59169. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59170. */
  59171. /**
  59172. * @module image/imageupload/imageuploadui
  59173. */
  59174. /**
  59175. * The image upload button plugin.
  59176. *
  59177. * For a detailed overview, check the {@glink features/images/image-upload/image-upload Image upload feature} documentation.
  59178. *
  59179. * Adds the `'uploadImage'` button to the {@link module:ui/componentfactory~ComponentFactory UI component factory}
  59180. * and also the `imageUpload` button as an alias for backward compatibility.
  59181. *
  59182. * @extends module:core/plugin~Plugin
  59183. */
  59184. class ImageUploadUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  59185. /**
  59186. * @inheritDoc
  59187. */
  59188. static get pluginName() {
  59189. return 'ImageUploadUI';
  59190. }
  59191. /**
  59192. * @inheritDoc
  59193. */
  59194. init() {
  59195. const editor = this.editor;
  59196. const t = editor.t;
  59197. const componentCreator = locale => {
  59198. const view = new ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__["FileDialogButtonView"]( locale );
  59199. const command = editor.commands.get( 'uploadImage' );
  59200. const imageTypes = editor.config.get( 'image.upload.types' );
  59201. const imageTypesRegExp = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["createImageTypeRegExp"])( imageTypes );
  59202. view.set( {
  59203. acceptedType: imageTypes.map( type => `image/${ type }` ).join( ',' ),
  59204. allowMultipleFiles: true
  59205. } );
  59206. view.buttonView.set( {
  59207. label: t( 'Insert image' ),
  59208. icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["icons"].image,
  59209. tooltip: true
  59210. } );
  59211. view.buttonView.bind( 'isEnabled' ).to( command );
  59212. view.on( 'done', ( evt, files ) => {
  59213. const imagesToUpload = Array.from( files ).filter( file => imageTypesRegExp.test( file.type ) );
  59214. if ( imagesToUpload.length ) {
  59215. editor.execute( 'uploadImage', { file: imagesToUpload } );
  59216. }
  59217. } );
  59218. return view;
  59219. };
  59220. // Setup `uploadImage` button and add `imageUpload` button as an alias for backward compatibility.
  59221. editor.ui.componentFactory.add( 'uploadImage', componentCreator );
  59222. editor.ui.componentFactory.add( 'imageUpload', componentCreator );
  59223. }
  59224. }
  59225. /***/ }),
  59226. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/uploadimagecommand.js":
  59227. /*!**************************************************************************************!*\
  59228. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/uploadimagecommand.js ***!
  59229. \**************************************************************************************/
  59230. /*! exports provided: default */
  59231. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59232. "use strict";
  59233. __webpack_require__.r(__webpack_exports__);
  59234. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UploadImageCommand; });
  59235. /* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/upload */ "./node_modules/ckeditor5/src/upload.js");
  59236. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  59237. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  59238. /**
  59239. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  59240. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59241. */
  59242. /**
  59243. * @module image/imageupload/uploadimagecommand
  59244. */
  59245. /**
  59246. * The upload image command.
  59247. *
  59248. * The command is registered by the {@link module:image/imageupload/imageuploadediting~ImageUploadEditing} plugin as `uploadImage`
  59249. * and it is also available via aliased `imageUpload` name.
  59250. *
  59251. * In order to upload an image at the current selection position
  59252. * (according to the {@link module:widget/utils~findOptimalInsertionRange} algorithm),
  59253. * execute the command and pass the native image file instance:
  59254. *
  59255. * this.listenTo( editor.editing.view.document, 'clipboardInput', ( evt, data ) => {
  59256. * // Assuming that only images were pasted:
  59257. * const images = Array.from( data.dataTransfer.files );
  59258. *
  59259. * // Upload the first image:
  59260. * editor.execute( 'uploadImage', { file: images[ 0 ] } );
  59261. * } );
  59262. *
  59263. * It is also possible to insert multiple images at once:
  59264. *
  59265. * editor.execute( 'uploadImage', {
  59266. * file: [
  59267. * file1,
  59268. * file2
  59269. * ]
  59270. * } );
  59271. *
  59272. * @extends module:core/command~Command
  59273. */
  59274. class UploadImageCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["Command"] {
  59275. /**
  59276. * @inheritDoc
  59277. */
  59278. refresh() {
  59279. const editor = this.editor;
  59280. const imageUtils = editor.plugins.get( 'ImageUtils' );
  59281. const selectedElement = editor.model.document.selection.getSelectedElement();
  59282. // TODO: This needs refactoring.
  59283. this.isEnabled = imageUtils.isImageAllowed() || imageUtils.isImage( selectedElement );
  59284. }
  59285. /**
  59286. * Executes the command.
  59287. *
  59288. * @fires execute
  59289. * @param {Object} options Options for the executed command.
  59290. * @param {File|Array.<File>} options.file The image file or an array of image files to upload.
  59291. */
  59292. execute( options ) {
  59293. const files = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["toArray"])( options.file );
  59294. const selection = this.editor.model.document.selection;
  59295. const imageUtils = this.editor.plugins.get( 'ImageUtils' );
  59296. // In case of multiple files, each file (starting from the 2nd) will be inserted at a position that
  59297. // follows the previous one. That will move the selection and, to stay on the safe side and make sure
  59298. // all images inherit the same selection attributes, they are collected beforehand.
  59299. //
  59300. // Applying these attributes ensures, for instance, that inserting an (inline) image into a link does
  59301. // not split that link but preserves its continuity.
  59302. //
  59303. // Note: Selection attributes that do not make sense for images will be filtered out by insertImage() anyway.
  59304. const selectionAttributes = Object.fromEntries( selection.getAttributes() );
  59305. files.forEach( ( file, index ) => {
  59306. const selectedElement = selection.getSelectedElement();
  59307. // Inserting of an inline image replace the selected element and make a selection on the inserted image.
  59308. // Therefore inserting multiple inline images requires creating position after each element.
  59309. if ( index && selectedElement && imageUtils.isImage( selectedElement ) ) {
  59310. const position = this.editor.model.createPositionAfter( selectedElement );
  59311. this._uploadImage( file, selectionAttributes, position );
  59312. } else {
  59313. this._uploadImage( file, selectionAttributes );
  59314. }
  59315. } );
  59316. }
  59317. /**
  59318. * Handles uploading single file.
  59319. *
  59320. * @private
  59321. * @param {File} file
  59322. * @param {Object} attributes
  59323. * @param {module:engine/model/position~Position} position
  59324. */
  59325. _uploadImage( file, attributes, position ) {
  59326. const editor = this.editor;
  59327. const fileRepository = editor.plugins.get( ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_0__["FileRepository"] );
  59328. const loader = fileRepository.createLoader( file );
  59329. const imageUtils = editor.plugins.get( 'ImageUtils' );
  59330. // Do not throw when upload adapter is not set. FileRepository will log an error anyway.
  59331. if ( !loader ) {
  59332. return;
  59333. }
  59334. imageUtils.insertImage( { ...attributes, uploadId: loader.id }, position );
  59335. }
  59336. }
  59337. /***/ }),
  59338. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js":
  59339. /*!*************************************************************************!*\
  59340. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js ***!
  59341. \*************************************************************************/
  59342. /*! exports provided: createImageTypeRegExp, fetchLocalImage, isLocalImage */
  59343. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59344. "use strict";
  59345. __webpack_require__.r(__webpack_exports__);
  59346. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createImageTypeRegExp", function() { return createImageTypeRegExp; });
  59347. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fetchLocalImage", function() { return fetchLocalImage; });
  59348. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLocalImage", function() { return isLocalImage; });
  59349. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  59350. /**
  59351. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  59352. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59353. */
  59354. /**
  59355. * @module image/imageupload/utils
  59356. */
  59357. /* global fetch, File */
  59358. /**
  59359. * Creates a regular expression used to test for image files.
  59360. *
  59361. * const imageType = createImageTypeRegExp( [ 'png', 'jpeg', 'svg+xml', 'vnd.microsoft.icon' ] );
  59362. *
  59363. * console.log( 'is supported image', imageType.test( file.type ) );
  59364. *
  59365. * @param {Array.<String>} types
  59366. * @returns {RegExp}
  59367. */
  59368. function createImageTypeRegExp( types ) {
  59369. // Sanitize the MIME type name which may include: "+", "-" or ".".
  59370. const regExpSafeNames = types.map( type => type.replace( '+', '\\+' ) );
  59371. return new RegExp( `^image\\/(${ regExpSafeNames.join( '|' ) })$` );
  59372. }
  59373. /**
  59374. * Creates a promise that fetches the image local source (Base64 or blob) and resolves with a `File` object.
  59375. *
  59376. * @param {module:engine/view/element~Element} image Image whose source to fetch.
  59377. * @returns {Promise.<File>} A promise which resolves when an image source is fetched and converted to a `File` instance.
  59378. * It resolves with a `File` object. If there were any errors during file processing, the promise will be rejected.
  59379. */
  59380. function fetchLocalImage( image ) {
  59381. return new Promise( ( resolve, reject ) => {
  59382. const imageSrc = image.getAttribute( 'src' );
  59383. // Fetch works asynchronously and so does not block browser UI when processing data.
  59384. fetch( imageSrc )
  59385. .then( resource => resource.blob() )
  59386. .then( blob => {
  59387. const mimeType = getImageMimeType( blob, imageSrc );
  59388. const ext = mimeType.replace( 'image/', '' );
  59389. const filename = `image.${ ext }`;
  59390. const file = new File( [ blob ], filename, { type: mimeType } );
  59391. resolve( file );
  59392. } )
  59393. .catch( err => {
  59394. // Fetch fails only, if it can't make a request due to a network failure or if anything prevented the request
  59395. // from completing, i.e. the Content Security Policy rules. It is not possible to detect the exact cause of failure,
  59396. // so we are just trying the fallback solution, if general TypeError is thrown.
  59397. return err && err.name === 'TypeError' ?
  59398. convertLocalImageOnCanvas( imageSrc ).then( resolve ).catch( reject ) :
  59399. reject( err );
  59400. } );
  59401. } );
  59402. }
  59403. /**
  59404. * Checks whether a given node is an image element with a local source (Base64 or blob).
  59405. *
  59406. * @param {module:image/imageutils~ImageUtils} imageUtils
  59407. * @param {module:engine/view/node~Node} node The node to check.
  59408. * @returns {Boolean}
  59409. */
  59410. function isLocalImage( imageUtils, node ) {
  59411. if ( !imageUtils.isInlineImageView( node ) || !node.getAttribute( 'src' ) ) {
  59412. return false;
  59413. }
  59414. return node.getAttribute( 'src' ).match( /^data:image\/\w+;base64,/g ) ||
  59415. node.getAttribute( 'src' ).match( /^blob:/g );
  59416. }
  59417. // Extracts an image type based on its blob representation or its source.
  59418. //
  59419. // @param {String} src Image `src` attribute value.
  59420. // @param {Blob} blob Image blob representation.
  59421. // @returns {String}
  59422. function getImageMimeType( blob, src ) {
  59423. if ( blob.type ) {
  59424. return blob.type;
  59425. } else if ( src.match( /data:(image\/\w+);base64/ ) ) {
  59426. return src.match( /data:(image\/\w+);base64/ )[ 1 ].toLowerCase();
  59427. } else {
  59428. // Fallback to 'jpeg' as common extension.
  59429. return 'image/jpeg';
  59430. }
  59431. }
  59432. // Creates a promise that converts the image local source (Base64 or blob) to a blob using canvas and resolves
  59433. // with a `File` object.
  59434. //
  59435. // @param {String} imageSrc Image `src` attribute value.
  59436. // @returns {Promise.<File>} A promise which resolves when an image source is converted to a `File` instance.
  59437. // It resolves with a `File` object. If there were any errors during file processing, the promise will be rejected.
  59438. function convertLocalImageOnCanvas( imageSrc ) {
  59439. return getBlobFromCanvas( imageSrc ).then( blob => {
  59440. const mimeType = getImageMimeType( blob, imageSrc );
  59441. const ext = mimeType.replace( 'image/', '' );
  59442. const filename = `image.${ ext }`;
  59443. return new File( [ blob ], filename, { type: mimeType } );
  59444. } );
  59445. }
  59446. // Creates a promise that resolves with a `Blob` object converted from the image source (Base64 or blob).
  59447. //
  59448. // @param {String} imageSrc Image `src` attribute value.
  59449. // @returns {Promise.<Blob>}
  59450. function getBlobFromCanvas( imageSrc ) {
  59451. return new Promise( ( resolve, reject ) => {
  59452. const image = ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["global"].document.createElement( 'img' );
  59453. image.addEventListener( 'load', () => {
  59454. const canvas = ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["global"].document.createElement( 'canvas' );
  59455. canvas.width = image.width;
  59456. canvas.height = image.height;
  59457. const ctx = canvas.getContext( '2d' );
  59458. ctx.drawImage( image, 0, 0 );
  59459. canvas.toBlob( blob => blob ? resolve( blob ) : reject() );
  59460. } );
  59461. image.addEventListener( 'error', () => reject() );
  59462. image.src = imageSrc;
  59463. } );
  59464. }
  59465. /***/ }),
  59466. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageutils.js":
  59467. /*!******************************************************************!*\
  59468. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageutils.js ***!
  59469. \******************************************************************/
  59470. /*! exports provided: default */
  59471. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59472. "use strict";
  59473. __webpack_require__.r(__webpack_exports__);
  59474. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUtils; });
  59475. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  59476. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  59477. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  59478. /**
  59479. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  59480. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59481. */
  59482. /**
  59483. * @module image/imageutils
  59484. */
  59485. /**
  59486. * A set of helpers related to images.
  59487. *
  59488. * @extends module:core/plugin~Plugin
  59489. */
  59490. class ImageUtils extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  59491. /**
  59492. * @inheritDoc
  59493. */
  59494. static get pluginName() {
  59495. return 'ImageUtils';
  59496. }
  59497. /**
  59498. * Checks if the provided model element is an `image` or `imageInline`.
  59499. *
  59500. * @param {module:engine/model/element~Element} modelElement
  59501. * @returns {Boolean}
  59502. */
  59503. isImage( modelElement ) {
  59504. return this.isInlineImage( modelElement ) || this.isBlockImage( modelElement );
  59505. }
  59506. /**
  59507. * Checks if the provided view element represents an inline image.
  59508. *
  59509. * Also, see {@link module:image/imageutils~ImageUtils#isImageWidget}.
  59510. *
  59511. * @param {module:engine/view/element~Element} element
  59512. * @returns {Boolean}
  59513. */
  59514. isInlineImageView( element ) {
  59515. return !!element && element.is( 'element', 'img' );
  59516. }
  59517. /**
  59518. * Checks if the provided view element represents a block image.
  59519. *
  59520. * Also, see {@link module:image/imageutils~ImageUtils#isImageWidget}.
  59521. *
  59522. * @param {module:engine/view/element~Element} element
  59523. * @returns {Boolean}
  59524. */
  59525. isBlockImageView( element ) {
  59526. return !!element && element.is( 'element', 'figure' ) && element.hasClass( 'image' );
  59527. }
  59528. /**
  59529. * Handles inserting single file. This method unifies image insertion using {@link module:widget/utils~findOptimalInsertionRange}
  59530. * method.
  59531. *
  59532. * const imageUtils = editor.plugins.get( 'ImageUtils' );
  59533. *
  59534. * imageUtils.insertImage( { src: 'path/to/image.jpg' } );
  59535. *
  59536. * @param {Object} [attributes={}] Attributes of the inserted image.
  59537. * This method filters out the attributes which are disallowed by the {@link module:engine/model/schema~Schema}.
  59538. * @param {module:engine/model/selection~Selectable} [selectable] Place to insert the image. If not specified,
  59539. * the {@link module:widget/utils~findOptimalInsertionRange} logic will be applied for the block images
  59540. * and `model.document.selection` for the inline images.
  59541. *
  59542. * **Note**: If `selectable` is passed, this helper will not be able to set selection attributes (such as `linkHref`)
  59543. * and apply them to the new image. In this case, make sure all selection attributes are passed in `attributes`.
  59544. *
  59545. * @param {'imageBlock'|'imageInline'} [imageType] Image type of inserted image. If not specified,
  59546. * it will be determined automatically depending of editor config or place of the insertion.
  59547. * @return {module:engine/view/element~Element|null} The inserted model image element.
  59548. */
  59549. insertImage( attributes = {}, selectable = null, imageType = null ) {
  59550. const editor = this.editor;
  59551. const model = editor.model;
  59552. const selection = model.document.selection;
  59553. imageType = determineImageTypeForInsertion( editor, selectable || selection, imageType );
  59554. // Mix declarative attributes with selection attributes because the new image should "inherit"
  59555. // the latter for best UX. For instance, inline images inserted into existing links
  59556. // should not split them. To do that, they need to have "linkHref" inherited from the selection.
  59557. attributes = {
  59558. ...Object.fromEntries( selection.getAttributes() ),
  59559. ...attributes
  59560. };
  59561. for ( const attributeName in attributes ) {
  59562. if ( !model.schema.checkAttribute( imageType, attributeName ) ) {
  59563. delete attributes[ attributeName ];
  59564. }
  59565. }
  59566. return model.change( writer => {
  59567. const imageElement = writer.createElement( imageType, attributes );
  59568. // If we want to insert a block image (for whatever reason) then we don't want to split text blocks.
  59569. // This applies only when we don't have the selectable specified (i.e., we insert multiple block images at once).
  59570. if ( !selectable && imageType != 'imageInline' ) {
  59571. selectable = Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["findOptimalInsertionRange"])( selection, model );
  59572. }
  59573. model.insertContent( imageElement, selectable );
  59574. // Inserting an image might've failed due to schema regulations.
  59575. if ( imageElement.parent ) {
  59576. writer.setSelection( imageElement, 'on' );
  59577. return imageElement;
  59578. }
  59579. return null;
  59580. } );
  59581. }
  59582. /**
  59583. * Returns an image widget editing view element if one is selected or is among the selection's ancestors.
  59584. *
  59585. * @protected
  59586. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} selection
  59587. * @returns {module:engine/view/element~Element|null}
  59588. */
  59589. getClosestSelectedImageWidget( selection ) {
  59590. const viewElement = selection.getSelectedElement();
  59591. if ( viewElement && this.isImageWidget( viewElement ) ) {
  59592. return viewElement;
  59593. }
  59594. let parent = selection.getFirstPosition().parent;
  59595. while ( parent ) {
  59596. if ( parent.is( 'element' ) && this.isImageWidget( parent ) ) {
  59597. return parent;
  59598. }
  59599. parent = parent.parent;
  59600. }
  59601. return null;
  59602. }
  59603. /**
  59604. * Returns a image model element if one is selected or is among the selection's ancestors.
  59605. *
  59606. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  59607. * @returns {module:engine/model/element~Element|null}
  59608. */
  59609. getClosestSelectedImageElement( selection ) {
  59610. const selectedElement = selection.getSelectedElement();
  59611. return this.isImage( selectedElement ) ? selectedElement : selection.getFirstPosition().findAncestor( 'imageBlock' );
  59612. }
  59613. /**
  59614. * Checks if image can be inserted at current model selection.
  59615. *
  59616. * @protected
  59617. * @returns {Boolean}
  59618. */
  59619. isImageAllowed() {
  59620. const model = this.editor.model;
  59621. const selection = model.document.selection;
  59622. return isImageAllowedInParent( this.editor, selection ) && isNotInsideImage( selection );
  59623. }
  59624. /**
  59625. * Converts a given {@link module:engine/view/element~Element} to an image widget:
  59626. * * Adds a {@link module:engine/view/element~Element#_setCustomProperty custom property} allowing to recognize the image widget
  59627. * element.
  59628. * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.
  59629. *
  59630. * @protected
  59631. * @param {module:engine/view/element~Element} viewElement
  59632. * @param {module:engine/view/downcastwriter~DowncastWriter} writer An instance of the view writer.
  59633. * @param {String} label The element's label. It will be concatenated with the image `alt` attribute if one is present.
  59634. * @returns {module:engine/view/element~Element}
  59635. */
  59636. toImageWidget( viewElement, writer, label ) {
  59637. writer.setCustomProperty( 'image', true, viewElement );
  59638. const labelCreator = () => {
  59639. const imgElement = this.findViewImgElement( viewElement );
  59640. const altText = imgElement.getAttribute( 'alt' );
  59641. return altText ? `${ altText } ${ label }` : label;
  59642. };
  59643. return Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["toWidget"])( viewElement, writer, { label: labelCreator } );
  59644. }
  59645. /**
  59646. * Checks if a given view element is an image widget.
  59647. *
  59648. * @protected
  59649. * @param {module:engine/view/element~Element} viewElement
  59650. * @returns {Boolean}
  59651. */
  59652. isImageWidget( viewElement ) {
  59653. return !!viewElement.getCustomProperty( 'image' ) && Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["isWidget"])( viewElement );
  59654. }
  59655. /**
  59656. * Checks if the provided model element is an `image`.
  59657. *
  59658. * @param {module:engine/model/element~Element} modelElement
  59659. * @returns {Boolean}
  59660. */
  59661. isBlockImage( modelElement ) {
  59662. return !!modelElement && modelElement.is( 'element', 'imageBlock' );
  59663. }
  59664. /**
  59665. * Checks if the provided model element is an `imageInline`.
  59666. *
  59667. * @param {module:engine/model/element~Element} modelElement
  59668. * @returns {Boolean}
  59669. */
  59670. isInlineImage( modelElement ) {
  59671. return !!modelElement && modelElement.is( 'element', 'imageInline' );
  59672. }
  59673. /**
  59674. * Get the view `<img>` from another view element, e.g. a widget (`<figure class="image">`), a link (`<a>`).
  59675. *
  59676. * The `<img>` can be located deep in other elements, so this helper performs a deep tree search.
  59677. *
  59678. * @param {module:engine/view/element~Element} figureView
  59679. * @returns {module:engine/view/element~Element}
  59680. */
  59681. findViewImgElement( figureView ) {
  59682. if ( this.isInlineImageView( figureView ) ) {
  59683. return figureView;
  59684. }
  59685. const editingView = this.editor.editing.view;
  59686. for ( const { item } of editingView.createRangeIn( figureView ) ) {
  59687. if ( this.isInlineImageView( item ) ) {
  59688. return item;
  59689. }
  59690. }
  59691. }
  59692. }
  59693. // Checks if image is allowed by schema in optimal insertion parent.
  59694. //
  59695. // @private
  59696. // @param {module:core/editor/editor~Editor} editor
  59697. // @param {module:engine/model/selection~Selection} selection
  59698. // @returns {Boolean}
  59699. function isImageAllowedInParent( editor, selection ) {
  59700. const imageType = determineImageTypeForInsertion( editor, selection );
  59701. if ( imageType == 'imageBlock' ) {
  59702. const parent = getInsertImageParent( selection, editor.model );
  59703. if ( editor.model.schema.checkChild( parent, 'imageBlock' ) ) {
  59704. return true;
  59705. }
  59706. } else if ( editor.model.schema.checkChild( selection.focus, 'imageInline' ) ) {
  59707. return true;
  59708. }
  59709. return false;
  59710. }
  59711. // Checks if selection is not placed inside an image (e.g. its caption).
  59712. //
  59713. // @private
  59714. // @param {module:engine/model/selection~Selectable} selection
  59715. // @returns {Boolean}
  59716. function isNotInsideImage( selection ) {
  59717. return [ ...selection.focus.getAncestors() ].every( ancestor => !ancestor.is( 'element', 'imageBlock' ) );
  59718. }
  59719. // Returns a node that will be used to insert image with `model.insertContent`.
  59720. //
  59721. // @private
  59722. // @param {module:engine/model/selection~Selection} selection
  59723. // @param {module:engine/model/model~Model} model
  59724. // @returns {module:engine/model/element~Element}
  59725. function getInsertImageParent( selection, model ) {
  59726. const insertionRange = Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["findOptimalInsertionRange"])( selection, model );
  59727. const parent = insertionRange.start.parent;
  59728. if ( parent.isEmpty && !parent.is( 'element', '$root' ) ) {
  59729. return parent.parent;
  59730. }
  59731. return parent;
  59732. }
  59733. // Determine image element type name depending on editor config or place of insertion.
  59734. //
  59735. // @private
  59736. // @param {module:core/editor/editor~Editor} editor
  59737. // @param {module:engine/model/selection~Selectable} selectable
  59738. // @param {'imageBlock'|'imageInline'} [imageType] Image element type name. Used to force return of provided element name,
  59739. // but only if there is proper plugin enabled.
  59740. // @returns {'imageBlock'|'imageInline'} imageType
  59741. function determineImageTypeForInsertion( editor, selectable, imageType ) {
  59742. const schema = editor.model.schema;
  59743. const configImageInsertType = editor.config.get( 'image.insert.type' );
  59744. if ( !editor.plugins.has( 'ImageBlockEditing' ) ) {
  59745. return 'imageInline';
  59746. }
  59747. if ( !editor.plugins.has( 'ImageInlineEditing' ) ) {
  59748. return 'imageBlock';
  59749. }
  59750. if ( imageType ) {
  59751. return imageType;
  59752. }
  59753. if ( configImageInsertType === 'inline' ) {
  59754. return 'imageInline';
  59755. }
  59756. if ( configImageInsertType === 'block' ) {
  59757. return 'imageBlock';
  59758. }
  59759. // Try to replace the selected widget (e.g. another image).
  59760. if ( selectable.is( 'selection' ) ) {
  59761. return Object(_image_utils__WEBPACK_IMPORTED_MODULE_2__["determineImageTypeForInsertionAtSelection"])( schema, selectable );
  59762. }
  59763. return schema.checkChild( selectable, 'imageInline' ) ? 'imageInline' : 'imageBlock';
  59764. }
  59765. /***/ }),
  59766. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/image.css":
  59767. /*!****************************************************************!*\
  59768. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/image.css ***!
  59769. \****************************************************************/
  59770. /*! exports provided: default */
  59771. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59772. "use strict";
  59773. __webpack_require__.r(__webpack_exports__);
  59774. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  59775. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  59776. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_image_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./image.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-image/theme/image.css");
  59777. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  59778. options.insert = "head";
  59779. options.singleton = true;
  59780. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_image_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  59781. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_image_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  59782. /***/ }),
  59783. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css":
  59784. /*!***********************************************************************!*\
  59785. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css ***!
  59786. \***********************************************************************/
  59787. /*! exports provided: default */
  59788. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59789. "use strict";
  59790. __webpack_require__.r(__webpack_exports__);
  59791. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  59792. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  59793. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imagecaption_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./imagecaption.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css");
  59794. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  59795. options.insert = "head";
  59796. options.singleton = true;
  59797. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imagecaption_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  59798. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imagecaption_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  59799. /***/ }),
  59800. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css":
  59801. /*!**********************************************************************!*\
  59802. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css ***!
  59803. \**********************************************************************/
  59804. /*! exports provided: default */
  59805. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59806. "use strict";
  59807. __webpack_require__.r(__webpack_exports__);
  59808. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  59809. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  59810. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imageresize_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./imageresize.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css");
  59811. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  59812. options.insert = "head";
  59813. options.singleton = true;
  59814. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imageresize_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  59815. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imageresize_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  59816. /***/ }),
  59817. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css":
  59818. /*!*********************************************************************!*\
  59819. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css ***!
  59820. \*********************************************************************/
  59821. /*! exports provided: default */
  59822. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59823. "use strict";
  59824. __webpack_require__.r(__webpack_exports__);
  59825. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  59826. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  59827. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imagestyle_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./imagestyle.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css");
  59828. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  59829. options.insert = "head";
  59830. options.singleton = true;
  59831. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imagestyle_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  59832. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imagestyle_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  59833. /***/ }),
  59834. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css":
  59835. /*!**************************************************************************!*\
  59836. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css ***!
  59837. \**************************************************************************/
  59838. /*! exports provided: default */
  59839. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59840. "use strict";
  59841. __webpack_require__.r(__webpack_exports__);
  59842. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  59843. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  59844. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imageuploadicon_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./imageuploadicon.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css");
  59845. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  59846. options.insert = "head";
  59847. options.singleton = true;
  59848. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imageuploadicon_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  59849. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imageuploadicon_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  59850. /***/ }),
  59851. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css":
  59852. /*!****************************************************************************!*\
  59853. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css ***!
  59854. \****************************************************************************/
  59855. /*! exports provided: default */
  59856. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59857. "use strict";
  59858. __webpack_require__.r(__webpack_exports__);
  59859. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  59860. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  59861. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imageuploadloader_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./imageuploadloader.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css");
  59862. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  59863. options.insert = "head";
  59864. options.singleton = true;
  59865. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imageuploadloader_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  59866. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imageuploadloader_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  59867. /***/ }),
  59868. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css":
  59869. /*!******************************************************************************!*\
  59870. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css ***!
  59871. \******************************************************************************/
  59872. /*! exports provided: default */
  59873. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59874. "use strict";
  59875. __webpack_require__.r(__webpack_exports__);
  59876. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  59877. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  59878. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imageuploadprogress_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./imageuploadprogress.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css");
  59879. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  59880. options.insert = "head";
  59881. options.singleton = true;
  59882. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imageuploadprogress_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  59883. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_imageuploadprogress_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  59884. /***/ }),
  59885. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css":
  59886. /*!******************************************************************************!*\
  59887. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css ***!
  59888. \******************************************************************************/
  59889. /*! exports provided: default */
  59890. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59891. "use strict";
  59892. __webpack_require__.r(__webpack_exports__);
  59893. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  59894. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  59895. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_textalternativeform_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./textalternativeform.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css");
  59896. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  59897. options.insert = "head";
  59898. options.singleton = true;
  59899. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_textalternativeform_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  59900. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_textalternativeform_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  59901. /***/ }),
  59902. /***/ "./node_modules/@ckeditor/ckeditor5-indent/src/indent.js":
  59903. /*!***************************************************************!*\
  59904. !*** ./node_modules/@ckeditor/ckeditor5-indent/src/indent.js ***!
  59905. \***************************************************************/
  59906. /*! exports provided: default */
  59907. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59908. "use strict";
  59909. __webpack_require__.r(__webpack_exports__);
  59910. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Indent; });
  59911. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  59912. /* harmony import */ var _indentediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./indentediting */ "./node_modules/@ckeditor/ckeditor5-indent/src/indentediting.js");
  59913. /* harmony import */ var _indentui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./indentui */ "./node_modules/@ckeditor/ckeditor5-indent/src/indentui.js");
  59914. /**
  59915. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  59916. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59917. */
  59918. /**
  59919. * @module indent/indent
  59920. */
  59921. /**
  59922. * The indent feature.
  59923. *
  59924. * This plugin acts as a single entry point plugin for other features that implement indentation of elements like lists or paragraphs.
  59925. *
  59926. * The compatible features are:
  59927. *
  59928. * * The {@link module:list/list~List} or {@link module:list/listediting~ListEditing} feature for list indentation.
  59929. * * The {@link module:indent/indentblock~IndentBlock} feature for block indentation.
  59930. *
  59931. * This is a "glue" plugin that loads the following plugins:
  59932. *
  59933. * * The {@link module:indent/indentediting~IndentEditing indent editing feature}.
  59934. * * The {@link module:indent/indentui~IndentUI indent UI feature}.
  59935. *
  59936. * The dependent plugins register the `'indent'` and `'outdent'` commands and introduce the `'indent'` and `'outdent'` buttons
  59937. * that allow to increase or decrease text indentation of supported elements.
  59938. *
  59939. * **Note**: In order for the commands and buttons to work, at least one of compatible features is required.
  59940. *
  59941. * @extends module:core/plugin~Plugin
  59942. */
  59943. class Indent extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  59944. /**
  59945. * @inheritDoc
  59946. */
  59947. static get pluginName() {
  59948. return 'Indent';
  59949. }
  59950. /**
  59951. * @inheritDoc
  59952. */
  59953. static get requires() {
  59954. return [ _indentediting__WEBPACK_IMPORTED_MODULE_1__["default"], _indentui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  59955. }
  59956. }
  59957. /***/ }),
  59958. /***/ "./node_modules/@ckeditor/ckeditor5-indent/src/indentediting.js":
  59959. /*!**********************************************************************!*\
  59960. !*** ./node_modules/@ckeditor/ckeditor5-indent/src/indentediting.js ***!
  59961. \**********************************************************************/
  59962. /*! exports provided: default */
  59963. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59964. "use strict";
  59965. __webpack_require__.r(__webpack_exports__);
  59966. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return IndentEditing; });
  59967. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  59968. /**
  59969. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  59970. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59971. */
  59972. /**
  59973. * @module indent/indentediting
  59974. */
  59975. /**
  59976. * The indent editing feature.
  59977. *
  59978. * This plugin registers the `'indent'` and `'outdent'` commands.
  59979. *
  59980. * **Note**: In order for the commands to work, at least one of the compatible features is required. Read more in the
  59981. * {@link module:indent/indent~Indent indent feature} API documentation.
  59982. *
  59983. * @extends module:core/plugin~Plugin
  59984. */
  59985. class IndentEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  59986. /**
  59987. * @inheritDoc
  59988. */
  59989. static get pluginName() {
  59990. return 'IndentEditing';
  59991. }
  59992. /**
  59993. * @inheritDoc
  59994. */
  59995. init() {
  59996. const editor = this.editor;
  59997. editor.commands.add( 'indent', new ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["MultiCommand"]( editor ) );
  59998. editor.commands.add( 'outdent', new ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["MultiCommand"]( editor ) );
  59999. }
  60000. }
  60001. /***/ }),
  60002. /***/ "./node_modules/@ckeditor/ckeditor5-indent/src/indentui.js":
  60003. /*!*****************************************************************!*\
  60004. !*** ./node_modules/@ckeditor/ckeditor5-indent/src/indentui.js ***!
  60005. \*****************************************************************/
  60006. /*! exports provided: default */
  60007. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60008. "use strict";
  60009. __webpack_require__.r(__webpack_exports__);
  60010. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return IndentUI; });
  60011. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  60012. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  60013. /* harmony import */ var _theme_icons_indent_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/indent.svg */ "./node_modules/@ckeditor/ckeditor5-indent/theme/icons/indent.svg");
  60014. /* harmony import */ var _theme_icons_outdent_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/icons/outdent.svg */ "./node_modules/@ckeditor/ckeditor5-indent/theme/icons/outdent.svg");
  60015. /**
  60016. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  60017. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60018. */
  60019. /**
  60020. * @module indent/indentui
  60021. */
  60022. /**
  60023. * The indent UI feature.
  60024. *
  60025. * This plugin registers the `'indent'` and `'outdent'` buttons.
  60026. *
  60027. * **Note**: In order for the commands to work, at least one of the compatible features is required. Read more in
  60028. * the {@link module:indent/indent~Indent indent feature} API documentation.
  60029. *
  60030. * @extends module:core/plugin~Plugin
  60031. */
  60032. class IndentUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["Plugin"] {
  60033. /**
  60034. * @inheritDoc
  60035. */
  60036. static get pluginName() {
  60037. return 'IndentUI';
  60038. }
  60039. /**
  60040. * @inheritDoc
  60041. */
  60042. init() {
  60043. const editor = this.editor;
  60044. const locale = editor.locale;
  60045. const t = editor.t;
  60046. const localizedIndentIcon = locale.uiLanguageDirection == 'ltr' ? _theme_icons_indent_svg__WEBPACK_IMPORTED_MODULE_2__["default"] : _theme_icons_outdent_svg__WEBPACK_IMPORTED_MODULE_3__["default"];
  60047. const localizedOutdentIcon = locale.uiLanguageDirection == 'ltr' ? _theme_icons_outdent_svg__WEBPACK_IMPORTED_MODULE_3__["default"] : _theme_icons_indent_svg__WEBPACK_IMPORTED_MODULE_2__["default"];
  60048. this._defineButton( 'indent', t( 'Increase indent' ), localizedIndentIcon );
  60049. this._defineButton( 'outdent', t( 'Decrease indent' ), localizedOutdentIcon );
  60050. }
  60051. /**
  60052. * Defines a UI button.
  60053. *
  60054. * @param {String} commandName
  60055. * @param {String} label
  60056. * @param {String} icon
  60057. * @private
  60058. */
  60059. _defineButton( commandName, label, icon ) {
  60060. const editor = this.editor;
  60061. editor.ui.componentFactory.add( commandName, locale => {
  60062. const command = editor.commands.get( commandName );
  60063. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( locale );
  60064. view.set( {
  60065. label,
  60066. icon,
  60067. tooltip: true
  60068. } );
  60069. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  60070. this.listenTo( view, 'execute', () => {
  60071. editor.execute( commandName );
  60072. editor.editing.view.focus();
  60073. } );
  60074. return view;
  60075. } );
  60076. }
  60077. }
  60078. /***/ }),
  60079. /***/ "./node_modules/@ckeditor/ckeditor5-indent/theme/icons/indent.svg":
  60080. /*!************************************************************************!*\
  60081. !*** ./node_modules/@ckeditor/ckeditor5-indent/theme/icons/indent.svg ***!
  60082. \************************************************************************/
  60083. /*! exports provided: default */
  60084. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60085. "use strict";
  60086. __webpack_require__.r(__webpack_exports__);
  60087. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zM1.632 6.95 5.02 9.358a.4.4 0 0 1-.013.661l-3.39 2.207A.4.4 0 0 1 1 11.892V7.275a.4.4 0 0 1 .632-.326z\"/></svg>");
  60088. /***/ }),
  60089. /***/ "./node_modules/@ckeditor/ckeditor5-indent/theme/icons/outdent.svg":
  60090. /*!*************************************************************************!*\
  60091. !*** ./node_modules/@ckeditor/ckeditor5-indent/theme/icons/outdent.svg ***!
  60092. \*************************************************************************/
  60093. /*! exports provided: default */
  60094. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60095. "use strict";
  60096. __webpack_require__.r(__webpack_exports__);
  60097. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zm1.618-9.55L.98 9.358a.4.4 0 0 0 .013.661l3.39 2.207A.4.4 0 0 0 5 11.892V7.275a.4.4 0 0 0-.632-.326z\"/></svg>");
  60098. /***/ }),
  60099. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/autolink.js":
  60100. /*!***************************************************************!*\
  60101. !*** ./node_modules/@ckeditor/ckeditor5-link/src/autolink.js ***!
  60102. \***************************************************************/
  60103. /*! exports provided: default */
  60104. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60105. "use strict";
  60106. __webpack_require__.r(__webpack_exports__);
  60107. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AutoLink; });
  60108. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  60109. /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
  60110. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  60111. /**
  60112. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  60113. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60114. */
  60115. /**
  60116. * @module link/autolink
  60117. */
  60118. const MIN_LINK_LENGTH_WITH_SPACE_AT_END = 4; // Ie: "t.co " (length 5).
  60119. // This was a tweak from https://gist.github.com/dperini/729294.
  60120. const URL_REG_EXP = new RegExp(
  60121. // Group 1: Line start or after a space.
  60122. '(^|\\s)' +
  60123. // Group 2: Detected URL (or e-mail).
  60124. '(' +
  60125. // Protocol identifier or short syntax "//"
  60126. // a. Full form http://user@foo.bar.baz:8080/foo/bar.html#baz?foo=bar
  60127. '(' +
  60128. '(?:(?:(?:https?|ftp):)?\\/\\/)' +
  60129. // BasicAuth using user:pass (optional)
  60130. '(?:\\S+(?::\\S*)?@)?' +
  60131. '(?:' +
  60132. // IP address dotted notation octets
  60133. // excludes loopback network 0.0.0.0
  60134. // excludes reserved space >= 224.0.0.0
  60135. // excludes network & broadcast addresses
  60136. // (first & last IP address of each class)
  60137. '(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])' +
  60138. '(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}' +
  60139. '(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))' +
  60140. '|' +
  60141. '(' +
  60142. // Do not allow `www.foo` - see https://github.com/ckeditor/ckeditor5/issues/8050.
  60143. '((?!www\\.)|(www\\.))' +
  60144. // Host & domain names.
  60145. '(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+' +
  60146. // TLD identifier name.
  60147. '(?:[a-z\\u00a1-\\uffff]{2,63})' +
  60148. ')' +
  60149. ')' +
  60150. // port number (optional)
  60151. '(?::\\d{2,5})?' +
  60152. // resource path (optional)
  60153. '(?:[/?#]\\S*)?' +
  60154. ')' +
  60155. '|' +
  60156. // b. Short form (either www.example.com or example@example.com)
  60157. '(' +
  60158. '(www.|(\\S+@))' +
  60159. // Host & domain names.
  60160. '((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+' +
  60161. // TLD identifier name.
  60162. '(?:[a-z\\u00a1-\\uffff]{2,63})' +
  60163. ')' +
  60164. ')$', 'i' );
  60165. const URL_GROUP_IN_MATCH = 2;
  60166. /**
  60167. * The autolink plugin.
  60168. *
  60169. * @extends module:core/plugin~Plugin
  60170. */
  60171. class AutoLink extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  60172. /**
  60173. * @inheritDoc
  60174. */
  60175. static get requires() {
  60176. return [ ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__["Delete"] ];
  60177. }
  60178. /**
  60179. * @inheritDoc
  60180. */
  60181. static get pluginName() {
  60182. return 'AutoLink';
  60183. }
  60184. /**
  60185. * @inheritDoc
  60186. */
  60187. init() {
  60188. const editor = this.editor;
  60189. const selection = editor.model.document.selection;
  60190. selection.on( 'change:range', () => {
  60191. // Disable plugin when selection is inside a code block.
  60192. this.isEnabled = !selection.anchor.parent.is( 'element', 'codeBlock' );
  60193. } );
  60194. this._enableTypingHandling();
  60195. }
  60196. /**
  60197. * @inheritDoc
  60198. */
  60199. afterInit() {
  60200. this._enableEnterHandling();
  60201. this._enableShiftEnterHandling();
  60202. }
  60203. /**
  60204. * Enables autolinking on typing.
  60205. *
  60206. * @private
  60207. */
  60208. _enableTypingHandling() {
  60209. const editor = this.editor;
  60210. const watcher = new ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__["TextWatcher"]( editor.model, text => {
  60211. // 1. Detect <kbd>Space</kbd> after a text with a potential link.
  60212. if ( !isSingleSpaceAtTheEnd( text ) ) {
  60213. return;
  60214. }
  60215. // 2. Check text before last typed <kbd>Space</kbd>.
  60216. const url = getUrlAtTextEnd( text.substr( 0, text.length - 1 ) );
  60217. if ( url ) {
  60218. return { url };
  60219. }
  60220. } );
  60221. const input = editor.plugins.get( 'Input' );
  60222. watcher.on( 'matched:data', ( evt, data ) => {
  60223. const { batch, range, url } = data;
  60224. if ( !input.isInput( batch ) ) {
  60225. return;
  60226. }
  60227. const linkEnd = range.end.getShiftedBy( -1 ); // Executed after a space character.
  60228. const linkStart = linkEnd.getShiftedBy( -url.length );
  60229. const linkRange = editor.model.createRange( linkStart, linkEnd );
  60230. this._applyAutoLink( url, linkRange );
  60231. } );
  60232. watcher.bind( 'isEnabled' ).to( this );
  60233. }
  60234. /**
  60235. * Enables autolinking on the <kbd>Enter</kbd> key.
  60236. *
  60237. * @private
  60238. */
  60239. _enableEnterHandling() {
  60240. const editor = this.editor;
  60241. const model = editor.model;
  60242. const enterCommand = editor.commands.get( 'enter' );
  60243. if ( !enterCommand ) {
  60244. return;
  60245. }
  60246. enterCommand.on( 'execute', () => {
  60247. const position = model.document.selection.getFirstPosition();
  60248. if ( !position.parent.previousSibling ) {
  60249. return;
  60250. }
  60251. const rangeToCheck = model.createRangeIn( position.parent.previousSibling );
  60252. this._checkAndApplyAutoLinkOnRange( rangeToCheck );
  60253. } );
  60254. }
  60255. /**
  60256. * Enables autolinking on the <kbd>Shift</kbd>+<kbd>Enter</kbd> keyboard shortcut.
  60257. *
  60258. * @private
  60259. */
  60260. _enableShiftEnterHandling() {
  60261. const editor = this.editor;
  60262. const model = editor.model;
  60263. const shiftEnterCommand = editor.commands.get( 'shiftEnter' );
  60264. if ( !shiftEnterCommand ) {
  60265. return;
  60266. }
  60267. shiftEnterCommand.on( 'execute', () => {
  60268. const position = model.document.selection.getFirstPosition();
  60269. const rangeToCheck = model.createRange(
  60270. model.createPositionAt( position.parent, 0 ),
  60271. position.getShiftedBy( -1 )
  60272. );
  60273. this._checkAndApplyAutoLinkOnRange( rangeToCheck );
  60274. } );
  60275. }
  60276. /**
  60277. * Checks if the passed range contains a linkable text.
  60278. *
  60279. * @param {module:engine/model/range~Range} rangeToCheck
  60280. * @private
  60281. */
  60282. _checkAndApplyAutoLinkOnRange( rangeToCheck ) {
  60283. const model = this.editor.model;
  60284. const { text, range } = Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__["getLastTextLine"])( rangeToCheck, model );
  60285. const url = getUrlAtTextEnd( text );
  60286. if ( url ) {
  60287. const linkRange = model.createRange(
  60288. range.end.getShiftedBy( -url.length ),
  60289. range.end
  60290. );
  60291. this._applyAutoLink( url, linkRange );
  60292. }
  60293. }
  60294. /**
  60295. * Applies a link on a given range.
  60296. *
  60297. * @param {String} url The URL to link.
  60298. * @param {module:engine/model/range~Range} range The text range to apply the link attribute to.
  60299. * @private
  60300. */
  60301. _applyAutoLink( link, range ) {
  60302. const model = this.editor.model;
  60303. const deletePlugin = this.editor.plugins.get( 'Delete' );
  60304. if ( !this.isEnabled || !isLinkAllowedOnRange( range, model ) ) {
  60305. return;
  60306. }
  60307. // Enqueue change to make undo step.
  60308. model.enqueueChange( writer => {
  60309. const defaultProtocol = this.editor.config.get( 'link.defaultProtocol' );
  60310. const parsedUrl = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["addLinkProtocolIfApplicable"])( link, defaultProtocol );
  60311. writer.setAttribute( 'linkHref', parsedUrl, range );
  60312. model.enqueueChange( () => {
  60313. deletePlugin.requestUndoOnBackspace();
  60314. } );
  60315. } );
  60316. }
  60317. }
  60318. // Check if text should be evaluated by the plugin in order to reduce number of RegExp checks on whole text.
  60319. function isSingleSpaceAtTheEnd( text ) {
  60320. return text.length > MIN_LINK_LENGTH_WITH_SPACE_AT_END && text[ text.length - 1 ] === ' ' && text[ text.length - 2 ] !== ' ';
  60321. }
  60322. function getUrlAtTextEnd( text ) {
  60323. const match = URL_REG_EXP.exec( text );
  60324. return match ? match[ URL_GROUP_IN_MATCH ] : null;
  60325. }
  60326. function isLinkAllowedOnRange( range, model ) {
  60327. return model.schema.checkAttributeInSelection( model.createSelection( range ), 'linkHref' );
  60328. }
  60329. /***/ }),
  60330. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/link.js":
  60331. /*!***********************************************************!*\
  60332. !*** ./node_modules/@ckeditor/ckeditor5-link/src/link.js ***!
  60333. \***********************************************************/
  60334. /*! exports provided: default */
  60335. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60336. "use strict";
  60337. __webpack_require__.r(__webpack_exports__);
  60338. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Link; });
  60339. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  60340. /* harmony import */ var _linkediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./linkediting */ "./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js");
  60341. /* harmony import */ var _linkui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linkui */ "./node_modules/@ckeditor/ckeditor5-link/src/linkui.js");
  60342. /* harmony import */ var _autolink__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./autolink */ "./node_modules/@ckeditor/ckeditor5-link/src/autolink.js");
  60343. /**
  60344. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  60345. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60346. */
  60347. /**
  60348. * @module link/link
  60349. */
  60350. /**
  60351. * The link plugin.
  60352. *
  60353. * This is a "glue" plugin that loads the {@link module:link/linkediting~LinkEditing link editing feature}
  60354. * and {@link module:link/linkui~LinkUI link UI feature}.
  60355. *
  60356. * @extends module:core/plugin~Plugin
  60357. */
  60358. class Link extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  60359. /**
  60360. * @inheritDoc
  60361. */
  60362. static get requires() {
  60363. return [ _linkediting__WEBPACK_IMPORTED_MODULE_1__["default"], _linkui__WEBPACK_IMPORTED_MODULE_2__["default"], _autolink__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  60364. }
  60365. /**
  60366. * @inheritDoc
  60367. */
  60368. static get pluginName() {
  60369. return 'Link';
  60370. }
  60371. }
  60372. /**
  60373. * The configuration of the {@link module:link/link~Link} feature.
  60374. *
  60375. * Read more in {@link module:link/link~LinkConfig}.
  60376. *
  60377. * @member {module:link/link~LinkConfig} module:core/editor/editorconfig~EditorConfig#link
  60378. */
  60379. /**
  60380. * The configuration of the {@link module:link/link~Link link feature}.
  60381. *
  60382. * ClassicEditor
  60383. * .create( editorElement, {
  60384. * link: ... // Link feature configuration.
  60385. * } )
  60386. * .then( ... )
  60387. * .catch( ... );
  60388. *
  60389. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  60390. * @interface LinkConfig
  60391. */
  60392. /**
  60393. * When set, the editor will add the given protocol to the link when the user creates a link without one.
  60394. * For example, when the user is creating a link and types `ckeditor.com` in the link form input, during link submission
  60395. * the editor will automatically add the `http://` protocol, so the link will look as follows: `http://ckeditor.com`.
  60396. *
  60397. * The feature also provides email address auto-detection. When you submit `hello@example.com`,
  60398. * the plugin will automatically change it to `mailto:hello@example.com`.
  60399. *
  60400. * ClassicEditor
  60401. * .create( editorElement, {
  60402. * link: {
  60403. * defaultProtocol: 'http://'
  60404. * }
  60405. * } )
  60406. * .then( ... )
  60407. * .catch( ... );
  60408. *
  60409. * **NOTE:** If no configuration is provided, the editor will not auto-fix the links.
  60410. *
  60411. * @member {String} module:link/link~LinkConfig#defaultProtocol
  60412. */
  60413. /**
  60414. * When set to `true`, the `target="blank"` and `rel="noopener noreferrer"` attributes are automatically added to all external links
  60415. * in the editor. "External links" are all links in the editor content starting with `http`, `https`, or `//`.
  60416. *
  60417. * ClassicEditor
  60418. * .create( editorElement, {
  60419. * link: {
  60420. * addTargetToExternalLinks: true
  60421. * }
  60422. * } )
  60423. * .then( ... )
  60424. * .catch( ... );
  60425. *
  60426. * Internally, this option activates a predefined {@link module:link/link~LinkConfig#decorators automatic link decorator}
  60427. * that extends all external links with the `target` and `rel` attributes.
  60428. *
  60429. * **Note**: To control the `target` and `rel` attributes of specific links in the edited content, a dedicated
  60430. * {@link module:link/link~LinkDecoratorManualDefinition manual} decorator must be defined in the
  60431. * {@link module:link/link~LinkConfig#decorators `config.link.decorators`} array. In such scenario,
  60432. * the `config.link.addTargetToExternalLinks` option should remain `undefined` or `false` to not interfere with the manual decorator.
  60433. *
  60434. * It is possible to add other {@link module:link/link~LinkDecoratorAutomaticDefinition automatic}
  60435. * or {@link module:link/link~LinkDecoratorManualDefinition manual} link decorators when this option is active.
  60436. *
  60437. * More information about decorators can be found in the {@link module:link/link~LinkConfig#decorators decorators configuration}
  60438. * reference.
  60439. *
  60440. * @default false
  60441. * @member {Boolean} module:link/link~LinkConfig#addTargetToExternalLinks
  60442. */
  60443. /**
  60444. * Decorators provide an easy way to configure and manage additional link attributes in the editor content. There are
  60445. * two types of link decorators:
  60446. *
  60447. * * {@link module:link/link~LinkDecoratorAutomaticDefinition Automatic} &ndash; They match links against pre–defined rules and
  60448. * manage their attributes based on the results.
  60449. * * {@link module:link/link~LinkDecoratorManualDefinition Manual} &ndash; They allow users to control link attributes individually,
  60450. * using the editor UI.
  60451. *
  60452. * Link decorators are defined as objects with key-value pairs, where the key is the name provided for a given decorator and the
  60453. * value is the decorator definition.
  60454. *
  60455. * The name of the decorator also corresponds to the {@glink framework/guides/architecture/editing-engine#text-attributes text attribute}
  60456. * in the model. For instance, the `isExternal` decorator below is represented as a `linkIsExternal` attribute in the model.
  60457. *
  60458. * ClassicEditor
  60459. * .create( editorElement, {
  60460. * link: {
  60461. * decorators: {
  60462. * isExternal: {
  60463. * mode: 'automatic',
  60464. * callback: url => url.startsWith( 'http://' ),
  60465. * attributes: {
  60466. * target: '_blank',
  60467. * rel: 'noopener noreferrer'
  60468. * }
  60469. * },
  60470. * isDownloadable: {
  60471. * mode: 'manual',
  60472. * label: 'Downloadable',
  60473. * attributes: {
  60474. * download: 'file.png',
  60475. * }
  60476. * },
  60477. * // ...
  60478. * }
  60479. * }
  60480. * } )
  60481. * .then( ... )
  60482. * .catch( ... );
  60483. *
  60484. * To learn more about the configuration syntax, check out the {@link module:link/link~LinkDecoratorAutomaticDefinition automatic}
  60485. * and {@link module:link/link~LinkDecoratorManualDefinition manual} decorator option reference.
  60486. *
  60487. * **Warning:** Currently, link decorators work independently of one another and no conflict resolution mechanism exists.
  60488. * For example, configuring the `target` attribute using both an automatic and a manual decorator at the same time could end up with
  60489. * quirky results. The same applies if multiple manual or automatic decorators were defined for the same attribute.
  60490. *
  60491. * **Note**: Since the `target` attribute management for external links is a common use case, there is a predefined automatic decorator
  60492. * dedicated for that purpose which can be enabled by turning a single option on. Check out the
  60493. * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}
  60494. * configuration description to learn more.
  60495. *
  60496. * See also the {@glink features/link#custom-link-attributes-decorators link feature guide} for more information.
  60497. *
  60498. * @member {Object.<String, module:link/link~LinkDecoratorDefinition>} module:link/link~LinkConfig#decorators
  60499. */
  60500. /**
  60501. * A link decorator definition. Two types implement this defition:
  60502. *
  60503. * * {@link module:link/link~LinkDecoratorManualDefinition}
  60504. * * {@link module:link/link~LinkDecoratorAutomaticDefinition}
  60505. *
  60506. * Refer to their document for more information about available options or to the
  60507. * {@glink features/link#custom-link-attributes-decorators link feature guide} for general information.
  60508. *
  60509. * @interface LinkDecoratorDefinition
  60510. */
  60511. /**
  60512. * Link decorator type.
  60513. *
  60514. * Check out the {@glink features/link#custom-link-attributes-decorators link feature guide} for more information.
  60515. *
  60516. * @member {'manual'|'automatic'} module:link/link~LinkDecoratorDefinition#mode
  60517. */
  60518. /**
  60519. * Describes an automatic {@link module:link/link~LinkConfig#decorators link decorator}. This decorator type matches
  60520. * all links in the editor content against a function that decides whether the link should receive a pre–defined set of attributes.
  60521. *
  60522. * It takes an object with key-value pairs of attributes and a callback function that must return a Boolean value based on the link's
  60523. * `href` (URL). When the callback returns `true`, attributes are applied to the link.
  60524. *
  60525. * For example, to add the `target="_blank"` attribute to all links in the editor starting with `http://`, the
  60526. * configuration could look like this:
  60527. *
  60528. * {
  60529. * mode: 'automatic',
  60530. * callback: url => url.startsWith( 'http://' ),
  60531. * attributes: {
  60532. * target: '_blank'
  60533. * }
  60534. * }
  60535. *
  60536. * **Note**: Since the `target` attribute management for external links is a common use case, there is a predefined automatic decorator
  60537. * dedicated for that purpose that can be enabled by turning a single option on. Check out the
  60538. * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}
  60539. * configuration description to learn more.
  60540. *
  60541. * @typedef {Object} module:link/link~LinkDecoratorAutomaticDefinition
  60542. * @property {'automatic'} mode Link decorator type. It is `'automatic'` for all automatic decorators.
  60543. * @property {Function} callback Takes a `url` as a parameter and returns `true` if the `attributes` should be applied to the link.
  60544. * @property {Object} [attributes] Key-value pairs used as link attributes added to the output during the
  60545. * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.
  60546. * Attributes should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.
  60547. * @property {Object} [styles] Key-value pairs used as link styles added to the output during the
  60548. * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.
  60549. * Styles should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.
  60550. * @property {String|Array.<String>} [classes] Class names used as link classes added to the output during the
  60551. * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.
  60552. * Classes should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.
  60553. */
  60554. /**
  60555. * Describes a manual {@link module:link/link~LinkConfig#decorators link decorator}. This decorator type is represented in
  60556. * the link feature's {@link module:link/linkui user interface} as a switch that the user can use to control the presence
  60557. * of a predefined set of attributes.
  60558. *
  60559. * For instance, to allow the users to manually control the presence of the `target="_blank"` and
  60560. * `rel="noopener noreferrer"` attributes on specific links, the decorator could look as follows:
  60561. *
  60562. * {
  60563. * mode: 'manual',
  60564. * label: 'Open in a new tab',
  60565. * defaultValue: true,
  60566. * attributes: {
  60567. * target: '_blank',
  60568. * rel: 'noopener noreferrer'
  60569. * }
  60570. * }
  60571. *
  60572. * @typedef {Object} module:link/link~LinkDecoratorManualDefinition
  60573. * @property {'manual'} mode Link decorator type. It is `'manual'` for all manual decorators.
  60574. * @property {String} label The label of the UI button that the user can use to control the presence of link attributes.
  60575. * @property {Object} [attributes] Key-value pairs used as link attributes added to the output during the
  60576. * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.
  60577. * Attributes should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.
  60578. * @property {Object} [styles] Key-value pairs used as link styles added to the output during the
  60579. * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.
  60580. * Styles should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.
  60581. * @property {String|Array.<String>} [classes] Class names used as link classes added to the output during the
  60582. * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.
  60583. * Classes should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.
  60584. * @property {Boolean} [defaultValue] Controls whether the decorator is "on" by default.
  60585. */
  60586. /***/ }),
  60587. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkcommand.js":
  60588. /*!******************************************************************!*\
  60589. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkcommand.js ***!
  60590. \******************************************************************/
  60591. /*! exports provided: default */
  60592. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60593. "use strict";
  60594. __webpack_require__.r(__webpack_exports__);
  60595. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkCommand; });
  60596. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  60597. /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
  60598. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  60599. /* harmony import */ var _utils_automaticdecorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/automaticdecorators */ "./node_modules/@ckeditor/ckeditor5-link/src/utils/automaticdecorators.js");
  60600. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  60601. /**
  60602. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  60603. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60604. */
  60605. /**
  60606. * @module link/linkcommand
  60607. */
  60608. /**
  60609. * The link command. It is used by the {@link module:link/link~Link link feature}.
  60610. *
  60611. * @extends module:core/command~Command
  60612. */
  60613. class LinkCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  60614. /**
  60615. * The value of the `'linkHref'` attribute if the start of the selection is located in a node with this attribute.
  60616. *
  60617. * @observable
  60618. * @readonly
  60619. * @member {Object|undefined} #value
  60620. */
  60621. constructor( editor ) {
  60622. super( editor );
  60623. /**
  60624. * A collection of {@link module:link/utils~ManualDecorator manual decorators}
  60625. * corresponding to the {@link module:link/link~LinkConfig#decorators decorator configuration}.
  60626. *
  60627. * You can consider it a model with states of manual decorators added to the currently selected link.
  60628. *
  60629. * @readonly
  60630. * @type {module:utils/collection~Collection}
  60631. */
  60632. this.manualDecorators = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["Collection"]();
  60633. /**
  60634. * An instance of the helper that ties together all {@link module:link/link~LinkDecoratorAutomaticDefinition}
  60635. * that are used by the {@glink features/link link} and the {@glink features/images/images-linking linking images} features.
  60636. *
  60637. * @readonly
  60638. * @type {module:link/utils~AutomaticDecorators}
  60639. */
  60640. this.automaticDecorators = new _utils_automaticdecorators__WEBPACK_IMPORTED_MODULE_3__["default"]();
  60641. }
  60642. /**
  60643. * Synchronizes the state of {@link #manualDecorators} with the currently present elements in the model.
  60644. */
  60645. restoreManualDecoratorStates() {
  60646. for ( const manualDecorator of this.manualDecorators ) {
  60647. manualDecorator.value = this._getDecoratorStateFromModel( manualDecorator.id );
  60648. }
  60649. }
  60650. /**
  60651. * @inheritDoc
  60652. */
  60653. refresh() {
  60654. const model = this.editor.model;
  60655. const selection = model.document.selection;
  60656. const selectedElement = selection.getSelectedElement() || Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["first"])( selection.getSelectedBlocks() );
  60657. // A check for any integration that allows linking elements (e.g. `LinkImage`).
  60658. // Currently the selection reads attributes from text nodes only. See #7429 and #7465.
  60659. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isLinkableElement"])( selectedElement, model.schema ) ) {
  60660. this.value = selectedElement.getAttribute( 'linkHref' );
  60661. this.isEnabled = model.schema.checkAttribute( selectedElement, 'linkHref' );
  60662. } else {
  60663. this.value = selection.getAttribute( 'linkHref' );
  60664. this.isEnabled = model.schema.checkAttributeInSelection( selection, 'linkHref' );
  60665. }
  60666. for ( const manualDecorator of this.manualDecorators ) {
  60667. manualDecorator.value = this._getDecoratorStateFromModel( manualDecorator.id );
  60668. }
  60669. }
  60670. /**
  60671. * Executes the command.
  60672. *
  60673. * When the selection is non-collapsed, the `linkHref` attribute will be applied to nodes inside the selection, but only to
  60674. * those nodes where the `linkHref` attribute is allowed (disallowed nodes will be omitted).
  60675. *
  60676. * When the selection is collapsed and is not inside the text with the `linkHref` attribute, a
  60677. * new {@link module:engine/model/text~Text text node} with the `linkHref` attribute will be inserted in place of the caret, but
  60678. * only if such element is allowed in this place. The `_data` of the inserted text will equal the `href` parameter.
  60679. * The selection will be updated to wrap the just inserted text node.
  60680. *
  60681. * When the selection is collapsed and inside the text with the `linkHref` attribute, the attribute value will be updated.
  60682. *
  60683. * # Decorators and model attribute management
  60684. *
  60685. * There is an optional argument to this command that applies or removes model
  60686. * {@glink framework/guides/architecture/editing-engine#text-attributes text attributes} brought by
  60687. * {@link module:link/utils~ManualDecorator manual link decorators}.
  60688. *
  60689. * Text attribute names in the model correspond to the entries in the {@link module:link/link~LinkConfig#decorators configuration}.
  60690. * For every decorator configured, a model text attribute exists with the "link" prefix. For example, a `'linkMyDecorator'` attribute
  60691. * corresponds to `'myDecorator'` in the configuration.
  60692. *
  60693. * To learn more about link decorators, check out the {@link module:link/link~LinkConfig#decorators `config.link.decorators`}
  60694. * documentation.
  60695. *
  60696. * Here is how to manage decorator attributes with the link command:
  60697. *
  60698. * const linkCommand = editor.commands.get( 'link' );
  60699. *
  60700. * // Adding a new decorator attribute.
  60701. * linkCommand.execute( 'http://example.com', {
  60702. * linkIsExternal: true
  60703. * } );
  60704. *
  60705. * // Removing a decorator attribute from the selection.
  60706. * linkCommand.execute( 'http://example.com', {
  60707. * linkIsExternal: false
  60708. * } );
  60709. *
  60710. * // Adding multiple decorator attributes at the same time.
  60711. * linkCommand.execute( 'http://example.com', {
  60712. * linkIsExternal: true,
  60713. * linkIsDownloadable: true,
  60714. * } );
  60715. *
  60716. * // Removing and adding decorator attributes at the same time.
  60717. * linkCommand.execute( 'http://example.com', {
  60718. * linkIsExternal: false,
  60719. * linkFoo: true,
  60720. * linkIsDownloadable: false,
  60721. * } );
  60722. *
  60723. * **Note**: If the decorator attribute name is not specified, its state remains untouched.
  60724. *
  60725. * **Note**: {@link module:link/unlinkcommand~UnlinkCommand#execute `UnlinkCommand#execute()`} removes all
  60726. * decorator attributes.
  60727. *
  60728. * @fires execute
  60729. * @param {String} href Link destination.
  60730. * @param {Object} [manualDecoratorIds={}] The information about manual decorator attributes to be applied or removed upon execution.
  60731. */
  60732. execute( href, manualDecoratorIds = {} ) {
  60733. const model = this.editor.model;
  60734. const selection = model.document.selection;
  60735. // Stores information about manual decorators to turn them on/off when command is applied.
  60736. const truthyManualDecorators = [];
  60737. const falsyManualDecorators = [];
  60738. for ( const name in manualDecoratorIds ) {
  60739. if ( manualDecoratorIds[ name ] ) {
  60740. truthyManualDecorators.push( name );
  60741. } else {
  60742. falsyManualDecorators.push( name );
  60743. }
  60744. }
  60745. model.change( writer => {
  60746. // If selection is collapsed then update selected link or insert new one at the place of caret.
  60747. if ( selection.isCollapsed ) {
  60748. const position = selection.getFirstPosition();
  60749. // When selection is inside text with `linkHref` attribute.
  60750. if ( selection.hasAttribute( 'linkHref' ) ) {
  60751. // Then update `linkHref` value.
  60752. const linkRange = Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__["findAttributeRange"])( position, 'linkHref', selection.getAttribute( 'linkHref' ), model );
  60753. writer.setAttribute( 'linkHref', href, linkRange );
  60754. truthyManualDecorators.forEach( item => {
  60755. writer.setAttribute( item, true, linkRange );
  60756. } );
  60757. falsyManualDecorators.forEach( item => {
  60758. writer.removeAttribute( item, linkRange );
  60759. } );
  60760. // Put the selection at the end of the updated link.
  60761. writer.setSelection( writer.createPositionAfter( linkRange.end.nodeBefore ) );
  60762. }
  60763. // If not then insert text node with `linkHref` attribute in place of caret.
  60764. // However, since selection is collapsed, attribute value will be used as data for text node.
  60765. // So, if `href` is empty, do not create text node.
  60766. else if ( href !== '' ) {
  60767. const attributes = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["toMap"])( selection.getAttributes() );
  60768. attributes.set( 'linkHref', href );
  60769. truthyManualDecorators.forEach( item => {
  60770. attributes.set( item, true );
  60771. } );
  60772. const { end: positionAfter } = model.insertContent( writer.createText( href, attributes ), position );
  60773. // Put the selection at the end of the inserted link.
  60774. // Using end of range returned from insertContent in case nodes with the same attributes got merged.
  60775. writer.setSelection( positionAfter );
  60776. }
  60777. // Remove the `linkHref` attribute and all link decorators from the selection.
  60778. // It stops adding a new content into the link element.
  60779. [ 'linkHref', ...truthyManualDecorators, ...falsyManualDecorators ].forEach( item => {
  60780. writer.removeSelectionAttribute( item );
  60781. } );
  60782. } else {
  60783. // If selection has non-collapsed ranges, we change attribute on nodes inside those ranges
  60784. // omitting nodes where the `linkHref` attribute is disallowed.
  60785. const ranges = model.schema.getValidRanges( selection.getRanges(), 'linkHref' );
  60786. // But for the first, check whether the `linkHref` attribute is allowed on selected blocks (e.g. the "image" element).
  60787. const allowedRanges = [];
  60788. for ( const element of selection.getSelectedBlocks() ) {
  60789. if ( model.schema.checkAttribute( element, 'linkHref' ) ) {
  60790. allowedRanges.push( writer.createRangeOn( element ) );
  60791. }
  60792. }
  60793. // Ranges that accept the `linkHref` attribute. Since we will iterate over `allowedRanges`, let's clone it.
  60794. const rangesToUpdate = allowedRanges.slice();
  60795. // For all selection ranges we want to check whether given range is inside an element that accepts the `linkHref` attribute.
  60796. // If so, we don't want to propagate applying the attribute to its children.
  60797. for ( const range of ranges ) {
  60798. if ( this._isRangeToUpdate( range, allowedRanges ) ) {
  60799. rangesToUpdate.push( range );
  60800. }
  60801. }
  60802. for ( const range of rangesToUpdate ) {
  60803. writer.setAttribute( 'linkHref', href, range );
  60804. truthyManualDecorators.forEach( item => {
  60805. writer.setAttribute( item, true, range );
  60806. } );
  60807. falsyManualDecorators.forEach( item => {
  60808. writer.removeAttribute( item, range );
  60809. } );
  60810. }
  60811. }
  60812. } );
  60813. }
  60814. /**
  60815. * Provides information whether a decorator with a given name is present in the currently processed selection.
  60816. *
  60817. * @private
  60818. * @param {String} decoratorName The name of the manual decorator used in the model
  60819. * @returns {Boolean} The information whether a given decorator is currently present in the selection.
  60820. */
  60821. _getDecoratorStateFromModel( decoratorName ) {
  60822. const model = this.editor.model;
  60823. const selection = model.document.selection;
  60824. const selectedElement = selection.getSelectedElement();
  60825. // A check for the `LinkImage` plugin. If the selection contains an element, get values from the element.
  60826. // Currently the selection reads attributes from text nodes only. See #7429 and #7465.
  60827. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isLinkableElement"])( selectedElement, model.schema ) ) {
  60828. return selectedElement.getAttribute( decoratorName );
  60829. }
  60830. return selection.getAttribute( decoratorName );
  60831. }
  60832. /**
  60833. * Checks whether specified `range` is inside an element that accepts the `linkHref` attribute.
  60834. *
  60835. * @private
  60836. * @param {module:engine/view/range~Range} range A range to check.
  60837. * @param {Array.<module:engine/view/range~Range>} allowedRanges An array of ranges created on elements where the attribute is accepted.
  60838. * @returns {Boolean}
  60839. */
  60840. _isRangeToUpdate( range, allowedRanges ) {
  60841. for ( const allowedRange of allowedRanges ) {
  60842. // A range is inside an element that will have the `linkHref` attribute. Do not modify its nodes.
  60843. if ( allowedRange.containsRange( range ) ) {
  60844. return false;
  60845. }
  60846. }
  60847. return true;
  60848. }
  60849. }
  60850. /***/ }),
  60851. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js":
  60852. /*!******************************************************************!*\
  60853. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js ***!
  60854. \******************************************************************/
  60855. /*! exports provided: default */
  60856. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60857. "use strict";
  60858. __webpack_require__.r(__webpack_exports__);
  60859. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkEditing; });
  60860. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  60861. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  60862. /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
  60863. /* harmony import */ var ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/clipboard */ "./node_modules/ckeditor5/src/clipboard.js");
  60864. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  60865. /* harmony import */ var _linkcommand__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./linkcommand */ "./node_modules/@ckeditor/ckeditor5-link/src/linkcommand.js");
  60866. /* harmony import */ var _unlinkcommand__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./unlinkcommand */ "./node_modules/@ckeditor/ckeditor5-link/src/unlinkcommand.js");
  60867. /* harmony import */ var _utils_manualdecorator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/manualdecorator */ "./node_modules/@ckeditor/ckeditor5-link/src/utils/manualdecorator.js");
  60868. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  60869. /* harmony import */ var _theme_link_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../theme/link.css */ "./node_modules/@ckeditor/ckeditor5-link/theme/link.css");
  60870. /**
  60871. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  60872. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60873. */
  60874. /**
  60875. * @module link/linkediting
  60876. */
  60877. const HIGHLIGHT_CLASS = 'ck-link_selected';
  60878. const DECORATOR_AUTOMATIC = 'automatic';
  60879. const DECORATOR_MANUAL = 'manual';
  60880. const EXTERNAL_LINKS_REGEXP = /^(https?:)?\/\//;
  60881. /**
  60882. * The link engine feature.
  60883. *
  60884. * It introduces the `linkHref="url"` attribute in the model which renders to the view as a `<a href="url">` element
  60885. * as well as `'link'` and `'unlink'` commands.
  60886. *
  60887. * @extends module:core/plugin~Plugin
  60888. */
  60889. class LinkEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  60890. /**
  60891. * @inheritDoc
  60892. */
  60893. static get pluginName() {
  60894. return 'LinkEditing';
  60895. }
  60896. /**
  60897. * @inheritDoc
  60898. */
  60899. static get requires() {
  60900. // Clipboard is required for handling cut and paste events while typing over the link.
  60901. return [ ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["TwoStepCaretMovement"], ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["Input"], ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_3__["ClipboardPipeline"] ];
  60902. }
  60903. /**
  60904. * @inheritDoc
  60905. */
  60906. constructor( editor ) {
  60907. super( editor );
  60908. editor.config.define( 'link', {
  60909. addTargetToExternalLinks: false
  60910. } );
  60911. }
  60912. /**
  60913. * @inheritDoc
  60914. */
  60915. init() {
  60916. const editor = this.editor;
  60917. // Allow link attribute on all inline nodes.
  60918. editor.model.schema.extend( '$text', { allowAttributes: 'linkHref' } );
  60919. editor.conversion.for( 'dataDowncast' )
  60920. .attributeToElement( { model: 'linkHref', view: _utils__WEBPACK_IMPORTED_MODULE_8__["createLinkElement"] } );
  60921. editor.conversion.for( 'editingDowncast' )
  60922. .attributeToElement( { model: 'linkHref', view: ( href, conversionApi ) => {
  60923. return Object(_utils__WEBPACK_IMPORTED_MODULE_8__["createLinkElement"])( Object(_utils__WEBPACK_IMPORTED_MODULE_8__["ensureSafeUrl"])( href ), conversionApi );
  60924. } } );
  60925. editor.conversion.for( 'upcast' )
  60926. .elementToAttribute( {
  60927. view: {
  60928. name: 'a',
  60929. attributes: {
  60930. href: true
  60931. }
  60932. },
  60933. model: {
  60934. key: 'linkHref',
  60935. value: viewElement => viewElement.getAttribute( 'href' )
  60936. }
  60937. } );
  60938. // Create linking commands.
  60939. editor.commands.add( 'link', new _linkcommand__WEBPACK_IMPORTED_MODULE_5__["default"]( editor ) );
  60940. editor.commands.add( 'unlink', new _unlinkcommand__WEBPACK_IMPORTED_MODULE_6__["default"]( editor ) );
  60941. const linkDecorators = Object(_utils__WEBPACK_IMPORTED_MODULE_8__["getLocalizedDecorators"])( editor.t, Object(_utils__WEBPACK_IMPORTED_MODULE_8__["normalizeDecorators"])( editor.config.get( 'link.decorators' ) ) );
  60942. this._enableAutomaticDecorators( linkDecorators.filter( item => item.mode === DECORATOR_AUTOMATIC ) );
  60943. this._enableManualDecorators( linkDecorators.filter( item => item.mode === DECORATOR_MANUAL ) );
  60944. // Enable two-step caret movement for `linkHref` attribute.
  60945. const twoStepCaretMovementPlugin = editor.plugins.get( ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["TwoStepCaretMovement"] );
  60946. twoStepCaretMovementPlugin.registerAttribute( 'linkHref' );
  60947. // Setup highlight over selected link.
  60948. Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["inlineHighlight"])( editor, 'linkHref', 'a', HIGHLIGHT_CLASS );
  60949. // Handle link following by CTRL+click or ALT+ENTER
  60950. this._enableLinkOpen();
  60951. // Change the attributes of the selection in certain situations after the link was inserted into the document.
  60952. this._enableInsertContentSelectionAttributesFixer();
  60953. // Handle a click at the beginning/end of a link element.
  60954. this._enableClickingAfterLink();
  60955. // Handle typing over the link.
  60956. this._enableTypingOverLink();
  60957. // Handle removing the content after the link element.
  60958. this._handleDeleteContentAfterLink();
  60959. }
  60960. /**
  60961. * Processes an array of configured {@link module:link/link~LinkDecoratorAutomaticDefinition automatic decorators}
  60962. * and registers a {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast dispatcher}
  60963. * for each one of them. Downcast dispatchers are obtained using the
  60964. * {@link module:link/utils~AutomaticDecorators#getDispatcher} method.
  60965. *
  60966. * **Note**: This method also activates the automatic external link decorator if enabled with
  60967. * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}.
  60968. *
  60969. * @private
  60970. * @param {Array.<module:link/link~LinkDecoratorAutomaticDefinition>} automaticDecoratorDefinitions
  60971. */
  60972. _enableAutomaticDecorators( automaticDecoratorDefinitions ) {
  60973. const editor = this.editor;
  60974. // Store automatic decorators in the command instance as we do the same with manual decorators.
  60975. // Thanks to that, `LinkImageEditing` plugin can re-use the same definitions.
  60976. const command = editor.commands.get( 'link' );
  60977. const automaticDecorators = command.automaticDecorators;
  60978. // Adds a default decorator for external links.
  60979. if ( editor.config.get( 'link.addTargetToExternalLinks' ) ) {
  60980. automaticDecorators.add( {
  60981. id: 'linkIsExternal',
  60982. mode: DECORATOR_AUTOMATIC,
  60983. callback: url => EXTERNAL_LINKS_REGEXP.test( url ),
  60984. attributes: {
  60985. target: '_blank',
  60986. rel: 'noopener noreferrer'
  60987. }
  60988. } );
  60989. }
  60990. automaticDecorators.add( automaticDecoratorDefinitions );
  60991. if ( automaticDecorators.length ) {
  60992. editor.conversion.for( 'downcast' ).add( automaticDecorators.getDispatcher() );
  60993. }
  60994. }
  60995. /**
  60996. * Processes an array of configured {@link module:link/link~LinkDecoratorManualDefinition manual decorators},
  60997. * transforms them into {@link module:link/utils~ManualDecorator} instances and stores them in the
  60998. * {@link module:link/linkcommand~LinkCommand#manualDecorators} collection (a model for manual decorators state).
  60999. *
  61000. * Also registers an {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement attribute-to-element}
  61001. * converter for each manual decorator and extends the {@link module:engine/model/schema~Schema model's schema}
  61002. * with adequate model attributes.
  61003. *
  61004. * @private
  61005. * @param {Array.<module:link/link~LinkDecoratorManualDefinition>} manualDecoratorDefinitions
  61006. */
  61007. _enableManualDecorators( manualDecoratorDefinitions ) {
  61008. if ( !manualDecoratorDefinitions.length ) {
  61009. return;
  61010. }
  61011. const editor = this.editor;
  61012. const command = editor.commands.get( 'link' );
  61013. const manualDecorators = command.manualDecorators;
  61014. manualDecoratorDefinitions.forEach( decorator => {
  61015. editor.model.schema.extend( '$text', { allowAttributes: decorator.id } );
  61016. // Keeps reference to manual decorator to decode its name to attributes during downcast.
  61017. decorator = new _utils_manualdecorator__WEBPACK_IMPORTED_MODULE_7__["default"]( decorator );
  61018. manualDecorators.add( decorator );
  61019. editor.conversion.for( 'downcast' ).attributeToElement( {
  61020. model: decorator.id,
  61021. view: ( manualDecoratorName, { writer } ) => {
  61022. if ( manualDecoratorName ) {
  61023. const element = writer.createAttributeElement( 'a', decorator.attributes, { priority: 5 } );
  61024. if ( decorator.classes ) {
  61025. writer.addClass( decorator.classes, element );
  61026. }
  61027. for ( const key in decorator.styles ) {
  61028. writer.setStyle( key, decorator.styles[ key ], element );
  61029. }
  61030. writer.setCustomProperty( 'link', true, element );
  61031. return element;
  61032. }
  61033. } } );
  61034. editor.conversion.for( 'upcast' ).elementToAttribute( {
  61035. view: {
  61036. name: 'a',
  61037. ...decorator._createPattern()
  61038. },
  61039. model: {
  61040. key: decorator.id
  61041. }
  61042. } );
  61043. } );
  61044. }
  61045. /**
  61046. * Attaches handlers for {@link module:engine/view/document~Document#event:enter} and
  61047. * {@link module:engine/view/document~Document#event:click} to enable link following.
  61048. *
  61049. * @private
  61050. */
  61051. _enableLinkOpen() {
  61052. const editor = this.editor;
  61053. const view = editor.editing.view;
  61054. const viewDocument = view.document;
  61055. const modelDocument = editor.model.document;
  61056. this.listenTo( viewDocument, 'click', ( evt, data ) => {
  61057. const shouldOpen = ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_4__["env"].isMac ? data.domEvent.metaKey : data.domEvent.ctrlKey;
  61058. if ( !shouldOpen ) {
  61059. return;
  61060. }
  61061. let clickedElement = data.domTarget;
  61062. if ( clickedElement.tagName.toLowerCase() != 'a' ) {
  61063. clickedElement = clickedElement.closest( 'a' );
  61064. }
  61065. if ( !clickedElement ) {
  61066. return;
  61067. }
  61068. const url = clickedElement.getAttribute( 'href' );
  61069. if ( !url ) {
  61070. return;
  61071. }
  61072. evt.stop();
  61073. data.preventDefault();
  61074. Object(_utils__WEBPACK_IMPORTED_MODULE_8__["openLink"])( url );
  61075. }, { context: '$capture' } );
  61076. this.listenTo( viewDocument, 'enter', ( evt, data ) => {
  61077. const selection = modelDocument.selection;
  61078. const selectedElement = selection.getSelectedElement();
  61079. const url = selectedElement ?
  61080. selectedElement.getAttribute( 'linkHref' ) :
  61081. selection.getAttribute( 'linkHref' );
  61082. const shouldOpen = url && data.domEvent.altKey;
  61083. if ( !shouldOpen ) {
  61084. return;
  61085. }
  61086. evt.stop();
  61087. Object(_utils__WEBPACK_IMPORTED_MODULE_8__["openLink"])( url );
  61088. }, { context: 'a' } );
  61089. }
  61090. /**
  61091. * Starts listening to {@link module:engine/model/model~Model#event:insertContent} and corrects the model
  61092. * selection attributes if the selection is at the end of a link after inserting the content.
  61093. *
  61094. * The purpose of this action is to improve the overall UX because the user is no longer "trapped" by the
  61095. * `linkHref` attribute of the selection and they can type a "clean" (`linkHref`–less) text right away.
  61096. *
  61097. * See https://github.com/ckeditor/ckeditor5/issues/6053.
  61098. *
  61099. * @private
  61100. */
  61101. _enableInsertContentSelectionAttributesFixer() {
  61102. const editor = this.editor;
  61103. const model = editor.model;
  61104. const selection = model.document.selection;
  61105. this.listenTo( model, 'insertContent', () => {
  61106. const nodeBefore = selection.anchor.nodeBefore;
  61107. const nodeAfter = selection.anchor.nodeAfter;
  61108. // NOTE: ↰ and ↱ represent the gravity of the selection.
  61109. // The only truly valid case is:
  61110. //
  61111. // ↰
  61112. // ...<$text linkHref="foo">INSERTED[]</$text>
  61113. //
  61114. // If the selection is not "trapped" by the `linkHref` attribute after inserting, there's nothing
  61115. // to fix there.
  61116. if ( !selection.hasAttribute( 'linkHref' ) ) {
  61117. return;
  61118. }
  61119. // Filter out the following case where a link with the same href (e.g. <a href="foo">INSERTED</a>) is inserted
  61120. // in the middle of an existing link:
  61121. //
  61122. // Before insertion:
  61123. // ↰
  61124. // <$text linkHref="foo">l[]ink</$text>
  61125. //
  61126. // Expected after insertion:
  61127. // ↰
  61128. // <$text linkHref="foo">lINSERTED[]ink</$text>
  61129. //
  61130. if ( !nodeBefore ) {
  61131. return;
  61132. }
  61133. // Filter out the following case where the selection has the "linkHref" attribute because the
  61134. // gravity is overridden and some text with another attribute (e.g. <b>INSERTED</b>) is inserted:
  61135. //
  61136. // Before insertion:
  61137. //
  61138. // ↱
  61139. // <$text linkHref="foo">[]link</$text>
  61140. //
  61141. // Expected after insertion:
  61142. //
  61143. // ↱
  61144. // <$text bold="true">INSERTED</$text><$text linkHref="foo">[]link</$text>
  61145. //
  61146. if ( !nodeBefore.hasAttribute( 'linkHref' ) ) {
  61147. return;
  61148. }
  61149. // Filter out the following case where a link is a inserted in the middle (or before) another link
  61150. // (different URLs, so they will not merge). In this (let's say weird) case, we can leave the selection
  61151. // attributes as they are because the user will end up writing in one link or another anyway.
  61152. //
  61153. // Before insertion:
  61154. //
  61155. // ↰
  61156. // <$text linkHref="foo">l[]ink</$text>
  61157. //
  61158. // Expected after insertion:
  61159. //
  61160. // ↰
  61161. // <$text linkHref="foo">l</$text><$text linkHref="bar">INSERTED[]</$text><$text linkHref="foo">ink</$text>
  61162. //
  61163. if ( nodeAfter && nodeAfter.hasAttribute( 'linkHref' ) ) {
  61164. return;
  61165. }
  61166. model.change( writer => {
  61167. removeLinkAttributesFromSelection( writer, getLinkAttributesAllowedOnText( model.schema ) );
  61168. } );
  61169. }, { priority: 'low' } );
  61170. }
  61171. /**
  61172. * Starts listening to {@link module:engine/view/document~Document#event:mousedown} and
  61173. * {@link module:engine/view/document~Document#event:selectionChange} and puts the selection before/after a link node
  61174. * if clicked at the beginning/ending of the link.
  61175. *
  61176. * The purpose of this action is to allow typing around the link node directly after a click.
  61177. *
  61178. * See https://github.com/ckeditor/ckeditor5/issues/1016.
  61179. *
  61180. * @private
  61181. */
  61182. _enableClickingAfterLink() {
  61183. const editor = this.editor;
  61184. const model = editor.model;
  61185. editor.editing.view.addObserver( ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__["MouseObserver"] );
  61186. let clicked = false;
  61187. // Detect the click.
  61188. this.listenTo( editor.editing.view.document, 'mousedown', () => {
  61189. clicked = true;
  61190. } );
  61191. // When the selection has changed...
  61192. this.listenTo( editor.editing.view.document, 'selectionChange', () => {
  61193. if ( !clicked ) {
  61194. return;
  61195. }
  61196. // ...and it was caused by the click...
  61197. clicked = false;
  61198. const selection = model.document.selection;
  61199. // ...and no text is selected...
  61200. if ( !selection.isCollapsed ) {
  61201. return;
  61202. }
  61203. // ...and clicked text is the link...
  61204. if ( !selection.hasAttribute( 'linkHref' ) ) {
  61205. return;
  61206. }
  61207. const position = selection.getFirstPosition();
  61208. const linkRange = Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["findAttributeRange"])( position, 'linkHref', selection.getAttribute( 'linkHref' ), model );
  61209. // ...check whether clicked start/end boundary of the link.
  61210. // If so, remove the `linkHref` attribute.
  61211. if ( position.isTouching( linkRange.start ) || position.isTouching( linkRange.end ) ) {
  61212. model.change( writer => {
  61213. removeLinkAttributesFromSelection( writer, getLinkAttributesAllowedOnText( model.schema ) );
  61214. } );
  61215. }
  61216. } );
  61217. }
  61218. /**
  61219. * Starts listening to {@link module:engine/model/model~Model#deleteContent} and {@link module:engine/model/model~Model#insertContent}
  61220. * and checks whether typing over the link. If so, attributes of removed text are preserved and applied to the inserted text.
  61221. *
  61222. * The purpose of this action is to allow modifying a text without loosing the `linkHref` attribute (and other).
  61223. *
  61224. * See https://github.com/ckeditor/ckeditor5/issues/4762.
  61225. *
  61226. * @private
  61227. */
  61228. _enableTypingOverLink() {
  61229. const editor = this.editor;
  61230. const view = editor.editing.view;
  61231. // Selection attributes when started typing over the link.
  61232. let selectionAttributes;
  61233. // Whether pressed `Backspace` or `Delete`. If so, attributes should not be preserved.
  61234. let deletedContent;
  61235. // Detect pressing `Backspace` / `Delete`.
  61236. this.listenTo( view.document, 'delete', () => {
  61237. deletedContent = true;
  61238. }, { priority: 'high' } );
  61239. // Listening to `model#deleteContent` allows detecting whether selected content was a link.
  61240. // If so, before removing the element, we will copy its attributes.
  61241. this.listenTo( editor.model, 'deleteContent', () => {
  61242. const selection = editor.model.document.selection;
  61243. // Copy attributes only if anything is selected.
  61244. if ( selection.isCollapsed ) {
  61245. return;
  61246. }
  61247. // When the content was deleted, do not preserve attributes.
  61248. if ( deletedContent ) {
  61249. deletedContent = false;
  61250. return;
  61251. }
  61252. // Enabled only when typing.
  61253. if ( !isTyping( editor ) ) {
  61254. return;
  61255. }
  61256. if ( shouldCopyAttributes( editor.model ) ) {
  61257. selectionAttributes = selection.getAttributes();
  61258. }
  61259. }, { priority: 'high' } );
  61260. // Listening to `model#insertContent` allows detecting the content insertion.
  61261. // We want to apply attributes that were removed while typing over the link.
  61262. this.listenTo( editor.model, 'insertContent', ( evt, [ element ] ) => {
  61263. deletedContent = false;
  61264. // Enabled only when typing.
  61265. if ( !isTyping( editor ) ) {
  61266. return;
  61267. }
  61268. if ( !selectionAttributes ) {
  61269. return;
  61270. }
  61271. editor.model.change( writer => {
  61272. for ( const [ attribute, value ] of selectionAttributes ) {
  61273. writer.setAttribute( attribute, value, element );
  61274. }
  61275. } );
  61276. selectionAttributes = null;
  61277. }, { priority: 'high' } );
  61278. }
  61279. /**
  61280. * Starts listening to {@link module:engine/model/model~Model#deleteContent} and checks whether
  61281. * removing a content right after the "linkHref" attribute.
  61282. *
  61283. * If so, the selection should not preserve the `linkHref` attribute. However, if
  61284. * the {@link module:typing/twostepcaretmovement~TwoStepCaretMovement} plugin is active and
  61285. * the selection has the "linkHref" attribute due to overriden gravity (at the end), the `linkHref` attribute should stay untouched.
  61286. *
  61287. * The purpose of this action is to allow removing the link text and keep the selection outside the link.
  61288. *
  61289. * See https://github.com/ckeditor/ckeditor5/issues/7521.
  61290. *
  61291. * @private
  61292. */
  61293. _handleDeleteContentAfterLink() {
  61294. const editor = this.editor;
  61295. const model = editor.model;
  61296. const selection = model.document.selection;
  61297. const view = editor.editing.view;
  61298. // A flag whether attributes `linkHref` attribute should be preserved.
  61299. let shouldPreserveAttributes = false;
  61300. // A flag whether the `Backspace` key was pressed.
  61301. let hasBackspacePressed = false;
  61302. // Detect pressing `Backspace`.
  61303. this.listenTo( view.document, 'delete', ( evt, data ) => {
  61304. hasBackspacePressed = data.domEvent.keyCode === ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].backspace;
  61305. }, { priority: 'high' } );
  61306. // Before removing the content, check whether the selection is inside a link or at the end of link but with 2-SCM enabled.
  61307. // If so, we want to preserve link attributes.
  61308. this.listenTo( model, 'deleteContent', () => {
  61309. // Reset the state.
  61310. shouldPreserveAttributes = false;
  61311. const position = selection.getFirstPosition();
  61312. const linkHref = selection.getAttribute( 'linkHref' );
  61313. if ( !linkHref ) {
  61314. return;
  61315. }
  61316. const linkRange = Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["findAttributeRange"])( position, 'linkHref', linkHref, model );
  61317. // Preserve `linkHref` attribute if the selection is in the middle of the link or
  61318. // the selection is at the end of the link and 2-SCM is activated.
  61319. shouldPreserveAttributes = linkRange.containsPosition( position ) || linkRange.end.isEqual( position );
  61320. }, { priority: 'high' } );
  61321. // After removing the content, check whether the current selection should preserve the `linkHref` attribute.
  61322. this.listenTo( model, 'deleteContent', () => {
  61323. // If didn't press `Backspace`.
  61324. if ( !hasBackspacePressed ) {
  61325. return;
  61326. }
  61327. hasBackspacePressed = false;
  61328. // Disable the mechanism if inside a link (`<$text url="foo">F[]oo</$text>` or <$text url="foo">Foo[]</$text>`).
  61329. if ( shouldPreserveAttributes ) {
  61330. return;
  61331. }
  61332. // Use `model.enqueueChange()` in order to execute the callback at the end of the changes process.
  61333. editor.model.enqueueChange( writer => {
  61334. removeLinkAttributesFromSelection( writer, getLinkAttributesAllowedOnText( model.schema ) );
  61335. } );
  61336. }, { priority: 'low' } );
  61337. }
  61338. }
  61339. // Make the selection free of link-related model attributes.
  61340. // All link-related model attributes start with "link". That includes not only "linkHref"
  61341. // but also all decorator attributes (they have dynamic names), or even custom plugins.
  61342. //
  61343. // @param {module:engine/model/writer~Writer} writer
  61344. // @param {Array.<String>} linkAttributes
  61345. function removeLinkAttributesFromSelection( writer, linkAttributes ) {
  61346. writer.removeSelectionAttribute( 'linkHref' );
  61347. for ( const attribute of linkAttributes ) {
  61348. writer.removeSelectionAttribute( attribute );
  61349. }
  61350. }
  61351. // Checks whether selection's attributes should be copied to the new inserted text.
  61352. //
  61353. // @param {module:engine/model/model~Model} model
  61354. // @returns {Boolean}
  61355. function shouldCopyAttributes( model ) {
  61356. const selection = model.document.selection;
  61357. const firstPosition = selection.getFirstPosition();
  61358. const lastPosition = selection.getLastPosition();
  61359. const nodeAtFirstPosition = firstPosition.nodeAfter;
  61360. // The text link node does not exist...
  61361. if ( !nodeAtFirstPosition ) {
  61362. return false;
  61363. }
  61364. // ...or it isn't the text node...
  61365. if ( !nodeAtFirstPosition.is( '$text' ) ) {
  61366. return false;
  61367. }
  61368. // ...or isn't the link.
  61369. if ( !nodeAtFirstPosition.hasAttribute( 'linkHref' ) ) {
  61370. return false;
  61371. }
  61372. // `textNode` = the position is inside the link element.
  61373. // `nodeBefore` = the position is at the end of the link element.
  61374. const nodeAtLastPosition = lastPosition.textNode || lastPosition.nodeBefore;
  61375. // If both references the same node selection contains a single text node.
  61376. if ( nodeAtFirstPosition === nodeAtLastPosition ) {
  61377. return true;
  61378. }
  61379. // If nodes are not equal, maybe the link nodes has defined additional attributes inside.
  61380. // First, we need to find the entire link range.
  61381. const linkRange = Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__["findAttributeRange"])( firstPosition, 'linkHref', nodeAtFirstPosition.getAttribute( 'linkHref' ), model );
  61382. // Then we can check whether selected range is inside the found link range. If so, attributes should be preserved.
  61383. return linkRange.containsRange( model.createRange( firstPosition, lastPosition ), true );
  61384. }
  61385. // Checks whether provided changes were caused by typing.
  61386. //
  61387. // @params {module:core/editor/editor~Editor} editor
  61388. // @returns {Boolean}
  61389. function isTyping( editor ) {
  61390. const input = editor.plugins.get( 'Input' );
  61391. return input.isInput( editor.model.change( writer => writer.batch ) );
  61392. }
  61393. // Returns an array containing names of the attributes allowed on `$text` that describes the link item.
  61394. //
  61395. // @param {module:engine/model/schema~Schema} schema
  61396. // @returns {Array.<String>}
  61397. function getLinkAttributesAllowedOnText( schema ) {
  61398. const textAttributes = schema.getDefinition( '$text' ).allowAttributes;
  61399. return textAttributes.filter( attribute => attribute.startsWith( 'link' ) );
  61400. }
  61401. /***/ }),
  61402. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkimage.js":
  61403. /*!****************************************************************!*\
  61404. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkimage.js ***!
  61405. \****************************************************************/
  61406. /*! exports provided: default */
  61407. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61408. "use strict";
  61409. __webpack_require__.r(__webpack_exports__);
  61410. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkImage; });
  61411. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  61412. /* harmony import */ var _linkimageediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./linkimageediting */ "./node_modules/@ckeditor/ckeditor5-link/src/linkimageediting.js");
  61413. /* harmony import */ var _linkimageui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linkimageui */ "./node_modules/@ckeditor/ckeditor5-link/src/linkimageui.js");
  61414. /* harmony import */ var _theme_linkimage_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/linkimage.css */ "./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css");
  61415. /**
  61416. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  61417. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  61418. */
  61419. /**
  61420. * @module link/linkimage
  61421. */
  61422. /**
  61423. * The `LinkImage` plugin.
  61424. *
  61425. * This is a "glue" plugin that loads the {@link module:link/linkimageediting~LinkImageEditing link image editing feature}
  61426. * and {@link module:link/linkimageui~LinkImageUI link image UI feature}.
  61427. *
  61428. * @extends module:core/plugin~Plugin
  61429. */
  61430. class LinkImage extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  61431. /**
  61432. * @inheritDoc
  61433. */
  61434. static get requires() {
  61435. return [ _linkimageediting__WEBPACK_IMPORTED_MODULE_1__["default"], _linkimageui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  61436. }
  61437. /**
  61438. * @inheritDoc
  61439. */
  61440. static get pluginName() {
  61441. return 'LinkImage';
  61442. }
  61443. }
  61444. /***/ }),
  61445. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkimageediting.js":
  61446. /*!***********************************************************************!*\
  61447. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkimageediting.js ***!
  61448. \***********************************************************************/
  61449. /*! exports provided: default */
  61450. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61451. "use strict";
  61452. __webpack_require__.r(__webpack_exports__);
  61453. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkImageEditing; });
  61454. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  61455. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  61456. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  61457. /* harmony import */ var _linkediting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./linkediting */ "./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js");
  61458. /**
  61459. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  61460. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  61461. */
  61462. /**
  61463. * @module link/linkimageediting
  61464. */
  61465. /**
  61466. * The link image engine feature.
  61467. *
  61468. * It accepts the `linkHref="url"` attribute in the model for the {@link module:image/image~Image `<imageBlock>`} element
  61469. * which allows linking images.
  61470. *
  61471. * @extends module:core/plugin~Plugin
  61472. */
  61473. class LinkImageEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  61474. /**
  61475. * @inheritDoc
  61476. */
  61477. static get requires() {
  61478. return [ 'ImageEditing', 'ImageUtils', _linkediting__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  61479. }
  61480. /**
  61481. * @inheritDoc
  61482. */
  61483. static get pluginName() {
  61484. return 'LinkImageEditing';
  61485. }
  61486. init() {
  61487. const editor = this.editor;
  61488. const schema = editor.model.schema;
  61489. if ( editor.plugins.has( 'ImageBlockEditing' ) ) {
  61490. schema.extend( 'imageBlock', { allowAttributes: [ 'linkHref' ] } );
  61491. }
  61492. editor.conversion.for( 'upcast' ).add( upcastLink( editor ) );
  61493. editor.conversion.for( 'downcast' ).add( downcastImageLink( editor ) );
  61494. // Definitions for decorators are provided by the `link` command and the `LinkEditing` plugin.
  61495. this._enableAutomaticDecorators();
  61496. this._enableManualDecorators();
  61497. }
  61498. /**
  61499. * Processes {@link module:link/link~LinkDecoratorAutomaticDefinition automatic decorators} definitions and
  61500. * attaches proper converters that will work when linking an image.`
  61501. *
  61502. * @private
  61503. */
  61504. _enableAutomaticDecorators() {
  61505. const editor = this.editor;
  61506. const command = editor.commands.get( 'link' );
  61507. const automaticDecorators = command.automaticDecorators;
  61508. if ( automaticDecorators.length ) {
  61509. editor.conversion.for( 'downcast' ).add( automaticDecorators.getDispatcherForLinkedImage() );
  61510. }
  61511. }
  61512. /**
  61513. * Processes transformed {@link module:link/utils~ManualDecorator} instances and attaches proper converters
  61514. * that will work when linking an image.
  61515. *
  61516. * @private
  61517. */
  61518. _enableManualDecorators() {
  61519. const editor = this.editor;
  61520. const command = editor.commands.get( 'link' );
  61521. for ( const decorator of command.manualDecorators ) {
  61522. if ( editor.plugins.has( 'ImageBlockEditing' ) ) {
  61523. editor.model.schema.extend( 'imageBlock', { allowAttributes: decorator.id } );
  61524. }
  61525. if ( editor.plugins.has( 'ImageInlineEditing' ) ) {
  61526. editor.model.schema.extend( 'imageInline', { allowAttributes: decorator.id } );
  61527. }
  61528. editor.conversion.for( 'downcast' ).add( downcastImageLinkManualDecorator( decorator ) );
  61529. editor.conversion.for( 'upcast' ).add( upcastImageLinkManualDecorator( editor, decorator ) );
  61530. }
  61531. }
  61532. }
  61533. // Returns a converter for linked block images that consumes the "href" attribute
  61534. // if a link contains an image.
  61535. //
  61536. // @private
  61537. // @param {module:core/editor/editor~Editor} editor The editor instance.
  61538. // @returns {Function}
  61539. function upcastLink( editor ) {
  61540. const isImageInlinePluginLoaded = editor.plugins.has( 'ImageInlineEditing' );
  61541. const imageUtils = editor.plugins.get( 'ImageUtils' );
  61542. return dispatcher => {
  61543. dispatcher.on( 'element:a', ( evt, data, conversionApi ) => {
  61544. const viewLink = data.viewItem;
  61545. const imageInLink = imageUtils.findViewImgElement( viewLink );
  61546. if ( !imageInLink ) {
  61547. return;
  61548. }
  61549. const blockImageView = imageInLink.findAncestor( element => imageUtils.isBlockImageView( element ) );
  61550. // There are four possible cases to consider here
  61551. //
  61552. // 1. A "root > ... > figure.image > a > img" structure.
  61553. // 2. A "root > ... > figure.image > a > picture > img" structure.
  61554. // 3. A "root > ... > block > a > img" structure.
  61555. // 4. A "root > ... > block > a > picture > img" structure.
  61556. //
  61557. // but the last 2 cases should only be considered by this converter when the inline image plugin
  61558. // is NOT loaded in the editor (because otherwise, that would be a plain, linked inline image).
  61559. if ( isImageInlinePluginLoaded && !blockImageView ) {
  61560. return;
  61561. }
  61562. // There's an image inside an <a> element - we consume it so it won't be picked up by the Link plugin.
  61563. const consumableAttributes = { attributes: [ 'href' ] };
  61564. // Consume the `href` attribute so the default one will not convert it to $text attribute.
  61565. if ( !conversionApi.consumable.consume( viewLink, consumableAttributes ) ) {
  61566. // Might be consumed by something else - i.e. other converter with priority=highest - a standard check.
  61567. return;
  61568. }
  61569. const linkHref = viewLink.getAttribute( 'href' );
  61570. // Missing the 'href' attribute.
  61571. if ( !linkHref ) {
  61572. return;
  61573. }
  61574. // A full definition of the image feature.
  61575. // figure > a > img: parent of the view link element is an image element (figure).
  61576. let modelElement = data.modelCursor.parent;
  61577. if ( !modelElement.is( 'element', 'imageBlock' ) ) {
  61578. // a > img: parent of the view link is not the image (figure) element. We need to convert it manually.
  61579. const conversionResult = conversionApi.convertItem( imageInLink, data.modelCursor );
  61580. // Set image range as conversion result.
  61581. data.modelRange = conversionResult.modelRange;
  61582. // Continue conversion where image conversion ends.
  61583. data.modelCursor = conversionResult.modelCursor;
  61584. modelElement = data.modelCursor.nodeBefore;
  61585. }
  61586. if ( modelElement && modelElement.is( 'element', 'imageBlock' ) ) {
  61587. // Set the linkHref attribute from link element on model image element.
  61588. conversionApi.writer.setAttribute( 'linkHref', linkHref, modelElement );
  61589. }
  61590. }, { priority: 'high' } );
  61591. // Using the same priority that `upcastImageLinkManualDecorator()` converter guarantees
  61592. // that manual decorators will decorate the proper element.
  61593. };
  61594. }
  61595. // Creates a converter that adds `<a>` to linked block image view elements.
  61596. //
  61597. // @private
  61598. function downcastImageLink( editor ) {
  61599. const imageUtils = editor.plugins.get( 'ImageUtils' );
  61600. return dispatcher => {
  61601. dispatcher.on( 'attribute:linkHref:imageBlock', ( evt, data, conversionApi ) => {
  61602. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  61603. return;
  61604. }
  61605. // The image will be already converted - so it will be present in the view.
  61606. const viewFigure = conversionApi.mapper.toViewElement( data.item );
  61607. const writer = conversionApi.writer;
  61608. // But we need to check whether the link element exists.
  61609. const linkInImage = Array.from( viewFigure.getChildren() ).find( child => child.name === 'a' );
  61610. const viewImage = imageUtils.findViewImgElement( viewFigure );
  61611. // <picture>...<img/></picture> or <img/>
  61612. const viewImgOrPicture = viewImage.parent.is( 'element', 'picture' ) ? viewImage.parent : viewImage;
  61613. // If so, update the attribute if it's defined or remove the entire link if the attribute is empty.
  61614. if ( linkInImage ) {
  61615. if ( data.attributeNewValue ) {
  61616. writer.setAttribute( 'href', data.attributeNewValue, linkInImage );
  61617. } else {
  61618. writer.move( writer.createRangeOn( viewImgOrPicture ), writer.createPositionAt( viewFigure, 0 ) );
  61619. writer.remove( linkInImage );
  61620. }
  61621. } else {
  61622. // But if it does not exist. Let's wrap already converted image by newly created link element.
  61623. // 1. Create an empty link element.
  61624. const linkElement = writer.createContainerElement( 'a', { href: data.attributeNewValue } );
  61625. // 2. Insert link inside the associated image.
  61626. writer.insert( writer.createPositionAt( viewFigure, 0 ), linkElement );
  61627. // 3. Move the image to the link.
  61628. writer.move( writer.createRangeOn( viewImgOrPicture ), writer.createPositionAt( linkElement, 0 ) );
  61629. }
  61630. }, { priority: 'high' } );
  61631. };
  61632. }
  61633. // Returns a converter that decorates the `<a>` element when the image is the link label.
  61634. //
  61635. // @private
  61636. // @returns {Function}
  61637. function downcastImageLinkManualDecorator( decorator ) {
  61638. return dispatcher => {
  61639. dispatcher.on( `attribute:${ decorator.id }:imageBlock`, ( evt, data, conversionApi ) => {
  61640. const viewFigure = conversionApi.mapper.toViewElement( data.item );
  61641. const linkInImage = Array.from( viewFigure.getChildren() ).find( child => child.name === 'a' );
  61642. // The <a> element was removed by the time this converter is executed.
  61643. // It may happen when the base `linkHref` and decorator attributes are removed
  61644. // at the same time (see #8401).
  61645. if ( !linkInImage ) {
  61646. return;
  61647. }
  61648. for ( const [ key, val ] of Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["toMap"])( decorator.attributes ) ) {
  61649. conversionApi.writer.setAttribute( key, val, linkInImage );
  61650. }
  61651. if ( decorator.classes ) {
  61652. conversionApi.writer.addClass( decorator.classes, linkInImage );
  61653. }
  61654. for ( const key in decorator.styles ) {
  61655. conversionApi.writer.setStyle( key, decorator.styles[ key ], linkInImage );
  61656. }
  61657. } );
  61658. };
  61659. }
  61660. // Returns a converter that checks whether manual decorators should be applied to the link.
  61661. //
  61662. // @private
  61663. // @returns {Function}
  61664. function upcastImageLinkManualDecorator( editor, decorator ) {
  61665. const isImageInlinePluginLoaded = editor.plugins.has( 'ImageInlineEditing' );
  61666. const imageUtils = editor.plugins.get( 'ImageUtils' );
  61667. return dispatcher => {
  61668. dispatcher.on( 'element:a', ( evt, data, conversionApi ) => {
  61669. const viewLink = data.viewItem;
  61670. const imageInLink = imageUtils.findViewImgElement( viewLink );
  61671. // We need to check whether an image is inside a link because the converter handles
  61672. // only manual decorators for linked images. See #7975.
  61673. if ( !imageInLink ) {
  61674. return;
  61675. }
  61676. const blockImageView = imageInLink.findAncestor( element => imageUtils.isBlockImageView( element ) );
  61677. if ( isImageInlinePluginLoaded && !blockImageView ) {
  61678. return;
  61679. }
  61680. const matcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__["Matcher"]( decorator._createPattern() );
  61681. const result = matcher.match( viewLink );
  61682. // The link element does not have required attributes or/and proper values.
  61683. if ( !result ) {
  61684. return;
  61685. }
  61686. // Check whether we can consume those attributes.
  61687. if ( !conversionApi.consumable.consume( viewLink, result.match ) ) {
  61688. return;
  61689. }
  61690. // At this stage we can assume that we have the `<imageBlock>` element.
  61691. // `nodeBefore` comes after conversion: `<a><img></a>`.
  61692. // `parent` comes with full image definition: `<figure><a><img></a></figure>.
  61693. // See the body of the `upcastLink()` function.
  61694. const modelElement = data.modelCursor.nodeBefore || data.modelCursor.parent;
  61695. conversionApi.writer.setAttribute( decorator.id, true, modelElement );
  61696. }, { priority: 'high' } );
  61697. // Using the same priority that `upcastLink()` converter guarantees that the linked image was properly converted.
  61698. };
  61699. }
  61700. /***/ }),
  61701. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkimageui.js":
  61702. /*!******************************************************************!*\
  61703. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkimageui.js ***!
  61704. \******************************************************************/
  61705. /*! exports provided: default */
  61706. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61707. "use strict";
  61708. __webpack_require__.r(__webpack_exports__);
  61709. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkImageUI; });
  61710. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  61711. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  61712. /* harmony import */ var _linkui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linkui */ "./node_modules/@ckeditor/ckeditor5-link/src/linkui.js");
  61713. /* harmony import */ var _linkediting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./linkediting */ "./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js");
  61714. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  61715. /* harmony import */ var _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../theme/icons/link.svg */ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg");
  61716. /**
  61717. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  61718. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  61719. */
  61720. /**
  61721. * @module link/linkimageui
  61722. */
  61723. /**
  61724. * The link image UI plugin.
  61725. *
  61726. * This plugin provides the `'linkImage'` button that can be displayed in the {@link module:image/imagetoolbar~ImageToolbar}.
  61727. * It can be used to wrap images in links.
  61728. *
  61729. * @extends module:core/plugin~Plugin
  61730. */
  61731. class LinkImageUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["Plugin"] {
  61732. /**
  61733. * @inheritDoc
  61734. */
  61735. static get requires() {
  61736. return [ _linkediting__WEBPACK_IMPORTED_MODULE_3__["default"], _linkui__WEBPACK_IMPORTED_MODULE_2__["default"], 'ImageBlockEditing' ];
  61737. }
  61738. /**
  61739. * @inheritDoc
  61740. */
  61741. static get pluginName() {
  61742. return 'LinkImageUI';
  61743. }
  61744. /**
  61745. * @inheritDoc
  61746. */
  61747. init() {
  61748. const editor = this.editor;
  61749. const viewDocument = editor.editing.view.document;
  61750. this.listenTo( viewDocument, 'click', ( evt, data ) => {
  61751. if ( this._isSelectedLinkedImage( editor.model.document.selection ) ) {
  61752. // Prevent browser navigation when clicking a linked image.
  61753. data.preventDefault();
  61754. // Block the `LinkUI` plugin when an image was clicked.
  61755. // In such a case, we'd like to display the image toolbar.
  61756. evt.stop();
  61757. }
  61758. }, { priority: 'high' } );
  61759. this._createToolbarLinkImageButton();
  61760. }
  61761. /**
  61762. * Creates a `LinkImageUI` button view.
  61763. *
  61764. * Clicking this button shows a {@link module:link/linkui~LinkUI#_balloon} attached to the selection.
  61765. * When an image is already linked, the view shows {@link module:link/linkui~LinkUI#actionsView} or
  61766. * {@link module:link/linkui~LinkUI#formView} if it is not.
  61767. *
  61768. * @private
  61769. */
  61770. _createToolbarLinkImageButton() {
  61771. const editor = this.editor;
  61772. const t = editor.t;
  61773. editor.ui.componentFactory.add( 'linkImage', locale => {
  61774. const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( locale );
  61775. const plugin = editor.plugins.get( 'LinkUI' );
  61776. const linkCommand = editor.commands.get( 'link' );
  61777. button.set( {
  61778. isEnabled: true,
  61779. label: t( 'Link image' ),
  61780. icon: _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_5__["default"],
  61781. keystroke: _utils__WEBPACK_IMPORTED_MODULE_4__["LINK_KEYSTROKE"],
  61782. tooltip: true,
  61783. isToggleable: true
  61784. } );
  61785. // Bind button to the command.
  61786. button.bind( 'isEnabled' ).to( linkCommand, 'isEnabled' );
  61787. button.bind( 'isOn' ).to( linkCommand, 'value', value => !!value );
  61788. // Show the actionsView or formView (both from LinkUI) on button click depending on whether the image is linked already.
  61789. this.listenTo( button, 'execute', () => {
  61790. if ( this._isSelectedLinkedImage( editor.model.document.selection ) ) {
  61791. plugin._addActionsView();
  61792. } else {
  61793. plugin._showUI( true );
  61794. }
  61795. } );
  61796. return button;
  61797. } );
  61798. }
  61799. /**
  61800. * Returns true if a linked image (either block or inline) is the only selected element
  61801. * in the model document.
  61802. *
  61803. * @private
  61804. * @param {module:engine/model/selection~Selection} selection
  61805. * @returns {Boolean}
  61806. */
  61807. _isSelectedLinkedImage( selection ) {
  61808. const selectedModelElement = selection.getSelectedElement();
  61809. const imageUtils = this.editor.plugins.get( 'ImageUtils' );
  61810. return imageUtils.isImage( selectedModelElement ) && selectedModelElement.hasAttribute( 'linkHref' );
  61811. }
  61812. }
  61813. /***/ }),
  61814. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkui.js":
  61815. /*!*************************************************************!*\
  61816. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkui.js ***!
  61817. \*************************************************************/
  61818. /*! exports provided: default */
  61819. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61820. "use strict";
  61821. __webpack_require__.r(__webpack_exports__);
  61822. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkUI; });
  61823. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  61824. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  61825. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  61826. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  61827. /* harmony import */ var _ui_linkformview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ui/linkformview */ "./node_modules/@ckeditor/ckeditor5-link/src/ui/linkformview.js");
  61828. /* harmony import */ var _ui_linkactionsview__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ui/linkactionsview */ "./node_modules/@ckeditor/ckeditor5-link/src/ui/linkactionsview.js");
  61829. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  61830. /* harmony import */ var _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../theme/icons/link.svg */ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg");
  61831. /**
  61832. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  61833. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  61834. */
  61835. /**
  61836. * @module link/linkui
  61837. */
  61838. const VISUAL_SELECTION_MARKER_NAME = 'link-ui';
  61839. /**
  61840. * The link UI plugin. It introduces the `'link'` and `'unlink'` buttons and support for the <kbd>Ctrl+K</kbd> keystroke.
  61841. *
  61842. * It uses the
  61843. * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.
  61844. *
  61845. * @extends module:core/plugin~Plugin
  61846. */
  61847. class LinkUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  61848. /**
  61849. * @inheritDoc
  61850. */
  61851. static get requires() {
  61852. return [ ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["ContextualBalloon"] ];
  61853. }
  61854. /**
  61855. * @inheritDoc
  61856. */
  61857. static get pluginName() {
  61858. return 'LinkUI';
  61859. }
  61860. /**
  61861. * @inheritDoc
  61862. */
  61863. init() {
  61864. const editor = this.editor;
  61865. editor.editing.view.addObserver( ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_1__["ClickObserver"] );
  61866. /**
  61867. * The actions view displayed inside of the balloon.
  61868. *
  61869. * @member {module:link/ui/linkactionsview~LinkActionsView}
  61870. */
  61871. this.actionsView = this._createActionsView();
  61872. /**
  61873. * The form view displayed inside the balloon.
  61874. *
  61875. * @member {module:link/ui/linkformview~LinkFormView}
  61876. */
  61877. this.formView = this._createFormView();
  61878. /**
  61879. * The contextual balloon plugin instance.
  61880. *
  61881. * @private
  61882. * @member {module:ui/panel/balloon/contextualballoon~ContextualBalloon}
  61883. */
  61884. this._balloon = editor.plugins.get( ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["ContextualBalloon"] );
  61885. // Create toolbar buttons.
  61886. this._createToolbarLinkButton();
  61887. // Attach lifecycle actions to the the balloon.
  61888. this._enableUserBalloonInteractions();
  61889. // Renders a fake visual selection marker on an expanded selection.
  61890. editor.conversion.for( 'editingDowncast' ).markerToHighlight( {
  61891. model: VISUAL_SELECTION_MARKER_NAME,
  61892. view: {
  61893. classes: [ 'ck-fake-link-selection' ]
  61894. }
  61895. } );
  61896. // Renders a fake visual selection marker on a collapsed selection.
  61897. editor.conversion.for( 'editingDowncast' ).markerToElement( {
  61898. model: VISUAL_SELECTION_MARKER_NAME,
  61899. view: {
  61900. name: 'span',
  61901. classes: [ 'ck-fake-link-selection', 'ck-fake-link-selection_collapsed' ]
  61902. }
  61903. } );
  61904. }
  61905. /**
  61906. * @inheritDoc
  61907. */
  61908. destroy() {
  61909. super.destroy();
  61910. // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).
  61911. this.formView.destroy();
  61912. }
  61913. /**
  61914. * Creates the {@link module:link/ui/linkactionsview~LinkActionsView} instance.
  61915. *
  61916. * @private
  61917. * @returns {module:link/ui/linkactionsview~LinkActionsView} The link actions view instance.
  61918. */
  61919. _createActionsView() {
  61920. const editor = this.editor;
  61921. const actionsView = new _ui_linkactionsview__WEBPACK_IMPORTED_MODULE_5__["default"]( editor.locale );
  61922. const linkCommand = editor.commands.get( 'link' );
  61923. const unlinkCommand = editor.commands.get( 'unlink' );
  61924. actionsView.bind( 'href' ).to( linkCommand, 'value' );
  61925. actionsView.editButtonView.bind( 'isEnabled' ).to( linkCommand );
  61926. actionsView.unlinkButtonView.bind( 'isEnabled' ).to( unlinkCommand );
  61927. // Execute unlink command after clicking on the "Edit" button.
  61928. this.listenTo( actionsView, 'edit', () => {
  61929. this._addFormView();
  61930. } );
  61931. // Execute unlink command after clicking on the "Unlink" button.
  61932. this.listenTo( actionsView, 'unlink', () => {
  61933. editor.execute( 'unlink' );
  61934. this._hideUI();
  61935. } );
  61936. // Close the panel on esc key press when the **actions have focus**.
  61937. actionsView.keystrokes.set( 'Esc', ( data, cancel ) => {
  61938. this._hideUI();
  61939. cancel();
  61940. } );
  61941. // Open the form view on Ctrl+K when the **actions have focus**..
  61942. actionsView.keystrokes.set( _utils__WEBPACK_IMPORTED_MODULE_6__["LINK_KEYSTROKE"], ( data, cancel ) => {
  61943. this._addFormView();
  61944. cancel();
  61945. } );
  61946. return actionsView;
  61947. }
  61948. /**
  61949. * Creates the {@link module:link/ui/linkformview~LinkFormView} instance.
  61950. *
  61951. * @private
  61952. * @returns {module:link/ui/linkformview~LinkFormView} The link form view instance.
  61953. */
  61954. _createFormView() {
  61955. const editor = this.editor;
  61956. const linkCommand = editor.commands.get( 'link' );
  61957. const defaultProtocol = editor.config.get( 'link.defaultProtocol' );
  61958. const formView = new _ui_linkformview__WEBPACK_IMPORTED_MODULE_4__["default"]( editor.locale, linkCommand );
  61959. formView.urlInputView.fieldView.bind( 'value' ).to( linkCommand, 'value' );
  61960. // Form elements should be read-only when corresponding commands are disabled.
  61961. formView.urlInputView.bind( 'isReadOnly' ).to( linkCommand, 'isEnabled', value => !value );
  61962. formView.saveButtonView.bind( 'isEnabled' ).to( linkCommand );
  61963. // Execute link command after clicking the "Save" button.
  61964. this.listenTo( formView, 'submit', () => {
  61965. const { value } = formView.urlInputView.fieldView.element;
  61966. const parsedUrl = Object(_utils__WEBPACK_IMPORTED_MODULE_6__["addLinkProtocolIfApplicable"])( value, defaultProtocol );
  61967. editor.execute( 'link', parsedUrl, formView.getDecoratorSwitchesState() );
  61968. this._closeFormView();
  61969. } );
  61970. // Hide the panel after clicking the "Cancel" button.
  61971. this.listenTo( formView, 'cancel', () => {
  61972. this._closeFormView();
  61973. } );
  61974. // Close the panel on esc key press when the **form has focus**.
  61975. formView.keystrokes.set( 'Esc', ( data, cancel ) => {
  61976. this._closeFormView();
  61977. cancel();
  61978. } );
  61979. return formView;
  61980. }
  61981. /**
  61982. * Creates a toolbar Link button. Clicking this button will show
  61983. * a {@link #_balloon} attached to the selection.
  61984. *
  61985. * @private
  61986. */
  61987. _createToolbarLinkButton() {
  61988. const editor = this.editor;
  61989. const linkCommand = editor.commands.get( 'link' );
  61990. const t = editor.t;
  61991. // Handle the `Ctrl+K` keystroke and show the panel.
  61992. editor.keystrokes.set( _utils__WEBPACK_IMPORTED_MODULE_6__["LINK_KEYSTROKE"], ( keyEvtData, cancel ) => {
  61993. // Prevent focusing the search bar in FF, Chrome and Edge. See https://github.com/ckeditor/ckeditor5/issues/4811.
  61994. cancel();
  61995. if ( linkCommand.isEnabled ) {
  61996. this._showUI( true );
  61997. }
  61998. } );
  61999. editor.ui.componentFactory.add( 'link', locale => {
  62000. const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["ButtonView"]( locale );
  62001. button.isEnabled = true;
  62002. button.label = t( 'Link' );
  62003. button.icon = _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_7__["default"];
  62004. button.keystroke = _utils__WEBPACK_IMPORTED_MODULE_6__["LINK_KEYSTROKE"];
  62005. button.tooltip = true;
  62006. button.isToggleable = true;
  62007. // Bind button to the command.
  62008. button.bind( 'isEnabled' ).to( linkCommand, 'isEnabled' );
  62009. button.bind( 'isOn' ).to( linkCommand, 'value', value => !!value );
  62010. // Show the panel on button click.
  62011. this.listenTo( button, 'execute', () => this._showUI( true ) );
  62012. return button;
  62013. } );
  62014. }
  62015. /**
  62016. * Attaches actions that control whether the balloon panel containing the
  62017. * {@link #formView} is visible or not.
  62018. *
  62019. * @private
  62020. */
  62021. _enableUserBalloonInteractions() {
  62022. const viewDocument = this.editor.editing.view.document;
  62023. // Handle click on view document and show panel when selection is placed inside the link element.
  62024. // Keep panel open until selection will be inside the same link element.
  62025. this.listenTo( viewDocument, 'click', () => {
  62026. const parentLink = this._getSelectedLinkElement();
  62027. if ( parentLink ) {
  62028. // Then show panel but keep focus inside editor editable.
  62029. this._showUI();
  62030. }
  62031. } );
  62032. // Focus the form if the balloon is visible and the Tab key has been pressed.
  62033. this.editor.keystrokes.set( 'Tab', ( data, cancel ) => {
  62034. if ( this._areActionsVisible && !this.actionsView.focusTracker.isFocused ) {
  62035. this.actionsView.focus();
  62036. cancel();
  62037. }
  62038. }, {
  62039. // Use the high priority because the link UI navigation is more important
  62040. // than other feature's actions, e.g. list indentation.
  62041. // https://github.com/ckeditor/ckeditor5-link/issues/146
  62042. priority: 'high'
  62043. } );
  62044. // Close the panel on the Esc key press when the editable has focus and the balloon is visible.
  62045. this.editor.keystrokes.set( 'Esc', ( data, cancel ) => {
  62046. if ( this._isUIVisible ) {
  62047. this._hideUI();
  62048. cancel();
  62049. }
  62050. } );
  62051. // Close on click outside of balloon panel element.
  62052. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_2__["clickOutsideHandler"])( {
  62053. emitter: this.formView,
  62054. activator: () => this._isUIInPanel,
  62055. contextElements: [ this._balloon.view.element ],
  62056. callback: () => this._hideUI()
  62057. } );
  62058. }
  62059. /**
  62060. * Adds the {@link #actionsView} to the {@link #_balloon}.
  62061. *
  62062. * @protected
  62063. */
  62064. _addActionsView() {
  62065. if ( this._areActionsInPanel ) {
  62066. return;
  62067. }
  62068. this._balloon.add( {
  62069. view: this.actionsView,
  62070. position: this._getBalloonPositionData()
  62071. } );
  62072. }
  62073. /**
  62074. * Adds the {@link #formView} to the {@link #_balloon}.
  62075. *
  62076. * @protected
  62077. */
  62078. _addFormView() {
  62079. if ( this._isFormInPanel ) {
  62080. return;
  62081. }
  62082. const editor = this.editor;
  62083. const linkCommand = editor.commands.get( 'link' );
  62084. this.formView.disableCssTransitions();
  62085. this._balloon.add( {
  62086. view: this.formView,
  62087. position: this._getBalloonPositionData()
  62088. } );
  62089. // Select input when form view is currently visible.
  62090. if ( this._balloon.visibleView === this.formView ) {
  62091. this.formView.urlInputView.fieldView.select();
  62092. }
  62093. this.formView.enableCssTransitions();
  62094. // Make sure that each time the panel shows up, the URL field remains in sync with the value of
  62095. // the command. If the user typed in the input, then canceled the balloon (`urlInputView.fieldView#value` stays
  62096. // unaltered) and re-opened it without changing the value of the link command (e.g. because they
  62097. // clicked the same link), they would see the old value instead of the actual value of the command.
  62098. // https://github.com/ckeditor/ckeditor5-link/issues/78
  62099. // https://github.com/ckeditor/ckeditor5-link/issues/123
  62100. this.formView.urlInputView.fieldView.element.value = linkCommand.value || '';
  62101. }
  62102. /**
  62103. * Closes the form view. Decides whether the balloon should be hidden completely or if the action view should be shown. This is
  62104. * decided upon the link command value (which has a value if the document selection is in the link).
  62105. *
  62106. * Additionally, if any {@link module:link/link~LinkConfig#decorators} are defined in the editor configuration, the state of
  62107. * switch buttons responsible for manual decorator handling is restored.
  62108. *
  62109. * @private
  62110. */
  62111. _closeFormView() {
  62112. const linkCommand = this.editor.commands.get( 'link' );
  62113. // Restore manual decorator states to represent the current model state. This case is important to reset the switch buttons
  62114. // when the user cancels the editing form.
  62115. linkCommand.restoreManualDecoratorStates();
  62116. if ( linkCommand.value !== undefined ) {
  62117. this._removeFormView();
  62118. } else {
  62119. this._hideUI();
  62120. }
  62121. }
  62122. /**
  62123. * Removes the {@link #formView} from the {@link #_balloon}.
  62124. *
  62125. * @protected
  62126. */
  62127. _removeFormView() {
  62128. if ( this._isFormInPanel ) {
  62129. // Blur the input element before removing it from DOM to prevent issues in some browsers.
  62130. // See https://github.com/ckeditor/ckeditor5/issues/1501.
  62131. this.formView.saveButtonView.focus();
  62132. this._balloon.remove( this.formView );
  62133. // Because the form has an input which has focus, the focus must be brought back
  62134. // to the editor. Otherwise, it would be lost.
  62135. this.editor.editing.view.focus();
  62136. this._hideFakeVisualSelection();
  62137. }
  62138. }
  62139. /**
  62140. * Shows the correct UI type. It is either {@link #formView} or {@link #actionsView}.
  62141. *
  62142. * @param {Boolean} forceVisible
  62143. * @private
  62144. */
  62145. _showUI( forceVisible = false ) {
  62146. // When there's no link under the selection, go straight to the editing UI.
  62147. if ( !this._getSelectedLinkElement() ) {
  62148. // Show visual selection on a text without a link when the contextual balloon is displayed.
  62149. // See https://github.com/ckeditor/ckeditor5/issues/4721.
  62150. this._showFakeVisualSelection();
  62151. this._addActionsView();
  62152. // Be sure panel with link is visible.
  62153. if ( forceVisible ) {
  62154. this._balloon.showStack( 'main' );
  62155. }
  62156. this._addFormView();
  62157. }
  62158. // If there's a link under the selection...
  62159. else {
  62160. // Go to the editing UI if actions are already visible.
  62161. if ( this._areActionsVisible ) {
  62162. this._addFormView();
  62163. }
  62164. // Otherwise display just the actions UI.
  62165. else {
  62166. this._addActionsView();
  62167. }
  62168. // Be sure panel with link is visible.
  62169. if ( forceVisible ) {
  62170. this._balloon.showStack( 'main' );
  62171. }
  62172. }
  62173. // Begin responding to ui#update once the UI is added.
  62174. this._startUpdatingUI();
  62175. }
  62176. /**
  62177. * Removes the {@link #formView} from the {@link #_balloon}.
  62178. *
  62179. * See {@link #_addFormView}, {@link #_addActionsView}.
  62180. *
  62181. * @protected
  62182. */
  62183. _hideUI() {
  62184. if ( !this._isUIInPanel ) {
  62185. return;
  62186. }
  62187. const editor = this.editor;
  62188. this.stopListening( editor.ui, 'update' );
  62189. this.stopListening( this._balloon, 'change:visibleView' );
  62190. // Make sure the focus always gets back to the editable _before_ removing the focused form view.
  62191. // Doing otherwise causes issues in some browsers. See https://github.com/ckeditor/ckeditor5-link/issues/193.
  62192. editor.editing.view.focus();
  62193. // Remove form first because it's on top of the stack.
  62194. this._removeFormView();
  62195. // Then remove the actions view because it's beneath the form.
  62196. this._balloon.remove( this.actionsView );
  62197. this._hideFakeVisualSelection();
  62198. }
  62199. /**
  62200. * Makes the UI react to the {@link module:core/editor/editorui~EditorUI#event:update} event to
  62201. * reposition itself when the editor UI should be refreshed.
  62202. *
  62203. * See: {@link #_hideUI} to learn when the UI stops reacting to the `update` event.
  62204. *
  62205. * @protected
  62206. */
  62207. _startUpdatingUI() {
  62208. const editor = this.editor;
  62209. const viewDocument = editor.editing.view.document;
  62210. let prevSelectedLink = this._getSelectedLinkElement();
  62211. let prevSelectionParent = getSelectionParent();
  62212. const update = () => {
  62213. const selectedLink = this._getSelectedLinkElement();
  62214. const selectionParent = getSelectionParent();
  62215. // Hide the panel if:
  62216. //
  62217. // * the selection went out of the EXISTING link element. E.g. user moved the caret out
  62218. // of the link,
  62219. // * the selection went to a different parent when creating a NEW link. E.g. someone
  62220. // else modified the document.
  62221. // * the selection has expanded (e.g. displaying link actions then pressing SHIFT+Right arrow).
  62222. //
  62223. // Note: #_getSelectedLinkElement will return a link for a non-collapsed selection only
  62224. // when fully selected.
  62225. if ( ( prevSelectedLink && !selectedLink ) ||
  62226. ( !prevSelectedLink && selectionParent !== prevSelectionParent ) ) {
  62227. this._hideUI();
  62228. }
  62229. // Update the position of the panel when:
  62230. // * link panel is in the visible stack
  62231. // * the selection remains in the original link element,
  62232. // * there was no link element in the first place, i.e. creating a new link
  62233. else if ( this._isUIVisible ) {
  62234. // If still in a link element, simply update the position of the balloon.
  62235. // If there was no link (e.g. inserting one), the balloon must be moved
  62236. // to the new position in the editing view (a new native DOM range).
  62237. this._balloon.updatePosition( this._getBalloonPositionData() );
  62238. }
  62239. prevSelectedLink = selectedLink;
  62240. prevSelectionParent = selectionParent;
  62241. };
  62242. function getSelectionParent() {
  62243. return viewDocument.selection.focus.getAncestors()
  62244. .reverse()
  62245. .find( node => node.is( 'element' ) );
  62246. }
  62247. this.listenTo( editor.ui, 'update', update );
  62248. this.listenTo( this._balloon, 'change:visibleView', update );
  62249. }
  62250. /**
  62251. * Returns `true` when {@link #formView} is in the {@link #_balloon}.
  62252. *
  62253. * @readonly
  62254. * @protected
  62255. * @type {Boolean}
  62256. */
  62257. get _isFormInPanel() {
  62258. return this._balloon.hasView( this.formView );
  62259. }
  62260. /**
  62261. * Returns `true` when {@link #actionsView} is in the {@link #_balloon}.
  62262. *
  62263. * @readonly
  62264. * @protected
  62265. * @type {Boolean}
  62266. */
  62267. get _areActionsInPanel() {
  62268. return this._balloon.hasView( this.actionsView );
  62269. }
  62270. /**
  62271. * Returns `true` when {@link #actionsView} is in the {@link #_balloon} and it is
  62272. * currently visible.
  62273. *
  62274. * @readonly
  62275. * @protected
  62276. * @type {Boolean}
  62277. */
  62278. get _areActionsVisible() {
  62279. return this._balloon.visibleView === this.actionsView;
  62280. }
  62281. /**
  62282. * Returns `true` when {@link #actionsView} or {@link #formView} is in the {@link #_balloon}.
  62283. *
  62284. * @readonly
  62285. * @protected
  62286. * @type {Boolean}
  62287. */
  62288. get _isUIInPanel() {
  62289. return this._isFormInPanel || this._areActionsInPanel;
  62290. }
  62291. /**
  62292. * Returns `true` when {@link #actionsView} or {@link #formView} is in the {@link #_balloon} and it is
  62293. * currently visible.
  62294. *
  62295. * @readonly
  62296. * @protected
  62297. * @type {Boolean}
  62298. */
  62299. get _isUIVisible() {
  62300. const visibleView = this._balloon.visibleView;
  62301. return visibleView == this.formView || this._areActionsVisible;
  62302. }
  62303. /**
  62304. * Returns positioning options for the {@link #_balloon}. They control the way the balloon is attached
  62305. * to the target element or selection.
  62306. *
  62307. * If the selection is collapsed and inside a link element, the panel will be attached to the
  62308. * entire link element. Otherwise, it will be attached to the selection.
  62309. *
  62310. * @private
  62311. * @returns {module:utils/dom/position~Options}
  62312. */
  62313. _getBalloonPositionData() {
  62314. const view = this.editor.editing.view;
  62315. const model = this.editor.model;
  62316. const viewDocument = view.document;
  62317. let target = null;
  62318. if ( model.markers.has( VISUAL_SELECTION_MARKER_NAME ) ) {
  62319. // There are cases when we highlight selection using a marker (#7705, #4721).
  62320. const markerViewElements = Array.from( this.editor.editing.mapper.markerNameToElements( VISUAL_SELECTION_MARKER_NAME ) );
  62321. const newRange = view.createRange(
  62322. view.createPositionBefore( markerViewElements[ 0 ] ),
  62323. view.createPositionAfter( markerViewElements[ markerViewElements.length - 1 ] )
  62324. );
  62325. target = view.domConverter.viewRangeToDom( newRange );
  62326. } else {
  62327. // Make sure the target is calculated on demand at the last moment because a cached DOM range
  62328. // (which is very fragile) can desynchronize with the state of the editing view if there was
  62329. // any rendering done in the meantime. This can happen, for instance, when an inline widget
  62330. // gets unlinked.
  62331. target = () => {
  62332. const targetLink = this._getSelectedLinkElement();
  62333. return targetLink ?
  62334. // When selection is inside link element, then attach panel to this element.
  62335. view.domConverter.mapViewToDom( targetLink ) :
  62336. // Otherwise attach panel to the selection.
  62337. view.domConverter.viewRangeToDom( viewDocument.selection.getFirstRange() );
  62338. };
  62339. }
  62340. return { target };
  62341. }
  62342. /**
  62343. * Returns the link {@link module:engine/view/attributeelement~AttributeElement} under
  62344. * the {@link module:engine/view/document~Document editing view's} selection or `null`
  62345. * if there is none.
  62346. *
  62347. * **Note**: For a non–collapsed selection, the link element is returned when **fully**
  62348. * selected and the **only** element within the selection boundaries, or when
  62349. * a linked widget is selected.
  62350. *
  62351. * @private
  62352. * @returns {module:engine/view/attributeelement~AttributeElement|null}
  62353. */
  62354. _getSelectedLinkElement() {
  62355. const view = this.editor.editing.view;
  62356. const selection = view.document.selection;
  62357. const selectedElement = selection.getSelectedElement();
  62358. // The selection is collapsed or some widget is selected (especially inline widget).
  62359. if ( selection.isCollapsed || selectedElement && Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_3__["isWidget"])( selectedElement ) ) {
  62360. return findLinkElementAncestor( selection.getFirstPosition() );
  62361. } else {
  62362. // The range for fully selected link is usually anchored in adjacent text nodes.
  62363. // Trim it to get closer to the actual link element.
  62364. const range = selection.getFirstRange().getTrimmed();
  62365. const startLink = findLinkElementAncestor( range.start );
  62366. const endLink = findLinkElementAncestor( range.end );
  62367. if ( !startLink || startLink != endLink ) {
  62368. return null;
  62369. }
  62370. // Check if the link element is fully selected.
  62371. if ( view.createRangeIn( startLink ).getTrimmed().isEqual( range ) ) {
  62372. return startLink;
  62373. } else {
  62374. return null;
  62375. }
  62376. }
  62377. }
  62378. /**
  62379. * Displays a fake visual selection when the contextual balloon is displayed.
  62380. *
  62381. * This adds a 'link-ui' marker into the document that is rendered as a highlight on selected text fragment.
  62382. *
  62383. * @private
  62384. */
  62385. _showFakeVisualSelection() {
  62386. const model = this.editor.model;
  62387. model.change( writer => {
  62388. const range = model.document.selection.getFirstRange();
  62389. if ( model.markers.has( VISUAL_SELECTION_MARKER_NAME ) ) {
  62390. writer.updateMarker( VISUAL_SELECTION_MARKER_NAME, { range } );
  62391. } else {
  62392. if ( range.start.isAtEnd ) {
  62393. const startPosition = range.start.getLastMatchingPosition(
  62394. ( { item } ) => !model.schema.isContent( item ),
  62395. { boundaries: range }
  62396. );
  62397. writer.addMarker( VISUAL_SELECTION_MARKER_NAME, {
  62398. usingOperation: false,
  62399. affectsData: false,
  62400. range: writer.createRange( startPosition, range.end )
  62401. } );
  62402. } else {
  62403. writer.addMarker( VISUAL_SELECTION_MARKER_NAME, {
  62404. usingOperation: false,
  62405. affectsData: false,
  62406. range
  62407. } );
  62408. }
  62409. }
  62410. } );
  62411. }
  62412. /**
  62413. * Hides the fake visual selection created in {@link #_showFakeVisualSelection}.
  62414. *
  62415. * @private
  62416. */
  62417. _hideFakeVisualSelection() {
  62418. const model = this.editor.model;
  62419. if ( model.markers.has( VISUAL_SELECTION_MARKER_NAME ) ) {
  62420. model.change( writer => {
  62421. writer.removeMarker( VISUAL_SELECTION_MARKER_NAME );
  62422. } );
  62423. }
  62424. }
  62425. }
  62426. // Returns a link element if there's one among the ancestors of the provided `Position`.
  62427. //
  62428. // @private
  62429. // @param {module:engine/view/position~Position} View position to analyze.
  62430. // @returns {module:engine/view/attributeelement~AttributeElement|null} Link element at the position or null.
  62431. function findLinkElementAncestor( position ) {
  62432. return position.getAncestors().find( ancestor => Object(_utils__WEBPACK_IMPORTED_MODULE_6__["isLinkElement"])( ancestor ) );
  62433. }
  62434. /***/ }),
  62435. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/ui/linkactionsview.js":
  62436. /*!*************************************************************************!*\
  62437. !*** ./node_modules/@ckeditor/ckeditor5-link/src/ui/linkactionsview.js ***!
  62438. \*************************************************************************/
  62439. /*! exports provided: default */
  62440. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62441. "use strict";
  62442. __webpack_require__.r(__webpack_exports__);
  62443. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkActionsView; });
  62444. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  62445. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  62446. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  62447. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  62448. /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css");
  62449. /* harmony import */ var _theme_linkactions_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/linkactions.css */ "./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css");
  62450. /* harmony import */ var _theme_icons_unlink_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme/icons/unlink.svg */ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/unlink.svg");
  62451. /**
  62452. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  62453. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62454. */
  62455. /**
  62456. * @module link/ui/linkactionsview
  62457. */
  62458. // See: #8833.
  62459. // eslint-disable-next-line ckeditor5-rules/ckeditor-imports
  62460. /**
  62461. * The link actions view class. This view displays the link preview, allows
  62462. * unlinking or editing the link.
  62463. *
  62464. * @extends module:ui/view~View
  62465. */
  62466. class LinkActionsView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"] {
  62467. /**
  62468. * @inheritDoc
  62469. */
  62470. constructor( locale ) {
  62471. super( locale );
  62472. const t = locale.t;
  62473. /**
  62474. * Tracks information about DOM focus in the actions.
  62475. *
  62476. * @readonly
  62477. * @member {module:utils/focustracker~FocusTracker}
  62478. */
  62479. this.focusTracker = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["FocusTracker"]();
  62480. /**
  62481. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  62482. *
  62483. * @readonly
  62484. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  62485. */
  62486. this.keystrokes = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["KeystrokeHandler"]();
  62487. /**
  62488. * The href preview view.
  62489. *
  62490. * @member {module:ui/view~View}
  62491. */
  62492. this.previewButtonView = this._createPreviewButton();
  62493. /**
  62494. * The unlink button view.
  62495. *
  62496. * @member {module:ui/button/buttonview~ButtonView}
  62497. */
  62498. this.unlinkButtonView = this._createButton( t( 'Unlink' ), _theme_icons_unlink_svg__WEBPACK_IMPORTED_MODULE_6__["default"], 'unlink' );
  62499. /**
  62500. * The edit link button view.
  62501. *
  62502. * @member {module:ui/button/buttonview~ButtonView}
  62503. */
  62504. this.editButtonView = this._createButton( t( 'Edit link' ), ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["icons"].pencil, 'edit' );
  62505. /**
  62506. * The value of the "href" attribute of the link to use in the {@link #previewButtonView}.
  62507. *
  62508. * @observable
  62509. * @member {String}
  62510. */
  62511. this.set( 'href' );
  62512. /**
  62513. * A collection of views that can be focused in the view.
  62514. *
  62515. * @readonly
  62516. * @protected
  62517. * @member {module:ui/viewcollection~ViewCollection}
  62518. */
  62519. this._focusables = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ViewCollection"]();
  62520. /**
  62521. * Helps cycling over {@link #_focusables} in the view.
  62522. *
  62523. * @readonly
  62524. * @protected
  62525. * @member {module:ui/focuscycler~FocusCycler}
  62526. */
  62527. this._focusCycler = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["FocusCycler"]( {
  62528. focusables: this._focusables,
  62529. focusTracker: this.focusTracker,
  62530. keystrokeHandler: this.keystrokes,
  62531. actions: {
  62532. // Navigate fields backwards using the Shift + Tab keystroke.
  62533. focusPrevious: 'shift + tab',
  62534. // Navigate fields forwards using the Tab key.
  62535. focusNext: 'tab'
  62536. }
  62537. } );
  62538. this.setTemplate( {
  62539. tag: 'div',
  62540. attributes: {
  62541. class: [
  62542. 'ck',
  62543. 'ck-link-actions',
  62544. 'ck-responsive-form'
  62545. ],
  62546. // https://github.com/ckeditor/ckeditor5-link/issues/90
  62547. tabindex: '-1'
  62548. },
  62549. children: [
  62550. this.previewButtonView,
  62551. this.editButtonView,
  62552. this.unlinkButtonView
  62553. ]
  62554. } );
  62555. }
  62556. /**
  62557. * @inheritDoc
  62558. */
  62559. render() {
  62560. super.render();
  62561. const childViews = [
  62562. this.previewButtonView,
  62563. this.editButtonView,
  62564. this.unlinkButtonView
  62565. ];
  62566. childViews.forEach( v => {
  62567. // Register the view as focusable.
  62568. this._focusables.add( v );
  62569. // Register the view in the focus tracker.
  62570. this.focusTracker.add( v.element );
  62571. } );
  62572. // Start listening for the keystrokes coming from #element.
  62573. this.keystrokes.listenTo( this.element );
  62574. }
  62575. /**
  62576. * @inheritDoc
  62577. */
  62578. destroy() {
  62579. super.destroy();
  62580. this.focusTracker.destroy();
  62581. this.keystrokes.destroy();
  62582. }
  62583. /**
  62584. * Focuses the fist {@link #_focusables} in the actions.
  62585. */
  62586. focus() {
  62587. this._focusCycler.focusFirst();
  62588. }
  62589. /**
  62590. * Creates a button view.
  62591. *
  62592. * @private
  62593. * @param {String} label The button label.
  62594. * @param {String} icon The button icon.
  62595. * @param {String} [eventName] An event name that the `ButtonView#execute` event will be delegated to.
  62596. * @returns {module:ui/button/buttonview~ButtonView} The button view instance.
  62597. */
  62598. _createButton( label, icon, eventName ) {
  62599. const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( this.locale );
  62600. button.set( {
  62601. label,
  62602. icon,
  62603. tooltip: true
  62604. } );
  62605. button.delegate( 'execute' ).to( this, eventName );
  62606. return button;
  62607. }
  62608. /**
  62609. * Creates a link href preview button.
  62610. *
  62611. * @private
  62612. * @returns {module:ui/button/buttonview~ButtonView} The button view instance.
  62613. */
  62614. _createPreviewButton() {
  62615. const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( this.locale );
  62616. const bind = this.bindTemplate;
  62617. const t = this.t;
  62618. button.set( {
  62619. withText: true,
  62620. tooltip: t( 'Open link in new tab' )
  62621. } );
  62622. button.extendTemplate( {
  62623. attributes: {
  62624. class: [
  62625. 'ck',
  62626. 'ck-link-actions__preview'
  62627. ],
  62628. href: bind.to( 'href', href => href && Object(_utils__WEBPACK_IMPORTED_MODULE_3__["ensureSafeUrl"])( href ) ),
  62629. target: '_blank',
  62630. rel: 'noopener noreferrer'
  62631. }
  62632. } );
  62633. button.bind( 'label' ).to( this, 'href', href => {
  62634. return href || t( 'This link has no URL' );
  62635. } );
  62636. button.bind( 'isEnabled' ).to( this, 'href', href => !!href );
  62637. button.template.tag = 'a';
  62638. button.template.eventListeners = {};
  62639. return button;
  62640. }
  62641. }
  62642. /**
  62643. * Fired when the {@link #editButtonView} is clicked.
  62644. *
  62645. * @event edit
  62646. */
  62647. /**
  62648. * Fired when the {@link #unlinkButtonView} is clicked.
  62649. *
  62650. * @event unlink
  62651. */
  62652. /***/ }),
  62653. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/ui/linkformview.js":
  62654. /*!**********************************************************************!*\
  62655. !*** ./node_modules/@ckeditor/ckeditor5-link/src/ui/linkformview.js ***!
  62656. \**********************************************************************/
  62657. /*! exports provided: default */
  62658. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62659. "use strict";
  62660. __webpack_require__.r(__webpack_exports__);
  62661. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkFormView; });
  62662. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  62663. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  62664. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  62665. /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css");
  62666. /* harmony import */ var _theme_linkform_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/linkform.css */ "./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css");
  62667. /**
  62668. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  62669. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62670. */
  62671. /**
  62672. * @module link/ui/linkformview
  62673. */
  62674. // See: #8833.
  62675. // eslint-disable-next-line ckeditor5-rules/ckeditor-imports
  62676. /**
  62677. * The link form view controller class.
  62678. *
  62679. * See {@link module:link/ui/linkformview~LinkFormView}.
  62680. *
  62681. * @extends module:ui/view~View
  62682. */
  62683. class LinkFormView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"] {
  62684. /**
  62685. * Creates an instance of the {@link module:link/ui/linkformview~LinkFormView} class.
  62686. *
  62687. * Also see {@link #render}.
  62688. *
  62689. * @param {module:utils/locale~Locale} [locale] The localization services instance.
  62690. * @param {module:link/linkcommand~LinkCommand} linkCommand Reference to {@link module:link/linkcommand~LinkCommand}.
  62691. * @param {String} [protocol] A value of a protocol to be displayed in the input's placeholder.
  62692. */
  62693. constructor( locale, linkCommand ) {
  62694. super( locale );
  62695. const t = locale.t;
  62696. /**
  62697. * Tracks information about DOM focus in the form.
  62698. *
  62699. * @readonly
  62700. * @member {module:utils/focustracker~FocusTracker}
  62701. */
  62702. this.focusTracker = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["FocusTracker"]();
  62703. /**
  62704. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  62705. *
  62706. * @readonly
  62707. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  62708. */
  62709. this.keystrokes = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["KeystrokeHandler"]();
  62710. /**
  62711. * The URL input view.
  62712. *
  62713. * @member {module:ui/labeledfield/labeledfieldview~LabeledFieldView}
  62714. */
  62715. this.urlInputView = this._createUrlInput();
  62716. /**
  62717. * The Save button view.
  62718. *
  62719. * @member {module:ui/button/buttonview~ButtonView}
  62720. */
  62721. this.saveButtonView = this._createButton( t( 'Save' ), ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["icons"].check, 'ck-button-save' );
  62722. this.saveButtonView.type = 'submit';
  62723. /**
  62724. * The Cancel button view.
  62725. *
  62726. * @member {module:ui/button/buttonview~ButtonView}
  62727. */
  62728. this.cancelButtonView = this._createButton( t( 'Cancel' ), ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["icons"].cancel, 'ck-button-cancel', 'cancel' );
  62729. /**
  62730. * A collection of {@link module:ui/button/switchbuttonview~SwitchButtonView},
  62731. * which corresponds to {@link module:link/linkcommand~LinkCommand#manualDecorators manual decorators}
  62732. * configured in the editor.
  62733. *
  62734. * @private
  62735. * @readonly
  62736. * @type {module:ui/viewcollection~ViewCollection}
  62737. */
  62738. this._manualDecoratorSwitches = this._createManualDecoratorSwitches( linkCommand );
  62739. /**
  62740. * A collection of child views in the form.
  62741. *
  62742. * @readonly
  62743. * @type {module:ui/viewcollection~ViewCollection}
  62744. */
  62745. this.children = this._createFormChildren( linkCommand.manualDecorators );
  62746. /**
  62747. * A collection of views that can be focused in the form.
  62748. *
  62749. * @readonly
  62750. * @protected
  62751. * @member {module:ui/viewcollection~ViewCollection}
  62752. */
  62753. this._focusables = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ViewCollection"]();
  62754. /**
  62755. * Helps cycling over {@link #_focusables} in the form.
  62756. *
  62757. * @readonly
  62758. * @protected
  62759. * @member {module:ui/focuscycler~FocusCycler}
  62760. */
  62761. this._focusCycler = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["FocusCycler"]( {
  62762. focusables: this._focusables,
  62763. focusTracker: this.focusTracker,
  62764. keystrokeHandler: this.keystrokes,
  62765. actions: {
  62766. // Navigate form fields backwards using the Shift + Tab keystroke.
  62767. focusPrevious: 'shift + tab',
  62768. // Navigate form fields forwards using the Tab key.
  62769. focusNext: 'tab'
  62770. }
  62771. } );
  62772. const classList = [ 'ck', 'ck-link-form', 'ck-responsive-form' ];
  62773. if ( linkCommand.manualDecorators.length ) {
  62774. classList.push( 'ck-link-form_layout-vertical', 'ck-vertical-form' );
  62775. }
  62776. this.setTemplate( {
  62777. tag: 'form',
  62778. attributes: {
  62779. class: classList,
  62780. // https://github.com/ckeditor/ckeditor5-link/issues/90
  62781. tabindex: '-1'
  62782. },
  62783. children: this.children
  62784. } );
  62785. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["injectCssTransitionDisabler"])( this );
  62786. }
  62787. /**
  62788. * Obtains the state of the {@link module:ui/button/switchbuttonview~SwitchButtonView switch buttons} representing
  62789. * {@link module:link/linkcommand~LinkCommand#manualDecorators manual link decorators}
  62790. * in the {@link module:link/ui/linkformview~LinkFormView}.
  62791. *
  62792. * @returns {Object.<String,Boolean>} Key-value pairs, where the key is the name of the decorator and the value is
  62793. * its state.
  62794. */
  62795. getDecoratorSwitchesState() {
  62796. return Array.from( this._manualDecoratorSwitches ).reduce( ( accumulator, switchButton ) => {
  62797. accumulator[ switchButton.name ] = switchButton.isOn;
  62798. return accumulator;
  62799. }, {} );
  62800. }
  62801. /**
  62802. * @inheritDoc
  62803. */
  62804. render() {
  62805. super.render();
  62806. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["submitHandler"])( {
  62807. view: this
  62808. } );
  62809. const childViews = [
  62810. this.urlInputView,
  62811. ...this._manualDecoratorSwitches,
  62812. this.saveButtonView,
  62813. this.cancelButtonView
  62814. ];
  62815. childViews.forEach( v => {
  62816. // Register the view as focusable.
  62817. this._focusables.add( v );
  62818. // Register the view in the focus tracker.
  62819. this.focusTracker.add( v.element );
  62820. } );
  62821. // Start listening for the keystrokes coming from #element.
  62822. this.keystrokes.listenTo( this.element );
  62823. }
  62824. /**
  62825. * @inheritDoc
  62826. */
  62827. destroy() {
  62828. super.destroy();
  62829. this.focusTracker.destroy();
  62830. this.keystrokes.destroy();
  62831. }
  62832. /**
  62833. * Focuses the fist {@link #_focusables} in the form.
  62834. */
  62835. focus() {
  62836. this._focusCycler.focusFirst();
  62837. }
  62838. /**
  62839. * Creates a labeled input view.
  62840. *
  62841. * @private
  62842. * @returns {module:ui/labeledfield/labeledfieldview~LabeledFieldView} Labeled field view instance.
  62843. */
  62844. _createUrlInput() {
  62845. const t = this.locale.t;
  62846. const labeledInput = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["LabeledFieldView"]( this.locale, ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["createLabeledInputText"] );
  62847. labeledInput.label = t( 'Link URL' );
  62848. return labeledInput;
  62849. }
  62850. /**
  62851. * Creates a button view.
  62852. *
  62853. * @private
  62854. * @param {String} label The button label.
  62855. * @param {String} icon The button icon.
  62856. * @param {String} className The additional button CSS class name.
  62857. * @param {String} [eventName] An event name that the `ButtonView#execute` event will be delegated to.
  62858. * @returns {module:ui/button/buttonview~ButtonView} The button view instance.
  62859. */
  62860. _createButton( label, icon, className, eventName ) {
  62861. const button = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]( this.locale );
  62862. button.set( {
  62863. label,
  62864. icon,
  62865. tooltip: true
  62866. } );
  62867. button.extendTemplate( {
  62868. attributes: {
  62869. class: className
  62870. }
  62871. } );
  62872. if ( eventName ) {
  62873. button.delegate( 'execute' ).to( this, eventName );
  62874. }
  62875. return button;
  62876. }
  62877. /**
  62878. * Populates {@link module:ui/viewcollection~ViewCollection} of {@link module:ui/button/switchbuttonview~SwitchButtonView}
  62879. * made based on {@link module:link/linkcommand~LinkCommand#manualDecorators}.
  62880. *
  62881. * @private
  62882. * @param {module:link/linkcommand~LinkCommand} linkCommand A reference to the link command.
  62883. * @returns {module:ui/viewcollection~ViewCollection} of switch buttons.
  62884. */
  62885. _createManualDecoratorSwitches( linkCommand ) {
  62886. const switches = this.createCollection();
  62887. for ( const manualDecorator of linkCommand.manualDecorators ) {
  62888. const switchButton = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["SwitchButtonView"]( this.locale );
  62889. switchButton.set( {
  62890. name: manualDecorator.id,
  62891. label: manualDecorator.label,
  62892. withText: true
  62893. } );
  62894. switchButton.bind( 'isOn' ).toMany( [ manualDecorator, linkCommand ], 'value', ( decoratorValue, commandValue ) => {
  62895. return commandValue === undefined && decoratorValue === undefined ? manualDecorator.defaultValue : decoratorValue;
  62896. } );
  62897. switchButton.on( 'execute', () => {
  62898. manualDecorator.set( 'value', !switchButton.isOn );
  62899. } );
  62900. switches.add( switchButton );
  62901. }
  62902. return switches;
  62903. }
  62904. /**
  62905. * Populates the {@link #children} collection of the form.
  62906. *
  62907. * If {@link module:link/linkcommand~LinkCommand#manualDecorators manual decorators} are configured in the editor, it creates an
  62908. * additional `View` wrapping all {@link #_manualDecoratorSwitches} switch buttons corresponding
  62909. * to these decorators.
  62910. *
  62911. * @private
  62912. * @param {module:utils/collection~Collection} manualDecorators A reference to
  62913. * the collection of manual decorators stored in the link command.
  62914. * @returns {module:ui/viewcollection~ViewCollection} The children of link form view.
  62915. */
  62916. _createFormChildren( manualDecorators ) {
  62917. const children = this.createCollection();
  62918. children.add( this.urlInputView );
  62919. if ( manualDecorators.length ) {
  62920. const additionalButtonsView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"]();
  62921. additionalButtonsView.setTemplate( {
  62922. tag: 'ul',
  62923. children: this._manualDecoratorSwitches.map( switchButton => ( {
  62924. tag: 'li',
  62925. children: [ switchButton ],
  62926. attributes: {
  62927. class: [
  62928. 'ck',
  62929. 'ck-list__item'
  62930. ]
  62931. }
  62932. } ) ),
  62933. attributes: {
  62934. class: [
  62935. 'ck',
  62936. 'ck-reset',
  62937. 'ck-list'
  62938. ]
  62939. }
  62940. } );
  62941. children.add( additionalButtonsView );
  62942. }
  62943. children.add( this.saveButtonView );
  62944. children.add( this.cancelButtonView );
  62945. return children;
  62946. }
  62947. }
  62948. /**
  62949. * Fired when the form view is submitted (when one of the children triggered the submit event),
  62950. * for example with a click on {@link #saveButtonView}.
  62951. *
  62952. * @event submit
  62953. */
  62954. /**
  62955. * Fired when the form view is canceled, for example with a click on {@link #cancelButtonView}.
  62956. *
  62957. * @event cancel
  62958. */
  62959. /***/ }),
  62960. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/unlinkcommand.js":
  62961. /*!********************************************************************!*\
  62962. !*** ./node_modules/@ckeditor/ckeditor5-link/src/unlinkcommand.js ***!
  62963. \********************************************************************/
  62964. /*! exports provided: default */
  62965. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62966. "use strict";
  62967. __webpack_require__.r(__webpack_exports__);
  62968. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UnlinkCommand; });
  62969. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  62970. /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
  62971. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  62972. /**
  62973. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  62974. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62975. */
  62976. /**
  62977. * @module link/unlinkcommand
  62978. */
  62979. /**
  62980. * The unlink command. It is used by the {@link module:link/link~Link link plugin}.
  62981. *
  62982. * @extends module:core/command~Command
  62983. */
  62984. class UnlinkCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  62985. /**
  62986. * @inheritDoc
  62987. */
  62988. refresh() {
  62989. const model = this.editor.model;
  62990. const selection = model.document.selection;
  62991. const selectedElement = selection.getSelectedElement();
  62992. // A check for any integration that allows linking elements (e.g. `LinkImage`).
  62993. // Currently the selection reads attributes from text nodes only. See #7429 and #7465.
  62994. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_2__["isLinkableElement"])( selectedElement, model.schema ) ) {
  62995. this.isEnabled = model.schema.checkAttribute( selectedElement, 'linkHref' );
  62996. } else {
  62997. this.isEnabled = model.schema.checkAttributeInSelection( selection, 'linkHref' );
  62998. }
  62999. }
  63000. /**
  63001. * Executes the command.
  63002. *
  63003. * When the selection is collapsed, it removes the `linkHref` attribute from each node with the same `linkHref` attribute value.
  63004. * When the selection is non-collapsed, it removes the `linkHref` attribute from each node in selected ranges.
  63005. *
  63006. * # Decorators
  63007. *
  63008. * If {@link module:link/link~LinkConfig#decorators `config.link.decorators`} is specified,
  63009. * all configured decorators are removed together with the `linkHref` attribute.
  63010. *
  63011. * @fires execute
  63012. */
  63013. execute() {
  63014. const editor = this.editor;
  63015. const model = this.editor.model;
  63016. const selection = model.document.selection;
  63017. const linkCommand = editor.commands.get( 'link' );
  63018. model.change( writer => {
  63019. // Get ranges to unlink.
  63020. const rangesToUnlink = selection.isCollapsed ?
  63021. [ Object(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__["findAttributeRange"])(
  63022. selection.getFirstPosition(),
  63023. 'linkHref',
  63024. selection.getAttribute( 'linkHref' ),
  63025. model
  63026. ) ] :
  63027. model.schema.getValidRanges( selection.getRanges(), 'linkHref' );
  63028. // Remove `linkHref` attribute from specified ranges.
  63029. for ( const range of rangesToUnlink ) {
  63030. writer.removeAttribute( 'linkHref', range );
  63031. // If there are registered custom attributes, then remove them during unlink.
  63032. if ( linkCommand ) {
  63033. for ( const manualDecorator of linkCommand.manualDecorators ) {
  63034. writer.removeAttribute( manualDecorator.id, range );
  63035. }
  63036. }
  63037. }
  63038. } );
  63039. }
  63040. }
  63041. /***/ }),
  63042. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js":
  63043. /*!************************************************************!*\
  63044. !*** ./node_modules/@ckeditor/ckeditor5-link/src/utils.js ***!
  63045. \************************************************************/
  63046. /*! exports provided: LINK_KEYSTROKE, isLinkElement, createLinkElement, ensureSafeUrl, getLocalizedDecorators, normalizeDecorators, isLinkableElement, isEmail, addLinkProtocolIfApplicable, openLink */
  63047. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63048. "use strict";
  63049. __webpack_require__.r(__webpack_exports__);
  63050. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LINK_KEYSTROKE", function() { return LINK_KEYSTROKE; });
  63051. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinkElement", function() { return isLinkElement; });
  63052. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLinkElement", function() { return createLinkElement; });
  63053. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureSafeUrl", function() { return ensureSafeUrl; });
  63054. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalizedDecorators", function() { return getLocalizedDecorators; });
  63055. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeDecorators", function() { return normalizeDecorators; });
  63056. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinkableElement", function() { return isLinkableElement; });
  63057. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmail", function() { return isEmail; });
  63058. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addLinkProtocolIfApplicable", function() { return addLinkProtocolIfApplicable; });
  63059. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "openLink", function() { return openLink; });
  63060. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  63061. /**
  63062. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  63063. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63064. */
  63065. /**
  63066. * @module link/utils
  63067. */
  63068. /* global window */
  63069. const ATTRIBUTE_WHITESPACES = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g; // eslint-disable-line no-control-regex
  63070. const SAFE_URL = /^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;
  63071. // Simplified email test - should be run over previously found URL.
  63072. const EMAIL_REG_EXP = /^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i;
  63073. // The regex checks for the protocol syntax ('xxxx://' or 'xxxx:')
  63074. // or non-word characters at the beginning of the link ('/', '#' etc.).
  63075. const PROTOCOL_REG_EXP = /^((\w+:(\/{2,})?)|(\W))/i;
  63076. /**
  63077. * A keystroke used by the {@link module:link/linkui~LinkUI link UI feature}.
  63078. */
  63079. const LINK_KEYSTROKE = 'Ctrl+K';
  63080. /**
  63081. * Returns `true` if a given view node is the link element.
  63082. *
  63083. * @param {module:engine/view/node~Node} node
  63084. * @returns {Boolean}
  63085. */
  63086. function isLinkElement( node ) {
  63087. return node.is( 'attributeElement' ) && !!node.getCustomProperty( 'link' );
  63088. }
  63089. /**
  63090. * Creates a link {@link module:engine/view/attributeelement~AttributeElement} with the provided `href` attribute.
  63091. *
  63092. * @param {String} href
  63093. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  63094. * @returns {module:engine/view/attributeelement~AttributeElement}
  63095. */
  63096. function createLinkElement( href, { writer } ) {
  63097. // Priority 5 - https://github.com/ckeditor/ckeditor5-link/issues/121.
  63098. const linkElement = writer.createAttributeElement( 'a', { href }, { priority: 5 } );
  63099. writer.setCustomProperty( 'link', true, linkElement );
  63100. return linkElement;
  63101. }
  63102. /**
  63103. * Returns a safe URL based on a given value.
  63104. *
  63105. * A URL is considered safe if it is safe for the user (does not contain any malicious code).
  63106. *
  63107. * If a URL is considered unsafe, a simple `"#"` is returned.
  63108. *
  63109. * @protected
  63110. * @param {*} url
  63111. * @returns {String} Safe URL.
  63112. */
  63113. function ensureSafeUrl( url ) {
  63114. url = String( url );
  63115. return isSafeUrl( url ) ? url : '#';
  63116. }
  63117. // Checks whether the given URL is safe for the user (does not contain any malicious code).
  63118. //
  63119. // @param {String} url URL to check.
  63120. function isSafeUrl( url ) {
  63121. const normalizedUrl = url.replace( ATTRIBUTE_WHITESPACES, '' );
  63122. return normalizedUrl.match( SAFE_URL );
  63123. }
  63124. /**
  63125. * Returns the {@link module:link/link~LinkConfig#decorators `config.link.decorators`} configuration processed
  63126. * to respect the locale of the editor, i.e. to display the {@link module:link/link~LinkDecoratorManualDefinition label}
  63127. * in the correct language.
  63128. *
  63129. * **Note**: Only the few most commonly used labels are translated automatically. Other labels should be manually
  63130. * translated in the {@link module:link/link~LinkConfig#decorators `config.link.decorators`} configuration.
  63131. *
  63132. * @param {module:utils/locale~Locale#t} t shorthand for {@link module:utils/locale~Locale#t Locale#t}
  63133. * @param {Array.<module:link/link~LinkDecoratorDefinition>} The decorator reference
  63134. * where the label values should be localized.
  63135. * @returns {Array.<module:link/link~LinkDecoratorDefinition>}
  63136. */
  63137. function getLocalizedDecorators( t, decorators ) {
  63138. const localizedDecoratorsLabels = {
  63139. 'Open in a new tab': t( 'Open in a new tab' ),
  63140. 'Downloadable': t( 'Downloadable' )
  63141. };
  63142. decorators.forEach( decorator => {
  63143. if ( decorator.label && localizedDecoratorsLabels[ decorator.label ] ) {
  63144. decorator.label = localizedDecoratorsLabels[ decorator.label ];
  63145. }
  63146. return decorator;
  63147. } );
  63148. return decorators;
  63149. }
  63150. /**
  63151. * Converts an object with defined decorators to a normalized array of decorators. The `id` key is added for each decorator and
  63152. * is used as the attribute's name in the model.
  63153. *
  63154. * @param {Object.<String, module:link/link~LinkDecoratorDefinition>} decorators
  63155. * @returns {Array.<module:link/link~LinkDecoratorDefinition>}
  63156. */
  63157. function normalizeDecorators( decorators ) {
  63158. const retArray = [];
  63159. if ( decorators ) {
  63160. for ( const [ key, value ] of Object.entries( decorators ) ) {
  63161. const decorator = Object.assign(
  63162. {},
  63163. value,
  63164. { id: `link${ Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["upperFirst"])( key ) }` }
  63165. );
  63166. retArray.push( decorator );
  63167. }
  63168. }
  63169. return retArray;
  63170. }
  63171. /**
  63172. * Returns `true` if the specified `element` can be linked (the element allows the `linkHref` attribute).
  63173. *
  63174. * @params {module:engine/model/element~Element|null} element
  63175. * @params {module:engine/model/schema~Schema} schema
  63176. * @returns {Boolean}
  63177. */
  63178. function isLinkableElement( element, schema ) {
  63179. if ( !element ) {
  63180. return false;
  63181. }
  63182. return schema.checkAttribute( element.name, 'linkHref' );
  63183. }
  63184. /**
  63185. * Returns `true` if the specified `value` is an email.
  63186. *
  63187. * @params {String} value
  63188. * @returns {Boolean}
  63189. */
  63190. function isEmail( value ) {
  63191. return EMAIL_REG_EXP.test( value );
  63192. }
  63193. /**
  63194. * Adds the protocol prefix to the specified `link` when:
  63195. *
  63196. * * it does not contain it already, and there is a {@link module:link/link~LinkConfig#defaultProtocol `defaultProtocol` }
  63197. * configuration value provided,
  63198. * * or the link is an email address.
  63199. *
  63200. *
  63201. * @params {String} link
  63202. * @params {String} defaultProtocol
  63203. * @returns {Boolean}
  63204. */
  63205. function addLinkProtocolIfApplicable( link, defaultProtocol ) {
  63206. const protocol = isEmail( link ) ? 'mailto:' : defaultProtocol;
  63207. const isProtocolNeeded = !!protocol && !PROTOCOL_REG_EXP.test( link );
  63208. return link && isProtocolNeeded ? protocol + link : link;
  63209. }
  63210. /**
  63211. * Opens the link in a new browser tab.
  63212. *
  63213. * @param {String} link
  63214. */
  63215. function openLink( link ) {
  63216. window.open( link, '_blank', 'noopener' );
  63217. }
  63218. /***/ }),
  63219. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/utils/automaticdecorators.js":
  63220. /*!********************************************************************************!*\
  63221. !*** ./node_modules/@ckeditor/ckeditor5-link/src/utils/automaticdecorators.js ***!
  63222. \********************************************************************************/
  63223. /*! exports provided: default */
  63224. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63225. "use strict";
  63226. __webpack_require__.r(__webpack_exports__);
  63227. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AutomaticDecorators; });
  63228. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  63229. /**
  63230. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  63231. * For licensing, see LICENSE.md.
  63232. */
  63233. /**
  63234. * @module link/utils
  63235. */
  63236. /**
  63237. * Helper class that ties together all {@link module:link/link~LinkDecoratorAutomaticDefinition} and provides
  63238. * the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement downcast dispatchers} for them.
  63239. */
  63240. class AutomaticDecorators {
  63241. constructor() {
  63242. /**
  63243. * Stores the definition of {@link module:link/link~LinkDecoratorAutomaticDefinition automatic decorators}.
  63244. * This data is used as a source for a downcast dispatcher to create a proper conversion to output data.
  63245. *
  63246. * @private
  63247. * @type {Set}
  63248. */
  63249. this._definitions = new Set();
  63250. }
  63251. /**
  63252. * Gives information about the number of decorators stored in the {@link module:link/utils~AutomaticDecorators} instance.
  63253. *
  63254. * @readonly
  63255. * @protected
  63256. * @type {Number}
  63257. */
  63258. get length() {
  63259. return this._definitions.size;
  63260. }
  63261. /**
  63262. * Adds automatic decorator objects or an array with them to be used during downcasting.
  63263. *
  63264. * @param {module:link/link~LinkDecoratorAutomaticDefinition|Array.<module:link/link~LinkDecoratorAutomaticDefinition>} item
  63265. * A configuration object of automatic rules for decorating links. It might also be an array of such objects.
  63266. */
  63267. add( item ) {
  63268. if ( Array.isArray( item ) ) {
  63269. item.forEach( item => this._definitions.add( item ) );
  63270. } else {
  63271. this._definitions.add( item );
  63272. }
  63273. }
  63274. /**
  63275. * Provides the conversion helper used in the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} method.
  63276. *
  63277. * @returns {Function} A dispatcher function used as conversion helper
  63278. * in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add}.
  63279. */
  63280. getDispatcher() {
  63281. return dispatcher => {
  63282. dispatcher.on( 'attribute:linkHref', ( evt, data, conversionApi ) => {
  63283. // There is only test as this behavior decorates links and
  63284. // it is run before dispatcher which actually consumes this node.
  63285. // This allows on writing own dispatcher with highest priority,
  63286. // which blocks both native converter and this additional decoration.
  63287. if ( !conversionApi.consumable.test( data.item, 'attribute:linkHref' ) ) {
  63288. return;
  63289. }
  63290. const viewWriter = conversionApi.writer;
  63291. const viewSelection = viewWriter.document.selection;
  63292. for ( const item of this._definitions ) {
  63293. const viewElement = viewWriter.createAttributeElement( 'a', item.attributes, {
  63294. priority: 5
  63295. } );
  63296. if ( item.classes ) {
  63297. viewWriter.addClass( item.classes, viewElement );
  63298. }
  63299. for ( const key in item.styles ) {
  63300. viewWriter.setStyle( key, item.styles[ key ], viewElement );
  63301. }
  63302. viewWriter.setCustomProperty( 'link', true, viewElement );
  63303. if ( item.callback( data.attributeNewValue ) ) {
  63304. if ( data.item.is( 'selection' ) ) {
  63305. viewWriter.wrap( viewSelection.getFirstRange(), viewElement );
  63306. } else {
  63307. viewWriter.wrap( conversionApi.mapper.toViewRange( data.range ), viewElement );
  63308. }
  63309. } else {
  63310. viewWriter.unwrap( conversionApi.mapper.toViewRange( data.range ), viewElement );
  63311. }
  63312. }
  63313. }, { priority: 'high' } );
  63314. };
  63315. }
  63316. /**
  63317. * Provides the conversion helper used in the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} method
  63318. * when linking images.
  63319. *
  63320. * @returns {Function} A dispatcher function used as conversion helper
  63321. * in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add}.
  63322. */
  63323. getDispatcherForLinkedImage() {
  63324. return dispatcher => {
  63325. dispatcher.on( 'attribute:linkHref:imageBlock', ( evt, data, { writer, mapper } ) => {
  63326. const viewFigure = mapper.toViewElement( data.item );
  63327. const linkInImage = Array.from( viewFigure.getChildren() ).find( child => child.name === 'a' );
  63328. for ( const item of this._definitions ) {
  63329. const attributes = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["toMap"])( item.attributes );
  63330. if ( item.callback( data.attributeNewValue ) ) {
  63331. for ( const [ key, val ] of attributes ) {
  63332. // Left for backward compatibility. Since v30 decorator should
  63333. // accept `classes` and `styles` separately from `attributes`.
  63334. if ( key === 'class' ) {
  63335. writer.addClass( val, linkInImage );
  63336. } else {
  63337. writer.setAttribute( key, val, linkInImage );
  63338. }
  63339. }
  63340. if ( item.classes ) {
  63341. writer.addClass( item.classes, linkInImage );
  63342. }
  63343. for ( const key in item.styles ) {
  63344. writer.setStyle( key, item.styles[ key ], linkInImage );
  63345. }
  63346. } else {
  63347. for ( const [ key, val ] of attributes ) {
  63348. if ( key === 'class' ) {
  63349. writer.removeClass( val, linkInImage );
  63350. } else {
  63351. writer.removeAttribute( key, linkInImage );
  63352. }
  63353. }
  63354. if ( item.classes ) {
  63355. writer.removeClass( item.classes, linkInImage );
  63356. }
  63357. for ( const key in item.styles ) {
  63358. writer.removeStyle( key, linkInImage );
  63359. }
  63360. }
  63361. }
  63362. } );
  63363. };
  63364. }
  63365. }
  63366. /***/ }),
  63367. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/utils/manualdecorator.js":
  63368. /*!****************************************************************************!*\
  63369. !*** ./node_modules/@ckeditor/ckeditor5-link/src/utils/manualdecorator.js ***!
  63370. \****************************************************************************/
  63371. /*! exports provided: default */
  63372. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63373. "use strict";
  63374. __webpack_require__.r(__webpack_exports__);
  63375. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ManualDecorator; });
  63376. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  63377. /**
  63378. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  63379. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63380. */
  63381. /**
  63382. * @module link/utils
  63383. */
  63384. /**
  63385. * Helper class that stores manual decorators with observable {@link module:link/utils~ManualDecorator#value}
  63386. * to support integration with the UI state. An instance of this class is a model with the state of individual manual decorators.
  63387. * These decorators are kept as collections in {@link module:link/linkcommand~LinkCommand#manualDecorators}.
  63388. *
  63389. * @mixes module:utils/observablemixin~ObservableMixin
  63390. */
  63391. class ManualDecorator {
  63392. /**
  63393. * Creates a new instance of {@link module:link/utils~ManualDecorator}.
  63394. *
  63395. * @param {Object} config
  63396. * @param {String} config.id The name of the attribute used in the model that represents a given manual decorator.
  63397. * For example: `'linkIsExternal'`.
  63398. * @param {String} config.label The label used in the user interface to toggle the manual decorator.
  63399. * @param {Object} config.attributes A set of attributes added to output data when the decorator is active for a specific link.
  63400. * Attributes should keep the format of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.
  63401. * @param {Boolean} [config.defaultValue] Controls whether the decorator is "on" by default.
  63402. */
  63403. constructor( { id, label, attributes, classes, styles, defaultValue } ) {
  63404. /**
  63405. * An ID of a manual decorator which is the name of the attribute in the model, for example: 'linkManualDecorator0'.
  63406. *
  63407. * @type {String}
  63408. */
  63409. this.id = id;
  63410. /**
  63411. * The value of the current manual decorator. It reflects its state from the UI.
  63412. *
  63413. * @observable
  63414. * @member {Boolean} module:link/utils~ManualDecorator#value
  63415. */
  63416. this.set( 'value' );
  63417. /**
  63418. * The default value of manual decorator.
  63419. *
  63420. * @type {Boolean}
  63421. */
  63422. this.defaultValue = defaultValue;
  63423. /**
  63424. * The label used in the user interface to toggle the manual decorator.
  63425. *
  63426. * @type {String}
  63427. */
  63428. this.label = label;
  63429. /**
  63430. * A set of attributes added to downcasted data when the decorator is activated for a specific link.
  63431. * Attributes should be added in a form of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.
  63432. *
  63433. * @type {Object}
  63434. */
  63435. this.attributes = attributes;
  63436. /**
  63437. * A set of classes added to downcasted data when the decorator is activated for a specific link.
  63438. * Classes should be added in a form of classes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.
  63439. *
  63440. * @type {Object}
  63441. */
  63442. this.classes = classes;
  63443. /**
  63444. * A set of styles added to downcasted data when the decorator is activated for a specific link.
  63445. * Styles should be added in a form of styles defined in {@link module:engine/view/elementdefinition~ElementDefinition}.
  63446. *
  63447. * @type {Object}
  63448. */
  63449. this.styles = styles;
  63450. }
  63451. /**
  63452. * Returns {@link module:engine/view/matcher~MatcherPattern} with decorator attributes.
  63453. *
  63454. * @protected
  63455. * @returns {module:engine/view/matcher~MatcherPattern}
  63456. */
  63457. _createPattern() {
  63458. return {
  63459. attributes: this.attributes,
  63460. classes: this.classes,
  63461. styles: this.styles
  63462. };
  63463. }
  63464. }
  63465. Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["mix"])( ManualDecorator, ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["ObservableMixin"] );
  63466. /***/ }),
  63467. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg":
  63468. /*!********************************************************************!*\
  63469. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg ***!
  63470. \********************************************************************/
  63471. /*! exports provided: default */
  63472. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63473. "use strict";
  63474. __webpack_require__.r(__webpack_exports__);
  63475. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184z\"/></svg>");
  63476. /***/ }),
  63477. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/unlink.svg":
  63478. /*!**********************************************************************!*\
  63479. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/icons/unlink.svg ***!
  63480. \**********************************************************************/
  63481. /*! exports provided: default */
  63482. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63483. "use strict";
  63484. __webpack_require__.r(__webpack_exports__);
  63485. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184zm4.919 10.562-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414z\"/></svg>");
  63486. /***/ }),
  63487. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/link.css":
  63488. /*!**************************************************************!*\
  63489. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/link.css ***!
  63490. \**************************************************************/
  63491. /*! exports provided: default */
  63492. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63493. "use strict";
  63494. __webpack_require__.r(__webpack_exports__);
  63495. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  63496. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  63497. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_link_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./link.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-link/theme/link.css");
  63498. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  63499. options.insert = "head";
  63500. options.singleton = true;
  63501. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_link_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  63502. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_link_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  63503. /***/ }),
  63504. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css":
  63505. /*!*********************************************************************!*\
  63506. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css ***!
  63507. \*********************************************************************/
  63508. /*! exports provided: default */
  63509. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63510. "use strict";
  63511. __webpack_require__.r(__webpack_exports__);
  63512. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  63513. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  63514. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_linkactions_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./linkactions.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css");
  63515. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  63516. options.insert = "head";
  63517. options.singleton = true;
  63518. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_linkactions_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  63519. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_linkactions_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  63520. /***/ }),
  63521. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css":
  63522. /*!******************************************************************!*\
  63523. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css ***!
  63524. \******************************************************************/
  63525. /*! exports provided: default */
  63526. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63527. "use strict";
  63528. __webpack_require__.r(__webpack_exports__);
  63529. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  63530. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  63531. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_linkform_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./linkform.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css");
  63532. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  63533. options.insert = "head";
  63534. options.singleton = true;
  63535. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_linkform_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  63536. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_linkform_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  63537. /***/ }),
  63538. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css":
  63539. /*!*******************************************************************!*\
  63540. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css ***!
  63541. \*******************************************************************/
  63542. /*! exports provided: default */
  63543. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63544. "use strict";
  63545. __webpack_require__.r(__webpack_exports__);
  63546. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  63547. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  63548. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_linkimage_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./linkimage.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css");
  63549. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  63550. options.insert = "head";
  63551. options.singleton = true;
  63552. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_linkimage_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  63553. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_linkimage_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  63554. /***/ }),
  63555. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/converters.js":
  63556. /*!*****************************************************************!*\
  63557. !*** ./node_modules/@ckeditor/ckeditor5-list/src/converters.js ***!
  63558. \*****************************************************************/
  63559. /*! exports provided: modelViewInsertion, modelViewRemove, modelViewChangeType, modelViewMergeAfterChangeType, modelViewChangeIndent, modelViewSplitOnInsert, modelViewMergeAfter, viewModelConverter, cleanList, cleanListItem, modelToViewPosition, viewToModelPosition, modelChangePostFixer, modelIndentPasteFixer */
  63560. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63561. "use strict";
  63562. __webpack_require__.r(__webpack_exports__);
  63563. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewInsertion", function() { return modelViewInsertion; });
  63564. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewRemove", function() { return modelViewRemove; });
  63565. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewChangeType", function() { return modelViewChangeType; });
  63566. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewMergeAfterChangeType", function() { return modelViewMergeAfterChangeType; });
  63567. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewChangeIndent", function() { return modelViewChangeIndent; });
  63568. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewSplitOnInsert", function() { return modelViewSplitOnInsert; });
  63569. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewMergeAfter", function() { return modelViewMergeAfter; });
  63570. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewModelConverter", function() { return viewModelConverter; });
  63571. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanList", function() { return cleanList; });
  63572. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanListItem", function() { return cleanListItem; });
  63573. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelToViewPosition", function() { return modelToViewPosition; });
  63574. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewToModelPosition", function() { return viewToModelPosition; });
  63575. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelChangePostFixer", function() { return modelChangePostFixer; });
  63576. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelIndentPasteFixer", function() { return modelIndentPasteFixer; });
  63577. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  63578. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-list/src/utils.js");
  63579. /**
  63580. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  63581. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63582. */
  63583. /**
  63584. * @module list/converters
  63585. */
  63586. /**
  63587. * A model-to-view converter for the `listItem` model element insertion.
  63588. *
  63589. * It creates a `<ul><li></li><ul>` (or `<ol>`) view structure out of a `listItem` model element, inserts it at the correct
  63590. * position, and merges the list with surrounding lists (if available).
  63591. *
  63592. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
  63593. * @param {module:engine/model/model~Model} model Model instance.
  63594. * @returns {Function} Returns a conversion callback.
  63595. */
  63596. function modelViewInsertion( model ) {
  63597. return ( evt, data, conversionApi ) => {
  63598. const consumable = conversionApi.consumable;
  63599. if ( !consumable.test( data.item, 'insert' ) ||
  63600. !consumable.test( data.item, 'attribute:listType' ) ||
  63601. !consumable.test( data.item, 'attribute:listIndent' )
  63602. ) {
  63603. return;
  63604. }
  63605. consumable.consume( data.item, 'insert' );
  63606. consumable.consume( data.item, 'attribute:listType' );
  63607. consumable.consume( data.item, 'attribute:listIndent' );
  63608. const modelItem = data.item;
  63609. const viewItem = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["generateLiInUl"])( modelItem, conversionApi );
  63610. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["injectViewList"])( modelItem, viewItem, conversionApi, model );
  63611. };
  63612. }
  63613. /**
  63614. * A model-to-view converter for the `listItem` model element removal.
  63615. *
  63616. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove
  63617. * @param {module:engine/model/model~Model} model Model instance.
  63618. * @returns {Function} Returns a conversion callback.
  63619. */
  63620. function modelViewRemove( model ) {
  63621. return ( evt, data, conversionApi ) => {
  63622. const viewPosition = conversionApi.mapper.toViewPosition( data.position );
  63623. const viewStart = viewPosition.getLastMatchingPosition( value => !value.item.is( 'element', 'li' ) );
  63624. const viewItem = viewStart.nodeAfter;
  63625. const viewWriter = conversionApi.writer;
  63626. // 1. Break the container after and before the list item.
  63627. // This will create a view list with one view list item - the one to remove.
  63628. viewWriter.breakContainer( viewWriter.createPositionBefore( viewItem ) );
  63629. viewWriter.breakContainer( viewWriter.createPositionAfter( viewItem ) );
  63630. // 2. Remove the list with the item to remove.
  63631. const viewList = viewItem.parent;
  63632. const viewListPrev = viewList.previousSibling;
  63633. const removeRange = viewWriter.createRangeOn( viewList );
  63634. const removed = viewWriter.remove( removeRange );
  63635. // 3. Merge the whole created by breaking and removing the list.
  63636. if ( viewListPrev && viewListPrev.nextSibling ) {
  63637. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, viewListPrev, viewListPrev.nextSibling );
  63638. }
  63639. // 4. Bring back nested list that was in the removed <li>.
  63640. const modelItem = conversionApi.mapper.toModelElement( viewItem );
  63641. hoistNestedLists( modelItem.getAttribute( 'listIndent' ) + 1, data.position, removeRange.start, viewItem, conversionApi, model );
  63642. // 5. Unbind removed view item and all children.
  63643. for ( const child of viewWriter.createRangeIn( removed ).getItems() ) {
  63644. conversionApi.mapper.unbindViewElement( child );
  63645. }
  63646. evt.stop();
  63647. };
  63648. }
  63649. /**
  63650. * A model-to-view converter for the `type` attribute change on the `listItem` model element.
  63651. *
  63652. * This change means that the `<li>` element parent changes from `<ul>` to `<ol>` (or vice versa). This is accomplished
  63653. * by breaking view elements and changing their name. The next {@link module:list/converters~modelViewMergeAfterChangeType}
  63654. * converter will attempt to merge split nodes.
  63655. *
  63656. * Splitting this conversion into 2 steps makes it possible to add an additional conversion in the middle.
  63657. * Check {@link module:list/todolistconverters~modelViewChangeType} to see an example of it.
  63658. *
  63659. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
  63660. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  63661. * @param {Object} data Additional information about the change.
  63662. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface.
  63663. */
  63664. function modelViewChangeType( evt, data, conversionApi ) {
  63665. if ( !conversionApi.consumable.consume( data.item, 'attribute:listType' ) ) {
  63666. return;
  63667. }
  63668. const viewItem = conversionApi.mapper.toViewElement( data.item );
  63669. const viewWriter = conversionApi.writer;
  63670. // Break the container after and before the list item.
  63671. // This will create a view list with one view list item -- the one that changed type.
  63672. viewWriter.breakContainer( viewWriter.createPositionBefore( viewItem ) );
  63673. viewWriter.breakContainer( viewWriter.createPositionAfter( viewItem ) );
  63674. // Change name of the view list that holds the changed view item.
  63675. // We cannot just change name property, because that would not render properly.
  63676. const viewList = viewItem.parent;
  63677. const listName = data.attributeNewValue == 'numbered' ? 'ol' : 'ul';
  63678. viewWriter.rename( listName, viewList );
  63679. }
  63680. /**
  63681. * A model-to-view converter that attempts to merge nodes split by {@link module:list/converters~modelViewChangeType}.
  63682. *
  63683. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
  63684. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  63685. * @param {Object} data Additional information about the change.
  63686. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface.
  63687. */
  63688. function modelViewMergeAfterChangeType( evt, data, conversionApi ) {
  63689. const viewItem = conversionApi.mapper.toViewElement( data.item );
  63690. const viewList = viewItem.parent;
  63691. const viewWriter = conversionApi.writer;
  63692. // Merge the changed view list with other lists, if possible.
  63693. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, viewList, viewList.nextSibling );
  63694. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, viewList.previousSibling, viewList );
  63695. // Consumable insertion of children inside the item. They are already handled by re-building the item in view.
  63696. for ( const child of data.item.getChildren() ) {
  63697. conversionApi.consumable.consume( child, 'insert' );
  63698. }
  63699. }
  63700. /**
  63701. * A model-to-view converter for the `listIndent` attribute change on the `listItem` model element.
  63702. *
  63703. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
  63704. * @param {module:engine/model/model~Model} model Model instance.
  63705. * @returns {Function} Returns a conversion callback.
  63706. */
  63707. function modelViewChangeIndent( model ) {
  63708. return ( evt, data, conversionApi ) => {
  63709. if ( !conversionApi.consumable.consume( data.item, 'attribute:listIndent' ) ) {
  63710. return;
  63711. }
  63712. const viewItem = conversionApi.mapper.toViewElement( data.item );
  63713. const viewWriter = conversionApi.writer;
  63714. // 1. Break the container after and before the list item.
  63715. // This will create a view list with one view list item -- the one that changed type.
  63716. viewWriter.breakContainer( viewWriter.createPositionBefore( viewItem ) );
  63717. viewWriter.breakContainer( viewWriter.createPositionAfter( viewItem ) );
  63718. // 2. Extract view list with changed view list item and merge "hole" possibly created by breaking and removing elements.
  63719. const viewList = viewItem.parent;
  63720. const viewListPrev = viewList.previousSibling;
  63721. const removeRange = viewWriter.createRangeOn( viewList );
  63722. viewWriter.remove( removeRange );
  63723. if ( viewListPrev && viewListPrev.nextSibling ) {
  63724. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, viewListPrev, viewListPrev.nextSibling );
  63725. }
  63726. // 3. Bring back nested list that was in the removed <li>.
  63727. hoistNestedLists( data.attributeOldValue + 1, data.range.start, removeRange.start, viewItem, conversionApi, model );
  63728. // 4. Inject view list like it is newly inserted.
  63729. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["injectViewList"])( data.item, viewItem, conversionApi, model );
  63730. // 5. Consume insertion of children inside the item. They are already handled by re-building the item in view.
  63731. for ( const child of data.item.getChildren() ) {
  63732. conversionApi.consumable.consume( child, 'insert' );
  63733. }
  63734. };
  63735. }
  63736. /**
  63737. * A special model-to-view converter introduced by the {@link module:list/list~List list feature}. This converter is fired for
  63738. * insert change of every model item, and should be fired before the actual converter. The converter checks whether the inserted
  63739. * model item is a non-`listItem` element. If it is, and it is inserted inside a view list, the converter breaks the
  63740. * list so the model element is inserted to the view parent element corresponding to its model parent element.
  63741. *
  63742. * The converter prevents such situations:
  63743. *
  63744. * // Model: // View:
  63745. * <listItem>foo</listItem> <ul>
  63746. * <listItem>bar</listItem> <li>foo</li>
  63747. * <li>bar</li>
  63748. * </ul>
  63749. *
  63750. * // After change: // Correct view guaranteed by this converter:
  63751. * <listItem>foo</listItem> <ul><li>foo</li></ul><p>xxx</p><ul><li>bar</li></ul>
  63752. * <paragraph>xxx</paragraph> // Instead of this wrong view state:
  63753. * <listItem>bar</listItem> <ul><li>foo</li><p>xxx</p><li>bar</li></ul>
  63754. *
  63755. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
  63756. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  63757. * @param {Object} data Additional information about the change.
  63758. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface.
  63759. */
  63760. function modelViewSplitOnInsert( evt, data, conversionApi ) {
  63761. if ( data.item.name != 'listItem' ) {
  63762. let viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
  63763. const viewWriter = conversionApi.writer;
  63764. const lists = [];
  63765. // Break multiple ULs/OLs if there are.
  63766. //
  63767. // Imagine following list:
  63768. //
  63769. // 1 --------
  63770. // 1.1 --------
  63771. // 1.1.1 --------
  63772. // 1.1.2 --------
  63773. // 1.1.3 --------
  63774. // 1.1.3.1 --------
  63775. // 1.2 --------
  63776. // 1.2.1 --------
  63777. // 2 --------
  63778. //
  63779. // Insert paragraph after item 1.1.1:
  63780. //
  63781. // 1 --------
  63782. // 1.1 --------
  63783. // 1.1.1 --------
  63784. //
  63785. // Lorem ipsum.
  63786. //
  63787. // 1.1.2 --------
  63788. // 1.1.3 --------
  63789. // 1.1.3.1 --------
  63790. // 1.2 --------
  63791. // 1.2.1 --------
  63792. // 2 --------
  63793. //
  63794. // In this case 1.1.2 has to become beginning of a new list.
  63795. // We need to break list before 1.1.2 (obvious), then we need to break list also before 1.2.
  63796. // Then we need to move those broken pieces one after another and merge:
  63797. //
  63798. // 1 --------
  63799. // 1.1 --------
  63800. // 1.1.1 --------
  63801. //
  63802. // Lorem ipsum.
  63803. //
  63804. // 1.1.2 --------
  63805. // 1.1.3 --------
  63806. // 1.1.3.1 --------
  63807. // 1.2 --------
  63808. // 1.2.1 --------
  63809. // 2 --------
  63810. //
  63811. while ( viewPosition.parent.name == 'ul' || viewPosition.parent.name == 'ol' ) {
  63812. viewPosition = viewWriter.breakContainer( viewPosition );
  63813. if ( viewPosition.parent.name != 'li' ) {
  63814. break;
  63815. }
  63816. // Remove lists that are after inserted element.
  63817. // They will be brought back later, below the inserted element.
  63818. const removeStart = viewPosition;
  63819. const removeEnd = viewWriter.createPositionAt( viewPosition.parent, 'end' );
  63820. // Don't remove if there is nothing to remove.
  63821. if ( !removeStart.isEqual( removeEnd ) ) {
  63822. const removed = viewWriter.remove( viewWriter.createRange( removeStart, removeEnd ) );
  63823. lists.push( removed );
  63824. }
  63825. viewPosition = viewWriter.createPositionAfter( viewPosition.parent );
  63826. }
  63827. // Bring back removed lists.
  63828. if ( lists.length > 0 ) {
  63829. for ( let i = 0; i < lists.length; i++ ) {
  63830. const previousList = viewPosition.nodeBefore;
  63831. const insertedRange = viewWriter.insert( viewPosition, lists[ i ] );
  63832. viewPosition = insertedRange.end;
  63833. // Don't merge first list! We want a split in that place (this is why this converter is introduced).
  63834. if ( i > 0 ) {
  63835. const mergePos = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, previousList, previousList.nextSibling );
  63836. // If `mergePos` is in `previousList` it means that the lists got merged.
  63837. // In this case, we need to fix insert position.
  63838. if ( mergePos && mergePos.parent == previousList ) {
  63839. viewPosition.offset--;
  63840. }
  63841. }
  63842. }
  63843. // Merge last inserted list with element after it.
  63844. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, viewPosition.nodeBefore, viewPosition.nodeAfter );
  63845. }
  63846. }
  63847. }
  63848. /**
  63849. * A special model-to-view converter introduced by the {@link module:list/list~List list feature}. This converter takes care of
  63850. * merging view lists after something is removed or moved from near them.
  63851. *
  63852. * Example:
  63853. *
  63854. * // Model: // View:
  63855. * <listItem>foo</listItem> <ul><li>foo</li></ul>
  63856. * <paragraph>xxx</paragraph> <p>xxx</p>
  63857. * <listItem>bar</listItem> <ul><li>bar</li></ul>
  63858. *
  63859. * // After change: // Correct view guaranteed by this converter:
  63860. * <listItem>foo</listItem> <ul>
  63861. * <listItem>bar</listItem> <li>foo</li>
  63862. * <li>bar</li>
  63863. * </ul>
  63864. *
  63865. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove
  63866. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  63867. * @param {Object} data Additional information about the change.
  63868. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface.
  63869. */
  63870. function modelViewMergeAfter( evt, data, conversionApi ) {
  63871. const viewPosition = conversionApi.mapper.toViewPosition( data.position );
  63872. const viewItemPrev = viewPosition.nodeBefore;
  63873. const viewItemNext = viewPosition.nodeAfter;
  63874. // Merge lists if something (remove, move) was done from inside of list.
  63875. // Merging will be done only if both items are view lists of the same type.
  63876. // The check is done inside the helper function.
  63877. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( conversionApi.writer, viewItemPrev, viewItemNext );
  63878. }
  63879. /**
  63880. * A view-to-model converter that converts the `<li>` view elements into the `listItem` model elements.
  63881. *
  63882. * To set correct values of the `listType` and `listIndent` attributes the converter:
  63883. * * checks `<li>`'s parent,
  63884. * * stores and increases the `conversionApi.store.indent` value when `<li>`'s sub-items are converted.
  63885. *
  63886. * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
  63887. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  63888. * @param {Object} data An object containing conversion input and a placeholder for conversion output and possibly other values.
  63889. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface to be used by the callback.
  63890. */
  63891. function viewModelConverter( evt, data, conversionApi ) {
  63892. if ( conversionApi.consumable.consume( data.viewItem, { name: true } ) ) {
  63893. const writer = conversionApi.writer;
  63894. // 1. Create `listItem` model element.
  63895. const listItem = writer.createElement( 'listItem' );
  63896. // 2. Handle `listItem` model element attributes.
  63897. const indent = getIndent( data.viewItem );
  63898. writer.setAttribute( 'listIndent', indent, listItem );
  63899. // Set 'bulleted' as default. If this item is pasted into a context,
  63900. const type = data.viewItem.parent && data.viewItem.parent.name == 'ol' ? 'numbered' : 'bulleted';
  63901. writer.setAttribute( 'listType', type, listItem );
  63902. if ( !conversionApi.safeInsert( listItem, data.modelCursor ) ) {
  63903. return;
  63904. }
  63905. const nextPosition = viewToModelListItemChildrenConverter( listItem, data.viewItem.getChildren(), conversionApi );
  63906. // Result range starts before the first item and ends after the last.
  63907. data.modelRange = writer.createRange( data.modelCursor, nextPosition );
  63908. conversionApi.updateConversionResult( listItem, data );
  63909. }
  63910. }
  63911. /**
  63912. * A view-to-model converter for the `<ul>` and `<ol>` view elements that cleans the input view of garbage.
  63913. * This is mostly to clean whitespaces from between the `<li>` view elements inside the view list element, however, also
  63914. * incorrect data can be cleared if the view was incorrect.
  63915. *
  63916. * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
  63917. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  63918. * @param {Object} data An object containing conversion input and a placeholder for conversion output and possibly other values.
  63919. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface to be used by the callback.
  63920. */
  63921. function cleanList( evt, data, conversionApi ) {
  63922. if ( conversionApi.consumable.test( data.viewItem, { name: true } ) ) {
  63923. // Caching children because when we start removing them iterating fails.
  63924. const children = Array.from( data.viewItem.getChildren() );
  63925. for ( const child of children ) {
  63926. const isWrongElement = !( child.is( 'element', 'li' ) || isList( child ) );
  63927. if ( isWrongElement ) {
  63928. child._remove();
  63929. }
  63930. }
  63931. }
  63932. }
  63933. /**
  63934. * A view-to-model converter for the `<li>` elements that cleans whitespace formatting from the input view.
  63935. *
  63936. * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
  63937. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  63938. * @param {Object} data An object containing conversion input and a placeholder for conversion output and possibly other values.
  63939. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface to be used by the callback.
  63940. */
  63941. function cleanListItem( evt, data, conversionApi ) {
  63942. if ( conversionApi.consumable.test( data.viewItem, { name: true } ) ) {
  63943. if ( data.viewItem.childCount === 0 ) {
  63944. return;
  63945. }
  63946. const children = [ ...data.viewItem.getChildren() ];
  63947. let foundList = false;
  63948. for ( const child of children ) {
  63949. if ( foundList && !isList( child ) ) {
  63950. child._remove();
  63951. }
  63952. if ( isList( child ) ) {
  63953. // If this is a <ul> or <ol>, do not process it, just mark that we already visited list element.
  63954. foundList = true;
  63955. }
  63956. }
  63957. }
  63958. }
  63959. /**
  63960. * Returns a callback for model position to view position mapping for {@link module:engine/conversion/mapper~Mapper}. The callback fixes
  63961. * positions between the `listItem` elements that would be incorrectly mapped because of how list items are represented in the model
  63962. * and in the view.
  63963. *
  63964. * @see module:engine/conversion/mapper~Mapper#event:modelToViewPosition
  63965. * @param {module:engine/view/view~View} view A view instance.
  63966. * @returns {Function}
  63967. */
  63968. function modelToViewPosition( view ) {
  63969. return ( evt, data ) => {
  63970. if ( data.isPhantom ) {
  63971. return;
  63972. }
  63973. const modelItem = data.modelPosition.nodeBefore;
  63974. if ( modelItem && modelItem.is( 'element', 'listItem' ) ) {
  63975. const viewItem = data.mapper.toViewElement( modelItem );
  63976. const topmostViewList = viewItem.getAncestors().find( isList );
  63977. const walker = view.createPositionAt( viewItem, 0 ).getWalker();
  63978. for ( const value of walker ) {
  63979. if ( value.type == 'elementStart' && value.item.is( 'element', 'li' ) ) {
  63980. data.viewPosition = value.previousPosition;
  63981. break;
  63982. } else if ( value.type == 'elementEnd' && value.item == topmostViewList ) {
  63983. data.viewPosition = value.nextPosition;
  63984. break;
  63985. }
  63986. }
  63987. }
  63988. };
  63989. }
  63990. /**
  63991. * The callback for view position to model position mapping for {@link module:engine/conversion/mapper~Mapper}. The callback fixes
  63992. * positions between the `<li>` elements that would be incorrectly mapped because of how list items are represented in the model
  63993. * and in the view.
  63994. *
  63995. * @see module:engine/conversion/mapper~Mapper#event:viewToModelPosition
  63996. * @param {module:engine/model/model~Model} model Model instance.
  63997. * @returns {Function} Returns a conversion callback.
  63998. */
  63999. function viewToModelPosition( model ) {
  64000. return ( evt, data ) => {
  64001. const viewPos = data.viewPosition;
  64002. const viewParent = viewPos.parent;
  64003. const mapper = data.mapper;
  64004. if ( viewParent.name == 'ul' || viewParent.name == 'ol' ) {
  64005. // Position is directly in <ul> or <ol>.
  64006. if ( !viewPos.isAtEnd ) {
  64007. // If position is not at the end, it must be before <li>.
  64008. // Get that <li>, map it to `listItem` and set model position before that `listItem`.
  64009. const modelNode = mapper.toModelElement( viewPos.nodeAfter );
  64010. data.modelPosition = model.createPositionBefore( modelNode );
  64011. } else {
  64012. // Position is at the end of <ul> or <ol>, so there is no <li> after it to be mapped.
  64013. // There is <li> before the position, but we cannot just map it to `listItem` and set model position after it,
  64014. // because that <li> may contain nested items.
  64015. // We will check "model length" of that <li>, in other words - how many `listItem`s are in that <li>.
  64016. const modelNode = mapper.toModelElement( viewPos.nodeBefore );
  64017. const modelLength = mapper.getModelLength( viewPos.nodeBefore );
  64018. // Then we get model position before mapped `listItem` and shift it accordingly.
  64019. data.modelPosition = model.createPositionBefore( modelNode ).getShiftedBy( modelLength );
  64020. }
  64021. evt.stop();
  64022. } else if (
  64023. viewParent.name == 'li' &&
  64024. viewPos.nodeBefore &&
  64025. ( viewPos.nodeBefore.name == 'ul' || viewPos.nodeBefore.name == 'ol' )
  64026. ) {
  64027. // In most cases when view position is in <li> it is in text and this is a correct position.
  64028. // However, if position is after <ul> or <ol> we have to fix it -- because in model <ul>/<ol> are not in the `listItem`.
  64029. const modelNode = mapper.toModelElement( viewParent );
  64030. // Check all <ul>s and <ol>s that are in the <li> but before mapped position.
  64031. // Get model length of those elements and then add it to the offset of `listItem` mapped to the original <li>.
  64032. let modelLength = 1; // Starts from 1 because the original <li> has to be counted in too.
  64033. let viewList = viewPos.nodeBefore;
  64034. while ( viewList && isList( viewList ) ) {
  64035. modelLength += mapper.getModelLength( viewList );
  64036. viewList = viewList.previousSibling;
  64037. }
  64038. data.modelPosition = model.createPositionBefore( modelNode ).getShiftedBy( modelLength );
  64039. evt.stop();
  64040. }
  64041. };
  64042. }
  64043. /**
  64044. * Post-fixer that reacts to changes on document and fixes incorrect model states.
  64045. *
  64046. * In the example below, there is a correct list structure.
  64047. * Then the middle element is removed so the list structure will become incorrect:
  64048. *
  64049. * <listItem listType="bulleted" listIndent=0>Item 1</listItem>
  64050. * <listItem listType="bulleted" listIndent=1>Item 2</listItem> <--- this is removed.
  64051. * <listItem listType="bulleted" listIndent=2>Item 3</listItem>
  64052. *
  64053. * The list structure after the middle element is removed:
  64054. *
  64055. * <listItem listType="bulleted" listIndent=0>Item 1</listItem>
  64056. * <listItem listType="bulleted" listIndent=2>Item 3</listItem>
  64057. *
  64058. * Should become:
  64059. *
  64060. * <listItem listType="bulleted" listIndent=0>Item 1</listItem>
  64061. * <listItem listType="bulleted" listIndent=1>Item 3</listItem> <--- note that indent got post-fixed.
  64062. *
  64063. * @param {module:engine/model/model~Model} model The data model.
  64064. * @param {module:engine/model/writer~Writer} writer The writer to do changes with.
  64065. * @returns {Boolean} `true` if any change has been applied, `false` otherwise.
  64066. */
  64067. function modelChangePostFixer( model, writer ) {
  64068. const changes = model.document.differ.getChanges();
  64069. const itemToListHead = new Map();
  64070. let applied = false;
  64071. for ( const entry of changes ) {
  64072. if ( entry.type == 'insert' && entry.name == 'listItem' ) {
  64073. _addListToFix( entry.position );
  64074. } else if ( entry.type == 'insert' && entry.name != 'listItem' ) {
  64075. if ( entry.name != '$text' ) {
  64076. // In case of renamed element.
  64077. const item = entry.position.nodeAfter;
  64078. if ( item.hasAttribute( 'listIndent' ) ) {
  64079. writer.removeAttribute( 'listIndent', item );
  64080. applied = true;
  64081. }
  64082. if ( item.hasAttribute( 'listType' ) ) {
  64083. writer.removeAttribute( 'listType', item );
  64084. applied = true;
  64085. }
  64086. if ( item.hasAttribute( 'listStyle' ) ) {
  64087. writer.removeAttribute( 'listStyle', item );
  64088. applied = true;
  64089. }
  64090. for ( const innerItem of Array.from( model.createRangeIn( item ) ).filter( e => e.item.is( 'element', 'listItem' ) ) ) {
  64091. _addListToFix( innerItem.previousPosition );
  64092. }
  64093. }
  64094. const posAfter = entry.position.getShiftedBy( entry.length );
  64095. _addListToFix( posAfter );
  64096. } else if ( entry.type == 'remove' && entry.name == 'listItem' ) {
  64097. _addListToFix( entry.position );
  64098. } else if ( entry.type == 'attribute' && entry.attributeKey == 'listIndent' ) {
  64099. _addListToFix( entry.range.start );
  64100. } else if ( entry.type == 'attribute' && entry.attributeKey == 'listType' ) {
  64101. _addListToFix( entry.range.start );
  64102. }
  64103. }
  64104. for ( const listHead of itemToListHead.values() ) {
  64105. _fixListIndents( listHead );
  64106. _fixListTypes( listHead );
  64107. }
  64108. return applied;
  64109. function _addListToFix( position ) {
  64110. const previousNode = position.nodeBefore;
  64111. if ( !previousNode || !previousNode.is( 'element', 'listItem' ) ) {
  64112. const item = position.nodeAfter;
  64113. if ( item && item.is( 'element', 'listItem' ) ) {
  64114. itemToListHead.set( item, item );
  64115. }
  64116. } else {
  64117. let listHead = previousNode;
  64118. if ( itemToListHead.has( listHead ) ) {
  64119. return;
  64120. }
  64121. for (
  64122. // Cache previousSibling and reuse for performance reasons. See #6581.
  64123. let previousSibling = listHead.previousSibling;
  64124. previousSibling && previousSibling.is( 'element', 'listItem' );
  64125. previousSibling = listHead.previousSibling
  64126. ) {
  64127. listHead = previousSibling;
  64128. if ( itemToListHead.has( listHead ) ) {
  64129. return;
  64130. }
  64131. }
  64132. itemToListHead.set( previousNode, listHead );
  64133. }
  64134. }
  64135. function _fixListIndents( item ) {
  64136. let maxIndent = 0;
  64137. let fixBy = null;
  64138. while ( item && item.is( 'element', 'listItem' ) ) {
  64139. const itemIndent = item.getAttribute( 'listIndent' );
  64140. if ( itemIndent > maxIndent ) {
  64141. let newIndent;
  64142. if ( fixBy === null ) {
  64143. fixBy = itemIndent - maxIndent;
  64144. newIndent = maxIndent;
  64145. } else {
  64146. if ( fixBy > itemIndent ) {
  64147. fixBy = itemIndent;
  64148. }
  64149. newIndent = itemIndent - fixBy;
  64150. }
  64151. writer.setAttribute( 'listIndent', newIndent, item );
  64152. applied = true;
  64153. } else {
  64154. fixBy = null;
  64155. maxIndent = item.getAttribute( 'listIndent' ) + 1;
  64156. }
  64157. item = item.nextSibling;
  64158. }
  64159. }
  64160. function _fixListTypes( item ) {
  64161. let typesStack = [];
  64162. let prev = null;
  64163. while ( item && item.is( 'element', 'listItem' ) ) {
  64164. const itemIndent = item.getAttribute( 'listIndent' );
  64165. if ( prev && prev.getAttribute( 'listIndent' ) > itemIndent ) {
  64166. typesStack = typesStack.slice( 0, itemIndent + 1 );
  64167. }
  64168. if ( itemIndent != 0 ) {
  64169. if ( typesStack[ itemIndent ] ) {
  64170. const type = typesStack[ itemIndent ];
  64171. if ( item.getAttribute( 'listType' ) != type ) {
  64172. writer.setAttribute( 'listType', type, item );
  64173. applied = true;
  64174. }
  64175. } else {
  64176. typesStack[ itemIndent ] = item.getAttribute( 'listType' );
  64177. }
  64178. }
  64179. prev = item;
  64180. item = item.nextSibling;
  64181. }
  64182. }
  64183. }
  64184. /**
  64185. * A fixer for pasted content that includes list items.
  64186. *
  64187. * It fixes indentation of pasted list items so the pasted items match correctly to the context they are pasted into.
  64188. *
  64189. * Example:
  64190. *
  64191. * <listItem listType="bulleted" listIndent=0>A</listItem>
  64192. * <listItem listType="bulleted" listIndent=1>B^</listItem>
  64193. * // At ^ paste: <listItem listType="bulleted" listIndent=4>X</listItem>
  64194. * // <listItem listType="bulleted" listIndent=5>Y</listItem>
  64195. * <listItem listType="bulleted" listIndent=2>C</listItem>
  64196. *
  64197. * Should become:
  64198. *
  64199. * <listItem listType="bulleted" listIndent=0>A</listItem>
  64200. * <listItem listType="bulleted" listIndent=1>BX</listItem>
  64201. * <listItem listType="bulleted" listIndent=2>Y/listItem>
  64202. * <listItem listType="bulleted" listIndent=2>C</listItem>
  64203. *
  64204. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  64205. * @param {Array} args Arguments of {@link module:engine/model/model~Model#insertContent}.
  64206. */
  64207. function modelIndentPasteFixer( evt, [ content, selectable ] ) {
  64208. // Check whether inserted content starts from a `listItem`. If it does not, it means that there are some other
  64209. // elements before it and there is no need to fix indents, because even if we insert that content into a list,
  64210. // that list will be broken.
  64211. // Note: we also need to handle singular elements because inserting item with indent 0 into 0,1,[],2
  64212. // would create incorrect model.
  64213. let item = content.is( 'documentFragment' ) ? content.getChild( 0 ) : content;
  64214. let selection;
  64215. if ( !selectable ) {
  64216. selection = this.document.selection;
  64217. } else {
  64218. selection = this.createSelection( selectable );
  64219. }
  64220. if ( item && item.is( 'element', 'listItem' ) ) {
  64221. // Get a reference list item. Inserted list items will be fixed according to that item.
  64222. const pos = selection.getFirstPosition();
  64223. let refItem = null;
  64224. if ( pos.parent.is( 'element', 'listItem' ) ) {
  64225. refItem = pos.parent;
  64226. } else if ( pos.nodeBefore && pos.nodeBefore.is( 'element', 'listItem' ) ) {
  64227. refItem = pos.nodeBefore;
  64228. }
  64229. // If there is `refItem` it means that we do insert list items into an existing list.
  64230. if ( refItem ) {
  64231. // First list item in `data` has indent equal to 0 (it is a first list item). It should have indent equal
  64232. // to the indent of reference item. We have to fix the first item and all of it's children and following siblings.
  64233. // Indent of all those items has to be adjusted to reference item.
  64234. const indentChange = refItem.getAttribute( 'listIndent' );
  64235. // Fix only if there is anything to fix.
  64236. if ( indentChange > 0 ) {
  64237. // Adjust indent of all "first" list items in inserted data.
  64238. while ( item && item.is( 'element', 'listItem' ) ) {
  64239. item._setAttribute( 'listIndent', item.getAttribute( 'listIndent' ) + indentChange );
  64240. item = item.nextSibling;
  64241. }
  64242. }
  64243. }
  64244. }
  64245. }
  64246. // Helper function that converts children of a given `<li>` view element into corresponding model elements.
  64247. // The function maintains proper order of elements if model `listItem` is split during the conversion
  64248. // due to block children conversion.
  64249. //
  64250. // @param {module:engine/model/element~Element} listItemModel List item model element to which converted children will be inserted.
  64251. // @param {Iterable.<module:engine/view/node~Node>} viewChildren View elements which will be converted.
  64252. // @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface to be used by the callback.
  64253. // @returns {module:engine/model/position~Position} Position on which next elements should be inserted after children conversion.
  64254. function viewToModelListItemChildrenConverter( listItemModel, viewChildren, conversionApi ) {
  64255. const { writer, schema } = conversionApi;
  64256. // A position after the last inserted `listItem`.
  64257. let nextPosition = writer.createPositionAfter( listItemModel );
  64258. // Check all children of the converted `<li>`. At this point we assume there are no "whitespace" view text nodes
  64259. // in view list, between view list items. This should be handled by `<ul>` and `<ol>` converters.
  64260. for ( const child of viewChildren ) {
  64261. if ( child.name == 'ul' || child.name == 'ol' ) {
  64262. // If the children is a list, we will insert its conversion result after currently handled `listItem`.
  64263. // Then, next insertion position will be set after all the new list items (and maybe other elements if
  64264. // something split list item).
  64265. //
  64266. // If this is a list, we expect that some `listItem`s and possibly other blocks will be inserted, however `.modelCursor`
  64267. // should be set after last `listItem` (or block). This is why it feels safe to use it as `nextPosition`
  64268. nextPosition = conversionApi.convertItem( child, nextPosition ).modelCursor;
  64269. } else {
  64270. // If this is not a list, try inserting content at the end of the currently handled `listItem`.
  64271. const result = conversionApi.convertItem( child, writer.createPositionAt( listItemModel, 'end' ) );
  64272. // It may end up that the current `listItem` becomes split (if that content cannot be inside `listItem`). For example:
  64273. //
  64274. // <li><p>Foo</p></li>
  64275. //
  64276. // will be converted to:
  64277. //
  64278. // <listItem></listItem><paragraph>Foo</paragraph><listItem></listItem>
  64279. //
  64280. const convertedChild = result.modelRange.start.nodeAfter;
  64281. const wasSplit = convertedChild && convertedChild.is( 'element' ) && !schema.checkChild( listItemModel, convertedChild.name );
  64282. if ( wasSplit ) {
  64283. // As `lastListItem` got split, we need to update it to the second part of the split `listItem` element.
  64284. //
  64285. // `modelCursor` should be set to a position where the conversion should continue. There are multiple possible scenarios
  64286. // that may happen. Usually, `modelCursor` (marked as `#` below) would point to the second list item after conversion:
  64287. //
  64288. // `<li><p>Foo</p></li>` -> `<listItem></listItem><paragraph>Foo</paragraph><listItem>#</listItem>`
  64289. //
  64290. // However, in some cases, like auto-paragraphing, the position is placed at the end of the block element:
  64291. //
  64292. // `<li><div>Foo</div></li>` -> `<listItem></listItem><paragraph>Foo#</paragraph><listItem></listItem>`
  64293. //
  64294. // or after an element if another element broken auto-paragraphed element:
  64295. //
  64296. // `<li><div><h2>Foo</h2></div></li>` -> `<listItem></listItem><heading1>Foo</heading1>#<listItem></listItem>`
  64297. //
  64298. // We need to check for such cases and use proper list item and position based on it.
  64299. //
  64300. if ( result.modelCursor.parent.is( 'element', 'listItem' ) ) {
  64301. // (1).
  64302. listItemModel = result.modelCursor.parent;
  64303. } else {
  64304. // (2), (3).
  64305. listItemModel = findNextListItem( result.modelCursor );
  64306. }
  64307. nextPosition = writer.createPositionAfter( listItemModel );
  64308. }
  64309. }
  64310. }
  64311. return nextPosition;
  64312. }
  64313. // Helper function that seeks for a next list item starting from given `startPosition`.
  64314. function findNextListItem( startPosition ) {
  64315. const treeWalker = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["TreeWalker"]( { startPosition } );
  64316. let value;
  64317. do {
  64318. value = treeWalker.next();
  64319. } while ( !value.value.item.is( 'element', 'listItem' ) );
  64320. return value.value.item;
  64321. }
  64322. // Helper function that takes all children of given `viewRemovedItem` and moves them in a correct place, according
  64323. // to other given parameters.
  64324. function hoistNestedLists( nextIndent, modelRemoveStartPosition, viewRemoveStartPosition, viewRemovedItem, conversionApi, model ) {
  64325. // Find correct previous model list item element.
  64326. // The element has to have either same or smaller indent than given reference indent.
  64327. // This will be the model element which will get nested items (if it has smaller indent) or sibling items (if it has same indent).
  64328. // Keep in mind that such element might not be found, if removed item was the first item.
  64329. const prevModelItem = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getSiblingListItem"])( modelRemoveStartPosition.nodeBefore, {
  64330. sameIndent: true,
  64331. smallerIndent: true,
  64332. listIndent: nextIndent,
  64333. foo: 'b'
  64334. } );
  64335. const mapper = conversionApi.mapper;
  64336. const viewWriter = conversionApi.writer;
  64337. // Indent of found element or `null` if the element has not been found.
  64338. const prevIndent = prevModelItem ? prevModelItem.getAttribute( 'listIndent' ) : null;
  64339. let insertPosition;
  64340. if ( !prevModelItem ) {
  64341. // If element has not been found, simply insert lists at the position where the removed item was:
  64342. //
  64343. // Lorem ipsum.
  64344. // 1 -------- <--- this is removed, no previous list item, put nested items in place of removed item.
  64345. // 1.1 -------- <--- this is reference indent.
  64346. // 1.1.1 --------
  64347. // 1.1.2 --------
  64348. // 1.2 --------
  64349. //
  64350. // Becomes:
  64351. //
  64352. // Lorem ipsum.
  64353. // 1.1 --------
  64354. // 1.1.1 --------
  64355. // 1.1.2 --------
  64356. // 1.2 --------
  64357. insertPosition = viewRemoveStartPosition;
  64358. } else if ( prevIndent == nextIndent ) {
  64359. // If element has been found and has same indent as reference indent it means that nested items should
  64360. // become siblings of found element:
  64361. //
  64362. // 1 --------
  64363. // 1.1 --------
  64364. // 1.2 -------- <--- this is `prevModelItem`.
  64365. // 2 -------- <--- this is removed, previous list item has indent same as reference indent.
  64366. // 2.1 -------- <--- this is reference indent, this and 2.2 should become siblings of 1.2.
  64367. // 2.2 --------
  64368. //
  64369. // Becomes:
  64370. //
  64371. // 1 --------
  64372. // 1.1 --------
  64373. // 1.2 --------
  64374. // 2.1 --------
  64375. // 2.2 --------
  64376. const prevViewList = mapper.toViewElement( prevModelItem ).parent;
  64377. insertPosition = viewWriter.createPositionAfter( prevViewList );
  64378. } else {
  64379. // If element has been found and has smaller indent as reference indent it means that nested items
  64380. // should become nested items of found item:
  64381. //
  64382. // 1 -------- <--- this is `prevModelItem`.
  64383. // 1.1 -------- <--- this is removed, previous list item has indent smaller than reference indent.
  64384. // 1.1.1 -------- <--- this is reference indent, this and 1.1.1 should become nested items of 1.
  64385. // 1.1.2 --------
  64386. // 1.2 --------
  64387. //
  64388. // Becomes:
  64389. //
  64390. // 1 --------
  64391. // 1.1.1 --------
  64392. // 1.1.2 --------
  64393. // 1.2 --------
  64394. //
  64395. // Note: in this case 1.1.1 have indent 2 while 1 have indent 0. In model that should not be possible,
  64396. // because following item may have indent bigger only by one. But this is fixed by postfixer.
  64397. const modelPosition = model.createPositionAt( prevModelItem, 'end' );
  64398. insertPosition = mapper.toViewPosition( modelPosition );
  64399. }
  64400. insertPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["positionAfterUiElements"])( insertPosition );
  64401. // Handle multiple lists. This happens if list item has nested numbered and bulleted lists. Following lists
  64402. // are inserted after the first list (no need to recalculate insertion position for them).
  64403. for ( const child of [ ...viewRemovedItem.getChildren() ] ) {
  64404. if ( isList( child ) ) {
  64405. insertPosition = viewWriter.move( viewWriter.createRangeOn( child ), insertPosition ).end;
  64406. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, child, child.nextSibling );
  64407. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["mergeViewLists"])( viewWriter, child.previousSibling, child );
  64408. }
  64409. }
  64410. }
  64411. // Checks if view element is a list type (ul or ol).
  64412. //
  64413. // @param {module:engine/view/element~Element} viewElement
  64414. // @returns {Boolean}
  64415. function isList( viewElement ) {
  64416. return viewElement.is( 'element', 'ol' ) || viewElement.is( 'element', 'ul' );
  64417. }
  64418. // Calculates the indent value for a list item. Handles HTML compliant and non-compliant lists.
  64419. //
  64420. // Also, fixes non HTML compliant lists indents:
  64421. //
  64422. // before: fixed list:
  64423. // OL OL
  64424. // |-> LI (parent LIs: 0) |-> LI (indent: 0)
  64425. // |-> OL |-> OL
  64426. // |-> OL |
  64427. // | |-> OL |
  64428. // | |-> OL |
  64429. // | |-> LI (parent LIs: 1) |-> LI (indent: 1)
  64430. // |-> LI (parent LIs: 1) |-> LI (indent: 1)
  64431. //
  64432. // before: fixed list:
  64433. // OL OL
  64434. // |-> OL |
  64435. // |-> OL |
  64436. // |-> OL |
  64437. // |-> LI (parent LIs: 0) |-> LI (indent: 0)
  64438. //
  64439. // before: fixed list:
  64440. // OL OL
  64441. // |-> LI (parent LIs: 0) |-> LI (indent: 0)
  64442. // |-> OL |-> OL
  64443. // |-> LI (parent LIs: 0) |-> LI (indent: 1)
  64444. //
  64445. // @param {module:engine/view/element~Element} listItem
  64446. // @param {Object} conversionStore
  64447. // @returns {Number}
  64448. function getIndent( listItem ) {
  64449. let indent = 0;
  64450. let parent = listItem.parent;
  64451. while ( parent ) {
  64452. // Each LI in the tree will result in an increased indent for HTML compliant lists.
  64453. if ( parent.is( 'element', 'li' ) ) {
  64454. indent++;
  64455. } else {
  64456. // If however the list is nested in other list we should check previous sibling of any of the list elements...
  64457. const previousSibling = parent.previousSibling;
  64458. // ...because the we might need increase its indent:
  64459. // before: fixed list:
  64460. // OL OL
  64461. // |-> LI (parent LIs: 0) |-> LI (indent: 0)
  64462. // |-> OL |-> OL
  64463. // |-> LI (parent LIs: 0) |-> LI (indent: 1)
  64464. if ( previousSibling && previousSibling.is( 'element', 'li' ) ) {
  64465. indent++;
  64466. }
  64467. }
  64468. parent = parent.parent;
  64469. }
  64470. return indent;
  64471. }
  64472. /***/ }),
  64473. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/indentcommand.js":
  64474. /*!********************************************************************!*\
  64475. !*** ./node_modules/@ckeditor/ckeditor5-list/src/indentcommand.js ***!
  64476. \********************************************************************/
  64477. /*! exports provided: default */
  64478. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64479. "use strict";
  64480. __webpack_require__.r(__webpack_exports__);
  64481. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return IndentCommand; });
  64482. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  64483. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  64484. /**
  64485. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  64486. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64487. */
  64488. /**
  64489. * @module list/indentcommand
  64490. */
  64491. /**
  64492. * The list indent command. It is used by the {@link module:list/list~List list feature}.
  64493. *
  64494. * @extends module:core/command~Command
  64495. */
  64496. class IndentCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  64497. /**
  64498. * Creates an instance of the command.
  64499. *
  64500. * @param {module:core/editor/editor~Editor} editor The editor instance.
  64501. * @param {'forward'|'backward'} indentDirection The direction of indent. If it is equal to `backward`, the command
  64502. * will outdent a list item.
  64503. */
  64504. constructor( editor, indentDirection ) {
  64505. super( editor );
  64506. /**
  64507. * Determines by how much the command will change the list item's indent attribute.
  64508. *
  64509. * @readonly
  64510. * @private
  64511. * @member {Number}
  64512. */
  64513. this._indentBy = indentDirection == 'forward' ? 1 : -1;
  64514. }
  64515. /**
  64516. * @inheritDoc
  64517. */
  64518. refresh() {
  64519. this.isEnabled = this._checkEnabled();
  64520. }
  64521. /**
  64522. * Indents or outdents (depending on the {@link #constructor}'s `indentDirection` parameter) selected list items.
  64523. *
  64524. * @fires execute
  64525. * @fires _executeCleanup
  64526. */
  64527. execute() {
  64528. const model = this.editor.model;
  64529. const doc = model.document;
  64530. let itemsToChange = Array.from( doc.selection.getSelectedBlocks() );
  64531. model.change( writer => {
  64532. const lastItem = itemsToChange[ itemsToChange.length - 1 ];
  64533. // Indenting a list item should also indent all the items that are already sub-items of indented item.
  64534. let next = lastItem.nextSibling;
  64535. // Check all items after last indented item, as long as their indent is bigger than indent of that item.
  64536. while ( next && next.name == 'listItem' && next.getAttribute( 'listIndent' ) > lastItem.getAttribute( 'listIndent' ) ) {
  64537. itemsToChange.push( next );
  64538. next = next.nextSibling;
  64539. }
  64540. // We need to be sure to keep model in correct state after each small change, because converters
  64541. // bases on that state and assumes that model is correct.
  64542. // Because of that, if the command outdents items, we will outdent them starting from the last item, as
  64543. // it is safer.
  64544. if ( this._indentBy < 0 ) {
  64545. itemsToChange = itemsToChange.reverse();
  64546. }
  64547. for ( const item of itemsToChange ) {
  64548. const indent = item.getAttribute( 'listIndent' ) + this._indentBy;
  64549. // If indent is lower than 0, it means that the item got outdented when it was not indented.
  64550. // This means that we need to convert that list item to paragraph.
  64551. if ( indent < 0 ) {
  64552. // To keep the model as correct as possible, first rename listItem, then remove attributes,
  64553. // as listItem without attributes is very incorrect and will cause problems in converters.
  64554. // No need to remove attributes, will be removed by post fixer.
  64555. writer.rename( item, 'paragraph' );
  64556. }
  64557. // If indent is >= 0, change the attribute value.
  64558. else {
  64559. writer.setAttribute( 'listIndent', indent, item );
  64560. }
  64561. }
  64562. /**
  64563. * Event fired by the {@link #execute} method.
  64564. *
  64565. * It allows to execute an action after executing the {@link ~IndentCommand#execute} method, for example adjusting
  64566. * attributes of changed list items.
  64567. *
  64568. * @protected
  64569. * @event _executeCleanup
  64570. */
  64571. this.fire( '_executeCleanup', itemsToChange );
  64572. } );
  64573. }
  64574. /**
  64575. * Checks whether the command can be enabled in the current context.
  64576. *
  64577. * @private
  64578. * @returns {Boolean} Whether the command should be enabled.
  64579. */
  64580. _checkEnabled() {
  64581. // Check whether any of position's ancestor is a list item.
  64582. const listItem = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this.editor.model.document.selection.getSelectedBlocks() );
  64583. // If selection is not in a list item, the command is disabled.
  64584. if ( !listItem || !listItem.is( 'element', 'listItem' ) ) {
  64585. return false;
  64586. }
  64587. if ( this._indentBy > 0 ) {
  64588. // Cannot indent first item in it's list. Check if before `listItem` is a list item that is in same list.
  64589. // To be in the same list, the item has to have same attributes and cannot be "split" by an item with lower indent.
  64590. const indent = listItem.getAttribute( 'listIndent' );
  64591. const type = listItem.getAttribute( 'listType' );
  64592. let prev = listItem.previousSibling;
  64593. while ( prev && prev.is( 'element', 'listItem' ) && prev.getAttribute( 'listIndent' ) >= indent ) {
  64594. if ( prev.getAttribute( 'listIndent' ) == indent ) {
  64595. // The item is on the same level.
  64596. // If it has same type, it means that we found a preceding sibling from the same list.
  64597. // If it does not have same type, it means that `listItem` is on different list (this can happen only
  64598. // on top level lists, though).
  64599. return prev.getAttribute( 'listType' ) == type;
  64600. }
  64601. prev = prev.previousSibling;
  64602. }
  64603. // Could not find similar list item, this means that `listItem` is first in its list.
  64604. return false;
  64605. }
  64606. // If we are outdenting it is enough to be in list item. Every list item can always be outdented.
  64607. return true;
  64608. }
  64609. }
  64610. /***/ }),
  64611. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/list.js":
  64612. /*!***********************************************************!*\
  64613. !*** ./node_modules/@ckeditor/ckeditor5-list/src/list.js ***!
  64614. \***********************************************************/
  64615. /*! exports provided: default */
  64616. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64617. "use strict";
  64618. __webpack_require__.r(__webpack_exports__);
  64619. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return List; });
  64620. /* harmony import */ var _listediting__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./listediting */ "./node_modules/@ckeditor/ckeditor5-list/src/listediting.js");
  64621. /* harmony import */ var _listui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./listui */ "./node_modules/@ckeditor/ckeditor5-list/src/listui.js");
  64622. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  64623. /**
  64624. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  64625. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64626. */
  64627. /**
  64628. * @module list/list
  64629. */
  64630. /**
  64631. * The list feature.
  64632. *
  64633. * This is a "glue" plugin that loads the {@link module:list/listediting~ListEditing list editing feature}
  64634. * and {@link module:list/listui~ListUI list UI feature}.
  64635. *
  64636. * @extends module:core/plugin~Plugin
  64637. */
  64638. class List extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["Plugin"] {
  64639. /**
  64640. * @inheritDoc
  64641. */
  64642. static get requires() {
  64643. return [ _listediting__WEBPACK_IMPORTED_MODULE_0__["default"], _listui__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  64644. }
  64645. /**
  64646. * @inheritDoc
  64647. */
  64648. static get pluginName() {
  64649. return 'List';
  64650. }
  64651. }
  64652. /***/ }),
  64653. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/listcommand.js":
  64654. /*!******************************************************************!*\
  64655. !*** ./node_modules/@ckeditor/ckeditor5-list/src/listcommand.js ***!
  64656. \******************************************************************/
  64657. /*! exports provided: default */
  64658. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64659. "use strict";
  64660. __webpack_require__.r(__webpack_exports__);
  64661. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListCommand; });
  64662. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  64663. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  64664. /**
  64665. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  64666. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64667. */
  64668. /**
  64669. * @module list/listcommand
  64670. */
  64671. /**
  64672. * The list command. It is used by the {@link module:list/list~List list feature}.
  64673. *
  64674. * @extends module:core/command~Command
  64675. */
  64676. class ListCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  64677. /**
  64678. * Creates an instance of the command.
  64679. *
  64680. * @param {module:core/editor/editor~Editor} editor The editor instance.
  64681. * @param {'numbered'|'bulleted'} type List type that will be handled by this command.
  64682. */
  64683. constructor( editor, type ) {
  64684. super( editor );
  64685. /**
  64686. * The type of the list created by the command.
  64687. *
  64688. * @readonly
  64689. * @member {'numbered'|'bulleted'|'todo'}
  64690. */
  64691. this.type = type;
  64692. /**
  64693. * A flag indicating whether the command is active, which means that the selection starts in a list of the same type.
  64694. *
  64695. * @observable
  64696. * @readonly
  64697. * @member {Boolean} #value
  64698. */
  64699. }
  64700. /**
  64701. * @inheritDoc
  64702. */
  64703. refresh() {
  64704. this.value = this._getValue();
  64705. this.isEnabled = this._checkEnabled();
  64706. }
  64707. /**
  64708. * Executes the list command.
  64709. *
  64710. * @fires execute
  64711. * @param {Object} [options] Command options.
  64712. * @param {Boolean} [options.forceValue] If set, it will force the command behavior. If `true`, the command will try to convert the
  64713. * selected items and potentially the neighbor elements to the proper list items. If set to `false` it will convert selected elements
  64714. * to paragraphs. If not set, the command will toggle selected elements to list items or paragraphs, depending on the selection.
  64715. */
  64716. execute( options = {} ) {
  64717. const model = this.editor.model;
  64718. const document = model.document;
  64719. const blocks = Array.from( document.selection.getSelectedBlocks() )
  64720. .filter( block => checkCanBecomeListItem( block, model.schema ) );
  64721. // Whether we are turning off some items.
  64722. const turnOff = options.forceValue !== undefined ? !options.forceValue : this.value;
  64723. // If we are turning off items, we are going to rename them to paragraphs.
  64724. model.change( writer => {
  64725. // If part of a list got turned off, we need to handle (outdent) all of sub-items of the last turned-off item.
  64726. // To be sure that model is all the time in a good state, we first fix items below turned-off item.
  64727. if ( turnOff ) {
  64728. // Start from the model item that is just after the last turned-off item.
  64729. let next = blocks[ blocks.length - 1 ].nextSibling;
  64730. let currentIndent = Number.POSITIVE_INFINITY;
  64731. let changes = [];
  64732. // Correct indent of all items after the last turned off item.
  64733. // Rules that should be followed:
  64734. // 1. All direct sub-items of turned-off item should become indent 0, because the first item after it
  64735. // will be the first item of a new list. Other items are at the same level, so should have same 0 index.
  64736. // 2. All items with indent lower than indent of turned-off item should become indent 0, because they
  64737. // should not end up as a child of any of list items that they were not children of before.
  64738. // 3. All other items should have their indent changed relatively to it's parent.
  64739. //
  64740. // For example:
  64741. // 1 * --------
  64742. // 2 * --------
  64743. // 3 * -------- <-- this is turned off.
  64744. // 4 * -------- <-- this has to become indent = 0, because it will be first item on a new list.
  64745. // 5 * -------- <-- this should be still be a child of item above, so indent = 1.
  64746. // 6 * -------- <-- this has to become indent = 0, because it should not be a child of any of items above.
  64747. // 7 * -------- <-- this should be still be a child of item above, so indent = 1.
  64748. // 8 * -------- <-- this has to become indent = 0.
  64749. // 9 * -------- <-- this should still be a child of item above, so indent = 1.
  64750. // 10 * -------- <-- this should still be a child of item above, so indent = 2.
  64751. // 11 * -------- <-- this should still be at the same level as item above, so indent = 2.
  64752. // 12 * -------- <-- this and all below are left unchanged.
  64753. // 13 * --------
  64754. // 14 * --------
  64755. //
  64756. // After turning off 3 the list becomes:
  64757. //
  64758. // 1 * --------
  64759. // 2 * --------
  64760. //
  64761. // 3 --------
  64762. //
  64763. // 4 * --------
  64764. // 5 * --------
  64765. // 6 * --------
  64766. // 7 * --------
  64767. // 8 * --------
  64768. // 9 * --------
  64769. // 10 * --------
  64770. // 11 * --------
  64771. // 12 * --------
  64772. // 13 * --------
  64773. // 14 * --------
  64774. //
  64775. // Thanks to this algorithm no lists are mismatched and no items get unexpected children/parent, while
  64776. // those parent-child connection which are possible to maintain are still maintained. It's worth noting
  64777. // that this is the same effect that we would be get by multiple use of outdent command. However doing
  64778. // it like this is much more efficient because it's less operation (less memory usage, easier OT) and
  64779. // less conversion (faster).
  64780. while ( next && next.name == 'listItem' && next.getAttribute( 'listIndent' ) !== 0 ) {
  64781. // Check each next list item, as long as its indent is bigger than 0.
  64782. // If the indent is 0 we are not going to change anything anyway.
  64783. const indent = next.getAttribute( 'listIndent' );
  64784. // We check if that's item indent is lower as current relative indent.
  64785. if ( indent < currentIndent ) {
  64786. // If it is, current relative indent becomes that indent.
  64787. currentIndent = indent;
  64788. }
  64789. // Fix indent relatively to current relative indent.
  64790. // Note, that if we just changed the current relative indent, the newIndent will be equal to 0.
  64791. const newIndent = indent - currentIndent;
  64792. // Save the entry in changes array. We do not apply it at the moment, because we will need to
  64793. // reverse the changes so the last item is changed first.
  64794. // This is to keep model in correct state all the time.
  64795. changes.push( { element: next, listIndent: newIndent } );
  64796. // Find next item.
  64797. next = next.nextSibling;
  64798. }
  64799. changes = changes.reverse();
  64800. for ( const item of changes ) {
  64801. writer.setAttribute( 'listIndent', item.listIndent, item.element );
  64802. }
  64803. }
  64804. // If we are turning on, we might change some items that are already `listItem`s but with different type.
  64805. // Changing one nested list item to other type should also trigger changing all its siblings so the
  64806. // whole nested list is of the same type.
  64807. // Example (assume changing to numbered list):
  64808. // * ------ <-- do not fix, top level item
  64809. // * ------ <-- fix, because latter list item of this item's list is changed
  64810. // * ------ <-- do not fix, item is not affected (different list)
  64811. // * ------ <-- fix, because latter list item of this item's list is changed
  64812. // * ------ <-- fix, because latter list item of this item's list is changed
  64813. // * ---[-- <-- already in selection
  64814. // * ------ <-- already in selection
  64815. // * ------ <-- already in selection
  64816. // * ------ <-- already in selection, but does not cause other list items to change because is top-level
  64817. // * ---]-- <-- already in selection
  64818. // * ------ <-- fix, because preceding list item of this item's list is changed
  64819. // * ------ <-- do not fix, item is not affected (different list)
  64820. // * ------ <-- do not fix, top level item
  64821. if ( !turnOff ) {
  64822. // Find lowest indent among selected items. This will be indicator what is the indent of
  64823. // top-most list affected by the command.
  64824. let lowestIndent = Number.POSITIVE_INFINITY;
  64825. for ( const item of blocks ) {
  64826. if ( item.is( 'element', 'listItem' ) && item.getAttribute( 'listIndent' ) < lowestIndent ) {
  64827. lowestIndent = item.getAttribute( 'listIndent' );
  64828. }
  64829. }
  64830. // Do not execute the fix for top-level lists.
  64831. lowestIndent = lowestIndent === 0 ? 1 : lowestIndent;
  64832. // Fix types of list items that are "before" the selected blocks.
  64833. _fixType( blocks, true, lowestIndent );
  64834. // Fix types of list items that are "after" the selected blocks.
  64835. _fixType( blocks, false, lowestIndent );
  64836. }
  64837. // Phew! Now it will be easier :).
  64838. // For each block element that was in the selection, we will either: turn it to list item,
  64839. // turn it to paragraph, or change it's type. Or leave it as it is.
  64840. // Do it in reverse as there might be multiple blocks (same as with changing indents).
  64841. for ( const element of blocks.reverse() ) {
  64842. if ( turnOff && element.name == 'listItem' ) {
  64843. // We are turning off and the element is a `listItem` - it should be converted to `paragraph`.
  64844. // List item specific attributes are removed by post fixer.
  64845. writer.rename( element, 'paragraph' );
  64846. } else if ( !turnOff && element.name != 'listItem' ) {
  64847. // We are turning on and the element is not a `listItem` - it should be converted to `listItem`.
  64848. // The order of operations is important to keep model in correct state.
  64849. writer.setAttributes( { listType: this.type, listIndent: 0 }, element );
  64850. writer.rename( element, 'listItem' );
  64851. } else if ( !turnOff && element.name == 'listItem' && element.getAttribute( 'listType' ) != this.type ) {
  64852. // We are turning on and the element is a `listItem` but has different type - change it's type and
  64853. // type of it's all siblings that have same indent.
  64854. writer.setAttribute( 'listType', this.type, element );
  64855. }
  64856. }
  64857. /**
  64858. * Event fired by the {@link #execute} method.
  64859. *
  64860. * It allows to execute an action after executing the {@link ~ListCommand#execute} method, for example adjusting
  64861. * attributes of changed blocks.
  64862. *
  64863. * @protected
  64864. * @event _executeCleanup
  64865. */
  64866. this.fire( '_executeCleanup', blocks );
  64867. } );
  64868. }
  64869. /**
  64870. * Checks the command's {@link #value}.
  64871. *
  64872. * @private
  64873. * @returns {Boolean} The current value.
  64874. */
  64875. _getValue() {
  64876. // Check whether closest `listItem` ancestor of the position has a correct type.
  64877. const listItem = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this.editor.model.document.selection.getSelectedBlocks() );
  64878. return !!listItem && listItem.is( 'element', 'listItem' ) && listItem.getAttribute( 'listType' ) == this.type;
  64879. }
  64880. /**
  64881. * Checks whether the command can be enabled in the current context.
  64882. *
  64883. * @private
  64884. * @returns {Boolean} Whether the command should be enabled.
  64885. */
  64886. _checkEnabled() {
  64887. // If command value is true it means that we are in list item, so the command should be enabled.
  64888. if ( this.value ) {
  64889. return true;
  64890. }
  64891. const selection = this.editor.model.document.selection;
  64892. const schema = this.editor.model.schema;
  64893. const firstBlock = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( selection.getSelectedBlocks() );
  64894. if ( !firstBlock ) {
  64895. return false;
  64896. }
  64897. // Otherwise, check if list item can be inserted at the position start.
  64898. return checkCanBecomeListItem( firstBlock, schema );
  64899. }
  64900. }
  64901. // Helper function used when one or more list item have their type changed. Fixes type of other list items
  64902. // that are affected by the change (are in same lists) but are not directly in selection. The function got extracted
  64903. // not to duplicated code, as same fix has to be performed before and after selection.
  64904. //
  64905. // @param {Array.<module:engine/model/node~Node>} blocks Blocks that are in selection.
  64906. // @param {Boolean} isBackward Specified whether fix will be applied for blocks before first selected block (`true`)
  64907. // or blocks after last selected block (`false`).
  64908. // @param {Number} lowestIndent Lowest indent among selected blocks.
  64909. function _fixType( blocks, isBackward, lowestIndent ) {
  64910. // We need to check previous sibling of first changed item and next siblings of last changed item.
  64911. const startingItem = isBackward ? blocks[ 0 ] : blocks[ blocks.length - 1 ];
  64912. if ( startingItem.is( 'element', 'listItem' ) ) {
  64913. let item = startingItem[ isBackward ? 'previousSibling' : 'nextSibling' ];
  64914. // During processing items, keeps the lowest indent of already processed items.
  64915. // This saves us from changing too many items.
  64916. // Following example is for going forward as it is easier to read, however same applies to going backward.
  64917. // * ------
  64918. // * ------
  64919. // * --[---
  64920. // * ------ <-- `lowestIndent` should be 1
  64921. // * --]--- <-- `startingItem`, `currentIndent` = 2, `lowestIndent` == 1
  64922. // * ------ <-- should be fixed, `indent` == 2 == `currentIndent`
  64923. // * ------ <-- should be fixed, set `currentIndent` to 1, `indent` == 1 == `currentIndent`
  64924. // * ------ <-- should not be fixed, item is in different list, `indent` = 2, `indent` != `currentIndent`
  64925. // * ------ <-- should be fixed, `indent` == 1 == `currentIndent`
  64926. // * ------ <-- break loop (`indent` < `lowestIndent`)
  64927. let currentIndent = startingItem.getAttribute( 'listIndent' );
  64928. // Look back until a list item with indent lower than reference `lowestIndent`.
  64929. // That would be the parent of nested sublist which contains item having `lowestIndent`.
  64930. while ( item && item.is( 'element', 'listItem' ) && item.getAttribute( 'listIndent' ) >= lowestIndent ) {
  64931. if ( currentIndent > item.getAttribute( 'listIndent' ) ) {
  64932. currentIndent = item.getAttribute( 'listIndent' );
  64933. }
  64934. // Found an item that is in the same nested sublist.
  64935. if ( item.getAttribute( 'listIndent' ) == currentIndent ) {
  64936. // Just add the item to selected blocks like it was selected by the user.
  64937. blocks[ isBackward ? 'unshift' : 'push' ]( item );
  64938. }
  64939. item = item[ isBackward ? 'previousSibling' : 'nextSibling' ];
  64940. }
  64941. }
  64942. }
  64943. // Checks whether the given block can be replaced by a listItem.
  64944. //
  64945. // @private
  64946. // @param {module:engine/model/element~Element} block A block to be tested.
  64947. // @param {module:engine/model/schema~Schema} schema The schema of the document.
  64948. // @returns {Boolean}
  64949. function checkCanBecomeListItem( block, schema ) {
  64950. return schema.checkChild( block.parent, 'listItem' ) && !schema.isObject( block );
  64951. }
  64952. /***/ }),
  64953. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/listediting.js":
  64954. /*!******************************************************************!*\
  64955. !*** ./node_modules/@ckeditor/ckeditor5-list/src/listediting.js ***!
  64956. \******************************************************************/
  64957. /*! exports provided: default */
  64958. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64959. "use strict";
  64960. __webpack_require__.r(__webpack_exports__);
  64961. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListEditing; });
  64962. /* harmony import */ var _listcommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./listcommand */ "./node_modules/@ckeditor/ckeditor5-list/src/listcommand.js");
  64963. /* harmony import */ var _indentcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./indentcommand */ "./node_modules/@ckeditor/ckeditor5-list/src/indentcommand.js");
  64964. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  64965. /* harmony import */ var ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/enter */ "./node_modules/ckeditor5/src/enter.js");
  64966. /* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ckeditor5/src/typing */ "./node_modules/ckeditor5/src/typing.js");
  64967. /* harmony import */ var _converters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./converters */ "./node_modules/@ckeditor/ckeditor5-list/src/converters.js");
  64968. /**
  64969. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  64970. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64971. */
  64972. /**
  64973. * @module list/listediting
  64974. */
  64975. /**
  64976. * The engine of the list feature. It handles creating, editing and removing lists and list items.
  64977. *
  64978. * It registers the `'numberedList'`, `'bulletedList'`, `'indentList'` and `'outdentList'` commands.
  64979. *
  64980. * @extends module:core/plugin~Plugin
  64981. */
  64982. class ListEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["Plugin"] {
  64983. /**
  64984. * @inheritDoc
  64985. */
  64986. static get pluginName() {
  64987. return 'ListEditing';
  64988. }
  64989. /**
  64990. * @inheritDoc
  64991. */
  64992. static get requires() {
  64993. return [ ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_3__["Enter"], ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_4__["Delete"] ];
  64994. }
  64995. /**
  64996. * @inheritDoc
  64997. */
  64998. init() {
  64999. const editor = this.editor;
  65000. // Schema.
  65001. // Note: in case `$block` will ever be allowed in `listItem`, keep in mind that this feature
  65002. // uses `Selection#getSelectedBlocks()` without any additional processing to obtain all selected list items.
  65003. // If there are blocks allowed inside list item, algorithms using `getSelectedBlocks()` will have to be modified.
  65004. editor.model.schema.register( 'listItem', {
  65005. inheritAllFrom: '$block',
  65006. allowAttributes: [ 'listType', 'listIndent' ]
  65007. } );
  65008. // Converters.
  65009. const data = editor.data;
  65010. const editing = editor.editing;
  65011. editor.model.document.registerPostFixer( writer => Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelChangePostFixer"])( editor.model, writer ) );
  65012. editing.mapper.registerViewToModelLength( 'li', getViewListItemLength );
  65013. data.mapper.registerViewToModelLength( 'li', getViewListItemLength );
  65014. editing.mapper.on( 'modelToViewPosition', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelToViewPosition"])( editing.view ) );
  65015. editing.mapper.on( 'viewToModelPosition', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["viewToModelPosition"])( editor.model ) );
  65016. data.mapper.on( 'modelToViewPosition', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelToViewPosition"])( editing.view ) );
  65017. editor.conversion.for( 'editingDowncast' )
  65018. .add( dispatcher => {
  65019. dispatcher.on( 'insert', _converters__WEBPACK_IMPORTED_MODULE_5__["modelViewSplitOnInsert"], { priority: 'high' } );
  65020. dispatcher.on( 'insert:listItem', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelViewInsertion"])( editor.model ) );
  65021. dispatcher.on( 'attribute:listType:listItem', _converters__WEBPACK_IMPORTED_MODULE_5__["modelViewChangeType"], { priority: 'high' } );
  65022. dispatcher.on( 'attribute:listType:listItem', _converters__WEBPACK_IMPORTED_MODULE_5__["modelViewMergeAfterChangeType"], { priority: 'low' } );
  65023. dispatcher.on( 'attribute:listIndent:listItem', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelViewChangeIndent"])( editor.model ) );
  65024. dispatcher.on( 'remove:listItem', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelViewRemove"])( editor.model ) );
  65025. dispatcher.on( 'remove', _converters__WEBPACK_IMPORTED_MODULE_5__["modelViewMergeAfter"], { priority: 'low' } );
  65026. } );
  65027. editor.conversion.for( 'dataDowncast' )
  65028. .add( dispatcher => {
  65029. dispatcher.on( 'insert', _converters__WEBPACK_IMPORTED_MODULE_5__["modelViewSplitOnInsert"], { priority: 'high' } );
  65030. dispatcher.on( 'insert:listItem', Object(_converters__WEBPACK_IMPORTED_MODULE_5__["modelViewInsertion"])( editor.model ) );
  65031. } );
  65032. editor.conversion.for( 'upcast' )
  65033. .add( dispatcher => {
  65034. dispatcher.on( 'element:ul', _converters__WEBPACK_IMPORTED_MODULE_5__["cleanList"], { priority: 'high' } );
  65035. dispatcher.on( 'element:ol', _converters__WEBPACK_IMPORTED_MODULE_5__["cleanList"], { priority: 'high' } );
  65036. dispatcher.on( 'element:li', _converters__WEBPACK_IMPORTED_MODULE_5__["cleanListItem"], { priority: 'high' } );
  65037. dispatcher.on( 'element:li', _converters__WEBPACK_IMPORTED_MODULE_5__["viewModelConverter"] );
  65038. } );
  65039. // Fix indentation of pasted items.
  65040. editor.model.on( 'insertContent', _converters__WEBPACK_IMPORTED_MODULE_5__["modelIndentPasteFixer"], { priority: 'high' } );
  65041. // Register commands for numbered and bulleted list.
  65042. editor.commands.add( 'numberedList', new _listcommand__WEBPACK_IMPORTED_MODULE_0__["default"]( editor, 'numbered' ) );
  65043. editor.commands.add( 'bulletedList', new _listcommand__WEBPACK_IMPORTED_MODULE_0__["default"]( editor, 'bulleted' ) );
  65044. // Register commands for indenting.
  65045. editor.commands.add( 'indentList', new _indentcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, 'forward' ) );
  65046. editor.commands.add( 'outdentList', new _indentcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, 'backward' ) );
  65047. const viewDocument = editing.view.document;
  65048. // Overwrite default Enter key behavior.
  65049. // If Enter key is pressed with selection collapsed in empty list item, outdent it instead of breaking it.
  65050. this.listenTo( viewDocument, 'enter', ( evt, data ) => {
  65051. const doc = this.editor.model.document;
  65052. const positionParent = doc.selection.getLastPosition().parent;
  65053. if ( doc.selection.isCollapsed && positionParent.name == 'listItem' && positionParent.isEmpty ) {
  65054. this.editor.execute( 'outdentList' );
  65055. data.preventDefault();
  65056. evt.stop();
  65057. }
  65058. }, { context: 'li' } );
  65059. // Overwrite default Backspace key behavior.
  65060. // If Backspace key is pressed with selection collapsed on first position in first list item, outdent it. #83
  65061. this.listenTo( viewDocument, 'delete', ( evt, data ) => {
  65062. // Check conditions from those that require less computations like those immediately available.
  65063. if ( data.direction !== 'backward' ) {
  65064. return;
  65065. }
  65066. const selection = this.editor.model.document.selection;
  65067. if ( !selection.isCollapsed ) {
  65068. return;
  65069. }
  65070. const firstPosition = selection.getFirstPosition();
  65071. if ( !firstPosition.isAtStart ) {
  65072. return;
  65073. }
  65074. const positionParent = firstPosition.parent;
  65075. if ( positionParent.name !== 'listItem' ) {
  65076. return;
  65077. }
  65078. const previousIsAListItem = positionParent.previousSibling && positionParent.previousSibling.name === 'listItem';
  65079. if ( previousIsAListItem ) {
  65080. return;
  65081. }
  65082. this.editor.execute( 'outdentList' );
  65083. data.preventDefault();
  65084. evt.stop();
  65085. }, { context: 'li' } );
  65086. const getCommandExecuter = commandName => {
  65087. return ( data, cancel ) => {
  65088. const command = this.editor.commands.get( commandName );
  65089. if ( command.isEnabled ) {
  65090. this.editor.execute( commandName );
  65091. cancel();
  65092. }
  65093. };
  65094. };
  65095. editor.keystrokes.set( 'Tab', getCommandExecuter( 'indentList' ) );
  65096. editor.keystrokes.set( 'Shift+Tab', getCommandExecuter( 'outdentList' ) );
  65097. }
  65098. /**
  65099. * @inheritDoc
  65100. */
  65101. afterInit() {
  65102. const commands = this.editor.commands;
  65103. const indent = commands.get( 'indent' );
  65104. const outdent = commands.get( 'outdent' );
  65105. if ( indent ) {
  65106. indent.registerChildCommand( commands.get( 'indentList' ) );
  65107. }
  65108. if ( outdent ) {
  65109. outdent.registerChildCommand( commands.get( 'outdentList' ) );
  65110. }
  65111. }
  65112. }
  65113. function getViewListItemLength( element ) {
  65114. let length = 1;
  65115. for ( const child of element.getChildren() ) {
  65116. if ( child.name == 'ul' || child.name == 'ol' ) {
  65117. for ( const item of child.getChildren() ) {
  65118. length += getViewListItemLength( item );
  65119. }
  65120. }
  65121. }
  65122. return length;
  65123. }
  65124. /***/ }),
  65125. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/listui.js":
  65126. /*!*************************************************************!*\
  65127. !*** ./node_modules/@ckeditor/ckeditor5-list/src/listui.js ***!
  65128. \*************************************************************/
  65129. /*! exports provided: default */
  65130. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65131. "use strict";
  65132. __webpack_require__.r(__webpack_exports__);
  65133. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListUI; });
  65134. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-list/src/utils.js");
  65135. /* harmony import */ var _theme_icons_numberedlist_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../theme/icons/numberedlist.svg */ "./node_modules/@ckeditor/ckeditor5-list/theme/icons/numberedlist.svg");
  65136. /* harmony import */ var _theme_icons_bulletedlist_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/bulletedlist.svg */ "./node_modules/@ckeditor/ckeditor5-list/theme/icons/bulletedlist.svg");
  65137. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  65138. /**
  65139. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  65140. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65141. */
  65142. /**
  65143. * @module list/listui
  65144. */
  65145. /**
  65146. * The list UI feature. It introduces the `'numberedList'` and `'bulletedList'` buttons that
  65147. * allow to convert paragraphs to and from list items and indent or outdent them.
  65148. *
  65149. * @extends module:core/plugin~Plugin
  65150. */
  65151. class ListUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_3__["Plugin"] {
  65152. /**
  65153. * @inheritDoc
  65154. */
  65155. static get pluginName() {
  65156. return 'ListUI';
  65157. }
  65158. /**
  65159. * @inheritDoc
  65160. */
  65161. init() {
  65162. const t = this.editor.t;
  65163. // Create two buttons and link them with numberedList and bulletedList commands.
  65164. Object(_utils__WEBPACK_IMPORTED_MODULE_0__["createUIComponent"])( this.editor, 'numberedList', t( 'Numbered List' ), _theme_icons_numberedlist_svg__WEBPACK_IMPORTED_MODULE_1__["default"] );
  65165. Object(_utils__WEBPACK_IMPORTED_MODULE_0__["createUIComponent"])( this.editor, 'bulletedList', t( 'Bulleted List' ), _theme_icons_bulletedlist_svg__WEBPACK_IMPORTED_MODULE_2__["default"] );
  65166. }
  65167. }
  65168. /***/ }),
  65169. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/utils.js":
  65170. /*!************************************************************!*\
  65171. !*** ./node_modules/@ckeditor/ckeditor5-list/src/utils.js ***!
  65172. \************************************************************/
  65173. /*! exports provided: createViewListItemElement, generateLiInUl, injectViewList, mergeViewLists, positionAfterUiElements, getSiblingListItem, createUIComponent, findNestedList, getSiblingNodes */
  65174. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65175. "use strict";
  65176. __webpack_require__.r(__webpack_exports__);
  65177. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createViewListItemElement", function() { return createViewListItemElement; });
  65178. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generateLiInUl", function() { return generateLiInUl; });
  65179. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectViewList", function() { return injectViewList; });
  65180. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeViewLists", function() { return mergeViewLists; });
  65181. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionAfterUiElements", function() { return positionAfterUiElements; });
  65182. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSiblingListItem", function() { return getSiblingListItem; });
  65183. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUIComponent", function() { return createUIComponent; });
  65184. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findNestedList", function() { return findNestedList; });
  65185. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSiblingNodes", function() { return getSiblingNodes; });
  65186. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  65187. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  65188. /**
  65189. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  65190. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65191. */
  65192. /**
  65193. * @module list/utils
  65194. */
  65195. /**
  65196. * Creates a list item {@link module:engine/view/containerelement~ContainerElement}.
  65197. *
  65198. * @param {module:engine/view/downcastwriter~DowncastWriter} writer The writer instance.
  65199. * @returns {module:engine/view/containerelement~ContainerElement}
  65200. */
  65201. function createViewListItemElement( writer ) {
  65202. const viewItem = writer.createContainerElement( 'li' );
  65203. viewItem.getFillerOffset = getListItemFillerOffset;
  65204. return viewItem;
  65205. }
  65206. /**
  65207. * Helper function that creates a `<ul><li></li></ul>` or (`<ol>`) structure out of the given `modelItem` model `listItem` element.
  65208. * Then, it binds the created view list item (`<li>`) with the model `listItem` element.
  65209. * The function then returns the created view list item (`<li>`).
  65210. *
  65211. * @param {module:engine/model/item~Item} modelItem Model list item.
  65212. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface.
  65213. * @returns {module:engine/view/containerelement~ContainerElement} View list element.
  65214. */
  65215. function generateLiInUl( modelItem, conversionApi ) {
  65216. const mapper = conversionApi.mapper;
  65217. const viewWriter = conversionApi.writer;
  65218. const listType = modelItem.getAttribute( 'listType' ) == 'numbered' ? 'ol' : 'ul';
  65219. const viewItem = createViewListItemElement( viewWriter );
  65220. const viewList = viewWriter.createContainerElement( listType, null );
  65221. viewWriter.insert( viewWriter.createPositionAt( viewList, 0 ), viewItem );
  65222. mapper.bindElements( modelItem, viewItem );
  65223. return viewItem;
  65224. }
  65225. /**
  65226. * Helper function that inserts a view list at a correct place and merges it with its siblings.
  65227. * It takes a model list item element (`modelItem`) and a corresponding view list item element (`injectedItem`). The view list item
  65228. * should be in a view list element (`<ul>` or `<ol>`) and should be its only child.
  65229. * See comments below to better understand the algorithm.
  65230. *
  65231. * @param {module:engine/view/item~Item} modelItem Model list item.
  65232. * @param {module:engine/view/containerelement~ContainerElement} injectedItem
  65233. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface.
  65234. * @param {module:engine/model/model~Model} model The model instance.
  65235. */
  65236. function injectViewList( modelItem, injectedItem, conversionApi, model ) {
  65237. const injectedList = injectedItem.parent;
  65238. const mapper = conversionApi.mapper;
  65239. const viewWriter = conversionApi.writer;
  65240. // The position where the view list will be inserted.
  65241. let insertPosition = mapper.toViewPosition( model.createPositionBefore( modelItem ) );
  65242. // 1. Find the previous list item that has the same or smaller indent. Basically we are looking for the first model item
  65243. // that is a "parent" or "sibling" of the injected model item.
  65244. // If there is no such list item, it means that the injected list item is the first item in "its list".
  65245. const refItem = getSiblingListItem( modelItem.previousSibling, {
  65246. sameIndent: true,
  65247. smallerIndent: true,
  65248. listIndent: modelItem.getAttribute( 'listIndent' )
  65249. } );
  65250. const prevItem = modelItem.previousSibling;
  65251. if ( refItem && refItem.getAttribute( 'listIndent' ) == modelItem.getAttribute( 'listIndent' ) ) {
  65252. // There is a list item with the same indent - we found the same-level sibling.
  65253. // Break the list after it. The inserted view item will be added in the broken space.
  65254. const viewItem = mapper.toViewElement( refItem );
  65255. insertPosition = viewWriter.breakContainer( viewWriter.createPositionAfter( viewItem ) );
  65256. } else {
  65257. // There is no list item with the same indent. Check the previous model item.
  65258. if ( prevItem && prevItem.name == 'listItem' ) {
  65259. // If it is a list item, it has to have a lower indent.
  65260. // It means that the inserted item should be added to it as its nested item.
  65261. insertPosition = mapper.toViewPosition( model.createPositionAt( prevItem, 'end' ) );
  65262. // There could be some not mapped elements (eg. span in to-do list) but we need to insert
  65263. // a nested list directly inside the li element.
  65264. const mappedViewAncestor = mapper.findMappedViewAncestor( insertPosition );
  65265. const nestedList = findNestedList( mappedViewAncestor );
  65266. // If there already is some nested list, then use it's position.
  65267. if ( nestedList ) {
  65268. insertPosition = viewWriter.createPositionBefore( nestedList );
  65269. } else {
  65270. // Else just put new list on the end of list item content.
  65271. insertPosition = viewWriter.createPositionAt( mappedViewAncestor, 'end' );
  65272. }
  65273. } else {
  65274. // The previous item is not a list item (or does not exist at all).
  65275. // Just map the position and insert the view item at the mapped position.
  65276. insertPosition = mapper.toViewPosition( model.createPositionBefore( modelItem ) );
  65277. }
  65278. }
  65279. insertPosition = positionAfterUiElements( insertPosition );
  65280. // Insert the view item.
  65281. viewWriter.insert( insertPosition, injectedList );
  65282. // 2. Handle possible children of the injected model item.
  65283. if ( prevItem && prevItem.name == 'listItem' ) {
  65284. const prevView = mapper.toViewElement( prevItem );
  65285. const walkerBoundaries = viewWriter.createRange( viewWriter.createPositionAt( prevView, 0 ), insertPosition );
  65286. const walker = walkerBoundaries.getWalker( { ignoreElementEnd: true } );
  65287. for ( const value of walker ) {
  65288. if ( value.item.is( 'element', 'li' ) ) {
  65289. const breakPosition = viewWriter.breakContainer( viewWriter.createPositionBefore( value.item ) );
  65290. const viewList = value.item.parent;
  65291. const targetPosition = viewWriter.createPositionAt( injectedItem, 'end' );
  65292. mergeViewLists( viewWriter, targetPosition.nodeBefore, targetPosition.nodeAfter );
  65293. viewWriter.move( viewWriter.createRangeOn( viewList ), targetPosition );
  65294. walker.position = breakPosition;
  65295. }
  65296. }
  65297. } else {
  65298. const nextViewList = injectedList.nextSibling;
  65299. if ( nextViewList && ( nextViewList.is( 'element', 'ul' ) || nextViewList.is( 'element', 'ol' ) ) ) {
  65300. let lastSubChild = null;
  65301. for ( const child of nextViewList.getChildren() ) {
  65302. const modelChild = mapper.toModelElement( child );
  65303. if ( modelChild && modelChild.getAttribute( 'listIndent' ) > modelItem.getAttribute( 'listIndent' ) ) {
  65304. lastSubChild = child;
  65305. } else {
  65306. break;
  65307. }
  65308. }
  65309. if ( lastSubChild ) {
  65310. viewWriter.breakContainer( viewWriter.createPositionAfter( lastSubChild ) );
  65311. viewWriter.move( viewWriter.createRangeOn( lastSubChild.parent ), viewWriter.createPositionAt( injectedItem, 'end' ) );
  65312. }
  65313. }
  65314. }
  65315. // Merge the inserted view list with its possible neighbor lists.
  65316. mergeViewLists( viewWriter, injectedList, injectedList.nextSibling );
  65317. mergeViewLists( viewWriter, injectedList.previousSibling, injectedList );
  65318. }
  65319. /**
  65320. * Helper function that takes two parameters that are expected to be view list elements, and merges them.
  65321. * The merge happens only if both parameters are list elements of the same type (the same element name and the same class attributes).
  65322. *
  65323. * @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter The writer instance.
  65324. * @param {module:engine/view/item~Item} firstList The first element to compare.
  65325. * @param {module:engine/view/item~Item} secondList The second element to compare.
  65326. * @returns {module:engine/view/position~Position|null} The position after merge or `null` when there was no merge.
  65327. */
  65328. function mergeViewLists( viewWriter, firstList, secondList ) {
  65329. // Check if two lists are going to be merged.
  65330. if ( !firstList || !secondList || ( firstList.name != 'ul' && firstList.name != 'ol' ) ) {
  65331. return null;
  65332. }
  65333. // Both parameters are list elements, so compare types now.
  65334. if ( firstList.name != secondList.name || firstList.getAttribute( 'class' ) !== secondList.getAttribute( 'class' ) ) {
  65335. return null;
  65336. }
  65337. return viewWriter.mergeContainers( viewWriter.createPositionAfter( firstList ) );
  65338. }
  65339. /**
  65340. * Helper function that for a given `view.Position`, returns a `view.Position` that is after all `view.UIElement`s that
  65341. * are after the given position.
  65342. *
  65343. * For example:
  65344. * `<container:p>foo^<ui:span></ui:span><ui:span></ui:span>bar</container:p>`
  65345. * For position ^, the position before "bar" will be returned.
  65346. *
  65347. * @param {module:engine/view/position~Position} viewPosition
  65348. * @returns {module:engine/view/position~Position}
  65349. */
  65350. function positionAfterUiElements( viewPosition ) {
  65351. return viewPosition.getLastMatchingPosition( value => value.item.is( 'uiElement' ) );
  65352. }
  65353. /**
  65354. * Helper function that searches for a previous list item sibling of a given model item that meets the given criteria
  65355. * passed by the options object.
  65356. *
  65357. * @param {module:engine/model/item~Item} modelItem
  65358. * @param {Object} options Search criteria.
  65359. * @param {Boolean} [options.sameIndent=false] Whether the sought sibling should have the same indentation.
  65360. * @param {Boolean} [options.smallerIndent=false] Whether the sought sibling should have a smaller indentation.
  65361. * @param {Number} [options.listIndent] The reference indentation.
  65362. * @param {'forward'|'backward'} [options.direction='backward'] Walking direction.
  65363. * @returns {module:engine/model/item~Item|null}
  65364. */
  65365. function getSiblingListItem( modelItem, options ) {
  65366. const sameIndent = !!options.sameIndent;
  65367. const smallerIndent = !!options.smallerIndent;
  65368. const indent = options.listIndent;
  65369. let item = modelItem;
  65370. while ( item && item.name == 'listItem' ) {
  65371. const itemIndent = item.getAttribute( 'listIndent' );
  65372. if ( ( sameIndent && indent == itemIndent ) || ( smallerIndent && indent > itemIndent ) ) {
  65373. return item;
  65374. }
  65375. if ( options.direction === 'forward' ) {
  65376. item = item.nextSibling;
  65377. } else {
  65378. item = item.previousSibling;
  65379. }
  65380. }
  65381. return null;
  65382. }
  65383. /**
  65384. * Helper method for creating a UI button and linking it with an appropriate command.
  65385. *
  65386. * @private
  65387. * @param {module:core/editor/editor~Editor} editor The editor instance to which the UI component will be added.
  65388. * @param {String} commandName The name of the command.
  65389. * @param {String} label The button label.
  65390. * @param {String} icon The source of the icon.
  65391. */
  65392. function createUIComponent( editor, commandName, label, icon ) {
  65393. editor.ui.componentFactory.add( commandName, locale => {
  65394. const command = editor.commands.get( commandName );
  65395. const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  65396. buttonView.set( {
  65397. label,
  65398. icon,
  65399. tooltip: true,
  65400. isToggleable: true
  65401. } );
  65402. // Bind button model to command.
  65403. buttonView.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  65404. // Execute command.
  65405. buttonView.on( 'execute', () => {
  65406. editor.execute( commandName );
  65407. editor.editing.view.focus();
  65408. } );
  65409. return buttonView;
  65410. } );
  65411. }
  65412. /**
  65413. * Returns a first list view element that is direct child of the given view element.
  65414. *
  65415. * @param {module:engine/view/element~Element} viewElement
  65416. * @return {module:engine/view/element~Element|null}
  65417. */
  65418. function findNestedList( viewElement ) {
  65419. for ( const node of viewElement.getChildren() ) {
  65420. if ( node.name == 'ul' || node.name == 'ol' ) {
  65421. return node;
  65422. }
  65423. }
  65424. return null;
  65425. }
  65426. /**
  65427. * Returns an array with all `listItem` elements that represents the same list.
  65428. *
  65429. * It means that values for `listIndent`, `listType`, and `listStyle` for all items are equal.
  65430. *
  65431. * @param {module:engine/model/position~Position} position Starting position.
  65432. * @param {'forward'|'backward'} direction Walking direction.
  65433. * @returns {Array.<module:engine/model/element~Element>}
  65434. */
  65435. function getSiblingNodes( position, direction ) {
  65436. const items = [];
  65437. const listItem = position.parent;
  65438. const walkerOptions = {
  65439. ignoreElementEnd: true,
  65440. startPosition: position,
  65441. shallow: true,
  65442. direction
  65443. };
  65444. const limitIndent = listItem.getAttribute( 'listIndent' );
  65445. const nodes = [ ...new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["TreeWalker"]( walkerOptions ) ]
  65446. .filter( value => value.item.is( 'element' ) )
  65447. .map( value => value.item );
  65448. for ( const element of nodes ) {
  65449. // If found something else than `listItem`, we're out of the list scope.
  65450. if ( !element.is( 'element', 'listItem' ) ) {
  65451. break;
  65452. }
  65453. // If current parsed item has lower indent that element that the element that was a starting point,
  65454. // it means we left a nested list. Abort searching items.
  65455. //
  65456. // ■ List item 1. [listIndent=0]
  65457. // ○ List item 2.[] [listIndent=1], limitIndent = 1,
  65458. // ○ List item 3. [listIndent=1]
  65459. // ■ List item 4. [listIndent=0]
  65460. //
  65461. // Abort searching when leave nested list.
  65462. if ( element.getAttribute( 'listIndent' ) < limitIndent ) {
  65463. break;
  65464. }
  65465. // ■ List item 1.[] [listIndent=0] limitIndent = 0,
  65466. // ○ List item 2. [listIndent=1]
  65467. // ○ List item 3. [listIndent=1]
  65468. // ■ List item 4. [listIndent=0]
  65469. //
  65470. // Ignore nested lists.
  65471. if ( element.getAttribute( 'listIndent' ) > limitIndent ) {
  65472. continue;
  65473. }
  65474. // ■ List item 1.[] [listType=bulleted]
  65475. // 1. List item 2. [listType=numbered]
  65476. // 2.List item 3. [listType=numbered]
  65477. //
  65478. // Abort searching when found a different kind of a list.
  65479. if ( element.getAttribute( 'listType' ) !== listItem.getAttribute( 'listType' ) ) {
  65480. break;
  65481. }
  65482. // ■ List item 1.[] [listType=bulleted]
  65483. // ■ List item 2. [listType=bulleted]
  65484. // ○ List item 3. [listType=bulleted]
  65485. // ○ List item 4. [listType=bulleted]
  65486. //
  65487. // Abort searching when found a different list style.
  65488. if ( element.getAttribute( 'listStyle' ) !== listItem.getAttribute( 'listStyle' ) ) {
  65489. break;
  65490. }
  65491. if ( direction === 'backward' ) {
  65492. items.unshift( element );
  65493. } else {
  65494. items.push( element );
  65495. }
  65496. }
  65497. return items;
  65498. }
  65499. // Implementation of getFillerOffset for view list item element.
  65500. //
  65501. // @returns {Number|null} Block filler offset or `null` if block filler is not needed.
  65502. function getListItemFillerOffset() {
  65503. const hasOnlyLists = !this.isEmpty && ( this.getChild( 0 ).name == 'ul' || this.getChild( 0 ).name == 'ol' );
  65504. if ( this.isEmpty || hasOnlyLists ) {
  65505. return 0;
  65506. }
  65507. return ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["getFillerOffset"].call( this );
  65508. }
  65509. /***/ }),
  65510. /***/ "./node_modules/@ckeditor/ckeditor5-list/theme/icons/bulletedlist.svg":
  65511. /*!****************************************************************************!*\
  65512. !*** ./node_modules/@ckeditor/ckeditor5-list/theme/icons/bulletedlist.svg ***!
  65513. \****************************************************************************/
  65514. /*! exports provided: default */
  65515. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65516. "use strict";
  65517. __webpack_require__.r(__webpack_exports__);
  65518. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0C1 4.784 1.777 4 2.75 4c.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75C1.784 7.5 1 6.723 1 5.75zm6 9c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0c0-.966.777-1.75 1.75-1.75.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75-.966 0-1.75-.777-1.75-1.75z\"/></svg>");
  65519. /***/ }),
  65520. /***/ "./node_modules/@ckeditor/ckeditor5-list/theme/icons/numberedlist.svg":
  65521. /*!****************************************************************************!*\
  65522. !*** ./node_modules/@ckeditor/ckeditor5-list/theme/icons/numberedlist.svg ***!
  65523. \****************************************************************************/
  65524. /*! exports provided: default */
  65525. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65526. "use strict";
  65527. __webpack_require__.r(__webpack_exports__);
  65528. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM3.5 3v5H2V3.7H1v-1h2.5V3zM.343 17.857l2.59-3.257H2.92a.6.6 0 1 0-1.04 0H.302a2 2 0 1 1 3.995 0h-.001c-.048.405-.16.734-.333.988-.175.254-.59.692-1.244 1.312H4.3v1h-4l.043-.043zM7 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75z\"/></svg>");
  65529. /***/ }),
  65530. /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/index.js":
  65531. /*!*****************************************************************!*\
  65532. !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/index.js ***!
  65533. \*****************************************************************/
  65534. /*! exports provided: Paragraph, ParagraphButtonUI */
  65535. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65536. "use strict";
  65537. __webpack_require__.r(__webpack_exports__);
  65538. /* harmony import */ var _paragraph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./paragraph */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js");
  65539. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Paragraph", function() { return _paragraph__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  65540. /* harmony import */ var _paragraphbuttonui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./paragraphbuttonui */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui.js");
  65541. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ParagraphButtonUI", function() { return _paragraphbuttonui__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  65542. /**
  65543. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  65544. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65545. */
  65546. /**
  65547. * @module paragraph
  65548. */
  65549. /***/ }),
  65550. /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js":
  65551. /*!**********************************************************************************!*\
  65552. !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js ***!
  65553. \**********************************************************************************/
  65554. /*! exports provided: default */
  65555. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65556. "use strict";
  65557. __webpack_require__.r(__webpack_exports__);
  65558. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertParagraphCommand; });
  65559. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  65560. /**
  65561. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  65562. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65563. */
  65564. /**
  65565. * @module paragraph/insertparagraphcommand
  65566. */
  65567. /**
  65568. * The insert paragraph command. It inserts a new paragraph at a specific
  65569. * {@link module:engine/model/position~Position document position}.
  65570. *
  65571. * // Insert a new paragraph before an element in the document.
  65572. * editor.execute( 'insertParagraph', {
  65573. * position: editor.model.createPositionBefore( element )
  65574. * } );
  65575. *
  65576. * If a paragraph is disallowed in the context of the specific position, the command
  65577. * will attempt to split position ancestors to find a place where it is possible
  65578. * to insert a paragraph.
  65579. *
  65580. * **Note**: This command moves the selection to the inserted paragraph.
  65581. *
  65582. * @extends module:core/command~Command
  65583. */
  65584. class InsertParagraphCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  65585. /**
  65586. * Executes the command.
  65587. *
  65588. * @param {Object} options Options for the executed command.
  65589. * @param {module:engine/model/position~Position} options.position The model position at which
  65590. * the new paragraph will be inserted.
  65591. * @fires execute
  65592. */
  65593. execute( options ) {
  65594. const model = this.editor.model;
  65595. let position = options.position;
  65596. model.change( writer => {
  65597. const paragraph = writer.createElement( 'paragraph' );
  65598. if ( !model.schema.checkChild( position.parent, paragraph ) ) {
  65599. const allowedParent = model.schema.findAllowedParent( position, paragraph );
  65600. // It could be there's no ancestor limit that would allow paragraph.
  65601. // In theory, "paragraph" could be disallowed even in the "$root".
  65602. if ( !allowedParent ) {
  65603. return;
  65604. }
  65605. position = writer.split( position, allowedParent ).position;
  65606. }
  65607. model.insertContent( paragraph, position );
  65608. writer.setSelection( paragraph, 'in' );
  65609. } );
  65610. }
  65611. }
  65612. /***/ }),
  65613. /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js":
  65614. /*!*********************************************************************!*\
  65615. !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js ***!
  65616. \*********************************************************************/
  65617. /*! exports provided: default */
  65618. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65619. "use strict";
  65620. __webpack_require__.r(__webpack_exports__);
  65621. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Paragraph; });
  65622. /* harmony import */ var _paragraphcommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./paragraphcommand */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js");
  65623. /* harmony import */ var _insertparagraphcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./insertparagraphcommand */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js");
  65624. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  65625. /**
  65626. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  65627. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65628. */
  65629. /**
  65630. * @module paragraph/paragraph
  65631. */
  65632. /**
  65633. * The paragraph feature for the editor.
  65634. *
  65635. * It introduces the `<paragraph>` element in the model which renders as a `<p>` element in the DOM and data.
  65636. *
  65637. * It also brings two editors commands:
  65638. *
  65639. * * The {@link module:paragraph/paragraphcommand~ParagraphCommand `'paragraph'`} command that converts all
  65640. * blocks in the model selection into paragraphs.
  65641. * * The {@link module:paragraph/insertparagraphcommand~InsertParagraphCommand `'insertParagraph'`} command
  65642. * that inserts a new paragraph at a specified location in the model.
  65643. *
  65644. * @extends module:core/plugin~Plugin
  65645. */
  65646. class Paragraph extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__["default"] {
  65647. /**
  65648. * @inheritDoc
  65649. */
  65650. static get pluginName() {
  65651. return 'Paragraph';
  65652. }
  65653. /**
  65654. * @inheritDoc
  65655. */
  65656. init() {
  65657. const editor = this.editor;
  65658. const model = editor.model;
  65659. editor.commands.add( 'paragraph', new _paragraphcommand__WEBPACK_IMPORTED_MODULE_0__["default"]( editor ) );
  65660. editor.commands.add( 'insertParagraph', new _insertparagraphcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  65661. // Schema.
  65662. model.schema.register( 'paragraph', { inheritAllFrom: '$block' } );
  65663. editor.conversion.elementToElement( { model: 'paragraph', view: 'p' } );
  65664. // Conversion for paragraph-like elements which has not been converted by any plugin.
  65665. editor.conversion.for( 'upcast' ).elementToElement( {
  65666. model: ( viewElement, { writer } ) => {
  65667. if ( !Paragraph.paragraphLikeElements.has( viewElement.name ) ) {
  65668. return null;
  65669. }
  65670. // Do not auto-paragraph empty elements.
  65671. if ( viewElement.isEmpty ) {
  65672. return null;
  65673. }
  65674. return writer.createElement( 'paragraph' );
  65675. },
  65676. view: /.+/,
  65677. converterPriority: 'low'
  65678. } );
  65679. }
  65680. }
  65681. /**
  65682. * A list of element names which should be treated by the autoparagraphing algorithms as
  65683. * paragraph-like. This means that e.g. the following content:
  65684. *
  65685. * <h1>Foo</h1>
  65686. * <table>
  65687. * <tr>
  65688. * <td>X</td>
  65689. * <td>
  65690. * <ul>
  65691. * <li>Y</li>
  65692. * <li>Z</li>
  65693. * </ul>
  65694. * </td>
  65695. * </tr>
  65696. * </table>
  65697. *
  65698. * contains five paragraph-like elements: `<h1>`, two `<td>`s and two `<li>`s.
  65699. * Hence, if none of the features is going to convert those elements the above content will be automatically handled
  65700. * by the paragraph feature and converted to:
  65701. *
  65702. * <p>Foo</p>
  65703. * <p>X</p>
  65704. * <p>Y</p>
  65705. * <p>Z</p>
  65706. *
  65707. * Note: The `<td>` containing two `<li>` elements was ignored as the innermost paragraph-like elements
  65708. * have a priority upon conversion.
  65709. *
  65710. * @member {Set.<String>} module:paragraph/paragraph~Paragraph.paragraphLikeElements
  65711. */
  65712. Paragraph.paragraphLikeElements = new Set( [
  65713. 'blockquote',
  65714. 'dd',
  65715. 'div',
  65716. 'dt',
  65717. 'h1',
  65718. 'h2',
  65719. 'h3',
  65720. 'h4',
  65721. 'h5',
  65722. 'h6',
  65723. 'li',
  65724. 'p',
  65725. 'td',
  65726. 'th'
  65727. ] );
  65728. /***/ }),
  65729. /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui.js":
  65730. /*!*****************************************************************************!*\
  65731. !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui.js ***!
  65732. \*****************************************************************************/
  65733. /*! exports provided: default */
  65734. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65735. "use strict";
  65736. __webpack_require__.r(__webpack_exports__);
  65737. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ParagraphButtonUI; });
  65738. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  65739. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  65740. /* harmony import */ var _theme_icons_paragraph_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/paragraph.svg */ "./node_modules/@ckeditor/ckeditor5-paragraph/theme/icons/paragraph.svg");
  65741. /**
  65742. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  65743. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65744. */
  65745. /**
  65746. * @module paragraph/paragraphbuttonui
  65747. */
  65748. /**
  65749. * This plugin defines the `'paragraph'` button. It can be used together with
  65750. * {@link module:heading/headingbuttonsui~HeadingButtonsUI} to replace the standard heading dropdown.
  65751. *
  65752. * This plugin is not loaded automatically by the {@link module:paragraph/paragraph~Paragraph} plugin. It must
  65753. * be added manually.
  65754. *
  65755. * ClassicEditor
  65756. * .create( {
  65757. * plugins: [ ..., Heading, Paragraph, HeadingButtonsUI, ParagraphButtonUI ]
  65758. * toolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3' ]
  65759. * } )
  65760. * .then( ... )
  65761. * .catch( ... );
  65762. *
  65763. * @extends module:core/plugin~Plugin
  65764. */
  65765. class ParagraphButtonUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  65766. init() {
  65767. const editor = this.editor;
  65768. const t = editor.t;
  65769. editor.ui.componentFactory.add( 'paragraph', locale => {
  65770. const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  65771. const command = editor.commands.get( 'paragraph' );
  65772. view.label = t( 'Paragraph' );
  65773. view.icon = _theme_icons_paragraph_svg__WEBPACK_IMPORTED_MODULE_2__["default"];
  65774. view.tooltip = true;
  65775. view.isToggleable = true;
  65776. view.bind( 'isEnabled' ).to( command );
  65777. view.bind( 'isOn' ).to( command, 'value' );
  65778. view.on( 'execute', () => {
  65779. editor.execute( 'paragraph' );
  65780. } );
  65781. return view;
  65782. } );
  65783. }
  65784. }
  65785. /***/ }),
  65786. /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js":
  65787. /*!****************************************************************************!*\
  65788. !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js ***!
  65789. \****************************************************************************/
  65790. /*! exports provided: default */
  65791. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65792. "use strict";
  65793. __webpack_require__.r(__webpack_exports__);
  65794. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ParagraphCommand; });
  65795. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  65796. /* harmony import */ var _ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/first */ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js");
  65797. /**
  65798. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  65799. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65800. */
  65801. /**
  65802. * @module paragraph/paragraphcommand
  65803. */
  65804. /**
  65805. * The paragraph command.
  65806. *
  65807. * @extends module:core/command~Command
  65808. */
  65809. class ParagraphCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  65810. /**
  65811. * The value of the command. Indicates whether the selection start is placed in a paragraph.
  65812. *
  65813. * @readonly
  65814. * @observable
  65815. * @member {Boolean} #value
  65816. */
  65817. /**
  65818. * @inheritDoc
  65819. */
  65820. refresh() {
  65821. const model = this.editor.model;
  65822. const document = model.document;
  65823. const block = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__["default"])( document.selection.getSelectedBlocks() );
  65824. this.value = !!block && block.is( 'element', 'paragraph' );
  65825. this.isEnabled = !!block && checkCanBecomeParagraph( block, model.schema );
  65826. }
  65827. /**
  65828. * Executes the command. All the blocks (see {@link module:engine/model/schema~Schema}) in the selection
  65829. * will be turned to paragraphs.
  65830. *
  65831. * @fires execute
  65832. * @param {Object} [options] Options for the executed command.
  65833. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} [options.selection]
  65834. * The selection that the command should be applied to.
  65835. * By default, if not provided, the command is applied to the {@link module:engine/model/document~Document#selection}.
  65836. */
  65837. execute( options = {} ) {
  65838. const model = this.editor.model;
  65839. const document = model.document;
  65840. model.change( writer => {
  65841. const blocks = ( options.selection || document.selection ).getSelectedBlocks();
  65842. for ( const block of blocks ) {
  65843. if ( !block.is( 'element', 'paragraph' ) && checkCanBecomeParagraph( block, model.schema ) ) {
  65844. writer.rename( block, 'paragraph' );
  65845. }
  65846. }
  65847. } );
  65848. }
  65849. }
  65850. // Checks whether the given block can be replaced by a paragraph.
  65851. //
  65852. // @private
  65853. // @param {module:engine/model/element~Element} block A block to be tested.
  65854. // @param {module:engine/model/schema~Schema} schema The schema of the document.
  65855. // @returns {Boolean}
  65856. function checkCanBecomeParagraph( block, schema ) {
  65857. return schema.checkChild( block.parent, 'paragraph' ) && !schema.isObject( block );
  65858. }
  65859. /***/ }),
  65860. /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/theme/icons/paragraph.svg":
  65861. /*!******************************************************************************!*\
  65862. !*** ./node_modules/@ckeditor/ckeditor5-paragraph/theme/icons/paragraph.svg ***!
  65863. \******************************************************************************/
  65864. /*! exports provided: default */
  65865. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65866. "use strict";
  65867. __webpack_require__.r(__webpack_exports__);
  65868. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10.5 5.5H7v5h3.5a2.5 2.5 0 1 0 0-5zM5 3h6.5v.025a5 5 0 0 1 0 9.95V13H7v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z\"/></svg>");
  65869. /***/ }),
  65870. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.js":
  65871. /*!*********************************************************************************!*\
  65872. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.js ***!
  65873. \*********************************************************************************/
  65874. /*! exports provided: replaceImagesSourceWithBase64, _convertHexToBase64 */
  65875. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65876. "use strict";
  65877. __webpack_require__.r(__webpack_exports__);
  65878. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "replaceImagesSourceWithBase64", function() { return replaceImagesSourceWithBase64; });
  65879. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_convertHexToBase64", function() { return _convertHexToBase64; });
  65880. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  65881. /**
  65882. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  65883. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65884. */
  65885. /**
  65886. * @module paste-from-office/filters/image
  65887. */
  65888. /* globals btoa */
  65889. /**
  65890. * Replaces source attribute of all `<img>` elements representing regular
  65891. * images (not the Word shapes) with inlined base64 image representation extracted from RTF or Blob data.
  65892. *
  65893. * @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment on which transform images.
  65894. * @param {String} rtfData The RTF data from which images representation will be used.
  65895. */
  65896. function replaceImagesSourceWithBase64( documentFragment, rtfData ) {
  65897. if ( !documentFragment.childCount ) {
  65898. return;
  65899. }
  65900. const upcastWriter = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["UpcastWriter"]();
  65901. const shapesIds = findAllShapesIds( documentFragment, upcastWriter );
  65902. removeAllImgElementsRepresentingShapes( shapesIds, documentFragment, upcastWriter );
  65903. removeAllShapeElements( documentFragment, upcastWriter );
  65904. const images = findAllImageElementsWithLocalSource( documentFragment, upcastWriter );
  65905. if ( images.length ) {
  65906. replaceImagesFileSourceWithInlineRepresentation( images, extractImageDataFromRtf( rtfData ), upcastWriter );
  65907. }
  65908. }
  65909. /**
  65910. * Converts given HEX string to base64 representation.
  65911. *
  65912. * @protected
  65913. * @param {String} hexString The HEX string to be converted.
  65914. * @returns {String} Base64 representation of a given HEX string.
  65915. */
  65916. function _convertHexToBase64( hexString ) {
  65917. return btoa( hexString.match( /\w{2}/g ).map( char => {
  65918. return String.fromCharCode( parseInt( char, 16 ) );
  65919. } ).join( '' ) );
  65920. }
  65921. // Finds all shapes (`<v:*>...</v:*>`) ids. Shapes can represent images (canvas)
  65922. // or Word shapes (which does not have RTF or Blob representation).
  65923. //
  65924. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment
  65925. // from which to extract shape ids.
  65926. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  65927. // @returns {Array.<String>} Array of shape ids.
  65928. function findAllShapesIds( documentFragment, writer ) {
  65929. const range = writer.createRangeIn( documentFragment );
  65930. const shapeElementsMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
  65931. name: /v:(.+)/
  65932. } );
  65933. const shapesIds = [];
  65934. for ( const value of range ) {
  65935. if ( value.type != 'elementStart' ) {
  65936. continue;
  65937. }
  65938. const el = value.item;
  65939. const prevSiblingName = el.previousSibling && el.previousSibling.name || null;
  65940. // If shape element have 'o:gfxdata' attribute and is not directly before `<v:shapetype>` element it means it represent Word shape.
  65941. if ( shapeElementsMatcher.match( el ) && el.getAttribute( 'o:gfxdata' ) && prevSiblingName !== 'v:shapetype' ) {
  65942. shapesIds.push( value.item.getAttribute( 'id' ) );
  65943. }
  65944. }
  65945. return shapesIds;
  65946. }
  65947. // Removes all `<img>` elements which represents Word shapes and not regular images.
  65948. //
  65949. // @param {Array.<String>} shapesIds Shape ids which will be checked against `<img>` elements.
  65950. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment from which to remove `<img>` elements.
  65951. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  65952. function removeAllImgElementsRepresentingShapes( shapesIds, documentFragment, writer ) {
  65953. const range = writer.createRangeIn( documentFragment );
  65954. const imageElementsMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
  65955. name: 'img'
  65956. } );
  65957. const imgs = [];
  65958. for ( const value of range ) {
  65959. if ( imageElementsMatcher.match( value.item ) ) {
  65960. const el = value.item;
  65961. const shapes = el.getAttribute( 'v:shapes' ) ? el.getAttribute( 'v:shapes' ).split( ' ' ) : [];
  65962. if ( shapes.length && shapes.every( shape => shapesIds.indexOf( shape ) > -1 ) ) {
  65963. imgs.push( el );
  65964. // Shapes may also have empty source while content is paste in some browsers (Safari).
  65965. } else if ( !el.getAttribute( 'src' ) ) {
  65966. imgs.push( el );
  65967. }
  65968. }
  65969. }
  65970. for ( const img of imgs ) {
  65971. writer.remove( img );
  65972. }
  65973. }
  65974. // Removes all shape elements (`<v:*>...</v:*>`) so they do not pollute the output structure.
  65975. //
  65976. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment from which to remove shape elements.
  65977. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  65978. function removeAllShapeElements( documentFragment, writer ) {
  65979. const range = writer.createRangeIn( documentFragment );
  65980. const shapeElementsMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
  65981. name: /v:(.+)/
  65982. } );
  65983. const shapes = [];
  65984. for ( const value of range ) {
  65985. if ( value.type == 'elementStart' && shapeElementsMatcher.match( value.item ) ) {
  65986. shapes.push( value.item );
  65987. }
  65988. }
  65989. for ( const shape of shapes ) {
  65990. writer.remove( shape );
  65991. }
  65992. }
  65993. // Finds all `<img>` elements in a given document fragment which have source pointing to local `file://` resource.
  65994. //
  65995. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment in which to look for `<img>` elements.
  65996. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  65997. // @returns {Object} result All found images grouped by source type.
  65998. // @returns {Array.<module:engine/view/element~Element>} result.file Array of found `<img>` elements with `file://` source.
  65999. // @returns {Array.<module:engine/view/element~Element>} result.blob Array of found `<img>` elements with `blob:` source.
  66000. function findAllImageElementsWithLocalSource( documentFragment, writer ) {
  66001. const range = writer.createRangeIn( documentFragment );
  66002. const imageElementsMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
  66003. name: 'img'
  66004. } );
  66005. const imgs = [];
  66006. for ( const value of range ) {
  66007. if ( imageElementsMatcher.match( value.item ) ) {
  66008. if ( value.item.getAttribute( 'src' ).startsWith( 'file://' ) ) {
  66009. imgs.push( value.item );
  66010. }
  66011. }
  66012. }
  66013. return imgs;
  66014. }
  66015. // Extracts all images HEX representations from a given RTF data.
  66016. //
  66017. // @param {String} rtfData The RTF data from which to extract images HEX representation.
  66018. // @returns {Array.<Object>} Array of found HEX representations. Each array item is an object containing:
  66019. //
  66020. // * {String} hex Image representation in HEX format.
  66021. // * {string} type Type of image, `image/png` or `image/jpeg`.
  66022. function extractImageDataFromRtf( rtfData ) {
  66023. if ( !rtfData ) {
  66024. return [];
  66025. }
  66026. const regexPictureHeader = /{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/;
  66027. const regexPicture = new RegExp( '(?:(' + regexPictureHeader.source + '))([\\da-fA-F\\s]+)\\}', 'g' );
  66028. const images = rtfData.match( regexPicture );
  66029. const result = [];
  66030. if ( images ) {
  66031. for ( const image of images ) {
  66032. let imageType = false;
  66033. if ( image.includes( '\\pngblip' ) ) {
  66034. imageType = 'image/png';
  66035. } else if ( image.includes( '\\jpegblip' ) ) {
  66036. imageType = 'image/jpeg';
  66037. }
  66038. if ( imageType ) {
  66039. result.push( {
  66040. hex: image.replace( regexPictureHeader, '' ).replace( /[^\da-fA-F]/g, '' ),
  66041. type: imageType
  66042. } );
  66043. }
  66044. }
  66045. }
  66046. return result;
  66047. }
  66048. // Replaces `src` attribute value of all given images with the corresponding base64 image representation.
  66049. //
  66050. // @param {Array.<module:engine/view/element~Element>} imageElements Array of image elements which will have its source replaced.
  66051. // @param {Array.<Object>} imagesHexSources Array of images hex sources (usually the result of `extractImageDataFromRtf()` function).
  66052. // The array should be the same length as `imageElements` parameter.
  66053. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  66054. function replaceImagesFileSourceWithInlineRepresentation( imageElements, imagesHexSources, writer ) {
  66055. // Assume there is an equal amount of image elements and images HEX sources so they can be matched accordingly based on existing order.
  66056. if ( imageElements.length === imagesHexSources.length ) {
  66057. for ( let i = 0; i < imageElements.length; i++ ) {
  66058. const newSrc = `data:${ imagesHexSources[ i ].type };base64,${ _convertHexToBase64( imagesHexSources[ i ].hex ) }`;
  66059. writer.setAttribute( 'src', newSrc, imageElements[ i ] );
  66060. }
  66061. }
  66062. }
  66063. /***/ }),
  66064. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js":
  66065. /*!********************************************************************************!*\
  66066. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js ***!
  66067. \********************************************************************************/
  66068. /*! exports provided: transformListItemLikeElementsIntoLists, unwrapParagraphInListItem */
  66069. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66070. "use strict";
  66071. __webpack_require__.r(__webpack_exports__);
  66072. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformListItemLikeElementsIntoLists", function() { return transformListItemLikeElementsIntoLists; });
  66073. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unwrapParagraphInListItem", function() { return unwrapParagraphInListItem; });
  66074. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  66075. /**
  66076. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  66077. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66078. */
  66079. /**
  66080. * @module paste-from-office/filters/list
  66081. */
  66082. /**
  66083. * Transforms Word specific list-like elements to the semantic HTML lists.
  66084. *
  66085. * Lists in Word are represented by block elements with special attributes like:
  66086. *
  66087. * <p class=MsoListParagraphCxSpFirst style='mso-list:l1 level1 lfo1'>...</p> // Paragraph based list.
  66088. * <h1 style='mso-list:l0 level1 lfo1'>...</h1> // Heading 1 based list.
  66089. *
  66090. * @param {module:engine/view/documentfragment~DocumentFragment} documentFragment The view structure to be transformed.
  66091. * @param {String} stylesString Styles from which list-like elements styling will be extracted.
  66092. */
  66093. function transformListItemLikeElementsIntoLists( documentFragment, stylesString ) {
  66094. if ( !documentFragment.childCount ) {
  66095. return;
  66096. }
  66097. const writer = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["UpcastWriter"]( documentFragment.document );
  66098. const itemLikeElements = findAllItemLikeElements( documentFragment, writer );
  66099. if ( !itemLikeElements.length ) {
  66100. return;
  66101. }
  66102. let currentList = null;
  66103. let currentIndentation = 1;
  66104. itemLikeElements.forEach( ( itemLikeElement, i ) => {
  66105. const isDifferentList = isNewListNeeded( itemLikeElements[ i - 1 ], itemLikeElement );
  66106. const previousItemLikeElement = isDifferentList ? null : itemLikeElements[ i - 1 ];
  66107. const indentationDifference = getIndentationDifference( previousItemLikeElement, itemLikeElement );
  66108. if ( isDifferentList ) {
  66109. currentList = null;
  66110. currentIndentation = 1;
  66111. }
  66112. if ( !currentList || indentationDifference !== 0 ) {
  66113. const listStyle = detectListStyle( itemLikeElement, stylesString );
  66114. if ( !currentList ) {
  66115. currentList = insertNewEmptyList( listStyle, itemLikeElement.element, writer );
  66116. } else if ( itemLikeElement.indent > currentIndentation ) {
  66117. const lastListItem = currentList.getChild( currentList.childCount - 1 );
  66118. const lastListItemChild = lastListItem.getChild( lastListItem.childCount - 1 );
  66119. currentList = insertNewEmptyList( listStyle, lastListItemChild, writer );
  66120. currentIndentation += 1;
  66121. } else if ( itemLikeElement.indent < currentIndentation ) {
  66122. const differentIndentation = currentIndentation - itemLikeElement.indent;
  66123. currentList = findParentListAtLevel( currentList, differentIndentation );
  66124. currentIndentation = parseInt( itemLikeElement.indent );
  66125. }
  66126. if ( itemLikeElement.indent <= currentIndentation ) {
  66127. if ( !currentList.is( 'element', listStyle.type ) ) {
  66128. currentList = writer.rename( listStyle.type, currentList );
  66129. }
  66130. }
  66131. }
  66132. const listItem = transformElementIntoListItem( itemLikeElement.element, writer );
  66133. writer.appendChild( listItem, currentList );
  66134. } );
  66135. }
  66136. /**
  66137. * Removes paragraph wrapping content inside a list item.
  66138. *
  66139. * @param {module:engine/view/documentfragment~DocumentFragment} documentFragment
  66140. * @param {module:engine/view/upcastwriter~UpcastWriter} writer
  66141. */
  66142. function unwrapParagraphInListItem( documentFragment, writer ) {
  66143. for ( const value of writer.createRangeIn( documentFragment ) ) {
  66144. const element = value.item;
  66145. if ( element.is( 'element', 'li' ) ) {
  66146. // Google Docs allows on single paragraph inside LI.
  66147. const firstChild = element.getChild( 0 );
  66148. if ( firstChild && firstChild.is( 'element', 'p' ) ) {
  66149. writer.unwrapElement( firstChild );
  66150. }
  66151. }
  66152. }
  66153. }
  66154. // Finds all list-like elements in a given document fragment.
  66155. //
  66156. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment
  66157. // in which to look for list-like nodes.
  66158. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  66159. // @returns {Array.<Object>} Array of found list-like items. Each item is an object containing:
  66160. //
  66161. // * {module:engine/src/view/element~Element} element List-like element.
  66162. // * {Number} id List item id parsed from `mso-list` style (see `getListItemData()` function).
  66163. // * {Number} order List item creation order parsed from `mso-list` style (see `getListItemData()` function).
  66164. // * {Number} indent List item indentation level parsed from `mso-list` style (see `getListItemData()` function).
  66165. function findAllItemLikeElements( documentFragment, writer ) {
  66166. const range = writer.createRangeIn( documentFragment );
  66167. // Matcher for finding list-like elements.
  66168. const itemLikeElementsMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
  66169. name: /^p|h\d+$/,
  66170. styles: {
  66171. 'mso-list': /.*/
  66172. }
  66173. } );
  66174. const itemLikeElements = [];
  66175. for ( const value of range ) {
  66176. if ( value.type === 'elementStart' && itemLikeElementsMatcher.match( value.item ) ) {
  66177. const itemData = getListItemData( value.item );
  66178. itemLikeElements.push( {
  66179. element: value.item,
  66180. id: itemData.id,
  66181. order: itemData.order,
  66182. indent: itemData.indent
  66183. } );
  66184. }
  66185. }
  66186. return itemLikeElements;
  66187. }
  66188. // Extracts list item style from the provided CSS.
  66189. //
  66190. // List item style is extracted from the CSS stylesheet. Each list with its specific style attribute
  66191. // value (`mso-list:l1 level1 lfo1`) has its dedicated properties in a CSS stylesheet defined with a selector like:
  66192. //
  66193. // @list l1:level1 { ... }
  66194. //
  66195. // It contains `mso-level-number-format` property which defines list numbering/bullet style. If this property
  66196. // is not defined it means default `decimal` numbering.
  66197. //
  66198. // Here CSS string representation is used as `mso-level-number-format` property is an invalid CSS property
  66199. // and will be removed during CSS parsing.
  66200. //
  66201. // @param {Object} listLikeItem List-like item for which list style will be searched for. Usually
  66202. // a result of `findAllItemLikeElements()` function.
  66203. // @param {String} stylesString CSS stylesheet.
  66204. // @returns {Object} result
  66205. // @returns {String} result.type List type, could be `ul` or `ol`.
  66206. // @returns {String|null} result.style List style, for example: `decimal`, `lower-roman`, etc. It is extracted
  66207. // directly from Word stylesheet and adjusted to represent proper values for the CSS `list-style-type` property.
  66208. // If it cannot be adjusted, the `null` value is returned.
  66209. function detectListStyle( listLikeItem, stylesString ) {
  66210. const listStyleRegexp = new RegExp( `@list l${ listLikeItem.id }:level${ listLikeItem.indent }\\s*({[^}]*)`, 'gi' );
  66211. const listStyleTypeRegex = /mso-level-number-format:([^;]{0,100});/gi;
  66212. const listStyleMatch = listStyleRegexp.exec( stylesString );
  66213. let listStyleType = 'decimal'; // Decimal is default one.
  66214. let type = 'ol'; // <ol> is default list.
  66215. if ( listStyleMatch && listStyleMatch[ 1 ] ) {
  66216. const listStyleTypeMatch = listStyleTypeRegex.exec( listStyleMatch[ 1 ] );
  66217. if ( listStyleTypeMatch && listStyleTypeMatch[ 1 ] ) {
  66218. listStyleType = listStyleTypeMatch[ 1 ].trim();
  66219. type = listStyleType !== 'bullet' && listStyleType !== 'image' ? 'ol' : 'ul';
  66220. }
  66221. // Styles for the numbered lists are always defined in the Word CSS stylesheet.
  66222. // Unordered lists MAY contain a value for the Word CSS definition `mso-level-text` but sometimes
  66223. // this tag is missing. And because of that, we cannot depend on that. We need to predict the list style value
  66224. // based on the list style marker element.
  66225. if ( listStyleType === 'bullet' ) {
  66226. const bulletedStyle = findBulletedListStyle( listLikeItem.element );
  66227. if ( bulletedStyle ) {
  66228. listStyleType = bulletedStyle;
  66229. }
  66230. }
  66231. }
  66232. return {
  66233. type,
  66234. style: mapListStyleDefinition( listStyleType )
  66235. };
  66236. }
  66237. // Tries to extract the `list-style-type` value based on the marker element for bulleted list.
  66238. //
  66239. // @param {module:engine/view/element~Element} element
  66240. // @returns {module:engine/view/element~Element|null}
  66241. function findBulletedListStyle( element ) {
  66242. const listMarkerElement = findListMarkerNode( element );
  66243. if ( !listMarkerElement ) {
  66244. return null;
  66245. }
  66246. const listMarker = listMarkerElement._data;
  66247. if ( listMarker === 'o' ) {
  66248. return 'circle';
  66249. } else if ( listMarker === '·' ) {
  66250. return 'disc';
  66251. }
  66252. // Word returns '§' instead of '■' for the square list style.
  66253. else if ( listMarker === '§' ) {
  66254. return 'square';
  66255. }
  66256. return null;
  66257. }
  66258. // Tries to find a text node that represents the marker element (list-style-type).
  66259. //
  66260. // @param {module:engine/view/element~Element} element
  66261. // @returns {module:engine/view/text~Text|null}
  66262. function findListMarkerNode( element ) {
  66263. // If the first child is a text node, it is the data for the element.
  66264. // The list-style marker is not present here.
  66265. if ( element.getChild( 0 ).is( '$text' ) ) {
  66266. return null;
  66267. }
  66268. for ( const childNode of element.getChildren() ) {
  66269. // The list-style marker will be inside the `<span>` element. Let's ignore all non-span elements.
  66270. // It may happen that the `<a>` element is added as the first child. Most probably, it's an anchor element.
  66271. if ( !childNode.is( 'element', 'span' ) ) {
  66272. continue;
  66273. }
  66274. const textNodeOrElement = childNode.getChild( 0 );
  66275. // If already found the marker element, use it.
  66276. if ( textNodeOrElement.is( '$text' ) ) {
  66277. return textNodeOrElement;
  66278. }
  66279. return textNodeOrElement.getChild( 0 );
  66280. }
  66281. }
  66282. // Parses the `list-style-type` value extracted directly from the Word CSS stylesheet and returns proper CSS definition.
  66283. //
  66284. // @param {String|null} value
  66285. // @returns {String|null}
  66286. function mapListStyleDefinition( value ) {
  66287. switch ( value ) {
  66288. case 'arabic-leading-zero':
  66289. return 'decimal-leading-zero';
  66290. case 'alpha-upper':
  66291. return 'upper-alpha';
  66292. case 'alpha-lower':
  66293. return 'lower-alpha';
  66294. case 'roman-upper':
  66295. return 'upper-roman';
  66296. case 'roman-lower':
  66297. return 'lower-roman';
  66298. case 'circle':
  66299. case 'disc':
  66300. case 'square':
  66301. return value;
  66302. default:
  66303. return null;
  66304. }
  66305. }
  66306. // Creates empty list of a given type and inserts it after a specified element.
  66307. //
  66308. // @param {Object} listStyle List style object which determines the type of newly created list.
  66309. // Usually a result of `detectListStyle()` function.
  66310. // @param {module:engine/view/element~Element} element Element after which list is inserted.
  66311. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  66312. // @returns {module:engine/view/element~Element} Newly created list element.
  66313. function insertNewEmptyList( listStyle, element, writer ) {
  66314. const parent = element.parent;
  66315. const list = writer.createElement( listStyle.type );
  66316. const position = parent.getChildIndex( element ) + 1;
  66317. writer.insertChild( position, list, parent );
  66318. // We do not support modifying the marker for a particular list item.
  66319. // Set the value for the `list-style-type` property directly to the list container.
  66320. if ( listStyle.style ) {
  66321. writer.setStyle( 'list-style-type', listStyle.style, list );
  66322. }
  66323. return list;
  66324. }
  66325. // Transforms a given element into a semantic list item. As the function operates on a provided
  66326. // {module:engine/src/view/element~Element element} it will modify the view structure to which this element belongs.
  66327. //
  66328. // @param {module:engine/view/element~Element} element Element which will be transformed into a list item.
  66329. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  66330. // @returns {module:engine/view/element~Element} New element to which the given one was transformed. It is
  66331. // inserted in place of the old element (the reference to the old element is lost due to renaming).
  66332. function transformElementIntoListItem( element, writer ) {
  66333. removeBulletElement( element, writer );
  66334. return writer.rename( 'li', element );
  66335. }
  66336. // Extracts list item information from Word specific list-like element style:
  66337. //
  66338. // `style="mso-list:l1 level1 lfo1"`
  66339. //
  66340. // where:
  66341. //
  66342. // * `l1` is a list id (however it does not mean this is a continuous list - see #43),
  66343. // * `level1` is a list item indentation level,
  66344. // * `lfo1` is a list insertion order in a document.
  66345. //
  66346. // @param {module:engine/view/element~Element} element Element from which style data is extracted.
  66347. // @returns {Object} result
  66348. // @returns {Number} result.id Parent list id.
  66349. // @returns {Number} result.order List item creation order.
  66350. // @returns {Number} result.indent List item indentation level.
  66351. function getListItemData( element ) {
  66352. const data = {};
  66353. const listStyle = element.getStyle( 'mso-list' );
  66354. if ( listStyle ) {
  66355. const idMatch = listStyle.match( /(^|\s{1,100})l(\d+)/i );
  66356. const orderMatch = listStyle.match( /\s{0,100}lfo(\d+)/i );
  66357. const indentMatch = listStyle.match( /\s{0,100}level(\d+)/i );
  66358. if ( idMatch && orderMatch && indentMatch ) {
  66359. data.id = idMatch[ 2 ];
  66360. data.order = orderMatch[ 1 ];
  66361. data.indent = indentMatch[ 1 ];
  66362. }
  66363. }
  66364. return data;
  66365. }
  66366. // Removes span with a numbering/bullet from a given element.
  66367. //
  66368. // @param {module:engine/view/element~Element} element
  66369. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  66370. function removeBulletElement( element, writer ) {
  66371. // Matcher for finding `span` elements holding lists numbering/bullets.
  66372. const bulletMatcher = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]( {
  66373. name: 'span',
  66374. styles: {
  66375. 'mso-list': 'Ignore'
  66376. }
  66377. } );
  66378. const range = writer.createRangeIn( element );
  66379. for ( const value of range ) {
  66380. if ( value.type === 'elementStart' && bulletMatcher.match( value.item ) ) {
  66381. writer.remove( value.item );
  66382. }
  66383. }
  66384. }
  66385. // Whether the previous and current items belong to the same list. It is determined based on `item.id`
  66386. // (extracted from `mso-list` style, see #getListItemData) and a previous sibling of the current item.
  66387. //
  66388. // However, it's quite easy to change the `id` attribute for nested lists in Word. It will break the list feature while pasting.
  66389. // Let's check also the `indent` attribute. If the difference between those two elements is equal to 1, we can assume that
  66390. // the `currentItem` is a beginning of the nested list because lists in CKEditor 5 always start with the `indent=0` attribute.
  66391. // See: https://github.com/ckeditor/ckeditor5/issues/7805.
  66392. //
  66393. // @param {Object} previousItem
  66394. // @param {Object} currentItem
  66395. // @returns {Boolean}
  66396. function isNewListNeeded( previousItem, currentItem ) {
  66397. if ( !previousItem ) {
  66398. return true;
  66399. }
  66400. if ( previousItem.id !== currentItem.id ) {
  66401. // See: https://github.com/ckeditor/ckeditor5/issues/7805.
  66402. //
  66403. // * List item 1.
  66404. // - Nested list item 1.
  66405. if ( currentItem.indent - previousItem.indent === 1 ) {
  66406. return false;
  66407. }
  66408. return true;
  66409. }
  66410. const previousSibling = currentItem.element.previousSibling;
  66411. if ( !previousSibling ) {
  66412. return true;
  66413. }
  66414. // Even with the same id the list does not have to be continuous (#43).
  66415. return !isList( previousSibling );
  66416. }
  66417. function isList( element ) {
  66418. return element.is( 'element', 'ol' ) || element.is( 'element', 'ul' );
  66419. }
  66420. // Calculates the indentation difference between two given list items (based on the indent attribute
  66421. // extracted from the `mso-list` style, see #getListItemData).
  66422. //
  66423. // @param {Object} previousItem
  66424. // @param {Object} currentItem
  66425. // @returns {Number}
  66426. function getIndentationDifference( previousItem, currentItem ) {
  66427. return previousItem ? currentItem.indent - previousItem.indent : currentItem.indent - 1;
  66428. }
  66429. // Finds the parent list element (ul/ol) of a given list element with indentation level lower by a given value.
  66430. //
  66431. // @param {module:engine/view/element~Element} listElement List element from which to start looking for a parent list.
  66432. // @param {Number} indentationDifference Indentation difference between lists.
  66433. // @returns {module:engine/view/element~Element} Found list element with indentation level lower by a given value.
  66434. function findParentListAtLevel( listElement, indentationDifference ) {
  66435. const ancestors = listElement.getAncestors( { parentFirst: true } );
  66436. let parentList = null;
  66437. let levelChange = 0;
  66438. for ( const ancestor of ancestors ) {
  66439. if ( ancestor.name === 'ul' || ancestor.name === 'ol' ) {
  66440. levelChange++;
  66441. }
  66442. if ( levelChange === indentationDifference ) {
  66443. parentList = ancestor;
  66444. break;
  66445. }
  66446. }
  66447. return parentList;
  66448. }
  66449. /***/ }),
  66450. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.js":
  66451. /*!*********************************************************************************!*\
  66452. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.js ***!
  66453. \*********************************************************************************/
  66454. /*! exports provided: parseHtml */
  66455. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66456. "use strict";
  66457. __webpack_require__.r(__webpack_exports__);
  66458. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseHtml", function() { return parseHtml; });
  66459. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  66460. /* harmony import */ var _space__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./space */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/space.js");
  66461. /**
  66462. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  66463. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66464. */
  66465. /**
  66466. * @module paste-from-office/filters/parse
  66467. */
  66468. /* globals DOMParser */
  66469. /**
  66470. * Parses provided HTML extracting contents of `<body>` and `<style>` tags.
  66471. *
  66472. * @param {String} htmlString HTML string to be parsed.
  66473. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
  66474. * @returns {Object} result
  66475. * @returns {module:engine/view/documentfragment~DocumentFragment} result.body Parsed body
  66476. * content as a traversable structure.
  66477. * @returns {String} result.bodyString Entire body content as a string.
  66478. * @returns {Array.<CSSStyleSheet>} result.styles Array of native `CSSStyleSheet` objects, each representing
  66479. * separate `style` tag from the source HTML.
  66480. * @returns {String} result.stylesString All `style` tags contents combined in the order of occurrence into one string.
  66481. */
  66482. function parseHtml( htmlString, stylesProcessor ) {
  66483. const domParser = new DOMParser();
  66484. // Remove Word specific "if comments" so content inside is not omitted by the parser.
  66485. htmlString = htmlString.replace( /<!--\[if gte vml 1]>/g, '' );
  66486. const normalizedHtml = Object(_space__WEBPACK_IMPORTED_MODULE_1__["normalizeSpacing"])( cleanContentAfterBody( htmlString ) );
  66487. // Parse htmlString as native Document object.
  66488. const htmlDocument = domParser.parseFromString( normalizedHtml, 'text/html' );
  66489. Object(_space__WEBPACK_IMPORTED_MODULE_1__["normalizeSpacerunSpans"])( htmlDocument );
  66490. // Get `innerHTML` first as transforming to View modifies the source document.
  66491. const bodyString = htmlDocument.body.innerHTML;
  66492. // Transform document.body to View.
  66493. const bodyView = documentToView( htmlDocument, stylesProcessor );
  66494. // Extract stylesheets.
  66495. const stylesObject = extractStyles( htmlDocument );
  66496. return {
  66497. body: bodyView,
  66498. bodyString,
  66499. styles: stylesObject.styles,
  66500. stylesString: stylesObject.stylesString
  66501. };
  66502. }
  66503. // Transforms native `Document` object into {@link module:engine/view/documentfragment~DocumentFragment}. Comments are skipped.
  66504. //
  66505. // @param {Document} htmlDocument Native `Document` object to be transformed.
  66506. // @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
  66507. // @returns {module:engine/view/documentfragment~DocumentFragment}
  66508. function documentToView( htmlDocument, stylesProcessor ) {
  66509. const viewDocument = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["ViewDocument"]( stylesProcessor );
  66510. const domConverter = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["DomConverter"]( viewDocument, { renderingMode: 'data' } );
  66511. const fragment = htmlDocument.createDocumentFragment();
  66512. const nodes = htmlDocument.body.childNodes;
  66513. while ( nodes.length > 0 ) {
  66514. fragment.appendChild( nodes[ 0 ] );
  66515. }
  66516. return domConverter.domToView( fragment, { skipComments: true } );
  66517. }
  66518. // Extracts both `CSSStyleSheet` and string representation from all `style` elements available in a provided `htmlDocument`.
  66519. //
  66520. // @param {Document} htmlDocument Native `Document` object from which styles will be extracted.
  66521. // @returns {Object} result
  66522. // @returns {Array.<CSSStyleSheet>} result.styles Array of native `CSSStyleSheet` object, each representing
  66523. // separate `style` tag from the source object.
  66524. // @returns {String} result.stylesString All `style` tags contents combined in the order of occurrence as one string.
  66525. function extractStyles( htmlDocument ) {
  66526. const styles = [];
  66527. const stylesString = [];
  66528. const styleTags = Array.from( htmlDocument.getElementsByTagName( 'style' ) );
  66529. for ( const style of styleTags ) {
  66530. if ( style.sheet && style.sheet.cssRules && style.sheet.cssRules.length ) {
  66531. styles.push( style.sheet );
  66532. stylesString.push( style.innerHTML );
  66533. }
  66534. }
  66535. return {
  66536. styles,
  66537. stylesString: stylesString.join( ' ' )
  66538. };
  66539. }
  66540. // Removes leftover content from between closing </body> and closing </html> tag:
  66541. //
  66542. // <html><body><p>Foo Bar</p></body><span>Fo</span></html> -> <html><body><p>Foo Bar</p></body></html>
  66543. //
  66544. // This function is used as specific browsers (Edge) add some random content after `body` tag when pasting from Word.
  66545. // @param {String} htmlString The HTML string to be cleaned.
  66546. // @returns {String} The HTML string with leftover content removed.
  66547. function cleanContentAfterBody( htmlString ) {
  66548. const bodyCloseTag = '</body>';
  66549. const htmlCloseTag = '</html>';
  66550. const bodyCloseIndex = htmlString.indexOf( bodyCloseTag );
  66551. if ( bodyCloseIndex < 0 ) {
  66552. return htmlString;
  66553. }
  66554. const htmlCloseIndex = htmlString.indexOf( htmlCloseTag, bodyCloseIndex + bodyCloseTag.length );
  66555. return htmlString.substring( 0, bodyCloseIndex + bodyCloseTag.length ) +
  66556. ( htmlCloseIndex >= 0 ? htmlString.substring( htmlCloseIndex ) : '' );
  66557. }
  66558. /***/ }),
  66559. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeboldwrapper.js":
  66560. /*!*********************************************************************************************!*\
  66561. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeboldwrapper.js ***!
  66562. \*********************************************************************************************/
  66563. /*! exports provided: default */
  66564. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66565. "use strict";
  66566. __webpack_require__.r(__webpack_exports__);
  66567. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return removeBoldWrapper; });
  66568. /**
  66569. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  66570. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66571. */
  66572. /**
  66573. * @module paste-from-office/filters/removeboldwrapper
  66574. */
  66575. /**
  66576. * Removes `<b>` tag wrapper added by Google Docs to a copied content.
  66577. *
  66578. * @param {module:engine/view/documentfragment~DocumentFragment} documentFragment element `data.content` obtained from clipboard
  66579. * @param {module:engine/view/upcastwriter~UpcastWriter} writer
  66580. */
  66581. function removeBoldWrapper( documentFragment, writer ) {
  66582. for ( const child of documentFragment.getChildren() ) {
  66583. if ( child.is( 'element', 'b' ) && child.getStyle( 'font-weight' ) === 'normal' ) {
  66584. const childIndex = documentFragment.getChildIndex( child );
  66585. writer.remove( child );
  66586. writer.insertChild( childIndex, child.getChildren(), documentFragment );
  66587. }
  66588. }
  66589. }
  66590. /***/ }),
  66591. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/space.js":
  66592. /*!*********************************************************************************!*\
  66593. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/space.js ***!
  66594. \*********************************************************************************/
  66595. /*! exports provided: normalizeSpacing, normalizeSpacerunSpans */
  66596. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66597. "use strict";
  66598. __webpack_require__.r(__webpack_exports__);
  66599. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeSpacing", function() { return normalizeSpacing; });
  66600. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeSpacerunSpans", function() { return normalizeSpacerunSpans; });
  66601. /**
  66602. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  66603. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66604. */
  66605. /**
  66606. * @module paste-from-office/filters/space
  66607. */
  66608. /**
  66609. * Replaces last space preceding elements closing tag with `&nbsp;`. Such operation prevents spaces from being removed
  66610. * during further DOM/View processing (see especially {@link module:engine/view/domconverter~DomConverter#_processDataFromDomText}).
  66611. * This method also takes into account Word specific `<o:p></o:p>` empty tags.
  66612. * Additionally multiline sequences of spaces and new lines between tags are removed (see #39 and #40).
  66613. *
  66614. * @param {String} htmlString HTML string in which spacing should be normalized.
  66615. * @returns {String} Input HTML with spaces normalized.
  66616. */
  66617. function normalizeSpacing( htmlString ) {
  66618. // Run normalizeSafariSpaceSpans() two times to cover nested spans.
  66619. return normalizeSafariSpaceSpans( normalizeSafariSpaceSpans( htmlString ) )
  66620. // Remove all \r\n from "spacerun spans" so the last replace line doesn't strip all whitespaces.
  66621. .replace( /(<span\s+style=['"]mso-spacerun:yes['"]>[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g, '$1$2' )
  66622. .replace( /<span\s+style=['"]mso-spacerun:yes['"]><\/span>/g, '' )
  66623. .replace( / <\//g, '\u00A0</' )
  66624. .replace( / <o:p><\/o:p>/g, '\u00A0<o:p></o:p>' )
  66625. // Remove <o:p> block filler from empty paragraph. Safari uses \u00A0 instead of &nbsp;.
  66626. .replace( /<o:p>(&nbsp;|\u00A0)<\/o:p>/g, '' )
  66627. // Remove all whitespaces when they contain any \r or \n.
  66628. .replace( />([^\S\r\n]*[\r\n]\s*)</g, '><' );
  66629. }
  66630. /**
  66631. * Normalizes spacing in special Word `spacerun spans` (`<span style='mso-spacerun:yes'>\s+</span>`) by replacing
  66632. * all spaces with `&nbsp; ` pairs. This prevents spaces from being removed during further DOM/View processing
  66633. * (see especially {@link module:engine/view/domconverter~DomConverter#_processDataFromDomText}).
  66634. *
  66635. * @param {Document} htmlDocument Native `Document` object in which spacing should be normalized.
  66636. */
  66637. function normalizeSpacerunSpans( htmlDocument ) {
  66638. htmlDocument.querySelectorAll( 'span[style*=spacerun]' ).forEach( el => {
  66639. const innerTextLength = el.innerText.length || 0;
  66640. el.innerHTML = Array( innerTextLength + 1 ).join( '\u00A0 ' ).substr( 0, innerTextLength );
  66641. } );
  66642. }
  66643. // Normalizes specific spacing generated by Safari when content pasted from Word (`<span class="Apple-converted-space"> </span>`)
  66644. // by replacing all spaces sequences longer than 1 space with `&nbsp; ` pairs. This prevents spaces from being removed during
  66645. // further DOM/View processing (see especially {@link module:engine/view/domconverter~DomConverter#_processDataFromDomText}).
  66646. //
  66647. // This function is similar to {@link module:clipboard/utils/normalizeclipboarddata normalizeClipboardData util} but uses
  66648. // regular spaces / &nbsp; sequence for replacement.
  66649. //
  66650. // @param {String} htmlString HTML string in which spacing should be normalized
  66651. // @returns {String} Input HTML with spaces normalized.
  66652. function normalizeSafariSpaceSpans( htmlString ) {
  66653. return htmlString.replace( /<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g, ( fullMatch, spaces ) => {
  66654. return spaces.length === 1 ? ' ' : Array( spaces.length + 1 ).join( '\u00A0 ' ).substr( 0, spaces.length );
  66655. } );
  66656. }
  66657. /***/ }),
  66658. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js":
  66659. /*!****************************************************************************************************!*\
  66660. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js ***!
  66661. \****************************************************************************************************/
  66662. /*! exports provided: default */
  66663. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66664. "use strict";
  66665. __webpack_require__.r(__webpack_exports__);
  66666. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return GoogleDocsNormalizer; });
  66667. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  66668. /* harmony import */ var _filters_removeboldwrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../filters/removeboldwrapper */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeboldwrapper.js");
  66669. /* harmony import */ var _filters_list__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../filters/list */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js");
  66670. /**
  66671. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  66672. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66673. */
  66674. /**
  66675. * @module paste-from-office/normalizers/googledocsnormalizer
  66676. */
  66677. const googleDocsMatch = /id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;
  66678. /**
  66679. * Normalizer for the content pasted from Google Docs.
  66680. *
  66681. * @implements module:paste-from-office/normalizer~Normalizer
  66682. */
  66683. class GoogleDocsNormalizer {
  66684. /**
  66685. * Creates a new `GoogleDocsNormalizer` instance.
  66686. *
  66687. * @param {module:engine/view/document~Document} document View document.
  66688. */
  66689. constructor( document ) {
  66690. /**
  66691. * @readonly
  66692. * @type {module:engine/view/document~Document}
  66693. */
  66694. this.document = document;
  66695. }
  66696. /**
  66697. * @inheritDoc
  66698. */
  66699. isActive( htmlString ) {
  66700. return googleDocsMatch.test( htmlString );
  66701. }
  66702. /**
  66703. * @inheritDoc
  66704. */
  66705. execute( data ) {
  66706. const writer = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["UpcastWriter"]( this.document );
  66707. const { body: documentFragment } = data._parsedData;
  66708. Object(_filters_removeboldwrapper__WEBPACK_IMPORTED_MODULE_1__["default"])( documentFragment, writer );
  66709. Object(_filters_list__WEBPACK_IMPORTED_MODULE_2__["unwrapParagraphInListItem"])( documentFragment, writer );
  66710. data.content = documentFragment;
  66711. }
  66712. }
  66713. /***/ }),
  66714. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/mswordnormalizer.js":
  66715. /*!************************************************************************************************!*\
  66716. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/mswordnormalizer.js ***!
  66717. \************************************************************************************************/
  66718. /*! exports provided: default */
  66719. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66720. "use strict";
  66721. __webpack_require__.r(__webpack_exports__);
  66722. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MSWordNormalizer; });
  66723. /* harmony import */ var _filters_list__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../filters/list */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js");
  66724. /* harmony import */ var _filters_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../filters/image */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.js");
  66725. /**
  66726. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  66727. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66728. */
  66729. /**
  66730. * @module paste-from-office/normalizers/mswordnormalizer
  66731. */
  66732. const msWordMatch1 = /<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i;
  66733. const msWordMatch2 = /xmlns:o="urn:schemas-microsoft-com/i;
  66734. /**
  66735. * Normalizer for the content pasted from Microsoft Word.
  66736. *
  66737. * @implements module:paste-from-office/normalizer~Normalizer
  66738. */
  66739. class MSWordNormalizer {
  66740. /**
  66741. * Creates a new `MSWordNormalizer` instance.
  66742. *
  66743. * @param {module:engine/view/document~Document} document View document.
  66744. */
  66745. constructor( document ) {
  66746. /**
  66747. * @readonly
  66748. * @type {module:engine/view/document~Document}
  66749. */
  66750. this.document = document;
  66751. }
  66752. /**
  66753. * @inheritDoc
  66754. */
  66755. isActive( htmlString ) {
  66756. return msWordMatch1.test( htmlString ) || msWordMatch2.test( htmlString );
  66757. }
  66758. /**
  66759. * @inheritDoc
  66760. */
  66761. execute( data ) {
  66762. const { body: documentFragment, stylesString } = data._parsedData;
  66763. Object(_filters_list__WEBPACK_IMPORTED_MODULE_0__["transformListItemLikeElementsIntoLists"])( documentFragment, stylesString );
  66764. Object(_filters_image__WEBPACK_IMPORTED_MODULE_1__["replaceImagesSourceWithBase64"])( documentFragment, data.dataTransfer.getData( 'text/rtf' ) );
  66765. data.content = documentFragment;
  66766. }
  66767. }
  66768. /***/ }),
  66769. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js":
  66770. /*!***********************************************************************************!*\
  66771. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js ***!
  66772. \***********************************************************************************/
  66773. /*! exports provided: default */
  66774. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66775. "use strict";
  66776. __webpack_require__.r(__webpack_exports__);
  66777. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PasteFromOffice; });
  66778. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  66779. /* harmony import */ var ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/clipboard */ "./node_modules/ckeditor5/src/clipboard.js");
  66780. /* harmony import */ var _normalizers_googledocsnormalizer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./normalizers/googledocsnormalizer */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js");
  66781. /* harmony import */ var _normalizers_mswordnormalizer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./normalizers/mswordnormalizer */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/mswordnormalizer.js");
  66782. /* harmony import */ var _filters_parse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./filters/parse */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.js");
  66783. /**
  66784. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  66785. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66786. */
  66787. /**
  66788. * @module paste-from-office/pastefromoffice
  66789. */
  66790. /**
  66791. * The Paste from Office plugin.
  66792. *
  66793. * This plugin handles content pasted from Office apps and transforms it (if necessary)
  66794. * to a valid structure which can then be understood by the editor features.
  66795. *
  66796. * Transformation is made by a set of predefined {@link module:paste-from-office/normalizer~Normalizer normalizers}.
  66797. * This plugin includes following normalizers:
  66798. * * {@link module:paste-from-office/normalizers/mswordnormalizer~MSWordNormalizer Microsoft Word normalizer}
  66799. * * {@link module:paste-from-office/normalizers/googledocsnormalizer~GoogleDocsNormalizer Google Docs normalizer}
  66800. *
  66801. * For more information about this feature check the {@glink api/paste-from-office package page}.
  66802. *
  66803. * @extends module:core/plugin~Plugin
  66804. */
  66805. class PasteFromOffice extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  66806. /**
  66807. * @inheritDoc
  66808. */
  66809. static get pluginName() {
  66810. return 'PasteFromOffice';
  66811. }
  66812. /**
  66813. * @inheritDoc
  66814. */
  66815. static get requires() {
  66816. return [ ckeditor5_src_clipboard__WEBPACK_IMPORTED_MODULE_1__["ClipboardPipeline"] ];
  66817. }
  66818. /**
  66819. * @inheritDoc
  66820. */
  66821. init() {
  66822. const editor = this.editor;
  66823. const viewDocument = editor.editing.view.document;
  66824. const normalizers = [];
  66825. normalizers.push( new _normalizers_mswordnormalizer__WEBPACK_IMPORTED_MODULE_3__["default"]( viewDocument ) );
  66826. normalizers.push( new _normalizers_googledocsnormalizer__WEBPACK_IMPORTED_MODULE_2__["default"]( viewDocument ) );
  66827. editor.plugins.get( 'ClipboardPipeline' ).on(
  66828. 'inputTransformation',
  66829. ( evt, data ) => {
  66830. if ( data._isTransformedWithPasteFromOffice ) {
  66831. return;
  66832. }
  66833. const htmlString = data.dataTransfer.getData( 'text/html' );
  66834. const activeNormalizer = normalizers.find( normalizer => normalizer.isActive( htmlString ) );
  66835. if ( activeNormalizer ) {
  66836. data._parsedData = Object(_filters_parse__WEBPACK_IMPORTED_MODULE_4__["parseHtml"])( htmlString, viewDocument.stylesProcessor );
  66837. activeNormalizer.execute( data );
  66838. data._isTransformedWithPasteFromOffice = true;
  66839. }
  66840. },
  66841. { priority: 'high' }
  66842. );
  66843. }
  66844. }
  66845. /***/ }),
  66846. /***/ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformat.js":
  66847. /*!****************************************************************************!*\
  66848. !*** ./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformat.js ***!
  66849. \****************************************************************************/
  66850. /*! exports provided: default */
  66851. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66852. "use strict";
  66853. __webpack_require__.r(__webpack_exports__);
  66854. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveFormat; });
  66855. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  66856. /* harmony import */ var _removeformatui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./removeformatui */ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatui.js");
  66857. /* harmony import */ var _removeformatediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./removeformatediting */ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatediting.js");
  66858. /**
  66859. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  66860. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66861. */
  66862. /**
  66863. * @module remove-format/removeformat
  66864. */
  66865. /**
  66866. * The remove format plugin.
  66867. *
  66868. * This is a "glue" plugin which loads the {@link module:remove-format/removeformatediting~RemoveFormatEditing}
  66869. * and {@link module:remove-format/removeformatui~RemoveFormatUI} plugins.
  66870. *
  66871. * For a detailed overview, check out the {@glink features/remove-format remove format} feature documentation.
  66872. *
  66873. * @extends module:core/plugin~Plugin
  66874. */
  66875. class RemoveFormat extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  66876. /**
  66877. * @inheritDoc
  66878. */
  66879. static get requires() {
  66880. return [ _removeformatediting__WEBPACK_IMPORTED_MODULE_2__["default"], _removeformatui__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  66881. }
  66882. /**
  66883. * @inheritDoc
  66884. */
  66885. static get pluginName() {
  66886. return 'RemoveFormat';
  66887. }
  66888. }
  66889. /***/ }),
  66890. /***/ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatcommand.js":
  66891. /*!***********************************************************************************!*\
  66892. !*** ./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatcommand.js ***!
  66893. \***********************************************************************************/
  66894. /*! exports provided: default */
  66895. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66896. "use strict";
  66897. __webpack_require__.r(__webpack_exports__);
  66898. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveFormatCommand; });
  66899. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  66900. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  66901. /**
  66902. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  66903. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66904. */
  66905. /**
  66906. * @module remove-format/removeformatcommand
  66907. */
  66908. /**
  66909. * The remove format command.
  66910. *
  66911. * It is used by the {@link module:remove-format/removeformat~RemoveFormat remove format feature}
  66912. * to clear the formatting in the selection.
  66913. *
  66914. * editor.execute( 'removeFormat' );
  66915. *
  66916. * @extends module:core/command~Command
  66917. */
  66918. class RemoveFormatCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  66919. /**
  66920. * @inheritDoc
  66921. */
  66922. refresh() {
  66923. const model = this.editor.model;
  66924. this.isEnabled = !!Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this._getFormattingItems( model.document.selection, model.schema ) );
  66925. }
  66926. /**
  66927. * @inheritDoc
  66928. */
  66929. execute() {
  66930. const model = this.editor.model;
  66931. const schema = model.schema;
  66932. model.change( writer => {
  66933. for ( const item of this._getFormattingItems( model.document.selection, schema ) ) {
  66934. if ( item.is( 'selection' ) ) {
  66935. for ( const attributeName of this._getFormattingAttributes( item, schema ) ) {
  66936. writer.removeSelectionAttribute( attributeName );
  66937. }
  66938. } else {
  66939. // Workaround for items with multiple removable attributes. See
  66940. // https://github.com/ckeditor/ckeditor5-remove-format/pull/1#pullrequestreview-220515609
  66941. const itemRange = writer.createRangeOn( item );
  66942. for ( const attributeName of this._getFormattingAttributes( item, schema ) ) {
  66943. writer.removeAttribute( attributeName, itemRange );
  66944. }
  66945. }
  66946. }
  66947. } );
  66948. }
  66949. /**
  66950. * Returns an iterable of items in a selection (including the selection itself) that have formatting model
  66951. * attributes to be removed by the feature.
  66952. *
  66953. * @protected
  66954. * @param {module:engine/model/documentselection~DocumentSelection} selection
  66955. * @param {module:engine/model/schema~Schema} schema The schema describing the item.
  66956. * @returns {Iterable.<module:engine/model/item~Item>|Iterable.<module:engine/model/documentselection~DocumentSelection>}
  66957. */
  66958. * _getFormattingItems( selection, schema ) {
  66959. const itemHasRemovableFormatting = item => {
  66960. return !!Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( this._getFormattingAttributes( item, schema ) );
  66961. };
  66962. // Check formatting on selected items that are not blocks.
  66963. for ( const curRange of selection.getRanges() ) {
  66964. for ( const item of curRange.getItems() ) {
  66965. if ( !schema.isBlock( item ) && itemHasRemovableFormatting( item ) ) {
  66966. yield item;
  66967. }
  66968. }
  66969. }
  66970. // Check formatting from selected blocks.
  66971. for ( const block of selection.getSelectedBlocks() ) {
  66972. if ( itemHasRemovableFormatting( block ) ) {
  66973. yield block;
  66974. }
  66975. }
  66976. // Finally the selection might be formatted as well, so make sure to check it.
  66977. if ( itemHasRemovableFormatting( selection ) ) {
  66978. yield selection;
  66979. }
  66980. }
  66981. /**
  66982. * Returns an iterable of formatting attributes of a given model item.
  66983. *
  66984. * **Note:** Formatting items have the `isFormatting` property set to `true`.
  66985. *
  66986. * @protected
  66987. * @param {module:engine/model/item~Item|module:engine/model/documentselection~DocumentSelection} item
  66988. * @param {module:engine/model/schema~Schema} schema The schema describing the item.
  66989. * @returns {Iterable.<String>} The names of formatting attributes found in a given item.
  66990. */
  66991. * _getFormattingAttributes( item, schema ) {
  66992. for ( const [ attributeName ] of item.getAttributes() ) {
  66993. const attributeProperties = schema.getAttributeProperties( attributeName );
  66994. if ( attributeProperties && attributeProperties.isFormatting ) {
  66995. yield attributeName;
  66996. }
  66997. }
  66998. }
  66999. }
  67000. /***/ }),
  67001. /***/ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatediting.js":
  67002. /*!***********************************************************************************!*\
  67003. !*** ./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatediting.js ***!
  67004. \***********************************************************************************/
  67005. /*! exports provided: default */
  67006. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67007. "use strict";
  67008. __webpack_require__.r(__webpack_exports__);
  67009. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveFormatEditing; });
  67010. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  67011. /* harmony import */ var _removeformatcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./removeformatcommand */ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatcommand.js");
  67012. /**
  67013. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67014. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67015. */
  67016. /**
  67017. * @module remove-format/removeformatediting
  67018. */
  67019. /**
  67020. * The remove format editing plugin.
  67021. *
  67022. * It registers the {@link module:remove-format/removeformatcommand~RemoveFormatCommand removeFormat} command.
  67023. *
  67024. * @extends module:core/plugin~Plugin
  67025. */
  67026. class RemoveFormatEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  67027. /**
  67028. * @inheritDoc
  67029. */
  67030. static get pluginName() {
  67031. return 'RemoveFormatEditing';
  67032. }
  67033. /**
  67034. * @inheritDoc
  67035. */
  67036. init() {
  67037. const editor = this.editor;
  67038. editor.commands.add( 'removeFormat', new _removeformatcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  67039. }
  67040. }
  67041. /***/ }),
  67042. /***/ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatui.js":
  67043. /*!******************************************************************************!*\
  67044. !*** ./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatui.js ***!
  67045. \******************************************************************************/
  67046. /*! exports provided: default */
  67047. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67048. "use strict";
  67049. __webpack_require__.r(__webpack_exports__);
  67050. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveFormatUI; });
  67051. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  67052. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  67053. /* harmony import */ var _theme_icons_remove_format_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/remove-format.svg */ "./node_modules/@ckeditor/ckeditor5-remove-format/theme/icons/remove-format.svg");
  67054. /**
  67055. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67056. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67057. */
  67058. /**
  67059. * @module remove-format/removeformatui
  67060. */
  67061. const REMOVE_FORMAT = 'removeFormat';
  67062. /**
  67063. * The remove format UI plugin. It registers the `'removeFormat'` button which can be
  67064. * used in the toolbar.
  67065. *
  67066. * @extends module:core/plugin~Plugin
  67067. */
  67068. class RemoveFormatUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  67069. /**
  67070. * @inheritDoc
  67071. */
  67072. static get pluginName() {
  67073. return 'RemoveFormatUI';
  67074. }
  67075. /**
  67076. * @inheritDoc
  67077. */
  67078. init() {
  67079. const editor = this.editor;
  67080. const t = editor.t;
  67081. editor.ui.componentFactory.add( REMOVE_FORMAT, locale => {
  67082. const command = editor.commands.get( REMOVE_FORMAT );
  67083. const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["ButtonView"]( locale );
  67084. view.set( {
  67085. label: t( 'Remove Format' ),
  67086. icon: _theme_icons_remove_format_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  67087. tooltip: true
  67088. } );
  67089. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  67090. // Execute the command.
  67091. this.listenTo( view, 'execute', () => {
  67092. editor.execute( REMOVE_FORMAT );
  67093. editor.editing.view.focus();
  67094. } );
  67095. return view;
  67096. } );
  67097. }
  67098. }
  67099. /***/ }),
  67100. /***/ "./node_modules/@ckeditor/ckeditor5-remove-format/theme/icons/remove-format.svg":
  67101. /*!**************************************************************************************!*\
  67102. !*** ./node_modules/@ckeditor/ckeditor5-remove-format/theme/icons/remove-format.svg ***!
  67103. \**************************************************************************************/
  67104. /*! exports provided: default */
  67105. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67106. "use strict";
  67107. __webpack_require__.r(__webpack_exports__);
  67108. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8.69 14.915c.053.052.173.083.36.093a.366.366 0 0 1 .345.485l-.003.01a.738.738 0 0 1-.697.497h-2.67a.374.374 0 0 1-.353-.496l.013-.038a.681.681 0 0 1 .644-.458c.197-.012.325-.043.386-.093a.28.28 0 0 0 .072-.11L9.592 4.5H6.269c-.359-.017-.609.013-.75.09-.142.078-.289.265-.442.563-.192.29-.516.464-.864.464H4.17a.43.43 0 0 1-.407-.569L4.46 3h13.08l-.62 2.043a.81.81 0 0 1-.775.574h-.114a.486.486 0 0 1-.486-.486c.001-.284-.054-.464-.167-.54-.112-.076-.367-.106-.766-.091h-3.28l-2.68 10.257c-.006.074.007.127.038.158zM3 17h8a.5.5 0 1 1 0 1H3a.5.5 0 1 1 0-1zm11.299 1.17a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.06-1.06l1.415 1.414 1.414-1.415a.75.75 0 1 1 1.06 1.06l-1.413 1.415 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414-1.414 1.414z\"/></svg>");
  67109. /***/ }),
  67110. /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/index.js":
  67111. /*!******************************************************************!*\
  67112. !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/index.js ***!
  67113. \******************************************************************/
  67114. /*! exports provided: SelectAll, SelectAllEditing, SelectAllUI */
  67115. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67116. "use strict";
  67117. __webpack_require__.r(__webpack_exports__);
  67118. /* harmony import */ var _selectall__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./selectall */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectall.js");
  67119. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAll", function() { return _selectall__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  67120. /* harmony import */ var _selectallediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./selectallediting */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js");
  67121. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAllEditing", function() { return _selectallediting__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  67122. /* harmony import */ var _selectallui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selectallui */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js");
  67123. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAllUI", function() { return _selectallui__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  67124. /**
  67125. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67126. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67127. */
  67128. /**
  67129. * @module select-all
  67130. */
  67131. /***/ }),
  67132. /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectall.js":
  67133. /*!**********************************************************************!*\
  67134. !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/selectall.js ***!
  67135. \**********************************************************************/
  67136. /*! exports provided: default */
  67137. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67138. "use strict";
  67139. __webpack_require__.r(__webpack_exports__);
  67140. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectAll; });
  67141. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  67142. /* harmony import */ var _selectallediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./selectallediting */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js");
  67143. /* harmony import */ var _selectallui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selectallui */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js");
  67144. /**
  67145. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67146. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67147. */
  67148. /**
  67149. * @module select-all/selectall
  67150. */
  67151. /**
  67152. * The select all feature.
  67153. *
  67154. * This is a "glue" plugin which loads the {@link module:select-all/selectallediting~SelectAllEditing select all editing feature}
  67155. * and the {@link module:select-all/selectallui~SelectAllUI select all UI feature}.
  67156. *
  67157. * Please refer to the documentation of individual features to learn more.
  67158. *
  67159. * @extends module:core/plugin~Plugin
  67160. */
  67161. class SelectAll extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  67162. /**
  67163. * @inheritDoc
  67164. */
  67165. static get requires() {
  67166. return [ _selectallediting__WEBPACK_IMPORTED_MODULE_1__["default"], _selectallui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  67167. }
  67168. /**
  67169. * @inheritDoc
  67170. */
  67171. static get pluginName() {
  67172. return 'SelectAll';
  67173. }
  67174. }
  67175. /***/ }),
  67176. /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallcommand.js":
  67177. /*!*****************************************************************************!*\
  67178. !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/selectallcommand.js ***!
  67179. \*****************************************************************************/
  67180. /*! exports provided: default */
  67181. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67182. "use strict";
  67183. __webpack_require__.r(__webpack_exports__);
  67184. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectAllCommand; });
  67185. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  67186. /**
  67187. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67188. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67189. */
  67190. /**
  67191. * @module select-all/selectallcommand
  67192. */
  67193. /**
  67194. * The select all command.
  67195. *
  67196. * It is used by the {@link module:select-all/selectallediting~SelectAllEditing select all editing feature} to handle
  67197. * the <kbd>Ctrl/⌘</kbd>+<kbd>A</kbd> keystroke.
  67198. *
  67199. * Executing this command changes the {@glink framework/guides/architecture/editing-engine#model model}
  67200. * selection so it contains the entire content of the editable root of the editor the selection is
  67201. * {@link module:engine/model/selection~Selection#anchor anchored} in.
  67202. *
  67203. * If the selection was anchored in a {@glink framework/guides/tutorials/implementing-a-block-widget nested editable}
  67204. * (e.g. a caption of an image), the new selection will contain its entire content. Successive executions of this command
  67205. * will expand the selection to encompass more and more content up to the entire editable root of the editor.
  67206. *
  67207. * @extends module:core/command~Command
  67208. */
  67209. class SelectAllCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  67210. /**
  67211. * @inheritDoc
  67212. */
  67213. constructor( editor ) {
  67214. super( editor );
  67215. // It does not affect data so should be enabled in read-only mode.
  67216. this.affectsData = false;
  67217. }
  67218. /**
  67219. * @inheritDoc
  67220. */
  67221. execute() {
  67222. const model = this.editor.model;
  67223. const selection = model.document.selection;
  67224. let scopeElement = model.schema.getLimitElement( selection );
  67225. // If an entire scope is selected, or the selection's ancestor is not a scope yet,
  67226. // browse through ancestors to find the enclosing parent scope.
  67227. if ( selection.containsEntireContent( scopeElement ) || !isSelectAllScope( model.schema, scopeElement ) ) {
  67228. do {
  67229. scopeElement = scopeElement.parent;
  67230. // Do nothing, if the entire `root` is already selected.
  67231. if ( !scopeElement ) {
  67232. return;
  67233. }
  67234. } while ( !isSelectAllScope( model.schema, scopeElement ) );
  67235. }
  67236. model.change( writer => {
  67237. writer.setSelection( scopeElement, 'in' );
  67238. } );
  67239. }
  67240. }
  67241. // Checks whether the element is a valid select-all scope.
  67242. // Returns true, if the element is a {@link module:engine/model/schema~Schema#isLimit limit},
  67243. // and can contain any text or paragraph.
  67244. //
  67245. // @param {module:engine/model/schema~Schema} schema The schema to check against.
  67246. // @param {module:engine/model/element~Element} element
  67247. // @return {Boolean}
  67248. function isSelectAllScope( schema, element ) {
  67249. return schema.isLimit( element ) && ( schema.checkChild( element, '$text' ) || schema.checkChild( element, 'paragraph' ) );
  67250. }
  67251. /***/ }),
  67252. /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js":
  67253. /*!*****************************************************************************!*\
  67254. !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js ***!
  67255. \*****************************************************************************/
  67256. /*! exports provided: default */
  67257. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67258. "use strict";
  67259. __webpack_require__.r(__webpack_exports__);
  67260. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectAllEditing; });
  67261. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  67262. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  67263. /* harmony import */ var _selectallcommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selectallcommand */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallcommand.js");
  67264. /**
  67265. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67266. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67267. */
  67268. /**
  67269. * @module select-all/selectallediting
  67270. */
  67271. const SELECT_ALL_KEYSTROKE = Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["parseKeystroke"])( 'Ctrl+A' );
  67272. /**
  67273. * The select all editing feature.
  67274. *
  67275. * It registers the `'selectAll'` {@link module:select-all/selectallcommand~SelectAllCommand command}
  67276. * and the <kbd>Ctrl/⌘</kbd>+<kbd>A</kbd> keystroke listener which executes it.
  67277. *
  67278. * @extends module:core/plugin~Plugin
  67279. */
  67280. class SelectAllEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  67281. /**
  67282. * @inheritDoc
  67283. */
  67284. static get pluginName() {
  67285. return 'SelectAllEditing';
  67286. }
  67287. /**
  67288. * @inheritDoc
  67289. */
  67290. init() {
  67291. const editor = this.editor;
  67292. const view = editor.editing.view;
  67293. const viewDocument = view.document;
  67294. editor.commands.add( 'selectAll', new _selectallcommand__WEBPACK_IMPORTED_MODULE_2__["default"]( editor ) );
  67295. this.listenTo( viewDocument, 'keydown', ( eventInfo, domEventData ) => {
  67296. if ( Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["getCode"])( domEventData ) === SELECT_ALL_KEYSTROKE ) {
  67297. editor.execute( 'selectAll' );
  67298. domEventData.preventDefault();
  67299. }
  67300. } );
  67301. }
  67302. }
  67303. /***/ }),
  67304. /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js":
  67305. /*!************************************************************************!*\
  67306. !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js ***!
  67307. \************************************************************************/
  67308. /*! exports provided: default */
  67309. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67310. "use strict";
  67311. __webpack_require__.r(__webpack_exports__);
  67312. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectAllUI; });
  67313. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  67314. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  67315. /* harmony import */ var _theme_icons_select_all_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/select-all.svg */ "./node_modules/@ckeditor/ckeditor5-select-all/theme/icons/select-all.svg");
  67316. /**
  67317. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67318. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67319. */
  67320. /**
  67321. * @module select-all/selectallui
  67322. */
  67323. /**
  67324. * The select all UI feature.
  67325. *
  67326. * It registers the `'selectAll'` UI button in the editor's
  67327. * {@link module:ui/componentfactory~ComponentFactory component factory}. When clicked, the button
  67328. * executes the {@link module:select-all/selectallcommand~SelectAllCommand select all command}.
  67329. *
  67330. * @extends module:core/plugin~Plugin
  67331. */
  67332. class SelectAllUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  67333. /**
  67334. * @inheritDoc
  67335. */
  67336. static get pluginName() {
  67337. return 'SelectAllUI';
  67338. }
  67339. /**
  67340. * @inheritDoc
  67341. */
  67342. init() {
  67343. const editor = this.editor;
  67344. editor.ui.componentFactory.add( 'selectAll', locale => {
  67345. const command = editor.commands.get( 'selectAll' );
  67346. const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  67347. const t = locale.t;
  67348. view.set( {
  67349. label: t( 'Select all' ),
  67350. icon: _theme_icons_select_all_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  67351. keystroke: 'Ctrl+A',
  67352. tooltip: true
  67353. } );
  67354. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  67355. // Execute the command.
  67356. this.listenTo( view, 'execute', () => {
  67357. editor.execute( 'selectAll' );
  67358. editor.editing.view.focus();
  67359. } );
  67360. return view;
  67361. } );
  67362. }
  67363. }
  67364. /***/ }),
  67365. /***/ "./node_modules/@ckeditor/ckeditor5-select-all/theme/icons/select-all.svg":
  67366. /*!********************************************************************************!*\
  67367. !*** ./node_modules/@ckeditor/ckeditor5-select-all/theme/icons/select-all.svg ***!
  67368. \********************************************************************************/
  67369. /*! exports provided: default */
  67370. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67371. "use strict";
  67372. __webpack_require__.r(__webpack_exports__);
  67373. /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M.75 15.5a.75.75 0 0 1 .75.75V18l.008.09A.5.5 0 0 0 2 18.5h1.75a.75.75 0 1 1 0 1.5H1.5l-.144-.007a1.5 1.5 0 0 1-1.35-1.349L0 18.5v-2.25a.75.75 0 0 1 .75-.75zm18.5 0a.75.75 0 0 1 .75.75v2.25l-.007.144a1.5 1.5 0 0 1-1.349 1.35L18.5 20h-2.25a.75.75 0 1 1 0-1.5H18a.5.5 0 0 0 .492-.41L18.5 18v-1.75a.75.75 0 0 1 .75-.75zm-10.45 3c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm.45-5.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5h8.5zM1.3 11c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM1.3 7c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5h-2.5a.75.75 0 1 1 0-1.5h2.5zm-5 0a.75.75 0 1 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5h5.5zm-6.5-5a.75.75 0 0 1 0 1.5H2a.5.5 0 0 0-.492.41L1.5 2v1.75a.75.75 0 0 1-1.5 0V1.5l.007-.144A1.5 1.5 0 0 1 1.356.006L1.5 0h2.25zM18.5 0l.144.007a1.5 1.5 0 0 1 1.35 1.349L20 1.5v2.25a.75.75 0 1 1-1.5 0V2l-.008-.09A.5.5 0 0 0 18 1.5h-1.75a.75.75 0 1 1 0-1.5h2.25zM8.8 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6z\"/></svg>");
  67374. /***/ }),
  67375. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/insertcolumncommand.js":
  67376. /*!************************************************************************************!*\
  67377. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/insertcolumncommand.js ***!
  67378. \************************************************************************************/
  67379. /*! exports provided: default */
  67380. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67381. "use strict";
  67382. __webpack_require__.r(__webpack_exports__);
  67383. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertColumnCommand; });
  67384. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  67385. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  67386. /**
  67387. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67388. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67389. */
  67390. /**
  67391. * @module table/commands/insertcolumncommand
  67392. */
  67393. /**
  67394. * The insert column command.
  67395. *
  67396. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableColumnLeft'` and
  67397. * `'insertTableColumnRight'` editor commands.
  67398. *
  67399. * To insert a column to the left of the selected cell, execute the following command:
  67400. *
  67401. * editor.execute( 'insertTableColumnLeft' );
  67402. *
  67403. * To insert a column to the right of the selected cell, execute the following command:
  67404. *
  67405. * editor.execute( 'insertTableColumnRight' );
  67406. *
  67407. * @extends module:core/command~Command
  67408. */
  67409. class InsertColumnCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  67410. /**
  67411. * Creates a new `InsertColumnCommand` instance.
  67412. *
  67413. * @param {module:core/editor/editor~Editor} editor An editor on which this command will be used.
  67414. * @param {Object} options
  67415. * @param {String} [options.order="right"] The order of insertion relative to the column in which the caret is located.
  67416. * Possible values: `"left"` and `"right"`.
  67417. */
  67418. constructor( editor, options = {} ) {
  67419. super( editor );
  67420. /**
  67421. * The order of insertion relative to the column in which the caret is located.
  67422. *
  67423. * @readonly
  67424. * @member {String} module:table/commands/insertcolumncommand~InsertColumnCommand#order
  67425. */
  67426. this.order = options.order || 'right';
  67427. }
  67428. /**
  67429. * @inheritDoc
  67430. */
  67431. refresh() {
  67432. const selection = this.editor.model.document.selection;
  67433. const isAnyCellSelected = !!Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( selection ).length;
  67434. this.isEnabled = isAnyCellSelected;
  67435. }
  67436. /**
  67437. * Executes the command.
  67438. *
  67439. * Depending on the command's {@link #order} value, it inserts a column to the `'left'` or `'right'` of the column
  67440. * in which the selection is set.
  67441. *
  67442. * @fires execute
  67443. */
  67444. execute() {
  67445. const editor = this.editor;
  67446. const selection = editor.model.document.selection;
  67447. const tableUtils = editor.plugins.get( 'TableUtils' );
  67448. const insertBefore = this.order === 'left';
  67449. const affectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( selection );
  67450. const columnIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getColumnIndexes"])( affectedTableCells );
  67451. const column = insertBefore ? columnIndexes.first : columnIndexes.last;
  67452. const table = affectedTableCells[ 0 ].findAncestor( 'table' );
  67453. tableUtils.insertColumns( table, { columns: 1, at: insertBefore ? column : column + 1 } );
  67454. }
  67455. }
  67456. /***/ }),
  67457. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/insertrowcommand.js":
  67458. /*!*********************************************************************************!*\
  67459. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/insertrowcommand.js ***!
  67460. \*********************************************************************************/
  67461. /*! exports provided: default */
  67462. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67463. "use strict";
  67464. __webpack_require__.r(__webpack_exports__);
  67465. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertRowCommand; });
  67466. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  67467. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  67468. /**
  67469. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67470. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67471. */
  67472. /**
  67473. * @module table/commands/insertrowcommand
  67474. */
  67475. /**
  67476. * The insert row command.
  67477. *
  67478. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableRowBelow'` and
  67479. * `'insertTableRowAbove'` editor commands.
  67480. *
  67481. * To insert a row below the selected cell, execute the following command:
  67482. *
  67483. * editor.execute( 'insertTableRowBelow' );
  67484. *
  67485. * To insert a row above the selected cell, execute the following command:
  67486. *
  67487. * editor.execute( 'insertTableRowAbove' );
  67488. *
  67489. * @extends module:core/command~Command
  67490. */
  67491. class InsertRowCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  67492. /**
  67493. * Creates a new `InsertRowCommand` instance.
  67494. *
  67495. * @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.
  67496. * @param {Object} options
  67497. * @param {String} [options.order="below"] The order of insertion relative to the row in which the caret is located.
  67498. * Possible values: `"above"` and `"below"`.
  67499. */
  67500. constructor( editor, options = {} ) {
  67501. super( editor );
  67502. /**
  67503. * The order of insertion relative to the row in which the caret is located.
  67504. *
  67505. * @readonly
  67506. * @member {String} module:table/commands/insertrowcommand~InsertRowCommand#order
  67507. */
  67508. this.order = options.order || 'below';
  67509. }
  67510. /**
  67511. * @inheritDoc
  67512. */
  67513. refresh() {
  67514. const selection = this.editor.model.document.selection;
  67515. const isAnyCellSelected = !!Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( selection ).length;
  67516. this.isEnabled = isAnyCellSelected;
  67517. }
  67518. /**
  67519. * Executes the command.
  67520. *
  67521. * Depending on the command's {@link #order} value, it inserts a row `'below'` or `'above'` the row in which selection is set.
  67522. *
  67523. * @fires execute
  67524. */
  67525. execute() {
  67526. const editor = this.editor;
  67527. const selection = editor.model.document.selection;
  67528. const tableUtils = editor.plugins.get( 'TableUtils' );
  67529. const insertAbove = this.order === 'above';
  67530. const affectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( selection );
  67531. const rowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getRowIndexes"])( affectedTableCells );
  67532. const row = insertAbove ? rowIndexes.first : rowIndexes.last;
  67533. const table = affectedTableCells[ 0 ].findAncestor( 'table' );
  67534. tableUtils.insertRows( table, { at: insertAbove ? row : row + 1, copyStructureFromAbove: !insertAbove } );
  67535. }
  67536. }
  67537. /***/ }),
  67538. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablecommand.js":
  67539. /*!***********************************************************************************!*\
  67540. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablecommand.js ***!
  67541. \***********************************************************************************/
  67542. /*! exports provided: default */
  67543. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67544. "use strict";
  67545. __webpack_require__.r(__webpack_exports__);
  67546. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertTableCommand; });
  67547. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  67548. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  67549. /**
  67550. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67551. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67552. */
  67553. /**
  67554. * @module table/commands/inserttablecommand
  67555. */
  67556. /**
  67557. * The insert table command.
  67558. *
  67559. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTable'` editor command.
  67560. *
  67561. * To insert a table at the current selection, execute the command and specify the dimensions:
  67562. *
  67563. * editor.execute( 'insertTable', { rows: 20, columns: 5 } );
  67564. *
  67565. * @extends module:core/command~Command
  67566. */
  67567. class InsertTableCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  67568. /**
  67569. * @inheritDoc
  67570. */
  67571. refresh() {
  67572. const model = this.editor.model;
  67573. const selection = model.document.selection;
  67574. const schema = model.schema;
  67575. this.isEnabled = isAllowedInParent( selection, schema );
  67576. }
  67577. /**
  67578. * Executes the command.
  67579. *
  67580. * Inserts a table with the given number of rows and columns into the editor.
  67581. *
  67582. * @param {Object} options
  67583. * @param {Number} [options.rows=2] The number of rows to create in the inserted table.
  67584. * @param {Number} [options.columns=2] The number of columns to create in the inserted table.
  67585. * @param {Number} [options.headingRows] The number of heading rows.
  67586. * If not provided it will default to {@link module:table/table~TableConfig#defaultHeadings `config.table.defaultHeadings.rows`}
  67587. * table config.
  67588. * @param {Number} [options.headingColumns] The number of heading columns.
  67589. * If not provided it will default to {@link module:table/table~TableConfig#defaultHeadings `config.table.defaultHeadings.columns`}
  67590. * table config.
  67591. * @fires execute
  67592. */
  67593. execute( options = {} ) {
  67594. const model = this.editor.model;
  67595. const selection = model.document.selection;
  67596. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  67597. const config = this.editor.config.get( 'table' );
  67598. const insertionRange = Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["findOptimalInsertionRange"])( selection, model );
  67599. const defaultRows = config.defaultHeadings.rows;
  67600. const defaultColumns = config.defaultHeadings.columns;
  67601. if ( options.headingRows === undefined && defaultRows ) {
  67602. options.headingRows = defaultRows;
  67603. }
  67604. if ( options.headingColumns === undefined && defaultColumns ) {
  67605. options.headingColumns = defaultColumns;
  67606. }
  67607. model.change( writer => {
  67608. const table = tableUtils.createTable( writer, options );
  67609. model.insertContent( table, insertionRange );
  67610. writer.setSelection( writer.createPositionAt( table.getNodeByPath( [ 0, 0, 0 ] ), 0 ) );
  67611. } );
  67612. }
  67613. }
  67614. // Checks if the table is allowed in the parent.
  67615. //
  67616. // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  67617. // @param {module:engine/model/schema~Schema} schema
  67618. // @returns {Boolean}
  67619. function isAllowedInParent( selection, schema ) {
  67620. const positionParent = selection.getFirstPosition().parent;
  67621. const validParent = positionParent === positionParent.root ? positionParent : positionParent.parent;
  67622. return schema.checkChild( validParent, 'table' );
  67623. }
  67624. /***/ }),
  67625. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellcommand.js":
  67626. /*!*********************************************************************************!*\
  67627. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellcommand.js ***!
  67628. \*********************************************************************************/
  67629. /*! exports provided: default */
  67630. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67631. "use strict";
  67632. __webpack_require__.r(__webpack_exports__);
  67633. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MergeCellCommand; });
  67634. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  67635. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  67636. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  67637. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  67638. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  67639. /**
  67640. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67641. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67642. */
  67643. /**
  67644. * @module table/commands/mergecellcommand
  67645. */
  67646. /**
  67647. * The merge cell command.
  67648. *
  67649. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCellRight'`, `'mergeTableCellLeft'`,
  67650. * `'mergeTableCellUp'` and `'mergeTableCellDown'` editor commands.
  67651. *
  67652. * To merge a table cell at the current selection with another cell, execute the command corresponding with the preferred direction.
  67653. *
  67654. * For example, to merge with a cell to the right:
  67655. *
  67656. * editor.execute( 'mergeTableCellRight' );
  67657. *
  67658. * **Note**: If a table cell has a different [`rowspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-rowspan)
  67659. * (for `'mergeTableCellRight'` and `'mergeTableCellLeft'`) or [`colspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-colspan)
  67660. * (for `'mergeTableCellUp'` and `'mergeTableCellDown'`), the command will be disabled.
  67661. *
  67662. * @extends module:core/command~Command
  67663. */
  67664. class MergeCellCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  67665. /**
  67666. * Creates a new `MergeCellCommand` instance.
  67667. *
  67668. * @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.
  67669. * @param {Object} options
  67670. * @param {String} options.direction Indicates which cell to merge with the currently selected one.
  67671. * Possible values are: `'left'`, `'right'`, `'up'` and `'down'`.
  67672. */
  67673. constructor( editor, options ) {
  67674. super( editor );
  67675. /**
  67676. * The direction that indicates which cell will be merged with the currently selected one.
  67677. *
  67678. * @readonly
  67679. * @member {String} #direction
  67680. */
  67681. this.direction = options.direction;
  67682. /**
  67683. * Whether the merge is horizontal (left/right) or vertical (up/down).
  67684. *
  67685. * @readonly
  67686. * @member {Boolean} #isHorizontal
  67687. */
  67688. this.isHorizontal = this.direction == 'right' || this.direction == 'left';
  67689. }
  67690. /**
  67691. * @inheritDoc
  67692. */
  67693. refresh() {
  67694. const cellToMerge = this._getMergeableCell();
  67695. this.value = cellToMerge;
  67696. this.isEnabled = !!cellToMerge;
  67697. }
  67698. /**
  67699. * Executes the command.
  67700. *
  67701. * Depending on the command's {@link #direction} value, it will merge the cell that is to the `'left'`, `'right'`, `'up'` or `'down'`.
  67702. *
  67703. * @fires execute
  67704. */
  67705. execute() {
  67706. const model = this.editor.model;
  67707. const doc = model.document;
  67708. const tableCell = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getTableCellsContainingSelection"])( doc.selection )[ 0 ];
  67709. const cellToMerge = this.value;
  67710. const direction = this.direction;
  67711. model.change( writer => {
  67712. const isMergeNext = direction == 'right' || direction == 'down';
  67713. // The merge mechanism is always the same so sort cells to be merged.
  67714. const cellToExpand = isMergeNext ? tableCell : cellToMerge;
  67715. const cellToRemove = isMergeNext ? cellToMerge : tableCell;
  67716. // Cache the parent of cell to remove for later check.
  67717. const removedTableCellRow = cellToRemove.parent;
  67718. mergeTableCells( cellToRemove, cellToExpand, writer );
  67719. const spanAttribute = this.isHorizontal ? 'colspan' : 'rowspan';
  67720. const cellSpan = parseInt( tableCell.getAttribute( spanAttribute ) || 1 );
  67721. const cellToMergeSpan = parseInt( cellToMerge.getAttribute( spanAttribute ) || 1 );
  67722. // Update table cell span attribute and merge set selection on merged contents.
  67723. writer.setAttribute( spanAttribute, cellSpan + cellToMergeSpan, cellToExpand );
  67724. writer.setSelection( writer.createRangeIn( cellToExpand ) );
  67725. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  67726. const table = removedTableCellRow.findAncestor( 'table' );
  67727. // Remove empty rows and columns after merging.
  67728. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyRowsColumns"])( table, tableUtils );
  67729. } );
  67730. }
  67731. /**
  67732. * Returns a cell that can be merged with the current cell depending on the command's direction.
  67733. *
  67734. * @returns {module:engine/model/element~Element|undefined}
  67735. * @private
  67736. */
  67737. _getMergeableCell() {
  67738. const model = this.editor.model;
  67739. const doc = model.document;
  67740. const tableCell = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getTableCellsContainingSelection"])( doc.selection )[ 0 ];
  67741. if ( !tableCell ) {
  67742. return;
  67743. }
  67744. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  67745. // First get the cell on proper direction.
  67746. const cellToMerge = this.isHorizontal ?
  67747. getHorizontalCell( tableCell, this.direction, tableUtils ) :
  67748. getVerticalCell( tableCell, this.direction, tableUtils );
  67749. if ( !cellToMerge ) {
  67750. return;
  67751. }
  67752. // If found check if the span perpendicular to merge direction is equal on both cells.
  67753. const spanAttribute = this.isHorizontal ? 'rowspan' : 'colspan';
  67754. const span = parseInt( tableCell.getAttribute( spanAttribute ) || 1 );
  67755. const cellToMergeSpan = parseInt( cellToMerge.getAttribute( spanAttribute ) || 1 );
  67756. if ( cellToMergeSpan === span ) {
  67757. return cellToMerge;
  67758. }
  67759. }
  67760. }
  67761. // Returns the cell that can be merged horizontally.
  67762. //
  67763. // @param {module:engine/model/element~Element} tableCell
  67764. // @param {String} direction
  67765. // @param {module:table/tableutils~TableUtils} tableUtils
  67766. // @returns {module:engine/model/node~Node|null}
  67767. function getHorizontalCell( tableCell, direction, tableUtils ) {
  67768. const tableRow = tableCell.parent;
  67769. const table = tableRow.parent;
  67770. const horizontalCell = direction == 'right' ? tableCell.nextSibling : tableCell.previousSibling;
  67771. const hasHeadingColumns = ( table.getAttribute( 'headingColumns' ) || 0 ) > 0;
  67772. if ( !horizontalCell ) {
  67773. return;
  67774. }
  67775. // Sort cells:
  67776. const cellOnLeft = direction == 'right' ? tableCell : horizontalCell;
  67777. const cellOnRight = direction == 'right' ? horizontalCell : tableCell;
  67778. // Get their column indexes:
  67779. const { column: leftCellColumn } = tableUtils.getCellLocation( cellOnLeft );
  67780. const { column: rightCellColumn } = tableUtils.getCellLocation( cellOnRight );
  67781. const leftCellSpan = parseInt( cellOnLeft.getAttribute( 'colspan' ) || 1 );
  67782. const isCellOnLeftInHeadingColumn = Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["isHeadingColumnCell"])( tableUtils, cellOnLeft, table );
  67783. const isCellOnRightInHeadingColumn = Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["isHeadingColumnCell"])( tableUtils, cellOnRight, table );
  67784. // We cannot merge heading columns cells with regular cells.
  67785. if ( hasHeadingColumns && isCellOnLeftInHeadingColumn != isCellOnRightInHeadingColumn ) {
  67786. return;
  67787. }
  67788. // The cell on the right must have index that is distant to the cell on the left by the left cell's width (colspan).
  67789. const cellsAreTouching = leftCellColumn + leftCellSpan === rightCellColumn;
  67790. // If the right cell's column index is different it means that there are rowspanned cells between them.
  67791. return cellsAreTouching ? horizontalCell : undefined;
  67792. }
  67793. // Returns the cell that can be merged vertically.
  67794. //
  67795. // @param {module:engine/model/element~Element} tableCell
  67796. // @param {String} direction
  67797. // @param {module:table/tableutils~TableUtils} tableUtils
  67798. // @returns {module:engine/model/node~Node|null}
  67799. function getVerticalCell( tableCell, direction, tableUtils ) {
  67800. const tableRow = tableCell.parent;
  67801. const table = tableRow.parent;
  67802. const rowIndex = table.getChildIndex( tableRow );
  67803. // Don't search for mergeable cell if direction points out of the table.
  67804. if ( ( direction == 'down' && rowIndex === tableUtils.getRows( table ) - 1 ) || ( direction == 'up' && rowIndex === 0 ) ) {
  67805. return;
  67806. }
  67807. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  67808. const headingRows = table.getAttribute( 'headingRows' ) || 0;
  67809. const isMergeWithBodyCell = direction == 'down' && ( rowIndex + rowspan ) === headingRows;
  67810. const isMergeWithHeadCell = direction == 'up' && rowIndex === headingRows;
  67811. // Don't search for mergeable cell if direction points out of the current table section.
  67812. if ( headingRows && ( isMergeWithBodyCell || isMergeWithHeadCell ) ) {
  67813. return;
  67814. }
  67815. const currentCellRowSpan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  67816. const rowOfCellToMerge = direction == 'down' ? rowIndex + currentCellRowSpan : rowIndex;
  67817. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, { endRow: rowOfCellToMerge } ) ];
  67818. const currentCellData = tableMap.find( value => value.cell === tableCell );
  67819. const mergeColumn = currentCellData.column;
  67820. const cellToMergeData = tableMap.find( ( { row, cellHeight, column } ) => {
  67821. if ( column !== mergeColumn ) {
  67822. return false;
  67823. }
  67824. if ( direction == 'down' ) {
  67825. // If merging a cell below the mergeRow is already calculated.
  67826. return row === rowOfCellToMerge;
  67827. } else {
  67828. // If merging a cell above calculate if it spans to mergeRow.
  67829. return rowOfCellToMerge === row + cellHeight;
  67830. }
  67831. } );
  67832. return cellToMergeData && cellToMergeData.cell;
  67833. }
  67834. // Merges two table cells. It will ensure that after merging cells with an empty paragraph, the resulting table cell will only have one
  67835. // paragraph. If one of the merged table cells is empty, the merged table cell will have the contents of the non-empty table cell.
  67836. // If both are empty, the merged table cell will have only one empty paragraph.
  67837. //
  67838. // @param {module:engine/model/element~Element} cellToRemove
  67839. // @param {module:engine/model/element~Element} cellToExpand
  67840. // @param {module:engine/model/writer~Writer} writer
  67841. function mergeTableCells( cellToRemove, cellToExpand, writer ) {
  67842. if ( !isEmpty( cellToRemove ) ) {
  67843. if ( isEmpty( cellToExpand ) ) {
  67844. writer.remove( writer.createRangeIn( cellToExpand ) );
  67845. }
  67846. writer.move( writer.createRangeIn( cellToRemove ), writer.createPositionAt( cellToExpand, 'end' ) );
  67847. }
  67848. // Remove merged table cell.
  67849. writer.remove( cellToRemove );
  67850. }
  67851. // Checks if the passed table cell contains an empty paragraph.
  67852. //
  67853. // @param {module:engine/model/element~Element} tableCell
  67854. // @returns {Boolean}
  67855. function isEmpty( tableCell ) {
  67856. return tableCell.childCount == 1 && tableCell.getChild( 0 ).is( 'element', 'paragraph' ) && tableCell.getChild( 0 ).isEmpty;
  67857. }
  67858. /***/ }),
  67859. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellscommand.js":
  67860. /*!**********************************************************************************!*\
  67861. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellscommand.js ***!
  67862. \**********************************************************************************/
  67863. /*! exports provided: default */
  67864. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67865. "use strict";
  67866. __webpack_require__.r(__webpack_exports__);
  67867. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MergeCellsCommand; });
  67868. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  67869. /* harmony import */ var _tableutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tableutils */ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js");
  67870. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  67871. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  67872. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  67873. /**
  67874. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67875. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67876. */
  67877. /**
  67878. * @module table/commands/mergecellscommand
  67879. */
  67880. /**
  67881. * The merge cells command.
  67882. *
  67883. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCells'` editor command.
  67884. *
  67885. * For example, to merge selected table cells:
  67886. *
  67887. * editor.execute( 'mergeTableCells' );
  67888. *
  67889. * @extends module:core/command~Command
  67890. */
  67891. class MergeCellsCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  67892. /**
  67893. * @inheritDoc
  67894. */
  67895. refresh() {
  67896. const selectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectedTableCells"])( this.editor.model.document.selection );
  67897. this.isEnabled = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["isSelectionRectangular"])( selectedTableCells, this.editor.plugins.get( _tableutils__WEBPACK_IMPORTED_MODULE_1__["default"] ) );
  67898. }
  67899. /**
  67900. * Executes the command.
  67901. *
  67902. * @fires execute
  67903. */
  67904. execute() {
  67905. const model = this.editor.model;
  67906. const tableUtils = this.editor.plugins.get( _tableutils__WEBPACK_IMPORTED_MODULE_1__["default"] );
  67907. model.change( writer => {
  67908. const selectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectedTableCells"])( model.document.selection );
  67909. // All cells will be merged into the first one.
  67910. const firstTableCell = selectedTableCells.shift();
  67911. // Update target cell dimensions.
  67912. const { mergeWidth, mergeHeight } = getMergeDimensions( firstTableCell, selectedTableCells, tableUtils );
  67913. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'colspan', mergeWidth, firstTableCell, writer );
  67914. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'rowspan', mergeHeight, firstTableCell, writer );
  67915. for ( const tableCell of selectedTableCells ) {
  67916. mergeTableCells( tableCell, firstTableCell, writer );
  67917. }
  67918. const table = firstTableCell.findAncestor( 'table' );
  67919. // Remove rows and columns that become empty (have no anchored cells).
  67920. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyRowsColumns"])( table, tableUtils );
  67921. writer.setSelection( firstTableCell, 'in' );
  67922. } );
  67923. }
  67924. }
  67925. // Merges two table cells. It will ensure that after merging cells with empty paragraphs the resulting table cell will only have one
  67926. // paragraph. If one of the merged table cells is empty, the merged table cell will have contents of the non-empty table cell.
  67927. // If both are empty, the merged table cell will have only one empty paragraph.
  67928. //
  67929. // @param {module:engine/model/element~Element} cellBeingMerged
  67930. // @param {module:engine/model/element~Element} targetCell
  67931. // @param {module:engine/model/writer~Writer} writer
  67932. function mergeTableCells( cellBeingMerged, targetCell, writer ) {
  67933. if ( !isEmpty( cellBeingMerged ) ) {
  67934. if ( isEmpty( targetCell ) ) {
  67935. writer.remove( writer.createRangeIn( targetCell ) );
  67936. }
  67937. writer.move( writer.createRangeIn( cellBeingMerged ), writer.createPositionAt( targetCell, 'end' ) );
  67938. }
  67939. // Remove merged table cell.
  67940. writer.remove( cellBeingMerged );
  67941. }
  67942. // Checks if the passed table cell contains an empty paragraph.
  67943. //
  67944. // @param {module:engine/model/element~Element} tableCell
  67945. // @returns {Boolean}
  67946. function isEmpty( tableCell ) {
  67947. return tableCell.childCount == 1 && tableCell.getChild( 0 ).is( 'element', 'paragraph' ) && tableCell.getChild( 0 ).isEmpty;
  67948. }
  67949. function getMergeDimensions( firstTableCell, selectedTableCells, tableUtils ) {
  67950. let maxWidthOffset = 0;
  67951. let maxHeightOffset = 0;
  67952. for ( const tableCell of selectedTableCells ) {
  67953. const { row, column } = tableUtils.getCellLocation( tableCell );
  67954. maxWidthOffset = getMaxOffset( tableCell, column, maxWidthOffset, 'colspan' );
  67955. maxHeightOffset = getMaxOffset( tableCell, row, maxHeightOffset, 'rowspan' );
  67956. }
  67957. // Update table cell span attribute and merge set selection on a merged contents.
  67958. const { row: firstCellRow, column: firstCellColumn } = tableUtils.getCellLocation( firstTableCell );
  67959. const mergeWidth = maxWidthOffset - firstCellColumn;
  67960. const mergeHeight = maxHeightOffset - firstCellRow;
  67961. return { mergeWidth, mergeHeight };
  67962. }
  67963. function getMaxOffset( tableCell, start, currentMaxOffset, which ) {
  67964. const dimensionValue = parseInt( tableCell.getAttribute( which ) || 1 );
  67965. return Math.max( currentMaxOffset, start + dimensionValue );
  67966. }
  67967. /***/ }),
  67968. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/removecolumncommand.js":
  67969. /*!************************************************************************************!*\
  67970. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/removecolumncommand.js ***!
  67971. \************************************************************************************/
  67972. /*! exports provided: default */
  67973. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67974. "use strict";
  67975. __webpack_require__.r(__webpack_exports__);
  67976. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveColumnCommand; });
  67977. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  67978. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  67979. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  67980. /**
  67981. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  67982. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67983. */
  67984. /**
  67985. * @module table/commands/removecolumncommand
  67986. */
  67987. /**
  67988. * The remove column command.
  67989. *
  67990. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableColumn'` editor command.
  67991. *
  67992. * To remove the column containing the selected cell, execute the command:
  67993. *
  67994. * editor.execute( 'removeTableColumn' );
  67995. *
  67996. * @extends module:core/command~Command
  67997. */
  67998. class RemoveColumnCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  67999. /**
  68000. * @inheritDoc
  68001. */
  68002. refresh() {
  68003. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
  68004. const firstCell = selectedCells[ 0 ];
  68005. if ( firstCell ) {
  68006. const table = firstCell.findAncestor( 'table' );
  68007. const tableColumnCount = this.editor.plugins.get( 'TableUtils' ).getColumns( table );
  68008. const { first, last } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getColumnIndexes"])( selectedCells );
  68009. this.isEnabled = last - first < ( tableColumnCount - 1 );
  68010. } else {
  68011. this.isEnabled = false;
  68012. }
  68013. }
  68014. /**
  68015. * @inheritDoc
  68016. */
  68017. execute() {
  68018. const [ firstCell, lastCell ] = getBoundaryCells( this.editor.model.document.selection );
  68019. const table = firstCell.parent.parent;
  68020. // Cache the table before removing or updating colspans.
  68021. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table ) ];
  68022. // Store column indexes of removed columns.
  68023. const removedColumnIndexes = {
  68024. first: tableMap.find( value => value.cell === firstCell ).column,
  68025. last: tableMap.find( value => value.cell === lastCell ).column
  68026. };
  68027. const cellToFocus = getCellToFocus( tableMap, firstCell, lastCell, removedColumnIndexes );
  68028. this.editor.model.change( writer => {
  68029. const columnsToRemove = removedColumnIndexes.last - removedColumnIndexes.first + 1;
  68030. this.editor.plugins.get( 'TableUtils' ).removeColumns( table, {
  68031. at: removedColumnIndexes.first,
  68032. columns: columnsToRemove
  68033. } );
  68034. writer.setSelection( writer.createPositionAt( cellToFocus, 0 ) );
  68035. } );
  68036. }
  68037. }
  68038. // Returns a proper table cell to focus after removing a column.
  68039. // - selection is on last table cell it will return previous cell.
  68040. function getCellToFocus( tableMap, firstCell, lastCell, removedColumnIndexes ) {
  68041. const colspan = parseInt( lastCell.getAttribute( 'colspan' ) || 1 );
  68042. // If the table cell is spanned over 2+ columns - it will be truncated so the selection should
  68043. // stay in that cell.
  68044. if ( colspan > 1 ) {
  68045. return lastCell;
  68046. }
  68047. // Normally, look for the cell in the same row that precedes the first cell to put selection there ("column on the left").
  68048. // If the deleted column is the first column of the table, there will be no predecessor: use the cell
  68049. // from the column that follows then (also in the same row).
  68050. else if ( firstCell.previousSibling || lastCell.nextSibling ) {
  68051. return lastCell.nextSibling || firstCell.previousSibling;
  68052. }
  68053. // It can happen that table cells have no siblings in a row, for instance, when there are row spans
  68054. // in the table (in the previous row). Then just look for the closest cell that is in a column
  68055. // that will not be removed to put the selection there.
  68056. else {
  68057. // Look for any cell in a column that precedes the first removed column.
  68058. if ( removedColumnIndexes.first ) {
  68059. return tableMap.reverse().find( ( { column } ) => {
  68060. return column < removedColumnIndexes.first;
  68061. } ).cell;
  68062. }
  68063. // If the first removed column is the first column of the table, then
  68064. // look for any cell that is in a column that follows the last removed column.
  68065. else {
  68066. return tableMap.reverse().find( ( { column } ) => {
  68067. return column > removedColumnIndexes.last;
  68068. } ).cell;
  68069. }
  68070. }
  68071. }
  68072. // Returns helper object returning the first and the last cell contained in given selection, based on DOM order.
  68073. function getBoundaryCells( selection ) {
  68074. const referenceCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( selection );
  68075. const firstCell = referenceCells[ 0 ];
  68076. const lastCell = referenceCells.pop();
  68077. const returnValue = [ firstCell, lastCell ];
  68078. return firstCell.isBefore( lastCell ) ? returnValue : returnValue.reverse();
  68079. }
  68080. /***/ }),
  68081. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/removerowcommand.js":
  68082. /*!*********************************************************************************!*\
  68083. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/removerowcommand.js ***!
  68084. \*********************************************************************************/
  68085. /*! exports provided: default */
  68086. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68087. "use strict";
  68088. __webpack_require__.r(__webpack_exports__);
  68089. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveRowCommand; });
  68090. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  68091. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  68092. /**
  68093. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  68094. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  68095. */
  68096. /**
  68097. * @module table/commands/removerowcommand
  68098. */
  68099. /**
  68100. * The remove row command.
  68101. *
  68102. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableRow'` editor command.
  68103. *
  68104. * To remove the row containing the selected cell, execute the command:
  68105. *
  68106. * editor.execute( 'removeTableRow' );
  68107. *
  68108. * @extends module:core/command~Command
  68109. */
  68110. class RemoveRowCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  68111. /**
  68112. * @inheritDoc
  68113. */
  68114. refresh() {
  68115. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
  68116. const firstCell = selectedCells[ 0 ];
  68117. if ( firstCell ) {
  68118. const table = firstCell.findAncestor( 'table' );
  68119. const tableRowCount = this.editor.plugins.get( 'TableUtils' ).getRows( table );
  68120. const lastRowIndex = tableRowCount - 1;
  68121. const selectedRowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getRowIndexes"])( selectedCells );
  68122. const areAllRowsSelected = selectedRowIndexes.first === 0 && selectedRowIndexes.last === lastRowIndex;
  68123. // Disallow selecting whole table -> delete whole table should be used instead.
  68124. this.isEnabled = !areAllRowsSelected;
  68125. } else {
  68126. this.isEnabled = false;
  68127. }
  68128. }
  68129. /**
  68130. * @inheritDoc
  68131. */
  68132. execute() {
  68133. const model = this.editor.model;
  68134. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  68135. const referenceCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( model.document.selection );
  68136. const removedRowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getRowIndexes"])( referenceCells );
  68137. const firstCell = referenceCells[ 0 ];
  68138. const table = firstCell.findAncestor( 'table' );
  68139. const columnIndexToFocus = tableUtils.getCellLocation( firstCell ).column;
  68140. model.change( writer => {
  68141. const rowsToRemove = removedRowIndexes.last - removedRowIndexes.first + 1;
  68142. tableUtils.removeRows( table, {
  68143. at: removedRowIndexes.first,
  68144. rows: rowsToRemove
  68145. } );
  68146. const cellToFocus = getCellToFocus( table, removedRowIndexes.first, columnIndexToFocus, tableUtils.getRows( table ) );
  68147. writer.setSelection( writer.createPositionAt( cellToFocus, 0 ) );
  68148. } );
  68149. }
  68150. }
  68151. // Returns a cell that should be focused before removing the row, belonging to the same column as the currently focused cell.
  68152. // * If the row was not the last one, the cell to focus will be in the row that followed it (before removal).
  68153. // * If the row was the last one, the cell to focus will be in the row that preceded it (before removal).
  68154. function getCellToFocus( table, removedRowIndex, columnToFocus, tableRowCount ) {
  68155. // Don't go beyond last row's index.
  68156. const row = table.getChild( Math.min( removedRowIndex, tableRowCount - 1 ) );
  68157. // Default to first table cell.
  68158. let cellToFocus = row.getChild( 0 );
  68159. let column = 0;
  68160. for ( const tableCell of row.getChildren() ) {
  68161. if ( column > columnToFocus ) {
  68162. return cellToFocus;
  68163. }
  68164. cellToFocus = tableCell;
  68165. column += parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  68166. }
  68167. return cellToFocus;
  68168. }
  68169. /***/ }),
  68170. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/selectcolumncommand.js":
  68171. /*!************************************************************************************!*\
  68172. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/selectcolumncommand.js ***!
  68173. \************************************************************************************/
  68174. /*! exports provided: default */
  68175. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68176. "use strict";
  68177. __webpack_require__.r(__webpack_exports__);
  68178. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectColumnCommand; });
  68179. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  68180. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  68181. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  68182. /**
  68183. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  68184. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  68185. */
  68186. /**
  68187. * @module table/commands/selectcolumncommand
  68188. */
  68189. /**
  68190. * The select column command.
  68191. *
  68192. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableColumn'` editor command.
  68193. *
  68194. * To select the columns containing the selected cells, execute the command:
  68195. *
  68196. * editor.execute( 'selectTableColumn' );
  68197. *
  68198. * @extends module:core/command~Command
  68199. */
  68200. class SelectColumnCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  68201. /**
  68202. * @inheritDoc
  68203. */
  68204. constructor( editor ) {
  68205. super( editor );
  68206. // It does not affect data so should be enabled in read-only mode.
  68207. this.affectsData = false;
  68208. }
  68209. /**
  68210. * @inheritDoc
  68211. */
  68212. refresh() {
  68213. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
  68214. this.isEnabled = selectedCells.length > 0;
  68215. }
  68216. /**
  68217. * @inheritDoc
  68218. */
  68219. execute() {
  68220. const model = this.editor.model;
  68221. const referenceCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
  68222. const firstCell = referenceCells[ 0 ];
  68223. const lastCell = referenceCells.pop();
  68224. const table = firstCell.findAncestor( 'table' );
  68225. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  68226. const startLocation = tableUtils.getCellLocation( firstCell );
  68227. const endLocation = tableUtils.getCellLocation( lastCell );
  68228. const startColumn = Math.min( startLocation.column, endLocation.column );
  68229. const endColumn = Math.max( startLocation.column, endLocation.column );
  68230. const rangesToSelect = [];
  68231. for ( const cellInfo of new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, { startColumn, endColumn } ) ) {
  68232. rangesToSelect.push( model.createRangeOn( cellInfo.cell ) );
  68233. }
  68234. model.change( writer => {
  68235. writer.setSelection( rangesToSelect );
  68236. } );
  68237. }
  68238. }
  68239. /***/ }),
  68240. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/selectrowcommand.js":
  68241. /*!*********************************************************************************!*\
  68242. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/selectrowcommand.js ***!
  68243. \*********************************************************************************/
  68244. /*! exports provided: default */
  68245. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68246. "use strict";
  68247. __webpack_require__.r(__webpack_exports__);
  68248. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectRowCommand; });
  68249. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  68250. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  68251. /**
  68252. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  68253. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  68254. */
  68255. /**
  68256. * @module table/commands/selectrowcommand
  68257. */
  68258. /**
  68259. * The select row command.
  68260. *
  68261. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableRow'` editor command.
  68262. *
  68263. * To select the rows containing the selected cells, execute the command:
  68264. *
  68265. * editor.execute( 'selectTableRow' );
  68266. *
  68267. * @extends module:core/command~Command
  68268. */
  68269. class SelectRowCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  68270. /**
  68271. * @inheritDoc
  68272. */
  68273. constructor( editor ) {
  68274. super( editor );
  68275. // It does not affect data so should be enabled in read-only mode.
  68276. this.affectsData = false;
  68277. }
  68278. /**
  68279. * @inheritDoc
  68280. */
  68281. refresh() {
  68282. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
  68283. this.isEnabled = selectedCells.length > 0;
  68284. }
  68285. /**
  68286. * @inheritDoc
  68287. */
  68288. execute() {
  68289. const model = this.editor.model;
  68290. const referenceCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( model.document.selection );
  68291. const rowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getRowIndexes"])( referenceCells );
  68292. const table = referenceCells[ 0 ].findAncestor( 'table' );
  68293. const rangesToSelect = [];
  68294. for ( let rowIndex = rowIndexes.first; rowIndex <= rowIndexes.last; rowIndex++ ) {
  68295. for ( const cell of table.getChild( rowIndex ).getChildren() ) {
  68296. rangesToSelect.push( model.createRangeOn( cell ) );
  68297. }
  68298. }
  68299. model.change( writer => {
  68300. writer.setSelection( rangesToSelect );
  68301. } );
  68302. }
  68303. }
  68304. /***/ }),
  68305. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/setheadercolumncommand.js":
  68306. /*!***************************************************************************************!*\
  68307. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/setheadercolumncommand.js ***!
  68308. \***************************************************************************************/
  68309. /*! exports provided: default */
  68310. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68311. "use strict";
  68312. __webpack_require__.r(__webpack_exports__);
  68313. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SetHeaderColumnCommand; });
  68314. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  68315. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  68316. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  68317. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  68318. /**
  68319. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  68320. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  68321. */
  68322. /**
  68323. * @module table/commands/setheadercolumncommand
  68324. */
  68325. /**
  68326. * The header column command.
  68327. *
  68328. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.
  68329. *
  68330. * You can make the column containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element)
  68331. * by executing:
  68332. *
  68333. * editor.execute( 'setTableColumnHeader' );
  68334. *
  68335. * **Note:** All preceding columns will also become headers. If the current column is already a header, executing this command
  68336. * will make it a regular column back again (including the following columns).
  68337. *
  68338. * @extends module:core/command~Command
  68339. */
  68340. class SetHeaderColumnCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  68341. /**
  68342. * @inheritDoc
  68343. */
  68344. refresh() {
  68345. const model = this.editor.model;
  68346. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
  68347. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  68348. const isInTable = selectedCells.length > 0;
  68349. this.isEnabled = isInTable;
  68350. /**
  68351. * Flag indicating whether the command is active. The command is active when the
  68352. * {@link module:engine/model/selection~Selection} is in a header column.
  68353. *
  68354. * @observable
  68355. * @readonly
  68356. * @member {Boolean} #value
  68357. */
  68358. this.value = isInTable && selectedCells.every( cell => Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["isHeadingColumnCell"])( tableUtils, cell ) );
  68359. }
  68360. /**
  68361. * Executes the command.
  68362. *
  68363. * When the selection is in a non-header column, the command will set the `headingColumns` table attribute to cover that column.
  68364. *
  68365. * When the selection is already in a header column, it will set `headingColumns` so the heading section will end before that column.
  68366. *
  68367. * @fires execute
  68368. * @param {Object} [options]
  68369. * @param {Boolean} [options.forceValue] If set, the command will set (`true`) or unset (`false`) the header columns according to
  68370. * the `forceValue` parameter instead of the current model state.
  68371. */
  68372. execute( options = {} ) {
  68373. if ( options.forceValue === this.value ) {
  68374. return;
  68375. }
  68376. const model = this.editor.model;
  68377. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
  68378. const table = selectedCells[ 0 ].findAncestor( 'table' );
  68379. const { first, last } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getColumnIndexes"])( selectedCells );
  68380. const headingColumnsToSet = this.value ? first : last + 1;
  68381. model.change( writer => {
  68382. if ( headingColumnsToSet ) {
  68383. // Changing heading columns requires to check if any of a heading cell is overlapping horizontally the table head.
  68384. // Any table cell that has a colspan attribute > 1 will not exceed the table head so we need to fix it in columns before.
  68385. const overlappingCells = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["getHorizontallyOverlappingCells"])( table, headingColumnsToSet );
  68386. for ( const { cell, column } of overlappingCells ) {
  68387. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["splitVertically"])( cell, column, headingColumnsToSet, writer );
  68388. }
  68389. }
  68390. Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'headingColumns', headingColumnsToSet, table, writer, 0 );
  68391. } );
  68392. }
  68393. }
  68394. /***/ }),
  68395. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/setheaderrowcommand.js":
  68396. /*!************************************************************************************!*\
  68397. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/setheaderrowcommand.js ***!
  68398. \************************************************************************************/
  68399. /*! exports provided: default */
  68400. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68401. "use strict";
  68402. __webpack_require__.r(__webpack_exports__);
  68403. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SetHeaderRowCommand; });
  68404. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  68405. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  68406. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  68407. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  68408. /**
  68409. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  68410. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  68411. */
  68412. /**
  68413. * @module table/commands/setheaderrowcommand
  68414. */
  68415. /**
  68416. * The header row command.
  68417. *
  68418. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.
  68419. *
  68420. * You can make the row containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element) by executing:
  68421. *
  68422. * editor.execute( 'setTableRowHeader' );
  68423. *
  68424. * **Note:** All preceding rows will also become headers. If the current row is already a header, executing this command
  68425. * will make it a regular row back again (including the following rows).
  68426. *
  68427. * @extends module:core/command~Command
  68428. */
  68429. class SetHeaderRowCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  68430. /**
  68431. * @inheritDoc
  68432. */
  68433. refresh() {
  68434. const model = this.editor.model;
  68435. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
  68436. const isInTable = selectedCells.length > 0;
  68437. this.isEnabled = isInTable;
  68438. /**
  68439. * Flag indicating whether the command is active. The command is active when the
  68440. * {@link module:engine/model/selection~Selection} is in a header row.
  68441. *
  68442. * @observable
  68443. * @readonly
  68444. * @member {Boolean} #value
  68445. */
  68446. this.value = isInTable && selectedCells.every( cell => this._isInHeading( cell, cell.parent.parent ) );
  68447. }
  68448. /**
  68449. * Executes the command.
  68450. *
  68451. * When the selection is in a non-header row, the command will set the `headingRows` table attribute to cover that row.
  68452. *
  68453. * When the selection is already in a header row, it will set `headingRows` so the heading section will end before that row.
  68454. *
  68455. * @fires execute
  68456. * @param {Object} options
  68457. * @param {Boolean} [options.forceValue] If set, the command will set (`true`) or unset (`false`) the header rows according to
  68458. * the `forceValue` parameter instead of the current model state.
  68459. */
  68460. execute( options = {} ) {
  68461. if ( options.forceValue === this.value ) {
  68462. return;
  68463. }
  68464. const model = this.editor.model;
  68465. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
  68466. const table = selectedCells[ 0 ].findAncestor( 'table' );
  68467. const { first, last } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getRowIndexes"])( selectedCells );
  68468. const headingRowsToSet = this.value ? first : last + 1;
  68469. const currentHeadingRows = table.getAttribute( 'headingRows' ) || 0;
  68470. model.change( writer => {
  68471. if ( headingRowsToSet ) {
  68472. // Changing heading rows requires to check if any of a heading cell is overlapping vertically the table head.
  68473. // Any table cell that has a rowspan attribute > 1 will not exceed the table head so we need to fix it in rows below.
  68474. const startRow = headingRowsToSet > currentHeadingRows ? currentHeadingRows : 0;
  68475. const overlappingCells = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["getVerticallyOverlappingCells"])( table, headingRowsToSet, startRow );
  68476. for ( const { cell } of overlappingCells ) {
  68477. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["splitHorizontally"])( cell, headingRowsToSet, writer );
  68478. }
  68479. }
  68480. Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'headingRows', headingRowsToSet, table, writer, 0 );
  68481. } );
  68482. }
  68483. /**
  68484. * Checks if a table cell is in the heading section.
  68485. *
  68486. * @param {module:engine/model/element~Element} tableCell
  68487. * @param {module:engine/model/element~Element} table
  68488. * @returns {Boolean}
  68489. * @private
  68490. */
  68491. _isInHeading( tableCell, table ) {
  68492. const headingRows = parseInt( table.getAttribute( 'headingRows' ) || 0 );
  68493. return !!headingRows && tableCell.parent.index < headingRows;
  68494. }
  68495. }
  68496. /***/ }),
  68497. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/splitcellcommand.js":
  68498. /*!*********************************************************************************!*\
  68499. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/splitcellcommand.js ***!
  68500. \*********************************************************************************/
  68501. /*! exports provided: default */
  68502. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68503. "use strict";
  68504. __webpack_require__.r(__webpack_exports__);
  68505. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SplitCellCommand; });
  68506. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  68507. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  68508. /**
  68509. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  68510. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  68511. */
  68512. /**
  68513. * @module table/commands/splitcellcommand
  68514. */
  68515. /**
  68516. * The split cell command.
  68517. *
  68518. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'splitTableCellVertically'`
  68519. * and `'splitTableCellHorizontally'` editor commands.
  68520. *
  68521. * You can split any cell vertically or horizontally by executing this command. For example, to split the selected table cell vertically:
  68522. *
  68523. * editor.execute( 'splitTableCellVertically' );
  68524. *
  68525. * @extends module:core/command~Command
  68526. */
  68527. class SplitCellCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Command"] {
  68528. /**
  68529. * Creates a new `SplitCellCommand` instance.
  68530. *
  68531. * @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.
  68532. * @param {Object} options
  68533. * @param {String} options.direction Indicates whether the command should split cells `'horizontally'` or `'vertically'`.
  68534. */
  68535. constructor( editor, options = {} ) {
  68536. super( editor );
  68537. /**
  68538. * The direction that indicates which cell will be split.
  68539. *
  68540. * @readonly
  68541. * @member {String} #direction
  68542. */
  68543. this.direction = options.direction || 'horizontally';
  68544. }
  68545. /**
  68546. * @inheritDoc
  68547. */
  68548. refresh() {
  68549. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
  68550. this.isEnabled = selectedCells.length === 1;
  68551. }
  68552. /**
  68553. * @inheritDoc
  68554. */
  68555. execute() {
  68556. const tableCell = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( this.editor.model.document.selection )[ 0 ];
  68557. const isHorizontal = this.direction === 'horizontally';
  68558. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  68559. if ( isHorizontal ) {
  68560. tableUtils.splitCellHorizontally( tableCell, 2 );
  68561. } else {
  68562. tableUtils.splitCellVertically( tableCell, 2 );
  68563. }
  68564. }
  68565. }
  68566. /***/ }),
  68567. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js":
  68568. /*!***************************************************************************!*\
  68569. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js ***!
  68570. \***************************************************************************/
  68571. /*! exports provided: downcastInsertTable, downcastInsertRow, downcastInsertCell, downcastTableHeadingColumnsChange, downcastRemoveRow, convertParagraphInTableCell, isSingleParagraphWithoutAttributes */
  68572. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68573. "use strict";
  68574. __webpack_require__.r(__webpack_exports__);
  68575. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastInsertTable", function() { return downcastInsertTable; });
  68576. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastInsertRow", function() { return downcastInsertRow; });
  68577. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastInsertCell", function() { return downcastInsertCell; });
  68578. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastTableHeadingColumnsChange", function() { return downcastTableHeadingColumnsChange; });
  68579. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastRemoveRow", function() { return downcastRemoveRow; });
  68580. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertParagraphInTableCell", function() { return convertParagraphInTableCell; });
  68581. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSingleParagraphWithoutAttributes", function() { return isSingleParagraphWithoutAttributes; });
  68582. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  68583. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  68584. /**
  68585. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  68586. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  68587. */
  68588. /**
  68589. * @module table/converters/downcast
  68590. */
  68591. /**
  68592. * Model table element to view table element conversion helper.
  68593. *
  68594. * This conversion helper creates the whole table element with child elements.
  68595. *
  68596. * @param {Object} options
  68597. * @param {Boolean} options.asWidget If set to `true`, the downcast conversion will produce a widget.
  68598. * @returns {Function} Conversion helper.
  68599. */
  68600. function downcastInsertTable( options = {} ) {
  68601. return dispatcher => dispatcher.on( 'insert:table', ( evt, data, conversionApi ) => {
  68602. const table = data.item;
  68603. if ( !conversionApi.consumable.consume( table, 'insert' ) ) {
  68604. return;
  68605. }
  68606. // Consume attributes if present to not fire attribute change downcast
  68607. conversionApi.consumable.consume( table, 'attribute:headingRows:table' );
  68608. conversionApi.consumable.consume( table, 'attribute:headingColumns:table' );
  68609. const asWidget = options && options.asWidget;
  68610. const figureElement = conversionApi.writer.createContainerElement( 'figure', { class: 'table' } );
  68611. const tableElement = conversionApi.writer.createContainerElement( 'table' );
  68612. conversionApi.writer.insert( conversionApi.writer.createPositionAt( figureElement, 0 ), tableElement );
  68613. let tableWidget;
  68614. if ( asWidget ) {
  68615. tableWidget = toTableWidget( figureElement, conversionApi.writer );
  68616. }
  68617. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table );
  68618. const tableAttributes = {
  68619. headingRows: table.getAttribute( 'headingRows' ) || 0,
  68620. headingColumns: table.getAttribute( 'headingColumns' ) || 0
  68621. };
  68622. // Cache for created table rows.
  68623. const viewRows = new Map();
  68624. for ( const tableSlot of tableWalker ) {
  68625. const { row, cell } = tableSlot;
  68626. const tableRow = table.getChild( row );
  68627. const trElement = viewRows.get( row ) || createTr( tableElement, tableRow, row, tableAttributes, conversionApi );
  68628. viewRows.set( row, trElement );
  68629. // Consume table cell - it will be always consumed as we convert whole table at once.
  68630. conversionApi.consumable.consume( cell, 'insert' );
  68631. const insertPosition = conversionApi.writer.createPositionAt( trElement, 'end' );
  68632. createViewTableCellElement( tableSlot, tableAttributes, insertPosition, conversionApi, options );
  68633. }
  68634. // Insert empty TR elements if there are any rows without anchored cells. Since the model is always normalized
  68635. // this can happen only in the document fragment that only part of the table is down-casted.
  68636. for ( const tableRow of table.getChildren() ) {
  68637. const rowIndex = tableRow.index;
  68638. // Make sure that this is a table row and not some other element (i.e., caption).
  68639. if ( tableRow.is( 'element', 'tableRow' ) && !viewRows.has( rowIndex ) ) {
  68640. viewRows.set( rowIndex, createTr( tableElement, tableRow, rowIndex, tableAttributes, conversionApi ) );
  68641. }
  68642. }
  68643. const viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
  68644. conversionApi.mapper.bindElements( table, asWidget ? tableWidget : figureElement );
  68645. conversionApi.writer.insert( viewPosition, asWidget ? tableWidget : figureElement );
  68646. } );
  68647. }
  68648. /**
  68649. * Model row element to view `<tr>` element conversion helper.
  68650. *
  68651. * This conversion helper creates the whole `<tr>` element with child elements.
  68652. *
  68653. * @returns {Function} Conversion helper.
  68654. */
  68655. function downcastInsertRow() {
  68656. return dispatcher => dispatcher.on( 'insert:tableRow', ( evt, data, conversionApi ) => {
  68657. const tableRow = data.item;
  68658. if ( !conversionApi.consumable.consume( tableRow, 'insert' ) ) {
  68659. return;
  68660. }
  68661. const table = tableRow.parent;
  68662. const figureElement = conversionApi.mapper.toViewElement( table );
  68663. const tableElement = getViewTable( figureElement );
  68664. const row = table.getChildIndex( tableRow );
  68665. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { row } );
  68666. const tableAttributes = {
  68667. headingRows: table.getAttribute( 'headingRows' ) || 0,
  68668. headingColumns: table.getAttribute( 'headingColumns' ) || 0
  68669. };
  68670. // Cache for created table rows.
  68671. const viewRows = new Map();
  68672. for ( const tableSlot of tableWalker ) {
  68673. const trElement = viewRows.get( row ) || createTr( tableElement, tableRow, row, tableAttributes, conversionApi );
  68674. viewRows.set( row, trElement );
  68675. // Consume table cell - it will be always consumed as we convert whole row at once.
  68676. conversionApi.consumable.consume( tableSlot.cell, 'insert' );
  68677. const insertPosition = conversionApi.writer.createPositionAt( trElement, 'end' );
  68678. createViewTableCellElement( tableSlot, tableAttributes, insertPosition, conversionApi, { asWidget: true } );
  68679. }
  68680. } );
  68681. }
  68682. /**
  68683. * Model table cell element to view `<td>` or `<th>` element conversion helper.
  68684. *
  68685. * This conversion helper will create proper `<th>` elements for table cells that are in the heading section (heading row or column)
  68686. * and `<td>` otherwise.
  68687. *
  68688. * @returns {Function} Conversion helper.
  68689. */
  68690. function downcastInsertCell() {
  68691. return dispatcher => dispatcher.on( 'insert:tableCell', ( evt, data, conversionApi ) => {
  68692. const tableCell = data.item;
  68693. if ( !conversionApi.consumable.consume( tableCell, 'insert' ) ) {
  68694. return;
  68695. }
  68696. const tableRow = tableCell.parent;
  68697. const table = tableRow.parent;
  68698. const rowIndex = table.getChildIndex( tableRow );
  68699. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { row: rowIndex } );
  68700. const tableAttributes = {
  68701. headingRows: table.getAttribute( 'headingRows' ) || 0,
  68702. headingColumns: table.getAttribute( 'headingColumns' ) || 0
  68703. };
  68704. // We need to iterate over a table in order to get proper row & column values from a walker
  68705. for ( const tableSlot of tableWalker ) {
  68706. if ( tableSlot.cell === tableCell ) {
  68707. const trElement = conversionApi.mapper.toViewElement( tableRow );
  68708. const insertPosition = conversionApi.writer.createPositionAt( trElement, tableRow.getChildIndex( tableCell ) );
  68709. createViewTableCellElement( tableSlot, tableAttributes, insertPosition, conversionApi, { asWidget: true } );
  68710. // No need to iterate further.
  68711. return;
  68712. }
  68713. }
  68714. } );
  68715. }
  68716. /**
  68717. * Conversion helper that acts on heading column table attribute change.
  68718. *
  68719. * Depending on changed attributes this converter will rename `<td` to `<th>` elements or vice versa depending on the cell column index.
  68720. *
  68721. * @returns {Function} Conversion helper.
  68722. */
  68723. function downcastTableHeadingColumnsChange() {
  68724. return dispatcher => dispatcher.on( 'attribute:headingColumns:table', ( evt, data, conversionApi ) => {
  68725. const table = data.item;
  68726. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  68727. return;
  68728. }
  68729. const tableAttributes = {
  68730. headingRows: table.getAttribute( 'headingRows' ) || 0,
  68731. headingColumns: table.getAttribute( 'headingColumns' ) || 0
  68732. };
  68733. const oldColumns = data.attributeOldValue;
  68734. const newColumns = data.attributeNewValue;
  68735. const lastColumnToCheck = ( oldColumns > newColumns ? oldColumns : newColumns ) - 1;
  68736. for ( const tableSlot of new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { endColumn: lastColumnToCheck } ) ) {
  68737. renameViewTableCellIfRequired( tableSlot, tableAttributes, conversionApi );
  68738. }
  68739. } );
  68740. }
  68741. /**
  68742. * Conversion helper that acts on a removed row.
  68743. *
  68744. * @returns {Function} Conversion helper.
  68745. */
  68746. function downcastRemoveRow() {
  68747. return dispatcher => dispatcher.on( 'remove:tableRow', ( evt, data, conversionApi ) => {
  68748. // Prevent default remove converter.
  68749. evt.stop();
  68750. const viewWriter = conversionApi.writer;
  68751. const mapper = conversionApi.mapper;
  68752. const viewStart = mapper.toViewPosition( data.position ).getLastMatchingPosition( value => !value.item.is( 'element', 'tr' ) );
  68753. const viewItem = viewStart.nodeAfter;
  68754. const tableSection = viewItem.parent;
  68755. const viewTable = tableSection.parent;
  68756. // Remove associated <tr> from the view.
  68757. const removeRange = viewWriter.createRangeOn( viewItem );
  68758. const removed = viewWriter.remove( removeRange );
  68759. for ( const child of viewWriter.createRangeIn( removed ).getItems() ) {
  68760. mapper.unbindViewElement( child );
  68761. }
  68762. // Cleanup: Ensure that thead & tbody sections are removed if left empty after removing rows. See #6437, #6391.
  68763. removeTableSectionIfEmpty( 'thead', viewTable, conversionApi );
  68764. removeTableSectionIfEmpty( 'tbody', viewTable, conversionApi );
  68765. }, { priority: 'higher' } );
  68766. }
  68767. /**
  68768. * Overrides paragraph inside table cell conversion.
  68769. *
  68770. * This converter:
  68771. * * should be used to override default paragraph conversion in the editing view.
  68772. * * It will only convert <paragraph> placed directly inside <tableCell>.
  68773. * * For a single paragraph without attributes it returns `<span>` to simulate data table.
  68774. * * For all other cases it returns `<p>` element.
  68775. *
  68776. * @param {module:engine/model/element~Element} modelElement
  68777. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  68778. * @returns {module:engine/view/containerelement~ContainerElement|undefined}
  68779. */
  68780. function convertParagraphInTableCell( modelElement, conversionApi ) {
  68781. const { writer } = conversionApi;
  68782. if ( !modelElement.parent.is( 'element', 'tableCell' ) ) {
  68783. return;
  68784. }
  68785. if ( isSingleParagraphWithoutAttributes( modelElement ) ) {
  68786. return writer.createContainerElement( 'span', { class: 'ck-table-bogus-paragraph' } );
  68787. } else {
  68788. return writer.createContainerElement( 'p' );
  68789. }
  68790. }
  68791. /**
  68792. * Checks if given model `<paragraph>` is an only child of a parent (`<tableCell>`) and if it has any attribute set.
  68793. *
  68794. * The paragraph should be converted in the editing view to:
  68795. *
  68796. * * If returned `true` - to a `<span class="ck-table-bogus-paragraph">`
  68797. * * If returned `false` - to a `<p>`
  68798. *
  68799. * @param {module:engine/model/element~Element} modelElement
  68800. * @returns {Boolean}
  68801. */
  68802. function isSingleParagraphWithoutAttributes( modelElement ) {
  68803. const tableCell = modelElement.parent;
  68804. const isSingleParagraph = tableCell.childCount === 1;
  68805. return isSingleParagraph && !hasAnyAttribute( modelElement );
  68806. }
  68807. // Converts a given {@link module:engine/view/element~Element} to a table widget:
  68808. // * Adds a {@link module:engine/view/element~Element#_setCustomProperty custom property} allowing to recognize the table widget element.
  68809. // * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.
  68810. //
  68811. // @param {module:engine/view/element~Element} viewElement
  68812. // @param {module:engine/view/downcastwriter~DowncastWriter} writer An instance of the view writer.
  68813. // @param {String} label The element's label. It will be concatenated with the table `alt` attribute if one is present.
  68814. // @returns {module:engine/view/element~Element}
  68815. function toTableWidget( viewElement, writer ) {
  68816. writer.setCustomProperty( 'table', true, viewElement );
  68817. return Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["toWidget"])( viewElement, writer, { hasSelectionHandle: true } );
  68818. }
  68819. // Renames an existing table cell in the view to a given element name.
  68820. //
  68821. // **Note** This method will not do anything if a view table cell has not been converted yet.
  68822. //
  68823. // @param {module:engine/model/element~Element} tableCell
  68824. // @param {String} desiredCellElementName
  68825. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  68826. function renameViewTableCell( tableCell, desiredCellElementName, conversionApi ) {
  68827. const viewWriter = conversionApi.writer;
  68828. const viewCell = conversionApi.mapper.toViewElement( tableCell );
  68829. const editable = viewWriter.createEditableElement( desiredCellElementName, viewCell.getAttributes() );
  68830. const renamedCell = Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["toWidgetEditable"])( editable, viewWriter );
  68831. viewWriter.insert( viewWriter.createPositionAfter( viewCell ), renamedCell );
  68832. viewWriter.move( viewWriter.createRangeIn( viewCell ), viewWriter.createPositionAt( renamedCell, 0 ) );
  68833. viewWriter.remove( viewWriter.createRangeOn( viewCell ) );
  68834. conversionApi.mapper.unbindViewElement( viewCell );
  68835. conversionApi.mapper.bindElements( tableCell, renamedCell );
  68836. }
  68837. // Renames a table cell element in the view according to its location in the table.
  68838. //
  68839. // @param {module:table/tablewalker~TableSlot} tableSlot
  68840. // @param {{headingColumns, headingRows}} tableAttributes
  68841. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  68842. function renameViewTableCellIfRequired( tableSlot, tableAttributes, conversionApi ) {
  68843. const { cell } = tableSlot;
  68844. // Check whether current columnIndex is overlapped by table cells from previous rows.
  68845. const desiredCellElementName = getCellElementName( tableSlot, tableAttributes );
  68846. const viewCell = conversionApi.mapper.toViewElement( cell );
  68847. // If in single change we're converting attribute changes and inserting cell the table cell might not be inserted into view
  68848. // because of child conversion is done after parent.
  68849. if ( viewCell && viewCell.name !== desiredCellElementName ) {
  68850. renameViewTableCell( cell, desiredCellElementName, conversionApi );
  68851. }
  68852. }
  68853. // Creates a table cell element in the view.
  68854. //
  68855. // @param {module:table/tablewalker~TableSlot} tableSlot
  68856. // @param {module:engine/view/position~Position} insertPosition
  68857. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  68858. function createViewTableCellElement( tableSlot, tableAttributes, insertPosition, conversionApi, options ) {
  68859. const asWidget = options && options.asWidget;
  68860. const cellElementName = getCellElementName( tableSlot, tableAttributes );
  68861. const cellElement = asWidget ?
  68862. Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["toWidgetEditable"])( conversionApi.writer.createEditableElement( cellElementName ), conversionApi.writer ) :
  68863. conversionApi.writer.createContainerElement( cellElementName );
  68864. const tableCell = tableSlot.cell;
  68865. const firstChild = tableCell.getChild( 0 );
  68866. const isSingleParagraph = tableCell.childCount === 1 && firstChild.name === 'paragraph';
  68867. conversionApi.writer.insert( insertPosition, cellElement );
  68868. conversionApi.mapper.bindElements( tableCell, cellElement );
  68869. // Additional requirement for data pipeline to have backward compatible data tables.
  68870. if ( !asWidget && isSingleParagraph && !hasAnyAttribute( firstChild ) ) {
  68871. const innerParagraph = tableCell.getChild( 0 );
  68872. conversionApi.consumable.consume( innerParagraph, 'insert' );
  68873. conversionApi.mapper.bindElements( innerParagraph, cellElement );
  68874. }
  68875. }
  68876. // Creates a `<tr>` view element.
  68877. //
  68878. // @param {module:engine/view/element~Element} tableElement
  68879. // @param {module:engine/model/element~Element} tableRow
  68880. // @param {Number} rowIndex
  68881. // @param {{headingColumns, headingRows}} tableAttributes
  68882. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  68883. // @returns {module:engine/view/element~Element}
  68884. function createTr( tableElement, tableRow, rowIndex, tableAttributes, conversionApi ) {
  68885. // Will always consume since we're converting <tableRow> element from a parent <table>.
  68886. conversionApi.consumable.consume( tableRow, 'insert' );
  68887. const trElement = tableRow.isEmpty ?
  68888. conversionApi.writer.createEmptyElement( 'tr' ) :
  68889. conversionApi.writer.createContainerElement( 'tr' );
  68890. conversionApi.mapper.bindElements( tableRow, trElement );
  68891. const headingRows = tableAttributes.headingRows;
  68892. const tableSection = getOrCreateTableSection( getSectionName( rowIndex, tableAttributes ), tableElement, conversionApi );
  68893. const offset = headingRows > 0 && rowIndex >= headingRows ? rowIndex - headingRows : rowIndex;
  68894. const position = conversionApi.writer.createPositionAt( tableSection, offset );
  68895. conversionApi.writer.insert( position, trElement );
  68896. return trElement;
  68897. }
  68898. // Returns `th` for heading cells and `td` for other cells for the current table walker value.
  68899. //
  68900. // @param {module:table/tablewalker~TableSlot} tableSlot
  68901. // @param {{headingColumns, headingRows}} tableAttributes
  68902. // @returns {String}
  68903. function getCellElementName( tableSlot, tableAttributes ) {
  68904. const { row, column } = tableSlot;
  68905. const { headingColumns, headingRows } = tableAttributes;
  68906. // Column heading are all tableCells in the first `columnHeading` rows.
  68907. const isColumnHeading = headingRows && headingRows > row;
  68908. // So a whole row gets <th> element.
  68909. if ( isColumnHeading ) {
  68910. return 'th';
  68911. }
  68912. // Row heading are tableCells which columnIndex is lower then headingColumns.
  68913. const isRowHeading = headingColumns && headingColumns > column;
  68914. return isRowHeading ? 'th' : 'td';
  68915. }
  68916. // Returns the table section name for the current table walker value.
  68917. //
  68918. // @param {Number} row
  68919. // @param {{headingColumns, headingRows}} tableAttributes
  68920. // @returns {String}
  68921. function getSectionName( row, tableAttributes ) {
  68922. return row < tableAttributes.headingRows ? 'thead' : 'tbody';
  68923. }
  68924. // Creates or returns an existing `<tbody>` or `<thead>` element with caching.
  68925. //
  68926. // @param {String} sectionName
  68927. // @param {module:engine/view/element~Element} viewTable
  68928. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  68929. // @param {Object} cachedTableSection An object that stores cached elements.
  68930. // @returns {module:engine/view/containerelement~ContainerElement}
  68931. function getOrCreateTableSection( sectionName, viewTable, conversionApi ) {
  68932. const viewTableSection = getExistingTableSectionElement( sectionName, viewTable );
  68933. return viewTableSection ? viewTableSection : createTableSection( sectionName, viewTable, conversionApi );
  68934. }
  68935. // Finds an existing `<tbody>` or `<thead>` element or returns undefined.
  68936. //
  68937. // @param {String} sectionName
  68938. // @param {module:engine/view/element~Element} tableElement
  68939. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  68940. function getExistingTableSectionElement( sectionName, tableElement ) {
  68941. for ( const tableSection of tableElement.getChildren() ) {
  68942. if ( tableSection.name == sectionName ) {
  68943. return tableSection;
  68944. }
  68945. }
  68946. }
  68947. // Creates a table section at the end of the table.
  68948. //
  68949. // @param {String} sectionName
  68950. // @param {module:engine/view/element~Element} tableElement
  68951. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  68952. // @returns {module:engine/view/containerelement~ContainerElement}
  68953. function createTableSection( sectionName, tableElement, conversionApi ) {
  68954. const tableChildElement = conversionApi.writer.createContainerElement( sectionName );
  68955. const insertPosition = conversionApi.writer.createPositionAt( tableElement, sectionName == 'tbody' ? 'end' : 0 );
  68956. conversionApi.writer.insert( insertPosition, tableChildElement );
  68957. return tableChildElement;
  68958. }
  68959. // Removes an existing `<tbody>` or `<thead>` element if it is empty.
  68960. //
  68961. // @param {String} sectionName
  68962. // @param {module:engine/view/element~Element} tableElement
  68963. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  68964. function removeTableSectionIfEmpty( sectionName, tableElement, conversionApi ) {
  68965. const tableSection = getExistingTableSectionElement( sectionName, tableElement );
  68966. if ( tableSection && tableSection.childCount === 0 ) {
  68967. conversionApi.writer.remove( conversionApi.writer.createRangeOn( tableSection ) );
  68968. }
  68969. }
  68970. // Finds a '<table>' element inside the `<figure>` widget.
  68971. //
  68972. // @param {module:engine/view/element~Element} viewFigure
  68973. function getViewTable( viewFigure ) {
  68974. for ( const child of viewFigure.getChildren() ) {
  68975. if ( child.name === 'table' ) {
  68976. return child;
  68977. }
  68978. }
  68979. }
  68980. // Checks if an element has any attributes set.
  68981. //
  68982. // @param {module:engine/model/element~Element element
  68983. // @returns {Boolean}
  68984. function hasAnyAttribute( element ) {
  68985. return !![ ...element.getAttributeKeys() ].length;
  68986. }
  68987. /***/ }),
  68988. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-paragraph-post-fixer.js":
  68989. /*!**************************************************************************************************!*\
  68990. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-paragraph-post-fixer.js ***!
  68991. \**************************************************************************************************/
  68992. /*! exports provided: default */
  68993. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68994. "use strict";
  68995. __webpack_require__.r(__webpack_exports__);
  68996. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTableCellParagraphPostFixer; });
  68997. /**
  68998. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  68999. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  69000. */
  69001. /**
  69002. * @module table/converters/table-cell-paragraph-post-fixer
  69003. */
  69004. /**
  69005. * Injects a table cell post-fixer into the model which inserts a `paragraph` element into empty table cells.
  69006. *
  69007. * A table cell must contain at least one block element as a child. An empty table cell will have an empty `paragraph` as a child.
  69008. *
  69009. * <table>
  69010. * <tableRow>
  69011. * <tableCell></tableCell>
  69012. * </tableRow>
  69013. * </table>
  69014. *
  69015. * Will be fixed to:
  69016. *
  69017. * <table>
  69018. * <tableRow>
  69019. * <tableCell><paragraph></paragraph></tableCell>
  69020. * </tableRow>
  69021. * </table>
  69022. *
  69023. * @param {module:engine/model/model~Model} model
  69024. */
  69025. function injectTableCellParagraphPostFixer( model ) {
  69026. model.document.registerPostFixer( writer => tableCellContentsPostFixer( writer, model ) );
  69027. }
  69028. // The table cell contents post-fixer.
  69029. //
  69030. // @param {module:engine/model/writer~Writer} writer
  69031. // @param {module:engine/model/model~Model} model
  69032. function tableCellContentsPostFixer( writer, model ) {
  69033. const changes = model.document.differ.getChanges();
  69034. let wasFixed = false;
  69035. for ( const entry of changes ) {
  69036. if ( entry.type == 'insert' && entry.name == 'table' ) {
  69037. wasFixed = fixTable( entry.position.nodeAfter, writer ) || wasFixed;
  69038. }
  69039. if ( entry.type == 'insert' && entry.name == 'tableRow' ) {
  69040. wasFixed = fixTableRow( entry.position.nodeAfter, writer ) || wasFixed;
  69041. }
  69042. if ( entry.type == 'insert' && entry.name == 'tableCell' ) {
  69043. wasFixed = fixTableCellContent( entry.position.nodeAfter, writer ) || wasFixed;
  69044. }
  69045. if ( checkTableCellChange( entry ) ) {
  69046. wasFixed = fixTableCellContent( entry.position.parent, writer ) || wasFixed;
  69047. }
  69048. }
  69049. return wasFixed;
  69050. }
  69051. // Fixes all table cells in a table.
  69052. //
  69053. // @param {module:engine/model/element~Element} table
  69054. // @param {module:engine/model/writer~Writer} writer
  69055. function fixTable( table, writer ) {
  69056. let wasFixed = false;
  69057. for ( const row of table.getChildren() ) {
  69058. if ( row.is( 'element', 'tableRow' ) ) {
  69059. wasFixed = fixTableRow( row, writer ) || wasFixed;
  69060. }
  69061. }
  69062. return wasFixed;
  69063. }
  69064. // Fixes all table cells in a table row.
  69065. //
  69066. // @param {module:engine/model/element~Element} tableRow
  69067. // @param {module:engine/model/writer~Writer} writer
  69068. function fixTableRow( tableRow, writer ) {
  69069. let wasFixed = false;
  69070. for ( const tableCell of tableRow.getChildren() ) {
  69071. wasFixed = fixTableCellContent( tableCell, writer ) || wasFixed;
  69072. }
  69073. return wasFixed;
  69074. }
  69075. // Fixes all table cell content by:
  69076. // - Adding a paragraph to a table cell without any child.
  69077. // - Wrapping direct $text in a `<paragraph>`.
  69078. //
  69079. // @param {module:engine/model/element~Element} table
  69080. // @param {module:engine/model/writer~Writer} writer
  69081. // @returns {Boolean}
  69082. function fixTableCellContent( tableCell, writer ) {
  69083. // Insert paragraph to an empty table cell.
  69084. if ( tableCell.childCount == 0 ) {
  69085. // @if CK_DEBUG_TABLE // console.log( 'Post-fixing table: insert paragraph in empty cell.' );
  69086. writer.insertElement( 'paragraph', tableCell );
  69087. return true;
  69088. }
  69089. // Check table cell children for directly placed text nodes.
  69090. // Temporary solution. See https://github.com/ckeditor/ckeditor5/issues/1464.
  69091. const textNodes = Array.from( tableCell.getChildren() ).filter( child => child.is( '$text' ) );
  69092. // @if CK_DEBUG_TABLE // textNodes.length && console.log( 'Post-fixing table: wrap cell content with paragraph.' );
  69093. for ( const child of textNodes ) {
  69094. writer.wrap( writer.createRangeOn( child ), 'paragraph' );
  69095. }
  69096. // Return true when there were text nodes to fix.
  69097. return !!textNodes.length;
  69098. }
  69099. // Checks if a differ change should fix the table cell. This happens on:
  69100. // - Removing content from the table cell (i.e. `tableCell` can be left empty).
  69101. // - Adding a text node directly into a table cell.
  69102. //
  69103. // @param {Object} differ change entry
  69104. // @returns {Boolean}
  69105. function checkTableCellChange( entry ) {
  69106. if ( !entry.position || !entry.position.parent.is( 'element', 'tableCell' ) ) {
  69107. return false;
  69108. }
  69109. return entry.type == 'insert' && entry.name == '$text' || entry.type == 'remove';
  69110. }
  69111. /***/ }),
  69112. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-refresh-post-fixer.js":
  69113. /*!************************************************************************************************!*\
  69114. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-refresh-post-fixer.js ***!
  69115. \************************************************************************************************/
  69116. /*! exports provided: default */
  69117. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69118. "use strict";
  69119. __webpack_require__.r(__webpack_exports__);
  69120. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTableCellRefreshPostFixer; });
  69121. /* harmony import */ var _downcast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./downcast */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js");
  69122. /**
  69123. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  69124. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  69125. */
  69126. /**
  69127. * @module table/converters/table-cell-refresh-post-fixer
  69128. */
  69129. /**
  69130. * Injects a table cell post-fixer into the model which marks the table cell in the differ to have it re-rendered.
  69131. *
  69132. * Model `paragraph` inside a table cell can be rendered as `<span>` or `<p>`. It is rendered as `<span>` if this is the only block
  69133. * element in that table cell and it does not have any attributes. It is rendered as `<p>` otherwise.
  69134. *
  69135. * When table cell content changes, for example a second `paragraph` element is added, we need to ensure that the first `paragraph` is
  69136. * re-rendered so it changes from `<span>` to `<p>`. The easiest way to do it is to re-render the entire table cell.
  69137. *
  69138. * @param {module:engine/model/model~Model} model
  69139. * @param {module:engine/conversion/mapper~Mapper} mapper
  69140. */
  69141. function injectTableCellRefreshPostFixer( model, mapper ) {
  69142. model.document.registerPostFixer( () => tableCellRefreshPostFixer( model.document.differ, mapper ) );
  69143. }
  69144. function tableCellRefreshPostFixer( differ, mapper ) {
  69145. // Stores cells to be refreshed, so the table cell will be refreshed once for multiple changes.
  69146. // 1. Gather all changes inside table cell.
  69147. const cellsToCheck = new Set();
  69148. for ( const change of differ.getChanges() ) {
  69149. const parent = change.type == 'attribute' ? change.range.start.parent : change.position.parent;
  69150. if ( parent.is( 'element', 'tableCell' ) ) {
  69151. cellsToCheck.add( parent );
  69152. }
  69153. }
  69154. // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: Checking table cell to refresh (${ cellsToCheck.size }).` );
  69155. // @if CK_DEBUG_TABLE // let paragraphsRefreshed = 0;
  69156. for ( const tableCell of cellsToCheck.values() ) {
  69157. for ( const paragraph of [ ...tableCell.getChildren() ].filter( child => shouldRefresh( child, mapper ) ) ) {
  69158. // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: refreshing paragraph in table cell (${++paragraphsRefreshed}).` );
  69159. differ.refreshItem( paragraph );
  69160. }
  69161. }
  69162. // Always return false to prevent the refresh post-fixer from re-running on the same set of changes and going into an infinite loop.
  69163. // This "post-fixer" does not change the model structure so there shouldn't be need to run other post-fixers again.
  69164. // See https://github.com/ckeditor/ckeditor5/issues/1936 & https://github.com/ckeditor/ckeditor5/issues/8200.
  69165. return false;
  69166. }
  69167. // Check if given model element needs refreshing.
  69168. //
  69169. // @param {module:engine/model/element~Element} modelElement
  69170. // @param {module:engine/conversion/mapper~Mapper} mapper
  69171. // @returns {Boolean}
  69172. function shouldRefresh( child, mapper ) {
  69173. if ( !child.is( 'element', 'paragraph' ) ) {
  69174. return false;
  69175. }
  69176. const viewElement = mapper.toViewElement( child );
  69177. if ( !viewElement ) {
  69178. return false;
  69179. }
  69180. return Object(_downcast__WEBPACK_IMPORTED_MODULE_0__["isSingleParagraphWithoutAttributes"])( child ) !== viewElement.is( 'element', 'span' );
  69181. }
  69182. /***/ }),
  69183. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-heading-rows-refresh-post-fixer.js":
  69184. /*!********************************************************************************************************!*\
  69185. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/table-heading-rows-refresh-post-fixer.js ***!
  69186. \********************************************************************************************************/
  69187. /*! exports provided: default */
  69188. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69189. "use strict";
  69190. __webpack_require__.r(__webpack_exports__);
  69191. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTableHeadingRowsRefreshPostFixer; });
  69192. /**
  69193. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  69194. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  69195. */
  69196. /**
  69197. * @module table/converters/table-heading-rows-refresh-post-fixer
  69198. */
  69199. /**
  69200. * Injects a table post-fixer into the model which marks the table in the differ to have it re-rendered.
  69201. *
  69202. * Table heading rows are represented in the model by a `headingRows` attribute. However, in the view, it's represented as separate
  69203. * sections of the table (`<thead>` or `<tbody>`) and changing `headingRows` attribute requires moving table rows between two sections.
  69204. * This causes problems with structural changes in a table (like adding and removing rows) thus atomic converters cannot be used.
  69205. *
  69206. * When table `headingRows` attribute changes, the entire table is re-rendered.
  69207. *
  69208. * @param {module:engine/model/model~Model} model
  69209. */
  69210. function injectTableHeadingRowsRefreshPostFixer( model ) {
  69211. model.document.registerPostFixer( () => tableHeadingRowsRefreshPostFixer( model ) );
  69212. }
  69213. function tableHeadingRowsRefreshPostFixer( model ) {
  69214. const differ = model.document.differ;
  69215. // Stores tables to be refreshed so the table will be refreshed once for multiple changes.
  69216. const tablesToRefresh = new Set();
  69217. for ( const change of differ.getChanges() ) {
  69218. if ( change.type === 'attribute' ) {
  69219. const element = change.range.start.nodeAfter;
  69220. if ( element && element.is( 'element', 'table' ) && change.attributeKey === 'headingRows' ) {
  69221. tablesToRefresh.add( element );
  69222. }
  69223. } else {
  69224. /* istanbul ignore else */
  69225. if ( change.type === 'insert' || change.type === 'remove' ) {
  69226. if ( change.name === 'tableRow' ) {
  69227. const table = change.position.findAncestor( 'table' );
  69228. const headingRows = table.getAttribute( 'headingRows' ) || 0;
  69229. if ( change.position.offset < headingRows ) {
  69230. tablesToRefresh.add( table );
  69231. }
  69232. } else if ( change.name === 'tableCell' ) {
  69233. const table = change.position.findAncestor( 'table' );
  69234. const headingColumns = table.getAttribute( 'headingColumns' ) || 0;
  69235. if ( change.position.offset < headingColumns ) {
  69236. tablesToRefresh.add( table );
  69237. }
  69238. }
  69239. }
  69240. }
  69241. }
  69242. if ( tablesToRefresh.size ) {
  69243. // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: refreshing heading rows (${ tablesToRefresh.size }).` );
  69244. for ( const table of tablesToRefresh.values() ) {
  69245. // Should be handled by a `triggerBy` configuration. See: https://github.com/ckeditor/ckeditor5/issues/8138.
  69246. differ.refreshItem( table );
  69247. }
  69248. return true;
  69249. }
  69250. return false;
  69251. }
  69252. /***/ }),
  69253. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-layout-post-fixer.js":
  69254. /*!******************************************************************************************!*\
  69255. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/table-layout-post-fixer.js ***!
  69256. \******************************************************************************************/
  69257. /*! exports provided: default */
  69258. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69259. "use strict";
  69260. __webpack_require__.r(__webpack_exports__);
  69261. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTableLayoutPostFixer; });
  69262. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  69263. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  69264. /**
  69265. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  69266. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  69267. */
  69268. /**
  69269. * @module table/converters/table-layout-post-fixer
  69270. */
  69271. /**
  69272. * Injects a table layout post-fixer into the model.
  69273. *
  69274. * The role of the table layout post-fixer is to ensure that the table rows have the correct structure
  69275. * after a {@link module:engine/model/model~Model#change `change()`} block was executed.
  69276. *
  69277. * The correct structure means that:
  69278. *
  69279. * * All table rows have the same size.
  69280. * * None of the table cells extend vertically beyond their section (either header or body).
  69281. * * A table cell has always at least one element as a child.
  69282. *
  69283. * If the table structure is not correct, the post-fixer will automatically correct it in two steps:
  69284. *
  69285. * 1. It will clip table cells that extend beyond their section.
  69286. * 2. It will add empty table cells to the rows that are narrower than the widest table row.
  69287. *
  69288. * ## Clipping overlapping table cells
  69289. *
  69290. * Such situation may occur when pasting a table (or a part of a table) to the editor from external sources.
  69291. *
  69292. * For example, see the following table which has a cell (FOO) with the rowspan attribute (2):
  69293. *
  69294. * <table headingRows="1">
  69295. * <tableRow>
  69296. * <tableCell rowspan="2"><paragraph>FOO</paragraph></tableCell>
  69297. * <tableCell colspan="2"><paragraph>BAR</paragraph></tableCell>
  69298. * </tableRow>
  69299. * <tableRow>
  69300. * <tableCell><paragraph>BAZ</paragraph></tableCell>
  69301. * <tableCell><paragraph>XYZ</paragraph></tableCell>
  69302. * </tableRow>
  69303. * </table>
  69304. *
  69305. * It will be rendered in the view as:
  69306. *
  69307. * <table>
  69308. * <thead>
  69309. * <tr>
  69310. * <td rowspan="2">FOO</td>
  69311. * <td colspan="2">BAR</td>
  69312. * </tr>
  69313. * </thead>
  69314. * <tbody>
  69315. * <tr>
  69316. * <td>BAZ</td>
  69317. * <td>XYZ</td>
  69318. * </tr>
  69319. * </tbody>
  69320. * </table>
  69321. *
  69322. * In the above example the table will be rendered as a table with two rows: one in the header and second one in the body.
  69323. * The table cell (FOO) cannot span over multiple rows as it would extend from the header to the body section.
  69324. * The `rowspan` attribute must be changed to (1). The value (1) is the default value of the `rowspan` attribute
  69325. * so the `rowspan` attribute will be removed from the model.
  69326. *
  69327. * The table cell with BAZ in the content will be in the first column of the table.
  69328. *
  69329. * ## Adding missing table cells
  69330. *
  69331. * The table post-fixer will insert empty table cells to equalize table row sizes (the number of columns).
  69332. * The size of a table row is calculated by counting column spans of table cells, both horizontal (from the same row) and
  69333. * vertical (from the rows above).
  69334. *
  69335. * In the above example, the table row in the body section of the table is narrower then the row from the header: it has two cells
  69336. * with the default colspan (1). The header row has one cell with colspan (1) and the second with colspan (2).
  69337. * The table cell (FOO) does not extend beyond the head section (and as such will be fixed in the first step of this post-fixer).
  69338. * The post-fixer will add a missing table cell to the row in the body section of the table.
  69339. *
  69340. * The table from the above example will be fixed and rendered to the view as below:
  69341. *
  69342. * <table>
  69343. * <thead>
  69344. * <tr>
  69345. * <td rowspan="2">FOO</td>
  69346. * <td colspan="2">BAR</td>
  69347. * </tr>
  69348. * </thead>
  69349. * <tbody>
  69350. * <tr>
  69351. * <td>BAZ</td>
  69352. * <td>XYZ</td>
  69353. * </tr>
  69354. * </tbody>
  69355. * </table>
  69356. *
  69357. * ## Collaboration and undo - Expectations vs post-fixer results
  69358. *
  69359. * The table post-fixer only ensures proper structure without a deeper analysis of the nature of the change. As such, it might lead
  69360. * to a structure which was not intended by the user. In particular, it will also fix undo steps (in conjunction with collaboration)
  69361. * in which the editor content might not return to the original state.
  69362. *
  69363. * This will usually happen when one or more users change the size of the table.
  69364. *
  69365. * As an example see the table below:
  69366. *
  69367. * <table>
  69368. * <tbody>
  69369. * <tr>
  69370. * <td>11</td>
  69371. * <td>12</td>
  69372. * </tr>
  69373. * <tr>
  69374. * <td>21</td>
  69375. * <td>22</td>
  69376. * </tr>
  69377. * </tbody>
  69378. * </table>
  69379. *
  69380. * and the user actions:
  69381. *
  69382. * 1. Both users have a table with two rows and two columns.
  69383. * 2. User A adds a column at the end of the table. This will insert empty table cells to two rows.
  69384. * 3. User B adds a row at the end of the table. This will insert a row with two empty table cells.
  69385. * 4. Both users will have a table as below:
  69386. *
  69387. *
  69388. * <table>
  69389. * <tbody>
  69390. * <tr>
  69391. * <td>11</td>
  69392. * <td>12</td>
  69393. * <td>(empty, inserted by A)</td>
  69394. * </tr>
  69395. * <tr>
  69396. * <td>21</td>
  69397. * <td>22</td>
  69398. * <td>(empty, inserted by A)</td>
  69399. * </tr>
  69400. * <tr>
  69401. * <td>(empty, inserted by B)</td>
  69402. * <td>(empty, inserted by B)</td>
  69403. * </tr>
  69404. * </tbody>
  69405. * </table>
  69406. *
  69407. * The last row is shorter then others so the table post-fixer will add an empty row to the last row:
  69408. *
  69409. * <table>
  69410. * <tbody>
  69411. * <tr>
  69412. * <td>11</td>
  69413. * <td>12</td>
  69414. * <td>(empty, inserted by A)</td>
  69415. * </tr>
  69416. * <tr>
  69417. * <td>21</td>
  69418. * <td>22</td>
  69419. * <td>(empty, inserted by A)</td>
  69420. * </tr>
  69421. * <tr>
  69422. * <td>(empty, inserted by B)</td>
  69423. * <td>(empty, inserted by B)</td>
  69424. * <td>(empty, inserted by the post-fixer)</td>
  69425. * </tr>
  69426. * </tbody>
  69427. * </table>
  69428. *
  69429. * Unfortunately undo does not know the nature of the changes and depending on which user applies the post-fixer changes, undoing them
  69430. * might lead to a broken table. If User B undoes inserting the column to the table, the undo engine will undo only the operations of
  69431. * inserting empty cells to rows from the initial table state (row 1 and 2) but the cell in the post-fixed row will remain:
  69432. *
  69433. * <table>
  69434. * <tbody>
  69435. * <tr>
  69436. * <td>11</td>
  69437. * <td>12</td>
  69438. * </tr>
  69439. * <tr>
  69440. * <td>21</td>
  69441. * <td>22</td>
  69442. * </tr>
  69443. * <tr>
  69444. * <td>(empty, inserted by B)</td>
  69445. * <td>(empty, inserted by B)</td>
  69446. * <td>(empty, inserted by a post-fixer)</td>
  69447. * </tr>
  69448. * </tbody>
  69449. * </table>
  69450. *
  69451. * After undo, the table post-fixer will detect that two rows are shorter than others and will fix the table to:
  69452. *
  69453. * <table>
  69454. * <tbody>
  69455. * <tr>
  69456. * <td>11</td>
  69457. * <td>12</td>
  69458. * <td>(empty, inserted by a post-fixer after undo)</td>
  69459. * </tr>
  69460. * <tr>
  69461. * <td>21</td>
  69462. * <td>22</td>
  69463. * <td>(empty, inserted by a post-fixer after undo)</td>
  69464. * </tr>
  69465. * <tr>
  69466. * <td>(empty, inserted by B)</td>
  69467. * <td>(empty, inserted by B)</td>
  69468. * <td>(empty, inserted by a post-fixer)</td>
  69469. * </tr>
  69470. * </tbody>
  69471. * </table>
  69472. * @param {module:engine/model/model~Model} model
  69473. */
  69474. function injectTableLayoutPostFixer( model ) {
  69475. model.document.registerPostFixer( writer => tableLayoutPostFixer( writer, model ) );
  69476. }
  69477. // The table layout post-fixer.
  69478. //
  69479. // @param {module:engine/model/writer~Writer} writer
  69480. // @param {module:engine/model/model~Model} model
  69481. function tableLayoutPostFixer( writer, model ) {
  69482. const changes = model.document.differ.getChanges();
  69483. let wasFixed = false;
  69484. // Do not analyze the same table more then once - may happen for multiple changes in the same table.
  69485. const analyzedTables = new Set();
  69486. for ( const entry of changes ) {
  69487. let table;
  69488. if ( entry.name == 'table' && entry.type == 'insert' ) {
  69489. table = entry.position.nodeAfter;
  69490. }
  69491. // Fix table on adding/removing table cells and rows.
  69492. if ( entry.name == 'tableRow' || entry.name == 'tableCell' ) {
  69493. table = entry.position.findAncestor( 'table' );
  69494. }
  69495. // Fix table on any table's attribute change - including attributes of table cells.
  69496. if ( isTableAttributeEntry( entry ) ) {
  69497. table = entry.range.start.findAncestor( 'table' );
  69498. }
  69499. if ( table && !analyzedTables.has( table ) ) {
  69500. // Step 1: correct rowspans of table cells if necessary.
  69501. // The wasFixed flag should be true if any of tables in batch was fixed - might be more then one.
  69502. wasFixed = fixTableCellsRowspan( table, writer ) || wasFixed;
  69503. // Step 2: fix table rows sizes.
  69504. wasFixed = fixTableRowsSizes( table, writer ) || wasFixed;
  69505. analyzedTables.add( table );
  69506. }
  69507. }
  69508. return wasFixed;
  69509. }
  69510. // Fixes the invalid value of the `rowspan` attribute because a table cell cannot vertically extend beyond the table section it belongs to.
  69511. //
  69512. // @param {module:engine/model/element~Element} table
  69513. // @param {module:engine/model/writer~Writer} writer
  69514. // @returns {Boolean} Returns `true` if the table was fixed.
  69515. function fixTableCellsRowspan( table, writer ) {
  69516. let wasFixed = false;
  69517. const cellsToTrim = findCellsToTrim( table );
  69518. if ( cellsToTrim.length ) {
  69519. // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: trimming cells row-spans (${ cellsToTrim.length }).` );
  69520. wasFixed = true;
  69521. for ( const data of cellsToTrim ) {
  69522. Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'rowspan', data.rowspan, data.cell, writer, 1 );
  69523. }
  69524. }
  69525. return wasFixed;
  69526. }
  69527. // Makes all table rows in a table the same size.
  69528. //
  69529. // @param {module:engine/model/element~Element} table
  69530. // @param {module:engine/model/writer~Writer} writer
  69531. // @returns {Boolean} Returns `true` if the table was fixed.
  69532. function fixTableRowsSizes( table, writer ) {
  69533. let wasFixed = false;
  69534. const childrenLengths = getChildrenLengths( table );
  69535. const rowsToRemove = [];
  69536. // Find empty rows.
  69537. for ( const [ rowIndex, size ] of childrenLengths.entries() ) {
  69538. // Ignore all non-row models.
  69539. if ( !size && table.getChild( rowIndex ).is( 'element', 'tableRow' ) ) {
  69540. rowsToRemove.push( rowIndex );
  69541. }
  69542. }
  69543. // Remove empty rows.
  69544. if ( rowsToRemove.length ) {
  69545. // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: remove empty rows (${ rowsToRemove.length }).` );
  69546. wasFixed = true;
  69547. for ( const rowIndex of rowsToRemove.reverse() ) {
  69548. writer.remove( table.getChild( rowIndex ) );
  69549. childrenLengths.splice( rowIndex, 1 );
  69550. }
  69551. }
  69552. // Filter out everything that's not a table row.
  69553. const rowsLengths = childrenLengths.filter( ( row, rowIndex ) => table.getChild( rowIndex ).is( 'element', 'tableRow' ) );
  69554. // Verify if all the rows have the same number of columns.
  69555. const tableSize = rowsLengths[ 0 ];
  69556. const isValid = rowsLengths.every( length => length === tableSize );
  69557. if ( !isValid ) {
  69558. // @if CK_DEBUG_TABLE // console.log( 'Post-fixing table: adding missing cells.' );
  69559. // Find the maximum number of columns.
  69560. const maxColumns = rowsLengths.reduce( ( prev, current ) => current > prev ? current : prev, 0 );
  69561. for ( const [ rowIndex, size ] of rowsLengths.entries() ) {
  69562. const columnsToInsert = maxColumns - size;
  69563. if ( columnsToInsert ) {
  69564. for ( let i = 0; i < columnsToInsert; i++ ) {
  69565. Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["createEmptyTableCell"])( writer, writer.createPositionAt( table.getChild( rowIndex ), 'end' ) );
  69566. }
  69567. wasFixed = true;
  69568. }
  69569. }
  69570. }
  69571. return wasFixed;
  69572. }
  69573. // Searches for table cells that extend beyond the table section to which they belong to. It will return an array of objects
  69574. // that stores table cells to be trimmed and the correct value of the `rowspan` attribute to set.
  69575. //
  69576. // @param {module:engine/model/element~Element} table
  69577. // @returns {Array.<{{cell, rowspan}}>}
  69578. function findCellsToTrim( table ) {
  69579. const headingRows = parseInt( table.getAttribute( 'headingRows' ) || 0 );
  69580. const maxRows = Array.from( table.getChildren() )
  69581. .reduce( ( count, row ) => row.is( 'element', 'tableRow' ) ? count + 1 : count, 0 );
  69582. const cellsToTrim = [];
  69583. for ( const { row, cell, cellHeight } of new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table ) ) {
  69584. // Skip cells that do not expand over its row.
  69585. if ( cellHeight < 2 ) {
  69586. continue;
  69587. }
  69588. const isInHeader = row < headingRows;
  69589. // Row limit is either end of header section or whole table as table body is after the header.
  69590. const rowLimit = isInHeader ? headingRows : maxRows;
  69591. // If table cell expands over its limit reduce it height to proper value.
  69592. if ( row + cellHeight > rowLimit ) {
  69593. const newRowspan = rowLimit - row;
  69594. cellsToTrim.push( { cell, rowspan: newRowspan } );
  69595. }
  69596. }
  69597. return cellsToTrim;
  69598. }
  69599. // Returns an array with lengths of rows assigned to the corresponding row index.
  69600. //
  69601. // @param {module:engine/model/element~Element} table
  69602. // @returns {Array.<Number>}
  69603. function getChildrenLengths( table ) {
  69604. // TableWalker will not provide items for the empty rows, we need to pre-fill this array.
  69605. const lengths = new Array( table.childCount ).fill( 0 );
  69606. for ( const { rowIndex } of new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { includeAllSlots: true } ) ) {
  69607. lengths[ rowIndex ]++;
  69608. }
  69609. return lengths;
  69610. }
  69611. // Checks if the differ entry for an attribute change is one of the table's attributes.
  69612. //
  69613. // @param entry
  69614. // @returns {Boolean}
  69615. function isTableAttributeEntry( entry ) {
  69616. const isAttributeType = entry.type === 'attribute';
  69617. const key = entry.attributeKey;
  69618. return isAttributeType && ( key === 'headingRows' || key === 'colspan' || key === 'rowspan' );
  69619. }
  69620. /***/ }),
  69621. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/upcasttable.js":
  69622. /*!******************************************************************************!*\
  69623. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/upcasttable.js ***!
  69624. \******************************************************************************/
  69625. /*! exports provided: upcastTableFigure, default, skipEmptyTableRow, ensureParagraphInTableCell */
  69626. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69627. "use strict";
  69628. __webpack_require__.r(__webpack_exports__);
  69629. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "upcastTableFigure", function() { return upcastTableFigure; });
  69630. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return upcastTable; });
  69631. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipEmptyTableRow", function() { return skipEmptyTableRow; });
  69632. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureParagraphInTableCell", function() { return ensureParagraphInTableCell; });
  69633. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  69634. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  69635. /**
  69636. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  69637. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  69638. */
  69639. /**
  69640. * @module table/converters/upcasttable
  69641. */
  69642. /**
  69643. * Returns a function that converts the table view representation:
  69644. *
  69645. * <figure class="table"><table>...</table></figure>
  69646. *
  69647. * to the model representation:
  69648. *
  69649. * <table></table>
  69650. *
  69651. * @returns {Function}
  69652. */
  69653. function upcastTableFigure() {
  69654. return dispatcher => {
  69655. dispatcher.on( 'element:figure', ( evt, data, conversionApi ) => {
  69656. // Do not convert if this is not a "table figure".
  69657. if ( !conversionApi.consumable.test( data.viewItem, { name: true, classes: 'table' } ) ) {
  69658. return;
  69659. }
  69660. // Find an table element inside the figure element.
  69661. const viewTable = getViewTableFromFigure( data.viewItem );
  69662. // Do not convert if table element is absent or was already converted.
  69663. if ( !viewTable || !conversionApi.consumable.test( viewTable, { name: true } ) ) {
  69664. return;
  69665. }
  69666. // Consume the figure to prevent other converters from processing it again.
  69667. conversionApi.consumable.consume( data.viewItem, { name: true, classes: 'table' } );
  69668. // Convert view table to model table.
  69669. const conversionResult = conversionApi.convertItem( viewTable, data.modelCursor );
  69670. // Get table element from conversion result.
  69671. const modelTable = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( conversionResult.modelRange.getItems() );
  69672. // When table wasn't successfully converted then finish conversion.
  69673. if ( !modelTable ) {
  69674. // Revert consumed figure so other features can convert it.
  69675. conversionApi.consumable.revert( data.viewItem, { name: true, classes: 'table' } );
  69676. return;
  69677. }
  69678. conversionApi.convertChildren( data.viewItem, conversionApi.writer.createPositionAt( modelTable, 'end' ) );
  69679. conversionApi.updateConversionResult( modelTable, data );
  69680. } );
  69681. };
  69682. }
  69683. /**
  69684. * View table element to model table element conversion helper.
  69685. *
  69686. * This conversion helper converts the table element as well as table rows.
  69687. *
  69688. * @returns {Function} Conversion helper.
  69689. */
  69690. function upcastTable() {
  69691. return dispatcher => {
  69692. dispatcher.on( 'element:table', ( evt, data, conversionApi ) => {
  69693. const viewTable = data.viewItem;
  69694. // When element was already consumed then skip it.
  69695. if ( !conversionApi.consumable.test( viewTable, { name: true } ) ) {
  69696. return;
  69697. }
  69698. const { rows, headingRows, headingColumns } = scanTable( viewTable );
  69699. // Only set attributes if values is greater then 0.
  69700. const attributes = {};
  69701. if ( headingColumns ) {
  69702. attributes.headingColumns = headingColumns;
  69703. }
  69704. if ( headingRows ) {
  69705. attributes.headingRows = headingRows;
  69706. }
  69707. const table = conversionApi.writer.createElement( 'table', attributes );
  69708. if ( !conversionApi.safeInsert( table, data.modelCursor ) ) {
  69709. return;
  69710. }
  69711. conversionApi.consumable.consume( viewTable, { name: true } );
  69712. // Upcast table rows in proper order (heading rows first).
  69713. rows.forEach( row => conversionApi.convertItem( row, conversionApi.writer.createPositionAt( table, 'end' ) ) );
  69714. // Convert everything else.
  69715. conversionApi.convertChildren( viewTable, conversionApi.writer.createPositionAt( table, 'end' ) );
  69716. // Create one row and one table cell for empty table.
  69717. if ( table.isEmpty ) {
  69718. const row = conversionApi.writer.createElement( 'tableRow' );
  69719. conversionApi.writer.insert( row, conversionApi.writer.createPositionAt( table, 'end' ) );
  69720. Object(_utils_common__WEBPACK_IMPORTED_MODULE_0__["createEmptyTableCell"])( conversionApi.writer, conversionApi.writer.createPositionAt( row, 'end' ) );
  69721. }
  69722. conversionApi.updateConversionResult( table, data );
  69723. } );
  69724. };
  69725. }
  69726. /**
  69727. * A conversion helper that skips empty <tr> elements from upcasting at the beginning of the table.
  69728. *
  69729. * An empty row is considered a table model error but when handling clipboard data there could be rows that contain only row-spanned cells
  69730. * and empty TR-s are used to maintain the table structure (also {@link module:table/tablewalker~TableWalker} assumes that there are only
  69731. * rows that have related `tableRow` elements).
  69732. *
  69733. * *Note:* Only the first empty rows are removed because they have no meaning and it solves the issue
  69734. * of an improper table with all empty rows.
  69735. *
  69736. * @returns {Function} Conversion helper.
  69737. */
  69738. function skipEmptyTableRow() {
  69739. return dispatcher => {
  69740. dispatcher.on( 'element:tr', ( evt, data ) => {
  69741. if ( data.viewItem.isEmpty && data.modelCursor.index == 0 ) {
  69742. evt.stop();
  69743. }
  69744. }, { priority: 'high' } );
  69745. };
  69746. }
  69747. /**
  69748. * A converter that ensures an empty paragraph is inserted in a table cell if no other content was converted.
  69749. *
  69750. * @returns {Function} Conversion helper.
  69751. */
  69752. function ensureParagraphInTableCell( elementName ) {
  69753. return dispatcher => {
  69754. dispatcher.on( `element:${ elementName }`, ( evt, data, conversionApi ) => {
  69755. // The default converter will create a model range on converted table cell.
  69756. if ( !data.modelRange ) {
  69757. return;
  69758. }
  69759. // Ensure a paragraph in the model for empty table cells for converted table cells.
  69760. if ( data.viewItem.isEmpty ) {
  69761. const tableCell = data.modelRange.start.nodeAfter;
  69762. const modelCursor = conversionApi.writer.createPositionAt( tableCell, 0 );
  69763. conversionApi.writer.insertElement( 'paragraph', modelCursor );
  69764. }
  69765. }, { priority: 'low' } );
  69766. };
  69767. }
  69768. // Get view `<table>` element from the view widget (`<figure>`).
  69769. //
  69770. // @private
  69771. // @param {module:engine/view/element~Element} figureView
  69772. // @returns {module:engine/view/element~Element}
  69773. function getViewTableFromFigure( figureView ) {
  69774. for ( const figureChild of figureView.getChildren() ) {
  69775. if ( figureChild.is( 'element', 'table' ) ) {
  69776. return figureChild;
  69777. }
  69778. }
  69779. }
  69780. // Scans table rows and extracts required metadata from the table:
  69781. //
  69782. // headingRows - The number of rows that go as table headers.
  69783. // headingColumns - The maximum number of row headings.
  69784. // rows - Sorted `<tr>` elements as they should go into the model - ie. if `<thead>` is inserted after `<tbody>` in the view.
  69785. //
  69786. // @private
  69787. // @param {module:engine/view/element~Element} viewTable
  69788. // @returns {{headingRows, headingColumns, rows}}
  69789. function scanTable( viewTable ) {
  69790. const tableMeta = {
  69791. headingRows: 0,
  69792. headingColumns: 0
  69793. };
  69794. // The `<tbody>` and `<thead>` sections in the DOM do not have to be in order `<thead>` -> `<tbody>` and there might be more than one
  69795. // of them.
  69796. // As the model does not have these sections, rows from different sections must be sorted.
  69797. // For example, below is a valid HTML table:
  69798. //
  69799. // <table>
  69800. // <tbody><tr><td>2</td></tr></tbody>
  69801. // <thead><tr><td>1</td></tr></thead>
  69802. // <tbody><tr><td>3</td></tr></tbody>
  69803. // </table>
  69804. //
  69805. // But browsers will render rows in order as: 1 as the heading and 2 and 3 as the body.
  69806. const headRows = [];
  69807. const bodyRows = [];
  69808. // Currently the editor does not support more then one <thead> section.
  69809. // Only the first <thead> from the view will be used as a heading row and the others will be converted to body rows.
  69810. let firstTheadElement;
  69811. for ( const tableChild of Array.from( viewTable.getChildren() ) ) {
  69812. // Only `<thead>`, `<tbody>` & `<tfoot>` from allowed table children can have `<tr>`s.
  69813. // The else is for future purposes (mainly `<caption>`).
  69814. if ( tableChild.name === 'tbody' || tableChild.name === 'thead' || tableChild.name === 'tfoot' ) {
  69815. // Save the first `<thead>` in the table as table header - all other ones will be converted to table body rows.
  69816. if ( tableChild.name === 'thead' && !firstTheadElement ) {
  69817. firstTheadElement = tableChild;
  69818. }
  69819. // There might be some extra empty text nodes between the `<tr>`s.
  69820. // Make sure further code operates on `tr`s only. (#145)
  69821. const trs = Array.from( tableChild.getChildren() ).filter( el => el.is( 'element', 'tr' ) );
  69822. for ( const tr of trs ) {
  69823. // This <tr> is a child of a first <thead> element.
  69824. if ( tr.parent.name === 'thead' && tr.parent === firstTheadElement ) {
  69825. tableMeta.headingRows++;
  69826. headRows.push( tr );
  69827. } else {
  69828. bodyRows.push( tr );
  69829. // For other rows check how many column headings this row has.
  69830. const headingCols = scanRowForHeadingColumns( tr, tableMeta, firstTheadElement );
  69831. if ( headingCols > tableMeta.headingColumns ) {
  69832. tableMeta.headingColumns = headingCols;
  69833. }
  69834. }
  69835. }
  69836. }
  69837. }
  69838. tableMeta.rows = [ ...headRows, ...bodyRows ];
  69839. return tableMeta;
  69840. }
  69841. // Scans a `<tr>` element and its children for metadata:
  69842. // - For heading row:
  69843. // - Adds this row to either the heading or the body rows.
  69844. // - Updates the number of heading rows.
  69845. // - For body rows:
  69846. // - Calculates the number of column headings.
  69847. //
  69848. // @private
  69849. // @param {module:engine/view/element~Element} tr
  69850. // @returns {Number}
  69851. function scanRowForHeadingColumns( tr ) {
  69852. let headingColumns = 0;
  69853. let index = 0;
  69854. // Filter out empty text nodes from tr children.
  69855. const children = Array.from( tr.getChildren() )
  69856. .filter( child => child.name === 'th' || child.name === 'td' );
  69857. // Count starting adjacent <th> elements of a <tr>.
  69858. while ( index < children.length && children[ index ].name === 'th' ) {
  69859. const th = children[ index ];
  69860. // Adjust columns calculation by the number of spanned columns.
  69861. const colspan = parseInt( th.getAttribute( 'colspan' ) || 1 );
  69862. headingColumns = headingColumns + colspan;
  69863. index++;
  69864. }
  69865. return headingColumns;
  69866. }
  69867. /***/ }),
  69868. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/table.js":
  69869. /*!*************************************************************!*\
  69870. !*** ./node_modules/@ckeditor/ckeditor5-table/src/table.js ***!
  69871. \*************************************************************/
  69872. /*! exports provided: default */
  69873. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69874. "use strict";
  69875. __webpack_require__.r(__webpack_exports__);
  69876. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Table; });
  69877. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  69878. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  69879. /* harmony import */ var _tableediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tableediting */ "./node_modules/@ckeditor/ckeditor5-table/src/tableediting.js");
  69880. /* harmony import */ var _tableui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tableui */ "./node_modules/@ckeditor/ckeditor5-table/src/tableui.js");
  69881. /* harmony import */ var _tableselection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableselection */ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js");
  69882. /* harmony import */ var _tableclipboard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./tableclipboard */ "./node_modules/@ckeditor/ckeditor5-table/src/tableclipboard.js");
  69883. /* harmony import */ var _tablekeyboard__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./tablekeyboard */ "./node_modules/@ckeditor/ckeditor5-table/src/tablekeyboard.js");
  69884. /* harmony import */ var _tablemouse__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./tablemouse */ "./node_modules/@ckeditor/ckeditor5-table/src/tablemouse.js");
  69885. /* harmony import */ var _theme_table_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../theme/table.css */ "./node_modules/@ckeditor/ckeditor5-table/theme/table.css");
  69886. /**
  69887. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  69888. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  69889. */
  69890. /**
  69891. * @module table/table
  69892. */
  69893. /**
  69894. * The table plugin.
  69895. *
  69896. * For a detailed overview, check the {@glink features/table Table feature documentation}.
  69897. *
  69898. * This is a "glue" plugin that loads the following table features:
  69899. *
  69900. * * {@link module:table/tableediting~TableEditing editing feature},
  69901. * * {@link module:table/tableselection~TableSelection selection feature},
  69902. * * {@link module:table/tablekeyboard~TableKeyboard keyboard navigation feature},
  69903. * * {@link module:table/tablemouse~TableMouse mouse selection feature},
  69904. * * {@link module:table/tableclipboard~TableClipboard clipboard feature},
  69905. * * {@link module:table/tableui~TableUI UI feature}.
  69906. *
  69907. * @extends module:core/plugin~Plugin
  69908. */
  69909. class Table extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  69910. /**
  69911. * @inheritDoc
  69912. */
  69913. static get requires() {
  69914. return [ _tableediting__WEBPACK_IMPORTED_MODULE_2__["default"], _tableui__WEBPACK_IMPORTED_MODULE_3__["default"], _tableselection__WEBPACK_IMPORTED_MODULE_4__["default"], _tablemouse__WEBPACK_IMPORTED_MODULE_7__["default"], _tablekeyboard__WEBPACK_IMPORTED_MODULE_6__["default"], _tableclipboard__WEBPACK_IMPORTED_MODULE_5__["default"], ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["Widget"] ];
  69915. }
  69916. /**
  69917. * @inheritDoc
  69918. */
  69919. static get pluginName() {
  69920. return 'Table';
  69921. }
  69922. }
  69923. /**
  69924. * The configuration of the table feature. Used by the table feature in the `@ckeditor/ckeditor5-table` package.
  69925. *
  69926. * ClassicEditor
  69927. * .create( editorElement, {
  69928. * table: ... // Table feature options.
  69929. * } )
  69930. * .then( ... )
  69931. * .catch( ... );
  69932. *
  69933. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  69934. *
  69935. * @interface TableConfig
  69936. */
  69937. /**
  69938. * The configuration of the {@link module:table/table~Table} feature.
  69939. *
  69940. * Read more in {@link module:table/table~TableConfig}.
  69941. *
  69942. * @member {module:table/table~TableConfig} module:core/editor/editorconfig~EditorConfig#table
  69943. */
  69944. /**
  69945. * Number of rows and columns to render by default as table heading when inserting new tables.
  69946. *
  69947. * You can configure it like this:
  69948. *
  69949. * const tableConfig = {
  69950. * defaultHeadings: {
  69951. * rows: 1,
  69952. * columns: 1
  69953. * }
  69954. * };
  69955. *
  69956. * Both rows and columns properties are optional defaulting to 0 (no heading).
  69957. *
  69958. * @member {Object} module:table/table~TableConfig#defaultHeadings
  69959. */
  69960. /**
  69961. * An array of color definitions (either strings or objects).
  69962. *
  69963. * const colors = [
  69964. * {
  69965. * color: 'hsl(0, 0%, 60%)',
  69966. * label: 'Grey'
  69967. * },
  69968. * 'hsl(0, 0%, 80%)',
  69969. * {
  69970. * color: 'hsl(0, 0%, 90%)',
  69971. * label: 'Light grey'
  69972. * },
  69973. * {
  69974. * color: 'hsl(0, 0%, 100%)',
  69975. * label: 'White',
  69976. * hasBorder: true
  69977. * },
  69978. * '#FF0000'
  69979. * ]
  69980. *
  69981. * Usually used as a configuration parameter, for instance in
  69982. * {@link module:table/table~TableConfig#tableProperties `config.table.tableProperties`}
  69983. * or {@link module:table/table~TableConfig#tableCellProperties `config.table.tableCellProperties`}.
  69984. *
  69985. * @typedef {Array.<String|Object>} module:table/table~TableColorConfig
  69986. */
  69987. /***/ }),
  69988. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableclipboard.js":
  69989. /*!**********************************************************************!*\
  69990. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableclipboard.js ***!
  69991. \**********************************************************************/
  69992. /*! exports provided: default, getTableIfOnlyTableInContent */
  69993. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69994. "use strict";
  69995. __webpack_require__.r(__webpack_exports__);
  69996. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableClipboard; });
  69997. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTableIfOnlyTableInContent", function() { return getTableIfOnlyTableInContent; });
  69998. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  69999. /* harmony import */ var _tableselection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tableselection */ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js");
  70000. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  70001. /* harmony import */ var _tableutils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tableutils */ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js");
  70002. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  70003. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  70004. /**
  70005. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  70006. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  70007. */
  70008. /**
  70009. * @module table/tableclipboard
  70010. */
  70011. /**
  70012. * This plugin adds support for copying/cutting/pasting fragments of tables.
  70013. * It is loaded automatically by the {@link module:table/table~Table} plugin.
  70014. *
  70015. * @extends module:core/plugin~Plugin
  70016. */
  70017. class TableClipboard extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  70018. /**
  70019. * @inheritDoc
  70020. */
  70021. static get pluginName() {
  70022. return 'TableClipboard';
  70023. }
  70024. /**
  70025. * @inheritDoc
  70026. */
  70027. static get requires() {
  70028. return [ _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"], _tableutils__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  70029. }
  70030. /**
  70031. * @inheritDoc
  70032. */
  70033. init() {
  70034. const editor = this.editor;
  70035. const viewDocument = editor.editing.view.document;
  70036. this.listenTo( viewDocument, 'copy', ( evt, data ) => this._onCopyCut( evt, data ) );
  70037. this.listenTo( viewDocument, 'cut', ( evt, data ) => this._onCopyCut( evt, data ) );
  70038. this.listenTo( editor.model, 'insertContent', ( evt, args ) => this._onInsertContent( evt, ...args ), { priority: 'high' } );
  70039. this.decorate( '_replaceTableSlotCell' );
  70040. }
  70041. /**
  70042. * Copies table content to a clipboard on "copy" & "cut" events.
  70043. *
  70044. * @private
  70045. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the handled event.
  70046. * @param {Object} data Clipboard event data.
  70047. */
  70048. _onCopyCut( evt, data ) {
  70049. const tableSelection = this.editor.plugins.get( _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"] );
  70050. if ( !tableSelection.getSelectedTableCells() ) {
  70051. return;
  70052. }
  70053. if ( evt.name == 'cut' && this.editor.isReadOnly ) {
  70054. return;
  70055. }
  70056. data.preventDefault();
  70057. evt.stop();
  70058. const dataController = this.editor.data;
  70059. const viewDocument = this.editor.editing.view.document;
  70060. const content = dataController.toView( tableSelection.getSelectionAsFragment() );
  70061. viewDocument.fire( 'clipboardOutput', {
  70062. dataTransfer: data.dataTransfer,
  70063. content,
  70064. method: evt.name
  70065. } );
  70066. }
  70067. /**
  70068. * Overrides default {@link module:engine/model/model~Model#insertContent `model.insertContent()`} method to handle pasting table inside
  70069. * selected table fragment.
  70070. *
  70071. * Depending on selected table fragment:
  70072. * - If a selected table fragment is smaller than paste table it will crop pasted table to match dimensions.
  70073. * - If dimensions are equal it will replace selected table fragment with a pasted table contents.
  70074. *
  70075. * @private
  70076. * @param evt
  70077. * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
  70078. * @param {module:engine/model/selection~Selectable} [selectable=model.document.selection]
  70079. * The selection into which the content should be inserted. If not provided the current model document selection will be used.
  70080. */
  70081. _onInsertContent( evt, content, selectable ) {
  70082. if ( selectable && !selectable.is( 'documentSelection' ) ) {
  70083. return;
  70084. }
  70085. const model = this.editor.model;
  70086. const tableUtils = this.editor.plugins.get( _tableutils__WEBPACK_IMPORTED_MODULE_3__["default"] );
  70087. // We might need to crop table before inserting so reference might change.
  70088. let pastedTable = getTableIfOnlyTableInContent( content, model );
  70089. if ( !pastedTable ) {
  70090. return;
  70091. }
  70092. const selectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getSelectionAffectedTableCells"])( model.document.selection );
  70093. if ( !selectedTableCells.length ) {
  70094. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["removeEmptyRowsColumns"])( pastedTable, tableUtils );
  70095. return;
  70096. }
  70097. // Override default model.insertContent() handling at this point.
  70098. evt.stop();
  70099. model.change( writer => {
  70100. const pastedDimensions = {
  70101. width: tableUtils.getColumns( pastedTable ),
  70102. height: tableUtils.getRows( pastedTable )
  70103. };
  70104. // Prepare the table for pasting.
  70105. const selection = prepareTableForPasting( selectedTableCells, pastedDimensions, writer, tableUtils );
  70106. // Beyond this point we operate on a fixed content table with rectangular selection and proper last row/column values.
  70107. const selectionHeight = selection.lastRow - selection.firstRow + 1;
  70108. const selectionWidth = selection.lastColumn - selection.firstColumn + 1;
  70109. // Crop pasted table if:
  70110. // - Pasted table dimensions exceeds selection area.
  70111. // - Pasted table has broken layout (ie some cells sticks out by the table dimensions established by the first and last row).
  70112. //
  70113. // Note: The table dimensions are established by the width of the first row and the total number of rows.
  70114. // It is possible to programmatically create a table that has rows which would have cells anchored beyond first row width but
  70115. // such table will not be created by other editing solutions.
  70116. const cropDimensions = {
  70117. startRow: 0,
  70118. startColumn: 0,
  70119. endRow: Math.min( selectionHeight, pastedDimensions.height ) - 1,
  70120. endColumn: Math.min( selectionWidth, pastedDimensions.width ) - 1
  70121. };
  70122. pastedTable = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["cropTableToDimensions"])( pastedTable, cropDimensions, writer );
  70123. // Content table to which we insert a pasted table.
  70124. const selectedTable = selectedTableCells[ 0 ].findAncestor( 'table' );
  70125. const cellsToSelect = this._replaceSelectedCellsWithPasted( pastedTable, pastedDimensions, selectedTable, selection, writer );
  70126. if ( this.editor.plugins.get( 'TableSelection' ).isEnabled ) {
  70127. // Selection ranges must be sorted because the first and last selection ranges are considered
  70128. // as anchor/focus cell ranges for multi-cell selection.
  70129. const selectionRanges = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["sortRanges"])( cellsToSelect.map( cell => writer.createRangeOn( cell ) ) );
  70130. writer.setSelection( selectionRanges );
  70131. } else {
  70132. // Set selection inside first cell if multi-cell selection is disabled.
  70133. writer.setSelection( cellsToSelect[ 0 ], 0 );
  70134. }
  70135. } );
  70136. }
  70137. /**
  70138. * Replaces the part of selectedTable with pastedTable.
  70139. *
  70140. * @private
  70141. * @param {module:engine/model/element~Element} pastedTable
  70142. * @param {Object} pastedDimensions
  70143. * @param {Number} pastedDimensions.height
  70144. * @param {Number} pastedDimensions.width
  70145. * @param {module:engine/model/element~Element} selectedTable
  70146. * @param {Object} selection
  70147. * @param {Number} selection.firstColumn
  70148. * @param {Number} selection.firstRow
  70149. * @param {Number} selection.lastColumn
  70150. * @param {Number} selection.lastRow
  70151. * @param {module:engine/model/writer~Writer} writer
  70152. * @returns {Array.<module:engine/model/element~Element>}
  70153. */
  70154. _replaceSelectedCellsWithPasted( pastedTable, pastedDimensions, selectedTable, selection, writer ) {
  70155. const { width: pastedWidth, height: pastedHeight } = pastedDimensions;
  70156. // Holds two-dimensional array that is addressed by [ row ][ column ] that stores cells anchored at given location.
  70157. const pastedTableLocationMap = createLocationMap( pastedTable, pastedWidth, pastedHeight );
  70158. const selectedTableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( selectedTable, {
  70159. startRow: selection.firstRow,
  70160. endRow: selection.lastRow,
  70161. startColumn: selection.firstColumn,
  70162. endColumn: selection.lastColumn,
  70163. includeAllSlots: true
  70164. } ) ];
  70165. // Selection must be set to pasted cells (some might be removed or new created).
  70166. const cellsToSelect = [];
  70167. // Store next cell insert position.
  70168. let insertPosition;
  70169. // Content table replace cells algorithm iterates over a selected table fragment and:
  70170. //
  70171. // - Removes existing table cells at current slot (location).
  70172. // - Inserts cell from a pasted table for a matched slots.
  70173. //
  70174. // This ensures proper table geometry after the paste
  70175. for ( const tableSlot of selectedTableMap ) {
  70176. const { row, column } = tableSlot;
  70177. // Save the insert position for current row start.
  70178. if ( column === selection.firstColumn ) {
  70179. insertPosition = tableSlot.getPositionBefore();
  70180. }
  70181. // Map current table slot location to an pasted table slot location.
  70182. const pastedRow = row - selection.firstRow;
  70183. const pastedColumn = column - selection.firstColumn;
  70184. const pastedCell = pastedTableLocationMap[ pastedRow % pastedHeight ][ pastedColumn % pastedWidth ];
  70185. // Clone cell to insert (to duplicate its attributes and children).
  70186. // Cloning is required to support repeating pasted table content when inserting to a bigger selection.
  70187. const cellToInsert = pastedCell ? writer.cloneElement( pastedCell ) : null;
  70188. // Replace the cell from the current slot with new table cell.
  70189. const newTableCell = this._replaceTableSlotCell( tableSlot, cellToInsert, insertPosition, writer );
  70190. // The cell was only removed.
  70191. if ( !newTableCell ) {
  70192. continue;
  70193. }
  70194. // Trim the cell if it's row/col-spans would exceed selection area.
  70195. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["trimTableCellIfNeeded"])( newTableCell, row, column, selection.lastRow, selection.lastColumn, writer );
  70196. cellsToSelect.push( newTableCell );
  70197. insertPosition = writer.createPositionAfter( newTableCell );
  70198. }
  70199. // If there are any headings, all the cells that overlap from heading must be splitted.
  70200. const headingRows = parseInt( selectedTable.getAttribute( 'headingRows' ) || 0 );
  70201. const headingColumns = parseInt( selectedTable.getAttribute( 'headingColumns' ) || 0 );
  70202. const areHeadingRowsIntersectingSelection = selection.firstRow < headingRows && headingRows <= selection.lastRow;
  70203. const areHeadingColumnsIntersectingSelection = selection.firstColumn < headingColumns && headingColumns <= selection.lastColumn;
  70204. if ( areHeadingRowsIntersectingSelection ) {
  70205. const columnsLimit = { first: selection.firstColumn, last: selection.lastColumn };
  70206. const newCells = doHorizontalSplit( selectedTable, headingRows, columnsLimit, writer, selection.firstRow );
  70207. cellsToSelect.push( ...newCells );
  70208. }
  70209. if ( areHeadingColumnsIntersectingSelection ) {
  70210. const rowsLimit = { first: selection.firstRow, last: selection.lastRow };
  70211. const newCells = doVerticalSplit( selectedTable, headingColumns, rowsLimit, writer );
  70212. cellsToSelect.push( ...newCells );
  70213. }
  70214. return cellsToSelect;
  70215. }
  70216. /**
  70217. * Replaces a single table slot.
  70218. *
  70219. * @private
  70220. * @param {module:table/tablewalker~TableSlot} tableSlot
  70221. * @param {module:engine/model/element~Element} cellToInsert
  70222. * @param {module:engine/model/position~Position} insertPosition
  70223. * @param {module:engine/model/writer~Writer} writer
  70224. * @returns {module:engine/model/element~Element|null} Inserted table cell or null if slot should remain empty.
  70225. */
  70226. _replaceTableSlotCell( tableSlot, cellToInsert, insertPosition, writer ) {
  70227. const { cell, isAnchor } = tableSlot;
  70228. // If the slot is occupied by a cell in a selected table - remove it.
  70229. // The slot of this cell will be either:
  70230. // - Replaced by a pasted table cell.
  70231. // - Spanned by a previously pasted table cell.
  70232. if ( isAnchor ) {
  70233. writer.remove( cell );
  70234. }
  70235. // There is no cell to insert (might be spanned by other cell in a pasted table) - advance to the next content table slot.
  70236. if ( !cellToInsert ) {
  70237. return null;
  70238. }
  70239. writer.insert( cellToInsert, insertPosition );
  70240. return cellToInsert;
  70241. }
  70242. }
  70243. /**
  70244. * Extract table for pasting into table.
  70245. *
  70246. * @private
  70247. * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
  70248. * @param {module:engine/model/model~Model} model The editor model.
  70249. * @returns {module:engine/model/element~Element|null}
  70250. */
  70251. function getTableIfOnlyTableInContent( content, model ) {
  70252. if ( !content.is( 'documentFragment' ) && !content.is( 'element' ) ) {
  70253. return null;
  70254. }
  70255. // Table passed directly.
  70256. if ( content.is( 'element', 'table' ) ) {
  70257. return content;
  70258. }
  70259. // We do not support mixed content when pasting table into table.
  70260. // See: https://github.com/ckeditor/ckeditor5/issues/6817.
  70261. if ( content.childCount == 1 && content.getChild( 0 ).is( 'element', 'table' ) ) {
  70262. return content.getChild( 0 );
  70263. }
  70264. // If there are only whitespaces around a table then use that table for pasting.
  70265. const contentRange = model.createRangeIn( content );
  70266. for ( const element of contentRange.getItems() ) {
  70267. if ( element.is( 'element', 'table' ) ) {
  70268. // Stop checking if there is some content before table.
  70269. const rangeBefore = model.createRange( contentRange.start, model.createPositionBefore( element ) );
  70270. if ( model.hasContent( rangeBefore, { ignoreWhitespaces: true } ) ) {
  70271. return null;
  70272. }
  70273. // Stop checking if there is some content after table.
  70274. const rangeAfter = model.createRange( model.createPositionAfter( element ), contentRange.end );
  70275. if ( model.hasContent( rangeAfter, { ignoreWhitespaces: true } ) ) {
  70276. return null;
  70277. }
  70278. // There wasn't any content neither before nor after.
  70279. return element;
  70280. }
  70281. }
  70282. return null;
  70283. }
  70284. // Prepares a table for pasting and returns adjusted selection dimensions.
  70285. //
  70286. // @param {Array.<module:engine/model/element~Element>} selectedTableCells
  70287. // @param {Object} pastedDimensions
  70288. // @param {Number} pastedDimensions.height
  70289. // @param {Number} pastedDimensions.width
  70290. // @param {module:engine/model/writer~Writer} writer
  70291. // @param {module:table/tableutils~TableUtils} tableUtils
  70292. // @returns {Object} selection
  70293. // @returns {Number} selection.firstColumn
  70294. // @returns {Number} selection.firstRow
  70295. // @returns {Number} selection.lastColumn
  70296. // @returns {Number} selection.lastRow
  70297. function prepareTableForPasting( selectedTableCells, pastedDimensions, writer, tableUtils ) {
  70298. const selectedTable = selectedTableCells[ 0 ].findAncestor( 'table' );
  70299. const columnIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getColumnIndexes"])( selectedTableCells );
  70300. const rowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getRowIndexes"])( selectedTableCells );
  70301. const selection = {
  70302. firstColumn: columnIndexes.first,
  70303. lastColumn: columnIndexes.last,
  70304. firstRow: rowIndexes.first,
  70305. lastRow: rowIndexes.last
  70306. };
  70307. // Single cell selected - expand selection to pasted table dimensions.
  70308. const shouldExpandSelection = selectedTableCells.length === 1;
  70309. if ( shouldExpandSelection ) {
  70310. selection.lastRow += pastedDimensions.height - 1;
  70311. selection.lastColumn += pastedDimensions.width - 1;
  70312. expandTableSize( selectedTable, selection.lastRow + 1, selection.lastColumn + 1, tableUtils );
  70313. }
  70314. // In case of expanding selection we do not reset the selection so in this case we will always try to fix selection
  70315. // like in the case of a non-rectangular area. This might be fixed by re-setting selected cells array but this shortcut is safe.
  70316. if ( shouldExpandSelection || !Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["isSelectionRectangular"])( selectedTableCells, tableUtils ) ) {
  70317. // For a non-rectangular selection (ie in which some cells sticks out from a virtual selection rectangle) we need to create
  70318. // a table layout that has a rectangular selection. This will split cells so the selection become rectangular.
  70319. // Beyond this point we will operate on fixed content table.
  70320. splitCellsToRectangularSelection( selectedTable, selection, writer );
  70321. }
  70322. // However a selected table fragment might be invalid if examined alone. Ie such table fragment:
  70323. //
  70324. // +---+---+---+---+
  70325. // 0 | a | b | c | d |
  70326. // + + +---+---+
  70327. // 1 | | e | f | g |
  70328. // + +---+ +---+
  70329. // 2 | | h | | i | <- last row, each cell has rowspan = 2,
  70330. // + + + + + so we need to return 3, not 2
  70331. // 3 | | | | |
  70332. // +---+---+---+---+
  70333. //
  70334. // is invalid as the cells "h" and "i" have rowspans.
  70335. // This case needs only adjusting the selection dimension as the rest of the algorithm operates on empty slots also.
  70336. else {
  70337. selection.lastRow = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["adjustLastRowIndex"])( selectedTable, selection );
  70338. selection.lastColumn = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["adjustLastColumnIndex"])( selectedTable, selection );
  70339. }
  70340. return selection;
  70341. }
  70342. // Expand table (in place) to expected size.
  70343. function expandTableSize( table, expectedHeight, expectedWidth, tableUtils ) {
  70344. const tableWidth = tableUtils.getColumns( table );
  70345. const tableHeight = tableUtils.getRows( table );
  70346. if ( expectedWidth > tableWidth ) {
  70347. tableUtils.insertColumns( table, {
  70348. at: tableWidth,
  70349. columns: expectedWidth - tableWidth
  70350. } );
  70351. }
  70352. if ( expectedHeight > tableHeight ) {
  70353. tableUtils.insertRows( table, {
  70354. at: tableHeight,
  70355. rows: expectedHeight - tableHeight
  70356. } );
  70357. }
  70358. }
  70359. // Returns two-dimensional array that is addressed by [ row ][ column ] that stores cells anchored at given location.
  70360. //
  70361. // At given row & column location it might be one of:
  70362. //
  70363. // * cell - cell from pasted table anchored at this location.
  70364. // * null - if no cell is anchored at this location.
  70365. //
  70366. // For instance, from a table below:
  70367. //
  70368. // +----+----+----+----+
  70369. // | 00 | 01 | 02 | 03 |
  70370. // + +----+----+----+
  70371. // | | 11 | 13 |
  70372. // +----+ +----+
  70373. // | 20 | | 23 |
  70374. // +----+----+----+----+
  70375. //
  70376. // The method will return an array (numbers represents cell element):
  70377. //
  70378. // const map = [
  70379. // [ '00', '01', '02', '03' ],
  70380. // [ null, '11', null, '13' ],
  70381. // [ '20', null, null, '23' ]
  70382. // ]
  70383. //
  70384. // This allows for a quick access to table at give row & column. For instance to access table cell "13" from pasted table call:
  70385. //
  70386. // const cell = map[ 1 ][ 3 ]
  70387. //
  70388. function createLocationMap( table, width, height ) {
  70389. // Create height x width (row x column) two-dimensional table to store cells.
  70390. const map = new Array( height ).fill( null )
  70391. .map( () => new Array( width ).fill( null ) );
  70392. for ( const { column, row, cell } of new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table ) ) {
  70393. map[ row ][ column ] = cell;
  70394. }
  70395. return map;
  70396. }
  70397. // Make selected cells rectangular by splitting the cells that stand out from a rectangular selection.
  70398. //
  70399. // In the table below a selection is shown with "::" and slots with anchor cells are named.
  70400. //
  70401. // +----+----+----+----+----+ +----+----+----+----+----+
  70402. // | 00 | 01 | 02 | 03 | | 00 | 01 | 02 | 03 |
  70403. // + +----+ +----+----+ | ::::::::::::::::----+
  70404. // | | 11 | | 13 | 14 | | ::11 | | 13:: 14 | <- first row
  70405. // +----+----+ + +----+ +----::---| | ::----+
  70406. // | 20 | 21 | | | 24 | select cells: | 20 ::21 | | :: 24 |
  70407. // +----+----+ +----+----+ 11 -> 33 +----::---| |---::----+
  70408. // | 30 | | 33 | 34 | | 30 :: | | 33:: 34 | <- last row
  70409. // + + +----+ + | :::::::::::::::: +
  70410. // | | | 43 | | | | | 43 | |
  70411. // +----+----+----+----+----+ +----+----+----+----+----+
  70412. // ^ ^
  70413. // first & last columns
  70414. //
  70415. // Will update table to:
  70416. //
  70417. // +----+----+----+----+----+
  70418. // | 00 | 01 | 02 | 03 |
  70419. // + +----+----+----+----+
  70420. // | | 11 | | 13 | 14 |
  70421. // +----+----+ + +----+
  70422. // | 20 | 21 | | | 24 |
  70423. // +----+----+ +----+----+
  70424. // | 30 | | | 33 | 34 |
  70425. // + +----+----+----+ +
  70426. // | | | | 43 | |
  70427. // +----+----+----+----+----+
  70428. //
  70429. // In th example above:
  70430. // - Cell "02" which have `rowspan = 4` must be trimmed at first and at after last row.
  70431. // - Cell "03" which have `rowspan = 2` and `colspan = 2` must be trimmed at first column and after last row.
  70432. // - Cells "00", "03" & "30" which cannot be cut by this algorithm as they are outside the trimmed area.
  70433. // - Cell "13" cannot be cut as it is inside the trimmed area.
  70434. function splitCellsToRectangularSelection( table, dimensions, writer ) {
  70435. const { firstRow, lastRow, firstColumn, lastColumn } = dimensions;
  70436. const rowIndexes = { first: firstRow, last: lastRow };
  70437. const columnIndexes = { first: firstColumn, last: lastColumn };
  70438. // 1. Split cells vertically in two steps as first step might create cells that needs to split again.
  70439. doVerticalSplit( table, firstColumn, rowIndexes, writer );
  70440. doVerticalSplit( table, lastColumn + 1, rowIndexes, writer );
  70441. // 2. Split cells horizontally in two steps as first step might create cells that needs to split again.
  70442. doHorizontalSplit( table, firstRow, columnIndexes, writer );
  70443. doHorizontalSplit( table, lastRow + 1, columnIndexes, writer, firstRow );
  70444. }
  70445. function doHorizontalSplit( table, splitRow, limitColumns, writer, startRow = 0 ) {
  70446. // If selection starts at first row then no split is needed.
  70447. if ( splitRow < 1 ) {
  70448. return;
  70449. }
  70450. const overlappingCells = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["getVerticallyOverlappingCells"])( table, splitRow, startRow );
  70451. // Filter out cells that are not touching insides of the rectangular selection.
  70452. const cellsToSplit = overlappingCells.filter( ( { column, cellWidth } ) => isAffectedBySelection( column, cellWidth, limitColumns ) );
  70453. return cellsToSplit.map( ( { cell } ) => Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["splitHorizontally"])( cell, splitRow, writer ) );
  70454. }
  70455. function doVerticalSplit( table, splitColumn, limitRows, writer ) {
  70456. // If selection starts at first column then no split is needed.
  70457. if ( splitColumn < 1 ) {
  70458. return;
  70459. }
  70460. const overlappingCells = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["getHorizontallyOverlappingCells"])( table, splitColumn );
  70461. // Filter out cells that are not touching insides of the rectangular selection.
  70462. const cellsToSplit = overlappingCells.filter( ( { row, cellHeight } ) => isAffectedBySelection( row, cellHeight, limitRows ) );
  70463. return cellsToSplit.map( ( { cell, column } ) => Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["splitVertically"])( cell, column, splitColumn, writer ) );
  70464. }
  70465. // Checks if cell at given row (column) is affected by a rectangular selection defined by first/last column (row).
  70466. //
  70467. // The same check is used for row as for column.
  70468. function isAffectedBySelection( index, span, limit ) {
  70469. const endIndex = index + span - 1;
  70470. const { first, last } = limit;
  70471. const isInsideSelection = index >= first && index <= last;
  70472. const overlapsSelectionFromOutside = index < first && endIndex >= first;
  70473. return isInsideSelection || overlapsSelectionFromOutside;
  70474. }
  70475. /***/ }),
  70476. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableediting.js":
  70477. /*!********************************************************************!*\
  70478. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableediting.js ***!
  70479. \********************************************************************/
  70480. /*! exports provided: default */
  70481. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70482. "use strict";
  70483. __webpack_require__.r(__webpack_exports__);
  70484. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableEditing; });
  70485. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  70486. /* harmony import */ var _converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./converters/upcasttable */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/upcasttable.js");
  70487. /* harmony import */ var _converters_downcast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./converters/downcast */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js");
  70488. /* harmony import */ var _commands_inserttablecommand__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./commands/inserttablecommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablecommand.js");
  70489. /* harmony import */ var _commands_insertrowcommand__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./commands/insertrowcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/insertrowcommand.js");
  70490. /* harmony import */ var _commands_insertcolumncommand__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands/insertcolumncommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/insertcolumncommand.js");
  70491. /* harmony import */ var _commands_splitcellcommand__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./commands/splitcellcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/splitcellcommand.js");
  70492. /* harmony import */ var _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/mergecellcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellcommand.js");
  70493. /* harmony import */ var _commands_removerowcommand__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./commands/removerowcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/removerowcommand.js");
  70494. /* harmony import */ var _commands_removecolumncommand__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./commands/removecolumncommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/removecolumncommand.js");
  70495. /* harmony import */ var _commands_setheaderrowcommand__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./commands/setheaderrowcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/setheaderrowcommand.js");
  70496. /* harmony import */ var _commands_setheadercolumncommand__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./commands/setheadercolumncommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/setheadercolumncommand.js");
  70497. /* harmony import */ var _commands_mergecellscommand__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./commands/mergecellscommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellscommand.js");
  70498. /* harmony import */ var _commands_selectrowcommand__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./commands/selectrowcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/selectrowcommand.js");
  70499. /* harmony import */ var _commands_selectcolumncommand__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./commands/selectcolumncommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/selectcolumncommand.js");
  70500. /* harmony import */ var _src_tableutils__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../src/tableutils */ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js");
  70501. /* harmony import */ var _converters_table_layout_post_fixer__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./converters/table-layout-post-fixer */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-layout-post-fixer.js");
  70502. /* harmony import */ var _converters_table_cell_paragraph_post_fixer__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./converters/table-cell-paragraph-post-fixer */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-paragraph-post-fixer.js");
  70503. /* harmony import */ var _converters_table_cell_refresh_post_fixer__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./converters/table-cell-refresh-post-fixer */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-refresh-post-fixer.js");
  70504. /* harmony import */ var _converters_table_heading_rows_refresh_post_fixer__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./converters/table-heading-rows-refresh-post-fixer */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-heading-rows-refresh-post-fixer.js");
  70505. /* harmony import */ var _theme_tableediting_css__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../theme/tableediting.css */ "./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css");
  70506. /**
  70507. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  70508. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  70509. */
  70510. /**
  70511. * @module table/tableediting
  70512. */
  70513. /**
  70514. * The table editing feature.
  70515. *
  70516. * @extends module:core/plugin~Plugin
  70517. */
  70518. class TableEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  70519. /**
  70520. * @inheritDoc
  70521. */
  70522. static get pluginName() {
  70523. return 'TableEditing';
  70524. }
  70525. /**
  70526. * @inheritDoc
  70527. */
  70528. init() {
  70529. const editor = this.editor;
  70530. const model = editor.model;
  70531. const schema = model.schema;
  70532. const conversion = editor.conversion;
  70533. schema.register( 'table', {
  70534. allowWhere: '$block',
  70535. allowAttributes: [ 'headingRows', 'headingColumns' ],
  70536. isObject: true,
  70537. isBlock: true
  70538. } );
  70539. schema.register( 'tableRow', {
  70540. allowIn: 'table',
  70541. isLimit: true
  70542. } );
  70543. schema.register( 'tableCell', {
  70544. allowIn: 'tableRow',
  70545. allowChildren: '$block',
  70546. allowAttributes: [ 'colspan', 'rowspan' ],
  70547. isLimit: true,
  70548. isSelectable: true
  70549. } );
  70550. // Figure conversion.
  70551. conversion.for( 'upcast' ).add( Object(_converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__["upcastTableFigure"])() );
  70552. // Table conversion.
  70553. conversion.for( 'upcast' ).add( Object(_converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__["default"])() );
  70554. conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastInsertTable"])( { asWidget: true } ) );
  70555. conversion.for( 'dataDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastInsertTable"])() );
  70556. // Table row conversion.
  70557. conversion.for( 'upcast' ).elementToElement( { model: 'tableRow', view: 'tr' } );
  70558. conversion.for( 'upcast' ).add( Object(_converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__["skipEmptyTableRow"])() );
  70559. conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastInsertRow"])() );
  70560. conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastRemoveRow"])() );
  70561. // Table cell conversion.
  70562. conversion.for( 'upcast' ).elementToElement( { model: 'tableCell', view: 'td' } );
  70563. conversion.for( 'upcast' ).elementToElement( { model: 'tableCell', view: 'th' } );
  70564. conversion.for( 'upcast' ).add( Object(_converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__["ensureParagraphInTableCell"])( 'td' ) );
  70565. conversion.for( 'upcast' ).add( Object(_converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__["ensureParagraphInTableCell"])( 'th' ) );
  70566. conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastInsertCell"])() );
  70567. // Duplicates code - needed to properly refresh paragraph inside a table cell.
  70568. conversion.for( 'editingDowncast' ).elementToElement( {
  70569. model: 'paragraph',
  70570. view: _converters_downcast__WEBPACK_IMPORTED_MODULE_2__["convertParagraphInTableCell"],
  70571. converterPriority: 'high'
  70572. } );
  70573. // Table attributes conversion.
  70574. conversion.for( 'downcast' ).attributeToAttribute( { model: 'colspan', view: 'colspan' } );
  70575. conversion.for( 'upcast' ).attributeToAttribute( {
  70576. model: { key: 'colspan', value: upcastCellSpan( 'colspan' ) },
  70577. view: 'colspan'
  70578. } );
  70579. conversion.for( 'downcast' ).attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
  70580. conversion.for( 'upcast' ).attributeToAttribute( {
  70581. model: { key: 'rowspan', value: upcastCellSpan( 'rowspan' ) },
  70582. view: 'rowspan'
  70583. } );
  70584. // Table heading columns conversion (a change of heading rows requires a reconversion of the whole table).
  70585. conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastTableHeadingColumnsChange"])() );
  70586. // Manually adjust model position mappings in a special case, when a table cell contains a paragraph, which is bound
  70587. // to its parent (to the table cell). This custom model-to-view position mapping is necessary in data pipeline only,
  70588. // because only during this conversion a paragraph can be bound to its parent.
  70589. editor.data.mapper.on( 'modelToViewPosition', mapTableCellModelPositionToView() );
  70590. // Define the config.
  70591. editor.config.define( 'table.defaultHeadings.rows', 0 );
  70592. editor.config.define( 'table.defaultHeadings.columns', 0 );
  70593. // Define all the commands.
  70594. editor.commands.add( 'insertTable', new _commands_inserttablecommand__WEBPACK_IMPORTED_MODULE_3__["default"]( editor ) );
  70595. editor.commands.add( 'insertTableRowAbove', new _commands_insertrowcommand__WEBPACK_IMPORTED_MODULE_4__["default"]( editor, { order: 'above' } ) );
  70596. editor.commands.add( 'insertTableRowBelow', new _commands_insertrowcommand__WEBPACK_IMPORTED_MODULE_4__["default"]( editor, { order: 'below' } ) );
  70597. editor.commands.add( 'insertTableColumnLeft', new _commands_insertcolumncommand__WEBPACK_IMPORTED_MODULE_5__["default"]( editor, { order: 'left' } ) );
  70598. editor.commands.add( 'insertTableColumnRight', new _commands_insertcolumncommand__WEBPACK_IMPORTED_MODULE_5__["default"]( editor, { order: 'right' } ) );
  70599. editor.commands.add( 'removeTableRow', new _commands_removerowcommand__WEBPACK_IMPORTED_MODULE_8__["default"]( editor ) );
  70600. editor.commands.add( 'removeTableColumn', new _commands_removecolumncommand__WEBPACK_IMPORTED_MODULE_9__["default"]( editor ) );
  70601. editor.commands.add( 'splitTableCellVertically', new _commands_splitcellcommand__WEBPACK_IMPORTED_MODULE_6__["default"]( editor, { direction: 'vertically' } ) );
  70602. editor.commands.add( 'splitTableCellHorizontally', new _commands_splitcellcommand__WEBPACK_IMPORTED_MODULE_6__["default"]( editor, { direction: 'horizontally' } ) );
  70603. editor.commands.add( 'mergeTableCells', new _commands_mergecellscommand__WEBPACK_IMPORTED_MODULE_12__["default"]( editor ) );
  70604. editor.commands.add( 'mergeTableCellRight', new _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor, { direction: 'right' } ) );
  70605. editor.commands.add( 'mergeTableCellLeft', new _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor, { direction: 'left' } ) );
  70606. editor.commands.add( 'mergeTableCellDown', new _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor, { direction: 'down' } ) );
  70607. editor.commands.add( 'mergeTableCellUp', new _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor, { direction: 'up' } ) );
  70608. editor.commands.add( 'setTableColumnHeader', new _commands_setheadercolumncommand__WEBPACK_IMPORTED_MODULE_11__["default"]( editor ) );
  70609. editor.commands.add( 'setTableRowHeader', new _commands_setheaderrowcommand__WEBPACK_IMPORTED_MODULE_10__["default"]( editor ) );
  70610. editor.commands.add( 'selectTableRow', new _commands_selectrowcommand__WEBPACK_IMPORTED_MODULE_13__["default"]( editor ) );
  70611. editor.commands.add( 'selectTableColumn', new _commands_selectcolumncommand__WEBPACK_IMPORTED_MODULE_14__["default"]( editor ) );
  70612. Object(_converters_table_heading_rows_refresh_post_fixer__WEBPACK_IMPORTED_MODULE_19__["default"])( model );
  70613. Object(_converters_table_layout_post_fixer__WEBPACK_IMPORTED_MODULE_16__["default"])( model );
  70614. Object(_converters_table_cell_refresh_post_fixer__WEBPACK_IMPORTED_MODULE_18__["default"])( model, editor.editing.mapper );
  70615. Object(_converters_table_cell_paragraph_post_fixer__WEBPACK_IMPORTED_MODULE_17__["default"])( model );
  70616. }
  70617. /**
  70618. * @inheritDoc
  70619. */
  70620. static get requires() {
  70621. return [ _src_tableutils__WEBPACK_IMPORTED_MODULE_15__["default"] ];
  70622. }
  70623. }
  70624. // Creates a mapper callback to adjust model position mappings in a table cell containing a paragraph, which is bound to its parent
  70625. // (to the table cell). Only positions after this paragraph have to be adjusted, because after binding this paragraph to the table cell,
  70626. // elements located after this paragraph would point either to a non-existent offset inside `tableCell` (if paragraph is empty), or after
  70627. // the first character of the paragraph's text. See https://github.com/ckeditor/ckeditor5/issues/10116.
  70628. //
  70629. // <tableCell><paragraph></paragraph>^</tableCell> -> <td>^&nbsp;</td>
  70630. //
  70631. // <tableCell><paragraph>foobar</paragraph>^</tableCell> -> <td>foobar^</td>
  70632. //
  70633. // @returns {Function}
  70634. function mapTableCellModelPositionToView() {
  70635. return ( evt, data ) => {
  70636. const modelParent = data.modelPosition.parent;
  70637. const modelNodeBefore = data.modelPosition.nodeBefore;
  70638. if ( !modelParent.is( 'element', 'tableCell' ) ) {
  70639. return;
  70640. }
  70641. if ( !modelNodeBefore || !modelNodeBefore.is( 'element', 'paragraph' ) ) {
  70642. return;
  70643. }
  70644. const viewNodeBefore = data.mapper.toViewElement( modelNodeBefore );
  70645. const viewParent = data.mapper.toViewElement( modelParent );
  70646. if ( viewNodeBefore === viewParent ) {
  70647. // Since the paragraph has already been bound to its parent, update the current position in the model with paragraph's
  70648. // max offset, so it points to the place which should normally (in all other cases) be the end position of this paragraph.
  70649. data.viewPosition = data.mapper.findPositionIn( viewParent, modelNodeBefore.maxOffset );
  70650. }
  70651. };
  70652. }
  70653. // Returns fixed colspan and rowspan attrbutes values.
  70654. //
  70655. // @private
  70656. // @param {String} type colspan or rowspan.
  70657. // @returns {Function} conversion value function.
  70658. function upcastCellSpan( type ) {
  70659. return cell => {
  70660. const span = parseInt( cell.getAttribute( type ) );
  70661. if ( Number.isNaN( span ) || span <= 0 ) {
  70662. return null;
  70663. }
  70664. return span;
  70665. };
  70666. }
  70667. /***/ }),
  70668. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tablekeyboard.js":
  70669. /*!*********************************************************************!*\
  70670. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tablekeyboard.js ***!
  70671. \*********************************************************************/
  70672. /*! exports provided: default */
  70673. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70674. "use strict";
  70675. __webpack_require__.r(__webpack_exports__);
  70676. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableKeyboard; });
  70677. /* harmony import */ var _tableselection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tableselection */ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js");
  70678. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  70679. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  70680. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  70681. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  70682. /**
  70683. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  70684. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  70685. */
  70686. /**
  70687. * @module table/tablekeyboard
  70688. */
  70689. /**
  70690. * This plugin enables keyboard navigation for tables.
  70691. * It is loaded automatically by the {@link module:table/table~Table} plugin.
  70692. *
  70693. * @extends module:core/plugin~Plugin
  70694. */
  70695. class TableKeyboard extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_2__["Plugin"] {
  70696. /**
  70697. * @inheritDoc
  70698. */
  70699. static get pluginName() {
  70700. return 'TableKeyboard';
  70701. }
  70702. /**
  70703. * @inheritDoc
  70704. */
  70705. static get requires() {
  70706. return [ _tableselection__WEBPACK_IMPORTED_MODULE_0__["default"] ];
  70707. }
  70708. /**
  70709. * @inheritDoc
  70710. */
  70711. init() {
  70712. const view = this.editor.editing.view;
  70713. const viewDocument = view.document;
  70714. // Handle Tab key navigation.
  70715. this.editor.keystrokes.set( 'Tab', ( ...args ) => this._handleTabOnSelectedTable( ...args ), { priority: 'low' } );
  70716. this.editor.keystrokes.set( 'Tab', this._getTabHandler( true ), { priority: 'low' } );
  70717. this.editor.keystrokes.set( 'Shift+Tab', this._getTabHandler( false ), { priority: 'low' } );
  70718. this.listenTo( viewDocument, 'arrowKey', ( ...args ) => this._onArrowKey( ...args ), { context: 'table' } );
  70719. }
  70720. /**
  70721. * Handles {@link module:engine/view/document~Document#event:keydown keydown} events for the <kbd>Tab</kbd> key executed
  70722. * when the table widget is selected.
  70723. *
  70724. * @private
  70725. * @param {module:engine/view/observer/keyobserver~KeyEventData} data Key event data.
  70726. * @param {Function} cancel The stop/stopPropagation/preventDefault function.
  70727. */
  70728. _handleTabOnSelectedTable( data, cancel ) {
  70729. const editor = this.editor;
  70730. const selection = editor.model.document.selection;
  70731. const selectedElement = selection.getSelectedElement();
  70732. if ( !selectedElement || !selectedElement.is( 'element', 'table' ) ) {
  70733. return;
  70734. }
  70735. cancel();
  70736. editor.model.change( writer => {
  70737. writer.setSelection( writer.createRangeIn( selectedElement.getChild( 0 ).getChild( 0 ) ) );
  70738. } );
  70739. }
  70740. /**
  70741. * Returns a handler for {@link module:engine/view/document~Document#event:keydown keydown} events for the <kbd>Tab</kbd> key executed
  70742. * inside table cells.
  70743. *
  70744. * @private
  70745. * @param {Boolean} isForward Whether this handler will move the selection to the next or the previous cell.
  70746. */
  70747. _getTabHandler( isForward ) {
  70748. const editor = this.editor;
  70749. return ( domEventData, cancel ) => {
  70750. const selection = editor.model.document.selection;
  70751. let tableCell = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getTableCellsContainingSelection"])( selection )[ 0 ];
  70752. if ( !tableCell ) {
  70753. tableCell = this.editor.plugins.get( 'TableSelection' ).getFocusCell();
  70754. }
  70755. if ( !tableCell ) {
  70756. return;
  70757. }
  70758. cancel();
  70759. const tableRow = tableCell.parent;
  70760. const table = tableRow.parent;
  70761. const currentRowIndex = table.getChildIndex( tableRow );
  70762. const currentCellIndex = tableRow.getChildIndex( tableCell );
  70763. const isFirstCellInRow = currentCellIndex === 0;
  70764. if ( !isForward && isFirstCellInRow && currentRowIndex === 0 ) {
  70765. // Set the selection over the whole table if the selection was in the first table cell.
  70766. editor.model.change( writer => {
  70767. writer.setSelection( writer.createRangeOn( table ) );
  70768. } );
  70769. return;
  70770. }
  70771. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  70772. const isLastCellInRow = currentCellIndex === tableRow.childCount - 1;
  70773. const isLastRow = currentRowIndex === tableUtils.getRows( table ) - 1;
  70774. if ( isForward && isLastRow && isLastCellInRow ) {
  70775. editor.execute( 'insertTableRowBelow' );
  70776. // Check if the command actually added a row. If `insertTableRowBelow` execution didn't add a row (because it was disabled
  70777. // or it got overwritten) set the selection over the whole table to mirror the first cell case.
  70778. if ( currentRowIndex === tableUtils.getRows( table ) - 1 ) {
  70779. editor.model.change( writer => {
  70780. writer.setSelection( writer.createRangeOn( table ) );
  70781. } );
  70782. return;
  70783. }
  70784. }
  70785. let cellToFocus;
  70786. // Move to the first cell in the next row.
  70787. if ( isForward && isLastCellInRow ) {
  70788. const nextRow = table.getChild( currentRowIndex + 1 );
  70789. cellToFocus = nextRow.getChild( 0 );
  70790. }
  70791. // Move to the last cell in the previous row.
  70792. else if ( !isForward && isFirstCellInRow ) {
  70793. const previousRow = table.getChild( currentRowIndex - 1 );
  70794. cellToFocus = previousRow.getChild( previousRow.childCount - 1 );
  70795. }
  70796. // Move to the next/previous cell.
  70797. else {
  70798. cellToFocus = tableRow.getChild( currentCellIndex + ( isForward ? 1 : -1 ) );
  70799. }
  70800. editor.model.change( writer => {
  70801. writer.setSelection( writer.createRangeIn( cellToFocus ) );
  70802. } );
  70803. };
  70804. }
  70805. /**
  70806. * Handles {@link module:engine/view/document~Document#event:keydown keydown} events.
  70807. *
  70808. * @private
  70809. * @param {module:utils/eventinfo~EventInfo} eventInfo
  70810. * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
  70811. */
  70812. _onArrowKey( eventInfo, domEventData ) {
  70813. const editor = this.editor;
  70814. const keyCode = domEventData.keyCode;
  70815. const direction = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_3__["getLocalizedArrowKeyCodeDirection"])( keyCode, editor.locale.contentLanguageDirection );
  70816. const wasHandled = this._handleArrowKeys( direction, domEventData.shiftKey );
  70817. if ( wasHandled ) {
  70818. domEventData.preventDefault();
  70819. domEventData.stopPropagation();
  70820. eventInfo.stop();
  70821. }
  70822. }
  70823. /**
  70824. * Handles arrow keys to move the selection around the table.
  70825. *
  70826. * @private
  70827. * @param {'left'|'up'|'right'|'down'} direction The direction of the arrow key.
  70828. * @param {Boolean} expandSelection If the current selection should be expanded.
  70829. * @returns {Boolean} Returns `true` if key was handled.
  70830. */
  70831. _handleArrowKeys( direction, expandSelection ) {
  70832. const model = this.editor.model;
  70833. const selection = model.document.selection;
  70834. const isForward = [ 'right', 'down' ].includes( direction );
  70835. // In case one or more table cells are selected (from outside),
  70836. // move the selection to a cell adjacent to the selected table fragment.
  70837. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getSelectedTableCells"])( selection );
  70838. if ( selectedCells.length ) {
  70839. let focusCell;
  70840. if ( expandSelection ) {
  70841. focusCell = this.editor.plugins.get( 'TableSelection' ).getFocusCell();
  70842. } else {
  70843. focusCell = isForward ? selectedCells[ selectedCells.length - 1 ] : selectedCells[ 0 ];
  70844. }
  70845. this._navigateFromCellInDirection( focusCell, direction, expandSelection );
  70846. return true;
  70847. }
  70848. // Abort if we're not in a table cell.
  70849. const tableCell = selection.focus.findAncestor( 'tableCell' );
  70850. /* istanbul ignore if: paranoid check */
  70851. if ( !tableCell ) {
  70852. return false;
  70853. }
  70854. // When the selection is not collapsed.
  70855. if ( !selection.isCollapsed ) {
  70856. if ( expandSelection ) {
  70857. // Navigation is in the opposite direction than the selection direction so this is shrinking of the selection.
  70858. // Selection for sure will not approach cell edge.
  70859. //
  70860. // With a special case when all cell content is selected - then selection should expand to the other cell.
  70861. // Note: When the entire cell gets selected using CTRL+A, the selection is always forward.
  70862. if ( selection.isBackward == isForward && !selection.containsEntireContent( tableCell ) ) {
  70863. return false;
  70864. }
  70865. } else {
  70866. const selectedElement = selection.getSelectedElement();
  70867. // It will collapse for non-object selected so it's not going to move to other cell.
  70868. if ( !selectedElement || !model.schema.isObject( selectedElement ) ) {
  70869. return false;
  70870. }
  70871. }
  70872. }
  70873. // Let's check if the selection is at the beginning/end of the cell.
  70874. if ( this._isSelectionAtCellEdge( selection, tableCell, isForward ) ) {
  70875. this._navigateFromCellInDirection( tableCell, direction, expandSelection );
  70876. return true;
  70877. }
  70878. return false;
  70879. }
  70880. /**
  70881. * Returns `true` if the selection is at the boundary of a table cell according to the navigation direction.
  70882. *
  70883. * @private
  70884. * @param {module:engine/model/selection~Selection} selection The current selection.
  70885. * @param {module:engine/model/element~Element} tableCell The current table cell element.
  70886. * @param {Boolean} isForward The expected navigation direction.
  70887. * @returns {Boolean}
  70888. */
  70889. _isSelectionAtCellEdge( selection, tableCell, isForward ) {
  70890. const model = this.editor.model;
  70891. const schema = this.editor.model.schema;
  70892. const focus = isForward ? selection.getLastPosition() : selection.getFirstPosition();
  70893. // If the current limit element is not table cell we are for sure not at the cell edge.
  70894. // Also `modifySelection` will not let us out of it.
  70895. if ( !schema.getLimitElement( focus ).is( 'element', 'tableCell' ) ) {
  70896. const boundaryPosition = model.createPositionAt( tableCell, isForward ? 'end' : 0 );
  70897. return boundaryPosition.isTouching( focus );
  70898. }
  70899. const probe = model.createSelection( focus );
  70900. model.modifySelection( probe, { direction: isForward ? 'forward' : 'backward' } );
  70901. // If there was no change in the focus position, then it's not possible to move the selection there.
  70902. return focus.isEqual( probe.focus );
  70903. }
  70904. /**
  70905. * Moves the selection from the given table cell in the specified direction.
  70906. *
  70907. * @protected
  70908. * @param {module:engine/model/element~Element} focusCell The table cell that is current multi-cell selection focus.
  70909. * @param {'left'|'up'|'right'|'down'} direction Direction in which selection should move.
  70910. * @param {Boolean} [expandSelection=false] If the current selection should be expanded.
  70911. */
  70912. _navigateFromCellInDirection( focusCell, direction, expandSelection = false ) {
  70913. const model = this.editor.model;
  70914. const table = focusCell.findAncestor( 'table' );
  70915. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, { includeAllSlots: true } ) ];
  70916. const { row: lastRow, column: lastColumn } = tableMap[ tableMap.length - 1 ];
  70917. const currentCellInfo = tableMap.find( ( { cell } ) => cell == focusCell );
  70918. let { row, column } = currentCellInfo;
  70919. switch ( direction ) {
  70920. case 'left':
  70921. column--;
  70922. break;
  70923. case 'up':
  70924. row--;
  70925. break;
  70926. case 'right':
  70927. column += currentCellInfo.cellWidth;
  70928. break;
  70929. case 'down':
  70930. row += currentCellInfo.cellHeight;
  70931. break;
  70932. }
  70933. const isOutsideVertically = row < 0 || row > lastRow;
  70934. const isBeforeFirstCell = column < 0 && row <= 0;
  70935. const isAfterLastCell = column > lastColumn && row >= lastRow;
  70936. // Note that if the table cell at the end of a row is row-spanned then isAfterLastCell will never be true.
  70937. // However, we don't know if user was navigating on the last row or not, so let's stay in the table.
  70938. if ( isOutsideVertically || isBeforeFirstCell || isAfterLastCell ) {
  70939. model.change( writer => {
  70940. writer.setSelection( writer.createRangeOn( table ) );
  70941. } );
  70942. return;
  70943. }
  70944. if ( column < 0 ) {
  70945. column = expandSelection ? 0 : lastColumn;
  70946. row--;
  70947. } else if ( column > lastColumn ) {
  70948. column = expandSelection ? lastColumn : 0;
  70949. row++;
  70950. }
  70951. const cellToSelect = tableMap.find( cellInfo => cellInfo.row == row && cellInfo.column == column ).cell;
  70952. const isForward = [ 'right', 'down' ].includes( direction );
  70953. const tableSelection = this.editor.plugins.get( 'TableSelection' );
  70954. if ( expandSelection && tableSelection.isEnabled ) {
  70955. const anchorCell = tableSelection.getAnchorCell() || focusCell;
  70956. tableSelection.setCellSelection( anchorCell, cellToSelect );
  70957. } else {
  70958. const positionToSelect = model.createPositionAt( cellToSelect, isForward ? 0 : 'end' );
  70959. model.change( writer => {
  70960. writer.setSelection( positionToSelect );
  70961. } );
  70962. }
  70963. }
  70964. }
  70965. /***/ }),
  70966. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tablemouse.js":
  70967. /*!******************************************************************!*\
  70968. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tablemouse.js ***!
  70969. \******************************************************************/
  70970. /*! exports provided: default */
  70971. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70972. "use strict";
  70973. __webpack_require__.r(__webpack_exports__);
  70974. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableMouse; });
  70975. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  70976. /* harmony import */ var _tableselection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tableselection */ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js");
  70977. /* harmony import */ var _tablemouse_mouseeventsobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tablemouse/mouseeventsobserver */ "./node_modules/@ckeditor/ckeditor5-table/src/tablemouse/mouseeventsobserver.js");
  70978. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  70979. /**
  70980. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  70981. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  70982. */
  70983. /**
  70984. * @module table/tablemouse
  70985. */
  70986. /**
  70987. * This plugin enables a table cells' selection with the mouse.
  70988. * It is loaded automatically by the {@link module:table/table~Table} plugin.
  70989. *
  70990. * @extends module:core/plugin~Plugin
  70991. */
  70992. class TableMouse extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  70993. /**
  70994. * @inheritDoc
  70995. */
  70996. static get pluginName() {
  70997. return 'TableMouse';
  70998. }
  70999. /**
  71000. * @inheritDoc
  71001. */
  71002. static get requires() {
  71003. return [ _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  71004. }
  71005. /**
  71006. * @inheritDoc
  71007. */
  71008. init() {
  71009. const editor = this.editor;
  71010. // Currently the MouseObserver only handles `mousedown` and `mouseup` events.
  71011. // TODO move to the engine?
  71012. editor.editing.view.addObserver( _tablemouse_mouseeventsobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
  71013. this._enableShiftClickSelection();
  71014. this._enableMouseDragSelection();
  71015. }
  71016. /**
  71017. * Enables making cells selection by <kbd>Shift</kbd>+click. Creates a selection from the cell which previously held
  71018. * the selection to the cell which was clicked. It can be the same cell, in which case it selects a single cell.
  71019. *
  71020. * @private
  71021. */
  71022. _enableShiftClickSelection() {
  71023. const editor = this.editor;
  71024. let blockSelectionChange = false;
  71025. const tableSelection = editor.plugins.get( _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"] );
  71026. this.listenTo( editor.editing.view.document, 'mousedown', ( evt, domEventData ) => {
  71027. if ( !this.isEnabled || !tableSelection.isEnabled ) {
  71028. return;
  71029. }
  71030. if ( !domEventData.domEvent.shiftKey ) {
  71031. return;
  71032. }
  71033. const anchorCell = tableSelection.getAnchorCell() || Object(_utils_selection__WEBPACK_IMPORTED_MODULE_3__["getTableCellsContainingSelection"])( editor.model.document.selection )[ 0 ];
  71034. if ( !anchorCell ) {
  71035. return;
  71036. }
  71037. const targetCell = this._getModelTableCellFromDomEvent( domEventData );
  71038. if ( targetCell && haveSameTableParent( anchorCell, targetCell ) ) {
  71039. blockSelectionChange = true;
  71040. tableSelection.setCellSelection( anchorCell, targetCell );
  71041. domEventData.preventDefault();
  71042. }
  71043. } );
  71044. this.listenTo( editor.editing.view.document, 'mouseup', () => {
  71045. blockSelectionChange = false;
  71046. } );
  71047. // We need to ignore a `selectionChange` event that is fired after we render our new table cells selection.
  71048. // When downcasting table cells selection to the view, we put the view selection in the last selected cell
  71049. // in a place that may not be natively a "correct" location. This is – we put it directly in the `<td>` element.
  71050. // All browsers fire the native `selectionchange` event.
  71051. // However, all browsers except Safari return the selection in the exact place where we put it
  71052. // (even though it's visually normalized). Safari returns `<td><p>^foo` that makes our selection observer
  71053. // fire our `selectionChange` event (because the view selection that we set in the first step differs from the DOM selection).
  71054. // Since `selectionChange` is fired, we automatically update the model selection that moves it that paragraph.
  71055. // This breaks our dear cells selection.
  71056. //
  71057. // Theoretically this issue concerns only Safari that is the only browser that do normalize the selection.
  71058. // However, to avoid code branching and to have a good coverage for this event blocker, I enabled it for all browsers.
  71059. //
  71060. // Note: I'm keeping the `blockSelectionChange` state separately for shift+click and mouse drag (exact same logic)
  71061. // so I don't have to try to analyze whether they don't overlap in some weird cases. Probably they don't.
  71062. // But I have other things to do, like writing this comment.
  71063. this.listenTo( editor.editing.view.document, 'selectionChange', evt => {
  71064. if ( blockSelectionChange ) {
  71065. // @if CK_DEBUG // console.log( 'Blocked selectionChange to avoid breaking table cells selection.' );
  71066. evt.stop();
  71067. }
  71068. }, { priority: 'highest' } );
  71069. }
  71070. /**
  71071. * Enables making cells selection by dragging.
  71072. *
  71073. * The selection is made only on mousemove. Mouse tracking is started on mousedown.
  71074. * However, the cells selection is enabled only after the mouse cursor left the anchor cell.
  71075. * Thanks to that normal text selection within one cell works just fine. However, you can still select
  71076. * just one cell by leaving the anchor cell and moving back to it.
  71077. *
  71078. * @private
  71079. */
  71080. _enableMouseDragSelection() {
  71081. const editor = this.editor;
  71082. let anchorCell, targetCell;
  71083. let beganCellSelection = false;
  71084. let blockSelectionChange = false;
  71085. const tableSelection = editor.plugins.get( _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"] );
  71086. this.listenTo( editor.editing.view.document, 'mousedown', ( evt, domEventData ) => {
  71087. if ( !this.isEnabled || !tableSelection.isEnabled ) {
  71088. return;
  71089. }
  71090. // Make sure to not conflict with the shift+click listener and any other possible handler.
  71091. if ( domEventData.domEvent.shiftKey || domEventData.domEvent.ctrlKey || domEventData.domEvent.altKey ) {
  71092. return;
  71093. }
  71094. anchorCell = this._getModelTableCellFromDomEvent( domEventData );
  71095. } );
  71096. this.listenTo( editor.editing.view.document, 'mousemove', ( evt, domEventData ) => {
  71097. if ( !domEventData.domEvent.buttons ) {
  71098. return;
  71099. }
  71100. if ( !anchorCell ) {
  71101. return;
  71102. }
  71103. const newTargetCell = this._getModelTableCellFromDomEvent( domEventData );
  71104. if ( newTargetCell && haveSameTableParent( anchorCell, newTargetCell ) ) {
  71105. targetCell = newTargetCell;
  71106. // Switch to the cell selection mode after the mouse cursor left the anchor cell.
  71107. // Switch off only on mouseup (makes selecting a single cell possible).
  71108. if ( !beganCellSelection && targetCell != anchorCell ) {
  71109. beganCellSelection = true;
  71110. }
  71111. }
  71112. // Yep, not making a cell selection yet. See method docs.
  71113. if ( !beganCellSelection ) {
  71114. return;
  71115. }
  71116. blockSelectionChange = true;
  71117. tableSelection.setCellSelection( anchorCell, targetCell );
  71118. domEventData.preventDefault();
  71119. } );
  71120. this.listenTo( editor.editing.view.document, 'mouseup', () => {
  71121. beganCellSelection = false;
  71122. blockSelectionChange = false;
  71123. anchorCell = null;
  71124. targetCell = null;
  71125. } );
  71126. // See the explanation in `_enableShiftClickSelection()`.
  71127. this.listenTo( editor.editing.view.document, 'selectionChange', evt => {
  71128. if ( blockSelectionChange ) {
  71129. // @if CK_DEBUG // console.log( 'Blocked selectionChange to avoid breaking table cells selection.' );
  71130. evt.stop();
  71131. }
  71132. }, { priority: 'highest' } );
  71133. }
  71134. /**
  71135. * Returns the model table cell element based on the target element of the passed DOM event.
  71136. *
  71137. * @private
  71138. * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
  71139. * @returns {module:engine/model/element~Element|undefined} Returns the table cell or `undefined`.
  71140. */
  71141. _getModelTableCellFromDomEvent( domEventData ) {
  71142. // Note: Work with positions (not element mapping) because the target element can be an attribute or other non-mapped element.
  71143. const viewTargetElement = domEventData.target;
  71144. const viewPosition = this.editor.editing.view.createPositionAt( viewTargetElement, 0 );
  71145. const modelPosition = this.editor.editing.mapper.toModelPosition( viewPosition );
  71146. const modelElement = modelPosition.parent;
  71147. return modelElement.findAncestor( 'tableCell', { includeSelf: true } );
  71148. }
  71149. }
  71150. function haveSameTableParent( cellA, cellB ) {
  71151. return cellA.parent.parent == cellB.parent.parent;
  71152. }
  71153. /***/ }),
  71154. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tablemouse/mouseeventsobserver.js":
  71155. /*!**************************************************************************************!*\
  71156. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tablemouse/mouseeventsobserver.js ***!
  71157. \**************************************************************************************/
  71158. /*! exports provided: default */
  71159. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71160. "use strict";
  71161. __webpack_require__.r(__webpack_exports__);
  71162. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MouseEventsObserver; });
  71163. /* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ "./node_modules/ckeditor5/src/engine.js");
  71164. /**
  71165. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  71166. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71167. */
  71168. /**
  71169. * @module table/tableselection/mouseeventsobserver
  71170. */
  71171. /**
  71172. * The mouse selection event observer.
  71173. *
  71174. * It registers listeners for the following DOM events:
  71175. *
  71176. * - `'mousemove'`
  71177. * - `'mouseup'`
  71178. * - `'mouseleave'`
  71179. *
  71180. * Note that this observer is disabled by default. To enable this observer, it needs to be added to
  71181. * {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.
  71182. *
  71183. * The observer is registered by the {@link module:table/tableselection~TableSelection} plugin.
  71184. *
  71185. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  71186. */
  71187. class MouseEventsObserver extends ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__["DomEventObserver"] {
  71188. /**
  71189. * @inheritDoc
  71190. */
  71191. constructor( view ) {
  71192. super( view );
  71193. this.domEventType = [ 'mousemove', 'mouseleave' ];
  71194. }
  71195. /**
  71196. * @inheritDoc
  71197. */
  71198. onDomEvent( domEvent ) {
  71199. this.fire( domEvent.type, domEvent );
  71200. }
  71201. }
  71202. /**
  71203. * Fired when the mouse is moved over one of the editables.
  71204. *
  71205. * Introduced by {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver}.
  71206. *
  71207. * Note that this event is not available by default. To make it available,
  71208. * {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver} needs to be added
  71209. * to {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.
  71210. *
  71211. * @see module:table/tableselection/mouseeventsobserver~MouseEventsObserver
  71212. * @event module:engine/view/document~Document#event:mousemove
  71213. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  71214. */
  71215. /**
  71216. * Fired when the mouse is moved out of one of the editables.
  71217. *
  71218. * Introduced by {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver}.
  71219. *
  71220. * Note that this event is not available by default. To make it available,
  71221. * {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver} needs to be added
  71222. * to {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.
  71223. *
  71224. * @see module:table/tableselection/mouseeventsobserver~MouseEventsObserver
  71225. * @event module:engine/view/document~Document#event:mouseleave
  71226. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  71227. */
  71228. /***/ }),
  71229. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js":
  71230. /*!**********************************************************************!*\
  71231. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js ***!
  71232. \**********************************************************************/
  71233. /*! exports provided: default */
  71234. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71235. "use strict";
  71236. __webpack_require__.r(__webpack_exports__);
  71237. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableSelection; });
  71238. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  71239. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  71240. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  71241. /* harmony import */ var _tableutils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tableutils */ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js");
  71242. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  71243. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  71244. /* harmony import */ var _theme_tableselection_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../theme/tableselection.css */ "./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css");
  71245. /**
  71246. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  71247. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71248. */
  71249. /**
  71250. * @module table/tableselection
  71251. */
  71252. /**
  71253. * This plugin enables the advanced table cells, rows and columns selection.
  71254. * It is loaded automatically by the {@link module:table/table~Table} plugin.
  71255. *
  71256. * @extends module:core/plugin~Plugin
  71257. */
  71258. class TableSelection extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  71259. /**
  71260. * @inheritDoc
  71261. */
  71262. static get pluginName() {
  71263. return 'TableSelection';
  71264. }
  71265. /**
  71266. * @inheritDoc
  71267. */
  71268. static get requires() {
  71269. return [ _tableutils__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  71270. }
  71271. /**
  71272. * @inheritDoc
  71273. */
  71274. init() {
  71275. const editor = this.editor;
  71276. const model = editor.model;
  71277. this.listenTo( model, 'deleteContent', ( evt, args ) => this._handleDeleteContent( evt, args ), { priority: 'high' } );
  71278. this._defineSelectionConverter();
  71279. this._enablePluginDisabling(); // sic!
  71280. }
  71281. /**
  71282. * Returns the currently selected table cells or `null` if it is not a table cells selection.
  71283. *
  71284. * @returns {Array.<module:engine/model/element~Element>|null}
  71285. */
  71286. getSelectedTableCells() {
  71287. const selection = this.editor.model.document.selection;
  71288. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getSelectedTableCells"])( selection );
  71289. if ( selectedCells.length == 0 ) {
  71290. return null;
  71291. }
  71292. // This should never happen, but let's know if it ever happens.
  71293. // @if CK_DEBUG // /* istanbul ignore next */
  71294. // @if CK_DEBUG // if ( selectedCells.length != selection.rangeCount ) {
  71295. // @if CK_DEBUG // console.warn( 'Mixed selection warning. The selection contains table cells and some other ranges.' );
  71296. // @if CK_DEBUG // }
  71297. return selectedCells;
  71298. }
  71299. /**
  71300. * Returns the selected table fragment as a document fragment.
  71301. *
  71302. * @returns {module:engine/model/documentfragment~DocumentFragment|null}
  71303. */
  71304. getSelectionAsFragment() {
  71305. const selectedCells = this.getSelectedTableCells();
  71306. if ( !selectedCells ) {
  71307. return null;
  71308. }
  71309. return this.editor.model.change( writer => {
  71310. const documentFragment = writer.createDocumentFragment();
  71311. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  71312. const { first: firstColumn, last: lastColumn } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getColumnIndexes"])( selectedCells );
  71313. const { first: firstRow, last: lastRow } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getRowIndexes"])( selectedCells );
  71314. const sourceTable = selectedCells[ 0 ].findAncestor( 'table' );
  71315. let adjustedLastRow = lastRow;
  71316. let adjustedLastColumn = lastColumn;
  71317. // If the selection is rectangular there could be a case of all cells in the last row/column spanned over
  71318. // next row/column so the real lastRow/lastColumn should be updated.
  71319. if ( Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["isSelectionRectangular"])( selectedCells, tableUtils ) ) {
  71320. const dimensions = {
  71321. firstColumn,
  71322. lastColumn,
  71323. firstRow,
  71324. lastRow
  71325. };
  71326. adjustedLastRow = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["adjustLastRowIndex"])( sourceTable, dimensions );
  71327. adjustedLastColumn = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["adjustLastColumnIndex"])( sourceTable, dimensions );
  71328. }
  71329. const cropDimensions = {
  71330. startRow: firstRow,
  71331. startColumn: firstColumn,
  71332. endRow: adjustedLastRow,
  71333. endColumn: adjustedLastColumn
  71334. };
  71335. const table = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["cropTableToDimensions"])( sourceTable, cropDimensions, writer );
  71336. writer.insert( table, documentFragment, 0 );
  71337. return documentFragment;
  71338. } );
  71339. }
  71340. /**
  71341. * Sets the model selection based on given anchor and target cells (can be the same cell).
  71342. * Takes care of setting the backward flag.
  71343. *
  71344. * const modelRoot = editor.model.document.getRoot();
  71345. * const firstCell = modelRoot.getNodeByPath( [ 0, 0, 0 ] );
  71346. * const lastCell = modelRoot.getNodeByPath( [ 0, 0, 1 ] );
  71347. *
  71348. * const tableSelection = editor.plugins.get( 'TableSelection' );
  71349. * tableSelection.setCellSelection( firstCell, lastCell );
  71350. *
  71351. * @param {module:engine/model/element~Element} anchorCell
  71352. * @param {module:engine/model/element~Element} targetCell
  71353. */
  71354. setCellSelection( anchorCell, targetCell ) {
  71355. const cellsToSelect = this._getCellsToSelect( anchorCell, targetCell );
  71356. this.editor.model.change( writer => {
  71357. writer.setSelection(
  71358. cellsToSelect.cells.map( cell => writer.createRangeOn( cell ) ),
  71359. { backward: cellsToSelect.backward }
  71360. );
  71361. } );
  71362. }
  71363. /**
  71364. * Returns the focus cell from the current selection.
  71365. *
  71366. * @returns {module:engine/model/element~Element}
  71367. */
  71368. getFocusCell() {
  71369. const selection = this.editor.model.document.selection;
  71370. const focusCellRange = [ ...selection.getRanges() ].pop();
  71371. const element = focusCellRange.getContainedElement();
  71372. if ( element && element.is( 'element', 'tableCell' ) ) {
  71373. return element;
  71374. }
  71375. return null;
  71376. }
  71377. /**
  71378. * Returns the anchor cell from the current selection.
  71379. *
  71380. * @returns {module:engine/model/element~Element} anchorCell
  71381. */
  71382. getAnchorCell() {
  71383. const selection = this.editor.model.document.selection;
  71384. const anchorCellRange = Object(ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__["first"])( selection.getRanges() );
  71385. const element = anchorCellRange.getContainedElement();
  71386. if ( element && element.is( 'element', 'tableCell' ) ) {
  71387. return element;
  71388. }
  71389. return null;
  71390. }
  71391. /**
  71392. * Defines a selection converter which marks the selected cells with a specific class.
  71393. *
  71394. * The real DOM selection is put in the last cell. Since the order of ranges is dependent on whether the
  71395. * selection is backward or not, the last cell will usually be close to the "focus" end of the selection
  71396. * (a selection has anchor and focus).
  71397. *
  71398. * The real DOM selection is then hidden with CSS.
  71399. *
  71400. * @private
  71401. */
  71402. _defineSelectionConverter() {
  71403. const editor = this.editor;
  71404. const highlighted = new Set();
  71405. editor.conversion.for( 'editingDowncast' ).add( dispatcher => dispatcher.on( 'selection', ( evt, data, conversionApi ) => {
  71406. const viewWriter = conversionApi.writer;
  71407. clearHighlightedTableCells( viewWriter );
  71408. const selectedCells = this.getSelectedTableCells();
  71409. if ( !selectedCells ) {
  71410. return;
  71411. }
  71412. for ( const tableCell of selectedCells ) {
  71413. const viewElement = conversionApi.mapper.toViewElement( tableCell );
  71414. viewWriter.addClass( 'ck-editor__editable_selected', viewElement );
  71415. highlighted.add( viewElement );
  71416. }
  71417. const lastViewCell = conversionApi.mapper.toViewElement( selectedCells[ selectedCells.length - 1 ] );
  71418. viewWriter.setSelection( lastViewCell, 0 );
  71419. }, { priority: 'lowest' } ) );
  71420. function clearHighlightedTableCells( writer ) {
  71421. for ( const previouslyHighlighted of highlighted ) {
  71422. writer.removeClass( 'ck-editor__editable_selected', previouslyHighlighted );
  71423. }
  71424. highlighted.clear();
  71425. }
  71426. }
  71427. /**
  71428. * Creates a listener that reacts to changes in {@link #isEnabled} and, if the plugin was disabled,
  71429. * it collapses the multi-cell selection to a regular selection placed inside a table cell.
  71430. *
  71431. * This listener helps features that disable the table selection plugin bring the selection
  71432. * to a clear state they can work with (for instance, because they don't support multiple cell selection).
  71433. */
  71434. _enablePluginDisabling() {
  71435. const editor = this.editor;
  71436. this.on( 'change:isEnabled', () => {
  71437. if ( !this.isEnabled ) {
  71438. const selectedCells = this.getSelectedTableCells();
  71439. if ( !selectedCells ) {
  71440. return;
  71441. }
  71442. editor.model.change( writer => {
  71443. const position = writer.createPositionAt( selectedCells[ 0 ], 0 );
  71444. const range = editor.model.schema.getNearestSelectionRange( position );
  71445. writer.setSelection( range );
  71446. } );
  71447. }
  71448. } );
  71449. }
  71450. /**
  71451. * Overrides the default `model.deleteContent()` behavior over a selected table fragment.
  71452. *
  71453. * @private
  71454. * @param {module:utils/eventinfo~EventInfo} event
  71455. * @param {Array.<*>} args Delete content method arguments.
  71456. */
  71457. _handleDeleteContent( event, args ) {
  71458. const [ selection, options ] = args;
  71459. const model = this.editor.model;
  71460. const isBackward = !options || options.direction == 'backward';
  71461. const selectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getSelectedTableCells"])( selection );
  71462. if ( !selectedTableCells.length ) {
  71463. return;
  71464. }
  71465. event.stop();
  71466. model.change( writer => {
  71467. const tableCellToSelect = selectedTableCells[ isBackward ? selectedTableCells.length - 1 : 0 ];
  71468. model.change( writer => {
  71469. for ( const tableCell of selectedTableCells ) {
  71470. model.deleteContent( writer.createSelection( tableCell, 'in' ) );
  71471. }
  71472. } );
  71473. const rangeToSelect = model.schema.getNearestSelectionRange( writer.createPositionAt( tableCellToSelect, 0 ) );
  71474. // Note: we ignore the case where rangeToSelect may be null because deleteContent() will always (unless someone broke it)
  71475. // create an empty paragraph to accommodate the selection.
  71476. if ( selection.is( 'documentSelection' ) ) {
  71477. writer.setSelection( rangeToSelect );
  71478. } else {
  71479. selection.setTo( rangeToSelect );
  71480. }
  71481. } );
  71482. }
  71483. /**
  71484. * Returns an array of table cells that should be selected based on the
  71485. * given anchor cell and target (focus) cell.
  71486. *
  71487. * The cells are returned in a reverse direction if the selection is backward.
  71488. *
  71489. * @private
  71490. * @param {module:engine/model/element~Element} anchorCell
  71491. * @param {module:engine/model/element~Element} targetCell
  71492. * @returns {Array.<module:engine/model/element~Element>}
  71493. */
  71494. _getCellsToSelect( anchorCell, targetCell ) {
  71495. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  71496. const startLocation = tableUtils.getCellLocation( anchorCell );
  71497. const endLocation = tableUtils.getCellLocation( targetCell );
  71498. const startRow = Math.min( startLocation.row, endLocation.row );
  71499. const endRow = Math.max( startLocation.row, endLocation.row );
  71500. const startColumn = Math.min( startLocation.column, endLocation.column );
  71501. const endColumn = Math.max( startLocation.column, endLocation.column );
  71502. // 2-dimensional array of the selected cells to ease flipping the order of cells for backward selections.
  71503. const selectionMap = new Array( endRow - startRow + 1 ).fill( null ).map( () => [] );
  71504. const walkerOptions = {
  71505. startRow,
  71506. endRow,
  71507. startColumn,
  71508. endColumn
  71509. };
  71510. for ( const { row, cell } of new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( anchorCell.findAncestor( 'table' ), walkerOptions ) ) {
  71511. selectionMap[ row - startRow ].push( cell );
  71512. }
  71513. const flipVertically = endLocation.row < startLocation.row;
  71514. const flipHorizontally = endLocation.column < startLocation.column;
  71515. if ( flipVertically ) {
  71516. selectionMap.reverse();
  71517. }
  71518. if ( flipHorizontally ) {
  71519. selectionMap.forEach( row => row.reverse() );
  71520. }
  71521. return {
  71522. cells: selectionMap.flat(),
  71523. backward: flipVertically || flipHorizontally
  71524. };
  71525. }
  71526. }
  71527. /***/ }),
  71528. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tabletoolbar.js":
  71529. /*!********************************************************************!*\
  71530. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tabletoolbar.js ***!
  71531. \********************************************************************/
  71532. /*! exports provided: default */
  71533. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71534. "use strict";
  71535. __webpack_require__.r(__webpack_exports__);
  71536. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableToolbar; });
  71537. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  71538. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  71539. /* harmony import */ var _utils_ui_widget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/ui/widget */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/ui/widget.js");
  71540. /**
  71541. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  71542. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71543. */
  71544. /**
  71545. * @module table/tabletoolbar
  71546. */
  71547. /**
  71548. * The table toolbar class. It creates toolbars for the table feature and its content (for now only for the table cell content).
  71549. *
  71550. * The table toolbar shows up when a table widget is selected. Its components (e.g. buttons) are created based on the
  71551. * {@link module:table/table~TableConfig#tableToolbar `table.tableToolbar` configuration option}.
  71552. *
  71553. * Table content toolbar shows up when the selection is inside the content of a table. It creates its component based on the
  71554. * {@link module:table/table~TableConfig#contentToolbar `table.contentToolbar` configuration option}.
  71555. *
  71556. * @extends module:core/plugin~Plugin
  71557. */
  71558. class TableToolbar extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  71559. /**
  71560. * @inheritDoc
  71561. */
  71562. static get requires() {
  71563. return [ ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetToolbarRepository"] ];
  71564. }
  71565. /**
  71566. * @inheritDoc
  71567. */
  71568. static get pluginName() {
  71569. return 'TableToolbar';
  71570. }
  71571. /**
  71572. * @inheritDoc
  71573. */
  71574. afterInit() {
  71575. const editor = this.editor;
  71576. const t = editor.t;
  71577. const widgetToolbarRepository = editor.plugins.get( ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_1__["WidgetToolbarRepository"] );
  71578. const tableContentToolbarItems = editor.config.get( 'table.contentToolbar' );
  71579. const tableToolbarItems = editor.config.get( 'table.tableToolbar' );
  71580. if ( tableContentToolbarItems ) {
  71581. widgetToolbarRepository.register( 'tableContent', {
  71582. ariaLabel: t( 'Table toolbar' ),
  71583. items: tableContentToolbarItems,
  71584. getRelatedElement: _utils_ui_widget__WEBPACK_IMPORTED_MODULE_2__["getTableWidgetAncestor"]
  71585. } );
  71586. }
  71587. if ( tableToolbarItems ) {
  71588. widgetToolbarRepository.register( 'table', {
  71589. ariaLabel: t( 'Table toolbar' ),
  71590. items: tableToolbarItems,
  71591. getRelatedElement: _utils_ui_widget__WEBPACK_IMPORTED_MODULE_2__["getSelectedTableWidget"]
  71592. } );
  71593. }
  71594. }
  71595. }
  71596. /**
  71597. * Items to be placed in the table content toolbar.
  71598. * The {@link module:table/tabletoolbar~TableToolbar} plugin is required to make this toolbar work.
  71599. *
  71600. * Assuming that you use the {@link module:table/tableui~TableUI} feature, the following toolbar items will be available
  71601. * in {@link module:ui/componentfactory~ComponentFactory}:
  71602. *
  71603. * * `'tableRow'`,
  71604. * * `'tableColumn'`,
  71605. * * `'mergeTableCells'`.
  71606. *
  71607. * You can thus configure the toolbar like this:
  71608. *
  71609. * const tableConfig = {
  71610. * contentToolbar: [ 'tableRow', 'tableColumn', 'mergeTableCells' ]
  71611. * };
  71612. *
  71613. * Of course, the same buttons can also be used in the
  71614. * {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
  71615. *
  71616. * Read more about configuring the toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
  71617. *
  71618. * @member {Array.<String>} module:table/table~TableConfig#contentToolbar
  71619. */
  71620. /**
  71621. * Items to be placed in the table toolbar.
  71622. * The {@link module:table/tabletoolbar~TableToolbar} plugin is required to make this toolbar work.
  71623. *
  71624. * You can thus configure the toolbar like this:
  71625. *
  71626. * const tableConfig = {
  71627. * tableToolbar: [ 'blockQuote' ]
  71628. * };
  71629. *
  71630. * Of course, the same buttons can also be used in the
  71631. * {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
  71632. *
  71633. * Read more about configuring the toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
  71634. *
  71635. * @member {Array.<String>} module:table/table~TableConfig#tableToolbar
  71636. */
  71637. /***/ }),
  71638. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableui.js":
  71639. /*!***************************************************************!*\
  71640. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableui.js ***!
  71641. \***************************************************************/
  71642. /*! exports provided: default */
  71643. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71644. "use strict";
  71645. __webpack_require__.r(__webpack_exports__);
  71646. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableUI; });
  71647. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  71648. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  71649. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  71650. /* harmony import */ var _ui_inserttableview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ui/inserttableview */ "./node_modules/@ckeditor/ckeditor5-table/src/ui/inserttableview.js");
  71651. /* harmony import */ var _theme_icons_table_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../theme/icons/table.svg */ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table.svg");
  71652. /* harmony import */ var _theme_icons_table_column_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../theme/icons/table-column.svg */ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-column.svg");
  71653. /* harmony import */ var _theme_icons_table_row_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../theme/icons/table-row.svg */ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-row.svg");
  71654. /* harmony import */ var _theme_icons_table_merge_cell_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../theme/icons/table-merge-cell.svg */ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-merge-cell.svg");
  71655. /**
  71656. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  71657. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71658. */
  71659. /**
  71660. * @module table/tableui
  71661. */
  71662. /**
  71663. * The table UI plugin. It introduces:
  71664. *
  71665. * * The `'insertTable'` dropdown,
  71666. * * The `'tableColumn'` dropdown,
  71667. * * The `'tableRow'` dropdown,
  71668. * * The `'mergeTableCells'` split button.
  71669. *
  71670. * The `'tableColumn'`, `'tableRow'` and `'mergeTableCells'` dropdowns work best with {@link module:table/tabletoolbar~TableToolbar}.
  71671. *
  71672. * @extends module:core/plugin~Plugin
  71673. */
  71674. class TableUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"] {
  71675. /**
  71676. * @inheritDoc
  71677. */
  71678. static get pluginName() {
  71679. return 'TableUI';
  71680. }
  71681. /**
  71682. * @inheritDoc
  71683. */
  71684. init() {
  71685. const editor = this.editor;
  71686. const t = this.editor.t;
  71687. const contentLanguageDirection = editor.locale.contentLanguageDirection;
  71688. const isContentLtr = contentLanguageDirection === 'ltr';
  71689. editor.ui.componentFactory.add( 'insertTable', locale => {
  71690. const command = editor.commands.get( 'insertTable' );
  71691. const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
  71692. dropdownView.bind( 'isEnabled' ).to( command );
  71693. // Decorate dropdown's button.
  71694. dropdownView.buttonView.set( {
  71695. icon: _theme_icons_table_svg__WEBPACK_IMPORTED_MODULE_4__["default"],
  71696. label: t( 'Insert table' ),
  71697. tooltip: true
  71698. } );
  71699. let insertTableView;
  71700. dropdownView.on( 'change:isOpen', () => {
  71701. if ( insertTableView ) {
  71702. return;
  71703. }
  71704. // Prepare custom view for dropdown's panel.
  71705. insertTableView = new _ui_inserttableview__WEBPACK_IMPORTED_MODULE_3__["default"]( locale );
  71706. dropdownView.panelView.children.add( insertTableView );
  71707. insertTableView.delegate( 'execute' ).to( dropdownView );
  71708. dropdownView.buttonView.on( 'open', () => {
  71709. // Reset the chooser before showing it to the user.
  71710. insertTableView.rows = 0;
  71711. insertTableView.columns = 0;
  71712. } );
  71713. dropdownView.on( 'execute', () => {
  71714. editor.execute( 'insertTable', { rows: insertTableView.rows, columns: insertTableView.columns } );
  71715. editor.editing.view.focus();
  71716. } );
  71717. } );
  71718. return dropdownView;
  71719. } );
  71720. editor.ui.componentFactory.add( 'tableColumn', locale => {
  71721. const options = [
  71722. {
  71723. type: 'switchbutton',
  71724. model: {
  71725. commandName: 'setTableColumnHeader',
  71726. label: t( 'Header column' ),
  71727. bindIsOn: true
  71728. }
  71729. },
  71730. { type: 'separator' },
  71731. {
  71732. type: 'button',
  71733. model: {
  71734. commandName: isContentLtr ? 'insertTableColumnLeft' : 'insertTableColumnRight',
  71735. label: t( 'Insert column left' )
  71736. }
  71737. },
  71738. {
  71739. type: 'button',
  71740. model: {
  71741. commandName: isContentLtr ? 'insertTableColumnRight' : 'insertTableColumnLeft',
  71742. label: t( 'Insert column right' )
  71743. }
  71744. },
  71745. {
  71746. type: 'button',
  71747. model: {
  71748. commandName: 'removeTableColumn',
  71749. label: t( 'Delete column' )
  71750. }
  71751. },
  71752. {
  71753. type: 'button',
  71754. model: {
  71755. commandName: 'selectTableColumn',
  71756. label: t( 'Select column' )
  71757. }
  71758. }
  71759. ];
  71760. return this._prepareDropdown( t( 'Column' ), _theme_icons_table_column_svg__WEBPACK_IMPORTED_MODULE_5__["default"], options, locale );
  71761. } );
  71762. editor.ui.componentFactory.add( 'tableRow', locale => {
  71763. const options = [
  71764. {
  71765. type: 'switchbutton',
  71766. model: {
  71767. commandName: 'setTableRowHeader',
  71768. label: t( 'Header row' ),
  71769. bindIsOn: true
  71770. }
  71771. },
  71772. { type: 'separator' },
  71773. {
  71774. type: 'button',
  71775. model: {
  71776. commandName: 'insertTableRowAbove',
  71777. label: t( 'Insert row above' )
  71778. }
  71779. },
  71780. {
  71781. type: 'button',
  71782. model: {
  71783. commandName: 'insertTableRowBelow',
  71784. label: t( 'Insert row below' )
  71785. }
  71786. },
  71787. {
  71788. type: 'button',
  71789. model: {
  71790. commandName: 'removeTableRow',
  71791. label: t( 'Delete row' )
  71792. }
  71793. },
  71794. {
  71795. type: 'button',
  71796. model: {
  71797. commandName: 'selectTableRow',
  71798. label: t( 'Select row' )
  71799. }
  71800. }
  71801. ];
  71802. return this._prepareDropdown( t( 'Row' ), _theme_icons_table_row_svg__WEBPACK_IMPORTED_MODULE_6__["default"], options, locale );
  71803. } );
  71804. editor.ui.componentFactory.add( 'mergeTableCells', locale => {
  71805. const options = [
  71806. {
  71807. type: 'button',
  71808. model: {
  71809. commandName: 'mergeTableCellUp',
  71810. label: t( 'Merge cell up' )
  71811. }
  71812. },
  71813. {
  71814. type: 'button',
  71815. model: {
  71816. commandName: isContentLtr ? 'mergeTableCellRight' : 'mergeTableCellLeft',
  71817. label: t( 'Merge cell right' )
  71818. }
  71819. },
  71820. {
  71821. type: 'button',
  71822. model: {
  71823. commandName: 'mergeTableCellDown',
  71824. label: t( 'Merge cell down' )
  71825. }
  71826. },
  71827. {
  71828. type: 'button',
  71829. model: {
  71830. commandName: isContentLtr ? 'mergeTableCellLeft' : 'mergeTableCellRight',
  71831. label: t( 'Merge cell left' )
  71832. }
  71833. },
  71834. { type: 'separator' },
  71835. {
  71836. type: 'button',
  71837. model: {
  71838. commandName: 'splitTableCellVertically',
  71839. label: t( 'Split cell vertically' )
  71840. }
  71841. },
  71842. {
  71843. type: 'button',
  71844. model: {
  71845. commandName: 'splitTableCellHorizontally',
  71846. label: t( 'Split cell horizontally' )
  71847. }
  71848. }
  71849. ];
  71850. return this._prepareMergeSplitButtonDropdown( t( 'Merge cells' ), _theme_icons_table_merge_cell_svg__WEBPACK_IMPORTED_MODULE_7__["default"], options, locale );
  71851. } );
  71852. }
  71853. /**
  71854. * Creates a dropdown view from a set of options.
  71855. *
  71856. * @private
  71857. * @param {String} label The dropdown button label.
  71858. * @param {String} icon An icon for the dropdown button.
  71859. * @param {Array.<module:ui/dropdown/utils~ListDropdownItemDefinition>} options The list of options for the dropdown.
  71860. * @param {module:utils/locale~Locale} locale
  71861. * @returns {module:ui/dropdown/dropdownview~DropdownView}
  71862. */
  71863. _prepareDropdown( label, icon, options, locale ) {
  71864. const editor = this.editor;
  71865. const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
  71866. const commands = this._fillDropdownWithListOptions( dropdownView, options );
  71867. // Decorate dropdown's button.
  71868. dropdownView.buttonView.set( {
  71869. label,
  71870. icon,
  71871. tooltip: true
  71872. } );
  71873. // Make dropdown button disabled when all options are disabled.
  71874. dropdownView.bind( 'isEnabled' ).toMany( commands, 'isEnabled', ( ...areEnabled ) => {
  71875. return areEnabled.some( isEnabled => isEnabled );
  71876. } );
  71877. this.listenTo( dropdownView, 'execute', evt => {
  71878. editor.execute( evt.source.commandName );
  71879. editor.editing.view.focus();
  71880. } );
  71881. return dropdownView;
  71882. }
  71883. /**
  71884. * Creates a dropdown view with a {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView} for
  71885. * merge (and split)–related commands.
  71886. *
  71887. * @private
  71888. * @param {String} label The dropdown button label.
  71889. * @param {String} icon An icon for the dropdown button.
  71890. * @param {Array.<module:ui/dropdown/utils~ListDropdownItemDefinition>} options The list of options for the dropdown.
  71891. * @param {module:utils/locale~Locale} locale
  71892. * @returns {module:ui/dropdown/dropdownview~DropdownView}
  71893. */
  71894. _prepareMergeSplitButtonDropdown( label, icon, options, locale ) {
  71895. const editor = this.editor;
  71896. const dropdownView = Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale, ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["SplitButtonView"] );
  71897. const mergeCommandName = 'mergeTableCells';
  71898. // Main command.
  71899. const mergeCommand = editor.commands.get( mergeCommandName );
  71900. // Subcommands in the dropdown.
  71901. const commands = this._fillDropdownWithListOptions( dropdownView, options );
  71902. dropdownView.buttonView.set( {
  71903. label,
  71904. icon,
  71905. tooltip: true,
  71906. isEnabled: true
  71907. } );
  71908. // Make dropdown button disabled when all options are disabled together with the main command.
  71909. dropdownView.bind( 'isEnabled' ).toMany( [ mergeCommand, ...commands ], 'isEnabled', ( ...areEnabled ) => {
  71910. return areEnabled.some( isEnabled => isEnabled );
  71911. } );
  71912. // Merge selected table cells when the main part of the split button is clicked.
  71913. this.listenTo( dropdownView.buttonView, 'execute', () => {
  71914. editor.execute( mergeCommandName );
  71915. editor.editing.view.focus();
  71916. } );
  71917. // Execute commands for events coming from the list in the dropdown panel.
  71918. this.listenTo( dropdownView, 'execute', evt => {
  71919. editor.execute( evt.source.commandName );
  71920. editor.editing.view.focus();
  71921. } );
  71922. return dropdownView;
  71923. }
  71924. /**
  71925. * Injects a {@link module:ui/list/listview~ListView} into the passed dropdown with buttons
  71926. * which execute editor commands as configured in passed options.
  71927. *
  71928. * @private
  71929. * @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
  71930. * @param {Array.<module:ui/dropdown/utils~ListDropdownItemDefinition>} options The list of options for the dropdown.
  71931. * @returns {Array.<module:core/command~Command>} Commands the list options are interacting with.
  71932. */
  71933. _fillDropdownWithListOptions( dropdownView, options ) {
  71934. const editor = this.editor;
  71935. const commands = [];
  71936. const itemDefinitions = new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_2__["Collection"]();
  71937. for ( const option of options ) {
  71938. addListOption( option, editor, commands, itemDefinitions );
  71939. }
  71940. Object(ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["addListToDropdown"])( dropdownView, itemDefinitions, editor.ui.componentFactory );
  71941. return commands;
  71942. }
  71943. }
  71944. // Adds an option to a list view.
  71945. //
  71946. // @param {module:table/tableui~DropdownOption} option A configuration option.
  71947. // @param {module:core/editor/editor~Editor} editor
  71948. // @param {Array.<module:core/command~Command>} commands The list of commands to update.
  71949. // @param {Iterable.<module:ui/dropdown/utils~ListDropdownItemDefinition>} itemDefinitions
  71950. // A collection of dropdown items to update with the given option.
  71951. function addListOption( option, editor, commands, itemDefinitions ) {
  71952. const model = option.model = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__["Model"]( option.model );
  71953. const { commandName, bindIsOn } = option.model;
  71954. if ( option.type === 'button' || option.type === 'switchbutton' ) {
  71955. const command = editor.commands.get( commandName );
  71956. commands.push( command );
  71957. model.set( { commandName } );
  71958. model.bind( 'isEnabled' ).to( command );
  71959. if ( bindIsOn ) {
  71960. model.bind( 'isOn' ).to( command, 'value' );
  71961. }
  71962. }
  71963. model.set( {
  71964. withText: true
  71965. } );
  71966. itemDefinitions.add( option );
  71967. }
  71968. /***/ }),
  71969. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js":
  71970. /*!******************************************************************!*\
  71971. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js ***!
  71972. \******************************************************************/
  71973. /*! exports provided: default */
  71974. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71975. "use strict";
  71976. __webpack_require__.r(__webpack_exports__);
  71977. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableUtils; });
  71978. /* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/utils */ "./node_modules/ckeditor5/src/utils.js");
  71979. /* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/core */ "./node_modules/ckeditor5/src/core.js");
  71980. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  71981. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  71982. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  71983. /**
  71984. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  71985. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71986. */
  71987. /**
  71988. * @module table/tableutils
  71989. */
  71990. /**
  71991. * The table utilities plugin.
  71992. *
  71993. * @extends module:core/plugin~Plugin
  71994. */
  71995. class TableUtils extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_1__["Plugin"] {
  71996. /**
  71997. * @inheritDoc
  71998. */
  71999. static get pluginName() {
  72000. return 'TableUtils';
  72001. }
  72002. /**
  72003. * @inheritDoc
  72004. */
  72005. init() {
  72006. this.decorate( 'insertColumns' );
  72007. this.decorate( 'insertRows' );
  72008. }
  72009. /**
  72010. * Returns the table cell location as an object with table row and table column indexes.
  72011. *
  72012. * For instance, in the table below:
  72013. *
  72014. * 0 1 2 3
  72015. * +---+---+---+---+
  72016. * 0 | a | b | c |
  72017. * + + +---+
  72018. * 1 | | | d |
  72019. * +---+---+ +---+
  72020. * 2 | e | | f |
  72021. * +---+---+---+---+
  72022. *
  72023. * the method will return:
  72024. *
  72025. * const cellA = table.getNodeByPath( [ 0, 0 ] );
  72026. * editor.plugins.get( 'TableUtils' ).getCellLocation( cellA );
  72027. * // will return { row: 0, column: 0 }
  72028. *
  72029. * const cellD = table.getNodeByPath( [ 1, 0 ] );
  72030. * editor.plugins.get( 'TableUtils' ).getCellLocation( cellD );
  72031. * // will return { row: 1, column: 3 }
  72032. *
  72033. * @param {module:engine/model/element~Element} tableCell
  72034. * @returns {Object} Returns a `{row, column}` object.
  72035. */
  72036. getCellLocation( tableCell ) {
  72037. const tableRow = tableCell.parent;
  72038. const table = tableRow.parent;
  72039. const rowIndex = table.getChildIndex( tableRow );
  72040. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, { row: rowIndex } );
  72041. for ( const { cell, row, column } of tableWalker ) {
  72042. if ( cell === tableCell ) {
  72043. return { row, column };
  72044. }
  72045. }
  72046. }
  72047. /**
  72048. * Creates an empty table with a proper structure. The table needs to be inserted into the model,
  72049. * for example, by using the {@link module:engine/model/model~Model#insertContent} function.
  72050. *
  72051. * model.change( ( writer ) => {
  72052. * // Create a table of 2 rows and 7 columns:
  72053. * const table = tableUtils.createTable( writer, { rows: 2, columns: 7 } );
  72054. *
  72055. * // Insert a table to the model at the best position taking the current selection:
  72056. * model.insertContent( table );
  72057. * }
  72058. *
  72059. * @param {module:engine/model/writer~Writer} writer The model writer.
  72060. * @param {Object} options
  72061. * @param {Number} [options.rows=2] The number of rows to create.
  72062. * @param {Number} [options.columns=2] The number of columns to create.
  72063. * @param {Number} [options.headingRows=0] The number of heading rows.
  72064. * @param {Number} [options.headingColumns=0] The number of heading columns.
  72065. * @returns {module:engine/model/element~Element} The created table element.
  72066. */
  72067. createTable( writer, options ) {
  72068. const table = writer.createElement( 'table' );
  72069. const rows = parseInt( options.rows ) || 2;
  72070. const columns = parseInt( options.columns ) || 2;
  72071. createEmptyRows( writer, table, 0, rows, columns );
  72072. if ( options.headingRows ) {
  72073. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingRows', Math.min( options.headingRows, rows ), table, writer, 0 );
  72074. }
  72075. if ( options.headingColumns ) {
  72076. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingColumns', Math.min( options.headingColumns, columns ), table, writer, 0 );
  72077. }
  72078. return table;
  72079. }
  72080. /**
  72081. * Inserts rows into a table.
  72082. *
  72083. * editor.plugins.get( 'TableUtils' ).insertRows( table, { at: 1, rows: 2 } );
  72084. *
  72085. * Assuming the table on the left, the above code will transform it to the table on the right:
  72086. *
  72087. * row index
  72088. * 0 +---+---+---+ `at` = 1, +---+---+---+ 0
  72089. * | a | b | c | `rows` = 2, | a | b | c |
  72090. * 1 + +---+---+ <-- insert here + +---+---+ 1
  72091. * | | d | e | | | | |
  72092. * 2 + +---+---+ will give: + +---+---+ 2
  72093. * | | f | g | | | | |
  72094. * 3 +---+---+---+ + +---+---+ 3
  72095. * | | d | e |
  72096. * + +---+---+ 4
  72097. * + + f | g |
  72098. * +---+---+---+ 5
  72099. *
  72100. * @param {module:engine/model/element~Element} table The table model element where the rows will be inserted.
  72101. * @param {Object} options
  72102. * @param {Number} [options.at=0] The row index at which the rows will be inserted.
  72103. * @param {Number} [options.rows=1] The number of rows to insert.
  72104. * @param {Boolean|undefined} [options.copyStructureFromAbove] The flag for copying row structure. Note that
  72105. * the row structure will not be copied if this option is not provided.
  72106. */
  72107. insertRows( table, options = {} ) {
  72108. const model = this.editor.model;
  72109. const insertAt = options.at || 0;
  72110. const rowsToInsert = options.rows || 1;
  72111. const isCopyStructure = options.copyStructureFromAbove !== undefined;
  72112. const copyStructureFrom = options.copyStructureFromAbove ? insertAt - 1 : insertAt;
  72113. const rows = this.getRows( table );
  72114. const columns = this.getColumns( table );
  72115. if ( insertAt > rows ) {
  72116. /**
  72117. * The `options.at` points at a row position that does not exist.
  72118. *
  72119. * @error tableutils-insertrows-insert-out-of-range
  72120. */
  72121. throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"](
  72122. 'tableutils-insertrows-insert-out-of-range',
  72123. this,
  72124. { options }
  72125. );
  72126. }
  72127. model.change( writer => {
  72128. const headingRows = table.getAttribute( 'headingRows' ) || 0;
  72129. // Inserting rows inside heading section requires to update `headingRows` attribute as the heading section will grow.
  72130. if ( headingRows > insertAt ) {
  72131. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingRows', headingRows + rowsToInsert, table, writer, 0 );
  72132. }
  72133. // Inserting at the end or at the beginning of a table doesn't require to calculate anything special.
  72134. if ( !isCopyStructure && ( insertAt === 0 || insertAt === rows ) ) {
  72135. createEmptyRows( writer, table, insertAt, rowsToInsert, columns );
  72136. return;
  72137. }
  72138. // Iterate over all the rows above the inserted rows in order to check for the row-spanned cells.
  72139. const walkerEndRow = isCopyStructure ? Math.max( insertAt, copyStructureFrom ) : insertAt;
  72140. const tableIterator = new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, { endRow: walkerEndRow } );
  72141. // Store spans of the reference row to reproduce it's structure. This array is column number indexed.
  72142. const rowColSpansMap = new Array( columns ).fill( 1 );
  72143. for ( const { row, column, cellHeight, cellWidth, cell } of tableIterator ) {
  72144. const lastCellRow = row + cellHeight - 1;
  72145. const isOverlappingInsertedRow = row < insertAt && insertAt <= lastCellRow;
  72146. const isReferenceRow = row <= copyStructureFrom && copyStructureFrom <= lastCellRow;
  72147. // If the cell is row-spanned and overlaps the inserted row, then reserve space for it in the row map.
  72148. if ( isOverlappingInsertedRow ) {
  72149. // This cell overlaps the inserted rows so we need to expand it further.
  72150. writer.setAttribute( 'rowspan', cellHeight + rowsToInsert, cell );
  72151. // Mark this cell with negative number to indicate how many cells should be skipped when adding the new cells.
  72152. rowColSpansMap[ column ] = -cellWidth;
  72153. }
  72154. // Store the colspan from reference row.
  72155. else if ( isCopyStructure && isReferenceRow ) {
  72156. rowColSpansMap[ column ] = cellWidth;
  72157. }
  72158. }
  72159. for ( let rowIndex = 0; rowIndex < rowsToInsert; rowIndex++ ) {
  72160. const tableRow = writer.createElement( 'tableRow' );
  72161. writer.insert( tableRow, table, insertAt );
  72162. for ( let cellIndex = 0; cellIndex < rowColSpansMap.length; cellIndex++ ) {
  72163. const colspan = rowColSpansMap[ cellIndex ];
  72164. const insertPosition = writer.createPositionAt( tableRow, 'end' );
  72165. // Insert the empty cell only if this slot is not row-spanned from any other cell.
  72166. if ( colspan > 0 ) {
  72167. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["createEmptyTableCell"])( writer, insertPosition, colspan > 1 ? { colspan } : null );
  72168. }
  72169. // Skip the col-spanned slots, there won't be any cells.
  72170. cellIndex += Math.abs( colspan ) - 1;
  72171. }
  72172. }
  72173. } );
  72174. }
  72175. /**
  72176. * Inserts columns into a table.
  72177. *
  72178. * editor.plugins.get( 'TableUtils' ).insertColumns( table, { at: 1, columns: 2 } );
  72179. *
  72180. * Assuming the table on the left, the above code will transform it to the table on the right:
  72181. *
  72182. * 0 1 2 3 0 1 2 3 4 5
  72183. * +---+---+---+ +---+---+---+---+---+
  72184. * | a | b | | a | b |
  72185. * + +---+ + +---+
  72186. * | | c | | | c |
  72187. * +---+---+---+ will give: +---+---+---+---+---+
  72188. * | d | e | f | | d | | | e | f |
  72189. * +---+ +---+ +---+---+---+ +---+
  72190. * | g | | h | | g | | | | h |
  72191. * +---+---+---+ +---+---+---+---+---+
  72192. * | i | | i |
  72193. * +---+---+---+ +---+---+---+---+---+
  72194. * ^---- insert here, `at` = 1, `columns` = 2
  72195. *
  72196. * @param {module:engine/model/element~Element} table The table model element where the columns will be inserted.
  72197. * @param {Object} options
  72198. * @param {Number} [options.at=0] The column index at which the columns will be inserted.
  72199. * @param {Number} [options.columns=1] The number of columns to insert.
  72200. */
  72201. insertColumns( table, options = {} ) {
  72202. const model = this.editor.model;
  72203. const insertAt = options.at || 0;
  72204. const columnsToInsert = options.columns || 1;
  72205. model.change( writer => {
  72206. const headingColumns = table.getAttribute( 'headingColumns' );
  72207. // Inserting columns inside heading section requires to update `headingColumns` attribute as the heading section will grow.
  72208. if ( insertAt < headingColumns ) {
  72209. writer.setAttribute( 'headingColumns', headingColumns + columnsToInsert, table );
  72210. }
  72211. const tableColumns = this.getColumns( table );
  72212. // Inserting at the end and at the beginning of a table doesn't require to calculate anything special.
  72213. if ( insertAt === 0 || tableColumns === insertAt ) {
  72214. for ( const tableRow of table.getChildren() ) {
  72215. // Ignore non-row elements inside the table (e.g. caption).
  72216. if ( !tableRow.is( 'element', 'tableRow' ) ) {
  72217. continue;
  72218. }
  72219. createCells( columnsToInsert, writer, writer.createPositionAt( tableRow, insertAt ? 'end' : 0 ) );
  72220. }
  72221. return;
  72222. }
  72223. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, { column: insertAt, includeAllSlots: true } );
  72224. for ( const tableSlot of tableWalker ) {
  72225. const { row, cell, cellAnchorColumn, cellAnchorRow, cellWidth, cellHeight } = tableSlot;
  72226. // When iterating over column the table walker outputs either:
  72227. // - cells at given column index (cell "e" from method docs),
  72228. // - spanned columns (spanned cell from row between cells "g" and "h" - spanned by "e", only if `includeAllSlots: true`),
  72229. // - or a cell from the same row which spans over this column (cell "a").
  72230. if ( cellAnchorColumn < insertAt ) {
  72231. // If cell is anchored in previous column, it is a cell that spans over an inserted column (cell "a" & "i").
  72232. // For such cells expand them by a number of columns inserted.
  72233. writer.setAttribute( 'colspan', cellWidth + columnsToInsert, cell );
  72234. // This cell will overlap cells in rows below so skip them (because of `includeAllSlots` option) - (cell "a")
  72235. const lastCellRow = cellAnchorRow + cellHeight - 1;
  72236. for ( let i = row; i <= lastCellRow; i++ ) {
  72237. tableWalker.skipRow( i );
  72238. }
  72239. } else {
  72240. // It's either cell at this column index or spanned cell by a row-spanned cell from row above.
  72241. // In table above it's cell "e" and a spanned position from row below (empty cell between cells "g" and "h")
  72242. createCells( columnsToInsert, writer, tableSlot.getPositionBefore() );
  72243. }
  72244. }
  72245. } );
  72246. }
  72247. /**
  72248. * Removes rows from the given `table`.
  72249. *
  72250. * This method re-calculates the table geometry including `rowspan` attribute of table cells overlapping removed rows
  72251. * and table headings values.
  72252. *
  72253. * editor.plugins.get( 'TableUtils' ).removeRows( table, { at: 1, rows: 2 } );
  72254. *
  72255. * Executing the above code in the context of the table on the left will transform its structure as presented on the right:
  72256. *
  72257. * row index
  72258. * ┌───┬───┬───┐ `at` = 1 ┌───┬───┬───┐
  72259. * 0 │ a │ b │ c │ `rows` = 2 │ a │ b │ c │ 0
  72260. * │ ├───┼───┤ │ ├───┼───┤
  72261. * 1 │ │ d │ e │ <-- remove from here │ │ d │ g │ 1
  72262. * │ │ ├───┤ will give: ├───┼───┼───┤
  72263. * 2 │ │ │ f │ │ h │ i │ j │ 2
  72264. * │ │ ├───┤ └───┴───┴───┘
  72265. * 3 │ │ │ g │
  72266. * ├───┼───┼───┤
  72267. * 4 │ h │ i │ j │
  72268. * └───┴───┴───┘
  72269. *
  72270. * @param {module:engine/model/element~Element} table
  72271. * @param {Object} options
  72272. * @param {Number} options.at The row index at which the removing rows will start.
  72273. * @param {Number} [options.rows=1] The number of rows to remove.
  72274. */
  72275. removeRows( table, options ) {
  72276. const model = this.editor.model;
  72277. const rowsToRemove = options.rows || 1;
  72278. const rowCount = this.getRows( table );
  72279. const first = options.at;
  72280. const last = first + rowsToRemove - 1;
  72281. if ( last > rowCount - 1 ) {
  72282. /**
  72283. * The `options.at` param must point at existing row and `options.rows` must not exceed the rows in the table.
  72284. *
  72285. * @error tableutils-removerows-row-index-out-of-range
  72286. */
  72287. throw new ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"](
  72288. 'tableutils-removerows-row-index-out-of-range',
  72289. this,
  72290. { table, options }
  72291. );
  72292. }
  72293. model.change( writer => {
  72294. // Removing rows from the table require that most calculations to be done prior to changing table structure.
  72295. // Preparations must be done in the same enqueueChange callback to use the current table structure.
  72296. // 1. Preparation - get row-spanned cells that have to be modified after removing rows.
  72297. const { cellsToMove, cellsToTrim } = getCellsToMoveAndTrimOnRemoveRow( table, first, last );
  72298. // 2. Execution
  72299. // 2a. Move cells from removed rows that extends over a removed section - must be done before removing rows.
  72300. // This will fill any gaps in a rows below that previously were empty because of row-spanned cells.
  72301. if ( cellsToMove.size ) {
  72302. const rowAfterRemovedSection = last + 1;
  72303. moveCellsToRow( table, rowAfterRemovedSection, cellsToMove, writer );
  72304. }
  72305. // 2b. Remove all required rows.
  72306. for ( let i = last; i >= first; i-- ) {
  72307. writer.remove( table.getChild( i ) );
  72308. }
  72309. // 2c. Update cells from rows above that overlap removed section. Similar to step 2 but does not involve moving cells.
  72310. for ( const { rowspan, cell } of cellsToTrim ) {
  72311. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'rowspan', rowspan, cell, writer );
  72312. }
  72313. // 2d. Adjust heading rows if removed rows were in a heading section.
  72314. updateHeadingRows( table, first, last, writer );
  72315. // 2e. Remove empty columns (without anchored cells) if there are any.
  72316. if ( !Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyColumns"])( table, this ) ) {
  72317. // If there wasn't any empty columns then we still need to check if this wasn't called
  72318. // because of cleaning empty rows and we only removed one of them.
  72319. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyRows"])( table, this );
  72320. }
  72321. } );
  72322. }
  72323. /**
  72324. * Removes columns from the given `table`.
  72325. *
  72326. * This method re-calculates the table geometry including the `colspan` attribute of table cells overlapping removed columns
  72327. * and table headings values.
  72328. *
  72329. * editor.plugins.get( 'TableUtils' ).removeColumns( table, { at: 1, columns: 2 } );
  72330. *
  72331. * Executing the above code in the context of the table on the left will transform its structure as presented on the right:
  72332. *
  72333. * 0 1 2 3 4 0 1 2
  72334. * ┌───────────────┬───┐ ┌───────┬───┐
  72335. * │ a │ b │ │ a │ b │
  72336. * │ ├───┤ │ ├───┤
  72337. * │ │ c │ │ │ c │
  72338. * ├───┬───┬───┬───┼───┤ will give: ├───┬───┼───┤
  72339. * │ d │ e │ f │ g │ h │ │ d │ g │ h │
  72340. * ├───┼───┼───┤ ├───┤ ├───┤ ├───┤
  72341. * │ i │ j │ k │ │ l │ │ i │ │ l │
  72342. * ├───┴───┴───┴───┴───┤ ├───┴───┴───┤
  72343. * │ m │ │ m │
  72344. * └───────────────────┘ └───────────┘
  72345. * ^---- remove from here, `at` = 1, `columns` = 2
  72346. *
  72347. * @param {module:engine/model/element~Element} table
  72348. * @param {Object} options
  72349. * @param {Number} options.at The row index at which the removing columns will start.
  72350. * @param {Number} [options.columns=1] The number of columns to remove.
  72351. */
  72352. removeColumns( table, options ) {
  72353. const model = this.editor.model;
  72354. const first = options.at;
  72355. const columnsToRemove = options.columns || 1;
  72356. const last = options.at + columnsToRemove - 1;
  72357. model.change( writer => {
  72358. adjustHeadingColumns( table, { first, last }, writer );
  72359. for ( let removedColumnIndex = last; removedColumnIndex >= first; removedColumnIndex-- ) {
  72360. for ( const { cell, column, cellWidth } of [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table ) ] ) {
  72361. // If colspaned cell overlaps removed column decrease its span.
  72362. if ( column <= removedColumnIndex && cellWidth > 1 && column + cellWidth > removedColumnIndex ) {
  72363. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'colspan', cellWidth - 1, cell, writer );
  72364. } else if ( column === removedColumnIndex ) {
  72365. // The cell in removed column has colspan of 1.
  72366. writer.remove( cell );
  72367. }
  72368. }
  72369. }
  72370. // Remove empty rows that could appear after removing columns.
  72371. if ( !Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyRows"])( table, this ) ) {
  72372. // If there wasn't any empty rows then we still need to check if this wasn't called
  72373. // because of cleaning empty columns and we only removed one of them.
  72374. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyColumns"])( table, this );
  72375. }
  72376. } );
  72377. }
  72378. /**
  72379. * Divides a table cell vertically into several ones.
  72380. *
  72381. * The cell will be visually split into more cells by updating colspans of other cells in a column
  72382. * and inserting cells (columns) after that cell.
  72383. *
  72384. * In the table below, if cell "a" is split into 3 cells:
  72385. *
  72386. * +---+---+---+
  72387. * | a | b | c |
  72388. * +---+---+---+
  72389. * | d | e | f |
  72390. * +---+---+---+
  72391. *
  72392. * it will result in the table below:
  72393. *
  72394. * +---+---+---+---+---+
  72395. * | a | | | b | c |
  72396. * +---+---+---+---+---+
  72397. * | d | e | f |
  72398. * +---+---+---+---+---+
  72399. *
  72400. * So cell "d" will get its `colspan` updated to `3` and 2 cells will be added (2 columns will be created).
  72401. *
  72402. * Splitting a cell that already has a `colspan` attribute set will distribute the cell `colspan` evenly and the remainder
  72403. * will be left to the original cell:
  72404. *
  72405. * +---+---+---+
  72406. * | a |
  72407. * +---+---+---+
  72408. * | b | c | d |
  72409. * +---+---+---+
  72410. *
  72411. * Splitting cell "a" with `colspan=3` into 2 cells will create 1 cell with a `colspan=a` and cell "a" that will have `colspan=2`:
  72412. *
  72413. * +---+---+---+
  72414. * | a | |
  72415. * +---+---+---+
  72416. * | b | c | d |
  72417. * +---+---+---+
  72418. *
  72419. * @param {module:engine/model/element~Element} tableCell
  72420. * @param {Number} numberOfCells
  72421. */
  72422. splitCellVertically( tableCell, numberOfCells = 2 ) {
  72423. const model = this.editor.model;
  72424. const tableRow = tableCell.parent;
  72425. const table = tableRow.parent;
  72426. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  72427. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  72428. model.change( writer => {
  72429. // First check - the cell spans over multiple rows so before doing anything else just split this cell.
  72430. if ( colspan > 1 ) {
  72431. // Get spans of new (inserted) cells and span to update of split cell.
  72432. const { newCellsSpan, updatedSpan } = breakSpanEvenly( colspan, numberOfCells );
  72433. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'colspan', updatedSpan, tableCell, writer );
  72434. // Each inserted cell will have the same attributes:
  72435. const newCellsAttributes = {};
  72436. // Do not store default value in the model.
  72437. if ( newCellsSpan > 1 ) {
  72438. newCellsAttributes.colspan = newCellsSpan;
  72439. }
  72440. // Copy rowspan of split cell.
  72441. if ( rowspan > 1 ) {
  72442. newCellsAttributes.rowspan = rowspan;
  72443. }
  72444. const cellsToInsert = colspan > numberOfCells ? numberOfCells - 1 : colspan - 1;
  72445. createCells( cellsToInsert, writer, writer.createPositionAfter( tableCell ), newCellsAttributes );
  72446. }
  72447. // Second check - the cell has colspan of 1 or we need to create more cells then the currently one spans over.
  72448. if ( colspan < numberOfCells ) {
  72449. const cellsToInsert = numberOfCells - colspan;
  72450. // First step: expand cells on the same column as split cell.
  72451. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table ) ];
  72452. // Get the column index of split cell.
  72453. const { column: splitCellColumn } = tableMap.find( ( { cell } ) => cell === tableCell );
  72454. // Find cells which needs to be expanded vertically - those on the same column or those that spans over split cell's column.
  72455. const cellsToUpdate = tableMap.filter( ( { cell, cellWidth, column } ) => {
  72456. const isOnSameColumn = cell !== tableCell && column === splitCellColumn;
  72457. const spansOverColumn = ( column < splitCellColumn && column + cellWidth > splitCellColumn );
  72458. return isOnSameColumn || spansOverColumn;
  72459. } );
  72460. // Expand cells vertically.
  72461. for ( const { cell, cellWidth } of cellsToUpdate ) {
  72462. writer.setAttribute( 'colspan', cellWidth + cellsToInsert, cell );
  72463. }
  72464. // Second step: create columns after split cell.
  72465. // Each inserted cell will have the same attributes:
  72466. const newCellsAttributes = {};
  72467. // Do not store default value in the model.
  72468. // Copy rowspan of split cell.
  72469. if ( rowspan > 1 ) {
  72470. newCellsAttributes.rowspan = rowspan;
  72471. }
  72472. createCells( cellsToInsert, writer, writer.createPositionAfter( tableCell ), newCellsAttributes );
  72473. const headingColumns = table.getAttribute( 'headingColumns' ) || 0;
  72474. // Update heading section if split cell is in heading section.
  72475. if ( headingColumns > splitCellColumn ) {
  72476. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingColumns', headingColumns + cellsToInsert, table, writer );
  72477. }
  72478. }
  72479. } );
  72480. }
  72481. /**
  72482. * Divides a table cell horizontally into several ones.
  72483. *
  72484. * The cell will be visually split into more cells by updating rowspans of other cells in the row and inserting rows with a single cell
  72485. * below.
  72486. *
  72487. * If in the table below cell "b" is split into 3 cells:
  72488. *
  72489. * +---+---+---+
  72490. * | a | b | c |
  72491. * +---+---+---+
  72492. * | d | e | f |
  72493. * +---+---+---+
  72494. *
  72495. * It will result in the table below:
  72496. *
  72497. * +---+---+---+
  72498. * | a | b | c |
  72499. * + +---+ +
  72500. * | | | |
  72501. * + +---+ +
  72502. * | | | |
  72503. * +---+---+---+
  72504. * | d | e | f |
  72505. * +---+---+---+
  72506. *
  72507. * So cells "a" and "b" will get their `rowspan` updated to `3` and 2 rows with a single cell will be added.
  72508. *
  72509. * Splitting a cell that already has a `rowspan` attribute set will distribute the cell `rowspan` evenly and the remainder
  72510. * will be left to the original cell:
  72511. *
  72512. * +---+---+---+
  72513. * | a | b | c |
  72514. * + +---+---+
  72515. * | | d | e |
  72516. * + +---+---+
  72517. * | | f | g |
  72518. * + +---+---+
  72519. * | | h | i |
  72520. * +---+---+---+
  72521. *
  72522. * Splitting cell "a" with `rowspan=4` into 3 cells will create 2 cells with a `rowspan=1` and cell "a" will have `rowspan=2`:
  72523. *
  72524. * +---+---+---+
  72525. * | a | b | c |
  72526. * + +---+---+
  72527. * | | d | e |
  72528. * +---+---+---+
  72529. * | | f | g |
  72530. * +---+---+---+
  72531. * | | h | i |
  72532. * +---+---+---+
  72533. *
  72534. * @param {module:engine/model/element~Element} tableCell
  72535. * @param {Number} numberOfCells
  72536. */
  72537. splitCellHorizontally( tableCell, numberOfCells = 2 ) {
  72538. const model = this.editor.model;
  72539. const tableRow = tableCell.parent;
  72540. const table = tableRow.parent;
  72541. const splitCellRow = table.getChildIndex( tableRow );
  72542. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  72543. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  72544. model.change( writer => {
  72545. // First check - the cell spans over multiple rows so before doing anything else just split this cell.
  72546. if ( rowspan > 1 ) {
  72547. // Cache table map before updating table.
  72548. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, {
  72549. startRow: splitCellRow,
  72550. endRow: splitCellRow + rowspan - 1,
  72551. includeAllSlots: true
  72552. } ) ];
  72553. // Get spans of new (inserted) cells and span to update of split cell.
  72554. const { newCellsSpan, updatedSpan } = breakSpanEvenly( rowspan, numberOfCells );
  72555. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'rowspan', updatedSpan, tableCell, writer );
  72556. const { column: cellColumn } = tableMap.find( ( { cell } ) => cell === tableCell );
  72557. // Each inserted cell will have the same attributes:
  72558. const newCellsAttributes = {};
  72559. // Do not store default value in the model.
  72560. if ( newCellsSpan > 1 ) {
  72561. newCellsAttributes.rowspan = newCellsSpan;
  72562. }
  72563. // Copy colspan of split cell.
  72564. if ( colspan > 1 ) {
  72565. newCellsAttributes.colspan = colspan;
  72566. }
  72567. for ( const tableSlot of tableMap ) {
  72568. const { column, row } = tableSlot;
  72569. // As both newly created cells and the split cell might have rowspan,
  72570. // the insertion of new cells must go to appropriate rows:
  72571. //
  72572. // 1. It's a row after split cell + it's height.
  72573. const isAfterSplitCell = row >= splitCellRow + updatedSpan;
  72574. // 2. Is on the same column.
  72575. const isOnSameColumn = column === cellColumn;
  72576. // 3. And it's row index is after previous cell height.
  72577. const isInEvenlySplitRow = ( row + splitCellRow + updatedSpan ) % newCellsSpan === 0;
  72578. if ( isAfterSplitCell && isOnSameColumn && isInEvenlySplitRow ) {
  72579. createCells( 1, writer, tableSlot.getPositionBefore(), newCellsAttributes );
  72580. }
  72581. }
  72582. }
  72583. // Second check - the cell has rowspan of 1 or we need to create more cells than the current cell spans over.
  72584. if ( rowspan < numberOfCells ) {
  72585. // We already split the cell in check one so here we split to the remaining number of cells only.
  72586. const cellsToInsert = numberOfCells - rowspan;
  72587. // This check is needed since we need to check if there are any cells from previous rows than spans over this cell's row.
  72588. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, { startRow: 0, endRow: splitCellRow } ) ];
  72589. // First step: expand cells.
  72590. for ( const { cell, cellHeight, row } of tableMap ) {
  72591. // Expand rowspan of cells that are either:
  72592. // - on the same row as current cell,
  72593. // - or are below split cell row and overlaps that row.
  72594. if ( cell !== tableCell && row + cellHeight > splitCellRow ) {
  72595. const rowspanToSet = cellHeight + cellsToInsert;
  72596. writer.setAttribute( 'rowspan', rowspanToSet, cell );
  72597. }
  72598. }
  72599. // Second step: create rows with single cell below split cell.
  72600. const newCellsAttributes = {};
  72601. // Copy colspan of split cell.
  72602. if ( colspan > 1 ) {
  72603. newCellsAttributes.colspan = colspan;
  72604. }
  72605. createEmptyRows( writer, table, splitCellRow + 1, cellsToInsert, 1, newCellsAttributes );
  72606. // Update heading section if split cell is in heading section.
  72607. const headingRows = table.getAttribute( 'headingRows' ) || 0;
  72608. if ( headingRows > splitCellRow ) {
  72609. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingRows', headingRows + cellsToInsert, table, writer );
  72610. }
  72611. }
  72612. } );
  72613. }
  72614. /**
  72615. * Returns the number of columns for a given table.
  72616. *
  72617. * editor.plugins.get( 'TableUtils' ).getColumns( table );
  72618. *
  72619. * @param {module:engine/model/element~Element} table The table to analyze.
  72620. * @returns {Number}
  72621. */
  72622. getColumns( table ) {
  72623. // Analyze first row only as all the rows should have the same width.
  72624. // Using the first row without checking if it's a tableRow because we expect
  72625. // that table will have only tableRow model elements at the beginning.
  72626. const row = table.getChild( 0 );
  72627. return [ ...row.getChildren() ].reduce( ( columns, row ) => {
  72628. const columnWidth = parseInt( row.getAttribute( 'colspan' ) || 1 );
  72629. return columns + columnWidth;
  72630. }, 0 );
  72631. }
  72632. /**
  72633. * Returns the number of rows for a given table. Any other element present in the table model is omitted.
  72634. *
  72635. * editor.plugins.get( 'TableUtils' ).getRows( table );
  72636. *
  72637. * @param {module:engine/model/element~Element} table The table to analyze.
  72638. * @returns {Number}
  72639. */
  72640. getRows( table ) {
  72641. // Rowspan not included due to #6427.
  72642. return Array.from( table.getChildren() )
  72643. .reduce( ( rowCount, child ) => child.is( 'element', 'tableRow' ) ? rowCount + 1 : rowCount, 0 );
  72644. }
  72645. }
  72646. // Creates empty rows at the given index in an existing table.
  72647. //
  72648. // @param {module:engine/model/writer~Writer} writer
  72649. // @param {module:engine/model/element~Element} table
  72650. // @param {Number} insertAt The row index of row insertion.
  72651. // @param {Number} rows The number of rows to create.
  72652. // @param {Number} tableCellToInsert The number of cells to insert in each row.
  72653. function createEmptyRows( writer, table, insertAt, rows, tableCellToInsert, attributes = {} ) {
  72654. for ( let i = 0; i < rows; i++ ) {
  72655. const tableRow = writer.createElement( 'tableRow' );
  72656. writer.insert( tableRow, table, insertAt );
  72657. createCells( tableCellToInsert, writer, writer.createPositionAt( tableRow, 'end' ), attributes );
  72658. }
  72659. }
  72660. // Creates cells at a given position.
  72661. //
  72662. // @param {Number} columns The number of columns to create
  72663. // @param {module:engine/model/writer~Writer} writer
  72664. // @param {module:engine/model/position~Position} insertPosition
  72665. function createCells( cells, writer, insertPosition, attributes = {} ) {
  72666. for ( let i = 0; i < cells; i++ ) {
  72667. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["createEmptyTableCell"])( writer, insertPosition, attributes );
  72668. }
  72669. }
  72670. // Evenly distributes the span of a cell to a number of provided cells.
  72671. // The resulting spans will always be integer values.
  72672. //
  72673. // For instance breaking a span of 7 into 3 cells will return:
  72674. //
  72675. // { newCellsSpan: 2, updatedSpan: 3 }
  72676. //
  72677. // as two cells will have a span of 2 and the remainder will go the first cell so its span will change to 3.
  72678. //
  72679. // @param {Number} span The span value do break.
  72680. // @param {Number} numberOfCells The number of resulting spans.
  72681. // @returns {{newCellsSpan: Number, updatedSpan: Number}}
  72682. function breakSpanEvenly( span, numberOfCells ) {
  72683. if ( span < numberOfCells ) {
  72684. return { newCellsSpan: 1, updatedSpan: 1 };
  72685. }
  72686. const newCellsSpan = Math.floor( span / numberOfCells );
  72687. const updatedSpan = ( span - newCellsSpan * numberOfCells ) + newCellsSpan;
  72688. return { newCellsSpan, updatedSpan };
  72689. }
  72690. // Updates heading columns attribute if removing a row from head section.
  72691. function adjustHeadingColumns( table, removedColumnIndexes, writer ) {
  72692. const headingColumns = table.getAttribute( 'headingColumns' ) || 0;
  72693. if ( headingColumns && removedColumnIndexes.first < headingColumns ) {
  72694. const headingsRemoved = Math.min( headingColumns - 1 /* Other numbers are 0-based */, removedColumnIndexes.last ) -
  72695. removedColumnIndexes.first + 1;
  72696. writer.setAttribute( 'headingColumns', headingColumns - headingsRemoved, table );
  72697. }
  72698. }
  72699. // Calculates a new heading rows value for removing rows from heading section.
  72700. function updateHeadingRows( table, first, last, writer ) {
  72701. const headingRows = table.getAttribute( 'headingRows' ) || 0;
  72702. if ( first < headingRows ) {
  72703. const newRows = last < headingRows ? headingRows - ( last - first + 1 ) : first;
  72704. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'headingRows', newRows, table, writer, 0 );
  72705. }
  72706. }
  72707. // Finds cells that will be:
  72708. // - trimmed - Cells that are "above" removed rows sections and overlap the removed section - their rowspan must be trimmed.
  72709. // - moved - Cells from removed rows section might stick out of. These cells are moved to the next row after a removed section.
  72710. //
  72711. // Sample table with overlapping & sticking out cells:
  72712. //
  72713. // +----+----+----+----+----+
  72714. // | 00 | 01 | 02 | 03 | 04 |
  72715. // +----+ + + + +
  72716. // | 10 | | | | |
  72717. // +----+----+ + + +
  72718. // | 20 | 21 | | | | <-- removed row
  72719. // + + +----+ + +
  72720. // | | | 32 | | | <-- removed row
  72721. // +----+ + +----+ +
  72722. // | 40 | | | 43 | |
  72723. // +----+----+----+----+----+
  72724. //
  72725. // In a table above:
  72726. // - cells to trim: '02', '03' & '04'.
  72727. // - cells to move: '21' & '32'.
  72728. function getCellsToMoveAndTrimOnRemoveRow( table, first, last ) {
  72729. const cellsToMove = new Map();
  72730. const cellsToTrim = [];
  72731. for ( const { row, column, cellHeight, cell } of new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, { endRow: last } ) ) {
  72732. const lastRowOfCell = row + cellHeight - 1;
  72733. const isCellStickingOutFromRemovedRows = row >= first && row <= last && lastRowOfCell > last;
  72734. if ( isCellStickingOutFromRemovedRows ) {
  72735. const rowspanInRemovedSection = last - row + 1;
  72736. const rowSpanToSet = cellHeight - rowspanInRemovedSection;
  72737. cellsToMove.set( column, {
  72738. cell,
  72739. rowspan: rowSpanToSet
  72740. } );
  72741. }
  72742. const isCellOverlappingRemovedRows = row < first && lastRowOfCell >= first;
  72743. if ( isCellOverlappingRemovedRows ) {
  72744. let rowspanAdjustment;
  72745. // Cell fully covers removed section - trim it by removed rows count.
  72746. if ( lastRowOfCell >= last ) {
  72747. rowspanAdjustment = last - first + 1;
  72748. }
  72749. // Cell partially overlaps removed section - calculate cell's span that is in removed section.
  72750. else {
  72751. rowspanAdjustment = lastRowOfCell - first + 1;
  72752. }
  72753. cellsToTrim.push( {
  72754. cell,
  72755. rowspan: cellHeight - rowspanAdjustment
  72756. } );
  72757. }
  72758. }
  72759. return { cellsToMove, cellsToTrim };
  72760. }
  72761. function moveCellsToRow( table, targetRowIndex, cellsToMove, writer ) {
  72762. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table, {
  72763. includeAllSlots: true,
  72764. row: targetRowIndex
  72765. } );
  72766. const tableRowMap = [ ...tableWalker ];
  72767. const row = table.getChild( targetRowIndex );
  72768. let previousCell;
  72769. for ( const { column, cell, isAnchor } of tableRowMap ) {
  72770. if ( cellsToMove.has( column ) ) {
  72771. const { cell: cellToMove, rowspan } = cellsToMove.get( column );
  72772. const targetPosition = previousCell ?
  72773. writer.createPositionAfter( previousCell ) :
  72774. writer.createPositionAt( row, 0 );
  72775. writer.move( writer.createRangeOn( cellToMove ), targetPosition );
  72776. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'rowspan', rowspan, cellToMove, writer );
  72777. previousCell = cellToMove;
  72778. } else if ( isAnchor ) {
  72779. // If cell is spanned then `cell` holds reference to overlapping cell. See ckeditor/ckeditor5#6502.
  72780. previousCell = cell;
  72781. }
  72782. }
  72783. }
  72784. /***/ }),
  72785. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js":
  72786. /*!*******************************************************************!*\
  72787. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js ***!
  72788. \*******************************************************************/
  72789. /*! exports provided: default */
  72790. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  72791. "use strict";
  72792. __webpack_require__.r(__webpack_exports__);
  72793. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableWalker; });
  72794. /**
  72795. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  72796. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  72797. */
  72798. /**
  72799. * @module table/tablewalker
  72800. */
  72801. // @if CK_DEBUG // import { CKEditorError } from 'ckeditor5/src/utils';
  72802. /**
  72803. * The table iterator class. It allows to iterate over table cells. For each cell the iterator yields
  72804. * {@link module:table/tablewalker~TableSlot} with proper table cell attributes.
  72805. */
  72806. class TableWalker {
  72807. /**
  72808. * Creates an instance of the table walker.
  72809. *
  72810. * The table walker iterates internally by traversing the table from row index = 0 and column index = 0.
  72811. * It walks row by row and column by column in order to output values defined in the constructor.
  72812. * By default it will output only the locations that are occupied by a cell. To include also spanned rows and columns,
  72813. * pass the `includeAllSlots` option to the constructor.
  72814. *
  72815. * The most important values of the iterator are column and row indexes of a cell.
  72816. *
  72817. * See {@link module:table/tablewalker~TableSlot} what values are returned by the table walker.
  72818. *
  72819. * To iterate over a given row:
  72820. *
  72821. * const tableWalker = new TableWalker( table, { startRow: 1, endRow: 2 } );
  72822. *
  72823. * for ( const tableSlot of tableWalker ) {
  72824. * console.log( 'A cell at row', tableSlot.row, 'and column', tableSlot.column );
  72825. * }
  72826. *
  72827. * For instance the code above for the following table:
  72828. *
  72829. * +----+----+----+----+----+----+
  72830. * | 00 | 02 | 03 | 04 | 05 |
  72831. * | +----+----+----+----+
  72832. * | | 12 | 14 | 15 |
  72833. * | +----+----+----+ +
  72834. * | | 22 | |
  72835. * |----+----+----+----+----+ +
  72836. * | 30 | 31 | 32 | 33 | 34 | |
  72837. * +----+----+----+----+----+----+
  72838. *
  72839. * will log in the console:
  72840. *
  72841. * 'A cell at row 1 and column 2'
  72842. * 'A cell at row 1 and column 4'
  72843. * 'A cell at row 1 and column 5'
  72844. * 'A cell at row 2 and column 2'
  72845. *
  72846. * To also iterate over spanned cells:
  72847. *
  72848. * const tableWalker = new TableWalker( table, { row: 1, includeAllSlots: true } );
  72849. *
  72850. * for ( const tableSlot of tableWalker ) {
  72851. * console.log( 'Slot at', tableSlot.row, 'x', tableSlot.column, ':', tableSlot.isAnchor ? 'is anchored' : 'is spanned' );
  72852. * }
  72853. *
  72854. * will log in the console for the table from the previous example:
  72855. *
  72856. * 'Cell at 1 x 0 : is spanned'
  72857. * 'Cell at 1 x 1 : is spanned'
  72858. * 'Cell at 1 x 2 : is anchored'
  72859. * 'Cell at 1 x 3 : is spanned'
  72860. * 'Cell at 1 x 4 : is anchored'
  72861. * 'Cell at 1 x 5 : is anchored'
  72862. *
  72863. * **Note**: Option `row` is a shortcut that sets both `startRow` and `endRow` to the same row.
  72864. * (Use either `row` or `startRow` and `endRow` but never together). Similarly the `column` option sets both `startColumn`
  72865. * and `endColumn` to the same column (Use either `column` or `startColumn` and `endColumn` but never together).
  72866. *
  72867. * @constructor
  72868. * @param {module:engine/model/element~Element} table A table over which the walker iterates.
  72869. * @param {Object} [options={}] An object with configuration.
  72870. * @param {Number} [options.row] A row index for which this iterator will output cells.
  72871. * Can't be used together with `startRow` and `endRow`.
  72872. * @param {Number} [options.startRow=0] A row index from which this iterator should start. Can't be used together with `row`.
  72873. * @param {Number} [options.endRow] A row index at which this iterator should end. Can't be used together with `row`.
  72874. * @param {Number} [options.column] A column index for which this iterator will output cells.
  72875. * Can't be used together with `startColumn` and `endColumn`.
  72876. * @param {Number} [options.startColumn=0] A column index from which this iterator should start. Can't be used together with `column`.
  72877. * @param {Number} [options.endColumn] A column index at which this iterator should end. Can't be used together with `column`.
  72878. * @param {Boolean} [options.includeAllSlots=false] Also return values for spanned cells.
  72879. */
  72880. constructor( table, options = {} ) {
  72881. /**
  72882. * The walker's table element.
  72883. *
  72884. * @readonly
  72885. * @member {module:engine/model/element~Element}
  72886. * @protected
  72887. */
  72888. this._table = table;
  72889. /**
  72890. * A row index from which this iterator will start.
  72891. *
  72892. * @readonly
  72893. * @member {Number}
  72894. * @private
  72895. */
  72896. this._startRow = options.row !== undefined ? options.row : options.startRow || 0;
  72897. /**
  72898. * A row index at which this iterator will end.
  72899. *
  72900. * @readonly
  72901. * @member {Number}
  72902. * @private
  72903. */
  72904. this._endRow = options.row !== undefined ? options.row : options.endRow;
  72905. /**
  72906. * If set, the table walker will only output cells from a given column and following ones or cells that overlap them.
  72907. *
  72908. * @readonly
  72909. * @member {Number}
  72910. * @private
  72911. */
  72912. this._startColumn = options.column !== undefined ? options.column : options.startColumn || 0;
  72913. /**
  72914. * If set, the table walker will only output cells up to a given column.
  72915. *
  72916. * @readonly
  72917. * @member {Number}
  72918. * @private
  72919. */
  72920. this._endColumn = options.column !== undefined ? options.column : options.endColumn;
  72921. /**
  72922. * Enables output of spanned cells that are normally not yielded.
  72923. *
  72924. * @readonly
  72925. * @member {Boolean}
  72926. * @private
  72927. */
  72928. this._includeAllSlots = !!options.includeAllSlots;
  72929. /**
  72930. * Row indexes to skip from the iteration.
  72931. *
  72932. * @readonly
  72933. * @member {Set<Number>}
  72934. * @private
  72935. */
  72936. this._skipRows = new Set();
  72937. /**
  72938. * The current row index.
  72939. *
  72940. * @member {Number}
  72941. * @protected
  72942. */
  72943. this._row = 0;
  72944. /**
  72945. * The index of the current row element in the table.
  72946. *
  72947. * @type {Number}
  72948. * @protected
  72949. */
  72950. this._rowIndex = 0;
  72951. /**
  72952. * The current column index.
  72953. *
  72954. * @member {Number}
  72955. * @protected
  72956. */
  72957. this._column = 0;
  72958. /**
  72959. * The cell index in a parent row. For spanned cells when {@link #_includeAllSlots} is set to `true`,
  72960. * this represents the index of the next table cell.
  72961. *
  72962. * @member {Number}
  72963. * @protected
  72964. */
  72965. this._cellIndex = 0;
  72966. /**
  72967. * Holds a map of spanned cells in a table.
  72968. *
  72969. * @readonly
  72970. * @member {Map.<Number, Map.<Number, Object>>}
  72971. * @private
  72972. */
  72973. this._spannedCells = new Map();
  72974. /**
  72975. * Index of the next column where a cell is anchored.
  72976. *
  72977. * @member {Number}
  72978. * @private
  72979. */
  72980. this._nextCellAtColumn = -1;
  72981. }
  72982. /**
  72983. * Iterable interface.
  72984. *
  72985. * @returns {Iterable.<module:table/tablewalker~TableSlot>}
  72986. */
  72987. [ Symbol.iterator ]() {
  72988. return this;
  72989. }
  72990. /**
  72991. * Gets the next table walker's value.
  72992. *
  72993. * @returns {module:table/tablewalker~TableSlot} The next table walker's value.
  72994. */
  72995. next() {
  72996. const row = this._table.getChild( this._rowIndex );
  72997. // Iterator is done when there's no row (table ended) or the row is after `endRow` limit.
  72998. if ( !row || this._isOverEndRow() ) {
  72999. return { done: true };
  73000. }
  73001. // We step over current element when it is not a tableRow instance.
  73002. if ( !row.is( 'element', 'tableRow' ) ) {
  73003. this._rowIndex++;
  73004. return this.next();
  73005. }
  73006. if ( this._isOverEndColumn() ) {
  73007. return this._advanceToNextRow();
  73008. }
  73009. let outValue = null;
  73010. const spanData = this._getSpanned();
  73011. if ( spanData ) {
  73012. if ( this._includeAllSlots && !this._shouldSkipSlot() ) {
  73013. outValue = this._formatOutValue( spanData.cell, spanData.row, spanData.column );
  73014. }
  73015. } else {
  73016. const cell = row.getChild( this._cellIndex );
  73017. if ( !cell ) {
  73018. // If there are no more cells left in row advance to the next row.
  73019. return this._advanceToNextRow();
  73020. }
  73021. const colspan = parseInt( cell.getAttribute( 'colspan' ) || 1 );
  73022. const rowspan = parseInt( cell.getAttribute( 'rowspan' ) || 1 );
  73023. // Record this cell spans if it's not 1x1 cell.
  73024. if ( colspan > 1 || rowspan > 1 ) {
  73025. this._recordSpans( cell, rowspan, colspan );
  73026. }
  73027. if ( !this._shouldSkipSlot() ) {
  73028. outValue = this._formatOutValue( cell );
  73029. }
  73030. this._nextCellAtColumn = this._column + colspan;
  73031. }
  73032. // Advance to the next column before returning value.
  73033. this._column++;
  73034. if ( this._column == this._nextCellAtColumn ) {
  73035. this._cellIndex++;
  73036. }
  73037. // The current value will be returned only if current row and column are not skipped.
  73038. return outValue || this.next();
  73039. }
  73040. /**
  73041. * Marks a row to skip in the next iteration. It will also skip cells from the current row if there are any cells from the current row
  73042. * to output.
  73043. *
  73044. * @param {Number} row The row index to skip.
  73045. */
  73046. skipRow( row ) {
  73047. this._skipRows.add( row );
  73048. }
  73049. /**
  73050. * Advances internal cursor to the next row.
  73051. *
  73052. * @private
  73053. * @returns {module:table/tablewalker~TableSlot}
  73054. */
  73055. _advanceToNextRow() {
  73056. this._row++;
  73057. this._rowIndex++;
  73058. this._column = 0;
  73059. this._cellIndex = 0;
  73060. this._nextCellAtColumn = -1;
  73061. return this.next();
  73062. }
  73063. /**
  73064. * Checks if the current row is over {@link #_endRow}.
  73065. *
  73066. * @private
  73067. * @returns {Boolean}
  73068. */
  73069. _isOverEndRow() {
  73070. // If #_endRow is defined skip all rows after it.
  73071. return this._endRow !== undefined && this._row > this._endRow;
  73072. }
  73073. /**
  73074. * Checks if the current cell is over {@link #_endColumn}
  73075. *
  73076. * @private
  73077. * @returns {Boolean}
  73078. */
  73079. _isOverEndColumn() {
  73080. // If #_endColumn is defined skip all cells after it.
  73081. return this._endColumn !== undefined && this._column > this._endColumn;
  73082. }
  73083. /**
  73084. * A common method for formatting the iterator's output value.
  73085. *
  73086. * @private
  73087. * @param {module:engine/model/element~Element} cell The table cell to output.
  73088. * @param {Number} [anchorRow] The row index of a cell anchor slot.
  73089. * @param {Number} [anchorColumn] The column index of a cell anchor slot.
  73090. * @returns {{done: Boolean, value: {cell: *, row: Number, column: *, rowspan: *, colspan: *, cellIndex: Number}}}
  73091. */
  73092. _formatOutValue( cell, anchorRow = this._row, anchorColumn = this._column ) {
  73093. return {
  73094. done: false,
  73095. value: new TableSlot( this, cell, anchorRow, anchorColumn )
  73096. };
  73097. }
  73098. /**
  73099. * Checks if the current slot should be skipped.
  73100. *
  73101. * @private
  73102. * @returns {Boolean}
  73103. */
  73104. _shouldSkipSlot() {
  73105. const rowIsMarkedAsSkipped = this._skipRows.has( this._row );
  73106. const rowIsBeforeStartRow = this._row < this._startRow;
  73107. const columnIsBeforeStartColumn = this._column < this._startColumn;
  73108. const columnIsAfterEndColumn = this._endColumn !== undefined && this._column > this._endColumn;
  73109. return rowIsMarkedAsSkipped || rowIsBeforeStartRow || columnIsBeforeStartColumn || columnIsAfterEndColumn;
  73110. }
  73111. /**
  73112. * Returns the cell element that is spanned over the current cell location.
  73113. *
  73114. * @private
  73115. * @returns {module:engine/model/element~Element}
  73116. */
  73117. _getSpanned() {
  73118. const rowMap = this._spannedCells.get( this._row );
  73119. // No spans for given row.
  73120. if ( !rowMap ) {
  73121. return null;
  73122. }
  73123. // If spans for given rows has entry for column it means that this location if spanned by other cell.
  73124. return rowMap.get( this._column ) || null;
  73125. }
  73126. /**
  73127. * Updates spanned cells map relative to the current cell location and its span dimensions.
  73128. *
  73129. * @private
  73130. * @param {module:engine/model/element~Element} cell A cell that is spanned.
  73131. * @param {Number} rowspan Cell height.
  73132. * @param {Number} colspan Cell width.
  73133. */
  73134. _recordSpans( cell, rowspan, colspan ) {
  73135. const data = {
  73136. cell,
  73137. row: this._row,
  73138. column: this._column
  73139. };
  73140. for ( let rowToUpdate = this._row; rowToUpdate < this._row + rowspan; rowToUpdate++ ) {
  73141. for ( let columnToUpdate = this._column; columnToUpdate < this._column + colspan; columnToUpdate++ ) {
  73142. if ( rowToUpdate != this._row || columnToUpdate != this._column ) {
  73143. this._markSpannedCell( rowToUpdate, columnToUpdate, data );
  73144. }
  73145. }
  73146. }
  73147. }
  73148. /**
  73149. * Marks the cell location as spanned by another cell.
  73150. *
  73151. * @private
  73152. * @param {Number} row The row index of the cell location.
  73153. * @param {Number} column The column index of the cell location.
  73154. * @param {Object} data A spanned cell details (cell element, anchor row and column).
  73155. */
  73156. _markSpannedCell( row, column, data ) {
  73157. if ( !this._spannedCells.has( row ) ) {
  73158. this._spannedCells.set( row, new Map() );
  73159. }
  73160. const rowSpans = this._spannedCells.get( row );
  73161. rowSpans.set( column, data );
  73162. }
  73163. }
  73164. /**
  73165. * An object returned by {@link module:table/tablewalker~TableWalker} when traversing table cells.
  73166. */
  73167. class TableSlot {
  73168. /**
  73169. * Creates an instance of the table walker value.
  73170. *
  73171. * @protected
  73172. * @param {module:table/tablewalker~TableWalker} tableWalker The table walker instance.
  73173. * @param {module:engine/model/element~Element} cell The current table cell.
  73174. * @param {Number} anchorRow The row index of a cell anchor slot.
  73175. * @param {Number} anchorColumn The column index of a cell anchor slot.
  73176. */
  73177. constructor( tableWalker, cell, anchorRow, anchorColumn ) {
  73178. /**
  73179. * The current table cell.
  73180. *
  73181. * @readonly
  73182. * @member {module:engine/model/element~Element}
  73183. */
  73184. this.cell = cell;
  73185. /**
  73186. * The row index of a table slot.
  73187. *
  73188. * @readonly
  73189. * @member {Number}
  73190. */
  73191. this.row = tableWalker._row;
  73192. /**
  73193. * The column index of a table slot.
  73194. *
  73195. * @readonly
  73196. * @member {Number}
  73197. */
  73198. this.column = tableWalker._column;
  73199. /**
  73200. * The row index of a cell anchor slot.
  73201. *
  73202. * @readonly
  73203. * @member {Number}
  73204. */
  73205. this.cellAnchorRow = anchorRow;
  73206. /**
  73207. * The column index of a cell anchor slot.
  73208. *
  73209. * @readonly
  73210. * @member {Number}
  73211. */
  73212. this.cellAnchorColumn = anchorColumn;
  73213. /**
  73214. * The index of the current cell in the parent row.
  73215. *
  73216. * @readonly
  73217. * @member {Number}
  73218. * @private
  73219. */
  73220. this._cellIndex = tableWalker._cellIndex;
  73221. /**
  73222. * The index of the current row element in the table.
  73223. *
  73224. * @readonly
  73225. * @member {Number}
  73226. * @private
  73227. */
  73228. this._rowIndex = tableWalker._rowIndex;
  73229. /**
  73230. * The table element.
  73231. *
  73232. * @readonly
  73233. * @member {module:engine/model/element~Element}
  73234. * @private
  73235. */
  73236. this._table = tableWalker._table;
  73237. }
  73238. /**
  73239. * Whether the cell is anchored in the current slot.
  73240. *
  73241. * @readonly
  73242. * @returns {Boolean}
  73243. */
  73244. get isAnchor() {
  73245. return this.row === this.cellAnchorRow && this.column === this.cellAnchorColumn;
  73246. }
  73247. /**
  73248. * The width of a cell defined by a `colspan` attribute. If the model attribute is not present, it is set to `1`.
  73249. *
  73250. * @readonly
  73251. * @returns {Number}
  73252. */
  73253. get cellWidth() {
  73254. return parseInt( this.cell.getAttribute( 'colspan' ) || 1 );
  73255. }
  73256. /**
  73257. * The height of a cell defined by a `rowspan` attribute. If the model attribute is not present, it is set to `1`.
  73258. *
  73259. * @readonly
  73260. * @returns {Number}
  73261. */
  73262. get cellHeight() {
  73263. return parseInt( this.cell.getAttribute( 'rowspan' ) || 1 );
  73264. }
  73265. /**
  73266. * The index of the current row element in the table.
  73267. *
  73268. * @readonly
  73269. * @returns {Number}
  73270. */
  73271. get rowIndex() {
  73272. return this._rowIndex;
  73273. }
  73274. /**
  73275. * Returns the {@link module:engine/model/position~Position} before the table slot.
  73276. *
  73277. * @returns {module:engine/model/position~Position}
  73278. */
  73279. getPositionBefore() {
  73280. const model = this._table.root.document.model;
  73281. return model.createPositionAt( this._table.getChild( this.row ), this._cellIndex );
  73282. }
  73283. // @if CK_DEBUG // get isSpanned() { throwMissingGetterError( 'isSpanned' ); }
  73284. // @if CK_DEBUG // get colspan() { throwMissingGetterError( 'colspan' ); }
  73285. // @if CK_DEBUG // get rowspan() { throwMissingGetterError( 'rowspan' ); }
  73286. // @if CK_DEBUG // get cellIndex() { throwMissingGetterError( 'cellIndex' ); }
  73287. }
  73288. /**
  73289. * This `TableSlot`'s getter (property) was removed in CKEditor 5 v20.0.0.
  73290. *
  73291. * Check out the new `TableWalker`'s API in the documentation.
  73292. *
  73293. * @error tableslot-getter-removed
  73294. * @param {String} getterName
  73295. */
  73296. // @if CK_DEBUG // function throwMissingGetterError( getterName ) {
  73297. // @if CK_DEBUG // throw new CKEditorError( 'tableslot-getter-removed', this, {
  73298. // @if CK_DEBUG // getterName
  73299. // @if CK_DEBUG // } );
  73300. // @if CK_DEBUG // }
  73301. /***/ }),
  73302. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/ui/inserttableview.js":
  73303. /*!**************************************************************************!*\
  73304. !*** ./node_modules/@ckeditor/ckeditor5-table/src/ui/inserttableview.js ***!
  73305. \**************************************************************************/
  73306. /*! exports provided: default */
  73307. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73308. "use strict";
  73309. __webpack_require__.r(__webpack_exports__);
  73310. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertTableView; });
  73311. /* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/ui */ "./node_modules/ckeditor5/src/ui.js");
  73312. /* harmony import */ var _theme_inserttable_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../theme/inserttable.css */ "./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css");
  73313. /**
  73314. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  73315. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73316. */
  73317. /**
  73318. * @module table/ui/inserttableview
  73319. */
  73320. /**
  73321. * The table size view.
  73322. *
  73323. * It renders a 10x10 grid to choose the inserted table size.
  73324. *
  73325. * @extends module:ui/view~View
  73326. * @implements module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable
  73327. */
  73328. class InsertTableView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"] {
  73329. /**
  73330. * @inheritDoc
  73331. */
  73332. constructor( locale ) {
  73333. super( locale );
  73334. const bind = this.bindTemplate;
  73335. /**
  73336. * A collection of table size box items.
  73337. *
  73338. * @readonly
  73339. * @member {module:ui/viewcollection~ViewCollection}
  73340. */
  73341. this.items = this._createGridCollection();
  73342. /**
  73343. * The currently selected number of rows of the new table.
  73344. *
  73345. * @observable
  73346. * @member {Number} #rows
  73347. */
  73348. this.set( 'rows', 0 );
  73349. /**
  73350. * The currently selected number of columns of the new table.
  73351. *
  73352. * @observable
  73353. * @member {Number} #columns
  73354. */
  73355. this.set( 'columns', 0 );
  73356. /**
  73357. * The label text displayed under the boxes.
  73358. *
  73359. * @observable
  73360. * @member {String} #label
  73361. */
  73362. this.bind( 'label' )
  73363. .to( this, 'columns', this, 'rows', ( columns, rows ) => `${ rows } × ${ columns }` );
  73364. this.setTemplate( {
  73365. tag: 'div',
  73366. attributes: {
  73367. class: [ 'ck' ]
  73368. },
  73369. children: [
  73370. {
  73371. tag: 'div',
  73372. attributes: {
  73373. class: [ 'ck-insert-table-dropdown__grid' ]
  73374. },
  73375. on: {
  73376. 'mouseover@.ck-insert-table-dropdown-grid-box': bind.to( 'boxover' )
  73377. },
  73378. children: this.items
  73379. },
  73380. {
  73381. tag: 'div',
  73382. attributes: {
  73383. class: [ 'ck-insert-table-dropdown__label' ]
  73384. },
  73385. children: [
  73386. {
  73387. text: bind.to( 'label' )
  73388. }
  73389. ]
  73390. }
  73391. ],
  73392. on: {
  73393. mousedown: bind.to( evt => {
  73394. evt.preventDefault();
  73395. } ),
  73396. click: bind.to( () => {
  73397. this.fire( 'execute' );
  73398. } )
  73399. }
  73400. } );
  73401. this.on( 'boxover', ( evt, domEvt ) => {
  73402. const { row, column } = domEvt.target.dataset;
  73403. // As row & column indexes are zero-based transform it to number of selected rows & columns.
  73404. this.set( {
  73405. rows: parseInt( row ),
  73406. columns: parseInt( column )
  73407. } );
  73408. } );
  73409. this.on( 'change:columns', () => {
  73410. this._highlightGridBoxes();
  73411. } );
  73412. this.on( 'change:rows', () => {
  73413. this._highlightGridBoxes();
  73414. } );
  73415. }
  73416. /**
  73417. * @inheritDoc
  73418. */
  73419. focus() {
  73420. // The dropdown panel expects DropdownPanelFocusable interface on views passed to dropdown panel. See #30.
  73421. // The method should be implemented while working on keyboard support for this view. See #22.
  73422. }
  73423. /**
  73424. * @inheritDoc
  73425. */
  73426. focusLast() {
  73427. // The dropdown panel expects DropdownPanelFocusable interface on views passed to dropdown panel. See #30.
  73428. // The method should be implemented while working on keyboard support for this view. See #22.
  73429. }
  73430. /**
  73431. * Highlights grid boxes depending on rows and columns selected.
  73432. *
  73433. * @private
  73434. */
  73435. _highlightGridBoxes() {
  73436. const rows = this.rows;
  73437. const columns = this.columns;
  73438. this.items.map( ( boxView, index ) => {
  73439. // Translate box index to the row & column index.
  73440. const itemRow = Math.floor( index / 10 );
  73441. const itemColumn = index % 10;
  73442. // Grid box is highlighted when its row & column index belongs to selected number of rows & columns.
  73443. const isOn = itemRow < rows && itemColumn < columns;
  73444. boxView.set( 'isOn', isOn );
  73445. } );
  73446. }
  73447. /**
  73448. * @private
  73449. * @returns {module:ui/viewcollection~ViewCollection} A view collection containing boxes to be placed in a table grid.
  73450. */
  73451. _createGridCollection() {
  73452. const boxes = [];
  73453. // Add grid boxes to table selection view.
  73454. for ( let index = 0; index < 100; index++ ) {
  73455. const row = Math.floor( index / 10 );
  73456. const column = index % 10;
  73457. boxes.push( new TableSizeGridBoxView( this.locale, row + 1, column + 1 ) );
  73458. }
  73459. return this.createCollection( boxes );
  73460. }
  73461. /**
  73462. * Fired when the mouse hover over one of the {@link #items child grid boxes}.
  73463. *
  73464. * @event boxover
  73465. */
  73466. }
  73467. /**
  73468. * A single grid box view element.
  73469. *
  73470. * This class is used to render the table size selection grid in {@link module:table/ui/inserttableview~InsertTableView}.
  73471. *
  73472. * @private
  73473. */
  73474. class TableSizeGridBoxView extends ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_0__["View"] {
  73475. /**
  73476. * @inheritDoc
  73477. */
  73478. constructor( locale, row, column ) {
  73479. super( locale );
  73480. const bind = this.bindTemplate;
  73481. /**
  73482. * Controls whether the grid box view is "on".
  73483. *
  73484. * @observable
  73485. * @member {Boolean} #isOn
  73486. */
  73487. this.set( 'isOn', false );
  73488. this.setTemplate( {
  73489. tag: 'div',
  73490. attributes: {
  73491. class: [
  73492. 'ck-insert-table-dropdown-grid-box',
  73493. bind.if( 'isOn', 'ck-on' )
  73494. ],
  73495. 'data-row': row,
  73496. 'data-column': column
  73497. }
  73498. } );
  73499. }
  73500. }
  73501. /***/ }),
  73502. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js":
  73503. /*!********************************************************************!*\
  73504. !*** ./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js ***!
  73505. \********************************************************************/
  73506. /*! exports provided: updateNumericAttribute, createEmptyTableCell, isHeadingColumnCell */
  73507. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73508. "use strict";
  73509. __webpack_require__.r(__webpack_exports__);
  73510. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateNumericAttribute", function() { return updateNumericAttribute; });
  73511. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEmptyTableCell", function() { return createEmptyTableCell; });
  73512. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHeadingColumnCell", function() { return isHeadingColumnCell; });
  73513. /**
  73514. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  73515. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73516. */
  73517. /**
  73518. * @module table/utils/common
  73519. */
  73520. /**
  73521. * A common method to update the numeric value. If a value is the default one, it will be unset.
  73522. *
  73523. * @param {String} key An attribute key.
  73524. * @param {*} value The new attribute value.
  73525. * @param {module:engine/model/item~Item} item A model item on which the attribute will be set.
  73526. * @param {module:engine/model/writer~Writer} writer
  73527. * @param {*} defaultValue The default attribute value. If a value is lower or equal, it will be unset.
  73528. */
  73529. function updateNumericAttribute( key, value, item, writer, defaultValue = 1 ) {
  73530. if ( value > defaultValue ) {
  73531. writer.setAttribute( key, value, item );
  73532. } else {
  73533. writer.removeAttribute( key, item );
  73534. }
  73535. }
  73536. /**
  73537. * A common method to create an empty table cell. It creates a proper model structure as a table cell must have at least one block inside.
  73538. *
  73539. * @param {module:engine/model/writer~Writer} writer The model writer.
  73540. * @param {module:engine/model/position~Position} insertPosition The position at which the table cell should be inserted.
  73541. * @param {Object} attributes The element attributes.
  73542. * @returns {module:engine/model/element~Element} Created table cell.
  73543. */
  73544. function createEmptyTableCell( writer, insertPosition, attributes = {} ) {
  73545. const tableCell = writer.createElement( 'tableCell', attributes );
  73546. writer.insertElement( 'paragraph', tableCell );
  73547. writer.insert( tableCell, insertPosition );
  73548. return tableCell;
  73549. }
  73550. /**
  73551. * Checks if a table cell belongs to the heading column section.
  73552. *
  73553. * @param {module:table/tableutils~TableUtils} tableUtils
  73554. * @param {module:engine/model/element~Element} tableCell
  73555. * @returns {Boolean}
  73556. */
  73557. function isHeadingColumnCell( tableUtils, tableCell ) {
  73558. const table = tableCell.parent.parent;
  73559. const headingColumns = parseInt( table.getAttribute( 'headingColumns' ) || 0 );
  73560. const { column } = tableUtils.getCellLocation( tableCell );
  73561. return !!headingColumns && column < headingColumns;
  73562. }
  73563. /***/ }),
  73564. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js":
  73565. /*!***********************************************************************!*\
  73566. !*** ./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js ***!
  73567. \***********************************************************************/
  73568. /*! exports provided: getSelectedTableCells, getTableCellsContainingSelection, getSelectionAffectedTableCells, getRowIndexes, getColumnIndexes, isSelectionRectangular, sortRanges */
  73569. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73570. "use strict";
  73571. __webpack_require__.r(__webpack_exports__);
  73572. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectedTableCells", function() { return getSelectedTableCells; });
  73573. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTableCellsContainingSelection", function() { return getTableCellsContainingSelection; });
  73574. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectionAffectedTableCells", function() { return getSelectionAffectedTableCells; });
  73575. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRowIndexes", function() { return getRowIndexes; });
  73576. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColumnIndexes", function() { return getColumnIndexes; });
  73577. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSelectionRectangular", function() { return isSelectionRectangular; });
  73578. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sortRanges", function() { return sortRanges; });
  73579. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  73580. /**
  73581. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  73582. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73583. */
  73584. /**
  73585. * @module table/utils/selection
  73586. */
  73587. /**
  73588. * Returns all model table cells that are fully selected (from the outside)
  73589. * within the provided model selection's ranges.
  73590. *
  73591. * To obtain the cells selected from the inside, use
  73592. * {@link module:table/utils/selection~getTableCellsContainingSelection}.
  73593. *
  73594. * @param {module:engine/model/selection~Selection} selection
  73595. * @returns {Array.<module:engine/model/element~Element>}
  73596. */
  73597. function getSelectedTableCells( selection ) {
  73598. const cells = [];
  73599. for ( const range of sortRanges( selection.getRanges() ) ) {
  73600. const element = range.getContainedElement();
  73601. if ( element && element.is( 'element', 'tableCell' ) ) {
  73602. cells.push( element );
  73603. }
  73604. }
  73605. return cells;
  73606. }
  73607. /**
  73608. * Returns all model table cells that the provided model selection's ranges
  73609. * {@link module:engine/model/range~Range#start} inside.
  73610. *
  73611. * To obtain the cells selected from the outside, use
  73612. * {@link module:table/utils/selection~getSelectedTableCells}.
  73613. *
  73614. * @param {module:engine/model/selection~Selection} selection
  73615. * @returns {Array.<module:engine/model/element~Element>}
  73616. */
  73617. function getTableCellsContainingSelection( selection ) {
  73618. const cells = [];
  73619. for ( const range of selection.getRanges() ) {
  73620. const cellWithSelection = range.start.findAncestor( 'tableCell' );
  73621. if ( cellWithSelection ) {
  73622. cells.push( cellWithSelection );
  73623. }
  73624. }
  73625. return cells;
  73626. }
  73627. /**
  73628. * Returns all model table cells that are either completely selected
  73629. * by selection ranges or host selection range
  73630. * {@link module:engine/model/range~Range#start start positions} inside them.
  73631. *
  73632. * Combines {@link module:table/utils/selection~getTableCellsContainingSelection} and
  73633. * {@link module:table/utils/selection~getSelectedTableCells}.
  73634. *
  73635. * @param {module:engine/model/selection~Selection} selection
  73636. * @returns {Array.<module:engine/model/element~Element>}
  73637. */
  73638. function getSelectionAffectedTableCells( selection ) {
  73639. const selectedCells = getSelectedTableCells( selection );
  73640. if ( selectedCells.length ) {
  73641. return selectedCells;
  73642. }
  73643. return getTableCellsContainingSelection( selection );
  73644. }
  73645. /**
  73646. * Returns an object with the `first` and `last` row index contained in the given `tableCells`.
  73647. *
  73648. * const selectedTableCells = getSelectedTableCells( editor.model.document.selection );
  73649. *
  73650. * const { first, last } = getRowIndexes( selectedTableCells );
  73651. *
  73652. * console.log( `Selected rows: ${ first } to ${ last }` );
  73653. *
  73654. * @param {Array.<module:engine/model/element~Element>} tableCells
  73655. * @returns {Object} Returns an object with the `first` and `last` table row indexes.
  73656. */
  73657. function getRowIndexes( tableCells ) {
  73658. const indexes = tableCells.map( cell => cell.parent.index );
  73659. return getFirstLastIndexesObject( indexes );
  73660. }
  73661. /**
  73662. * Returns an object with the `first` and `last` column index contained in the given `tableCells`.
  73663. *
  73664. * const selectedTableCells = getSelectedTableCells( editor.model.document.selection );
  73665. *
  73666. * const { first, last } = getColumnIndexes( selectedTableCells );
  73667. *
  73668. * console.log( `Selected columns: ${ first } to ${ last }` );
  73669. *
  73670. * @param {Array.<module:engine/model/element~Element>} tableCells
  73671. * @returns {Object} Returns an object with the `first` and `last` table column indexes.
  73672. */
  73673. function getColumnIndexes( tableCells ) {
  73674. const table = tableCells[ 0 ].findAncestor( 'table' );
  73675. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table ) ];
  73676. const indexes = tableMap
  73677. .filter( entry => tableCells.includes( entry.cell ) )
  73678. .map( entry => entry.column );
  73679. return getFirstLastIndexesObject( indexes );
  73680. }
  73681. /**
  73682. * Checks if the selection contains cells that do not exceed rectangular selection.
  73683. *
  73684. * In a table below:
  73685. *
  73686. * ┌───┬───┬───┬───┐
  73687. * │ a │ b │ c │ d │
  73688. * ├───┴───┼───┤ │
  73689. * │ e │ f │ │
  73690. * │ ├───┼───┤
  73691. * │ │ g │ h │
  73692. * └───────┴───┴───┘
  73693. *
  73694. * Valid selections are these which create a solid rectangle (without gaps), such as:
  73695. * - a, b (two horizontal cells)
  73696. * - c, f (two vertical cells)
  73697. * - a, b, e (cell "e" spans over four cells)
  73698. * - c, d, f (cell d spans over a cell in the row below)
  73699. *
  73700. * While an invalid selection would be:
  73701. * - a, c (the unselected cell "b" creates a gap)
  73702. * - f, g, h (cell "d" spans over a cell from the row of "f" cell - thus creates a gap)
  73703. *
  73704. * @param {Array.<module:engine/model/element~Element>} selectedTableCells
  73705. * @param {module:table/tableutils~TableUtils} tableUtils
  73706. * @returns {Boolean}
  73707. */
  73708. function isSelectionRectangular( selectedTableCells, tableUtils ) {
  73709. if ( selectedTableCells.length < 2 || !areCellInTheSameTableSection( selectedTableCells ) ) {
  73710. return false;
  73711. }
  73712. // A valid selection is a fully occupied rectangle composed of table cells.
  73713. // Below we will calculate the area of a selected table cells and the area of valid selection.
  73714. // The area of a valid selection is defined by top-left and bottom-right cells.
  73715. const rows = new Set();
  73716. const columns = new Set();
  73717. let areaOfSelectedCells = 0;
  73718. for ( const tableCell of selectedTableCells ) {
  73719. const { row, column } = tableUtils.getCellLocation( tableCell );
  73720. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  73721. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  73722. // Record row & column indexes of current cell.
  73723. rows.add( row );
  73724. columns.add( column );
  73725. // For cells that spans over multiple rows add also the last row that this cell spans over.
  73726. if ( rowspan > 1 ) {
  73727. rows.add( row + rowspan - 1 );
  73728. }
  73729. // For cells that spans over multiple columns add also the last column that this cell spans over.
  73730. if ( colspan > 1 ) {
  73731. columns.add( column + colspan - 1 );
  73732. }
  73733. areaOfSelectedCells += ( rowspan * colspan );
  73734. }
  73735. // We can only merge table cells that are in adjacent rows...
  73736. const areaOfValidSelection = getBiggestRectangleArea( rows, columns );
  73737. return areaOfValidSelection == areaOfSelectedCells;
  73738. }
  73739. /**
  73740. * Returns array of sorted ranges.
  73741. *
  73742. * @param {Iterable.<module:engine/model/range~Range>} ranges
  73743. * @return {Array.<module:engine/model/range~Range>}
  73744. */
  73745. function sortRanges( ranges ) {
  73746. return Array.from( ranges ).sort( compareRangeOrder );
  73747. }
  73748. // Helper method to get an object with `first` and `last` indexes from an unsorted array of indexes.
  73749. function getFirstLastIndexesObject( indexes ) {
  73750. const allIndexesSorted = indexes.sort( ( indexA, indexB ) => indexA - indexB );
  73751. const first = allIndexesSorted[ 0 ];
  73752. const last = allIndexesSorted[ allIndexesSorted.length - 1 ];
  73753. return { first, last };
  73754. }
  73755. function compareRangeOrder( rangeA, rangeB ) {
  73756. // Since table cell ranges are disjoint, it's enough to check their start positions.
  73757. const posA = rangeA.start;
  73758. const posB = rangeB.start;
  73759. // Checking for equal position (returning 0) is not needed because this would be either:
  73760. // a. Intersecting range (not allowed by model)
  73761. // b. Collapsed range on the same position (allowed by model but should not happen).
  73762. return posA.isBefore( posB ) ? -1 : 1;
  73763. }
  73764. // Calculates the area of a maximum rectangle that can span over the provided row & column indexes.
  73765. //
  73766. // @param {Array.<Number>} rows
  73767. // @param {Array.<Number>} columns
  73768. // @returns {Number}
  73769. function getBiggestRectangleArea( rows, columns ) {
  73770. const rowsIndexes = Array.from( rows.values() );
  73771. const columnIndexes = Array.from( columns.values() );
  73772. const lastRow = Math.max( ...rowsIndexes );
  73773. const firstRow = Math.min( ...rowsIndexes );
  73774. const lastColumn = Math.max( ...columnIndexes );
  73775. const firstColumn = Math.min( ...columnIndexes );
  73776. return ( lastRow - firstRow + 1 ) * ( lastColumn - firstColumn + 1 );
  73777. }
  73778. // Checks if the selection does not mix a header (column or row) with other cells.
  73779. //
  73780. // For instance, in the table below valid selections consist of cells with the same letter only.
  73781. // So, a-a (same heading row and column) or d-d (body cells) are valid while c-d or a-b are not.
  73782. //
  73783. // header columns
  73784. // ↓ ↓
  73785. // ┌───┬───┬───┬───┐
  73786. // │ a │ a │ b │ b │ ← header row
  73787. // ├───┼───┼───┼───┤
  73788. // │ c │ c │ d │ d │
  73789. // ├───┼───┼───┼───┤
  73790. // │ c │ c │ d │ d │
  73791. // └───┴───┴───┴───┘
  73792. function areCellInTheSameTableSection( tableCells ) {
  73793. const table = tableCells[ 0 ].findAncestor( 'table' );
  73794. const rowIndexes = getRowIndexes( tableCells );
  73795. const headingRows = parseInt( table.getAttribute( 'headingRows' ) || 0 );
  73796. // Calculating row indexes is a bit cheaper so if this check fails we can't merge.
  73797. if ( !areIndexesInSameSection( rowIndexes, headingRows ) ) {
  73798. return false;
  73799. }
  73800. const headingColumns = parseInt( table.getAttribute( 'headingColumns' ) || 0 );
  73801. const columnIndexes = getColumnIndexes( tableCells );
  73802. // Similarly cells must be in same column section.
  73803. return areIndexesInSameSection( columnIndexes, headingColumns );
  73804. }
  73805. // Unified check if table rows/columns indexes are in the same heading/body section.
  73806. function areIndexesInSameSection( { first, last }, headingSectionSize ) {
  73807. const firstCellIsInHeading = first < headingSectionSize;
  73808. const lastCellIsInHeading = last < headingSectionSize;
  73809. return firstCellIsInHeading === lastCellIsInHeading;
  73810. }
  73811. /***/ }),
  73812. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js":
  73813. /*!***********************************************************************!*\
  73814. !*** ./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js ***!
  73815. \***********************************************************************/
  73816. /*! exports provided: cropTableToDimensions, getVerticallyOverlappingCells, splitHorizontally, getHorizontallyOverlappingCells, splitVertically, trimTableCellIfNeeded, removeEmptyColumns, removeEmptyRows, removeEmptyRowsColumns, adjustLastRowIndex, adjustLastColumnIndex */
  73817. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73818. "use strict";
  73819. __webpack_require__.r(__webpack_exports__);
  73820. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cropTableToDimensions", function() { return cropTableToDimensions; });
  73821. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVerticallyOverlappingCells", function() { return getVerticallyOverlappingCells; });
  73822. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "splitHorizontally", function() { return splitHorizontally; });
  73823. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHorizontallyOverlappingCells", function() { return getHorizontallyOverlappingCells; });
  73824. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "splitVertically", function() { return splitVertically; });
  73825. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trimTableCellIfNeeded", function() { return trimTableCellIfNeeded; });
  73826. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeEmptyColumns", function() { return removeEmptyColumns; });
  73827. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeEmptyRows", function() { return removeEmptyRows; });
  73828. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeEmptyRowsColumns", function() { return removeEmptyRowsColumns; });
  73829. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjustLastRowIndex", function() { return adjustLastRowIndex; });
  73830. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjustLastColumnIndex", function() { return adjustLastColumnIndex; });
  73831. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  73832. /* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  73833. /**
  73834. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  73835. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73836. */
  73837. /**
  73838. * @module table/utils/structure
  73839. */
  73840. /**
  73841. * Returns a cropped table according to given dimensions.
  73842. * To return a cropped table that starts at first row and first column and end in third row and column:
  73843. *
  73844. * const croppedTable = cropTableToDimensions( table, {
  73845. * startRow: 1,
  73846. * endRow: 3,
  73847. * startColumn: 1,
  73848. * endColumn: 3
  73849. * }, writer );
  73850. *
  73851. * Calling the code above for the table below:
  73852. *
  73853. * 0 1 2 3 4 0 1 2
  73854. * ┌───┬───┬───┬───┬───┐
  73855. * 0 │ a │ b │ c │ d │ e │
  73856. * ├───┴───┤ ├───┴───┤ ┌───┬───┬───┐
  73857. * 1 │ f │ │ g │ │ │ │ g │ 0
  73858. * ├───┬───┴───┼───┬───┤ will return: ├───┴───┼───┤
  73859. * 2 │ h │ i │ j │ k │ │ i │ j │ 1
  73860. * ├───┤ ├───┤ │ │ ├───┤
  73861. * 3 │ l │ │ m │ │ │ │ m │ 2
  73862. * ├───┼───┬───┤ ├───┤ └───────┴───┘
  73863. * 4 │ n │ o │ p │ │ q │
  73864. * └───┴───┴───┴───┴───┘
  73865. *
  73866. * @param {module:engine/model/element~Element} sourceTable
  73867. * @param {Object} cropDimensions
  73868. * @param {Number} cropDimensions.startRow
  73869. * @param {Number} cropDimensions.startColumn
  73870. * @param {Number} cropDimensions.endRow
  73871. * @param {Number} cropDimensions.endColumn
  73872. * @param {module:engine/model/writer~Writer} writer
  73873. * @returns {module:engine/model/element~Element}
  73874. */
  73875. function cropTableToDimensions( sourceTable, cropDimensions, writer ) {
  73876. const { startRow, startColumn, endRow, endColumn } = cropDimensions;
  73877. // Create empty table with empty rows equal to crop height.
  73878. const croppedTable = writer.createElement( 'table' );
  73879. const cropHeight = endRow - startRow + 1;
  73880. for ( let i = 0; i < cropHeight; i++ ) {
  73881. writer.insertElement( 'tableRow', croppedTable, 'end' );
  73882. }
  73883. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( sourceTable, { startRow, endRow, startColumn, endColumn, includeAllSlots: true } ) ];
  73884. // Iterate over source table slots (including empty - spanned - ones).
  73885. for ( const { row: sourceRow, column: sourceColumn, cell: tableCell, isAnchor, cellAnchorRow, cellAnchorColumn } of tableMap ) {
  73886. // Row index in cropped table.
  73887. const rowInCroppedTable = sourceRow - startRow;
  73888. const row = croppedTable.getChild( rowInCroppedTable );
  73889. // For empty slots: fill the gap with empty table cell.
  73890. if ( !isAnchor ) {
  73891. // But fill the gap only if the spanning cell is anchored outside cropped area.
  73892. // In the table from method jsdoc those cells are: "c" & "f".
  73893. if ( cellAnchorRow < startRow || cellAnchorColumn < startColumn ) {
  73894. Object(_common__WEBPACK_IMPORTED_MODULE_1__["createEmptyTableCell"])( writer, writer.createPositionAt( row, 'end' ) );
  73895. }
  73896. }
  73897. // Otherwise clone the cell with all children and trim if it exceeds cropped area.
  73898. else {
  73899. const tableCellCopy = writer.cloneElement( tableCell );
  73900. writer.append( tableCellCopy, row );
  73901. // Trim table if it exceeds cropped area.
  73902. // In the table from method jsdoc those cells are: "g" & "m".
  73903. trimTableCellIfNeeded( tableCellCopy, sourceRow, sourceColumn, endRow, endColumn, writer );
  73904. }
  73905. }
  73906. // Adjust heading rows & columns in cropped table if crop selection includes headings parts.
  73907. addHeadingsToCroppedTable( croppedTable, sourceTable, startRow, startColumn, writer );
  73908. return croppedTable;
  73909. }
  73910. /**
  73911. * Returns slot info of cells that starts above and overlaps a given row.
  73912. *
  73913. * In a table below, passing `overlapRow = 3`
  73914. *
  73915. * ┌───┬───┬───┬───┬───┐
  73916. * 0 │ a │ b │ c │ d │ e │
  73917. * │ ├───┼───┼───┼───┤
  73918. * 1 │ │ f │ g │ h │ i │
  73919. * ├───┤ ├───┼───┤ │
  73920. * 2 │ j │ │ k │ l │ │
  73921. * │ │ │ ├───┼───┤
  73922. * 3 │ │ │ │ m │ n │ <- overlap row to check
  73923. * ├───┼───┤ │ ├───│
  73924. * 4 │ o │ p │ │ │ q │
  73925. * └───┴───┴───┴───┴───┘
  73926. *
  73927. * will return slot info for cells: "j", "f", "k".
  73928. *
  73929. * @param {module:engine/model/element~Element} table The table to check.
  73930. * @param {Number} overlapRow The index of the row to check.
  73931. * @param {Number} [startRow=0] A row to start analysis. Use it when it is known that the cells above that row will not overlap.
  73932. * @returns {Array.<module:table/tablewalker~TableSlot>}
  73933. */
  73934. function getVerticallyOverlappingCells( table, overlapRow, startRow = 0 ) {
  73935. const cells = [];
  73936. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { startRow, endRow: overlapRow - 1 } );
  73937. for ( const slotInfo of tableWalker ) {
  73938. const { row, cellHeight } = slotInfo;
  73939. const cellEndRow = row + cellHeight - 1;
  73940. if ( row < overlapRow && overlapRow <= cellEndRow ) {
  73941. cells.push( slotInfo );
  73942. }
  73943. }
  73944. return cells;
  73945. }
  73946. /**
  73947. * Splits the table cell horizontally.
  73948. *
  73949. * @param {module:engine/model/element~Element} tableCell
  73950. * @param {Number} splitRow
  73951. * @param {module:engine/model/writer~Writer} writer
  73952. * @returns {module:engine/model/element~Element} Created table cell.
  73953. */
  73954. function splitHorizontally( tableCell, splitRow, writer ) {
  73955. const tableRow = tableCell.parent;
  73956. const table = tableRow.parent;
  73957. const rowIndex = tableRow.index;
  73958. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) );
  73959. const newRowspan = splitRow - rowIndex;
  73960. const newCellAttributes = {};
  73961. const newCellRowSpan = rowspan - newRowspan;
  73962. if ( newCellRowSpan > 1 ) {
  73963. newCellAttributes.rowspan = newCellRowSpan;
  73964. }
  73965. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  73966. if ( colspan > 1 ) {
  73967. newCellAttributes.colspan = colspan;
  73968. }
  73969. const startRow = rowIndex;
  73970. const endRow = startRow + newRowspan;
  73971. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { startRow, endRow, includeAllSlots: true } ) ];
  73972. let newCell = null;
  73973. let columnIndex;
  73974. for ( const tableSlot of tableMap ) {
  73975. const { row, column, cell } = tableSlot;
  73976. if ( cell === tableCell && columnIndex === undefined ) {
  73977. columnIndex = column;
  73978. }
  73979. if ( columnIndex !== undefined && columnIndex === column && row === endRow ) {
  73980. newCell = Object(_common__WEBPACK_IMPORTED_MODULE_1__["createEmptyTableCell"])( writer, tableSlot.getPositionBefore(), newCellAttributes );
  73981. }
  73982. }
  73983. // Update the rowspan attribute after updating table.
  73984. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'rowspan', newRowspan, tableCell, writer );
  73985. return newCell;
  73986. }
  73987. /**
  73988. * Returns slot info of cells that starts before and overlaps a given column.
  73989. *
  73990. * In a table below, passing `overlapColumn = 3`
  73991. *
  73992. * 0 1 2 3 4
  73993. * ┌───────┬───────┬───┐
  73994. * │ a │ b │ c │
  73995. * │───┬───┴───────┼───┤
  73996. * │ d │ e │ f │
  73997. * ├───┼───┬───────┴───┤
  73998. * │ g │ h │ i │
  73999. * ├───┼───┼───┬───────┤
  74000. * │ j │ k │ l │ m │
  74001. * ├───┼───┴───┼───┬───┤
  74002. * │ n │ o │ p │ q │
  74003. * └───┴───────┴───┴───┘
  74004. * ^
  74005. * Overlap column to check
  74006. *
  74007. * will return slot info for cells: "b", "e", "i".
  74008. *
  74009. * @param {module:engine/model/element~Element} table The table to check.
  74010. * @param {Number} overlapColumn The index of the column to check.
  74011. * @returns {Array.<module:table/tablewalker~TableSlot>}
  74012. */
  74013. function getHorizontallyOverlappingCells( table, overlapColumn ) {
  74014. const cellsToSplit = [];
  74015. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table );
  74016. for ( const slotInfo of tableWalker ) {
  74017. const { column, cellWidth } = slotInfo;
  74018. const cellEndColumn = column + cellWidth - 1;
  74019. if ( column < overlapColumn && overlapColumn <= cellEndColumn ) {
  74020. cellsToSplit.push( slotInfo );
  74021. }
  74022. }
  74023. return cellsToSplit;
  74024. }
  74025. /**
  74026. * Splits the table cell vertically.
  74027. *
  74028. * @param {module:engine/model/element~Element} tableCell
  74029. * @param {Number} columnIndex The table cell column index.
  74030. * @param {Number} splitColumn The index of column to split cell on.
  74031. * @param {module:engine/model/writer~Writer} writer
  74032. * @returns {module:engine/model/element~Element} Created table cell.
  74033. */
  74034. function splitVertically( tableCell, columnIndex, splitColumn, writer ) {
  74035. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) );
  74036. const newColspan = splitColumn - columnIndex;
  74037. const newCellAttributes = {};
  74038. const newCellColSpan = colspan - newColspan;
  74039. if ( newCellColSpan > 1 ) {
  74040. newCellAttributes.colspan = newCellColSpan;
  74041. }
  74042. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  74043. if ( rowspan > 1 ) {
  74044. newCellAttributes.rowspan = rowspan;
  74045. }
  74046. const newCell = Object(_common__WEBPACK_IMPORTED_MODULE_1__["createEmptyTableCell"])( writer, writer.createPositionAfter( tableCell ), newCellAttributes );
  74047. // Update the colspan attribute after updating table.
  74048. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'colspan', newColspan, tableCell, writer );
  74049. return newCell;
  74050. }
  74051. /**
  74052. * Adjusts table cell dimensions to not exceed limit row and column.
  74053. *
  74054. * If table cell width (or height) covers a column (or row) that is after a limit column (or row)
  74055. * this method will trim "colspan" (or "rowspan") attribute so the table cell will fit in a defined limits.
  74056. *
  74057. * @param {module:engine/model/element~Element} tableCell
  74058. * @param {Number} cellRow
  74059. * @param {Number} cellColumn
  74060. * @param {Number} limitRow
  74061. * @param {Number} limitColumn
  74062. * @param {module:engine/model/writer~Writer} writer
  74063. */
  74064. function trimTableCellIfNeeded( tableCell, cellRow, cellColumn, limitRow, limitColumn, writer ) {
  74065. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  74066. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  74067. const endColumn = cellColumn + colspan - 1;
  74068. if ( endColumn > limitColumn ) {
  74069. const trimmedSpan = limitColumn - cellColumn + 1;
  74070. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'colspan', trimmedSpan, tableCell, writer, 1 );
  74071. }
  74072. const endRow = cellRow + rowspan - 1;
  74073. if ( endRow > limitRow ) {
  74074. const trimmedSpan = limitRow - cellRow + 1;
  74075. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'rowspan', trimmedSpan, tableCell, writer, 1 );
  74076. }
  74077. }
  74078. // Sets proper heading attributes to a cropped table.
  74079. function addHeadingsToCroppedTable( croppedTable, sourceTable, startRow, startColumn, writer ) {
  74080. const headingRows = parseInt( sourceTable.getAttribute( 'headingRows' ) || 0 );
  74081. if ( headingRows > 0 ) {
  74082. const headingRowsInCrop = headingRows - startRow;
  74083. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'headingRows', headingRowsInCrop, croppedTable, writer, 0 );
  74084. }
  74085. const headingColumns = parseInt( sourceTable.getAttribute( 'headingColumns' ) || 0 );
  74086. if ( headingColumns > 0 ) {
  74087. const headingColumnsInCrop = headingColumns - startColumn;
  74088. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'headingColumns', headingColumnsInCrop, croppedTable, writer, 0 );
  74089. }
  74090. }
  74091. /**
  74092. * Removes columns that have no cells anchored.
  74093. *
  74094. * In table below:
  74095. *
  74096. * +----+----+----+----+----+----+----+
  74097. * | 00 | 01 | 03 | 04 | 06 |
  74098. * +----+----+----+----+ +----+
  74099. * | 10 | 11 | 13 | | 16 |
  74100. * +----+----+----+----+----+----+----+
  74101. * | 20 | 21 | 23 | 24 | 26 |
  74102. * +----+----+----+----+----+----+----+
  74103. * ^--- empty ---^
  74104. *
  74105. * Will remove columns 2 and 5.
  74106. *
  74107. * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.
  74108. * To remove a column from a table use {@link module:table/tableutils~TableUtils#removeColumns `TableUtils.removeColumns()`}.
  74109. *
  74110. * @protected
  74111. * @param {module:engine/model/element~Element} table
  74112. * @param {module:table/tableutils~TableUtils} tableUtils
  74113. * @returns {Boolean} True if removed some columns.
  74114. */
  74115. function removeEmptyColumns( table, tableUtils ) {
  74116. const width = tableUtils.getColumns( table );
  74117. const columnsMap = new Array( width ).fill( 0 );
  74118. for ( const { column } of new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table ) ) {
  74119. columnsMap[ column ]++;
  74120. }
  74121. const emptyColumns = columnsMap.reduce( ( result, cellsCount, column ) => {
  74122. return cellsCount ? result : [ ...result, column ];
  74123. }, [] );
  74124. if ( emptyColumns.length > 0 ) {
  74125. // Remove only last empty column because it will recurrently trigger removing empty rows.
  74126. const emptyColumn = emptyColumns[ emptyColumns.length - 1 ];
  74127. // @if CK_DEBUG_TABLE // console.log( `Removing empty column: ${ emptyColumn }.` );
  74128. tableUtils.removeColumns( table, { at: emptyColumn } );
  74129. return true;
  74130. }
  74131. return false;
  74132. }
  74133. /**
  74134. * Removes rows that have no cells anchored.
  74135. *
  74136. * In table below:
  74137. *
  74138. * +----+----+----+
  74139. * | 00 | 01 | 02 |
  74140. * +----+----+----+
  74141. * | 10 | 11 | 12 |
  74142. * + + + +
  74143. * | | | | <-- empty
  74144. * +----+----+----+
  74145. * | 30 | 31 | 32 |
  74146. * +----+----+----+
  74147. * | 40 | 42 |
  74148. * + + +
  74149. * | | | <-- empty
  74150. * +----+----+----+
  74151. * | 60 | 61 | 62 |
  74152. * +----+----+----+
  74153. *
  74154. * Will remove rows 2 and 5.
  74155. *
  74156. * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.
  74157. * To remove a row from a table use {@link module:table/tableutils~TableUtils#removeRows `TableUtils.removeRows()`}.
  74158. *
  74159. * @protected
  74160. * @param {module:engine/model/element~Element} table
  74161. * @param {module:table/tableutils~TableUtils} tableUtils
  74162. * @returns {Boolean} True if removed some rows.
  74163. */
  74164. function removeEmptyRows( table, tableUtils ) {
  74165. const emptyRows = [];
  74166. const tableRowCount = tableUtils.getRows( table );
  74167. for ( let rowIndex = 0; rowIndex < tableRowCount; rowIndex++ ) {
  74168. const tableRow = table.getChild( rowIndex );
  74169. if ( tableRow.isEmpty ) {
  74170. emptyRows.push( rowIndex );
  74171. }
  74172. }
  74173. if ( emptyRows.length > 0 ) {
  74174. // Remove only last empty row because it will recurrently trigger removing empty columns.
  74175. const emptyRow = emptyRows[ emptyRows.length - 1 ];
  74176. // @if CK_DEBUG_TABLE // console.log( `Removing empty row: ${ emptyRow }.` );
  74177. tableUtils.removeRows( table, { at: emptyRow } );
  74178. return true;
  74179. }
  74180. return false;
  74181. }
  74182. /**
  74183. * Removes rows and columns that have no cells anchored.
  74184. *
  74185. * In table below:
  74186. *
  74187. * +----+----+----+----+
  74188. * | 00 | 02 |
  74189. * +----+----+ +
  74190. * | 10 | |
  74191. * +----+----+----+----+
  74192. * | 20 | 22 | 23 |
  74193. * + + + +
  74194. * | | | | <-- empty row
  74195. * +----+----+----+----+
  74196. * ^--- empty column
  74197. *
  74198. * Will remove row 3 and column 1.
  74199. *
  74200. * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.
  74201. * To remove a rows from a table use {@link module:table/tableutils~TableUtils#removeRows `TableUtils.removeRows()`} and
  74202. * {@link module:table/tableutils~TableUtils#removeColumns `TableUtils.removeColumns()`} to remove a column.
  74203. *
  74204. * @protected
  74205. * @param {module:engine/model/element~Element} table
  74206. * @param {module:table/tableutils~TableUtils} tableUtils
  74207. */
  74208. function removeEmptyRowsColumns( table, tableUtils ) {
  74209. const removedColumns = removeEmptyColumns( table, tableUtils );
  74210. // If there was some columns removed then cleaning empty rows was already triggered.
  74211. if ( !removedColumns ) {
  74212. removeEmptyRows( table, tableUtils );
  74213. }
  74214. }
  74215. /**
  74216. * Returns adjusted last row index if selection covers part of a row with empty slots (spanned by other cells).
  74217. * The `dimensions.lastRow` is equal to last row index but selection might be bigger.
  74218. *
  74219. * This happens *only* on rectangular selection so we analyze a case like this:
  74220. *
  74221. * +---+---+---+---+
  74222. * 0 | a | b | c | d |
  74223. * + + +---+---+
  74224. * 1 | | e | f | g |
  74225. * + +---+ +---+
  74226. * 2 | | h | | i | <- last row, each cell has rowspan = 2,
  74227. * + + + + + so we need to return 3, not 2
  74228. * 3 | | | | |
  74229. * +---+---+---+---+
  74230. *
  74231. * @param {module:engine/model/element~Element} table
  74232. * @param {Object} dimensions
  74233. * @param {Number} dimensions.firstRow
  74234. * @param {Number} dimensions.firstColumn
  74235. * @param {Number} dimensions.lastRow
  74236. * @param {Number} dimensions.lastColumn
  74237. * @returns {Number} Adjusted last row index.
  74238. */
  74239. function adjustLastRowIndex( table, dimensions ) {
  74240. const lastRowMap = Array.from( new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, {
  74241. startColumn: dimensions.firstColumn,
  74242. endColumn: dimensions.lastColumn,
  74243. row: dimensions.lastRow
  74244. } ) );
  74245. const everyCellHasSingleRowspan = lastRowMap.every( ( { cellHeight } ) => cellHeight === 1 );
  74246. // It is a "flat" row, so the last row index is OK.
  74247. if ( everyCellHasSingleRowspan ) {
  74248. return dimensions.lastRow;
  74249. }
  74250. // Otherwise get any cell's rowspan and adjust the last row index.
  74251. const rowspanAdjustment = lastRowMap[ 0 ].cellHeight - 1;
  74252. return dimensions.lastRow + rowspanAdjustment;
  74253. }
  74254. /**
  74255. * Returns adjusted last column index if selection covers part of a column with empty slots (spanned by other cells).
  74256. * The `dimensions.lastColumn` is equal to last column index but selection might be bigger.
  74257. *
  74258. * This happens *only* on rectangular selection so we analyze a case like this:
  74259. *
  74260. * 0 1 2 3
  74261. * +---+---+---+---+
  74262. * | a |
  74263. * +---+---+---+---+
  74264. * | b | c | d |
  74265. * +---+---+---+---+
  74266. * | e | f |
  74267. * +---+---+---+---+
  74268. * | g | h |
  74269. * +---+---+---+---+
  74270. * ^
  74271. * last column, each cell has colspan = 2, so we need to return 3, not 2
  74272. *
  74273. * @param {module:engine/model/element~Element} table
  74274. * @param {Object} dimensions
  74275. * @param {Number} dimensions.firstRow
  74276. * @param {Number} dimensions.firstColumn
  74277. * @param {Number} dimensions.lastRow
  74278. * @param {Number} dimensions.lastColumn
  74279. * @returns {Number} Adjusted last column index.
  74280. */
  74281. function adjustLastColumnIndex( table, dimensions ) {
  74282. const lastColumnMap = Array.from( new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, {
  74283. startRow: dimensions.firstRow,
  74284. endRow: dimensions.lastRow,
  74285. column: dimensions.lastColumn
  74286. } ) );
  74287. const everyCellHasSingleColspan = lastColumnMap.every( ( { cellWidth } ) => cellWidth === 1 );
  74288. // It is a "flat" column, so the last column index is OK.
  74289. if ( everyCellHasSingleColspan ) {
  74290. return dimensions.lastColumn;
  74291. }
  74292. // Otherwise get any cell's colspan and adjust the last column index.
  74293. const colspanAdjustment = lastColumnMap[ 0 ].cellWidth - 1;
  74294. return dimensions.lastColumn + colspanAdjustment;
  74295. }
  74296. /***/ }),
  74297. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/utils/ui/widget.js":
  74298. /*!***********************************************************************!*\
  74299. !*** ./node_modules/@ckeditor/ckeditor5-table/src/utils/ui/widget.js ***!
  74300. \***********************************************************************/
  74301. /*! exports provided: getSelectedTableWidget, getTableWidgetAncestor */
  74302. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74303. "use strict";
  74304. __webpack_require__.r(__webpack_exports__);
  74305. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectedTableWidget", function() { return getSelectedTableWidget; });
  74306. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTableWidgetAncestor", function() { return getTableWidgetAncestor; });
  74307. /* harmony import */ var ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/widget */ "./node_modules/ckeditor5/src/widget.js");
  74308. /**
  74309. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  74310. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  74311. */
  74312. /**
  74313. * @module table/utils/ui/widget
  74314. */
  74315. /**
  74316. * Returns a table widget editing view element if one is selected.
  74317. *
  74318. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} selection
  74319. * @returns {module:engine/view/element~Element|null}
  74320. */
  74321. function getSelectedTableWidget( selection ) {
  74322. const viewElement = selection.getSelectedElement();
  74323. if ( viewElement && isTableWidget( viewElement ) ) {
  74324. return viewElement;
  74325. }
  74326. return null;
  74327. }
  74328. /**
  74329. * Returns a table widget editing view element if one is among the selection's ancestors.
  74330. *
  74331. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} selection
  74332. * @returns {module:engine/view/element~Element|null}
  74333. */
  74334. function getTableWidgetAncestor( selection ) {
  74335. let parent = selection.getFirstPosition().parent;
  74336. while ( parent ) {
  74337. if ( parent.is( 'element' ) && isTableWidget( parent ) ) {
  74338. return parent;
  74339. }
  74340. parent = parent.parent;
  74341. }
  74342. return null;
  74343. }
  74344. // Checks if a given view element is a table widget.
  74345. //
  74346. // @param {module:engine/view/element~Element} viewElement
  74347. // @returns {Boolean}
  74348. function isTableWidget( viewElement ) {
  74349. return !!viewElement.getCustomProperty( 'table' ) && Object(ckeditor5_src_widget__WEBPACK_IMPORTED_MODULE_0__["isWidget"])( viewElement );
  74350. }
  74351. /***/ }),
  74352. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-column.svg":
  74353. /*!*****************************************************************************!*\
  74354. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-column.svg ***!
  74355. \*****************************************************************************/
  74356. /*! exports provided: default */
  74357. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74358. "use strict";
  74359. __webpack_require__.r(__webpack_exports__);
  74360. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\" opacity=\".6\"/><path d=\"M18 7v1H2V7h16zm0 5v1H2v-1h16z\" opacity=\".6\"/><path d=\"M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z\"/></svg>");
  74361. /***/ }),
  74362. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-merge-cell.svg":
  74363. /*!*********************************************************************************!*\
  74364. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-merge-cell.svg ***!
  74365. \*********************************************************************************/
  74366. /*! exports provided: default */
  74367. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74368. "use strict";
  74369. __webpack_require__.r(__webpack_exports__);
  74370. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\" opacity=\".6\"/><path d=\"M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z\" opacity=\".6\"/><path d=\"M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z\"/></svg>");
  74371. /***/ }),
  74372. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-row.svg":
  74373. /*!**************************************************************************!*\
  74374. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-row.svg ***!
  74375. \**************************************************************************/
  74376. /*! exports provided: default */
  74377. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74378. "use strict";
  74379. __webpack_require__.r(__webpack_exports__);
  74380. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\" opacity=\".6\"/><path d=\"M7 2h1v16H7V2zm5 0h1v16h-1V2z\" opacity=\".6\"/><path d=\"M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z\"/></svg>");
  74381. /***/ }),
  74382. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table.svg":
  74383. /*!**********************************************************************!*\
  74384. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/icons/table.svg ***!
  74385. \**********************************************************************/
  74386. /*! exports provided: default */
  74387. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74388. "use strict";
  74389. __webpack_require__.r(__webpack_exports__);
  74390. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3 6v3h4V6H3zm0 4v3h4v-3H3zm0 4v3h4v-3H3zm5 3h4v-3H8v3zm5 0h4v-3h-4v3zm4-4v-3h-4v3h4zm0-4V6h-4v3h4zm1.5 8a1.5 1.5 0 0 1-1.5 1.5H3A1.5 1.5 0 0 1 1.5 17V4c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5v13zM12 13v-3H8v3h4zm0-4V6H8v3h4z\"/></svg>");
  74391. /***/ }),
  74392. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css":
  74393. /*!**********************************************************************!*\
  74394. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css ***!
  74395. \**********************************************************************/
  74396. /*! exports provided: default */
  74397. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74398. "use strict";
  74399. __webpack_require__.r(__webpack_exports__);
  74400. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  74401. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  74402. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_inserttable_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./inserttable.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css");
  74403. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  74404. options.insert = "head";
  74405. options.singleton = true;
  74406. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_inserttable_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  74407. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_inserttable_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  74408. /***/ }),
  74409. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/table.css":
  74410. /*!****************************************************************!*\
  74411. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/table.css ***!
  74412. \****************************************************************/
  74413. /*! exports provided: default */
  74414. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74415. "use strict";
  74416. __webpack_require__.r(__webpack_exports__);
  74417. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  74418. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  74419. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_table_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./table.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-table/theme/table.css");
  74420. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  74421. options.insert = "head";
  74422. options.singleton = true;
  74423. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_table_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  74424. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_table_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  74425. /***/ }),
  74426. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css":
  74427. /*!***********************************************************************!*\
  74428. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css ***!
  74429. \***********************************************************************/
  74430. /*! exports provided: default */
  74431. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74432. "use strict";
  74433. __webpack_require__.r(__webpack_exports__);
  74434. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  74435. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  74436. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_tableediting_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./tableediting.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css");
  74437. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  74438. options.insert = "head";
  74439. options.singleton = true;
  74440. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_tableediting_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  74441. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_tableediting_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  74442. /***/ }),
  74443. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css":
  74444. /*!*************************************************************************!*\
  74445. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css ***!
  74446. \*************************************************************************/
  74447. /*! exports provided: default */
  74448. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74449. "use strict";
  74450. __webpack_require__.r(__webpack_exports__);
  74451. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  74452. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  74453. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_tableselection_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./tableselection.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css");
  74454. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  74455. options.insert = "head";
  74456. options.singleton = true;
  74457. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_tableselection_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  74458. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_tableselection_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  74459. /***/ }),
  74460. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/delete.js":
  74461. /*!***************************************************************!*\
  74462. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/delete.js ***!
  74463. \***************************************************************/
  74464. /*! exports provided: default */
  74465. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74466. "use strict";
  74467. __webpack_require__.r(__webpack_exports__);
  74468. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Delete; });
  74469. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  74470. /* harmony import */ var _deletecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./deletecommand */ "./node_modules/@ckeditor/ckeditor5-typing/src/deletecommand.js");
  74471. /* harmony import */ var _deleteobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./deleteobserver */ "./node_modules/@ckeditor/ckeditor5-typing/src/deleteobserver.js");
  74472. /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  74473. /**
  74474. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  74475. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  74476. */
  74477. /**
  74478. * @module typing/delete
  74479. */
  74480. /**
  74481. * The delete and backspace feature. Handles the <kbd>Delete</kbd> and <kbd>Backspace</kbd> keys in the editor.
  74482. *
  74483. * @extends module:core/plugin~Plugin
  74484. */
  74485. class Delete extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  74486. /**
  74487. * Whether pressing backspace should trigger undo action
  74488. *
  74489. * @private
  74490. * @member {Boolean} #_undoOnBackspace
  74491. */
  74492. /**
  74493. * @inheritDoc
  74494. */
  74495. static get pluginName() {
  74496. return 'Delete';
  74497. }
  74498. init() {
  74499. const editor = this.editor;
  74500. const view = editor.editing.view;
  74501. const viewDocument = view.document;
  74502. const modelDocument = editor.model.document;
  74503. view.addObserver( _deleteobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
  74504. this._undoOnBackspace = false;
  74505. const deleteForwardCommand = new _deletecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, 'forward' );
  74506. // Register `deleteForward` command and add `forwardDelete` command as an alias for backward compatibility.
  74507. editor.commands.add( 'deleteForward', deleteForwardCommand );
  74508. editor.commands.add( 'forwardDelete', deleteForwardCommand );
  74509. editor.commands.add( 'delete', new _deletecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, 'backward' ) );
  74510. this.listenTo( viewDocument, 'delete', ( evt, data ) => {
  74511. const deleteCommandParams = { unit: data.unit, sequence: data.sequence };
  74512. // If a specific (view) selection to remove was set, convert it to a model selection and set as a parameter for `DeleteCommand`.
  74513. if ( data.selectionToRemove ) {
  74514. const modelSelection = editor.model.createSelection();
  74515. const ranges = [];
  74516. for ( const viewRange of data.selectionToRemove.getRanges() ) {
  74517. ranges.push( editor.editing.mapper.toModelRange( viewRange ) );
  74518. }
  74519. modelSelection.setTo( ranges );
  74520. deleteCommandParams.selection = modelSelection;
  74521. }
  74522. editor.execute( data.direction == 'forward' ? 'deleteForward' : 'delete', deleteCommandParams );
  74523. data.preventDefault();
  74524. view.scrollToTheSelection();
  74525. }, { priority: 'low' } );
  74526. // Android IMEs have a quirk - they change DOM selection after the input changes were performed by the browser.
  74527. // This happens on `keyup` event. Android doesn't know anything about our deletion and selection handling. Even if the selection
  74528. // was changed during input events, IME remembers the position where the selection "should" be placed and moves it there.
  74529. //
  74530. // To prevent incorrect selection, we save the selection after deleting here and then re-set it on `keyup`. This has to be done
  74531. // on DOM selection level, because on `keyup` the model selection is still the same as it was just after deletion, so it
  74532. // wouldn't be changed and the fix would do nothing.
  74533. //
  74534. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_3__["default"].isAndroid ) {
  74535. let domSelectionAfterDeletion = null;
  74536. this.listenTo( viewDocument, 'delete', ( evt, data ) => {
  74537. const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
  74538. domSelectionAfterDeletion = {
  74539. anchorNode: domSelection.anchorNode,
  74540. anchorOffset: domSelection.anchorOffset,
  74541. focusNode: domSelection.focusNode,
  74542. focusOffset: domSelection.focusOffset
  74543. };
  74544. }, { priority: 'lowest' } );
  74545. this.listenTo( viewDocument, 'keyup', ( evt, data ) => {
  74546. if ( domSelectionAfterDeletion ) {
  74547. const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
  74548. domSelection.collapse( domSelectionAfterDeletion.anchorNode, domSelectionAfterDeletion.anchorOffset );
  74549. domSelection.extend( domSelectionAfterDeletion.focusNode, domSelectionAfterDeletion.focusOffset );
  74550. domSelectionAfterDeletion = null;
  74551. }
  74552. } );
  74553. }
  74554. if ( this.editor.plugins.has( 'UndoEditing' ) ) {
  74555. this.listenTo( viewDocument, 'delete', ( evt, data ) => {
  74556. if ( this._undoOnBackspace && data.direction == 'backward' && data.sequence == 1 && data.unit == 'codePoint' ) {
  74557. this._undoOnBackspace = false;
  74558. editor.execute( 'undo' );
  74559. data.preventDefault();
  74560. evt.stop();
  74561. }
  74562. }, { context: '$capture' } );
  74563. this.listenTo( modelDocument, 'change', () => {
  74564. this._undoOnBackspace = false;
  74565. } );
  74566. }
  74567. }
  74568. /**
  74569. * If the next user action after calling this method is pressing backspace, it would undo the last change.
  74570. *
  74571. * Requires {@link module:undo/undoediting~UndoEditing} plugin. If not loaded, does nothing.
  74572. */
  74573. requestUndoOnBackspace() {
  74574. if ( this.editor.plugins.has( 'UndoEditing' ) ) {
  74575. this._undoOnBackspace = true;
  74576. }
  74577. }
  74578. }
  74579. /***/ }),
  74580. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/deletecommand.js":
  74581. /*!**********************************************************************!*\
  74582. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/deletecommand.js ***!
  74583. \**********************************************************************/
  74584. /*! exports provided: default */
  74585. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74586. "use strict";
  74587. __webpack_require__.r(__webpack_exports__);
  74588. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DeleteCommand; });
  74589. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  74590. /* harmony import */ var _ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/count */ "./node_modules/@ckeditor/ckeditor5-utils/src/count.js");
  74591. /* harmony import */ var _utils_changebuffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/changebuffer */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js");
  74592. /**
  74593. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  74594. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  74595. */
  74596. /**
  74597. * @module typing/deletecommand
  74598. */
  74599. /**
  74600. * The delete command. Used by the {@link module:typing/delete~Delete delete feature} to handle the <kbd>Delete</kbd> and
  74601. * <kbd>Backspace</kbd> keys.
  74602. *
  74603. * @extends module:core/command~Command
  74604. */
  74605. class DeleteCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  74606. /**
  74607. * Creates an instance of the command.
  74608. *
  74609. * @param {module:core/editor/editor~Editor} editor
  74610. * @param {'forward'|'backward'} direction The directionality of the delete describing in what direction it
  74611. * should consume the content when the selection is collapsed.
  74612. */
  74613. constructor( editor, direction ) {
  74614. super( editor );
  74615. /**
  74616. * The directionality of the delete describing in what direction it should
  74617. * consume the content when the selection is collapsed.
  74618. *
  74619. * @readonly
  74620. * @member {'forward'|'backward'} #direction
  74621. */
  74622. this.direction = direction;
  74623. /**
  74624. * Delete's change buffer used to group subsequent changes into batches.
  74625. *
  74626. * @readonly
  74627. * @private
  74628. * @type {module:typing/utils/changebuffer~ChangeBuffer}
  74629. */
  74630. this._buffer = new _utils_changebuffer__WEBPACK_IMPORTED_MODULE_2__["default"]( editor.model, editor.config.get( 'typing.undoStep' ) );
  74631. }
  74632. /**
  74633. * The current change buffer.
  74634. *
  74635. * @type {module:typing/utils/changebuffer~ChangeBuffer}
  74636. */
  74637. get buffer() {
  74638. return this._buffer;
  74639. }
  74640. /**
  74641. * Executes the delete command. Depending on whether the selection is collapsed or not, deletes its content
  74642. * or a piece of content in the {@link #direction defined direction}.
  74643. *
  74644. * @fires execute
  74645. * @param {Object} [options] The command options.
  74646. * @param {'character'} [options.unit='character'] See {@link module:engine/model/utils/modifyselection~modifySelection}'s options.
  74647. * @param {Number} [options.sequence=1] A number describing which subsequent delete event it is without the key being released.
  74648. * See the {@link module:engine/view/document~Document#event:delete} event data.
  74649. * @param {module:engine/model/selection~Selection} [options.selection] Selection to remove. If not set, current model selection
  74650. * will be used.
  74651. */
  74652. execute( options = {} ) {
  74653. const model = this.editor.model;
  74654. const doc = model.document;
  74655. model.enqueueChange( this._buffer.batch, writer => {
  74656. this._buffer.lock();
  74657. const selection = writer.createSelection( options.selection || doc.selection );
  74658. const sequence = options.sequence || 1;
  74659. // Do not replace the whole selected content if selection was collapsed.
  74660. // This prevents such situation:
  74661. //
  74662. // <h1></h1><p>[]</p> --> <h1>[</h1><p>]</p> --> <p></p>
  74663. // starting content --> after `modifySelection` --> after `deleteContent`.
  74664. const doNotResetEntireContent = selection.isCollapsed;
  74665. // Try to extend the selection in the specified direction.
  74666. if ( selection.isCollapsed ) {
  74667. model.modifySelection( selection, { direction: this.direction, unit: options.unit } );
  74668. }
  74669. // Check if deleting in an empty editor. See #61.
  74670. if ( this._shouldEntireContentBeReplacedWithParagraph( sequence ) ) {
  74671. this._replaceEntireContentWithParagraph( writer );
  74672. return;
  74673. }
  74674. // Check if deleting in the first empty block.
  74675. // See https://github.com/ckeditor/ckeditor5/issues/8137.
  74676. if ( this._shouldReplaceFirstBlockWithParagraph( selection, sequence ) ) {
  74677. this.editor.execute( 'paragraph', { selection } );
  74678. return;
  74679. }
  74680. // If selection is still collapsed, then there's nothing to delete.
  74681. if ( selection.isCollapsed ) {
  74682. return;
  74683. }
  74684. let changeCount = 0;
  74685. selection.getFirstRange().getMinimalFlatRanges().forEach( range => {
  74686. changeCount += Object(_ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_1__["default"])(
  74687. range.getWalker( { singleCharacters: true, ignoreElementEnd: true, shallow: true } )
  74688. );
  74689. } );
  74690. model.deleteContent( selection, {
  74691. doNotResetEntireContent,
  74692. direction: this.direction
  74693. } );
  74694. this._buffer.input( changeCount );
  74695. writer.setSelection( selection );
  74696. this._buffer.unlock();
  74697. } );
  74698. }
  74699. /**
  74700. * If the user keeps <kbd>Backspace</kbd> or <kbd>Delete</kbd> key pressed, the content of the current
  74701. * editable will be cleared. However, this will not yet lead to resetting the remaining block to a paragraph
  74702. * (which happens e.g. when the user does <kbd>Ctrl</kbd> + <kbd>A</kbd>, <kbd>Backspace</kbd>).
  74703. *
  74704. * But, if the user pressed the key in an empty editable for the first time,
  74705. * we want to replace the entire content with a paragraph if:
  74706. *
  74707. * * the current limit element is empty,
  74708. * * the paragraph is allowed in the limit element,
  74709. * * the limit doesn't already have a paragraph inside.
  74710. *
  74711. * See https://github.com/ckeditor/ckeditor5-typing/issues/61.
  74712. *
  74713. * @private
  74714. * @param {Number} sequence A number describing which subsequent delete event it is without the key being released.
  74715. * @returns {Boolean}
  74716. */
  74717. _shouldEntireContentBeReplacedWithParagraph( sequence ) {
  74718. // Does nothing if user pressed and held the "Backspace" or "Delete" key.
  74719. if ( sequence > 1 ) {
  74720. return false;
  74721. }
  74722. const model = this.editor.model;
  74723. const doc = model.document;
  74724. const selection = doc.selection;
  74725. const limitElement = model.schema.getLimitElement( selection );
  74726. // If a collapsed selection contains the whole content it means that the content is empty
  74727. // (from the user perspective).
  74728. const limitElementIsEmpty = selection.isCollapsed && selection.containsEntireContent( limitElement );
  74729. if ( !limitElementIsEmpty ) {
  74730. return false;
  74731. }
  74732. if ( !model.schema.checkChild( limitElement, 'paragraph' ) ) {
  74733. return false;
  74734. }
  74735. const limitElementFirstChild = limitElement.getChild( 0 );
  74736. // Does nothing if the limit element already contains only a paragraph.
  74737. // We ignore the case when paragraph might have some inline elements (<p><inlineWidget>[]</inlineWidget></p>)
  74738. // because we don't support such cases yet and it's unclear whether inlineWidget shouldn't be a limit itself.
  74739. if ( limitElementFirstChild && limitElementFirstChild.name === 'paragraph' ) {
  74740. return false;
  74741. }
  74742. return true;
  74743. }
  74744. /**
  74745. * The entire content is replaced with the paragraph. Selection is moved inside the paragraph.
  74746. *
  74747. * @private
  74748. * @param {module:engine/model/writer~Writer} writer The model writer.
  74749. */
  74750. _replaceEntireContentWithParagraph( writer ) {
  74751. const model = this.editor.model;
  74752. const doc = model.document;
  74753. const selection = doc.selection;
  74754. const limitElement = model.schema.getLimitElement( selection );
  74755. const paragraph = writer.createElement( 'paragraph' );
  74756. writer.remove( writer.createRangeIn( limitElement ) );
  74757. writer.insert( paragraph, limitElement );
  74758. writer.setSelection( paragraph, 0 );
  74759. }
  74760. /**
  74761. * Checks if the selection is inside an empty element that is the first child of the limit element
  74762. * and should be replaced with a paragraph.
  74763. *
  74764. * @private
  74765. * @param {module:engine/model/selection~Selection} selection The selection.
  74766. * @param {Number} sequence A number describing which subsequent delete event it is without the key being released.
  74767. * @returns {Boolean}
  74768. */
  74769. _shouldReplaceFirstBlockWithParagraph( selection, sequence ) {
  74770. const model = this.editor.model;
  74771. // Does nothing if user pressed and held the "Backspace" key or it was a "Delete" button.
  74772. if ( sequence > 1 || this.direction != 'backward' ) {
  74773. return false;
  74774. }
  74775. if ( !selection.isCollapsed ) {
  74776. return false;
  74777. }
  74778. const position = selection.getFirstPosition();
  74779. const limitElement = model.schema.getLimitElement( position );
  74780. const limitElementFirstChild = limitElement.getChild( 0 );
  74781. // Only elements that are direct children of the limit element can be replaced.
  74782. // Unwrapping from a block quote should be handled in a dedicated feature.
  74783. if ( position.parent != limitElementFirstChild ) {
  74784. return false;
  74785. }
  74786. // A block should be replaced only if it was empty.
  74787. if ( !selection.containsEntireContent( limitElementFirstChild ) ) {
  74788. return false;
  74789. }
  74790. // Replace with a paragraph only if it's allowed there.
  74791. if ( !model.schema.checkChild( limitElement, 'paragraph' ) ) {
  74792. return false;
  74793. }
  74794. // Does nothing if the limit element already contains only a paragraph.
  74795. if ( limitElementFirstChild.name == 'paragraph' ) {
  74796. return false;
  74797. }
  74798. return true;
  74799. }
  74800. }
  74801. /***/ }),
  74802. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/deleteobserver.js":
  74803. /*!***********************************************************************!*\
  74804. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/deleteobserver.js ***!
  74805. \***********************************************************************/
  74806. /*! exports provided: default */
  74807. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74808. "use strict";
  74809. __webpack_require__.r(__webpack_exports__);
  74810. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DeleteObserver; });
  74811. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  74812. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/domeventdata */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js");
  74813. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_bubblingeventinfo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js");
  74814. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  74815. /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  74816. /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/utils */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/utils.js");
  74817. /**
  74818. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  74819. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  74820. */
  74821. /**
  74822. * @module typing/deleteobserver
  74823. */
  74824. /**
  74825. * Delete observer introduces the {@link module:engine/view/document~Document#event:delete} event.
  74826. *
  74827. * @extends module:engine/view/observer/observer~Observer
  74828. */
  74829. class DeleteObserver extends _ckeditor_ckeditor5_engine_src_view_observer_observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  74830. /**
  74831. * @inheritDoc
  74832. */
  74833. constructor( view ) {
  74834. super( view );
  74835. const document = view.document;
  74836. let sequence = 0;
  74837. document.on( 'keyup', ( evt, data ) => {
  74838. if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].delete || data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].backspace ) {
  74839. sequence = 0;
  74840. }
  74841. } );
  74842. document.on( 'keydown', ( evt, data ) => {
  74843. // Do not fire the `delete` event, if Shift + Delete key combination was pressed on a non-collapsed selection on Windows.
  74844. //
  74845. // The Shift + Delete key combination should work in the same way as the `cut` event on a non-collapsed selection on Windows.
  74846. // In fact, the native `cut` event is actually emitted in this case, but with lower priority. Therefore, in order to handle the
  74847. // Shift + Delete key combination correctly, it is enough not to emit the `delete` event.
  74848. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_4__["default"].isWindows && Object(_utils_utils__WEBPACK_IMPORTED_MODULE_5__["isShiftDeleteOnNonCollapsedSelection"])( data, document ) ) {
  74849. return;
  74850. }
  74851. const deleteData = {};
  74852. if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].delete ) {
  74853. deleteData.direction = 'forward';
  74854. deleteData.unit = 'character';
  74855. } else if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].backspace ) {
  74856. deleteData.direction = 'backward';
  74857. deleteData.unit = 'codePoint';
  74858. } else {
  74859. return;
  74860. }
  74861. const hasWordModifier = _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_4__["default"].isMac ? data.altKey : data.ctrlKey;
  74862. deleteData.unit = hasWordModifier ? 'word' : deleteData.unit;
  74863. deleteData.sequence = ++sequence;
  74864. fireViewDeleteEvent( evt, data.domEvent, deleteData );
  74865. } );
  74866. // `beforeinput` is handled only for Android devices. Desktop Chrome and iOS are skipped because they are working fine now.
  74867. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_4__["default"].isAndroid ) {
  74868. document.on( 'beforeinput', ( evt, data ) => {
  74869. // If event type is other than `deleteContentBackward` then this is not deleting.
  74870. if ( data.domEvent.inputType != 'deleteContentBackward' ) {
  74871. return;
  74872. }
  74873. const deleteData = {
  74874. unit: 'codepoint',
  74875. direction: 'backward',
  74876. sequence: 1
  74877. };
  74878. // Android IMEs may change the DOM selection on `beforeinput` event so that the selection contains all the text
  74879. // that the IME wants to remove. We will pass this information to `delete` event so proper part of the content is removed.
  74880. //
  74881. // Sometimes it is only expanding by a one character (in case of collapsed selection). In this case we don't need to
  74882. // set a different selection to remove, it will work just fine.
  74883. const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
  74884. if ( domSelection.anchorNode == domSelection.focusNode && domSelection.anchorOffset + 1 != domSelection.focusOffset ) {
  74885. deleteData.selectionToRemove = view.domConverter.domSelectionToView( domSelection );
  74886. }
  74887. fireViewDeleteEvent( evt, data.domEvent, deleteData );
  74888. } );
  74889. }
  74890. function fireViewDeleteEvent( originalEvent, domEvent, deleteData ) {
  74891. const event = new _ckeditor_ckeditor5_engine_src_view_observer_bubblingeventinfo__WEBPACK_IMPORTED_MODULE_2__["default"]( document, 'delete', document.selection.getFirstRange() );
  74892. document.fire( event, new _ckeditor_ckeditor5_engine_src_view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_1__["default"]( document, domEvent, deleteData ) );
  74893. // Stop the original event if `delete` event was stopped.
  74894. // https://github.com/ckeditor/ckeditor5/issues/753
  74895. if ( event.stop.called ) {
  74896. originalEvent.stop();
  74897. }
  74898. }
  74899. }
  74900. /**
  74901. * @inheritDoc
  74902. */
  74903. observe() {}
  74904. }
  74905. /**
  74906. * Event fired when the user tries to delete content (e.g. presses <kbd>Delete</kbd> or <kbd>Backspace</kbd>).
  74907. *
  74908. * Note: This event is fired by the {@link module:typing/deleteobserver~DeleteObserver observer}
  74909. * (usually registered by the {@link module:typing/delete~Delete delete feature}).
  74910. *
  74911. * @event module:engine/view/document~Document#event:delete
  74912. * @param {module:engine/view/observer/domeventdata~DomEventData} data
  74913. * @param {'forward'|'delete'} data.direction The direction in which the deletion should happen.
  74914. * @param {'character'|'codePoint'|'word'} data.unit The "amount" of content that should be deleted.
  74915. * @param {Number} data.sequence A number describing which subsequent delete event it is without the key being released.
  74916. * If it's 2 or more it means that the key was pressed and hold.
  74917. * @param {module:engine/view/selection~Selection} [data.selectionToRemove] View selection which content should be removed. If not set,
  74918. * current selection should be used.
  74919. */
  74920. /***/ }),
  74921. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/index.js":
  74922. /*!**************************************************************!*\
  74923. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/index.js ***!
  74924. \**************************************************************/
  74925. /*! exports provided: Typing, Input, Delete, TextWatcher, TwoStepCaretMovement, TextTransformation, inlineHighlight, findAttributeRange, getLastTextLine, isNonTypingKeystroke */
  74926. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74927. "use strict";
  74928. __webpack_require__.r(__webpack_exports__);
  74929. /* harmony import */ var _typing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typing */ "./node_modules/@ckeditor/ckeditor5-typing/src/typing.js");
  74930. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Typing", function() { return _typing__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  74931. /* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./input */ "./node_modules/@ckeditor/ckeditor5-typing/src/input.js");
  74932. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return _input__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  74933. /* harmony import */ var _delete__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./delete */ "./node_modules/@ckeditor/ckeditor5-typing/src/delete.js");
  74934. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Delete", function() { return _delete__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  74935. /* harmony import */ var _textwatcher__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./textwatcher */ "./node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js");
  74936. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextWatcher", function() { return _textwatcher__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  74937. /* harmony import */ var _twostepcaretmovement__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./twostepcaretmovement */ "./node_modules/@ckeditor/ckeditor5-typing/src/twostepcaretmovement.js");
  74938. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TwoStepCaretMovement", function() { return _twostepcaretmovement__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  74939. /* harmony import */ var _texttransformation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./texttransformation */ "./node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js");
  74940. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextTransformation", function() { return _texttransformation__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  74941. /* harmony import */ var _utils_inlinehighlight__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/inlinehighlight */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.js");
  74942. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "inlineHighlight", function() { return _utils_inlinehighlight__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  74943. /* harmony import */ var _utils_findattributerange__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/findattributerange */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js");
  74944. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findAttributeRange", function() { return _utils_findattributerange__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  74945. /* harmony import */ var _utils_getlasttextline__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/getlasttextline */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js");
  74946. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLastTextLine", function() { return _utils_getlasttextline__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  74947. /* harmony import */ var _utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/injectunsafekeystrokeshandling */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js");
  74948. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNonTypingKeystroke", function() { return _utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_9__["isNonTypingKeystroke"]; });
  74949. /**
  74950. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  74951. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  74952. */
  74953. /**
  74954. * @module typing
  74955. */
  74956. /***/ }),
  74957. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/input.js":
  74958. /*!**************************************************************!*\
  74959. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/input.js ***!
  74960. \**************************************************************/
  74961. /*! exports provided: default */
  74962. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74963. "use strict";
  74964. __webpack_require__.r(__webpack_exports__);
  74965. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Input; });
  74966. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  74967. /* harmony import */ var _inputcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inputcommand */ "./node_modules/@ckeditor/ckeditor5-typing/src/inputcommand.js");
  74968. /* harmony import */ var _utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/injectunsafekeystrokeshandling */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js");
  74969. /* harmony import */ var _utils_injecttypingmutationshandling__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/injecttypingmutationshandling */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injecttypingmutationshandling.js");
  74970. /**
  74971. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  74972. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  74973. */
  74974. /**
  74975. * @module typing/input
  74976. */
  74977. /**
  74978. * Handles text input coming from the keyboard or other input methods.
  74979. *
  74980. * @extends module:core/plugin~Plugin
  74981. */
  74982. class Input extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  74983. /**
  74984. * @inheritDoc
  74985. */
  74986. static get pluginName() {
  74987. return 'Input';
  74988. }
  74989. /**
  74990. * @inheritDoc
  74991. */
  74992. init() {
  74993. const editor = this.editor;
  74994. // TODO The above default configuration value should be defined using editor.config.define() once it's fixed.
  74995. const inputCommand = new _inputcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, editor.config.get( 'typing.undoStep' ) || 20 );
  74996. editor.commands.add( 'input', inputCommand );
  74997. Object(_utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_2__["default"])( editor );
  74998. Object(_utils_injecttypingmutationshandling__WEBPACK_IMPORTED_MODULE_3__["default"])( editor );
  74999. }
  75000. /**
  75001. * Checks batch if it is a result of user input - e.g. typing.
  75002. *
  75003. * const input = editor.plugins.get( 'Input' );
  75004. *
  75005. * editor.model.document.on( 'change:data', ( evt, batch ) => {
  75006. * if ( input.isInput( batch ) ) {
  75007. * console.log( 'The user typed something...' );
  75008. * }
  75009. * } );
  75010. *
  75011. * **Note:** This method checks if the batch was created using {@link module:typing/inputcommand~InputCommand 'input'}
  75012. * command as typing changes coming from user input are inserted to the document using that command.
  75013. *
  75014. * @param {module:engine/model/batch~Batch} batch A batch to check.
  75015. * @returns {Boolean}
  75016. */
  75017. isInput( batch ) {
  75018. const inputCommand = this.editor.commands.get( 'input' );
  75019. return inputCommand._batches.has( batch );
  75020. }
  75021. }
  75022. /***/ }),
  75023. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/inputcommand.js":
  75024. /*!*********************************************************************!*\
  75025. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/inputcommand.js ***!
  75026. \*********************************************************************/
  75027. /*! exports provided: default */
  75028. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75029. "use strict";
  75030. __webpack_require__.r(__webpack_exports__);
  75031. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InputCommand; });
  75032. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  75033. /* harmony import */ var _utils_changebuffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/changebuffer */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js");
  75034. /**
  75035. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  75036. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  75037. */
  75038. /**
  75039. * @module typing/inputcommand
  75040. */
  75041. /**
  75042. * The input command. Used by the {@link module:typing/input~Input input feature} to handle typing.
  75043. *
  75044. * @extends module:core/command~Command
  75045. */
  75046. class InputCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  75047. /**
  75048. * Creates an instance of the command.
  75049. *
  75050. * @param {module:core/editor/editor~Editor} editor
  75051. * @param {Number} undoStepSize The maximum number of atomic changes
  75052. * which can be contained in one batch in the command buffer.
  75053. */
  75054. constructor( editor, undoStepSize ) {
  75055. super( editor );
  75056. /**
  75057. * Typing's change buffer used to group subsequent changes into batches.
  75058. *
  75059. * @readonly
  75060. * @private
  75061. * @member {module:typing/utils/changebuffer~ChangeBuffer} #_buffer
  75062. */
  75063. this._buffer = new _utils_changebuffer__WEBPACK_IMPORTED_MODULE_1__["default"]( editor.model, undoStepSize );
  75064. /**
  75065. * Stores batches created by the input command. The batches are used to differentiate input batches from other batches using
  75066. * {@link module:typing/input~Input#isInput} method.
  75067. *
  75068. * @type {WeakSet<module:engine/model/batch~Batch>}
  75069. * @protected
  75070. */
  75071. this._batches = new WeakSet();
  75072. }
  75073. /**
  75074. * The current change buffer.
  75075. *
  75076. * @type {module:typing/utils/changebuffer~ChangeBuffer}
  75077. */
  75078. get buffer() {
  75079. return this._buffer;
  75080. }
  75081. /**
  75082. * @inheritDoc
  75083. */
  75084. destroy() {
  75085. super.destroy();
  75086. this._buffer.destroy();
  75087. }
  75088. /**
  75089. * Executes the input command. It replaces the content within the given range with the given text.
  75090. * Replacing is a two step process, first the content within the range is removed and then the new text is inserted
  75091. * at the beginning of the range (which after the removal is a collapsed range).
  75092. *
  75093. * @fires execute
  75094. * @param {Object} [options] The command options.
  75095. * @param {String} [options.text=''] The text to be inserted.
  75096. * @param {module:engine/model/range~Range} [options.range] The range in which the text is inserted. Defaults
  75097. * to the first range in the current selection.
  75098. * @param {module:engine/model/range~Range} [options.resultRange] The range where the selection
  75099. * should be placed after the insertion. If not specified, the selection will be placed right after
  75100. * the inserted text.
  75101. */
  75102. execute( options = {} ) {
  75103. const model = this.editor.model;
  75104. const doc = model.document;
  75105. const text = options.text || '';
  75106. const textInsertions = text.length;
  75107. const selection = options.range ? model.createSelection( options.range ) : doc.selection;
  75108. const resultRange = options.resultRange;
  75109. model.enqueueChange( this._buffer.batch, writer => {
  75110. this._buffer.lock();
  75111. // Store the batch as an 'input' batch for the Input.isInput( batch ) check.
  75112. this._batches.add( this._buffer.batch );
  75113. model.deleteContent( selection );
  75114. if ( text ) {
  75115. model.insertContent( writer.createText( text, doc.selection.getAttributes() ), selection );
  75116. }
  75117. if ( resultRange ) {
  75118. writer.setSelection( resultRange );
  75119. } else if ( !selection.is( 'documentSelection' ) ) {
  75120. writer.setSelection( selection );
  75121. }
  75122. this._buffer.unlock();
  75123. this._buffer.input( textInsertions );
  75124. } );
  75125. }
  75126. }
  75127. /***/ }),
  75128. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js":
  75129. /*!***************************************************************************!*\
  75130. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js ***!
  75131. \***************************************************************************/
  75132. /*! exports provided: default */
  75133. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75134. "use strict";
  75135. __webpack_require__.r(__webpack_exports__);
  75136. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextTransformation; });
  75137. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  75138. /* harmony import */ var _textwatcher__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./textwatcher */ "./node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js");
  75139. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  75140. /**
  75141. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  75142. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  75143. */
  75144. /**
  75145. * @module typing/texttransformation
  75146. */
  75147. // All named transformations.
  75148. const TRANSFORMATIONS = {
  75149. // Common symbols:
  75150. copyright: { from: '(c)', to: '©' },
  75151. registeredTrademark: { from: '(r)', to: '®' },
  75152. trademark: { from: '(tm)', to: '™' },
  75153. // Mathematical:
  75154. oneHalf: { from: /(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i, to: [ null, '½', null ] },
  75155. oneThird: { from: /(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i, to: [ null, '⅓', null ] },
  75156. twoThirds: { from: /(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i, to: [ null, '⅔', null ] },
  75157. oneForth: { from: /(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i, to: [ null, '¼', null ] },
  75158. threeQuarters: { from: /(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i, to: [ null, '¾', null ] },
  75159. lessThanOrEqual: { from: '<=', to: '≤' },
  75160. greaterThanOrEqual: { from: '>=', to: '≥' },
  75161. notEqual: { from: '!=', to: '≠' },
  75162. arrowLeft: { from: '<-', to: '←' },
  75163. arrowRight: { from: '->', to: '→' },
  75164. // Typography:
  75165. horizontalEllipsis: { from: '...', to: '…' },
  75166. enDash: { from: /(^| )(--)( )$/, to: [ null, '–', null ] },
  75167. emDash: { from: /(^| )(---)( )$/, to: [ null, '—', null ] },
  75168. // Quotations:
  75169. // English, US
  75170. quotesPrimary: { from: buildQuotesRegExp( '"' ), to: [ null, '“', null, '”' ] },
  75171. quotesSecondary: { from: buildQuotesRegExp( '\'' ), to: [ null, '‘', null, '’' ] },
  75172. // English, UK
  75173. quotesPrimaryEnGb: { from: buildQuotesRegExp( '\'' ), to: [ null, '‘', null, '’' ] },
  75174. quotesSecondaryEnGb: { from: buildQuotesRegExp( '"' ), to: [ null, '“', null, '”' ] },
  75175. // Polish
  75176. quotesPrimaryPl: { from: buildQuotesRegExp( '"' ), to: [ null, '„', null, '”' ] },
  75177. quotesSecondaryPl: { from: buildQuotesRegExp( '\'' ), to: [ null, '‚', null, '’' ] }
  75178. };
  75179. // Transformation groups.
  75180. const TRANSFORMATION_GROUPS = {
  75181. symbols: [ 'copyright', 'registeredTrademark', 'trademark' ],
  75182. mathematical: [
  75183. 'oneHalf', 'oneThird', 'twoThirds', 'oneForth', 'threeQuarters',
  75184. 'lessThanOrEqual', 'greaterThanOrEqual', 'notEqual',
  75185. 'arrowLeft', 'arrowRight'
  75186. ],
  75187. typography: [ 'horizontalEllipsis', 'enDash', 'emDash' ],
  75188. quotes: [ 'quotesPrimary', 'quotesSecondary' ]
  75189. };
  75190. // A set of default transformations provided by the feature.
  75191. const DEFAULT_TRANSFORMATIONS = [
  75192. 'symbols',
  75193. 'mathematical',
  75194. 'typography',
  75195. 'quotes'
  75196. ];
  75197. /**
  75198. * The text transformation plugin.
  75199. *
  75200. * @extends module:core/plugin~Plugin
  75201. */
  75202. class TextTransformation extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  75203. /**
  75204. * @inheritDoc
  75205. */
  75206. static get requires() {
  75207. return [ 'Delete', 'Input' ];
  75208. }
  75209. /**
  75210. * @inheritDoc
  75211. */
  75212. static get pluginName() {
  75213. return 'TextTransformation';
  75214. }
  75215. /**
  75216. * @inheritDoc
  75217. */
  75218. constructor( editor ) {
  75219. super( editor );
  75220. editor.config.define( 'typing', {
  75221. transformations: {
  75222. include: DEFAULT_TRANSFORMATIONS
  75223. }
  75224. } );
  75225. }
  75226. /**
  75227. * @inheritDoc
  75228. */
  75229. init() {
  75230. const model = this.editor.model;
  75231. const modelSelection = model.document.selection;
  75232. modelSelection.on( 'change:range', () => {
  75233. // Disable plugin when selection is inside a code block.
  75234. this.isEnabled = !modelSelection.anchor.parent.is( 'element', 'codeBlock' );
  75235. } );
  75236. this._enableTransformationWatchers();
  75237. }
  75238. /**
  75239. * Create new TextWatcher listening to the editor for typing and selection events.
  75240. *
  75241. * @private
  75242. */
  75243. _enableTransformationWatchers() {
  75244. const editor = this.editor;
  75245. const model = editor.model;
  75246. const inputPlugin = editor.plugins.get( 'Input' );
  75247. const deletePlugin = editor.plugins.get( 'Delete' );
  75248. const normalizedTransformations = normalizeTransformations( editor.config.get( 'typing.transformations' ) );
  75249. const testCallback = text => {
  75250. for ( const normalizedTransformation of normalizedTransformations ) {
  75251. const from = normalizedTransformation.from;
  75252. const match = from.test( text );
  75253. if ( match ) {
  75254. return { normalizedTransformation };
  75255. }
  75256. }
  75257. };
  75258. const watcherCallback = ( evt, data ) => {
  75259. if ( !inputPlugin.isInput( data.batch ) ) {
  75260. return;
  75261. }
  75262. const { from, to } = data.normalizedTransformation;
  75263. const matches = from.exec( data.text );
  75264. const replaces = to( matches.slice( 1 ) );
  75265. const matchedRange = data.range;
  75266. let changeIndex = matches.index;
  75267. model.enqueueChange( writer => {
  75268. for ( let i = 1; i < matches.length; i++ ) {
  75269. const match = matches[ i ];
  75270. const replaceWith = replaces[ i - 1 ];
  75271. if ( replaceWith == null ) {
  75272. changeIndex += match.length;
  75273. continue;
  75274. }
  75275. const replacePosition = matchedRange.start.getShiftedBy( changeIndex );
  75276. const replaceRange = model.createRange( replacePosition, replacePosition.getShiftedBy( match.length ) );
  75277. const attributes = getTextAttributesAfterPosition( replacePosition );
  75278. model.insertContent( writer.createText( replaceWith, attributes ), replaceRange );
  75279. changeIndex += replaceWith.length;
  75280. }
  75281. model.enqueueChange( () => {
  75282. deletePlugin.requestUndoOnBackspace();
  75283. } );
  75284. } );
  75285. };
  75286. const watcher = new _textwatcher__WEBPACK_IMPORTED_MODULE_1__["default"]( editor.model, testCallback );
  75287. watcher.on( 'matched:data', watcherCallback );
  75288. watcher.bind( 'isEnabled' ).to( this );
  75289. }
  75290. }
  75291. // Normalizes the configuration `from` parameter value.
  75292. // The normalized value for the `from` parameter is a RegExp instance. If the passed `from` is already a RegExp instance,
  75293. // it is returned unchanged.
  75294. //
  75295. // @param {String|RegExp} from
  75296. // @returns {RegExp}
  75297. function normalizeFrom( from ) {
  75298. if ( typeof from == 'string' ) {
  75299. return new RegExp( `(${ Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["escapeRegExp"])( from ) })$` );
  75300. }
  75301. // `from` is already a regular expression.
  75302. return from;
  75303. }
  75304. // Normalizes the configuration `to` parameter value.
  75305. // The normalized value for the `to` parameter is a function that takes an array and returns an array. See more in the
  75306. // configuration description. If the passed `to` is already a function, it is returned unchanged.
  75307. //
  75308. // @param {String|Array.<null|String>|Function} to
  75309. // @returns {Function}
  75310. function normalizeTo( to ) {
  75311. if ( typeof to == 'string' ) {
  75312. return () => [ to ];
  75313. } else if ( to instanceof Array ) {
  75314. return () => to;
  75315. }
  75316. // `to` is already a function.
  75317. return to;
  75318. }
  75319. // For given `position` returns attributes for the text that is after that position.
  75320. // The text can be in the same text node as the position (`foo[]bar`) or in the next text node (`foo[]<$text bold="true">bar</$text>`).
  75321. //
  75322. // @param {module:engine/model/position~Position} position
  75323. // @returns {Iterable.<*>}
  75324. function getTextAttributesAfterPosition( position ) {
  75325. const textNode = position.textNode ? position.textNode : position.nodeAfter;
  75326. return textNode.getAttributes();
  75327. }
  75328. // Returns a RegExp pattern string that detects a sentence inside a quote.
  75329. //
  75330. // @param {String} quoteCharacter The character to create a pattern for.
  75331. // @returns {String}
  75332. function buildQuotesRegExp( quoteCharacter ) {
  75333. return new RegExp( `(^|\\s)(${ quoteCharacter })([^${ quoteCharacter }]*)(${ quoteCharacter })$` );
  75334. }
  75335. // Reads text transformation config and returns normalized array of transformations objects.
  75336. //
  75337. // @param {module:typing/texttransformation~TextTransformationDescription} config
  75338. // @returns {Array.<{from:String,to:Function}>}
  75339. function normalizeTransformations( config ) {
  75340. const extra = config.extra || [];
  75341. const remove = config.remove || [];
  75342. const isNotRemoved = transformation => !remove.includes( transformation );
  75343. const configured = config.include.concat( extra ).filter( isNotRemoved );
  75344. return expandGroupsAndRemoveDuplicates( configured )
  75345. .filter( isNotRemoved ) // Filter out 'remove' transformations as they might be set in group
  75346. .map( transformation => TRANSFORMATIONS[ transformation ] || transformation )
  75347. .map( transformation => ( {
  75348. from: normalizeFrom( transformation.from ),
  75349. to: normalizeTo( transformation.to )
  75350. } ) );
  75351. }
  75352. // Reads definitions and expands named groups if needed to transformation names.
  75353. // This method also removes duplicated named transformations if any.
  75354. //
  75355. // @param {Array.<String|Object>} definitions
  75356. // @returns {Array.<String|Object>}
  75357. function expandGroupsAndRemoveDuplicates( definitions ) {
  75358. // Set is using to make sure that transformation names are not duplicated.
  75359. const definedTransformations = new Set();
  75360. for ( const transformationOrGroup of definitions ) {
  75361. if ( TRANSFORMATION_GROUPS[ transformationOrGroup ] ) {
  75362. for ( const transformation of TRANSFORMATION_GROUPS[ transformationOrGroup ] ) {
  75363. definedTransformations.add( transformation );
  75364. }
  75365. } else {
  75366. definedTransformations.add( transformationOrGroup );
  75367. }
  75368. }
  75369. return Array.from( definedTransformations );
  75370. }
  75371. /**
  75372. * The text transformation definition object. It describes what should be replaced with what.
  75373. *
  75374. * The input value (`from`) can be passed either as a string or as a regular expression.
  75375. *
  75376. * * If a string is passed, it will be simply checked if the end of the input matches it.
  75377. * * If a regular expression is passed, its entire length must be covered with capturing groups (e.g. `/(foo)(bar)$/`).
  75378. * Also, since it is compared against the end of the input, it has to end with `$` to be correctly matched.
  75379. * See examples below.
  75380. *
  75381. * The output value (`to`) can be passed as a string, as an array or as a function.
  75382. *
  75383. * * If a string is passed, it will be used as a replacement value as-is. Note that a string output value can be used only if
  75384. * the input value is a string, too.
  75385. * * If an array is passed, it has to have the same number of elements as there are capturing groups in the input value regular expression.
  75386. * Each capture group will be replaced with a corresponding string from the passed array. If a given capturing group should not be replaced,
  75387. * use `null` instead of passing a string.
  75388. * * If a function is used, it should return an array as described above. The function is passed one parameter &mdash; an array with matches
  75389. * by the regular expression. See the examples below.
  75390. *
  75391. * A simple string-to-string replacement:
  75392. *
  75393. * { from: '(c)', to: '©' }
  75394. *
  75395. * Change quote styles using a regular expression. Note how all the parts are in separate capturing groups and the space at the beginning
  75396. * and the text inside quotes are not replaced (`null` passed as the first and the third value in the `to` parameter):
  75397. *
  75398. * {
  75399. * from: /(^|\s)(")([^"]*)(")$/,
  75400. * to: [ null, '“', null, '”' ]
  75401. * }
  75402. *
  75403. * Automatic uppercase after a dot using a callback:
  75404. *
  75405. * {
  75406. * from: /(\. )([a-z])$/,
  75407. * to: matches => [ null, matches[ 1 ].toUpperCase() ]
  75408. * }
  75409. *
  75410. * @typedef {Object} module:typing/texttransformation~TextTransformationDescription
  75411. * @property {String|RegExp} from The string or regular expression to transform.
  75412. * @property {String} to The text to transform compatible with `String.replace()`.
  75413. */
  75414. /**
  75415. * The configuration of the {@link module:typing/texttransformation~TextTransformation} feature.
  75416. *
  75417. * Read more in {@link module:typing/texttransformation~TextTransformationConfig}.
  75418. *
  75419. * @member {module:typing/texttransformation~TextTransformationConfig} module:typing/typing~TypingConfig#transformations
  75420. */
  75421. /**
  75422. * The configuration of the text transformation feature.
  75423. *
  75424. * ClassicEditor
  75425. * .create( editorElement, {
  75426. * typing: {
  75427. * transformations: ... // Text transformation feature options.
  75428. * }
  75429. * } )
  75430. * .then( ... )
  75431. * .catch( ... );
  75432. *
  75433. * By default, the feature comes pre-configured
  75434. * (via {@link module:typing/texttransformation~TextTransformationConfig#include `config.typing.transformations.include`}) with the
  75435. * following groups of transformations:
  75436. *
  75437. * * Typography (group name: `typography`)
  75438. * - `ellipsis`: transforms `...` to `…`
  75439. * - `enDash`: transforms ` -- ` to ` – `
  75440. * - `emDash`: transforms ` --- ` to ` — `
  75441. * * Quotations (group name: `quotes`)
  75442. * - `quotesPrimary`: transforms `"Foo bar"` to `“Foo bar”`
  75443. * - `quotesSecondary`: transforms `'Foo bar'` to `‘Foo bar’`
  75444. * * Symbols (group name: `symbols`)
  75445. * - `trademark`: transforms `(tm)` to `™`
  75446. * - `registeredTrademark`: transforms `(r)` to `®`
  75447. * - `copyright`: transforms `(c)` to `©`
  75448. * * Mathematical (group name: `mathematical`)
  75449. * - `oneHalf`: transforms `1/2` to: `½`
  75450. * - `oneThird`: transforms `1/3` to: `⅓`
  75451. * - `twoThirds`: transforms `2/3` to: `⅔`
  75452. * - `oneForth`: transforms `1/4` to: `¼`
  75453. * - `threeQuarters`: transforms `3/4` to: `¾`
  75454. * - `lessThanOrEqual`: transforms `<=` to: `≤`
  75455. * - `greaterThanOrEqual`: transforms `>=` to: `≥`
  75456. * - `notEqual`: transforms `!=` to: `≠`
  75457. * - `arrowLeft`: transforms `<-` to: `←`
  75458. * - `arrowRight`: transforms `->` to: `→`
  75459. * * Misc:
  75460. * - `quotesPrimaryEnGb`: transforms `'Foo bar'` to `‘Foo bar’`
  75461. * - `quotesSecondaryEnGb`: transforms `"Foo bar"` to `“Foo bar”`
  75462. * - `quotesPrimaryPl`: transforms `"Foo bar"` to `„Foo bar”`
  75463. * - `quotesSecondaryPl`: transforms `'Foo bar'` to `‚Foo bar’`
  75464. *
  75465. * In order to load additional transformations, use the
  75466. * {@link module:typing/texttransformation~TextTransformationConfig#extra `transformations.extra` option}.
  75467. *
  75468. * In order to narrow down the list of transformations, use the
  75469. * {@link module:typing/texttransformation~TextTransformationConfig#remove `transformations.remove` option}.
  75470. *
  75471. * In order to completely override the supported transformations, use the
  75472. * {@link module:typing/texttransformation~TextTransformationConfig#include `transformations.include` option}.
  75473. *
  75474. * Examples:
  75475. *
  75476. * const transformationsConfig = {
  75477. * include: [
  75478. * // Use only the 'quotes' and 'typography' groups.
  75479. * 'quotes',
  75480. * 'typography',
  75481. *
  75482. * // Plus, some custom transformation.
  75483. * { from: 'CKE', to: 'CKEditor' }
  75484. * ]
  75485. * };
  75486. *
  75487. * const transformationsConfig = {
  75488. * // Remove the 'ellipsis' transformation loaded by the 'typography' group.
  75489. * remove: [ 'ellipsis' ]
  75490. * }
  75491. *
  75492. * @interface TextTransformationConfig
  75493. */
  75494. /* eslint-disable max-len */
  75495. /**
  75496. * The standard list of text transformations supported by the editor. By default it comes pre-configured with a couple dozen of them
  75497. * (see {@link module:typing/texttransformation~TextTransformationConfig} for the full list). You can override this list completely
  75498. * by setting this option or use the other two options
  75499. * ({@link module:typing/texttransformation~TextTransformationConfig#extra `transformations.extra`},
  75500. * {@link module:typing/texttransformation~TextTransformationConfig#remove `transformations.remove`}) to fine-tune the default list.
  75501. *
  75502. * @member {Array.<module:typing/texttransformation~TextTransformationDescription>} module:typing/texttransformation~TextTransformationConfig#include
  75503. */
  75504. /**
  75505. * Additional text transformations that are added to the transformations defined in
  75506. * {@link module:typing/texttransformation~TextTransformationConfig#include `transformations.include`}.
  75507. *
  75508. * const transformationsConfig = {
  75509. * extra: [
  75510. * { from: 'CKE', to: 'CKEditor' }
  75511. * ]
  75512. * };
  75513. *
  75514. * @member {Array.<module:typing/texttransformation~TextTransformationDescription>} module:typing/texttransformation~TextTransformationConfig#extra
  75515. */
  75516. /**
  75517. * The text transformation names that are removed from transformations defined in
  75518. * {@link module:typing/texttransformation~TextTransformationConfig#include `transformations.include`} or
  75519. * {@link module:typing/texttransformation~TextTransformationConfig#extra `transformations.extra`}.
  75520. *
  75521. * const transformationsConfig = {
  75522. * remove: [
  75523. * 'ellipsis', // Remove only 'ellipsis' from the 'typography' group.
  75524. * 'mathematical' // Remove all transformations from the 'mathematical' group.
  75525. * ]
  75526. * }
  75527. *
  75528. * @member {Array.<module:typing/texttransformation~TextTransformationDescription>} module:typing/texttransformation~TextTransformationConfig#remove
  75529. */
  75530. /* eslint-enable max-len */
  75531. /***/ }),
  75532. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js":
  75533. /*!********************************************************************!*\
  75534. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js ***!
  75535. \********************************************************************/
  75536. /*! exports provided: default */
  75537. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75538. "use strict";
  75539. __webpack_require__.r(__webpack_exports__);
  75540. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextWatcher; });
  75541. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  75542. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  75543. /* harmony import */ var _utils_getlasttextline__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/getlasttextline */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js");
  75544. /**
  75545. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  75546. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  75547. */
  75548. /**
  75549. * @module typing/textwatcher
  75550. */
  75551. /**
  75552. * The text watcher feature.
  75553. *
  75554. * Fires the {@link module:typing/textwatcher~TextWatcher#event:matched:data `matched:data`},
  75555. * {@link module:typing/textwatcher~TextWatcher#event:matched:selection `matched:selection`} and
  75556. * {@link module:typing/textwatcher~TextWatcher#event:unmatched `unmatched`} events on typing or selection changes.
  75557. *
  75558. * @private
  75559. * @mixes module:utils/observablemixin~ObservableMixin
  75560. */
  75561. class TextWatcher {
  75562. /**
  75563. * Creates a text watcher instance.
  75564. *
  75565. * @param {module:engine/model/model~Model} model
  75566. * @param {Function} testCallback See {@link module:typing/textwatcher~TextWatcher#testCallback}.
  75567. */
  75568. constructor( model, testCallback ) {
  75569. /**
  75570. * The editor's model.
  75571. *
  75572. * @readonly
  75573. * @member {module:engine/model/model~Model}
  75574. */
  75575. this.model = model;
  75576. /**
  75577. * The function used to match the text.
  75578. *
  75579. * The test callback can return 3 values:
  75580. *
  75581. * * `false` if there is no match,
  75582. * * `true` if there is a match,
  75583. * * an object if there is a match and we want to pass some additional information to the {@link #event:matched:data} event.
  75584. *
  75585. * @member {Function} #testCallback
  75586. * @returns {Object} testResult
  75587. */
  75588. this.testCallback = testCallback;
  75589. /**
  75590. * Whether there is a match currently.
  75591. *
  75592. * @readonly
  75593. * @member {Boolean}
  75594. */
  75595. this.hasMatch = false;
  75596. /**
  75597. * Flag indicating whether the `TextWatcher` instance is enabled or disabled.
  75598. * A disabled TextWatcher will not evaluate text.
  75599. *
  75600. * To disable TextWatcher:
  75601. *
  75602. * const watcher = new TextWatcher( editor.model, testCallback );
  75603. *
  75604. * // After this a testCallback will not be called.
  75605. * watcher.isEnabled = false;
  75606. *
  75607. * @observable
  75608. * @member {Boolean} #isEnabled
  75609. */
  75610. this.set( 'isEnabled', true );
  75611. // Toggle text watching on isEnabled state change.
  75612. this.on( 'change:isEnabled', () => {
  75613. if ( this.isEnabled ) {
  75614. this._startListening();
  75615. } else {
  75616. this.stopListening( model.document.selection );
  75617. this.stopListening( model.document );
  75618. }
  75619. } );
  75620. this._startListening();
  75621. }
  75622. /**
  75623. * Starts listening to the editor for typing and selection events.
  75624. *
  75625. * @private
  75626. */
  75627. _startListening() {
  75628. const model = this.model;
  75629. const document = model.document;
  75630. this.listenTo( document.selection, 'change:range', ( evt, { directChange } ) => {
  75631. // Indirect changes (i.e. when the user types or external changes are applied) are handled in the document's change event.
  75632. if ( !directChange ) {
  75633. return;
  75634. }
  75635. // Act only on collapsed selection.
  75636. if ( !document.selection.isCollapsed ) {
  75637. if ( this.hasMatch ) {
  75638. this.fire( 'unmatched' );
  75639. this.hasMatch = false;
  75640. }
  75641. return;
  75642. }
  75643. this._evaluateTextBeforeSelection( 'selection' );
  75644. } );
  75645. this.listenTo( document, 'change:data', ( evt, batch ) => {
  75646. if ( batch.type == 'transparent' ) {
  75647. return;
  75648. }
  75649. this._evaluateTextBeforeSelection( 'data', { batch } );
  75650. } );
  75651. }
  75652. /**
  75653. * Checks the editor content for matched text.
  75654. *
  75655. * @fires matched:data
  75656. * @fires matched:selection
  75657. * @fires unmatched
  75658. *
  75659. * @private
  75660. * @param {'data'|'selection'} suffix A suffix used for generating the event name.
  75661. * @param {Object} data Data object for event.
  75662. */
  75663. _evaluateTextBeforeSelection( suffix, data = {} ) {
  75664. const model = this.model;
  75665. const document = model.document;
  75666. const selection = document.selection;
  75667. const rangeBeforeSelection = model.createRange( model.createPositionAt( selection.focus.parent, 0 ), selection.focus );
  75668. const { text, range } = Object(_utils_getlasttextline__WEBPACK_IMPORTED_MODULE_2__["default"])( rangeBeforeSelection, model );
  75669. const testResult = this.testCallback( text );
  75670. if ( !testResult && this.hasMatch ) {
  75671. this.fire( 'unmatched' );
  75672. }
  75673. this.hasMatch = !!testResult;
  75674. if ( testResult ) {
  75675. const eventData = Object.assign( data, { text, range } );
  75676. // If the test callback returns an object with additional data, assign the data as well.
  75677. if ( typeof testResult == 'object' ) {
  75678. Object.assign( eventData, testResult );
  75679. }
  75680. this.fire( `matched:${ suffix }`, eventData );
  75681. }
  75682. }
  75683. }
  75684. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( TextWatcher, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  75685. /**
  75686. * Fired whenever the text watcher found a match for data changes.
  75687. *
  75688. * @event matched:data
  75689. * @param {Object} data Event data.
  75690. * @param {String} data.text The full text before selection to which the regexp was applied.
  75691. * @param {module:engine/model/range~Range} data.range The range representing the position of the `data.text`.
  75692. * @param {Object} [data.testResult] The additional data returned from the {@link module:typing/textwatcher~TextWatcher#testCallback}.
  75693. */
  75694. /**
  75695. * Fired whenever the text watcher found a match for selection changes.
  75696. *
  75697. * @event matched:selection
  75698. * @param {Object} data Event data.
  75699. * @param {String} data.text The full text before selection.
  75700. * @param {module:engine/model/range~Range} data.range The range representing the position of the `data.text`.
  75701. * @param {Object} [data.testResult] The additional data returned from the {@link module:typing/textwatcher~TextWatcher#testCallback}.
  75702. */
  75703. /**
  75704. * Fired whenever the text does not match anymore. Fired only when the text watcher found a match.
  75705. *
  75706. * @event unmatched
  75707. */
  75708. /***/ }),
  75709. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/twostepcaretmovement.js":
  75710. /*!*****************************************************************************!*\
  75711. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/twostepcaretmovement.js ***!
  75712. \*****************************************************************************/
  75713. /*! exports provided: default */
  75714. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75715. "use strict";
  75716. __webpack_require__.r(__webpack_exports__);
  75717. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TwoStepCaretMovement; });
  75718. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  75719. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  75720. /**
  75721. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  75722. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  75723. */
  75724. /**
  75725. * @module typing/twostepcaretmovement
  75726. */
  75727. /**
  75728. * This plugin enables the two-step caret (phantom) movement behavior for
  75729. * {@link module:typing/twostepcaretmovement~TwoStepCaretMovement#registerAttribute registered attributes}
  75730. * on arrow right (<kbd>→</kbd>) and left (<kbd>←</kbd>) key press.
  75731. *
  75732. * Thanks to this (phantom) caret movement the user is able to type before/after as well as at the
  75733. * beginning/end of an attribute.
  75734. *
  75735. * **Note:** This plugin support right–to–left (Arabic, Hebrew, etc.) content by mirroring its behavior
  75736. * but for the sake of simplicity examples showcase only left–to–right use–cases.
  75737. *
  75738. * # Forward movement
  75739. *
  75740. * ## "Entering" an attribute:
  75741. *
  75742. * When this plugin is enabled and registered for the `a` attribute and the selection is right before it
  75743. * (at the attribute boundary), pressing the right arrow key will not move the selection but update its
  75744. * attributes accordingly:
  75745. *
  75746. * * When enabled:
  75747. *
  75748. * foo{}<$text a="true">bar</$text>
  75749. *
  75750. * <kbd>→</kbd>
  75751. *
  75752. * foo<$text a="true">{}bar</$text>
  75753. *
  75754. * * When disabled:
  75755. *
  75756. * foo{}<$text a="true">bar</$text>
  75757. *
  75758. * <kbd>→</kbd>
  75759. *
  75760. * foo<$text a="true">b{}ar</$text>
  75761. *
  75762. *
  75763. * ## "Leaving" an attribute:
  75764. *
  75765. * * When enabled:
  75766. *
  75767. * <$text a="true">bar{}</$text>baz
  75768. *
  75769. * <kbd>→</kbd>
  75770. *
  75771. * <$text a="true">bar</$text>{}baz
  75772. *
  75773. * * When disabled:
  75774. *
  75775. * <$text a="true">bar{}</$text>baz
  75776. *
  75777. * <kbd>→</kbd>
  75778. *
  75779. * <$text a="true">bar</$text>b{}az
  75780. *
  75781. * # Backward movement
  75782. *
  75783. * * When enabled:
  75784. *
  75785. * <$text a="true">bar</$text>{}baz
  75786. *
  75787. * <kbd>←</kbd>
  75788. *
  75789. * <$text a="true">bar{}</$text>baz
  75790. *
  75791. * * When disabled:
  75792. *
  75793. * <$text a="true">bar</$text>{}baz
  75794. *
  75795. * <kbd>←</kbd>
  75796. *
  75797. * <$text a="true">ba{}r</$text>b{}az
  75798. *
  75799. * # Multiple attributes
  75800. *
  75801. * * When enabled and many attributes starts or ends at the same position:
  75802. *
  75803. * <$text a="true" b="true">bar</$text>{}baz
  75804. *
  75805. * <kbd>←</kbd>
  75806. *
  75807. * <$text a="true" b="true">bar{}</$text>baz
  75808. *
  75809. * * When enabled and one procedes another:
  75810. *
  75811. * <$text a="true">bar</$text><$text b="true">{}bar</$text>
  75812. *
  75813. * <kbd>←</kbd>
  75814. *
  75815. * <$text a="true">bar{}</$text><$text b="true">bar</$text>
  75816. *
  75817. */
  75818. class TwoStepCaretMovement extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  75819. /**
  75820. * @inheritDoc
  75821. */
  75822. static get pluginName() {
  75823. return 'TwoStepCaretMovement';
  75824. }
  75825. /**
  75826. * @inheritDoc
  75827. */
  75828. constructor( editor ) {
  75829. super( editor );
  75830. /**
  75831. * A set of attributes to handle.
  75832. *
  75833. * @protected
  75834. * @property {module:typing/twostepcaretmovement~TwoStepCaretMovement}
  75835. */
  75836. this.attributes = new Set();
  75837. /**
  75838. * The current UID of the overridden gravity, as returned by
  75839. * {@link module:engine/model/writer~Writer#overrideSelectionGravity}.
  75840. *
  75841. * @private
  75842. * @member {String}
  75843. */
  75844. this._overrideUid = null;
  75845. }
  75846. /**
  75847. * @inheritDoc
  75848. */
  75849. init() {
  75850. const editor = this.editor;
  75851. const model = editor.model;
  75852. const view = editor.editing.view;
  75853. const locale = editor.locale;
  75854. const modelSelection = model.document.selection;
  75855. // Listen to keyboard events and handle the caret movement according to the 2-step caret logic.
  75856. this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
  75857. // This implementation works only for collapsed selection.
  75858. if ( !modelSelection.isCollapsed ) {
  75859. return;
  75860. }
  75861. // When user tries to expand the selection or jump over the whole word or to the beginning/end then
  75862. // two-steps movement is not necessary.
  75863. if ( data.shiftKey || data.altKey || data.ctrlKey ) {
  75864. return;
  75865. }
  75866. const arrowRightPressed = data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["keyCodes"].arrowright;
  75867. const arrowLeftPressed = data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["keyCodes"].arrowleft;
  75868. // When neither left or right arrow has been pressed then do noting.
  75869. if ( !arrowRightPressed && !arrowLeftPressed ) {
  75870. return;
  75871. }
  75872. const contentDirection = locale.contentLanguageDirection;
  75873. let isMovementHandled = false;
  75874. if ( ( contentDirection === 'ltr' && arrowRightPressed ) || ( contentDirection === 'rtl' && arrowLeftPressed ) ) {
  75875. isMovementHandled = this._handleForwardMovement( data );
  75876. } else {
  75877. isMovementHandled = this._handleBackwardMovement( data );
  75878. }
  75879. // Stop the keydown event if the two-step caret movement handled it. Avoid collisions
  75880. // with other features which may also take over the caret movement (e.g. Widget).
  75881. if ( isMovementHandled === true ) {
  75882. evt.stop();
  75883. }
  75884. }, { context: '$text', priority: 'highest' } );
  75885. /**
  75886. * A flag indicating that the automatic gravity restoration should not happen upon the next
  75887. * gravity restoration.
  75888. * {@link module:engine/model/selection~Selection#event:change:range} event.
  75889. *
  75890. * @private
  75891. * @member {String}
  75892. */
  75893. this._isNextGravityRestorationSkipped = false;
  75894. // The automatic gravity restoration logic.
  75895. this.listenTo( modelSelection, 'change:range', ( evt, data ) => {
  75896. // Skipping the automatic restoration is needed if the selection should change
  75897. // but the gravity must remain overridden afterwards. See the #handleBackwardMovement
  75898. // to learn more.
  75899. if ( this._isNextGravityRestorationSkipped ) {
  75900. this._isNextGravityRestorationSkipped = false;
  75901. return;
  75902. }
  75903. // Skip automatic restore when the gravity is not overridden — simply, there's nothing to restore
  75904. // at this moment.
  75905. if ( !this._isGravityOverridden ) {
  75906. return;
  75907. }
  75908. // Skip automatic restore when the change is indirect AND the selection is at the attribute boundary.
  75909. // It means that e.g. if the change was external (collaboration) and the user had their
  75910. // selection around the link, its gravity should remain intact in this change:range event.
  75911. if ( !data.directChange && isBetweenDifferentAttributes( modelSelection.getFirstPosition(), this.attributes ) ) {
  75912. return;
  75913. }
  75914. this._restoreGravity();
  75915. } );
  75916. }
  75917. /**
  75918. * Registers a given attribute for the two-step caret movement.
  75919. *
  75920. * @param {String} attribute Name of the attribute to handle.
  75921. */
  75922. registerAttribute( attribute ) {
  75923. this.attributes.add( attribute );
  75924. }
  75925. /**
  75926. * Updates the document selection and the view according to the two–step caret movement state
  75927. * when moving **forwards**. Executed upon `keypress` in the {@link module:engine/view/view~View}.
  75928. *
  75929. * @private
  75930. * @param {module:engine/view/observer/domeventdata~DomEventData} data Data of the key press.
  75931. * @returns {Boolean} `true` when the handler prevented caret movement
  75932. */
  75933. _handleForwardMovement( data ) {
  75934. const attributes = this.attributes;
  75935. const model = this.editor.model;
  75936. const selection = model.document.selection;
  75937. const position = selection.getFirstPosition();
  75938. // DON'T ENGAGE 2-SCM if gravity is already overridden. It means that we just entered
  75939. //
  75940. // <paragraph>foo<$text attribute>{}bar</$text>baz</paragraph>
  75941. //
  75942. // or left the attribute
  75943. //
  75944. // <paragraph>foo<$text attribute>bar</$text>{}baz</paragraph>
  75945. //
  75946. // and the gravity will be restored automatically.
  75947. if ( this._isGravityOverridden ) {
  75948. return false;
  75949. }
  75950. // DON'T ENGAGE 2-SCM when the selection is at the beginning of the block AND already has the
  75951. // attribute:
  75952. // * when the selection was initially set there using the mouse,
  75953. // * when the editor has just started
  75954. //
  75955. // <paragraph><$text attribute>{}bar</$text>baz</paragraph>
  75956. //
  75957. if ( position.isAtStart && hasAnyAttribute( selection, attributes ) ) {
  75958. return false;
  75959. }
  75960. // ENGAGE 2-SCM When at least one of the observed attributes changes its value (incl. starts, ends).
  75961. //
  75962. // <paragraph>foo<$text attribute>bar{}</$text>baz</paragraph>
  75963. // <paragraph>foo<$text attribute>bar{}</$text><$text otherAttribute>baz</$text></paragraph>
  75964. // <paragraph>foo<$text attribute=1>bar{}</$text><$text attribute=2>baz</$text></paragraph>
  75965. // <paragraph>foo{}<$text attribute>bar</$text>baz</paragraph>
  75966. //
  75967. if ( isBetweenDifferentAttributes( position, attributes ) ) {
  75968. preventCaretMovement( data );
  75969. this._overrideGravity();
  75970. return true;
  75971. }
  75972. }
  75973. /**
  75974. * Updates the document selection and the view according to the two–step caret movement state
  75975. * when moving **backwards**. Executed upon `keypress` in the {@link module:engine/view/view~View}.
  75976. *
  75977. * @private
  75978. * @param {module:engine/view/observer/domeventdata~DomEventData} data Data of the key press.
  75979. * @returns {Boolean} `true` when the handler prevented caret movement
  75980. */
  75981. _handleBackwardMovement( data ) {
  75982. const attributes = this.attributes;
  75983. const model = this.editor.model;
  75984. const selection = model.document.selection;
  75985. const position = selection.getFirstPosition();
  75986. // When the gravity is already overridden (by this plugin), it means we are on the two-step position.
  75987. // Prevent the movement, restore the gravity and update selection attributes.
  75988. //
  75989. // <paragraph>foo<$text attribute=1>bar</$text><$text attribute=2>{}baz</$text></paragraph>
  75990. // <paragraph>foo<$text attribute>bar</$text><$text otherAttribute>{}baz</$text></paragraph>
  75991. // <paragraph>foo<$text attribute>{}bar</$text>baz</paragraph>
  75992. // <paragraph>foo<$text attribute>bar</$text>{}baz</paragraph>
  75993. //
  75994. if ( this._isGravityOverridden ) {
  75995. preventCaretMovement( data );
  75996. this._restoreGravity();
  75997. setSelectionAttributesFromTheNodeBefore( model, attributes, position );
  75998. return true;
  75999. } else {
  76000. // REMOVE SELECTION ATTRIBUTE when restoring gravity towards a non-existent content at the
  76001. // beginning of the block.
  76002. //
  76003. // <paragraph>{}<$text attribute>bar</$text></paragraph>
  76004. //
  76005. if ( position.isAtStart ) {
  76006. if ( hasAnyAttribute( selection, attributes ) ) {
  76007. preventCaretMovement( data );
  76008. setSelectionAttributesFromTheNodeBefore( model, attributes, position );
  76009. return true;
  76010. }
  76011. return false;
  76012. }
  76013. // When we are moving from natural gravity, to the position of the 2SCM, we need to override the gravity,
  76014. // and make sure it won't be restored. Unless it's at the end of the block and an observed attribute.
  76015. // We need to check if the caret is a one position before the attribute boundary:
  76016. //
  76017. // <paragraph>foo<$text attribute=1>bar</$text><$text attribute=2>b{}az</$text></paragraph>
  76018. // <paragraph>foo<$text attribute>bar</$text><$text otherAttribute>b{}az</$text></paragraph>
  76019. // <paragraph>foo<$text attribute>b{}ar</$text>baz</paragraph>
  76020. // <paragraph>foo<$text attribute>bar</$text>b{}az</paragraph>
  76021. //
  76022. if ( isStepAfterAnyAttributeBoundary( position, attributes ) ) {
  76023. // ENGAGE 2-SCM if the selection has no attribute. This may happen when the user
  76024. // left the attribute using a FORWARD 2-SCM.
  76025. //
  76026. // <paragraph><$text attribute>bar</$text>{}</paragraph>
  76027. //
  76028. if (
  76029. position.isAtEnd &&
  76030. !hasAnyAttribute( selection, attributes ) &&
  76031. isBetweenDifferentAttributes( position, attributes )
  76032. ) {
  76033. preventCaretMovement( data );
  76034. setSelectionAttributesFromTheNodeBefore( model, attributes, position );
  76035. return true;
  76036. }
  76037. // Skip the automatic gravity restore upon the next selection#change:range event.
  76038. // If not skipped, it would automatically restore the gravity, which should remain
  76039. // overridden.
  76040. this._isNextGravityRestorationSkipped = true;
  76041. this._overrideGravity();
  76042. // Don't return "true" here because we didn't call _preventCaretMovement.
  76043. // Returning here will destabilize the filler logic, which also listens to
  76044. // keydown (and the event would be stopped).
  76045. return false;
  76046. }
  76047. }
  76048. }
  76049. /**
  76050. * `true` when the gravity is overridden for the plugin.
  76051. *
  76052. * @readonly
  76053. * @private
  76054. * @type {Boolean}
  76055. */
  76056. get _isGravityOverridden() {
  76057. return !!this._overrideUid;
  76058. }
  76059. /**
  76060. * Overrides the gravity using the {@link module:engine/model/writer~Writer model writer}
  76061. * and stores the information about this fact in the {@link #_overrideUid}.
  76062. *
  76063. * A shorthand for {@link module:engine/model/writer~Writer#overrideSelectionGravity}.
  76064. *
  76065. * @private
  76066. */
  76067. _overrideGravity() {
  76068. this._overrideUid = this.editor.model.change( writer => {
  76069. return writer.overrideSelectionGravity();
  76070. } );
  76071. }
  76072. /**
  76073. * Restores the gravity using the {@link module:engine/model/writer~Writer model writer}.
  76074. *
  76075. * A shorthand for {@link module:engine/model/writer~Writer#restoreSelectionGravity}.
  76076. *
  76077. * @private
  76078. */
  76079. _restoreGravity() {
  76080. this.editor.model.change( writer => {
  76081. writer.restoreSelectionGravity( this._overrideUid );
  76082. this._overrideUid = null;
  76083. } );
  76084. }
  76085. }
  76086. // Checks whether the selection has any of given attributes.
  76087. //
  76088. // @param {module:engine/model/documentselection~DocumentSelection} selection
  76089. // @param {Iterable.<String>} attributes
  76090. function hasAnyAttribute( selection, attributes ) {
  76091. for ( const observedAttribute of attributes ) {
  76092. if ( selection.hasAttribute( observedAttribute ) ) {
  76093. return true;
  76094. }
  76095. }
  76096. return false;
  76097. }
  76098. // Applies the given attributes to the current selection using using the
  76099. // values from the node before the current position. Uses
  76100. // the {@link module:engine/model/writer~Writer model writer}.
  76101. //
  76102. // @param {module:engine/model/model~Model}
  76103. // @param {Iterable.<String>} attributess
  76104. // @param {module:engine/model/position~Position} position
  76105. function setSelectionAttributesFromTheNodeBefore( model, attributes, position ) {
  76106. const nodeBefore = position.nodeBefore;
  76107. model.change( writer => {
  76108. if ( nodeBefore ) {
  76109. writer.setSelectionAttribute( nodeBefore.getAttributes() );
  76110. } else {
  76111. writer.removeSelectionAttribute( attributes );
  76112. }
  76113. } );
  76114. }
  76115. // Prevents the caret movement in the view by calling `preventDefault` on the event data.
  76116. //
  76117. // @alias data.preventDefault
  76118. function preventCaretMovement( data ) {
  76119. data.preventDefault();
  76120. }
  76121. // Checks whether the step before `isBetweenDifferentAttributes()`.
  76122. //
  76123. // @param {module:engine/model/position~Position} position
  76124. // @param {String} attribute
  76125. function isStepAfterAnyAttributeBoundary( position, attributes ) {
  76126. const positionBefore = position.getShiftedBy( -1 );
  76127. return isBetweenDifferentAttributes( positionBefore, attributes );
  76128. }
  76129. // Checks whether the given position is between different values of given attributes.
  76130. //
  76131. // @param {module:engine/model/position~Position} position
  76132. // @param {Iterable.<String>} attributes
  76133. function isBetweenDifferentAttributes( position, attributes ) {
  76134. const { nodeBefore, nodeAfter } = position;
  76135. for ( const observedAttribute of attributes ) {
  76136. const attrBefore = nodeBefore ? nodeBefore.getAttribute( observedAttribute ) : undefined;
  76137. const attrAfter = nodeAfter ? nodeAfter.getAttribute( observedAttribute ) : undefined;
  76138. if ( attrAfter !== attrBefore ) {
  76139. return true;
  76140. }
  76141. }
  76142. return false;
  76143. }
  76144. /***/ }),
  76145. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/typing.js":
  76146. /*!***************************************************************!*\
  76147. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/typing.js ***!
  76148. \***************************************************************/
  76149. /*! exports provided: default */
  76150. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76151. "use strict";
  76152. __webpack_require__.r(__webpack_exports__);
  76153. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Typing; });
  76154. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  76155. /* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./input */ "./node_modules/@ckeditor/ckeditor5-typing/src/input.js");
  76156. /* harmony import */ var _delete__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./delete */ "./node_modules/@ckeditor/ckeditor5-typing/src/delete.js");
  76157. /**
  76158. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  76159. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  76160. */
  76161. /**
  76162. * @module typing/typing
  76163. */
  76164. /**
  76165. * The typing feature. It handles typing.
  76166. *
  76167. * This is a "glue" plugin which loads the {@link module:typing/input~Input} and {@link module:typing/delete~Delete}
  76168. * plugins.
  76169. *
  76170. * @extends module:core/plugin~Plugin
  76171. */
  76172. class Typing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  76173. static get requires() {
  76174. return [ _input__WEBPACK_IMPORTED_MODULE_1__["default"], _delete__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  76175. }
  76176. /**
  76177. * @inheritDoc
  76178. */
  76179. static get pluginName() {
  76180. return 'Typing';
  76181. }
  76182. }
  76183. /**
  76184. * The configuration of the typing features. Used by the features from the `@ckeditor/ckeditor5-typing` package.
  76185. *
  76186. * Read more in {@link module:typing/typing~TypingConfig}.
  76187. *
  76188. * @member {module:typing/typing~TypingConfig} module:core/editor/editorconfig~EditorConfig#typing
  76189. */
  76190. /**
  76191. * The configuration of the typing features. Used by the typing features in `@ckeditor/ckeditor5-typing` package.
  76192. *
  76193. * ClassicEditor
  76194. * .create( editorElement, {
  76195. * typing: ... // Typing feature options.
  76196. * } )
  76197. * .then( ... )
  76198. * .catch( ... );
  76199. *
  76200. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  76201. *
  76202. * @interface TypingConfig
  76203. */
  76204. /**
  76205. * The granularity of undo/redo for typing and deleting. The value `20` means (more or less) that a new undo step
  76206. * is created every 20 characters are inserted or deleted.
  76207. *
  76208. * @member {Number} [module:typing/typing~TypingConfig#undoStep=20]
  76209. */
  76210. /***/ }),
  76211. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js":
  76212. /*!***************************************************************************!*\
  76213. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js ***!
  76214. \***************************************************************************/
  76215. /*! exports provided: default */
  76216. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76217. "use strict";
  76218. __webpack_require__.r(__webpack_exports__);
  76219. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ChangeBuffer; });
  76220. /**
  76221. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  76222. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  76223. */
  76224. /**
  76225. * @module typing/utils/changebuffer
  76226. */
  76227. /**
  76228. * Change buffer allows to group atomic changes (like characters that have been typed) into
  76229. * {@link module:engine/model/batch~Batch batches}.
  76230. *
  76231. * Batches represent single undo steps, hence changes added to one single batch are undone together.
  76232. *
  76233. * The buffer has a configurable limit of atomic changes that it can accommodate. After the limit was
  76234. * exceeded (see {@link ~ChangeBuffer#input}), a new batch is created in {@link ~ChangeBuffer#batch}.
  76235. *
  76236. * To use the change buffer you need to let it know about the number of changes that were added to the batch:
  76237. *
  76238. * const buffer = new ChangeBuffer( model, LIMIT );
  76239. *
  76240. * // Later on in your feature:
  76241. * buffer.batch.insert( pos, insertedCharacters );
  76242. * buffer.input( insertedCharacters.length );
  76243. *
  76244. */
  76245. class ChangeBuffer {
  76246. /**
  76247. * Creates a new instance of the change buffer.
  76248. *
  76249. * @param {module:engine/model/model~Model} model
  76250. * @param {Number} [limit=20] The maximum number of atomic changes which can be contained in one batch.
  76251. */
  76252. constructor( model, limit = 20 ) {
  76253. /**
  76254. * The model instance.
  76255. *
  76256. * @readonly
  76257. * @member {module:engine/model/model~Model} #model
  76258. */
  76259. this.model = model;
  76260. /**
  76261. * The number of atomic changes in the buffer. Once it exceeds the {@link #limit},
  76262. * the {@link #batch batch} is set to a new one.
  76263. *
  76264. * @readonly
  76265. * @member {Number} #size
  76266. */
  76267. this.size = 0;
  76268. /**
  76269. * The maximum number of atomic changes which can be contained in one batch.
  76270. *
  76271. * @readonly
  76272. * @member {Number} #limit
  76273. */
  76274. this.limit = limit;
  76275. /**
  76276. * Whether the buffer is locked. A locked buffer cannot be reset unless it gets unlocked.
  76277. *
  76278. * @readonly
  76279. * @member {Boolean} #isLocked
  76280. */
  76281. this.isLocked = false;
  76282. // The function to be called in order to notify the buffer about batches which appeared in the document.
  76283. // The callback will check whether it is a new batch and in that case the buffer will be flushed.
  76284. //
  76285. // The reason why the buffer needs to be flushed whenever a new batch appears is that the changes added afterwards
  76286. // should be added to a new batch. For instance, when the user types, then inserts an image, and then types again,
  76287. // the characters typed after inserting the image should be added to a different batch than the characters typed before.
  76288. this._changeCallback = ( evt, batch ) => {
  76289. if ( batch.type != 'transparent' && batch !== this._batch ) {
  76290. this._reset( true );
  76291. }
  76292. };
  76293. this._selectionChangeCallback = () => {
  76294. this._reset();
  76295. };
  76296. this.model.document.on( 'change', this._changeCallback );
  76297. this.model.document.selection.on( 'change:range', this._selectionChangeCallback );
  76298. this.model.document.selection.on( 'change:attribute', this._selectionChangeCallback );
  76299. /**
  76300. * The current batch instance.
  76301. *
  76302. * @private
  76303. * @member #_batch
  76304. */
  76305. /**
  76306. * The callback to document the change event which later needs to be removed.
  76307. *
  76308. * @private
  76309. * @member #_changeCallback
  76310. */
  76311. /**
  76312. * The callback to document selection `change:attribute` and `change:range` events which resets the buffer.
  76313. *
  76314. * @private
  76315. * @member #_selectionChangeCallback
  76316. */
  76317. }
  76318. /**
  76319. * The current batch to which a feature should add its operations. Once the {@link #size}
  76320. * is reached or exceeds the {@link #limit}, the batch is set to a new instance and the size is reset.
  76321. *
  76322. * @type {module:engine/model/batch~Batch}
  76323. */
  76324. get batch() {
  76325. if ( !this._batch ) {
  76326. this._batch = this.model.createBatch();
  76327. }
  76328. return this._batch;
  76329. }
  76330. /**
  76331. * The input number of changes into the buffer. Once the {@link #size} is
  76332. * reached or exceeds the {@link #limit}, the batch is set to a new instance and the size is reset.
  76333. *
  76334. * @param {Number} changeCount The number of atomic changes to input.
  76335. */
  76336. input( changeCount ) {
  76337. this.size += changeCount;
  76338. if ( this.size >= this.limit ) {
  76339. this._reset( true );
  76340. }
  76341. }
  76342. /**
  76343. * Locks the buffer.
  76344. */
  76345. lock() {
  76346. this.isLocked = true;
  76347. }
  76348. /**
  76349. * Unlocks the buffer.
  76350. */
  76351. unlock() {
  76352. this.isLocked = false;
  76353. }
  76354. /**
  76355. * Destroys the buffer.
  76356. */
  76357. destroy() {
  76358. this.model.document.off( 'change', this._changeCallback );
  76359. this.model.document.selection.off( 'change:range', this._selectionChangeCallback );
  76360. this.model.document.selection.off( 'change:attribute', this._selectionChangeCallback );
  76361. }
  76362. /**
  76363. * Resets the change buffer.
  76364. *
  76365. * @private
  76366. * @param {Boolean} [ignoreLock] Whether internal lock {@link #isLocked} should be ignored.
  76367. */
  76368. _reset( ignoreLock ) {
  76369. if ( !this.isLocked || ignoreLock ) {
  76370. this._batch = null;
  76371. this.size = 0;
  76372. }
  76373. }
  76374. }
  76375. /***/ }),
  76376. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js":
  76377. /*!*********************************************************************************!*\
  76378. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js ***!
  76379. \*********************************************************************************/
  76380. /*! exports provided: default */
  76381. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76382. "use strict";
  76383. __webpack_require__.r(__webpack_exports__);
  76384. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return findAttributeRange; });
  76385. /**
  76386. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  76387. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  76388. */
  76389. /**
  76390. * @module typing/utils/findattributerange
  76391. */
  76392. /**
  76393. * Returns a model range that covers all consecutive nodes with the same `attributeName` and its `value`
  76394. * that intersect the given `position`.
  76395. *
  76396. * It can be used e.g. to get the entire range on which the `linkHref` attribute needs to be changed when having a
  76397. * selection inside a link.
  76398. *
  76399. * @param {module:engine/model/position~Position} position The start position.
  76400. * @param {String} attributeName The attribute name.
  76401. * @param {String} value The attribute value.
  76402. * @param {module:engine/model/model~Model} model The model instance.
  76403. * @returns {module:engine/model/range~Range} The link range.
  76404. */
  76405. function findAttributeRange( position, attributeName, value, model ) {
  76406. return model.createRange(
  76407. _findBound( position, attributeName, value, true, model ),
  76408. _findBound( position, attributeName, value, false, model )
  76409. );
  76410. }
  76411. // Walks forward or backward (depends on the `lookBack` flag), node by node, as long as they have the same attribute value
  76412. // and returns a position just before or after (depends on the `lookBack` flag) the last matched node.
  76413. //
  76414. // @param {module:engine/model/position~Position} position The start position.
  76415. // @param {String} attributeName The attribute name.
  76416. // @param {String} value The attribute value.
  76417. // @param {Boolean} lookBack Whether the walk direction is forward (`false`) or backward (`true`).
  76418. // @returns {module:engine/model/position~Position} The position just before the last matched node.
  76419. function _findBound( position, attributeName, value, lookBack, model ) {
  76420. // Get node before or after position (depends on `lookBack` flag).
  76421. // When position is inside text node then start searching from text node.
  76422. let node = position.textNode || ( lookBack ? position.nodeBefore : position.nodeAfter );
  76423. let lastNode = null;
  76424. while ( node && node.getAttribute( attributeName ) == value ) {
  76425. lastNode = node;
  76426. node = lookBack ? node.previousSibling : node.nextSibling;
  76427. }
  76428. return lastNode ? model.createPositionAt( lastNode, lookBack ? 'before' : 'after' ) : position;
  76429. }
  76430. /***/ }),
  76431. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js":
  76432. /*!******************************************************************************!*\
  76433. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js ***!
  76434. \******************************************************************************/
  76435. /*! exports provided: default */
  76436. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76437. "use strict";
  76438. __webpack_require__.r(__webpack_exports__);
  76439. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getLastTextLine; });
  76440. /**
  76441. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  76442. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  76443. */
  76444. /**
  76445. * @module typing/utils/getlasttextline
  76446. */
  76447. /**
  76448. * Returns the last text line from the given range.
  76449. *
  76450. * "The last text line" is understood as text (from one or more text nodes) which is limited either by a parent block
  76451. * or by inline elements (e.g. `<softBreak>`).
  76452. *
  76453. * const rangeToCheck = model.createRange(
  76454. * model.createPositionAt( paragraph, 0 ),
  76455. * model.createPositionAt( paragraph, 'end' )
  76456. * );
  76457. *
  76458. * const { text, range } = getLastTextLine( rangeToCheck, model );
  76459. *
  76460. * For model below, the returned `text` will be "Foo bar baz" and `range` will be set on whole `<paragraph>` content:
  76461. *
  76462. * <paragraph>Foo bar baz<paragraph>
  76463. *
  76464. * However, in below case, `text` will be set to "baz" and `range` will be set only on "baz".
  76465. *
  76466. * <paragraph>Foo<softBreak></softBreak>bar<softBreak></softBreak>baz<paragraph>
  76467. *
  76468. * @protected
  76469. * @param {module:engine/model/range~Range} range
  76470. * @param {module:engine/model/model~Model} model
  76471. * @returns {module:typing/utils/getlasttextline~LastTextLineData}
  76472. */
  76473. function getLastTextLine( range, model ) {
  76474. let start = range.start;
  76475. const text = Array.from( range.getItems() ).reduce( ( rangeText, node ) => {
  76476. // Trim text to a last occurrence of an inline element and update range start.
  76477. if ( !( node.is( '$text' ) || node.is( '$textProxy' ) ) ) {
  76478. start = model.createPositionAfter( node );
  76479. return '';
  76480. }
  76481. return rangeText + node.data;
  76482. }, '' );
  76483. return { text, range: model.createRange( start, range.end ) };
  76484. }
  76485. /**
  76486. * The value returned by {@link module:typing/utils/getlasttextline~getLastTextLine}.
  76487. *
  76488. * @typedef {Object} module:typing/utils/getlasttextline~LastTextLineData
  76489. *
  76490. * @property {String} text The text from the text nodes in the last text line.
  76491. * @property {module:engine/model/range~Range} range The range set on the text nodes in the last text line.
  76492. */
  76493. /***/ }),
  76494. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injecttypingmutationshandling.js":
  76495. /*!********************************************************************************************!*\
  76496. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/injecttypingmutationshandling.js ***!
  76497. \********************************************************************************************/
  76498. /*! exports provided: default */
  76499. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76500. "use strict";
  76501. __webpack_require__.r(__webpack_exports__);
  76502. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTypingMutationsHandling; });
  76503. /* harmony import */ var _ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/diff */ "./node_modules/@ckeditor/ckeditor5-utils/src/diff.js");
  76504. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_domconverter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/domconverter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js");
  76505. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/utils.js");
  76506. /**
  76507. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  76508. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  76509. */
  76510. /**
  76511. * @module typing/utils/injecttypingmutationshandling
  76512. */
  76513. /**
  76514. * Handles mutations caused by normal typing.
  76515. *
  76516. * @param {module:core/editor/editor~Editor} editor The editor instance.
  76517. */
  76518. function injectTypingMutationsHandling( editor ) {
  76519. editor.editing.view.document.on( 'mutations', ( evt, mutations, viewSelection ) => {
  76520. new MutationHandler( editor ).handle( mutations, viewSelection );
  76521. } );
  76522. }
  76523. /**
  76524. * Helper class for translating DOM mutations into model changes.
  76525. *
  76526. * @private
  76527. */
  76528. class MutationHandler {
  76529. /**
  76530. * Creates an instance of the mutation handler.
  76531. *
  76532. * @param {module:core/editor/editor~Editor} editor
  76533. */
  76534. constructor( editor ) {
  76535. /**
  76536. * Editor instance for which mutations are handled.
  76537. *
  76538. * @readonly
  76539. * @member {module:core/editor/editor~Editor} #editor
  76540. */
  76541. this.editor = editor;
  76542. /**
  76543. * The editing controller.
  76544. *
  76545. * @readonly
  76546. * @member {module:engine/controller/editingcontroller~EditingController} #editing
  76547. */
  76548. this.editing = this.editor.editing;
  76549. }
  76550. /**
  76551. * Handles given mutations.
  76552. *
  76553. * @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|
  76554. * module:engine/view/observer/mutationobserver~MutatedChildren>} mutations
  76555. * @param {module:engine/view/selection~Selection|null} viewSelection
  76556. */
  76557. handle( mutations, viewSelection ) {
  76558. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_2__["containerChildrenMutated"])( mutations ) ) {
  76559. this._handleContainerChildrenMutations( mutations, viewSelection );
  76560. } else {
  76561. for ( const mutation of mutations ) {
  76562. // Fortunately it will never be both.
  76563. this._handleTextMutation( mutation, viewSelection );
  76564. this._handleTextNodeInsertion( mutation );
  76565. }
  76566. }
  76567. }
  76568. /**
  76569. * Handles situations when container's children mutated during input. This can happen when
  76570. * the browser is trying to "fix" DOM in certain situations. For example, when the user starts to type
  76571. * in `<p><a href=""><i>Link{}</i></a></p>`, the browser might change the order of elements
  76572. * to `<p><i><a href="">Link</a>x{}</i></p>`. A similar situation happens when the spell checker
  76573. * replaces a word wrapped with `<strong>` with a word wrapped with a `<b>` element.
  76574. *
  76575. * To handle such situations, the common DOM ancestor of all mutations is converted to the model representation
  76576. * and then compared with the current model to calculate the proper text change.
  76577. *
  76578. * Note: Single text node insertion is handled in {@link #_handleTextNodeInsertion} and text node mutation is handled
  76579. * in {@link #_handleTextMutation}).
  76580. *
  76581. * @private
  76582. * @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|
  76583. * module:engine/view/observer/mutationobserver~MutatedChildren>} mutations
  76584. * @param {module:engine/view/selection~Selection|null} viewSelection
  76585. */
  76586. _handleContainerChildrenMutations( mutations, viewSelection ) {
  76587. // Get common ancestor of all mutations.
  76588. const mutationsCommonAncestor = getMutationsContainer( mutations );
  76589. // Quit if there is no common ancestor.
  76590. if ( !mutationsCommonAncestor ) {
  76591. return;
  76592. }
  76593. const domConverter = this.editor.editing.view.domConverter;
  76594. // Get common ancestor in DOM.
  76595. const domMutationCommonAncestor = domConverter.mapViewToDom( mutationsCommonAncestor );
  76596. // Create fresh DomConverter so it will not use existing mapping and convert current DOM to model.
  76597. // This wouldn't be needed if DomConverter would allow to create fresh view without checking any mappings.
  76598. const freshDomConverter = new _ckeditor_ckeditor5_engine_src_view_domconverter__WEBPACK_IMPORTED_MODULE_1__["default"]( this.editor.editing.view.document );
  76599. const modelFromCurrentDom = this.editor.data.toModel(
  76600. freshDomConverter.domToView( domMutationCommonAncestor )
  76601. ).getChild( 0 );
  76602. // Current model.
  76603. const currentModel = this.editor.editing.mapper.toModelElement( mutationsCommonAncestor );
  76604. // If common ancestor is not mapped, do not do anything. It probably is a parent of another view element.
  76605. // That means that we would need to diff model elements (see `if` below). Better return early instead of
  76606. // trying to get a reasonable model ancestor. It will fell into the `if` below anyway.
  76607. // This situation happens for example for lists. If `<ul>` is a common ancestor, `currentModel` is `undefined`
  76608. // because `<ul>` is not mapped (`<li>`s are).
  76609. // See https://github.com/ckeditor/ckeditor5/issues/718.
  76610. if ( !currentModel ) {
  76611. return;
  76612. }
  76613. // Get children from both ancestors.
  76614. const modelFromDomChildren = Array.from( modelFromCurrentDom.getChildren() );
  76615. const currentModelChildren = Array.from( currentModel.getChildren() );
  76616. // Remove the last `<softBreak>` from the end of `modelFromDomChildren` if there is no `<softBreak>` in current model.
  76617. // If the described scenario happened, it means that this is a bogus `<br />` added by a browser.
  76618. const lastDomChild = modelFromDomChildren[ modelFromDomChildren.length - 1 ];
  76619. const lastCurrentChild = currentModelChildren[ currentModelChildren.length - 1 ];
  76620. const isLastDomChildSoftBreak = lastDomChild && lastDomChild.is( 'element', 'softBreak' );
  76621. const isLastCurrentChildSoftBreak = lastCurrentChild && !lastCurrentChild.is( 'element', 'softBreak' );
  76622. if ( isLastDomChildSoftBreak && isLastCurrentChildSoftBreak ) {
  76623. modelFromDomChildren.pop();
  76624. }
  76625. const schema = this.editor.model.schema;
  76626. // Skip situations when common ancestor has any container elements.
  76627. if ( !isSafeForTextMutation( modelFromDomChildren, schema ) || !isSafeForTextMutation( currentModelChildren, schema ) ) {
  76628. return;
  76629. }
  76630. // Replace &nbsp; inserted by the browser with normal space. See comment in `_handleTextMutation`.
  76631. // Replace non-texts with any character. This is potentially dangerous but passes in manual tests. The thing is
  76632. // that we need to take care of proper indexes so we cannot simply remove non-text elements from the content.
  76633. // By inserting a character we keep all the real texts on their indexes.
  76634. const newText = modelFromDomChildren.map( item => item.is( '$text' ) ? item.data : '@' ).join( '' ).replace( /\u00A0/g, ' ' );
  76635. const oldText = currentModelChildren.map( item => item.is( '$text' ) ? item.data : '@' ).join( '' ).replace( /\u00A0/g, ' ' );
  76636. // Do nothing if mutations created same text.
  76637. if ( oldText === newText ) {
  76638. return;
  76639. }
  76640. const diffResult = Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__["default"])( oldText, newText );
  76641. const { firstChangeAt, insertions, deletions } = calculateChanges( diffResult );
  76642. // Try setting new model selection according to passed view selection.
  76643. let modelSelectionRange = null;
  76644. if ( viewSelection ) {
  76645. modelSelectionRange = this.editing.mapper.toModelRange( viewSelection.getFirstRange() );
  76646. }
  76647. const insertText = newText.substr( firstChangeAt, insertions );
  76648. const removeRange = this.editor.model.createRange(
  76649. this.editor.model.createPositionAt( currentModel, firstChangeAt ),
  76650. this.editor.model.createPositionAt( currentModel, firstChangeAt + deletions )
  76651. );
  76652. this.editor.execute( 'input', {
  76653. text: insertText,
  76654. range: removeRange,
  76655. resultRange: modelSelectionRange
  76656. } );
  76657. }
  76658. /**
  76659. * @private
  76660. */
  76661. _handleTextMutation( mutation, viewSelection ) {
  76662. if ( mutation.type != 'text' ) {
  76663. return;
  76664. }
  76665. // Replace &nbsp; inserted by the browser with normal space.
  76666. // We want only normal spaces in the model and in the view. Renderer and DOM Converter will be then responsible
  76667. // for rendering consecutive spaces using &nbsp;, but the model and the view has to be clear.
  76668. // Other feature may introduce inserting non-breakable space on specific key stroke (for example shift + space).
  76669. // However then it will be handled outside of mutations, like enter key is.
  76670. // The replacing is here because it has to be done before `diff` and `diffToChanges` functions, as they
  76671. // take `newText` and compare it to (cleaned up) view.
  76672. // It could also be done in mutation observer too, however if any outside plugin would like to
  76673. // introduce additional events for mutations, they would get already cleaned up version (this may be good or not).
  76674. const newText = mutation.newText.replace( /\u00A0/g, ' ' );
  76675. // To have correct `diffResult`, we also compare view node text data with &nbsp; replaced by space.
  76676. const oldText = mutation.oldText.replace( /\u00A0/g, ' ' );
  76677. // Do nothing if mutations created same text.
  76678. if ( oldText === newText ) {
  76679. return;
  76680. }
  76681. const diffResult = Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__["default"])( oldText, newText );
  76682. const { firstChangeAt, insertions, deletions } = calculateChanges( diffResult );
  76683. // Try setting new model selection according to passed view selection.
  76684. let modelSelectionRange = null;
  76685. if ( viewSelection ) {
  76686. modelSelectionRange = this.editing.mapper.toModelRange( viewSelection.getFirstRange() );
  76687. }
  76688. // Get the position in view and model where the changes will happen.
  76689. const viewPos = this.editing.view.createPositionAt( mutation.node, firstChangeAt );
  76690. const modelPos = this.editing.mapper.toModelPosition( viewPos );
  76691. const removeRange = this.editor.model.createRange( modelPos, modelPos.getShiftedBy( deletions ) );
  76692. const insertText = newText.substr( firstChangeAt, insertions );
  76693. this.editor.execute( 'input', {
  76694. text: insertText,
  76695. range: removeRange,
  76696. resultRange: modelSelectionRange
  76697. } );
  76698. }
  76699. /**
  76700. * @private
  76701. */
  76702. _handleTextNodeInsertion( mutation ) {
  76703. if ( mutation.type != 'children' ) {
  76704. return;
  76705. }
  76706. const change = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getSingleTextNodeChange"])( mutation );
  76707. const viewPos = this.editing.view.createPositionAt( mutation.node, change.index );
  76708. const modelPos = this.editing.mapper.toModelPosition( viewPos );
  76709. const insertedText = change.values[ 0 ].data;
  76710. this.editor.execute( 'input', {
  76711. // Replace &nbsp; inserted by the browser with normal space.
  76712. // See comment in `_handleTextMutation`.
  76713. // In this case we don't need to do this before `diff` because we diff whole nodes.
  76714. // Just change &nbsp; in case there are some.
  76715. text: insertedText.replace( /\u00A0/g, ' ' ),
  76716. range: this.editor.model.createRange( modelPos )
  76717. } );
  76718. }
  76719. }
  76720. // Returns first common ancestor of all mutations that is either {@link module:engine/view/containerelement~ContainerElement}
  76721. // or {@link module:engine/view/rootelement~RootElement}.
  76722. //
  76723. // @private
  76724. // @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|
  76725. // module:engine/view/observer/mutationobserver~MutatedChildren>} mutations
  76726. // @returns {module:engine/view/containerelement~ContainerElement|engine/view/rootelement~RootElement|undefined}
  76727. function getMutationsContainer( mutations ) {
  76728. const lca = mutations
  76729. .map( mutation => mutation.node )
  76730. .reduce( ( commonAncestor, node ) => {
  76731. return commonAncestor.getCommonAncestor( node, { includeSelf: true } );
  76732. } );
  76733. if ( !lca ) {
  76734. return;
  76735. }
  76736. // We need to look for container and root elements only, so check all LCA's
  76737. // ancestors (starting from itself).
  76738. return lca.getAncestors( { includeSelf: true, parentFirst: true } )
  76739. .find( element => element.is( 'containerElement' ) || element.is( 'rootElement' ) );
  76740. }
  76741. // Returns true if provided array contains content that won't be problematic during diffing and text mutation handling.
  76742. //
  76743. // @param {Array.<module:engine/model/node~Node>} children
  76744. // @param {module:engine/model/schema~Schema} schema
  76745. // @returns {Boolean}
  76746. function isSafeForTextMutation( children, schema ) {
  76747. return children.every( child => schema.isInline( child ) );
  76748. }
  76749. // Calculates first change index and number of characters that should be inserted and deleted starting from that index.
  76750. //
  76751. // @private
  76752. // @param diffResult
  76753. // @returns {{insertions: number, deletions: number, firstChangeAt: *}}
  76754. function calculateChanges( diffResult ) {
  76755. // Index where the first change happens. Used to set the position from which nodes will be removed and where will be inserted.
  76756. let firstChangeAt = null;
  76757. // Index where the last change happens. Used to properly count how many characters have to be removed and inserted.
  76758. let lastChangeAt = null;
  76759. // Get `firstChangeAt` and `lastChangeAt`.
  76760. for ( let i = 0; i < diffResult.length; i++ ) {
  76761. const change = diffResult[ i ];
  76762. if ( change != 'equal' ) {
  76763. firstChangeAt = firstChangeAt === null ? i : firstChangeAt;
  76764. lastChangeAt = i;
  76765. }
  76766. }
  76767. // How many characters, starting from `firstChangeAt`, should be removed.
  76768. let deletions = 0;
  76769. // How many characters, starting from `firstChangeAt`, should be inserted.
  76770. let insertions = 0;
  76771. for ( let i = firstChangeAt; i <= lastChangeAt; i++ ) {
  76772. // If there is no change (equal) or delete, the character is existing in `oldText`. We count it for removing.
  76773. if ( diffResult[ i ] != 'insert' ) {
  76774. deletions++;
  76775. }
  76776. // If there is no change (equal) or insert, the character is existing in `newText`. We count it for inserting.
  76777. if ( diffResult[ i ] != 'delete' ) {
  76778. insertions++;
  76779. }
  76780. }
  76781. return { insertions, deletions, firstChangeAt };
  76782. }
  76783. /***/ }),
  76784. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js":
  76785. /*!*********************************************************************************************!*\
  76786. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js ***!
  76787. \*********************************************************************************************/
  76788. /*! exports provided: default, isNonTypingKeystroke */
  76789. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76790. "use strict";
  76791. __webpack_require__.r(__webpack_exports__);
  76792. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectUnsafeKeystrokesHandling; });
  76793. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNonTypingKeystroke", function() { return isNonTypingKeystroke; });
  76794. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  76795. /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  76796. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/utils.js");
  76797. /**
  76798. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  76799. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  76800. */
  76801. /**
  76802. * @module typing/utils/injectunsafekeystrokeshandling
  76803. */
  76804. /**
  76805. * Handles keystrokes which are unsafe for typing. This handler's logic is explained
  76806. * in https://github.com/ckeditor/ckeditor5-typing/issues/83#issuecomment-398690251.
  76807. *
  76808. * @param {module:core/editor/editor~Editor} editor The editor instance.
  76809. */
  76810. function injectUnsafeKeystrokesHandling( editor ) {
  76811. let latestCompositionSelection = null;
  76812. const model = editor.model;
  76813. const view = editor.editing.view;
  76814. const inputCommand = editor.commands.get( 'input' );
  76815. // For Android, we want to handle keystrokes on `beforeinput` to be sure that code in `DeleteObserver` already had a chance to be fired.
  76816. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_1__["default"].isAndroid ) {
  76817. view.document.on( 'beforeinput', ( evt, evtData ) => handleUnsafeKeystroke( evtData ), { priority: 'lowest' } );
  76818. } else {
  76819. view.document.on( 'keydown', ( evt, evtData ) => handleUnsafeKeystroke( evtData ), { priority: 'lowest' } );
  76820. }
  76821. view.document.on( 'compositionstart', handleCompositionStart, { priority: 'lowest' } );
  76822. view.document.on( 'compositionend', () => {
  76823. latestCompositionSelection = model.createSelection( model.document.selection );
  76824. }, { priority: 'lowest' } );
  76825. // Handles the keydown event. We need to guess whether such keystroke is going to result
  76826. // in typing. If so, then before character insertion happens, any selected content needs
  76827. // to be deleted. Otherwise the default browser deletion mechanism would be
  76828. // triggered, resulting in:
  76829. //
  76830. // * Hundreds of mutations which could not be handled.
  76831. // * But most importantly, loss of control over how the content is being deleted.
  76832. //
  76833. // The method is used in a low-priority listener, hence allowing other listeners (e.g. delete or enter features)
  76834. // to handle the event.
  76835. //
  76836. // @param {module:engine/view/observer/keyobserver~KeyEventData} evtData
  76837. function handleUnsafeKeystroke( evtData ) {
  76838. // Do not delete the content, if Shift + Delete key combination was pressed on a non-collapsed selection on Windows.
  76839. //
  76840. // The Shift + Delete key combination should work in the same way as the `cut` event on a non-collapsed selection on Windows.
  76841. // In fact, the native `cut` event is actually emitted in this case, but with lower priority. Therefore, in order to handle the
  76842. // Shift + Delete key combination correctly, it is enough to prevent the content deletion here.
  76843. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_1__["default"].isWindows && Object(_utils__WEBPACK_IMPORTED_MODULE_2__["isShiftDeleteOnNonCollapsedSelection"])( evtData, view.document ) ) {
  76844. return;
  76845. }
  76846. const doc = model.document;
  76847. const isComposing = view.document.isComposing;
  76848. const isSelectionUnchanged = latestCompositionSelection && latestCompositionSelection.isEqual( doc.selection );
  76849. // Reset stored composition selection.
  76850. latestCompositionSelection = null;
  76851. // By relying on the state of the input command we allow disabling the entire input easily
  76852. // by just disabling the input command. We could’ve used here the delete command but that
  76853. // would mean requiring the delete feature which would block loading one without the other.
  76854. // We could also check the editor.isReadOnly property, but that wouldn't allow to block
  76855. // the input without blocking other features.
  76856. if ( !inputCommand.isEnabled ) {
  76857. return;
  76858. }
  76859. if ( isNonTypingKeystroke( evtData ) || doc.selection.isCollapsed ) {
  76860. return;
  76861. }
  76862. // If during composition, deletion should be prevented as it may remove composed sequence (#83).
  76863. if ( isComposing && evtData.keyCode === 229 ) {
  76864. return;
  76865. }
  76866. // If there is a `keydown` event fired with '229' keycode it might be related
  76867. // to recent composition. Check if selection is the same as upon ending recent composition,
  76868. // if so do not remove selected content as it will remove composed sequence (#83).
  76869. if ( !isComposing && evtData.keyCode === 229 && isSelectionUnchanged ) {
  76870. return;
  76871. }
  76872. deleteSelectionContent();
  76873. }
  76874. // Handles the `compositionstart` event. It is used only in special cases to remove the contents
  76875. // of a non-collapsed selection so composition itself does not result in complex mutations.
  76876. //
  76877. // The special case mentioned above is a situation in which the `keydown` event is fired after
  76878. // `compositionstart` event. In such cases {@link #handleKeydown} cannot clear current selection
  76879. // contents (because it is too late and will break the composition) so the composition handler takes care of it.
  76880. function handleCompositionStart() {
  76881. const doc = model.document;
  76882. const isFlatSelection = doc.selection.rangeCount === 1 ? doc.selection.getFirstRange().isFlat : true;
  76883. // If on `compositionstart` there is a non-collapsed selection which start and end have different parents
  76884. // it means the `handleKeydown()` method did not remove its contents. It happens usually because
  76885. // of different order of events (`compositionstart` before `keydown` - in Safari). In such cases
  76886. // we need to remove selection contents on composition start (#83).
  76887. if ( doc.selection.isCollapsed || isFlatSelection ) {
  76888. return;
  76889. }
  76890. deleteSelectionContent();
  76891. }
  76892. function deleteSelectionContent() {
  76893. const buffer = inputCommand.buffer;
  76894. buffer.lock();
  76895. const batch = buffer.batch;
  76896. inputCommand._batches.add( batch );
  76897. model.enqueueChange( batch, () => {
  76898. model.deleteContent( model.document.selection );
  76899. } );
  76900. buffer.unlock();
  76901. }
  76902. }
  76903. const safeKeycodes = [
  76904. Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["getCode"])( 'arrowUp' ),
  76905. Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["getCode"])( 'arrowRight' ),
  76906. Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["getCode"])( 'arrowDown' ),
  76907. Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["getCode"])( 'arrowLeft' ),
  76908. 9, // Tab
  76909. 16, // Shift
  76910. 17, // Ctrl
  76911. 18, // Alt
  76912. 19, // Pause
  76913. 20, // CapsLock
  76914. 27, // Escape
  76915. 33, // PageUp
  76916. 34, // PageDown
  76917. 35, // Home
  76918. 36, // End,
  76919. 45, // Insert,
  76920. 91, // Windows,
  76921. 93, // Menu key,
  76922. 144, // NumLock
  76923. 145, // ScrollLock,
  76924. 173, // Mute/Unmute
  76925. 174, // Volume up
  76926. 175, // Volume down,
  76927. 176, // Next song,
  76928. 177, // Previous song,
  76929. 178, // Stop,
  76930. 179, // Play/Pause,
  76931. 255 // Display brightness (increase and decrease)
  76932. ];
  76933. // Function keys.
  76934. for ( let code = 112; code <= 135; code++ ) {
  76935. safeKeycodes.push( code );
  76936. }
  76937. /**
  76938. * Returns `true` if a keystroke will **not** result in "typing".
  76939. *
  76940. * For instance, keystrokes that result in typing are letters "a-zA-Z", numbers "0-9", delete, backspace, etc.
  76941. *
  76942. * Keystrokes that do not cause typing are, for instance, Fn keys (F5, F8, etc.), arrow keys (←, →, ↑, ↓),
  76943. * Tab (↹), "Windows logo key" (⊞ Win), etc.
  76944. *
  76945. * Note: This implementation is very simple and will need to be refined with time.
  76946. *
  76947. * @param {module:engine/view/observer/keyobserver~KeyEventData} keyData
  76948. * @returns {Boolean}
  76949. */
  76950. function isNonTypingKeystroke( keyData ) {
  76951. // Keystrokes which contain Ctrl or Cmd don't represent typing.
  76952. if ( keyData.ctrlKey || keyData.metaKey ) {
  76953. return true;
  76954. }
  76955. return safeKeycodes.includes( keyData.keyCode );
  76956. }
  76957. /***/ }),
  76958. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.js":
  76959. /*!******************************************************************************!*\
  76960. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.js ***!
  76961. \******************************************************************************/
  76962. /*! exports provided: default */
  76963. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76964. "use strict";
  76965. __webpack_require__.r(__webpack_exports__);
  76966. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return inlineHighlight; });
  76967. /* harmony import */ var _findattributerange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./findattributerange */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js");
  76968. /**
  76969. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  76970. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  76971. */
  76972. /**
  76973. * @module typing/utils/inlinehighlight
  76974. */
  76975. /**
  76976. * Adds a visual highlight style to an attribute element in which the selection is anchored.
  76977. * Together with two-step caret movement, they indicate that the user is typing inside the element.
  76978. *
  76979. * Highlight is turned on by adding the given class to the attribute element in the view:
  76980. *
  76981. * * The class is removed before the conversion has started, as callbacks added with the `'highest'` priority
  76982. * to {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} events.
  76983. * * The class is added in the view post fixer, after other changes in the model tree were converted to the view.
  76984. *
  76985. * This way, adding and removing the highlight does not interfere with conversion.
  76986. *
  76987. * Usage:
  76988. *
  76989. * import inlineHighlight from '@ckeditor/ckeditor5-typing/src/utils/inlinehighlight';
  76990. *
  76991. * // Make `ck-link_selected` class be applied on an `a` element
  76992. * // whenever the corresponding `linkHref` attribute element is selected.
  76993. * inlineHighlight( editor, 'linkHref', 'a', 'ck-link_selected' );
  76994. *
  76995. * @param {module:core/editor/editor~Editor} editor The editor instance.
  76996. * @param {String} attributeName The attribute name to check.
  76997. * @param {String} tagName The tagName of a view item.
  76998. * @param {String} className The class name to apply in the view.
  76999. */
  77000. function inlineHighlight( editor, attributeName, tagName, className ) {
  77001. const view = editor.editing.view;
  77002. const highlightedElements = new Set();
  77003. // Adding the class.
  77004. view.document.registerPostFixer( writer => {
  77005. const selection = editor.model.document.selection;
  77006. let changed = false;
  77007. if ( selection.hasAttribute( attributeName ) ) {
  77008. const modelRange = Object(_findattributerange__WEBPACK_IMPORTED_MODULE_0__["default"])(
  77009. selection.getFirstPosition(),
  77010. attributeName,
  77011. selection.getAttribute( attributeName ),
  77012. editor.model
  77013. );
  77014. const viewRange = editor.editing.mapper.toViewRange( modelRange );
  77015. // There might be multiple view elements in the `viewRange`, for example, when the `a` element is
  77016. // broken by a UIElement.
  77017. for ( const item of viewRange.getItems() ) {
  77018. if ( item.is( 'element', tagName ) && !item.hasClass( className ) ) {
  77019. writer.addClass( className, item );
  77020. highlightedElements.add( item );
  77021. changed = true;
  77022. }
  77023. }
  77024. }
  77025. return changed;
  77026. } );
  77027. // Removing the class.
  77028. editor.conversion.for( 'editingDowncast' ).add( dispatcher => {
  77029. // Make sure the highlight is removed on every possible event, before conversion is started.
  77030. dispatcher.on( 'insert', removeHighlight, { priority: 'highest' } );
  77031. dispatcher.on( 'remove', removeHighlight, { priority: 'highest' } );
  77032. dispatcher.on( 'attribute', removeHighlight, { priority: 'highest' } );
  77033. dispatcher.on( 'selection', removeHighlight, { priority: 'highest' } );
  77034. function removeHighlight() {
  77035. view.change( writer => {
  77036. for ( const item of highlightedElements.values() ) {
  77037. writer.removeClass( className, item );
  77038. highlightedElements.delete( item );
  77039. }
  77040. } );
  77041. }
  77042. } );
  77043. }
  77044. /***/ }),
  77045. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/utils.js":
  77046. /*!********************************************************************!*\
  77047. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/utils.js ***!
  77048. \********************************************************************/
  77049. /*! exports provided: containerChildrenMutated, getSingleTextNodeChange, compareChildNodes, isShiftDeleteOnNonCollapsedSelection */
  77050. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77051. "use strict";
  77052. __webpack_require__.r(__webpack_exports__);
  77053. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containerChildrenMutated", function() { return containerChildrenMutated; });
  77054. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSingleTextNodeChange", function() { return getSingleTextNodeChange; });
  77055. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareChildNodes", function() { return compareChildNodes; });
  77056. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isShiftDeleteOnNonCollapsedSelection", function() { return isShiftDeleteOnNonCollapsedSelection; });
  77057. /* harmony import */ var _ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/diff */ "./node_modules/@ckeditor/ckeditor5-utils/src/diff.js");
  77058. /* harmony import */ var _ckeditor_ckeditor5_utils_src_difftochanges__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/difftochanges */ "./node_modules/@ckeditor/ckeditor5-utils/src/difftochanges.js");
  77059. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  77060. /**
  77061. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77062. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77063. */
  77064. /**
  77065. * @module typing/utils/utils
  77066. */
  77067. /**
  77068. * Returns true if container children have mutated or more than a single text node was changed.
  77069. *
  77070. * @private
  77071. * @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|
  77072. * module:engine/view/observer/mutationobserver~MutatedChildren>} mutations
  77073. * @returns {Boolean}
  77074. */
  77075. function containerChildrenMutated( mutations ) {
  77076. if ( mutations.length == 0 ) {
  77077. return false;
  77078. }
  77079. // Check if there is any mutation of `children` type or any mutation that changes more than one text node.
  77080. for ( const mutation of mutations ) {
  77081. if ( mutation.type === 'children' && !getSingleTextNodeChange( mutation ) ) {
  77082. return true;
  77083. }
  77084. }
  77085. return false;
  77086. }
  77087. /**
  77088. * Returns change made to a single text node.
  77089. *
  77090. * @private
  77091. * @param {module:engine/view/observer/mutationobserver~MutatedText|
  77092. * module:engine/view/observer/mutationobserver~MutatedChildren} mutation
  77093. * @returns {Object|undefined} Change object (see {@link module:utils/difftochanges~diffToChanges} output)
  77094. * or undefined if more than a single text node was changed.
  77095. */
  77096. function getSingleTextNodeChange( mutation ) {
  77097. // One new node.
  77098. if ( mutation.newChildren.length - mutation.oldChildren.length != 1 ) {
  77099. return;
  77100. }
  77101. // Which is text.
  77102. const diffResult = Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__["default"])( mutation.oldChildren, mutation.newChildren, compareChildNodes );
  77103. const changes = Object(_ckeditor_ckeditor5_utils_src_difftochanges__WEBPACK_IMPORTED_MODULE_1__["default"])( diffResult, mutation.newChildren );
  77104. // In case of [ delete, insert, insert ] the previous check will not exit.
  77105. if ( changes.length > 1 ) {
  77106. return;
  77107. }
  77108. const change = changes[ 0 ];
  77109. // Which is text.
  77110. if ( !( !!change.values[ 0 ] && change.values[ 0 ].is( '$text' ) ) ) {
  77111. return;
  77112. }
  77113. return change;
  77114. }
  77115. /**
  77116. * Checks whether two view nodes are identical, which means they are the same object
  77117. * or contain exactly same data (in case of text nodes).
  77118. *
  77119. * @private
  77120. * @param {module:engine/view/node~Node} oldChild
  77121. * @param {module:engine/view/node~Node} newChild
  77122. * @returns {Boolean}
  77123. */
  77124. function compareChildNodes( oldChild, newChild ) {
  77125. if ( !!oldChild && oldChild.is( '$text' ) && !!newChild && newChild.is( '$text' ) ) {
  77126. return oldChild.data === newChild.data;
  77127. } else {
  77128. return oldChild === newChild;
  77129. }
  77130. }
  77131. /**
  77132. * Checks if <kbd>Shift</kbd> + <kbd>Delete</kbd> keystroke was pressed on a non-collapsed selection.
  77133. *
  77134. * This key combination has a special meaning on Windows machines and it should work in the same way as the `cut` event on a non-collapsed
  77135. * selection.
  77136. *
  77137. * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData Event data.
  77138. * @param {module:engine/view/document~Document} document The document instance on which the event has been fired.
  77139. * @returns {Boolean}
  77140. */
  77141. function isShiftDeleteOnNonCollapsedSelection( domEventData, document ) {
  77142. const selection = document.selection;
  77143. const isShiftDelete = domEventData.shiftKey && domEventData.keyCode === _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].delete;
  77144. const isNonCollapsedSelection = !selection.isCollapsed;
  77145. return isShiftDelete && isNonCollapsedSelection;
  77146. }
  77147. /***/ }),
  77148. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js":
  77149. /*!*********************************************************************************!*\
  77150. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js ***!
  77151. \*********************************************************************************/
  77152. /*! exports provided: default */
  77153. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77154. "use strict";
  77155. __webpack_require__.r(__webpack_exports__);
  77156. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return clickOutsideHandler; });
  77157. /**
  77158. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77159. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77160. */
  77161. /**
  77162. * @module ui/bindings/clickoutsidehandler
  77163. */
  77164. /* global document */
  77165. /**
  77166. * Handles clicking **outside** of a specified set of elements, then fires an action.
  77167. *
  77168. * **Note**: Actually, the action is executed upon `mousedown`, not `click`. It prevents
  77169. * certain issues when the user keeps holding the mouse button and the UI cannot react
  77170. * properly.
  77171. *
  77172. * @param {Object} options Configuration options.
  77173. * @param {module:utils/dom/emittermixin~Emitter} options.emitter The emitter to which this behavior
  77174. * should be added.
  77175. * @param {Function} options.activator Function returning a `Boolean`, to determine whether the handler is active.
  77176. * @param {Array.<HTMLElement>} options.contextElements HTML elements that determine the scope of the
  77177. * handler. Clicking any of them or their descendants will **not** fire the callback.
  77178. * @param {Function} options.callback An action executed by the handler.
  77179. */
  77180. function clickOutsideHandler( { emitter, activator, callback, contextElements } ) {
  77181. emitter.listenTo( document, 'mousedown', ( evt, domEvt ) => {
  77182. if ( !activator() ) {
  77183. return;
  77184. }
  77185. // Check if `composedPath` is `undefined` in case the browser does not support native shadow DOM.
  77186. // Can be removed when all supported browsers support native shadow DOM.
  77187. const path = typeof domEvt.composedPath == 'function' ? domEvt.composedPath() : [];
  77188. for ( const contextElement of contextElements ) {
  77189. if ( contextElement.contains( domEvt.target ) || path.includes( contextElement ) ) {
  77190. return;
  77191. }
  77192. }
  77193. callback();
  77194. } );
  77195. }
  77196. /***/ }),
  77197. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/injectcsstransitiondisabler.js":
  77198. /*!*****************************************************************************************!*\
  77199. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/bindings/injectcsstransitiondisabler.js ***!
  77200. \*****************************************************************************************/
  77201. /*! exports provided: default */
  77202. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77203. "use strict";
  77204. __webpack_require__.r(__webpack_exports__);
  77205. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectCssTransitionDisabler; });
  77206. /**
  77207. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77208. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77209. */
  77210. /**
  77211. * @module ui/bindings/injectcsstransitiondisabler
  77212. */
  77213. /**
  77214. * A decorator that brings the possibility to temporarily disable CSS transitions using
  77215. * {@link module:ui/view~View} methods. It is helpful when, for instance, the transitions should not happen
  77216. * when the view is first displayed but they should work normal in other cases.
  77217. *
  77218. * The methods to control the CSS transitions are:
  77219. * * `disableCssTransitions()` – Adds the `.ck-transitions-disabled` class to the
  77220. * {@link module:ui/view~View#element view element}.
  77221. * * `enableCssTransitions()` – Removes the `.ck-transitions-disabled` class from the
  77222. * {@link module:ui/view~View#element view element}.
  77223. *
  77224. * **Note**: This helper extends the {@link module:ui/view~View#template template} and must be used **after**
  77225. * {@link module:ui/view~View#setTemplate} is called:
  77226. *
  77227. * import injectCssTransitionDisabler from '@ckeditor/ckeditor5-ui/src/bindings/injectcsstransitiondisabler';
  77228. *
  77229. * class MyView extends View {
  77230. * constructor() {
  77231. * super();
  77232. *
  77233. * // ...
  77234. *
  77235. * this.setTemplate( { ... } );
  77236. *
  77237. * // ...
  77238. *
  77239. * injectCssTransitionDisabler( this );
  77240. *
  77241. * // ...
  77242. * }
  77243. * }
  77244. *
  77245. * The usage comes down to:
  77246. *
  77247. * const view = new MyView();
  77248. *
  77249. * // ...
  77250. *
  77251. * view.disableCssTransitions();
  77252. * view.show();
  77253. * view.enableCssTransitions();
  77254. *
  77255. * @param {module:ui/view~View} view View instance that should get this functionality.
  77256. */
  77257. function injectCssTransitionDisabler( view ) {
  77258. view.set( '_isCssTransitionsDisabled', false );
  77259. view.disableCssTransitions = () => {
  77260. view._isCssTransitionsDisabled = true;
  77261. };
  77262. view.enableCssTransitions = () => {
  77263. view._isCssTransitionsDisabled = false;
  77264. };
  77265. view.extendTemplate( {
  77266. attributes: {
  77267. class: [
  77268. view.bindTemplate.if( '_isCssTransitionsDisabled', 'ck-transitions-disabled' )
  77269. ]
  77270. }
  77271. } );
  77272. }
  77273. /***/ }),
  77274. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/preventdefault.js":
  77275. /*!****************************************************************************!*\
  77276. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/bindings/preventdefault.js ***!
  77277. \****************************************************************************/
  77278. /*! exports provided: default */
  77279. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77280. "use strict";
  77281. __webpack_require__.r(__webpack_exports__);
  77282. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return preventDefault; });
  77283. /**
  77284. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77285. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77286. */
  77287. /**
  77288. * @module ui/bindings/preventdefault
  77289. */
  77290. /**
  77291. * A helper which executes a native `Event.preventDefault()` if the target of an event equals the
  77292. * {@link module:ui/view~View#element element of the view}. It shortens the definition of a
  77293. * {@link module:ui/view~View#template template}.
  77294. *
  77295. * // In a class extending View.
  77296. * import preventDefault from '@ckeditor/ckeditor5-ui/src/bindings/preventdefault';
  77297. *
  77298. * // ...
  77299. *
  77300. * this.setTemplate( {
  77301. * tag: 'div',
  77302. *
  77303. * on: {
  77304. * // Prevent the default mousedown action on this view.
  77305. * mousedown: preventDefault( this )
  77306. * }
  77307. * } );
  77308. *
  77309. * @param {module:ui/view~View} view View instance that defines the template.
  77310. * @returns {module:ui/template~TemplateToBinding}
  77311. */
  77312. function preventDefault( view ) {
  77313. return view.bindTemplate.to( evt => {
  77314. if ( evt.target === view.element ) {
  77315. evt.preventDefault();
  77316. }
  77317. } );
  77318. }
  77319. /***/ }),
  77320. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js":
  77321. /*!***************************************************************************!*\
  77322. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js ***!
  77323. \***************************************************************************/
  77324. /*! exports provided: default */
  77325. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77326. "use strict";
  77327. __webpack_require__.r(__webpack_exports__);
  77328. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return submitHandler; });
  77329. /**
  77330. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77331. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77332. */
  77333. /**
  77334. * @module ui/bindings/submithandler
  77335. */
  77336. /**
  77337. * A handler useful for {@link module:ui/view~View views} working as HTML forms. It intercepts a native DOM
  77338. * `submit` event, prevents the default web browser behavior (navigation and page reload) and
  77339. * fires the `submit` event on a view instead. Such a custom event can be then used by any
  77340. * {@link module:utils/dom/emittermixin~Emitter emitter}, e.g. to serialize the form data.
  77341. *
  77342. * import submitHandler from '@ckeditor/ckeditor5-ui/src/bindings/submithandler';
  77343. *
  77344. * // ...
  77345. *
  77346. * class AnyFormView extends View {
  77347. * constructor() {
  77348. * super();
  77349. *
  77350. * // ...
  77351. *
  77352. * submitHandler( {
  77353. * view: this
  77354. * } );
  77355. * }
  77356. * }
  77357. *
  77358. * // ...
  77359. *
  77360. * const view = new AnyFormView();
  77361. *
  77362. * // A sample listener attached by an emitter working with the view.
  77363. * this.listenTo( view, 'submit', () => {
  77364. * saveTheFormData();
  77365. * hideTheForm();
  77366. * } );
  77367. *
  77368. * @param {Object} [options] Configuration options.
  77369. * @param {module:ui/view~View} options.view The view which DOM `submit` events should be handled.
  77370. */
  77371. function submitHandler( { view } ) {
  77372. view.listenTo( view.element, 'submit', ( evt, domEvt ) => {
  77373. domEvt.preventDefault();
  77374. view.fire( 'submit' );
  77375. }, { useCapture: true } );
  77376. }
  77377. /***/ }),
  77378. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js":
  77379. /*!**********************************************************************!*\
  77380. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js ***!
  77381. \**********************************************************************/
  77382. /*! exports provided: default */
  77383. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77384. "use strict";
  77385. __webpack_require__.r(__webpack_exports__);
  77386. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ButtonView; });
  77387. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  77388. /* harmony import */ var _icon_iconview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../icon/iconview */ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js");
  77389. /* harmony import */ var _tooltip_tooltipview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../tooltip/tooltipview */ "./node_modules/@ckeditor/ckeditor5-ui/src/tooltip/tooltipview.js");
  77390. /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  77391. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  77392. /* harmony import */ var _theme_components_button_button_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/components/button/button.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css");
  77393. /**
  77394. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77395. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77396. */
  77397. /**
  77398. * @module ui/button/buttonview
  77399. */
  77400. /**
  77401. * The button view class.
  77402. *
  77403. * const view = new ButtonView();
  77404. *
  77405. * view.set( {
  77406. * label: 'A button',
  77407. * keystroke: 'Ctrl+B',
  77408. * tooltip: true,
  77409. * withText: true
  77410. * } );
  77411. *
  77412. * view.render();
  77413. *
  77414. * document.body.append( view.element );
  77415. *
  77416. * @extends module:ui/view~View
  77417. * @implements module:ui/button/button~Button
  77418. */
  77419. class ButtonView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  77420. /**
  77421. * @inheritDoc
  77422. */
  77423. constructor( locale ) {
  77424. super( locale );
  77425. const bind = this.bindTemplate;
  77426. const ariaLabelUid = Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_3__["default"])();
  77427. // Implement the Button interface.
  77428. this.set( 'class' );
  77429. this.set( 'labelStyle' );
  77430. this.set( 'icon' );
  77431. this.set( 'isEnabled', true );
  77432. this.set( 'isOn', false );
  77433. this.set( 'isVisible', true );
  77434. this.set( 'isToggleable', false );
  77435. this.set( 'keystroke' );
  77436. this.set( 'label' );
  77437. this.set( 'tabindex', -1 );
  77438. this.set( 'tooltip' );
  77439. this.set( 'tooltipPosition', 's' );
  77440. this.set( 'type', 'button' );
  77441. this.set( 'withText', false );
  77442. this.set( 'withKeystroke', false );
  77443. /**
  77444. * Collection of the child views inside of the button {@link #element}.
  77445. *
  77446. * @readonly
  77447. * @member {module:ui/viewcollection~ViewCollection}
  77448. */
  77449. this.children = this.createCollection();
  77450. /**
  77451. * Tooltip of the button view. It is configurable using the {@link #tooltip tooltip attribute}.
  77452. *
  77453. * @readonly
  77454. * @member {module:ui/tooltip/tooltipview~TooltipView} #tooltipView
  77455. */
  77456. this.tooltipView = this._createTooltipView();
  77457. /**
  77458. * Label of the button view. It is configurable using the {@link #label label attribute}.
  77459. *
  77460. * @readonly
  77461. * @member {module:ui/view~View} #labelView
  77462. */
  77463. this.labelView = this._createLabelView( ariaLabelUid );
  77464. /**
  77465. * The icon view of the button. Will be added to {@link #children} when the
  77466. * {@link #icon icon attribute} is defined.
  77467. *
  77468. * @readonly
  77469. * @member {module:ui/icon/iconview~IconView} #iconView
  77470. */
  77471. this.iconView = new _icon_iconview__WEBPACK_IMPORTED_MODULE_1__["default"]();
  77472. this.iconView.extendTemplate( {
  77473. attributes: {
  77474. class: 'ck-button__icon'
  77475. }
  77476. } );
  77477. /**
  77478. * A view displaying the keystroke of the button next to the {@link #labelView label}.
  77479. * Added to {@link #children} when the {@link #withKeystroke `withKeystroke` attribute}
  77480. * is defined.
  77481. *
  77482. * @readonly
  77483. * @member {module:ui/view/view~View} #keystrokeView
  77484. */
  77485. this.keystrokeView = this._createKeystrokeView();
  77486. /**
  77487. * Tooltip of the button bound to the template.
  77488. *
  77489. * @see #tooltip
  77490. * @see #_getTooltipString
  77491. * @private
  77492. * @observable
  77493. * @member {Boolean} #_tooltipString
  77494. */
  77495. this.bind( '_tooltipString' ).to(
  77496. this, 'tooltip',
  77497. this, 'label',
  77498. this, 'keystroke',
  77499. this._getTooltipString.bind( this )
  77500. );
  77501. this.setTemplate( {
  77502. tag: 'button',
  77503. attributes: {
  77504. class: [
  77505. 'ck',
  77506. 'ck-button',
  77507. bind.to( 'class' ),
  77508. bind.if( 'isEnabled', 'ck-disabled', value => !value ),
  77509. bind.if( 'isVisible', 'ck-hidden', value => !value ),
  77510. bind.to( 'isOn', value => value ? 'ck-on' : 'ck-off' ),
  77511. bind.if( 'withText', 'ck-button_with-text' ),
  77512. bind.if( 'withKeystroke', 'ck-button_with-keystroke' )
  77513. ],
  77514. type: bind.to( 'type', value => value ? value : 'button' ),
  77515. tabindex: bind.to( 'tabindex' ),
  77516. 'aria-labelledby': `ck-editor__aria-label_${ ariaLabelUid }`,
  77517. 'aria-disabled': bind.if( 'isEnabled', true, value => !value ),
  77518. 'aria-pressed': bind.to( 'isOn', value => this.isToggleable ? String( value ) : false )
  77519. },
  77520. children: this.children,
  77521. on: {
  77522. mousedown: bind.to( evt => {
  77523. evt.preventDefault();
  77524. } ),
  77525. click: bind.to( evt => {
  77526. // We can't make the button disabled using the disabled attribute, because it won't be focusable.
  77527. // Though, shouldn't this condition be moved to the button controller?
  77528. if ( this.isEnabled ) {
  77529. this.fire( 'execute' );
  77530. } else {
  77531. // Prevent the default when button is disabled, to block e.g.
  77532. // automatic form submitting. See ckeditor/ckeditor5-link#74.
  77533. evt.preventDefault();
  77534. }
  77535. } )
  77536. }
  77537. } );
  77538. }
  77539. /**
  77540. * @inheritDoc
  77541. */
  77542. render() {
  77543. super.render();
  77544. if ( this.icon ) {
  77545. this.iconView.bind( 'content' ).to( this, 'icon' );
  77546. this.children.add( this.iconView );
  77547. }
  77548. this.children.add( this.tooltipView );
  77549. this.children.add( this.labelView );
  77550. if ( this.withKeystroke && this.keystroke ) {
  77551. this.children.add( this.keystrokeView );
  77552. }
  77553. }
  77554. /**
  77555. * Focuses the {@link #element} of the button.
  77556. */
  77557. focus() {
  77558. this.element.focus();
  77559. }
  77560. /**
  77561. * Creates a {@link module:ui/tooltip/tooltipview~TooltipView} instance and binds it with button
  77562. * attributes.
  77563. *
  77564. * @private
  77565. * @returns {module:ui/tooltip/tooltipview~TooltipView}
  77566. */
  77567. _createTooltipView() {
  77568. const tooltipView = new _tooltip_tooltipview__WEBPACK_IMPORTED_MODULE_2__["default"]();
  77569. tooltipView.bind( 'text' ).to( this, '_tooltipString' );
  77570. tooltipView.bind( 'position' ).to( this, 'tooltipPosition' );
  77571. return tooltipView;
  77572. }
  77573. /**
  77574. * Creates a label view instance and binds it with button attributes.
  77575. *
  77576. * @private
  77577. * @param {String} ariaLabelUid The aria label UID.
  77578. * @returns {module:ui/view~View}
  77579. */
  77580. _createLabelView( ariaLabelUid ) {
  77581. const labelView = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]();
  77582. const bind = this.bindTemplate;
  77583. labelView.setTemplate( {
  77584. tag: 'span',
  77585. attributes: {
  77586. class: [
  77587. 'ck',
  77588. 'ck-button__label'
  77589. ],
  77590. style: bind.to( 'labelStyle' ),
  77591. id: `ck-editor__aria-label_${ ariaLabelUid }`
  77592. },
  77593. children: [
  77594. {
  77595. text: this.bindTemplate.to( 'label' )
  77596. }
  77597. ]
  77598. } );
  77599. return labelView;
  77600. }
  77601. /**
  77602. * Creates a view that displays a keystroke next to a {@link #labelView label }
  77603. * and binds it with button attributes.
  77604. *
  77605. * @private
  77606. * @returns {module:ui/view~View}
  77607. */
  77608. _createKeystrokeView() {
  77609. const keystrokeView = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]();
  77610. keystrokeView.setTemplate( {
  77611. tag: 'span',
  77612. attributes: {
  77613. class: [
  77614. 'ck',
  77615. 'ck-button__keystroke'
  77616. ]
  77617. },
  77618. children: [
  77619. {
  77620. text: this.bindTemplate.to( 'keystroke', text => Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["getEnvKeystrokeText"])( text ) )
  77621. }
  77622. ]
  77623. } );
  77624. return keystrokeView;
  77625. }
  77626. /**
  77627. * Gets the text for the {@link #tooltipView} from the combination of
  77628. * {@link #tooltip}, {@link #label} and {@link #keystroke} attributes.
  77629. *
  77630. * @private
  77631. * @see #tooltip
  77632. * @see #_tooltipString
  77633. * @param {Boolean|String|Function} tooltip Button tooltip.
  77634. * @param {String} label Button label.
  77635. * @param {String} keystroke Button keystroke.
  77636. * @returns {String}
  77637. */
  77638. _getTooltipString( tooltip, label, keystroke ) {
  77639. if ( tooltip ) {
  77640. if ( typeof tooltip == 'string' ) {
  77641. return tooltip;
  77642. } else {
  77643. if ( keystroke ) {
  77644. keystroke = Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["getEnvKeystrokeText"])( keystroke );
  77645. }
  77646. if ( tooltip instanceof Function ) {
  77647. return tooltip( label, keystroke );
  77648. } else {
  77649. return `${ label }${ keystroke ? ` (${ keystroke })` : '' }`;
  77650. }
  77651. }
  77652. }
  77653. return '';
  77654. }
  77655. }
  77656. /***/ }),
  77657. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js":
  77658. /*!****************************************************************************!*\
  77659. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js ***!
  77660. \****************************************************************************/
  77661. /*! exports provided: default */
  77662. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77663. "use strict";
  77664. __webpack_require__.r(__webpack_exports__);
  77665. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SwitchButtonView; });
  77666. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  77667. /* harmony import */ var _buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  77668. /* harmony import */ var _theme_components_button_switchbutton_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/components/button/switchbutton.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css");
  77669. /**
  77670. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77671. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77672. */
  77673. /**
  77674. * @module ui/button/switchbuttonview
  77675. */
  77676. /**
  77677. * The switch button view class.
  77678. *
  77679. * const view = new SwitchButtonView();
  77680. *
  77681. * view.set( {
  77682. * withText: true,
  77683. * label: 'Switch me!'
  77684. * } );
  77685. *
  77686. * view.render();
  77687. *
  77688. * document.body.append( view.element );
  77689. *
  77690. * @extends module:ui/button/buttonview~ButtonView
  77691. */
  77692. class SwitchButtonView extends _buttonview__WEBPACK_IMPORTED_MODULE_1__["default"] {
  77693. /**
  77694. * @inheritDoc
  77695. */
  77696. constructor( locale ) {
  77697. super( locale );
  77698. this.isToggleable = true;
  77699. /**
  77700. * The toggle switch of the button.
  77701. *
  77702. * @readonly
  77703. * @member {module:ui/view~View} #toggleSwitchView
  77704. */
  77705. this.toggleSwitchView = this._createToggleView();
  77706. this.extendTemplate( {
  77707. attributes: {
  77708. class: 'ck-switchbutton'
  77709. }
  77710. } );
  77711. }
  77712. /**
  77713. * @inheritDoc
  77714. */
  77715. render() {
  77716. super.render();
  77717. this.children.add( this.toggleSwitchView );
  77718. }
  77719. /**
  77720. * Creates a toggle child view.
  77721. *
  77722. * @private
  77723. * @returns {module:ui/view~View}
  77724. */
  77725. _createToggleView() {
  77726. const toggleSwitchView = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]();
  77727. toggleSwitchView.setTemplate( {
  77728. tag: 'span',
  77729. attributes: {
  77730. class: [
  77731. 'ck',
  77732. 'ck-button__toggle'
  77733. ]
  77734. },
  77735. children: [
  77736. {
  77737. tag: 'span',
  77738. attributes: {
  77739. class: [
  77740. 'ck',
  77741. 'ck-button__toggle__inner'
  77742. ]
  77743. }
  77744. }
  77745. ]
  77746. } );
  77747. return toggleSwitchView;
  77748. }
  77749. }
  77750. /***/ }),
  77751. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview.js":
  77752. /*!****************************************************************************!*\
  77753. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview.js ***!
  77754. \****************************************************************************/
  77755. /*! exports provided: default */
  77756. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77757. "use strict";
  77758. __webpack_require__.r(__webpack_exports__);
  77759. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ColorGridView; });
  77760. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  77761. /* harmony import */ var _colortileview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./colortileview */ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js");
  77762. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  77763. /* harmony import */ var _focuscycler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
  77764. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  77765. /* harmony import */ var _theme_components_colorgrid_colorgrid_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/components/colorgrid/colorgrid.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css");
  77766. /**
  77767. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77768. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77769. */
  77770. /**
  77771. * @module ui/colorgrid/colorgrid
  77772. */
  77773. /**
  77774. * A grid of {@link module:ui/colorgrid/colortile~ColorTileView color tiles}.
  77775. *
  77776. * @extends module:ui/view~View
  77777. */
  77778. class ColorGridView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  77779. /**
  77780. * Creates an instance of a color grid containing {@link module:ui/colorgrid/colortile~ColorTileView tiles}.
  77781. *
  77782. * @param {module:utils/locale~Locale} [locale] The localization services instance.
  77783. * @param {Object} options Component configuration
  77784. * @param {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>} [options.colorDefinitions] Array with definitions
  77785. * required to create the {@link module:ui/colorgrid/colortile~ColorTileView tiles}.
  77786. * @param {Number} options.columns A number of columns to display the tiles.
  77787. */
  77788. constructor( locale, options ) {
  77789. super( locale );
  77790. const colorDefinitions = options && options.colorDefinitions || [];
  77791. const viewStyleAttribute = {};
  77792. if ( options && options.columns ) {
  77793. viewStyleAttribute.gridTemplateColumns = `repeat( ${ options.columns }, 1fr)`;
  77794. }
  77795. /**
  77796. * The color of the currently selected color tile in {@link #items}.
  77797. *
  77798. * @observable
  77799. * @type {String}
  77800. */
  77801. this.set( 'selectedColor' );
  77802. /**
  77803. * Collection of the child tile views.
  77804. *
  77805. * @readonly
  77806. * @member {module:ui/viewcollection~ViewCollection}
  77807. */
  77808. this.items = this.createCollection();
  77809. /**
  77810. * Tracks information about DOM focus in the grid.
  77811. *
  77812. * @readonly
  77813. * @member {module:utils/focustracker~FocusTracker}
  77814. */
  77815. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_2__["default"]();
  77816. /**
  77817. * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  77818. *
  77819. * @readonly
  77820. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  77821. */
  77822. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_4__["default"]();
  77823. /**
  77824. * Helps cycling over focusable {@link #items} in the grid.
  77825. *
  77826. * @readonly
  77827. * @protected
  77828. * @member {module:ui/focuscycler~FocusCycler}
  77829. */
  77830. this._focusCycler = new _focuscycler__WEBPACK_IMPORTED_MODULE_3__["default"]( {
  77831. focusables: this.items,
  77832. focusTracker: this.focusTracker,
  77833. keystrokeHandler: this.keystrokes,
  77834. actions: {
  77835. // Navigate grid items backwards using the arrowup key.
  77836. focusPrevious: 'arrowleft',
  77837. // Navigate grid items forwards using the arrowdown key.
  77838. focusNext: 'arrowright'
  77839. }
  77840. } );
  77841. this.items.on( 'add', ( evt, colorTile ) => {
  77842. colorTile.isOn = colorTile.color === this.selectedColor;
  77843. } );
  77844. colorDefinitions.forEach( color => {
  77845. const colorTile = new _colortileview__WEBPACK_IMPORTED_MODULE_1__["default"]();
  77846. colorTile.set( {
  77847. color: color.color,
  77848. label: color.label,
  77849. tooltip: true,
  77850. hasBorder: color.options.hasBorder
  77851. } );
  77852. colorTile.on( 'execute', () => {
  77853. this.fire( 'execute', {
  77854. value: color.color,
  77855. hasBorder: color.options.hasBorder,
  77856. label: color.label
  77857. } );
  77858. } );
  77859. this.items.add( colorTile );
  77860. } );
  77861. this.setTemplate( {
  77862. tag: 'div',
  77863. children: this.items,
  77864. attributes: {
  77865. class: [
  77866. 'ck',
  77867. 'ck-color-grid'
  77868. ],
  77869. style: viewStyleAttribute
  77870. }
  77871. } );
  77872. this.on( 'change:selectedColor', ( evt, name, selectedColor ) => {
  77873. for ( const item of this.items ) {
  77874. item.isOn = item.color === selectedColor;
  77875. }
  77876. } );
  77877. }
  77878. /**
  77879. * Focuses the first focusable in {@link #items}.
  77880. */
  77881. focus() {
  77882. if ( this.items.length ) {
  77883. this.items.first.focus();
  77884. }
  77885. }
  77886. /**
  77887. * Focuses the last focusable in {@link #items}.
  77888. */
  77889. focusLast() {
  77890. if ( this.items.length ) {
  77891. this.items.last.focus();
  77892. }
  77893. }
  77894. /**
  77895. * @inheritDoc
  77896. */
  77897. render() {
  77898. super.render();
  77899. // Items added before rendering should be known to the #focusTracker.
  77900. for ( const item of this.items ) {
  77901. this.focusTracker.add( item.element );
  77902. }
  77903. this.items.on( 'add', ( evt, item ) => {
  77904. this.focusTracker.add( item.element );
  77905. } );
  77906. this.items.on( 'remove', ( evt, item ) => {
  77907. this.focusTracker.remove( item.element );
  77908. } );
  77909. // Start listening for the keystrokes coming from #element.
  77910. this.keystrokes.listenTo( this.element );
  77911. }
  77912. /**
  77913. * @inheritDoc
  77914. */
  77915. destroy() {
  77916. super.destroy();
  77917. this.focusTracker.destroy();
  77918. this.keystrokes.destroy();
  77919. }
  77920. /**
  77921. * Fired when the `ColorTileView` for the picked item is executed.
  77922. *
  77923. * @event execute
  77924. * @param {Object} data Additional information about the event.
  77925. * @param {String} data.value The value of the selected color
  77926. * ({@link module:ui/colorgrid/colorgrid~ColorDefinition#color `color.color`}).
  77927. * @param {Boolean} data.hasBorder The `hasBorder` property of the selected color
  77928. * ({@link module:ui/colorgrid/colorgrid~ColorDefinition#options `color.options.hasBorder`}).
  77929. * @param {String} data.Label The label of the selected color
  77930. * ({@link module:ui/colorgrid/colorgrid~ColorDefinition#label `color.label`})
  77931. */
  77932. }
  77933. /**
  77934. * A color definition used to create a {@link module:ui/colorgrid/colortile~ColorTileView}.
  77935. *
  77936. * {
  77937. * color: 'hsl(0, 0%, 75%)',
  77938. * label: 'Light Grey',
  77939. * options: {
  77940. * hasBorder: true
  77941. * }
  77942. * }
  77943. *
  77944. * @typedef {Object} module:ui/colorgrid/colorgrid~ColorDefinition
  77945. * @type Object
  77946. *
  77947. * @property {String} color String representing a color.
  77948. * It is used as value of background-color style in {@link module:ui/colorgrid/colortile~ColorTileView}.
  77949. * @property {String} label String used as label for {@link module:ui/colorgrid/colortile~ColorTileView}.
  77950. * @property {Object} options Additional options passed to create a {@link module:ui/colorgrid/colortile~ColorTileView}.
  77951. * @property {Boolean} options.hasBorder A flag that indicates if special a CSS class should be added
  77952. * to {@link module:ui/colorgrid/colortile~ColorTileView}, which renders a border around it.
  77953. */
  77954. /***/ }),
  77955. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js":
  77956. /*!****************************************************************************!*\
  77957. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js ***!
  77958. \****************************************************************************/
  77959. /*! exports provided: default */
  77960. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77961. "use strict";
  77962. __webpack_require__.r(__webpack_exports__);
  77963. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ColorTileView; });
  77964. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  77965. /* harmony import */ var _theme_icons_color_tile_check_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/icons/color-tile-check.svg */ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/color-tile-check.svg");
  77966. /**
  77967. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  77968. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77969. */
  77970. /**
  77971. * @module ui/colorgrid/colortile
  77972. */
  77973. /**
  77974. * This class represents a single color tile in the {@link module:ui/colorgrid/colorgrid~ColorGridView}.
  77975. *
  77976. * @extends module:ui/button/buttonview~ButtonView
  77977. */
  77978. class ColorTileView extends _button_buttonview__WEBPACK_IMPORTED_MODULE_0__["default"] {
  77979. constructor( locale ) {
  77980. super( locale );
  77981. const bind = this.bindTemplate;
  77982. /**
  77983. * String representing a color shown as tile's background.
  77984. *
  77985. * @type {String}
  77986. */
  77987. this.set( 'color' );
  77988. /**
  77989. * A flag that toggles a special CSS class responsible for displaying
  77990. * a border around the button.
  77991. *
  77992. * @type {Boolean}
  77993. */
  77994. this.set( 'hasBorder' );
  77995. this.icon = _theme_icons_color_tile_check_svg__WEBPACK_IMPORTED_MODULE_1__["default"];
  77996. this.extendTemplate( {
  77997. attributes: {
  77998. style: {
  77999. backgroundColor: bind.to( 'color' )
  78000. },
  78001. class: [
  78002. 'ck',
  78003. 'ck-color-grid__tile',
  78004. bind.if( 'hasBorder', 'ck-color-table__color-tile_bordered' )
  78005. ]
  78006. }
  78007. } );
  78008. }
  78009. /**
  78010. * @inheritDoc
  78011. */
  78012. render() {
  78013. super.render();
  78014. this.iconView.fillColor = 'hsl(0, 0%, 100%)';
  78015. }
  78016. }
  78017. /***/ }),
  78018. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/utils.js":
  78019. /*!********************************************************************!*\
  78020. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/utils.js ***!
  78021. \********************************************************************/
  78022. /*! exports provided: getLocalizedColorOptions, normalizeColorOptions, normalizeSingleColorDefinition */
  78023. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  78024. "use strict";
  78025. __webpack_require__.r(__webpack_exports__);
  78026. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalizedColorOptions", function() { return getLocalizedColorOptions; });
  78027. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeColorOptions", function() { return normalizeColorOptions; });
  78028. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeSingleColorDefinition", function() { return normalizeSingleColorDefinition; });
  78029. /**
  78030. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  78031. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  78032. */
  78033. /**
  78034. * @module ui/colorgrid/utils
  78035. */
  78036. /**
  78037. * Returns color configuration options as defined in `editor.config.(fontColor|fontBackgroundColor).colors` or
  78038. * `editor.config.table.(tableProperties|tableCellProperties).(background|border).colors
  78039. * but processed to account for editor localization in the correct language.
  78040. *
  78041. * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
  78042. * when the user configuration is defined because the editor does not exist yet.
  78043. *
  78044. * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor#locale} instance.
  78045. * @param {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>} options
  78046. * @returns {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>}.
  78047. */
  78048. function getLocalizedColorOptions( locale, options ) {
  78049. const t = locale.t;
  78050. const localizedColorNames = {
  78051. Black: t( 'Black' ),
  78052. 'Dim grey': t( 'Dim grey' ),
  78053. Grey: t( 'Grey' ),
  78054. 'Light grey': t( 'Light grey' ),
  78055. White: t( 'White' ),
  78056. Red: t( 'Red' ),
  78057. Orange: t( 'Orange' ),
  78058. Yellow: t( 'Yellow' ),
  78059. 'Light green': t( 'Light green' ),
  78060. Green: t( 'Green' ),
  78061. Aquamarine: t( 'Aquamarine' ),
  78062. Turquoise: t( 'Turquoise' ),
  78063. 'Light blue': t( 'Light blue' ),
  78064. Blue: t( 'Blue' ),
  78065. Purple: t( 'Purple' )
  78066. };
  78067. return options.map( colorOption => {
  78068. const label = localizedColorNames[ colorOption.label ];
  78069. if ( label && label != colorOption.label ) {
  78070. colorOption.label = label;
  78071. }
  78072. return colorOption;
  78073. } );
  78074. }
  78075. /**
  78076. * Creates a unified color definition object from color configuration options.
  78077. * The object contains the information necessary to both render the UI and initialize the conversion.
  78078. *
  78079. * @param {module:ui/colorgrid/colorgrid~ColorDefinition} options
  78080. * @returns {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>}
  78081. */
  78082. function normalizeColorOptions( options ) {
  78083. return options
  78084. .map( normalizeSingleColorDefinition )
  78085. .filter( option => !!option );
  78086. }
  78087. // Creates a normalized color definition from the user-defined configuration.
  78088. // The "normalization" means it will create full
  78089. // {@link module:ui/colorgrid/colorgrid~ColorDefinition `ColorDefinition-like`}
  78090. // object for string values, and add a `view` property, for each definition.
  78091. //
  78092. // @param {String|module:ui/colorgrid/colorgrid~ColorDefinition}
  78093. // @returns {module:ui/colorgrid/colorgrid~ColorDefinition}
  78094. function normalizeSingleColorDefinition( color ) {
  78095. if ( typeof color === 'string' ) {
  78096. return {
  78097. model: color,
  78098. label: color,
  78099. hasBorder: false,
  78100. view: {
  78101. name: 'span',
  78102. styles: {
  78103. color
  78104. }
  78105. }
  78106. };
  78107. } else {
  78108. return {
  78109. model: color.color,
  78110. label: color.label || color.color,
  78111. hasBorder: color.hasBorder === undefined ? false : color.hasBorder,
  78112. view: {
  78113. name: 'span',
  78114. styles: {
  78115. color: `${ color.color }`
  78116. }
  78117. }
  78118. };
  78119. }
  78120. }
  78121. /***/ }),
  78122. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/componentfactory.js":
  78123. /*!*********************************************************************!*\
  78124. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/componentfactory.js ***!
  78125. \*********************************************************************/
  78126. /*! exports provided: default */
  78127. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  78128. "use strict";
  78129. __webpack_require__.r(__webpack_exports__);
  78130. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ComponentFactory; });
  78131. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  78132. /**
  78133. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  78134. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  78135. */
  78136. /**
  78137. * @module ui/componentfactory
  78138. */
  78139. /**
  78140. * A helper class implementing the UI component ({@link module:ui/view~View view}) factory.
  78141. *
  78142. * It allows functions producing specific UI components to be registered under their unique names
  78143. * in the factory. A registered component can be then instantiated by providing its name.
  78144. * Note that names are case insensitive.
  78145. *
  78146. * // The editor provides localization tools for the factory.
  78147. * const factory = new ComponentFactory( editor );
  78148. *
  78149. * factory.add( 'foo', locale => new FooView( locale ) );
  78150. * factory.add( 'bar', locale => new BarView( locale ) );
  78151. *
  78152. * // An instance of FooView.
  78153. * const fooInstance = factory.create( 'foo' );
  78154. *
  78155. * // Names are case insensitive so this is also allowed:
  78156. * const barInstance = factory.create( 'Bar' );
  78157. *
  78158. * The {@link module:core/editor/editor~Editor#locale editor locale} is passed to the factory
  78159. * function when {@link module:ui/componentfactory~ComponentFactory#create} is called.
  78160. */
  78161. class ComponentFactory {
  78162. /**
  78163. * Creates an instance of the factory.
  78164. *
  78165. * @constructor
  78166. * @param {module:core/editor/editor~Editor} editor The editor instance.
  78167. */
  78168. constructor( editor ) {
  78169. /**
  78170. * The editor instance that the factory belongs to.
  78171. *
  78172. * @readonly
  78173. * @member {module:core/editor/editor~Editor}
  78174. */
  78175. this.editor = editor;
  78176. /**
  78177. * Registered component factories.
  78178. *
  78179. * @private
  78180. * @member {Map}
  78181. */
  78182. this._components = new Map();
  78183. }
  78184. /**
  78185. * Returns an iterator of registered component names. Names are returned in lower case.
  78186. *
  78187. * @returns {Iterable.<String>}
  78188. */
  78189. * names() {
  78190. for ( const value of this._components.values() ) {
  78191. yield value.originalName;
  78192. }
  78193. }
  78194. /**
  78195. * Registers a component factory function that will be used by the
  78196. * {@link #create create} method and called with the
  78197. * {@link module:core/editor/editor~Editor#locale editor locale} as an argument,
  78198. * allowing localization of the {@link module:ui/view~View view}.
  78199. *
  78200. * @param {String} name The name of the component.
  78201. * @param {Function} callback The callback that returns the component.
  78202. */
  78203. add( name, callback ) {
  78204. this._components.set( getNormalized( name ), { callback, originalName: name } );
  78205. }
  78206. /**
  78207. * Creates an instance of a component registered in the factory under a specific name.
  78208. *
  78209. * When called, the {@link module:core/editor/editor~Editor#locale editor locale} is passed to
  78210. * the previously {@link #add added} factory function, allowing localization of the
  78211. * {@link module:ui/view~View view}.
  78212. *
  78213. * @param {String} name The name of the component.
  78214. * @returns {module:ui/view~View} The instantiated component view.
  78215. */
  78216. create( name ) {
  78217. if ( !this.has( name ) ) {
  78218. /**
  78219. * The required component is not registered in the component factory. Please make sure
  78220. * the provided name is correct and the component has been correctly
  78221. * {@link #add added} to the factory.
  78222. *
  78223. * @error componentfactory-item-missing
  78224. * @param {String} name The name of the missing component.
  78225. */
  78226. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  78227. 'componentfactory-item-missing',
  78228. this,
  78229. { name }
  78230. );
  78231. }
  78232. return this._components.get( getNormalized( name ) ).callback( this.editor.locale );
  78233. }
  78234. /**
  78235. * Checks if a component of a given name is registered in the factory.
  78236. *
  78237. * @param {String} name The name of the component.
  78238. * @returns {Boolean}
  78239. */
  78240. has( name ) {
  78241. return this._components.has( getNormalized( name ) );
  78242. }
  78243. }
  78244. //
  78245. // Ensures that the component name used as the key in the internal map is in lower case.
  78246. //
  78247. // @private
  78248. // @param {String} name
  78249. // @returns {String}
  78250. function getNormalized( name ) {
  78251. return String( name ).toLowerCase();
  78252. }
  78253. /***/ }),
  78254. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js":
  78255. /*!***************************************************************************************!*\
  78256. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js ***!
  78257. \***************************************************************************************/
  78258. /*! exports provided: default */
  78259. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  78260. "use strict";
  78261. __webpack_require__.r(__webpack_exports__);
  78262. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DropdownButtonView; });
  78263. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  78264. /* harmony import */ var _theme_icons_dropdown_arrow_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../theme/icons/dropdown-arrow.svg */ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg");
  78265. /* harmony import */ var _icon_iconview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../icon/iconview */ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js");
  78266. /**
  78267. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  78268. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  78269. */
  78270. /**
  78271. * @module ui/dropdown/button/dropdownbuttonview
  78272. */
  78273. /**
  78274. * The default dropdown button view class.
  78275. *
  78276. * const view = new DropdownButtonView();
  78277. *
  78278. * view.set( {
  78279. * label: 'A button',
  78280. * keystroke: 'Ctrl+B',
  78281. * tooltip: true
  78282. * } );
  78283. *
  78284. * view.render();
  78285. *
  78286. * document.body.append( view.element );
  78287. *
  78288. * Also see the {@link module:ui/dropdown/utils~createDropdown `createDropdown()` util}.
  78289. *
  78290. * @implements module:ui/dropdown/button/dropdownbutton~DropdownButton
  78291. * @extends module:ui/button/buttonview~ButtonView
  78292. */
  78293. class DropdownButtonView extends _button_buttonview__WEBPACK_IMPORTED_MODULE_0__["default"] {
  78294. /**
  78295. * @inheritDoc
  78296. */
  78297. constructor( locale ) {
  78298. super( locale );
  78299. /**
  78300. * An icon that displays arrow to indicate a dropdown button.
  78301. *
  78302. * @readonly
  78303. * @member {module:ui/icon/iconview~IconView}
  78304. */
  78305. this.arrowView = this._createArrowView();
  78306. this.extendTemplate( {
  78307. attributes: {
  78308. 'aria-haspopup': true
  78309. }
  78310. } );
  78311. // The DropdownButton interface expects the open event upon which will open the dropdown.
  78312. this.delegate( 'execute' ).to( this, 'open' );
  78313. }
  78314. /**
  78315. * @inheritDoc
  78316. */
  78317. render() {
  78318. super.render();
  78319. this.children.add( this.arrowView );
  78320. }
  78321. /**
  78322. * Creates a {@link module:ui/icon/iconview~IconView} instance as {@link #arrowView}.
  78323. *
  78324. * @private
  78325. * @returns {module:ui/icon/iconview~IconView}
  78326. */
  78327. _createArrowView() {
  78328. const arrowView = new _icon_iconview__WEBPACK_IMPORTED_MODULE_2__["default"]();
  78329. arrowView.content = _theme_icons_dropdown_arrow_svg__WEBPACK_IMPORTED_MODULE_1__["default"];
  78330. arrowView.extendTemplate( {
  78331. attributes: {
  78332. class: 'ck-dropdown__arrow'
  78333. }
  78334. } );
  78335. return arrowView;
  78336. }
  78337. }
  78338. /***/ }),
  78339. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview.js":
  78340. /*!************************************************************************************!*\
  78341. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview.js ***!
  78342. \************************************************************************************/
  78343. /*! exports provided: default */
  78344. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  78345. "use strict";
  78346. __webpack_require__.r(__webpack_exports__);
  78347. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SplitButtonView; });
  78348. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  78349. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  78350. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  78351. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  78352. /* harmony import */ var _theme_icons_dropdown_arrow_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../theme/icons/dropdown-arrow.svg */ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg");
  78353. /* harmony import */ var _theme_components_dropdown_splitbutton_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../theme/components/dropdown/splitbutton.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css");
  78354. /**
  78355. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  78356. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  78357. */
  78358. /**
  78359. * @module ui/dropdown/button/splitbuttonview
  78360. */
  78361. /**
  78362. * The split button view class.
  78363. *
  78364. * const view = new SplitButtonView();
  78365. *
  78366. * view.set( {
  78367. * label: 'A button',
  78368. * keystroke: 'Ctrl+B',
  78369. * tooltip: true
  78370. * } );
  78371. *
  78372. * view.render();
  78373. *
  78374. * document.body.append( view.element );
  78375. *
  78376. * Also see the {@link module:ui/dropdown/utils~createDropdown `createDropdown()` util}.
  78377. *
  78378. * @implements module:ui/dropdown/button/dropdownbutton~DropdownButton
  78379. * @extends module:ui/view~View
  78380. */
  78381. class SplitButtonView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  78382. /**
  78383. * @inheritDoc
  78384. */
  78385. constructor( locale ) {
  78386. super( locale );
  78387. const bind = this.bindTemplate;
  78388. // Implement the Button interface.
  78389. this.set( 'class' );
  78390. this.set( 'icon' );
  78391. this.set( 'isEnabled', true );
  78392. this.set( 'isOn', false );
  78393. this.set( 'isToggleable', false );
  78394. this.set( 'isVisible', true );
  78395. this.set( 'keystroke' );
  78396. this.set( 'label' );
  78397. this.set( 'tabindex', -1 );
  78398. this.set( 'tooltip' );
  78399. this.set( 'tooltipPosition', 's' );
  78400. this.set( 'type', 'button' );
  78401. this.set( 'withText', false );
  78402. /**
  78403. * Collection of the child views inside of the split button {@link #element}.
  78404. *
  78405. * @readonly
  78406. * @member {module:ui/viewcollection~ViewCollection}
  78407. */
  78408. this.children = this.createCollection();
  78409. /**
  78410. * A main button of split button.
  78411. *
  78412. * @readonly
  78413. * @member {module:ui/button/buttonview~ButtonView}
  78414. */
  78415. this.actionView = this._createActionView();
  78416. /**
  78417. * A secondary button of split button that opens dropdown.
  78418. *
  78419. * @readonly
  78420. * @member {module:ui/button/buttonview~ButtonView}
  78421. */
  78422. this.arrowView = this._createArrowView();
  78423. /**
  78424. * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}. It manages
  78425. * keystrokes of the split button:
  78426. *
  78427. * * <kbd>▶</kbd> moves focus to arrow view when action view is focused,
  78428. * * <kbd>◀</kbd> moves focus to action view when arrow view is focused.
  78429. *
  78430. * @readonly
  78431. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  78432. */
  78433. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_2__["default"]();
  78434. /**
  78435. * Tracks information about DOM focus in the dropdown.
  78436. *
  78437. * @readonly
  78438. * @member {module:utils/focustracker~FocusTracker}
  78439. */
  78440. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_3__["default"]();
  78441. this.setTemplate( {
  78442. tag: 'div',
  78443. attributes: {
  78444. class: [
  78445. 'ck',
  78446. 'ck-splitbutton',
  78447. bind.to( 'class' ),
  78448. bind.if( 'isVisible', 'ck-hidden', value => !value ),
  78449. this.arrowView.bindTemplate.if( 'isOn', 'ck-splitbutton_open' )
  78450. ]
  78451. },
  78452. children: this.children
  78453. } );
  78454. }
  78455. /**
  78456. * @inheritDoc
  78457. */
  78458. render() {
  78459. super.render();
  78460. this.children.add( this.actionView );
  78461. this.children.add( this.arrowView );
  78462. this.focusTracker.add( this.actionView.element );
  78463. this.focusTracker.add( this.arrowView.element );
  78464. this.keystrokes.listenTo( this.element );
  78465. // Overrides toolbar focus cycling behavior.
  78466. this.keystrokes.set( 'arrowright', ( evt, cancel ) => {
  78467. if ( this.focusTracker.focusedElement === this.actionView.element ) {
  78468. this.arrowView.focus();
  78469. cancel();
  78470. }
  78471. } );
  78472. // Overrides toolbar focus cycling behavior.
  78473. this.keystrokes.set( 'arrowleft', ( evt, cancel ) => {
  78474. if ( this.focusTracker.focusedElement === this.arrowView.element ) {
  78475. this.actionView.focus();
  78476. cancel();
  78477. }
  78478. } );
  78479. }
  78480. /**
  78481. * @inheritDoc
  78482. */
  78483. destroy() {
  78484. super.destroy();
  78485. this.focusTracker.destroy();
  78486. this.keystrokes.destroy();
  78487. }
  78488. /**
  78489. * Focuses the {@link #actionView#element} of the action part of split button.
  78490. */
  78491. focus() {
  78492. this.actionView.focus();
  78493. }
  78494. /**
  78495. * Creates a {@link module:ui/button/buttonview~ButtonView} instance as {@link #actionView} and binds it with main split button
  78496. * attributes.
  78497. *
  78498. * @private
  78499. * @returns {module:ui/button/buttonview~ButtonView}
  78500. */
  78501. _createActionView() {
  78502. const actionView = new _button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]();
  78503. actionView.bind(
  78504. 'icon',
  78505. 'isEnabled',
  78506. 'isOn',
  78507. 'isToggleable',
  78508. 'keystroke',
  78509. 'label',
  78510. 'tabindex',
  78511. 'tooltip',
  78512. 'tooltipPosition',
  78513. 'type',
  78514. 'withText'
  78515. ).to( this );
  78516. actionView.extendTemplate( {
  78517. attributes: {
  78518. class: 'ck-splitbutton__action'
  78519. }
  78520. } );
  78521. actionView.delegate( 'execute' ).to( this );
  78522. return actionView;
  78523. }
  78524. /**
  78525. * Creates a {@link module:ui/button/buttonview~ButtonView} instance as {@link #arrowView} and binds it with main split button
  78526. * attributes.
  78527. *
  78528. * @private
  78529. * @returns {module:ui/button/buttonview~ButtonView}
  78530. */
  78531. _createArrowView() {
  78532. const arrowView = new _button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]();
  78533. const bind = arrowView.bindTemplate;
  78534. arrowView.icon = _theme_icons_dropdown_arrow_svg__WEBPACK_IMPORTED_MODULE_4__["default"];
  78535. arrowView.extendTemplate( {
  78536. attributes: {
  78537. class: 'ck-splitbutton__arrow',
  78538. 'aria-haspopup': true,
  78539. 'aria-expanded': bind.to( 'isOn', value => String( value ) )
  78540. }
  78541. } );
  78542. arrowView.bind( 'isEnabled' ).to( this );
  78543. arrowView.delegate( 'execute' ).to( this, 'open' );
  78544. return arrowView;
  78545. }
  78546. }
  78547. /***/ }),
  78548. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelview.js":
  78549. /*!*******************************************************************************!*\
  78550. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelview.js ***!
  78551. \*******************************************************************************/
  78552. /*! exports provided: default */
  78553. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  78554. "use strict";
  78555. __webpack_require__.r(__webpack_exports__);
  78556. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DropdownPanelView; });
  78557. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  78558. /**
  78559. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  78560. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  78561. */
  78562. /**
  78563. * @module ui/dropdown/dropdownpanelview
  78564. */
  78565. /**
  78566. * The dropdown panel view class.
  78567. *
  78568. * See {@link module:ui/dropdown/dropdownview~DropdownView} to learn about the common usage.
  78569. *
  78570. * @extends module:ui/view~View
  78571. */
  78572. class DropdownPanelView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  78573. /**
  78574. * @inheritDoc
  78575. */
  78576. constructor( locale ) {
  78577. super( locale );
  78578. const bind = this.bindTemplate;
  78579. /**
  78580. * Controls whether the panel is visible.
  78581. *
  78582. * @observable
  78583. * @member {Boolean} #isVisible
  78584. */
  78585. this.set( 'isVisible', false );
  78586. /**
  78587. * The position of the panel, relative to the parent.
  78588. *
  78589. * This property is reflected in the CSS class set to {@link #element} that controls
  78590. * the position of the panel.
  78591. *
  78592. * @observable
  78593. * @default 'se'
  78594. * @member {'s'|'se'|'sw'|'sme'|'smw'|'n'|'ne'|'nw'|'nme'|'nmw'} #position
  78595. */
  78596. this.set( 'position', 'se' );
  78597. /**
  78598. * Collection of the child views in this panel.
  78599. *
  78600. * A common child type is the {@link module:ui/list/listview~ListView} and {@link module:ui/toolbar/toolbarview~ToolbarView}.
  78601. * See {@link module:ui/dropdown/utils~addListToDropdown} and
  78602. * {@link module:ui/dropdown/utils~addToolbarToDropdown} to learn more about child views of dropdowns.
  78603. *
  78604. * @readonly
  78605. * @member {module:ui/viewcollection~ViewCollection}
  78606. */
  78607. this.children = this.createCollection();
  78608. this.setTemplate( {
  78609. tag: 'div',
  78610. attributes: {
  78611. class: [
  78612. 'ck',
  78613. 'ck-reset',
  78614. 'ck-dropdown__panel',
  78615. bind.to( 'position', value => `ck-dropdown__panel_${ value }` ),
  78616. bind.if( 'isVisible', 'ck-dropdown__panel-visible' )
  78617. ]
  78618. },
  78619. children: this.children,
  78620. on: {
  78621. // Drag and drop in the panel should not break the selection in the editor.
  78622. // https://github.com/ckeditor/ckeditor5-ui/issues/228
  78623. selectstart: bind.to( evt => evt.preventDefault() )
  78624. }
  78625. } );
  78626. }
  78627. /**
  78628. * Focuses the view element or first item in view collection on opening dropdown's panel.
  78629. *
  78630. * See also {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable}.
  78631. */
  78632. focus() {
  78633. if ( this.children.length ) {
  78634. this.children.first.focus();
  78635. }
  78636. }
  78637. /**
  78638. * Focuses the view element or last item in view collection on opening dropdown's panel.
  78639. *
  78640. * See also {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable}.
  78641. */
  78642. focusLast() {
  78643. if ( this.children.length ) {
  78644. const lastChild = this.children.last;
  78645. if ( typeof lastChild.focusLast === 'function' ) {
  78646. lastChild.focusLast();
  78647. } else {
  78648. lastChild.focus();
  78649. }
  78650. }
  78651. }
  78652. }
  78653. /***/ }),
  78654. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownview.js":
  78655. /*!**************************************************************************!*\
  78656. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownview.js ***!
  78657. \**************************************************************************/
  78658. /*! exports provided: default */
  78659. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  78660. "use strict";
  78661. __webpack_require__.r(__webpack_exports__);
  78662. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DropdownView; });
  78663. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  78664. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  78665. /* harmony import */ var _theme_components_dropdown_dropdown_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/components/dropdown/dropdown.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css");
  78666. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/position */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js");
  78667. /**
  78668. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  78669. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  78670. */
  78671. /**
  78672. * @module ui/dropdown/dropdownview
  78673. */
  78674. /**
  78675. * The dropdown view class. It manages the dropdown button and dropdown panel.
  78676. *
  78677. * In most cases, the easiest way to create a dropdown is by using the {@link module:ui/dropdown/utils~createDropdown}
  78678. * util:
  78679. *
  78680. * const dropdown = createDropdown( locale );
  78681. *
  78682. * // Configure dropdown's button properties:
  78683. * dropdown.buttonView.set( {
  78684. * label: 'A dropdown',
  78685. * withText: true
  78686. * } );
  78687. *
  78688. * dropdown.render();
  78689. *
  78690. * dropdown.panelView.element.textContent = 'Content of the panel';
  78691. *
  78692. * // Will render a dropdown with a panel containing a "Content of the panel" text.
  78693. * document.body.appendChild( dropdown.element );
  78694. *
  78695. * If you want to add a richer content to the dropdown panel, you can use the {@link module:ui/dropdown/utils~addListToDropdown}
  78696. * and {@link module:ui/dropdown/utils~addToolbarToDropdown} helpers. See more examples in
  78697. * {@link module:ui/dropdown/utils~createDropdown} documentation.
  78698. *
  78699. * If you want to create a completely custom dropdown, then you can compose it manually:
  78700. *
  78701. * const button = new DropdownButtonView( locale );
  78702. * const panel = new DropdownPanelView( locale );
  78703. * const dropdown = new DropdownView( locale, button, panel );
  78704. *
  78705. * button.set( {
  78706. * label: 'A dropdown',
  78707. * withText: true
  78708. * } );
  78709. *
  78710. * dropdown.render();
  78711. *
  78712. * panel.element.textContent = 'Content of the panel';
  78713. *
  78714. * // Will render a dropdown with a panel containing a "Content of the panel" text.
  78715. * document.body.appendChild( dropdown.element );
  78716. *
  78717. * However, dropdown created this way will contain little behavior. You will need to implement handlers for actions
  78718. * such as {@link module:ui/bindings/clickoutsidehandler~clickOutsideHandler clicking outside an open dropdown}
  78719. * (which should close it) and support for arrow keys inside the panel. Therefore, unless you really know what
  78720. * you do and you really need to do it, it is recommended to use the {@link module:ui/dropdown/utils~createDropdown} helper.
  78721. *
  78722. * @extends module:ui/view~View
  78723. */
  78724. class DropdownView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  78725. /**
  78726. * Creates an instance of the dropdown.
  78727. *
  78728. * Also see {@link #render}.
  78729. *
  78730. * @param {module:utils/locale~Locale} [locale] The localization services instance.
  78731. * @param {module:ui/dropdown/button/dropdownbutton~DropdownButton} buttonView
  78732. * @param {module:ui/dropdown/dropdownpanelview~DropdownPanelView} panelView
  78733. */
  78734. constructor( locale, buttonView, panelView ) {
  78735. super( locale );
  78736. const bind = this.bindTemplate;
  78737. /**
  78738. * Button of the dropdown view. Clicking the button opens the {@link #panelView}.
  78739. *
  78740. * @readonly
  78741. * @member {module:ui/button/buttonview~ButtonView} #buttonView
  78742. */
  78743. this.buttonView = buttonView;
  78744. /**
  78745. * Panel of the dropdown. It opens when the {@link #buttonView} is
  78746. * {@link module:ui/button/buttonview~ButtonView#event:execute executed} (i.e. clicked).
  78747. *
  78748. * Child views can be added to the panel's `children` collection:
  78749. *
  78750. * dropdown.panelView.children.add( childView );
  78751. *
  78752. * See {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView#children} and
  78753. * {@link module:ui/viewcollection~ViewCollection#add}.
  78754. *
  78755. * @readonly
  78756. * @member {module:ui/dropdown/dropdownpanelview~DropdownPanelView} #panelView
  78757. */
  78758. this.panelView = panelView;
  78759. /**
  78760. * Controls whether the dropdown view is open, i.e. shows or hides the {@link #panelView panel}.
  78761. *
  78762. * @observable
  78763. * @member {Boolean} #isOpen
  78764. */
  78765. this.set( 'isOpen', false );
  78766. /**
  78767. * Controls whether the dropdown is enabled, i.e. it can be clicked and execute an action.
  78768. *
  78769. * See {@link module:ui/button/buttonview~ButtonView#isEnabled}.
  78770. *
  78771. * @observable
  78772. * @member {Boolean} #isEnabled
  78773. */
  78774. this.set( 'isEnabled', true );
  78775. /**
  78776. * (Optional) The additional CSS class set on the dropdown {@link #element}.
  78777. *
  78778. * @observable
  78779. * @member {String} #class
  78780. */
  78781. this.set( 'class' );
  78782. /**
  78783. * (Optional) The `id` attribute of the dropdown (i.e. to pair with a `<label>` element).
  78784. *
  78785. * @observable
  78786. * @member {String} #id
  78787. */
  78788. this.set( 'id' );
  78789. /**
  78790. * The position of the panel, relative to the dropdown.
  78791. *
  78792. * **Note**: When `'auto'`, the panel will use one of the remaining positions to stay
  78793. * in the viewport, visible to the user. The positions correspond directly to
  78794. * {@link module:ui/dropdown/dropdownview~DropdownView.defaultPanelPositions default panel positions}.
  78795. *
  78796. * **Note**: This value has an impact on the
  78797. * {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView#position} property
  78798. * each time the panel becomes {@link #isOpen open}.
  78799. *
  78800. * @observable
  78801. * @default 'auto'
  78802. * @member {'auto'|'s'|'se'|'sw'|'sme'|'smw'|'n'|'ne'|'nw'|'nme'|'nmw'} #panelPosition
  78803. */
  78804. this.set( 'panelPosition', 'auto' );
  78805. /**
  78806. * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}. It manages
  78807. * keystrokes of the dropdown:
  78808. *
  78809. * * <kbd>▼</kbd> opens the dropdown,
  78810. * * <kbd>◀</kbd> and <kbd>Esc</kbd> closes the dropdown.
  78811. *
  78812. * @readonly
  78813. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  78814. */
  78815. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_1__["default"]();
  78816. this.setTemplate( {
  78817. tag: 'div',
  78818. attributes: {
  78819. class: [
  78820. 'ck',
  78821. 'ck-dropdown',
  78822. bind.to( 'class' ),
  78823. bind.if( 'isEnabled', 'ck-disabled', value => !value )
  78824. ],
  78825. id: bind.to( 'id' ),
  78826. 'aria-describedby': bind.to( 'ariaDescribedById' )
  78827. },
  78828. children: [
  78829. buttonView,
  78830. panelView
  78831. ]
  78832. } );
  78833. buttonView.extendTemplate( {
  78834. attributes: {
  78835. class: [
  78836. 'ck-dropdown__button'
  78837. ]
  78838. }
  78839. } );
  78840. /**
  78841. * A child {@link module:ui/list/listview~ListView list view} of the dropdown located
  78842. * in its {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel}.
  78843. *
  78844. * **Note**: Only supported when dropdown has list view added using {@link module:ui/dropdown/utils~addListToDropdown}.
  78845. *
  78846. * @readonly
  78847. * @member {module:ui/list/listview~ListView} #listView
  78848. */
  78849. /**
  78850. * A child toolbar of the dropdown located in the
  78851. * {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel}.
  78852. *
  78853. * **Note**: Only supported when dropdown has list view added using {@link module:ui/dropdown/utils~addToolbarToDropdown}.
  78854. *
  78855. * @readonly
  78856. * @member {module:ui/toolbar/toolbarview~ToolbarView} #toolbarView
  78857. */
  78858. /**
  78859. * Fired when the toolbar button or list item is executed.
  78860. *
  78861. * For {@link #listView} It fires when a child of some {@link module:ui/list/listitemview~ListItemView}
  78862. * fired `execute`.
  78863. *
  78864. * For {@link #toolbarView} It fires when one of the buttons has been
  78865. * {@link module:ui/button/buttonview~ButtonView#event:execute executed}.
  78866. *
  78867. * **Note**: Only supported when dropdown has list view added using {@link module:ui/dropdown/utils~addListToDropdown}
  78868. * or {@link module:ui/dropdown/utils~addToolbarToDropdown}.
  78869. *
  78870. * @event execute
  78871. */
  78872. }
  78873. /**
  78874. * @inheritDoc
  78875. */
  78876. render() {
  78877. super.render();
  78878. // Toggle the dropdown when its button has been clicked.
  78879. this.listenTo( this.buttonView, 'open', () => {
  78880. this.isOpen = !this.isOpen;
  78881. } );
  78882. // Toggle the visibility of the panel when the dropdown becomes open.
  78883. this.panelView.bind( 'isVisible' ).to( this, 'isOpen' );
  78884. // Let the dropdown control the position of the panel. The position must
  78885. // be updated every time the dropdown is open.
  78886. this.on( 'change:isOpen', () => {
  78887. if ( !this.isOpen ) {
  78888. return;
  78889. }
  78890. // If "auto", find the best position of the panel to fit into the viewport.
  78891. // Otherwise, simply assign the static position.
  78892. if ( this.panelPosition === 'auto' ) {
  78893. this.panelView.position = DropdownView._getOptimalPosition( {
  78894. element: this.panelView.element,
  78895. target: this.buttonView.element,
  78896. fitInViewport: true,
  78897. positions: this._panelPositions
  78898. } ).name;
  78899. } else {
  78900. this.panelView.position = this.panelPosition;
  78901. }
  78902. } );
  78903. // Listen for keystrokes coming from within #element.
  78904. this.keystrokes.listenTo( this.element );
  78905. const closeDropdown = ( data, cancel ) => {
  78906. if ( this.isOpen ) {
  78907. this.buttonView.focus();
  78908. this.isOpen = false;
  78909. cancel();
  78910. }
  78911. };
  78912. // Open the dropdown panel using the arrow down key, just like with return or space.
  78913. this.keystrokes.set( 'arrowdown', ( data, cancel ) => {
  78914. // Don't open if the dropdown is disabled or already open.
  78915. if ( this.buttonView.isEnabled && !this.isOpen ) {
  78916. this.isOpen = true;
  78917. cancel();
  78918. }
  78919. } );
  78920. // Block the right arrow key (until nested dropdowns are implemented).
  78921. this.keystrokes.set( 'arrowright', ( data, cancel ) => {
  78922. if ( this.isOpen ) {
  78923. cancel();
  78924. }
  78925. } );
  78926. // Close the dropdown using the arrow left/escape key.
  78927. this.keystrokes.set( 'arrowleft', closeDropdown );
  78928. this.keystrokes.set( 'esc', closeDropdown );
  78929. }
  78930. /**
  78931. * Focuses the {@link #buttonView}.
  78932. */
  78933. focus() {
  78934. this.buttonView.focus();
  78935. }
  78936. /**
  78937. * Returns {@link #panelView panel} positions to be used by the
  78938. * {@link module:utils/dom/position~getOptimalPosition `getOptimalPosition()`}
  78939. * utility considering the direction of the language the UI of the editor is displayed in.
  78940. *
  78941. * @type {module:utils/dom/position~Options#positions}
  78942. * @private
  78943. */
  78944. get _panelPositions() {
  78945. const {
  78946. south, north,
  78947. southEast, southWest,
  78948. northEast, northWest,
  78949. southMiddleEast, southMiddleWest,
  78950. northMiddleEast, northMiddleWest
  78951. } = DropdownView.defaultPanelPositions;
  78952. if ( this.locale.uiLanguageDirection !== 'rtl' ) {
  78953. return [
  78954. southEast, southWest, southMiddleEast, southMiddleWest, south,
  78955. northEast, northWest, northMiddleEast, northMiddleWest, north
  78956. ];
  78957. } else {
  78958. return [
  78959. southWest, southEast, southMiddleWest, southMiddleEast, south,
  78960. northWest, northEast, northMiddleWest, northMiddleEast, north
  78961. ];
  78962. }
  78963. }
  78964. }
  78965. /**
  78966. * A set of positioning functions used by the dropdown view to determine
  78967. * the optimal position (i.e. fitting into the browser viewport) of its
  78968. * {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel} when
  78969. * {@link module:ui/dropdown/dropdownview~DropdownView#panelPosition} is set to 'auto'`.
  78970. *
  78971. * The available positioning functions are as follow:
  78972. *
  78973. * **South**
  78974. *
  78975. * * `south`
  78976. *
  78977. * [ Button ]
  78978. * +-----------------+
  78979. * | Panel |
  78980. * +-----------------+
  78981. *
  78982. * * `southEast`
  78983. *
  78984. * [ Button ]
  78985. * +-----------------+
  78986. * | Panel |
  78987. * +-----------------+
  78988. *
  78989. * * `southWest`
  78990. *
  78991. * [ Button ]
  78992. * +-----------------+
  78993. * | Panel |
  78994. * +-----------------+
  78995. *
  78996. * * `southMiddleEast`
  78997. *
  78998. * [ Button ]
  78999. * +-----------------+
  79000. * | Panel |
  79001. * +-----------------+
  79002. *
  79003. * * `southMiddleWest`
  79004. *
  79005. * [ Button ]
  79006. * +-----------------+
  79007. * | Panel |
  79008. * +-----------------+
  79009. *
  79010. * **North**
  79011. *
  79012. * * `north`
  79013. *
  79014. * +-----------------+
  79015. * | Panel |
  79016. * +-----------------+
  79017. * [ Button ]
  79018. *
  79019. * * `northEast`
  79020. *
  79021. * +-----------------+
  79022. * | Panel |
  79023. * +-----------------+
  79024. * [ Button ]
  79025. *
  79026. * * `northWest`
  79027. *
  79028. * +-----------------+
  79029. * | Panel |
  79030. * +-----------------+
  79031. * [ Button ]
  79032. *
  79033. * * `northMiddleEast`
  79034. *
  79035. * +-----------------+
  79036. * | Panel |
  79037. * +-----------------+
  79038. * [ Button ]
  79039. *
  79040. * * `northMiddleWest`
  79041. *
  79042. * +-----------------+
  79043. * | Panel |
  79044. * +-----------------+
  79045. * [ Button ]
  79046. *
  79047. * Positioning functions are compatible with {@link module:utils/dom/position~Position}.
  79048. *
  79049. * The name that position function returns will be reflected in dropdown panel's class that
  79050. * controls its placement. See {@link module:ui/dropdown/dropdownview~DropdownView#panelPosition}
  79051. * to learn more.
  79052. *
  79053. * @member {Object} module:ui/dropdown/dropdownview~DropdownView.defaultPanelPositions
  79054. */
  79055. DropdownView.defaultPanelPositions = {
  79056. south: ( buttonRect, panelRect ) => {
  79057. return {
  79058. top: buttonRect.bottom,
  79059. left: buttonRect.left - ( panelRect.width - buttonRect.width ) / 2,
  79060. name: 's'
  79061. };
  79062. },
  79063. southEast: buttonRect => {
  79064. return {
  79065. top: buttonRect.bottom,
  79066. left: buttonRect.left,
  79067. name: 'se'
  79068. };
  79069. },
  79070. southWest: ( buttonRect, panelRect ) => {
  79071. return {
  79072. top: buttonRect.bottom,
  79073. left: buttonRect.left - panelRect.width + buttonRect.width,
  79074. name: 'sw'
  79075. };
  79076. },
  79077. southMiddleEast: ( buttonRect, panelRect ) => {
  79078. return {
  79079. top: buttonRect.bottom,
  79080. left: buttonRect.left - ( panelRect.width - buttonRect.width ) / 4,
  79081. name: 'sme'
  79082. };
  79083. },
  79084. southMiddleWest: ( buttonRect, panelRect ) => {
  79085. return {
  79086. top: buttonRect.bottom,
  79087. left: buttonRect.left - ( panelRect.width - buttonRect.width ) * 3 / 4,
  79088. name: 'smw'
  79089. };
  79090. },
  79091. north: ( buttonRect, panelRect ) => {
  79092. return {
  79093. top: buttonRect.top - panelRect.height,
  79094. left: buttonRect.left - ( panelRect.width - buttonRect.width ) / 2,
  79095. name: 'n'
  79096. };
  79097. },
  79098. northEast: ( buttonRect, panelRect ) => {
  79099. return {
  79100. top: buttonRect.top - panelRect.height,
  79101. left: buttonRect.left,
  79102. name: 'ne'
  79103. };
  79104. },
  79105. northWest: ( buttonRect, panelRect ) => {
  79106. return {
  79107. top: buttonRect.top - panelRect.height,
  79108. left: buttonRect.left - panelRect.width + buttonRect.width,
  79109. name: 'nw'
  79110. };
  79111. },
  79112. northMiddleEast: ( buttonRect, panelRect ) => {
  79113. return {
  79114. top: buttonRect.top - panelRect.height,
  79115. left: buttonRect.left - ( panelRect.width - buttonRect.width ) / 4,
  79116. name: 'nme'
  79117. };
  79118. },
  79119. northMiddleWest: ( buttonRect, panelRect ) => {
  79120. return {
  79121. top: buttonRect.top - panelRect.height,
  79122. left: buttonRect.left - ( panelRect.width - buttonRect.width ) * 3 / 4,
  79123. name: 'nmw'
  79124. };
  79125. }
  79126. };
  79127. /**
  79128. * A function used to calculate the optimal position for the dropdown panel.
  79129. *
  79130. * @protected
  79131. * @member {Function} module:ui/dropdown/dropdownview~DropdownView._getOptimalPosition
  79132. */
  79133. DropdownView._getOptimalPosition = _ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_3__["getOptimalPosition"];
  79134. /***/ }),
  79135. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js":
  79136. /*!*******************************************************************!*\
  79137. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js ***!
  79138. \*******************************************************************/
  79139. /*! exports provided: createDropdown, addToolbarToDropdown, addListToDropdown */
  79140. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79141. "use strict";
  79142. __webpack_require__.r(__webpack_exports__);
  79143. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDropdown", function() { return createDropdown; });
  79144. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addToolbarToDropdown", function() { return addToolbarToDropdown; });
  79145. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addListToDropdown", function() { return addListToDropdown; });
  79146. /* harmony import */ var _dropdownpanelview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dropdownpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelview.js");
  79147. /* harmony import */ var _dropdownview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dropdownview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownview.js");
  79148. /* harmony import */ var _button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./button/dropdownbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js");
  79149. /* harmony import */ var _toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../toolbar/toolbarview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js");
  79150. /* harmony import */ var _list_listview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../list/listview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js");
  79151. /* harmony import */ var _list_listitemview__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../list/listitemview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js");
  79152. /* harmony import */ var _list_listseparatorview__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../list/listseparatorview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listseparatorview.js");
  79153. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  79154. /* harmony import */ var _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../button/switchbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js");
  79155. /* harmony import */ var _bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../bindings/clickoutsidehandler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js");
  79156. /* harmony import */ var _theme_components_dropdown_toolbardropdown_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../theme/components/dropdown/toolbardropdown.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css");
  79157. /* harmony import */ var _theme_components_dropdown_listdropdown_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../theme/components/dropdown/listdropdown.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css");
  79158. /**
  79159. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  79160. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  79161. */
  79162. /**
  79163. * @module ui/dropdown/utils
  79164. */
  79165. /**
  79166. * A helper for creating dropdowns. It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown},
  79167. * with a {@link module:ui/dropdown/button/dropdownbutton~DropdownButton button},
  79168. * {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView panel} and all standard dropdown's behaviors.
  79169. *
  79170. * # Creating dropdowns
  79171. *
  79172. * By default, the default {@link module:ui/dropdown/button/dropdownbuttonview~DropdownButtonView} class is used as
  79173. * definition of the button:
  79174. *
  79175. * const dropdown = createDropdown( model );
  79176. *
  79177. * // Configure dropdown's button properties:
  79178. * dropdown.buttonView.set( {
  79179. * label: 'A dropdown',
  79180. * withText: true
  79181. * } );
  79182. *
  79183. * dropdown.render();
  79184. *
  79185. * // Will render a dropdown labeled "A dropdown" with an empty panel.
  79186. * document.body.appendChild( dropdown.element );
  79187. *
  79188. * You can also provide other button views (they need to implement the
  79189. * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface). For instance, you can use
  79190. * {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView} to create a dropdown with a split button.
  79191. *
  79192. * const dropdown = createDropdown( model, SplitButtonView );
  79193. *
  79194. * // Configure dropdown's button properties:
  79195. * dropdown.buttonView.set( {
  79196. * label: 'A dropdown',
  79197. * withText: true
  79198. * } );
  79199. *
  79200. * dropdown.buttonView.on( 'execute', () => {
  79201. * // Add the behavior of the "action part" of the split button.
  79202. * // Split button consists of the "action part" and "arrow part".
  79203. * // The arrow opens the dropdown while the action part can have some other behavior.
  79204. * } );
  79205. *
  79206. * dropdown.render();
  79207. *
  79208. * // Will render a dropdown labeled "A dropdown" with an empty panel.
  79209. * document.body.appendChild( dropdown.element );
  79210. *
  79211. * # Adding content to the dropdown's panel
  79212. *
  79213. * The content of the panel can be inserted directly into the `dropdown.panelView.element`:
  79214. *
  79215. * dropdown.panelView.element.textContent = 'Content of the panel';
  79216. *
  79217. * However, most of the time you will want to add there either a {@link module:ui/list/listview~ListView list of options}
  79218. * or a list of buttons (i.e. a {@link module:ui/toolbar/toolbarview~ToolbarView toolbar}).
  79219. * To simplify the task, you can use, respectively, {@link module:ui/dropdown/utils~addListToDropdown} or
  79220. * {@link module:ui/dropdown/utils~addToolbarToDropdown} utils.
  79221. *
  79222. * @param {module:utils/locale~Locale} locale The locale instance.
  79223. * @param {Function} ButtonClass The dropdown button view class. Needs to implement the
  79224. * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface.
  79225. * @returns {module:ui/dropdown/dropdownview~DropdownView} The dropdown view instance.
  79226. */
  79227. function createDropdown( locale, ButtonClass = _button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  79228. const buttonView = new ButtonClass( locale );
  79229. const panelView = new _dropdownpanelview__WEBPACK_IMPORTED_MODULE_0__["default"]( locale );
  79230. const dropdownView = new _dropdownview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale, buttonView, panelView );
  79231. buttonView.bind( 'isEnabled' ).to( dropdownView );
  79232. if ( buttonView instanceof _button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  79233. buttonView.bind( 'isOn' ).to( dropdownView, 'isOpen' );
  79234. } else {
  79235. buttonView.arrowView.bind( 'isOn' ).to( dropdownView, 'isOpen' );
  79236. }
  79237. addDefaultBehavior( dropdownView );
  79238. return dropdownView;
  79239. }
  79240. /**
  79241. * Adds an instance of {@link module:ui/toolbar/toolbarview~ToolbarView} to a dropdown.
  79242. *
  79243. * const buttons = [];
  79244. *
  79245. * // Either create a new ButtonView instance or create existing.
  79246. * buttons.push( new ButtonView() );
  79247. * buttons.push( editor.ui.componentFactory.create( 'someButton' ) );
  79248. *
  79249. * const dropdown = createDropdown( locale );
  79250. *
  79251. * addToolbarToDropdown( dropdown, buttons );
  79252. *
  79253. * dropdown.toolbarView.isVertical = true;
  79254. *
  79255. * // Will render a vertical button dropdown labeled "A button dropdown"
  79256. * // with a button group in the panel containing two buttons.
  79257. * dropdown.render()
  79258. * document.body.appendChild( dropdown.element );
  79259. *
  79260. * See {@link module:ui/dropdown/utils~createDropdown} and {@link module:ui/toolbar/toolbarview~ToolbarView}.
  79261. *
  79262. * @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView A dropdown instance to which `ToolbarView` will be added.
  79263. * @param {Iterable.<module:ui/button/buttonview~ButtonView>} buttons
  79264. */
  79265. function addToolbarToDropdown( dropdownView, buttons ) {
  79266. const locale = dropdownView.locale;
  79267. const t = locale.t;
  79268. const toolbarView = dropdownView.toolbarView = new _toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_3__["default"]( locale );
  79269. toolbarView.set( 'ariaLabel', t( 'Dropdown toolbar' ) );
  79270. dropdownView.extendTemplate( {
  79271. attributes: {
  79272. class: [ 'ck-toolbar-dropdown' ]
  79273. }
  79274. } );
  79275. buttons.map( view => toolbarView.items.add( view ) );
  79276. dropdownView.panelView.children.add( toolbarView );
  79277. toolbarView.items.delegate( 'execute' ).to( dropdownView );
  79278. }
  79279. /**
  79280. * Adds an instance of {@link module:ui/list/listview~ListView} to a dropdown.
  79281. *
  79282. * const items = new Collection();
  79283. *
  79284. * items.add( {
  79285. * type: 'button',
  79286. * model: new Model( {
  79287. * withText: true,
  79288. * label: 'First item',
  79289. * labelStyle: 'color: red'
  79290. * } )
  79291. * } );
  79292. *
  79293. * items.add( {
  79294. * type: 'button',
  79295. * model: new Model( {
  79296. * withText: true,
  79297. * label: 'Second item',
  79298. * labelStyle: 'color: green',
  79299. * class: 'foo'
  79300. * } )
  79301. * } );
  79302. *
  79303. * const dropdown = createDropdown( locale );
  79304. *
  79305. * addListToDropdown( dropdown, items );
  79306. *
  79307. * // Will render a dropdown with a list in the panel containing two items.
  79308. * dropdown.render()
  79309. * document.body.appendChild( dropdown.element );
  79310. *
  79311. * The `items` collection passed to this methods controls the presence and attributes of respective
  79312. * {@link module:ui/list/listitemview~ListItemView list items}.
  79313. *
  79314. *
  79315. * See {@link module:ui/dropdown/utils~createDropdown} and {@link module:list/list~List}.
  79316. *
  79317. * @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView A dropdown instance to which `ListVIew` will be added.
  79318. * @param {Iterable.<module:ui/dropdown/utils~ListDropdownItemDefinition>} items
  79319. * A collection of the list item definitions to populate the list.
  79320. */
  79321. function addListToDropdown( dropdownView, items ) {
  79322. const locale = dropdownView.locale;
  79323. const listView = dropdownView.listView = new _list_listview__WEBPACK_IMPORTED_MODULE_4__["default"]( locale );
  79324. listView.items.bindTo( items ).using( ( { type, model } ) => {
  79325. if ( type === 'separator' ) {
  79326. return new _list_listseparatorview__WEBPACK_IMPORTED_MODULE_6__["default"]( locale );
  79327. } else if ( type === 'button' || type === 'switchbutton' ) {
  79328. const listItemView = new _list_listitemview__WEBPACK_IMPORTED_MODULE_5__["default"]( locale );
  79329. let buttonView;
  79330. if ( type === 'button' ) {
  79331. buttonView = new _button_buttonview__WEBPACK_IMPORTED_MODULE_7__["default"]( locale );
  79332. } else {
  79333. buttonView = new _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_8__["default"]( locale );
  79334. }
  79335. // Bind all model properties to the button view.
  79336. buttonView.bind( ...Object.keys( model ) ).to( model );
  79337. buttonView.delegate( 'execute' ).to( listItemView );
  79338. listItemView.children.add( buttonView );
  79339. return listItemView;
  79340. }
  79341. } );
  79342. dropdownView.panelView.children.add( listView );
  79343. listView.items.delegate( 'execute' ).to( dropdownView );
  79344. }
  79345. // Add a set of default behaviors to dropdown view.
  79346. //
  79347. // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
  79348. function addDefaultBehavior( dropdownView ) {
  79349. closeDropdownOnBlur( dropdownView );
  79350. closeDropdownOnExecute( dropdownView );
  79351. focusDropdownContentsOnArrows( dropdownView );
  79352. }
  79353. // Adds a behavior to a dropdownView that closes opened dropdown when user clicks outside the dropdown.
  79354. //
  79355. // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
  79356. function closeDropdownOnBlur( dropdownView ) {
  79357. dropdownView.on( 'render', () => {
  79358. Object(_bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_9__["default"])( {
  79359. emitter: dropdownView,
  79360. activator: () => dropdownView.isOpen,
  79361. callback: () => {
  79362. dropdownView.isOpen = false;
  79363. },
  79364. contextElements: [ dropdownView.element ]
  79365. } );
  79366. } );
  79367. }
  79368. // Adds a behavior to a dropdownView that closes the dropdown view on "execute" event.
  79369. //
  79370. // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
  79371. function closeDropdownOnExecute( dropdownView ) {
  79372. // Close the dropdown when one of the list items has been executed.
  79373. dropdownView.on( 'execute', evt => {
  79374. // Toggling a switch button view should not close the dropdown.
  79375. if ( evt.source instanceof _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_8__["default"] ) {
  79376. return;
  79377. }
  79378. dropdownView.isOpen = false;
  79379. } );
  79380. }
  79381. // Adds a behavior to a dropdownView that focuses the dropdown's panel view contents on keystrokes.
  79382. //
  79383. // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
  79384. function focusDropdownContentsOnArrows( dropdownView ) {
  79385. // If the dropdown panel is already open, the arrow down key should focus the first child of the #panelView.
  79386. dropdownView.keystrokes.set( 'arrowdown', ( data, cancel ) => {
  79387. if ( dropdownView.isOpen ) {
  79388. dropdownView.panelView.focus();
  79389. cancel();
  79390. }
  79391. } );
  79392. // If the dropdown panel is already open, the arrow up key should focus the last child of the #panelView.
  79393. dropdownView.keystrokes.set( 'arrowup', ( data, cancel ) => {
  79394. if ( dropdownView.isOpen ) {
  79395. dropdownView.panelView.focusLast();
  79396. cancel();
  79397. }
  79398. } );
  79399. }
  79400. /**
  79401. * A definition of the list item used by the {@link module:ui/dropdown/utils~addListToDropdown}
  79402. * utility.
  79403. *
  79404. * @typedef {Object} module:ui/dropdown/utils~ListDropdownItemDefinition
  79405. *
  79406. * @property {String} type Either `'separator'`, `'button'` or `'switchbutton'`.
  79407. * @property {module:ui/model~Model} [model] Model of the item (when **not** `'separator'`).
  79408. * Its properties fuel the newly created list item (or its children, depending on the `type`).
  79409. */
  79410. /***/ }),
  79411. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editableui/editableuiview.js":
  79412. /*!******************************************************************************!*\
  79413. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editableui/editableuiview.js ***!
  79414. \******************************************************************************/
  79415. /*! exports provided: default */
  79416. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79417. "use strict";
  79418. __webpack_require__.r(__webpack_exports__);
  79419. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditableUIView; });
  79420. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  79421. /**
  79422. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  79423. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  79424. */
  79425. /**
  79426. * @module ui/editableui/editableuiview
  79427. */
  79428. /**
  79429. * The editable UI view class.
  79430. *
  79431. * @extends module:ui/view~View
  79432. */
  79433. class EditableUIView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  79434. /**
  79435. * Creates an instance of EditableUIView class.
  79436. *
  79437. * @param {module:utils/locale~Locale} [locale] The locale instance.
  79438. * @param {module:engine/view/view~View} editingView The editing view instance the editable is related to.
  79439. * @param {HTMLElement} [editableElement] The editable element. If not specified, this view
  79440. * should create it. Otherwise, the existing element should be used.
  79441. */
  79442. constructor( locale, editingView, editableElement ) {
  79443. super( locale );
  79444. this.setTemplate( {
  79445. tag: 'div',
  79446. attributes: {
  79447. class: [
  79448. 'ck',
  79449. 'ck-content',
  79450. 'ck-editor__editable',
  79451. 'ck-rounded-corners'
  79452. ],
  79453. lang: locale.contentLanguage,
  79454. dir: locale.contentLanguageDirection
  79455. }
  79456. } );
  79457. /**
  79458. * The name of the editable UI view.
  79459. *
  79460. * @member {String} #name
  79461. */
  79462. this.name = null;
  79463. /**
  79464. * Controls whether the editable is focused, i.e. the user is typing in it.
  79465. *
  79466. * @observable
  79467. * @member {Boolean} #isFocused
  79468. */
  79469. this.set( 'isFocused', false );
  79470. /**
  79471. * The element which is the main editable element (usually the one with `contentEditable="true"`).
  79472. *
  79473. * @private
  79474. * @type {HTMLElement}
  79475. */
  79476. this._editableElement = editableElement;
  79477. /**
  79478. * Whether an external {@link #_editableElement} was passed into the constructor, which also means
  79479. * the view will not render its {@link #template}.
  79480. *
  79481. * @private
  79482. * @type {Boolean}
  79483. */
  79484. this._hasExternalElement = !!this._editableElement;
  79485. /**
  79486. * The editing view instance the editable is related to. Editable uses the editing
  79487. * view to dynamically modify its certain DOM attributes after {@link #render rendering}.
  79488. *
  79489. * **Note**: The DOM attributes are performed by the editing view and not UI
  79490. * {@link module:ui/view~View#bindTemplate template bindings} because once rendered,
  79491. * the editable DOM element must remain under the full control of the engine to work properly.
  79492. *
  79493. * @protected
  79494. * @type {module:engine/view/view~View}
  79495. */
  79496. this._editingView = editingView;
  79497. }
  79498. /**
  79499. * Renders the view by either applying the {@link #template} to the existing
  79500. * {@link #_editableElement} or assigning {@link #element} as {@link #_editableElement}.
  79501. */
  79502. render() {
  79503. super.render();
  79504. if ( this._hasExternalElement ) {
  79505. this.template.apply( this.element = this._editableElement );
  79506. } else {
  79507. this._editableElement = this.element;
  79508. }
  79509. this.on( 'change:isFocused', () => this._updateIsFocusedClasses() );
  79510. this._updateIsFocusedClasses();
  79511. }
  79512. /**
  79513. * @inheritDoc
  79514. */
  79515. destroy() {
  79516. if ( this._hasExternalElement ) {
  79517. this.template.revert( this._editableElement );
  79518. }
  79519. super.destroy();
  79520. }
  79521. /**
  79522. * Updates the `ck-focused` and `ck-blurred` CSS classes on the {@link #element} according to
  79523. * the {@link #isFocused} property value using the {@link #_editingView editing view} API.
  79524. *
  79525. * @private
  79526. */
  79527. _updateIsFocusedClasses() {
  79528. const editingView = this._editingView;
  79529. if ( editingView.isRenderingInProgress ) {
  79530. updateAfterRender( this );
  79531. } else {
  79532. update( this );
  79533. }
  79534. function update( view ) {
  79535. editingView.change( writer => {
  79536. const viewRoot = editingView.document.getRoot( view.name );
  79537. writer.addClass( view.isFocused ? 'ck-focused' : 'ck-blurred', viewRoot );
  79538. writer.removeClass( view.isFocused ? 'ck-blurred' : 'ck-focused', viewRoot );
  79539. } );
  79540. }
  79541. // In a case of a multi-root editor, a callback will be attached more than once (one callback for each root).
  79542. // While executing one callback the `isRenderingInProgress` observable is changing what causes executing another
  79543. // callback and render is called inside the already pending render.
  79544. // We need to be sure that callback is executed only when the value has changed from `true` to `false`.
  79545. // See https://github.com/ckeditor/ckeditor5/issues/1676.
  79546. function updateAfterRender( view ) {
  79547. editingView.once( 'change:isRenderingInProgress', ( evt, name, value ) => {
  79548. if ( !value ) {
  79549. update( view );
  79550. } else {
  79551. updateAfterRender( view );
  79552. }
  79553. } );
  79554. }
  79555. }
  79556. }
  79557. /***/ }),
  79558. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.js":
  79559. /*!*******************************************************************************************!*\
  79560. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.js ***!
  79561. \*******************************************************************************************/
  79562. /*! exports provided: default */
  79563. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79564. "use strict";
  79565. __webpack_require__.r(__webpack_exports__);
  79566. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InlineEditableUIView; });
  79567. /* harmony import */ var _editableui_editableuiview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editableui/editableuiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editableui/editableuiview.js");
  79568. /**
  79569. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  79570. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  79571. */
  79572. /**
  79573. * @module ui/editableui/inline/inlineeditableuiview
  79574. */
  79575. /**
  79576. * The inline editable UI class implementing an inline {@link module:ui/editableui/editableuiview~EditableUIView}.
  79577. *
  79578. * @extends module:ui/editableui/editableuiview~EditableUIView
  79579. */
  79580. class InlineEditableUIView extends _editableui_editableuiview__WEBPACK_IMPORTED_MODULE_0__["default"] {
  79581. /**
  79582. * Creates an instance of the InlineEditableUIView class.
  79583. *
  79584. * @param {module:utils/locale~Locale} [locale] The locale instance.
  79585. * @param {module:engine/view/view~View} editingView The editing view instance the editable is related to.
  79586. * @param {HTMLElement} [editableElement] The editable element. If not specified, the
  79587. * {@link module:ui/editableui/editableuiview~EditableUIView}
  79588. * will create it. Otherwise, the existing element will be used.
  79589. */
  79590. constructor( locale, editingView, editableElement ) {
  79591. super( locale, editingView, editableElement );
  79592. this.extendTemplate( {
  79593. attributes: {
  79594. role: 'textbox',
  79595. class: 'ck-editor__editable_inline'
  79596. }
  79597. } );
  79598. }
  79599. /**
  79600. * @inheritDoc
  79601. */
  79602. render() {
  79603. super.render();
  79604. const editingView = this._editingView;
  79605. const t = this.t;
  79606. editingView.change( writer => {
  79607. const viewRoot = editingView.document.getRoot( this.name );
  79608. writer.setAttribute( 'aria-label', t( 'Rich Text Editor, %0', this.name ), viewRoot );
  79609. } );
  79610. }
  79611. }
  79612. /***/ }),
  79613. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js":
  79614. /*!****************************************************************************!*\
  79615. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js ***!
  79616. \****************************************************************************/
  79617. /*! exports provided: default */
  79618. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79619. "use strict";
  79620. __webpack_require__.r(__webpack_exports__);
  79621. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BodyCollection; });
  79622. /* harmony import */ var _template__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
  79623. /* harmony import */ var _viewcollection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
  79624. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_createelement__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/createelement */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.js");
  79625. /**
  79626. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  79627. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  79628. */
  79629. /**
  79630. * @module ui/editorui/bodycollection
  79631. */
  79632. /* globals document */
  79633. /**
  79634. * This is a special {@link module:ui/viewcollection~ViewCollection} dedicated to elements that are detached
  79635. * from the DOM structure of the editor, like panels, icons, etc.
  79636. *
  79637. * The body collection is available in the {@link module:ui/editorui/editoruiview~EditorUIView#body `editor.ui.view.body`} property.
  79638. * Any plugin can add a {@link module:ui/view~View view} to this collection.
  79639. * These views will render in a container placed directly in the `<body>` element.
  79640. * The editor will detach and destroy this collection when the editor will be {@link module:core/editor/editor~Editor#destroy destroyed}.
  79641. *
  79642. * If you need to control the life cycle of the body collection on your own, you can create your own instance of this class.
  79643. *
  79644. * A body collection will render itself automatically in the DOM body element as soon as you call {@link ~BodyCollection#attachToDom}.
  79645. * If you create multiple body collections, this class will create a special wrapper element in the DOM to limit the number of
  79646. * elements created directly in the body and remove it when the last body collection will be
  79647. * {@link ~BodyCollection#detachFromDom detached}.
  79648. *
  79649. * @extends module:ui/viewcollection~ViewCollection
  79650. */
  79651. class BodyCollection extends _viewcollection__WEBPACK_IMPORTED_MODULE_1__["default"] {
  79652. /**
  79653. * Creates a new instance of the {@link module:ui/editorui/bodycollection~BodyCollection}.
  79654. *
  79655. * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor editor's locale} instance.
  79656. * @param {Iterable.<module:ui/view~View>} [initialItems] The initial items of the collection.
  79657. */
  79658. constructor( locale, initialItems = [] ) {
  79659. super( initialItems );
  79660. /**
  79661. * The {@link module:core/editor/editor~Editor#locale editor's locale} instance.
  79662. * See the view {@link module:ui/view~View#locale locale} property.
  79663. *
  79664. * @member {module:utils/locale~Locale}
  79665. */
  79666. this.locale = locale;
  79667. }
  79668. /**
  79669. * Attaches the body collection to the DOM body element. You need to execute this method to render the content of
  79670. * the body collection.
  79671. */
  79672. attachToDom() {
  79673. /**
  79674. * The element holding elements of the body region.
  79675. *
  79676. * @protected
  79677. * @member {HTMLElement} #_bodyCollectionContainer
  79678. */
  79679. this._bodyCollectionContainer = new _template__WEBPACK_IMPORTED_MODULE_0__["default"]( {
  79680. tag: 'div',
  79681. attributes: {
  79682. class: [
  79683. 'ck',
  79684. 'ck-reset_all',
  79685. 'ck-body',
  79686. 'ck-rounded-corners'
  79687. ],
  79688. dir: this.locale.uiLanguageDirection
  79689. },
  79690. children: this
  79691. } ).render();
  79692. let wrapper = document.querySelector( '.ck-body-wrapper' );
  79693. if ( !wrapper ) {
  79694. wrapper = Object(_ckeditor_ckeditor5_utils_src_dom_createelement__WEBPACK_IMPORTED_MODULE_2__["default"])( document, 'div', { class: 'ck-body-wrapper' } );
  79695. document.body.appendChild( wrapper );
  79696. }
  79697. wrapper.appendChild( this._bodyCollectionContainer );
  79698. }
  79699. /**
  79700. * Detaches the collection from the DOM structure. Use this method when you do not need to use the body collection
  79701. * anymore to clean-up the DOM structure.
  79702. */
  79703. detachFromDom() {
  79704. super.destroy();
  79705. if ( this._bodyCollectionContainer ) {
  79706. this._bodyCollectionContainer.remove();
  79707. }
  79708. const wrapper = document.querySelector( '.ck-body-wrapper' );
  79709. if ( wrapper && wrapper.childElementCount == 0 ) {
  79710. wrapper.remove();
  79711. }
  79712. }
  79713. }
  79714. /***/ }),
  79715. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js":
  79716. /*!*************************************************************************************!*\
  79717. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js ***!
  79718. \*************************************************************************************/
  79719. /*! exports provided: default */
  79720. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79721. "use strict";
  79722. __webpack_require__.r(__webpack_exports__);
  79723. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BoxedEditorUIView; });
  79724. /* harmony import */ var _editorui_editoruiview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editorui/editoruiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js");
  79725. /* harmony import */ var _label_labelview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../label/labelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js");
  79726. /**
  79727. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  79728. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  79729. */
  79730. /**
  79731. * @module ui/editorui/boxed/boxededitoruiview
  79732. */
  79733. /**
  79734. * The boxed editor UI view class. This class represents an editor interface
  79735. * consisting of a toolbar and an editable area, enclosed within a box.
  79736. *
  79737. * @extends module:ui/editorui/editoruiview~EditorUIView
  79738. */
  79739. class BoxedEditorUIView extends _editorui_editoruiview__WEBPACK_IMPORTED_MODULE_0__["default"] {
  79740. /**
  79741. * Creates an instance of the boxed editor UI view class.
  79742. *
  79743. * @param {module:utils/locale~Locale} locale The locale instance..
  79744. */
  79745. constructor( locale ) {
  79746. super( locale );
  79747. /**
  79748. * Collection of the child views located in the top (`.ck-editor__top`)
  79749. * area of the UI.
  79750. *
  79751. * @readonly
  79752. * @member {module:ui/viewcollection~ViewCollection}
  79753. */
  79754. this.top = this.createCollection();
  79755. /**
  79756. * Collection of the child views located in the main (`.ck-editor__main`)
  79757. * area of the UI.
  79758. *
  79759. * @readonly
  79760. * @member {module:ui/viewcollection~ViewCollection}
  79761. */
  79762. this.main = this.createCollection();
  79763. /**
  79764. * Voice label of the UI.
  79765. *
  79766. * @protected
  79767. * @readonly
  79768. * @member {module:ui/view~View} #_voiceLabelView
  79769. */
  79770. this._voiceLabelView = this._createVoiceLabel();
  79771. this.setTemplate( {
  79772. tag: 'div',
  79773. attributes: {
  79774. class: [
  79775. 'ck',
  79776. 'ck-reset',
  79777. 'ck-editor',
  79778. 'ck-rounded-corners'
  79779. ],
  79780. role: 'application',
  79781. dir: locale.uiLanguageDirection,
  79782. lang: locale.uiLanguage,
  79783. 'aria-labelledby': this._voiceLabelView.id
  79784. },
  79785. children: [
  79786. this._voiceLabelView,
  79787. {
  79788. tag: 'div',
  79789. attributes: {
  79790. class: [
  79791. 'ck',
  79792. 'ck-editor__top',
  79793. 'ck-reset_all'
  79794. ],
  79795. role: 'presentation'
  79796. },
  79797. children: this.top
  79798. },
  79799. {
  79800. tag: 'div',
  79801. attributes: {
  79802. class: [
  79803. 'ck',
  79804. 'ck-editor__main'
  79805. ],
  79806. role: 'presentation'
  79807. },
  79808. children: this.main
  79809. }
  79810. ]
  79811. } );
  79812. }
  79813. /**
  79814. * Creates a voice label view instance.
  79815. *
  79816. * @private
  79817. * @returns {module:ui/label/labelview~LabelView}
  79818. */
  79819. _createVoiceLabel() {
  79820. const t = this.t;
  79821. const voiceLabel = new _label_labelview__WEBPACK_IMPORTED_MODULE_1__["default"]();
  79822. voiceLabel.text = t( 'Rich Text Editor' );
  79823. voiceLabel.extendTemplate( {
  79824. attributes: {
  79825. class: 'ck-voice-label'
  79826. }
  79827. } );
  79828. return voiceLabel;
  79829. }
  79830. }
  79831. /***/ }),
  79832. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js":
  79833. /*!**************************************************************************!*\
  79834. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js ***!
  79835. \**************************************************************************/
  79836. /*! exports provided: default */
  79837. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79838. "use strict";
  79839. __webpack_require__.r(__webpack_exports__);
  79840. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditorUIView; });
  79841. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  79842. /* harmony import */ var _bodycollection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bodycollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js");
  79843. /* harmony import */ var _theme_components_editorui_editorui_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/components/editorui/editorui.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css");
  79844. /**
  79845. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  79846. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  79847. */
  79848. /**
  79849. * @module ui/editorui/editoruiview
  79850. */
  79851. /**
  79852. * The editor UI view class. Base class for the editor main views.
  79853. *
  79854. * @extends module:ui/view~View
  79855. */
  79856. class EditorUIView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  79857. /**
  79858. * Creates an instance of the editor UI view class.
  79859. *
  79860. * @param {module:utils/locale~Locale} [locale] The locale instance.
  79861. */
  79862. constructor( locale ) {
  79863. super( locale );
  79864. /**
  79865. * Collection of the child views, detached from the DOM
  79866. * structure of the editor, like panels, icons etc.
  79867. *
  79868. * @readonly
  79869. * @member {module:ui/viewcollection~ViewCollection} #body
  79870. */
  79871. this.body = new _bodycollection__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  79872. }
  79873. /**
  79874. * @inheritDoc
  79875. */
  79876. render() {
  79877. super.render();
  79878. this.body.attachToDom();
  79879. }
  79880. /**
  79881. * @inheritDoc
  79882. */
  79883. destroy() {
  79884. this.body.detachFromDom();
  79885. return super.destroy();
  79886. }
  79887. }
  79888. /***/ }),
  79889. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js":
  79890. /*!****************************************************************!*\
  79891. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js ***!
  79892. \****************************************************************/
  79893. /*! exports provided: default */
  79894. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79895. "use strict";
  79896. __webpack_require__.r(__webpack_exports__);
  79897. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FocusCycler; });
  79898. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  79899. /**
  79900. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  79901. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  79902. */
  79903. /**
  79904. * @module ui/focuscycler
  79905. */
  79906. /**
  79907. * A utility class that helps cycling over focusable {@link module:ui/view~View views} in a
  79908. * {@link module:ui/viewcollection~ViewCollection} when the focus is tracked by the
  79909. * {@link module:utils/focustracker~FocusTracker} instance. It helps implementing keyboard
  79910. * navigation in HTML forms, toolbars, lists and the like.
  79911. *
  79912. * To work properly it requires:
  79913. * * a collection of focusable (HTML `tabindex` attribute) views that implement the `focus()` method,
  79914. * * an associated focus tracker to determine which view is focused.
  79915. *
  79916. * A simple cycler setup can look like this:
  79917. *
  79918. * const focusables = new ViewCollection();
  79919. * const focusTracker = new FocusTracker();
  79920. *
  79921. * // Add focusable views to the focus tracker.
  79922. * focusTracker.add( ... );
  79923. *
  79924. * Then, the cycler can be used manually:
  79925. *
  79926. * const cycler = new FocusCycler( { focusables, focusTracker } );
  79927. *
  79928. * // Will focus the first focusable view in #focusables.
  79929. * cycler.focusFirst();
  79930. *
  79931. * // Will log the next focusable item in #focusables.
  79932. * console.log( cycler.next );
  79933. *
  79934. * Alternatively, it can work side by side with the {@link module:utils/keystrokehandler~KeystrokeHandler}:
  79935. *
  79936. * const keystrokeHandler = new KeystrokeHandler();
  79937. *
  79938. * // Activate the keystroke handler.
  79939. * keystrokeHandler.listenTo( sourceOfEvents );
  79940. *
  79941. * const cycler = new FocusCycler( {
  79942. * focusables, focusTracker, keystrokeHandler,
  79943. * actions: {
  79944. * // When arrowup of arrowleft is detected by the #keystrokeHandler,
  79945. * // focusPrevious() will be called on the cycler.
  79946. * focusPrevious: [ 'arrowup', 'arrowleft' ],
  79947. * }
  79948. * } );
  79949. *
  79950. * Check out the {@glink framework/guides/deep-dive/ui/focus-tracking "Deep dive into focus tracking" guide} to learn more.
  79951. */
  79952. class FocusCycler {
  79953. /**
  79954. * Creates an instance of the focus cycler utility.
  79955. *
  79956. * @param {Object} options Configuration options.
  79957. * @param {module:utils/collection~Collection|Object} options.focusables
  79958. * @param {module:utils/focustracker~FocusTracker} options.focusTracker
  79959. * @param {module:utils/keystrokehandler~KeystrokeHandler} [options.keystrokeHandler]
  79960. * @param {Object} [options.actions]
  79961. */
  79962. constructor( options ) {
  79963. Object.assign( this, options );
  79964. /**
  79965. * A {@link module:ui/view~View view} collection that the cycler operates on.
  79966. *
  79967. * @readonly
  79968. * @member {module:utils/collection~Collection} #focusables
  79969. */
  79970. /**
  79971. * A focus tracker instance that the cycler uses to determine the current focus
  79972. * state in {@link #focusables}.
  79973. *
  79974. * @readonly
  79975. * @member {module:utils/focustracker~FocusTracker} #focusTracker
  79976. */
  79977. /**
  79978. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}
  79979. * which can respond to certain keystrokes and cycle the focus.
  79980. *
  79981. * @readonly
  79982. * @member {module:utils/keystrokehandler~KeystrokeHandler} #keystrokeHandler
  79983. */
  79984. /**
  79985. * Actions that the cycler can take when a keystroke is pressed. Requires
  79986. * `options.keystrokeHandler` to be passed and working. When an action is
  79987. * performed, `preventDefault` and `stopPropagation` will be called on the event
  79988. * the keystroke fired in the DOM.
  79989. *
  79990. * actions: {
  79991. * // Will call #focusPrevious() when arrowleft or arrowup is pressed.
  79992. * focusPrevious: [ 'arrowleft', 'arrowup' ],
  79993. *
  79994. * // Will call #focusNext() when arrowdown is pressed.
  79995. * focusNext: 'arrowdown'
  79996. * }
  79997. *
  79998. * @readonly
  79999. * @member {Object} #actions
  80000. */
  80001. if ( options.actions && options.keystrokeHandler ) {
  80002. for ( const methodName in options.actions ) {
  80003. let actions = options.actions[ methodName ];
  80004. if ( typeof actions == 'string' ) {
  80005. actions = [ actions ];
  80006. }
  80007. for ( const keystroke of actions ) {
  80008. options.keystrokeHandler.set( keystroke, ( data, cancel ) => {
  80009. this[ methodName ]();
  80010. cancel();
  80011. } );
  80012. }
  80013. }
  80014. }
  80015. }
  80016. /**
  80017. * Returns the first focusable view in {@link #focusables}.
  80018. * Returns `null` if there is none.
  80019. *
  80020. * @readonly
  80021. * @member {module:ui/view~View|null} #first
  80022. */
  80023. get first() {
  80024. return this.focusables.find( isFocusable ) || null;
  80025. }
  80026. /**
  80027. * Returns the last focusable view in {@link #focusables}.
  80028. * Returns `null` if there is none.
  80029. *
  80030. * @readonly
  80031. * @member {module:ui/view~View|null} #last
  80032. */
  80033. get last() {
  80034. return this.focusables.filter( isFocusable ).slice( -1 )[ 0 ] || null;
  80035. }
  80036. /**
  80037. * Returns the next focusable view in {@link #focusables} based on {@link #current}.
  80038. * Returns `null` if there is none.
  80039. *
  80040. * @readonly
  80041. * @member {module:ui/view~View|null} #next
  80042. */
  80043. get next() {
  80044. return this._getFocusableItem( 1 );
  80045. }
  80046. /**
  80047. * Returns the previous focusable view in {@link #focusables} based on {@link #current}.
  80048. * Returns `null` if there is none.
  80049. *
  80050. * @readonly
  80051. * @member {module:ui/view~View|null} #previous
  80052. */
  80053. get previous() {
  80054. return this._getFocusableItem( -1 );
  80055. }
  80056. /**
  80057. * An index of the view in the {@link #focusables} which is focused according
  80058. * to {@link #focusTracker}. Returns `null` when there is no such view.
  80059. *
  80060. * @readonly
  80061. * @member {Number|null} #current
  80062. */
  80063. get current() {
  80064. let index = null;
  80065. // There's no focused view in the focusables.
  80066. if ( this.focusTracker.focusedElement === null ) {
  80067. return null;
  80068. }
  80069. this.focusables.find( ( view, viewIndex ) => {
  80070. const focused = view.element === this.focusTracker.focusedElement;
  80071. if ( focused ) {
  80072. index = viewIndex;
  80073. }
  80074. return focused;
  80075. } );
  80076. return index;
  80077. }
  80078. /**
  80079. * Focuses the {@link #first} item in {@link #focusables}.
  80080. */
  80081. focusFirst() {
  80082. this._focus( this.first );
  80083. }
  80084. /**
  80085. * Focuses the {@link #last} item in {@link #focusables}.
  80086. */
  80087. focusLast() {
  80088. this._focus( this.last );
  80089. }
  80090. /**
  80091. * Focuses the {@link #next} item in {@link #focusables}.
  80092. */
  80093. focusNext() {
  80094. this._focus( this.next );
  80095. }
  80096. /**
  80097. * Focuses the {@link #previous} item in {@link #focusables}.
  80098. */
  80099. focusPrevious() {
  80100. this._focus( this.previous );
  80101. }
  80102. /**
  80103. * Focuses the given view if it exists.
  80104. *
  80105. * @protected
  80106. * @param {module:ui/view~View} view
  80107. */
  80108. _focus( view ) {
  80109. if ( view ) {
  80110. view.focus();
  80111. }
  80112. }
  80113. /**
  80114. * Returns the next or previous focusable view in {@link #focusables} with respect
  80115. * to {@link #current}.
  80116. *
  80117. * @protected
  80118. * @param {Number} step Either `1` for checking forward from {@link #current} or
  80119. * `-1` for checking backwards.
  80120. * @returns {module:ui/view~View|null}
  80121. */
  80122. _getFocusableItem( step ) {
  80123. // Cache for speed.
  80124. const current = this.current;
  80125. const collectionLength = this.focusables.length;
  80126. if ( !collectionLength ) {
  80127. return null;
  80128. }
  80129. // Start from the beginning if no view is focused.
  80130. // https://github.com/ckeditor/ckeditor5-ui/issues/206
  80131. if ( current === null ) {
  80132. return this[ step === 1 ? 'first' : 'last' ];
  80133. }
  80134. // Cycle in both directions.
  80135. let index = ( current + collectionLength + step ) % collectionLength;
  80136. do {
  80137. const view = this.focusables.get( index );
  80138. // TODO: Check if view is visible.
  80139. if ( isFocusable( view ) ) {
  80140. return view;
  80141. }
  80142. // Cycle in both directions.
  80143. index = ( index + collectionLength + step ) % collectionLength;
  80144. } while ( index !== current );
  80145. return null;
  80146. }
  80147. }
  80148. // Checks whether a view is focusable.
  80149. //
  80150. // @private
  80151. // @param {module:ui/view~View} view A view to be checked.
  80152. // @returns {Boolean}
  80153. function isFocusable( view ) {
  80154. return !!( view.focus && _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__["default"].window.getComputedStyle( view.element ).display != 'none' );
  80155. }
  80156. /***/ }),
  80157. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/formheader/formheaderview.js":
  80158. /*!******************************************************************************!*\
  80159. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/formheader/formheaderview.js ***!
  80160. \******************************************************************************/
  80161. /*! exports provided: default */
  80162. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  80163. "use strict";
  80164. __webpack_require__.r(__webpack_exports__);
  80165. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FormHeaderView; });
  80166. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  80167. /* harmony import */ var _theme_components_formheader_formheader_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/components/formheader/formheader.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css");
  80168. /**
  80169. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  80170. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  80171. */
  80172. /**
  80173. * @module ui/formheader/formheaderview
  80174. */
  80175. /**
  80176. * The class component representing a form header view. It should be used in more advanced forms to
  80177. * describe the main purpose of the form.
  80178. *
  80179. * By default the component contains a bolded label view that has to be set. The label is usually a short (at most 3-word) string.
  80180. * The component can also be extended by any other elements, like: icons, dropdowns, etc.
  80181. *
  80182. * It is used i.a.
  80183. * by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}
  80184. * and {@link module:special-characters/ui/specialcharactersnavigationview~SpecialCharactersNavigationView}.
  80185. *
  80186. * The latter is an example, where the component has been extended by {@link module:ui/dropdown/dropdownview~DropdownView} view.
  80187. *
  80188. * @extends module:ui/view~View
  80189. */
  80190. class FormHeaderView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  80191. /**
  80192. * Creates an instance of the form header class.
  80193. *
  80194. * @param {module:utils/locale~Locale} locale The locale instance.
  80195. * @param {Object} options
  80196. * @param {String} options.label A label.
  80197. * @param {String} [options.class] An additional class.
  80198. */
  80199. constructor( locale, options = {} ) {
  80200. super( locale );
  80201. const bind = this.bindTemplate;
  80202. /**
  80203. * The label of the header.
  80204. *
  80205. * @observable
  80206. * @member {String} #label
  80207. */
  80208. this.set( 'label', options.label || '' );
  80209. /**
  80210. * An additional CSS class added to the {@link #element}.
  80211. *
  80212. * @observable
  80213. * @member {String} #class
  80214. */
  80215. this.set( 'class', options.class || null );
  80216. /**
  80217. * A collection of header items.
  80218. *
  80219. * @readonly
  80220. * @member {module:ui/viewcollection~ViewCollection}
  80221. */
  80222. this.children = this.createCollection();
  80223. this.setTemplate( {
  80224. tag: 'div',
  80225. attributes: {
  80226. class: [
  80227. 'ck',
  80228. 'ck-form__header',
  80229. bind.to( 'class' )
  80230. ]
  80231. },
  80232. children: this.children
  80233. } );
  80234. const label = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]( locale );
  80235. label.setTemplate( {
  80236. tag: 'span',
  80237. attributes: {
  80238. class: [
  80239. 'ck',
  80240. 'ck-form__header__label'
  80241. ]
  80242. },
  80243. children: [
  80244. { text: bind.to( 'label' ) }
  80245. ]
  80246. } );
  80247. this.children.add( label );
  80248. }
  80249. }
  80250. /***/ }),
  80251. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js":
  80252. /*!******************************************************************!*\
  80253. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js ***!
  80254. \******************************************************************/
  80255. /*! exports provided: default */
  80256. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  80257. "use strict";
  80258. __webpack_require__.r(__webpack_exports__);
  80259. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return IconView; });
  80260. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  80261. /* harmony import */ var _theme_components_icon_icon_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/components/icon/icon.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css");
  80262. /**
  80263. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  80264. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  80265. */
  80266. /* global DOMParser */
  80267. /**
  80268. * @module ui/icon/iconview
  80269. */
  80270. /**
  80271. * The icon view class.
  80272. *
  80273. * @extends module:ui/view~View
  80274. */
  80275. class IconView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  80276. /**
  80277. * @inheritDoc
  80278. */
  80279. constructor() {
  80280. super();
  80281. const bind = this.bindTemplate;
  80282. /**
  80283. * The SVG source of the icon.
  80284. *
  80285. * @observable
  80286. * @member {String} #content
  80287. */
  80288. this.set( 'content', '' );
  80289. /**
  80290. * This attribute specifies the boundaries to which the
  80291. * icon content should stretch.
  80292. *
  80293. * @observable
  80294. * @default '0 0 20 20'
  80295. * @member {String} #viewBox
  80296. */
  80297. this.set( 'viewBox', '0 0 20 20' );
  80298. /**
  80299. * The fill color of the child `path.ck-icon__fill`.
  80300. *
  80301. * @observable
  80302. * @default ''
  80303. * @member {String} #fillColor
  80304. */
  80305. this.set( 'fillColor', '' );
  80306. this.setTemplate( {
  80307. tag: 'svg',
  80308. ns: 'http://www.w3.org/2000/svg',
  80309. attributes: {
  80310. class: [
  80311. 'ck',
  80312. 'ck-icon'
  80313. ],
  80314. viewBox: bind.to( 'viewBox' )
  80315. }
  80316. } );
  80317. }
  80318. /**
  80319. * @inheritDoc
  80320. */
  80321. render() {
  80322. super.render();
  80323. this._updateXMLContent();
  80324. this._colorFillPaths();
  80325. // This is a hack for lack of innerHTML binding.
  80326. // See: https://github.com/ckeditor/ckeditor5-ui/issues/99.
  80327. this.on( 'change:content', () => {
  80328. this._updateXMLContent();
  80329. this._colorFillPaths();
  80330. } );
  80331. this.on( 'change:fillColor', () => {
  80332. this._colorFillPaths();
  80333. } );
  80334. }
  80335. /**
  80336. * Updates the {@link #element} with the value of {@link #content}.
  80337. *
  80338. * @private
  80339. */
  80340. _updateXMLContent() {
  80341. if ( this.content ) {
  80342. const parsed = new DOMParser().parseFromString( this.content.trim(), 'image/svg+xml' );
  80343. const svg = parsed.querySelector( 'svg' );
  80344. const viewBox = svg.getAttribute( 'viewBox' );
  80345. if ( viewBox ) {
  80346. this.viewBox = viewBox;
  80347. }
  80348. this.element.innerHTML = '';
  80349. while ( svg.childNodes.length > 0 ) {
  80350. this.element.appendChild( svg.childNodes[ 0 ] );
  80351. }
  80352. }
  80353. }
  80354. /**
  80355. * Fills all child `path.ck-icon__fill` with the `#fillColor`.
  80356. *
  80357. * @private
  80358. */
  80359. _colorFillPaths() {
  80360. if ( this.fillColor ) {
  80361. this.element.querySelectorAll( '.ck-icon__fill' ).forEach( path => {
  80362. path.style.fill = this.fillColor;
  80363. } );
  80364. }
  80365. }
  80366. }
  80367. /***/ }),
  80368. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/iframe/iframeview.js":
  80369. /*!**********************************************************************!*\
  80370. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/iframe/iframeview.js ***!
  80371. \**********************************************************************/
  80372. /*! exports provided: default */
  80373. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  80374. "use strict";
  80375. __webpack_require__.r(__webpack_exports__);
  80376. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return IframeView; });
  80377. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  80378. /**
  80379. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  80380. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  80381. */
  80382. /**
  80383. * @module ui/iframe/iframeview
  80384. */
  80385. /**
  80386. * The iframe view class.
  80387. *
  80388. * const iframe = new IframeView();
  80389. *
  80390. * iframe.render();
  80391. * document.body.appendChild( iframe.element );
  80392. *
  80393. * iframe.on( 'loaded', () => {
  80394. * console.log( 'The iframe has loaded', iframe.element.contentWindow );
  80395. * } );
  80396. *
  80397. * iframe.element.src = 'https://ckeditor.com';
  80398. *
  80399. * @extends module:ui/view~View
  80400. */
  80401. class IframeView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  80402. /**
  80403. * Creates a new instance of the iframe view.
  80404. *
  80405. * @param {module:utils/locale~Locale} [locale] The locale instance.
  80406. */
  80407. constructor( locale ) {
  80408. super( locale );
  80409. const bind = this.bindTemplate;
  80410. this.setTemplate( {
  80411. tag: 'iframe',
  80412. attributes: {
  80413. class: [
  80414. 'ck',
  80415. 'ck-reset_all'
  80416. ],
  80417. // It seems that we need to allow scripts in order to be able to listen to events.
  80418. // TODO: Research that. Perhaps the src must be set?
  80419. sandbox: 'allow-same-origin allow-scripts'
  80420. },
  80421. on: {
  80422. load: bind.to( 'loaded' )
  80423. }
  80424. } );
  80425. }
  80426. /**
  80427. * Renders the iframe's {@link #element} and returns a `Promise` for asynchronous
  80428. * child `contentDocument` loading process.
  80429. *
  80430. * @returns {Promise} A promise which resolves once the iframe `contentDocument` has
  80431. * been {@link #event:loaded}.
  80432. */
  80433. render() {
  80434. return new Promise( resolve => {
  80435. this.on( 'loaded', resolve );
  80436. super.render();
  80437. } );
  80438. }
  80439. }
  80440. /**
  80441. * Fired when the DOM iframe's `contentDocument` finished loading.
  80442. *
  80443. * @event loaded
  80444. */
  80445. /***/ }),
  80446. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/index.js":
  80447. /*!**********************************************************!*\
  80448. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/index.js ***!
  80449. \**********************************************************/
  80450. /*! exports provided: clickOutsideHandler, injectCssTransitionDisabler, submitHandler, BodyCollection, ButtonView, SwitchButtonView, getLocalizedColorOptions, normalizeColorOptions, normalizeSingleColorDefinition, ColorGridView, ColorTileView, DropdownButtonView, SplitButtonView, createDropdown, addToolbarToDropdown, addListToDropdown, EditorUIView, BoxedEditorUIView, InlineEditableUIView, FormHeaderView, FocusCycler, IconView, InputTextView, IframeView, LabelView, LabeledFieldView, createLabeledInputText, createLabeledDropdown, ListItemView, ListView, Notification, Model, BalloonPanelView, ContextualBalloon, StickyPanelView, TooltipView, Template, ToolbarView, ToolbarSeparatorView, enableToolbarKeyboardFocus, normalizeToolbarConfig, BalloonToolbar, BlockToolbar, View, ViewCollection */
  80451. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  80452. "use strict";
  80453. __webpack_require__.r(__webpack_exports__);
  80454. /* harmony import */ var _bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bindings/clickoutsidehandler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js");
  80455. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clickOutsideHandler", function() { return _bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  80456. /* harmony import */ var _bindings_injectcsstransitiondisabler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bindings/injectcsstransitiondisabler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/injectcsstransitiondisabler.js");
  80457. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "injectCssTransitionDisabler", function() { return _bindings_injectcsstransitiondisabler__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  80458. /* harmony import */ var _bindings_submithandler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bindings/submithandler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js");
  80459. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "submitHandler", function() { return _bindings_submithandler__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  80460. /* harmony import */ var _editorui_bodycollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editorui/bodycollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js");
  80461. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BodyCollection", function() { return _editorui_bodycollection__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  80462. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  80463. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ButtonView", function() { return _button_buttonview__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  80464. /* harmony import */ var _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./button/switchbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js");
  80465. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SwitchButtonView", function() { return _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  80466. /* harmony import */ var _colorgrid_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./colorgrid/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/utils.js");
  80467. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLocalizedColorOptions", function() { return _colorgrid_utils__WEBPACK_IMPORTED_MODULE_6__["getLocalizedColorOptions"]; });
  80468. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeColorOptions", function() { return _colorgrid_utils__WEBPACK_IMPORTED_MODULE_6__["normalizeColorOptions"]; });
  80469. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeSingleColorDefinition", function() { return _colorgrid_utils__WEBPACK_IMPORTED_MODULE_6__["normalizeSingleColorDefinition"]; });
  80470. /* harmony import */ var _colorgrid_colorgridview__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./colorgrid/colorgridview */ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview.js");
  80471. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorGridView", function() { return _colorgrid_colorgridview__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  80472. /* harmony import */ var _colorgrid_colortileview__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./colorgrid/colortileview */ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js");
  80473. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorTileView", function() { return _colorgrid_colortileview__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  80474. /* harmony import */ var _dropdown_button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dropdown/button/dropdownbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js");
  80475. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropdownButtonView", function() { return _dropdown_button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  80476. /* harmony import */ var _dropdown_button_splitbuttonview__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./dropdown/button/splitbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview.js");
  80477. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SplitButtonView", function() { return _dropdown_button_splitbuttonview__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  80478. /* harmony import */ var _dropdown_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./dropdown/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js");
  80479. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createDropdown", function() { return _dropdown_utils__WEBPACK_IMPORTED_MODULE_11__["createDropdown"]; });
  80480. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addToolbarToDropdown", function() { return _dropdown_utils__WEBPACK_IMPORTED_MODULE_11__["addToolbarToDropdown"]; });
  80481. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addListToDropdown", function() { return _dropdown_utils__WEBPACK_IMPORTED_MODULE_11__["addListToDropdown"]; });
  80482. /* harmony import */ var _editorui_editoruiview__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./editorui/editoruiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js");
  80483. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorUIView", function() { return _editorui_editoruiview__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  80484. /* harmony import */ var _editorui_boxed_boxededitoruiview__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./editorui/boxed/boxededitoruiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js");
  80485. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BoxedEditorUIView", function() { return _editorui_boxed_boxededitoruiview__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  80486. /* harmony import */ var _editableui_inline_inlineeditableuiview__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./editableui/inline/inlineeditableuiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.js");
  80487. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InlineEditableUIView", function() { return _editableui_inline_inlineeditableuiview__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  80488. /* harmony import */ var _formheader_formheaderview__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./formheader/formheaderview */ "./node_modules/@ckeditor/ckeditor5-ui/src/formheader/formheaderview.js");
  80489. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormHeaderView", function() { return _formheader_formheaderview__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  80490. /* harmony import */ var _focuscycler__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
  80491. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocusCycler", function() { return _focuscycler__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  80492. /* harmony import */ var _icon_iconview__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./icon/iconview */ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js");
  80493. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IconView", function() { return _icon_iconview__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  80494. /* harmony import */ var _inputtext_inputtextview__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./inputtext/inputtextview */ "./node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js");
  80495. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InputTextView", function() { return _inputtext_inputtextview__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  80496. /* harmony import */ var _iframe_iframeview__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./iframe/iframeview */ "./node_modules/@ckeditor/ckeditor5-ui/src/iframe/iframeview.js");
  80497. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IframeView", function() { return _iframe_iframeview__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  80498. /* harmony import */ var _label_labelview__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./label/labelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js");
  80499. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LabelView", function() { return _label_labelview__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  80500. /* harmony import */ var _labeledfield_labeledfieldview__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./labeledfield/labeledfieldview */ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview.js");
  80501. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LabeledFieldView", function() { return _labeledfield_labeledfieldview__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  80502. /* harmony import */ var _labeledfield_utils__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./labeledfield/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/utils.js");
  80503. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createLabeledInputText", function() { return _labeledfield_utils__WEBPACK_IMPORTED_MODULE_22__["createLabeledInputText"]; });
  80504. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createLabeledDropdown", function() { return _labeledfield_utils__WEBPACK_IMPORTED_MODULE_22__["createLabeledDropdown"]; });
  80505. /* harmony import */ var _list_listitemview__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./list/listitemview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js");
  80506. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListItemView", function() { return _list_listitemview__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  80507. /* harmony import */ var _list_listview__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./list/listview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js");
  80508. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListView", function() { return _list_listview__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  80509. /* harmony import */ var _notification_notification__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./notification/notification */ "./node_modules/@ckeditor/ckeditor5-ui/src/notification/notification.js");
  80510. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return _notification_notification__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  80511. /* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./model */ "./node_modules/@ckeditor/ckeditor5-ui/src/model.js");
  80512. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Model", function() { return _model__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  80513. /* harmony import */ var _panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./panel/balloon/balloonpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
  80514. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BalloonPanelView", function() { return _panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  80515. /* harmony import */ var _panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./panel/balloon/contextualballoon */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js");
  80516. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContextualBalloon", function() { return _panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  80517. /* harmony import */ var _panel_sticky_stickypanelview__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./panel/sticky/stickypanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview.js");
  80518. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StickyPanelView", function() { return _panel_sticky_stickypanelview__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  80519. /* harmony import */ var _tooltip_tooltipview__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./tooltip/tooltipview */ "./node_modules/@ckeditor/ckeditor5-ui/src/tooltip/tooltipview.js");
  80520. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TooltipView", function() { return _tooltip_tooltipview__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  80521. /* harmony import */ var _template__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
  80522. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Template", function() { return _template__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  80523. /* harmony import */ var _toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./toolbar/toolbarview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js");
  80524. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToolbarView", function() { return _toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  80525. /* harmony import */ var _toolbar_toolbarseparatorview__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./toolbar/toolbarseparatorview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js");
  80526. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToolbarSeparatorView", function() { return _toolbar_toolbarseparatorview__WEBPACK_IMPORTED_MODULE_33__["default"]; });
  80527. /* harmony import */ var _toolbar_enabletoolbarkeyboardfocus__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./toolbar/enabletoolbarkeyboardfocus */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus.js");
  80528. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "enableToolbarKeyboardFocus", function() { return _toolbar_enabletoolbarkeyboardfocus__WEBPACK_IMPORTED_MODULE_34__["default"]; });
  80529. /* harmony import */ var _toolbar_normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./toolbar/normalizetoolbarconfig */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js");
  80530. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeToolbarConfig", function() { return _toolbar_normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_35__["default"]; });
  80531. /* harmony import */ var _toolbar_balloon_balloontoolbar__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./toolbar/balloon/balloontoolbar */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/balloon/balloontoolbar.js");
  80532. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BalloonToolbar", function() { return _toolbar_balloon_balloontoolbar__WEBPACK_IMPORTED_MODULE_36__["default"]; });
  80533. /* harmony import */ var _toolbar_block_blocktoolbar__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./toolbar/block/blocktoolbar */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blocktoolbar.js");
  80534. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockToolbar", function() { return _toolbar_block_blocktoolbar__WEBPACK_IMPORTED_MODULE_37__["default"]; });
  80535. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  80536. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "View", function() { return _view__WEBPACK_IMPORTED_MODULE_38__["default"]; });
  80537. /* harmony import */ var _viewcollection__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
  80538. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewCollection", function() { return _viewcollection__WEBPACK_IMPORTED_MODULE_39__["default"]; });
  80539. /**
  80540. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  80541. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  80542. */
  80543. /**
  80544. * @module ui
  80545. */
  80546. /***/ }),
  80547. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js":
  80548. /*!****************************************************************************!*\
  80549. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js ***!
  80550. \****************************************************************************/
  80551. /*! exports provided: default */
  80552. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  80553. "use strict";
  80554. __webpack_require__.r(__webpack_exports__);
  80555. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InputTextView; });
  80556. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  80557. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  80558. /* harmony import */ var _theme_components_inputtext_inputtext_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/components/inputtext/inputtext.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css");
  80559. /**
  80560. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  80561. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  80562. */
  80563. /**
  80564. * @module ui/inputtext/inputtextview
  80565. */
  80566. /**
  80567. * The text input view class.
  80568. *
  80569. * @extends module:ui/view~View
  80570. */
  80571. class InputTextView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  80572. /**
  80573. * @inheritDoc
  80574. */
  80575. constructor( locale ) {
  80576. super( locale );
  80577. /**
  80578. * The value of the input.
  80579. *
  80580. * @observable
  80581. * @member {String} #value
  80582. */
  80583. this.set( 'value' );
  80584. /**
  80585. * The `id` attribute of the input (i.e. to pair with a `<label>` element).
  80586. *
  80587. * @observable
  80588. * @member {String} #id
  80589. */
  80590. this.set( 'id' );
  80591. /**
  80592. * The `placeholder` attribute of the input.
  80593. *
  80594. * @observable
  80595. * @member {String} #placeholder
  80596. */
  80597. this.set( 'placeholder' );
  80598. /**
  80599. * Controls whether the input view is in read-only mode.
  80600. *
  80601. * @observable
  80602. * @member {Boolean} #isReadOnly
  80603. */
  80604. this.set( 'isReadOnly', false );
  80605. /**
  80606. * Set to `true` when the field has some error. Usually controlled via
  80607. * {@link module:ui/labeledinput/labeledinputview~LabeledInputView#errorText}.
  80608. *
  80609. * @observable
  80610. * @member {Boolean} #hasError
  80611. */
  80612. this.set( 'hasError', false );
  80613. /**
  80614. * The `id` of the element describing this field, e.g. when it has
  80615. * some error, it helps screen readers read the error text.
  80616. *
  80617. * @observable
  80618. * @member {Boolean} #ariaDescribedById
  80619. */
  80620. this.set( 'ariaDescribedById' );
  80621. /**
  80622. * Stores information about the editor UI focus and propagates it so various plugins and components
  80623. * are unified as a focus group.
  80624. *
  80625. * @readonly
  80626. * @member {module:utils/focustracker~FocusTracker} #focusTracker
  80627. */
  80628. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__["default"]();
  80629. /**
  80630. * An observable flag set to `true` when the input is currently focused by the user.
  80631. * Set to `false` otherwise.
  80632. *
  80633. * @readonly
  80634. * @observable
  80635. * @member {Boolean} #isFocused
  80636. * @default false
  80637. */
  80638. this.bind( 'isFocused' ).to( this.focusTracker );
  80639. /**
  80640. * An observable flag set to `true` when the input contains no text, i.e.
  80641. * when {@link #value} is `''`, `null`, or `false`.
  80642. *
  80643. * @readonly
  80644. * @observable
  80645. * @member {Boolean} #isEmpty
  80646. * @default true
  80647. */
  80648. this.set( 'isEmpty', true );
  80649. const bind = this.bindTemplate;
  80650. this.setTemplate( {
  80651. tag: 'input',
  80652. attributes: {
  80653. type: 'text',
  80654. class: [
  80655. 'ck',
  80656. 'ck-input',
  80657. 'ck-input-text',
  80658. bind.if( 'isFocused', 'ck-input_focused' ),
  80659. bind.if( 'isEmpty', 'ck-input-text_empty' ),
  80660. bind.if( 'hasError', 'ck-error' )
  80661. ],
  80662. id: bind.to( 'id' ),
  80663. placeholder: bind.to( 'placeholder' ),
  80664. readonly: bind.to( 'isReadOnly' ),
  80665. 'aria-invalid': bind.if( 'hasError', true ),
  80666. 'aria-describedby': bind.to( 'ariaDescribedById' )
  80667. },
  80668. on: {
  80669. input: bind.to( ( ...args ) => {
  80670. this.fire( 'input', ...args );
  80671. this._updateIsEmpty();
  80672. } ),
  80673. change: bind.to( this._updateIsEmpty.bind( this ) )
  80674. }
  80675. } );
  80676. /**
  80677. * Fired when the user types in the input. Corresponds to the native
  80678. * DOM `input` event.
  80679. *
  80680. * @event input
  80681. */
  80682. }
  80683. /**
  80684. * @inheritDoc
  80685. */
  80686. render() {
  80687. super.render();
  80688. this.focusTracker.add( this.element );
  80689. this._setDomElementValue( this.value );
  80690. this._updateIsEmpty();
  80691. // Bind `this.value` to the DOM element's value.
  80692. // We cannot use `value` DOM attribute because removing it on Edge does not clear the DOM element's value property.
  80693. this.on( 'change:value', ( evt, name, value ) => {
  80694. this._setDomElementValue( value );
  80695. this._updateIsEmpty();
  80696. } );
  80697. }
  80698. /**
  80699. * @inheritDoc
  80700. */
  80701. destroy() {
  80702. super.destroy();
  80703. this.focusTracker.destroy();
  80704. }
  80705. /**
  80706. * Moves the focus to the input and selects the value.
  80707. */
  80708. select() {
  80709. this.element.select();
  80710. }
  80711. /**
  80712. * Focuses the input.
  80713. */
  80714. focus() {
  80715. this.element.focus();
  80716. }
  80717. /**
  80718. * Updates the {@link #isEmpty} property value on demand.
  80719. *
  80720. * @private
  80721. */
  80722. _updateIsEmpty() {
  80723. this.isEmpty = isInputElementEmpty( this.element );
  80724. }
  80725. /**
  80726. * Sets the `value` property of the {@link #element DOM element} on demand.
  80727. *
  80728. * @private
  80729. */
  80730. _setDomElementValue( value ) {
  80731. this.element.value = ( !value && value !== 0 ) ? '' : value;
  80732. }
  80733. }
  80734. function isInputElementEmpty( domElement ) {
  80735. return !domElement.value;
  80736. }
  80737. /***/ }),
  80738. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js":
  80739. /*!********************************************************************!*\
  80740. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js ***!
  80741. \********************************************************************/
  80742. /*! exports provided: default */
  80743. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  80744. "use strict";
  80745. __webpack_require__.r(__webpack_exports__);
  80746. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LabelView; });
  80747. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  80748. /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  80749. /* harmony import */ var _theme_components_label_label_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/components/label/label.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css");
  80750. /**
  80751. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  80752. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  80753. */
  80754. /**
  80755. * @module ui/label/labelview
  80756. */
  80757. /**
  80758. * The label view class.
  80759. *
  80760. * @extends module:ui/view~View
  80761. */
  80762. class LabelView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  80763. /**
  80764. * @inheritDoc
  80765. */
  80766. constructor( locale ) {
  80767. super( locale );
  80768. /**
  80769. * The text of the label.
  80770. *
  80771. * @observable
  80772. * @member {String} #text
  80773. */
  80774. this.set( 'text' );
  80775. /**
  80776. * The `for` attribute of the label (i.e. to pair with an `<input>` element).
  80777. *
  80778. * @observable
  80779. * @member {String} #for
  80780. */
  80781. this.set( 'for' );
  80782. /**
  80783. * An unique id of the label. It can be used by other UI components to reference
  80784. * the label, for instance, using the `aria-describedby` DOM attribute.
  80785. *
  80786. * @member {String} #id
  80787. */
  80788. this.id = `ck-editor__label_${ Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__["default"])() }`;
  80789. const bind = this.bindTemplate;
  80790. this.setTemplate( {
  80791. tag: 'label',
  80792. attributes: {
  80793. class: [
  80794. 'ck',
  80795. 'ck-label'
  80796. ],
  80797. id: this.id,
  80798. for: bind.to( 'for' )
  80799. },
  80800. children: [
  80801. {
  80802. text: bind.to( 'text' )
  80803. }
  80804. ]
  80805. } );
  80806. }
  80807. }
  80808. /***/ }),
  80809. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview.js":
  80810. /*!**********************************************************************************!*\
  80811. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview.js ***!
  80812. \**********************************************************************************/
  80813. /*! exports provided: default */
  80814. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  80815. "use strict";
  80816. __webpack_require__.r(__webpack_exports__);
  80817. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LabeledFieldView; });
  80818. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  80819. /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  80820. /* harmony import */ var _label_labelview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../label/labelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js");
  80821. /* harmony import */ var _theme_components_labeledfield_labeledfieldview_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/components/labeledfield/labeledfieldview.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css");
  80822. /**
  80823. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  80824. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  80825. */
  80826. /**
  80827. * @module ui/labeledfield/labeledfieldview
  80828. */
  80829. /**
  80830. * The labeled field view class. It can be used to enhance any view with the following features:
  80831. *
  80832. * * a label,
  80833. * * (optional) an error message,
  80834. * * (optional) an info (status) text,
  80835. *
  80836. * all bound logically by proper DOM attributes for UX and accessibility. It also provides an interface
  80837. * (e.g. observable properties) that allows controlling those additional features.
  80838. *
  80839. * The constructor of this class requires a callback that returns a view to be labeled. The callback
  80840. * is called with unique ids that allow binding of DOM properties:
  80841. *
  80842. * const labeledInputView = new LabeledFieldView( locale, ( labeledFieldView, viewUid, statusUid ) => {
  80843. * const inputView = new InputTextView( labeledFieldView.locale );
  80844. *
  80845. * inputView.set( {
  80846. * id: viewUid,
  80847. * ariaDescribedById: statusUid
  80848. * } );
  80849. *
  80850. * inputView.bind( 'isReadOnly' ).to( labeledFieldView, 'isEnabled', value => !value );
  80851. * inputView.bind( 'hasError' ).to( labeledFieldView, 'errorText', value => !!value );
  80852. *
  80853. * return inputView;
  80854. * } );
  80855. *
  80856. * labeledInputView.label = 'User name';
  80857. * labeledInputView.infoText = 'Full name like for instance, John Doe.';
  80858. * labeledInputView.render();
  80859. *
  80860. * document.body.append( labeledInputView.element );
  80861. *
  80862. * See {@link module:ui/labeledfield/utils} to discover ready–to–use labeled input helpers for common
  80863. * UI components.
  80864. *
  80865. * @extends module:ui/view~View
  80866. */
  80867. class LabeledFieldView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  80868. /**
  80869. * Creates an instance of the labeled field view class using a provided creator function
  80870. * that provides the view to be labeled.
  80871. *
  80872. * @param {module:utils/locale~Locale} locale The locale instance.
  80873. * @param {Function} viewCreator A function that returns a {@link module:ui/view~View}
  80874. * that will be labeled. The following arguments are passed to the creator function:
  80875. *
  80876. * * an instance of the `LabeledFieldView` to allow binding observable properties,
  80877. * * an UID string that connects the {@link #labelView label} and the labeled field view in DOM,
  80878. * * an UID string that connects the {@link #statusView status} and the labeled field view in DOM.
  80879. */
  80880. constructor( locale, viewCreator ) {
  80881. super( locale );
  80882. const viewUid = `ck-labeled-field-view-${ Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__["default"])() }`;
  80883. const statusUid = `ck-labeled-field-view-status-${ Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__["default"])() }`;
  80884. /**
  80885. * The field view that gets labeled.
  80886. *
  80887. * @member {module:ui/view~View} #fieldView
  80888. */
  80889. this.fieldView = viewCreator( this, viewUid, statusUid );
  80890. /**
  80891. * The text of the label.
  80892. *
  80893. * @observable
  80894. * @member {String} #label
  80895. */
  80896. this.set( 'label' );
  80897. /**
  80898. * Controls whether the component is in read-only mode.
  80899. *
  80900. * @observable
  80901. * @member {Boolean} #isEnabled
  80902. */
  80903. this.set( 'isEnabled', true );
  80904. /**
  80905. * An observable flag set to `true` when {@link #fieldView} is empty (`false` otherwise).
  80906. *
  80907. * @readonly
  80908. * @observable
  80909. * @member {Boolean} #isEmpty
  80910. * @default true
  80911. */
  80912. this.set( 'isEmpty', true );
  80913. /**
  80914. * An observable flag set to `true` when {@link #fieldView} is currently focused by
  80915. * the user (`false` otherwise).
  80916. *
  80917. * @readonly
  80918. * @observable
  80919. * @member {Boolean} #isFocused
  80920. * @default false
  80921. */
  80922. this.set( 'isFocused', false );
  80923. /**
  80924. * The validation error text. When set, it will be displayed
  80925. * next to the {@link #fieldView} as a typical validation error message.
  80926. * Set it to `null` to hide the message.
  80927. *
  80928. * **Note:** Setting this property to anything but `null` will automatically
  80929. * make the `hasError` of the {@link #fieldView} `true`.
  80930. *
  80931. * @observable
  80932. * @member {String|null} #errorText
  80933. */
  80934. this.set( 'errorText', null );
  80935. /**
  80936. * The additional information text displayed next to the {@link #fieldView} which can
  80937. * be used to inform the user about its purpose, provide help or hints.
  80938. *
  80939. * Set it to `null` to hide the message.
  80940. *
  80941. * **Note:** This text will be displayed in the same place as {@link #errorText} but the
  80942. * latter always takes precedence: if the {@link #errorText} is set, it replaces
  80943. * {@link #infoText}.
  80944. *
  80945. * @observable
  80946. * @member {String|null} #infoText
  80947. * @default null
  80948. */
  80949. this.set( 'infoText', null );
  80950. /**
  80951. * (Optional) The additional CSS class set on the dropdown {@link #element}.
  80952. *
  80953. * @observable
  80954. * @member {String} #class
  80955. */
  80956. this.set( 'class' );
  80957. /**
  80958. * The content of the `placeholder` attribute of the {@link #fieldView}.
  80959. *
  80960. * @observable
  80961. * @member {String} #placeholder
  80962. */
  80963. this.set( 'placeholder' );
  80964. /**
  80965. * The label view instance that describes the entire view.
  80966. *
  80967. * @member {module:ui/label/labelview~LabelView} #labelView
  80968. */
  80969. this.labelView = this._createLabelView( viewUid );
  80970. /**
  80971. * The status view for the {@link #fieldView}. It displays {@link #errorText} and
  80972. * {@link #infoText}.
  80973. *
  80974. * @member {module:ui/view~View} #statusView
  80975. */
  80976. this.statusView = this._createStatusView( statusUid );
  80977. /**
  80978. * The combined status text made of {@link #errorText} and {@link #infoText}.
  80979. * Note that when present, {@link #errorText} always takes precedence in the
  80980. * status.
  80981. *
  80982. * @see #errorText
  80983. * @see #infoText
  80984. * @see #statusView
  80985. * @private
  80986. * @observable
  80987. * @member {String|null} #_statusText
  80988. */
  80989. this.bind( '_statusText' ).to(
  80990. this, 'errorText',
  80991. this, 'infoText',
  80992. ( errorText, infoText ) => errorText || infoText
  80993. );
  80994. const bind = this.bindTemplate;
  80995. this.setTemplate( {
  80996. tag: 'div',
  80997. attributes: {
  80998. class: [
  80999. 'ck',
  81000. 'ck-labeled-field-view',
  81001. bind.to( 'class' ),
  81002. bind.if( 'isEnabled', 'ck-disabled', value => !value ),
  81003. bind.if( 'isEmpty', 'ck-labeled-field-view_empty' ),
  81004. bind.if( 'isFocused', 'ck-labeled-field-view_focused' ),
  81005. bind.if( 'placeholder', 'ck-labeled-field-view_placeholder' ),
  81006. bind.if( 'errorText', 'ck-error' )
  81007. ]
  81008. },
  81009. children: [
  81010. {
  81011. tag: 'div',
  81012. attributes: {
  81013. class: [
  81014. 'ck',
  81015. 'ck-labeled-field-view__input-wrapper'
  81016. ]
  81017. },
  81018. children: [
  81019. this.fieldView,
  81020. this.labelView
  81021. ]
  81022. },
  81023. this.statusView
  81024. ]
  81025. } );
  81026. }
  81027. /**
  81028. * Creates label view class instance and bind with view.
  81029. *
  81030. * @private
  81031. * @param {String} id Unique id to set as labelView#for attribute.
  81032. * @returns {module:ui/label/labelview~LabelView}
  81033. */
  81034. _createLabelView( id ) {
  81035. const labelView = new _label_labelview__WEBPACK_IMPORTED_MODULE_2__["default"]( this.locale );
  81036. labelView.for = id;
  81037. labelView.bind( 'text' ).to( this, 'label' );
  81038. return labelView;
  81039. }
  81040. /**
  81041. * Creates the status view instance. It displays {@link #errorText} and {@link #infoText}
  81042. * next to the {@link #fieldView}. See {@link #_statusText}.
  81043. *
  81044. * @private
  81045. * @param {String} statusUid Unique id of the status, shared with the {@link #fieldView view's}
  81046. * `aria-describedby` attribute.
  81047. * @returns {module:ui/view~View}
  81048. */
  81049. _createStatusView( statusUid ) {
  81050. const statusView = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]( this.locale );
  81051. const bind = this.bindTemplate;
  81052. statusView.setTemplate( {
  81053. tag: 'div',
  81054. attributes: {
  81055. class: [
  81056. 'ck',
  81057. 'ck-labeled-field-view__status',
  81058. bind.if( 'errorText', 'ck-labeled-field-view__status_error' ),
  81059. bind.if( '_statusText', 'ck-hidden', value => !value )
  81060. ],
  81061. id: statusUid,
  81062. role: bind.if( 'errorText', 'alert' )
  81063. },
  81064. children: [
  81065. {
  81066. text: bind.to( '_statusText' )
  81067. }
  81068. ]
  81069. } );
  81070. return statusView;
  81071. }
  81072. /**
  81073. * Focuses the {@link #fieldView}.
  81074. */
  81075. focus() {
  81076. this.fieldView.focus();
  81077. }
  81078. }
  81079. /***/ }),
  81080. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/utils.js":
  81081. /*!***********************************************************************!*\
  81082. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/utils.js ***!
  81083. \***********************************************************************/
  81084. /*! exports provided: createLabeledInputText, createLabeledDropdown */
  81085. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  81086. "use strict";
  81087. __webpack_require__.r(__webpack_exports__);
  81088. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLabeledInputText", function() { return createLabeledInputText; });
  81089. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLabeledDropdown", function() { return createLabeledDropdown; });
  81090. /* harmony import */ var _inputtext_inputtextview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../inputtext/inputtextview */ "./node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js");
  81091. /* harmony import */ var _dropdown_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dropdown/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js");
  81092. /**
  81093. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  81094. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  81095. */
  81096. /**
  81097. * @module ui/labeledfield/utils
  81098. */
  81099. /**
  81100. * A helper for creating labeled inputs.
  81101. *
  81102. * It creates an instance of a {@link module:ui/inputtext/inputtextview~InputTextView input text} that is
  81103. * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in DOM.
  81104. *
  81105. * The helper does the following:
  81106. *
  81107. * * It sets input's `id` and `ariaDescribedById` attributes.
  81108. * * It binds input's `isReadOnly` to the labeled view.
  81109. * * It binds input's `hasError` to the labeled view.
  81110. * * It enables a logic that cleans up the error when user starts typing in the input..
  81111. *
  81112. * Usage:
  81113. *
  81114. * const labeledInputView = new LabeledFieldView( locale, createLabeledDropdown );
  81115. * console.log( labeledInputView.view ); // An input instance.
  81116. *
  81117. * @param {module:ui/labeledfield/labeledfieldview~LabeledFieldView} labeledFieldView The instance of the labeled field view.
  81118. * @param {String} viewUid An UID string that allows DOM logical connection between the
  81119. * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view's label} and the input.
  81120. * @param {String} statusUid An UID string that allows DOM logical connection between the
  81121. * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view's status} and the input.
  81122. * @returns {module:ui/inputtext/inputtextview~InputTextView} The input text view instance.
  81123. */
  81124. function createLabeledInputText( labeledFieldView, viewUid, statusUid ) {
  81125. const inputView = new _inputtext_inputtextview__WEBPACK_IMPORTED_MODULE_0__["default"]( labeledFieldView.locale );
  81126. inputView.set( {
  81127. id: viewUid,
  81128. ariaDescribedById: statusUid
  81129. } );
  81130. inputView.bind( 'isReadOnly' ).to( labeledFieldView, 'isEnabled', value => !value );
  81131. inputView.bind( 'hasError' ).to( labeledFieldView, 'errorText', value => !!value );
  81132. inputView.on( 'input', () => {
  81133. // UX: Make the error text disappear and disable the error indicator as the user
  81134. // starts fixing the errors.
  81135. labeledFieldView.errorText = null;
  81136. } );
  81137. labeledFieldView.bind( 'isEmpty', 'isFocused', 'placeholder' ).to( inputView );
  81138. return inputView;
  81139. }
  81140. /**
  81141. * A helper for creating labeled dropdowns.
  81142. *
  81143. * It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown} that is
  81144. * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled field view}.
  81145. *
  81146. * The helper does the following:
  81147. *
  81148. * * It sets dropdown's `id` and `ariaDescribedById` attributes.
  81149. * * It binds input's `isEnabled` to the labeled view.
  81150. *
  81151. * Usage:
  81152. *
  81153. * const labeledInputView = new LabeledFieldView( locale, createLabeledDropdown );
  81154. * console.log( labeledInputView.view ); // A dropdown instance.
  81155. *
  81156. * @param {module:ui/labeledfield/labeledfieldview~LabeledFieldView} labeledFieldView The instance of the labeled field view.
  81157. * @param {String} viewUid An UID string that allows DOM logical connection between the
  81158. * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view label} and the dropdown.
  81159. * @param {String} statusUid An UID string that allows DOM logical connection between the
  81160. * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view status} and the dropdown.
  81161. * @returns {module:ui/dropdown/dropdownview~DropdownView} The dropdown view instance.
  81162. */
  81163. function createLabeledDropdown( labeledFieldView, viewUid, statusUid ) {
  81164. const dropdownView = Object(_dropdown_utils__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( labeledFieldView.locale );
  81165. dropdownView.set( {
  81166. id: viewUid,
  81167. ariaDescribedById: statusUid
  81168. } );
  81169. dropdownView.bind( 'isEnabled' ).to( labeledFieldView );
  81170. return dropdownView;
  81171. }
  81172. /***/ }),
  81173. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js":
  81174. /*!**********************************************************************!*\
  81175. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js ***!
  81176. \**********************************************************************/
  81177. /*! exports provided: default */
  81178. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  81179. "use strict";
  81180. __webpack_require__.r(__webpack_exports__);
  81181. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListItemView; });
  81182. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  81183. /**
  81184. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  81185. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  81186. */
  81187. /**
  81188. * @module ui/list/listitemview
  81189. */
  81190. /**
  81191. * The list item view class.
  81192. *
  81193. * @extends module:ui/view~View
  81194. */
  81195. class ListItemView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  81196. /**
  81197. * @inheritDoc
  81198. */
  81199. constructor( locale ) {
  81200. super( locale );
  81201. /**
  81202. * Collection of the child views inside of the list item {@link #element}.
  81203. *
  81204. * @readonly
  81205. * @member {module:ui/viewcollection~ViewCollection}
  81206. */
  81207. this.children = this.createCollection();
  81208. this.setTemplate( {
  81209. tag: 'li',
  81210. attributes: {
  81211. class: [
  81212. 'ck',
  81213. 'ck-list__item'
  81214. ]
  81215. },
  81216. children: this.children
  81217. } );
  81218. }
  81219. /**
  81220. * Focuses the list item.
  81221. */
  81222. focus() {
  81223. this.children.first.focus();
  81224. }
  81225. }
  81226. /***/ }),
  81227. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listseparatorview.js":
  81228. /*!***************************************************************************!*\
  81229. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/list/listseparatorview.js ***!
  81230. \***************************************************************************/
  81231. /*! exports provided: default */
  81232. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  81233. "use strict";
  81234. __webpack_require__.r(__webpack_exports__);
  81235. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListSeparatorView; });
  81236. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  81237. /**
  81238. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  81239. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  81240. */
  81241. /**
  81242. * @module ui/list/listseparatorview
  81243. */
  81244. /**
  81245. * The list separator view class.
  81246. *
  81247. * @extends module:ui/view~View
  81248. */
  81249. class ListSeparatorView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  81250. /**
  81251. * @inheritDoc
  81252. */
  81253. constructor( locale ) {
  81254. super( locale );
  81255. this.setTemplate( {
  81256. tag: 'li',
  81257. attributes: {
  81258. class: [
  81259. 'ck',
  81260. 'ck-list__separator'
  81261. ]
  81262. }
  81263. } );
  81264. }
  81265. }
  81266. /***/ }),
  81267. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js":
  81268. /*!******************************************************************!*\
  81269. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js ***!
  81270. \******************************************************************/
  81271. /*! exports provided: default */
  81272. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  81273. "use strict";
  81274. __webpack_require__.r(__webpack_exports__);
  81275. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListView; });
  81276. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  81277. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  81278. /* harmony import */ var _focuscycler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
  81279. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  81280. /* harmony import */ var _theme_components_list_list_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/components/list/list.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css");
  81281. /**
  81282. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  81283. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  81284. */
  81285. /**
  81286. * @module ui/list/listview
  81287. */
  81288. /**
  81289. * The list view class.
  81290. *
  81291. * @extends module:ui/view~View
  81292. * @implements module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable
  81293. */
  81294. class ListView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  81295. /**
  81296. * @inheritDoc
  81297. */
  81298. constructor() {
  81299. super();
  81300. /**
  81301. * Collection of the child list views.
  81302. *
  81303. * @readonly
  81304. * @member {module:ui/viewcollection~ViewCollection}
  81305. */
  81306. this.items = this.createCollection();
  81307. /**
  81308. * Tracks information about DOM focus in the list.
  81309. *
  81310. * @readonly
  81311. * @member {module:utils/focustracker~FocusTracker}
  81312. */
  81313. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__["default"]();
  81314. /**
  81315. * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  81316. *
  81317. * @readonly
  81318. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  81319. */
  81320. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_3__["default"]();
  81321. /**
  81322. * Helps cycling over focusable {@link #items} in the list.
  81323. *
  81324. * @readonly
  81325. * @protected
  81326. * @member {module:ui/focuscycler~FocusCycler}
  81327. */
  81328. this._focusCycler = new _focuscycler__WEBPACK_IMPORTED_MODULE_2__["default"]( {
  81329. focusables: this.items,
  81330. focusTracker: this.focusTracker,
  81331. keystrokeHandler: this.keystrokes,
  81332. actions: {
  81333. // Navigate list items backwards using the arrowup key.
  81334. focusPrevious: 'arrowup',
  81335. // Navigate toolbar items forwards using the arrowdown key.
  81336. focusNext: 'arrowdown'
  81337. }
  81338. } );
  81339. this.setTemplate( {
  81340. tag: 'ul',
  81341. attributes: {
  81342. class: [
  81343. 'ck',
  81344. 'ck-reset',
  81345. 'ck-list'
  81346. ]
  81347. },
  81348. children: this.items
  81349. } );
  81350. }
  81351. /**
  81352. * @inheritDoc
  81353. */
  81354. render() {
  81355. super.render();
  81356. // Items added before rendering should be known to the #focusTracker.
  81357. for ( const item of this.items ) {
  81358. this.focusTracker.add( item.element );
  81359. }
  81360. this.items.on( 'add', ( evt, item ) => {
  81361. this.focusTracker.add( item.element );
  81362. } );
  81363. this.items.on( 'remove', ( evt, item ) => {
  81364. this.focusTracker.remove( item.element );
  81365. } );
  81366. // Start listening for the keystrokes coming from #element.
  81367. this.keystrokes.listenTo( this.element );
  81368. }
  81369. /**
  81370. * @inheritDoc
  81371. */
  81372. destroy() {
  81373. super.destroy();
  81374. this.focusTracker.destroy();
  81375. this.keystrokes.destroy();
  81376. }
  81377. /**
  81378. * Focuses the first focusable in {@link #items}.
  81379. */
  81380. focus() {
  81381. this._focusCycler.focusFirst();
  81382. }
  81383. /**
  81384. * Focuses the last focusable in {@link #items}.
  81385. */
  81386. focusLast() {
  81387. this._focusCycler.focusLast();
  81388. }
  81389. }
  81390. /***/ }),
  81391. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/model.js":
  81392. /*!**********************************************************!*\
  81393. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/model.js ***!
  81394. \**********************************************************/
  81395. /*! exports provided: default */
  81396. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  81397. "use strict";
  81398. __webpack_require__.r(__webpack_exports__);
  81399. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Model; });
  81400. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  81401. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  81402. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  81403. /**
  81404. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  81405. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  81406. */
  81407. /**
  81408. * @module ui/model
  81409. */
  81410. /**
  81411. * The base MVC model class.
  81412. *
  81413. * @mixes module:utils/observablemixin~ObservableMixin
  81414. */
  81415. class Model {
  81416. /**
  81417. * Creates a new Model instance.
  81418. *
  81419. * @param {Object} [attributes] The model state attributes to be defined during the instance creation.
  81420. * @param {Object} [properties] The (out of state) properties to be appended to the instance during creation.
  81421. */
  81422. constructor( attributes, properties ) {
  81423. // Extend this instance with the additional (out of state) properties.
  81424. if ( properties ) {
  81425. Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["extend"])( this, properties );
  81426. }
  81427. // Initialize the attributes.
  81428. if ( attributes ) {
  81429. this.set( attributes );
  81430. }
  81431. }
  81432. }
  81433. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( Model, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  81434. /***/ }),
  81435. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/notification/notification.js":
  81436. /*!******************************************************************************!*\
  81437. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/notification/notification.js ***!
  81438. \******************************************************************************/
  81439. /*! exports provided: default */
  81440. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  81441. "use strict";
  81442. __webpack_require__.r(__webpack_exports__);
  81443. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Notification; });
  81444. /* harmony import */ var _ckeditor_ckeditor5_core_src_contextplugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/contextplugin */ "./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js");
  81445. /**
  81446. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  81447. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  81448. */
  81449. /**
  81450. * @module ui/notification/notification
  81451. */
  81452. /* globals window */
  81453. /**
  81454. * The Notification plugin.
  81455. *
  81456. * This plugin sends a few types of notifications: `success`, `info` and `warning`. The notifications need to be
  81457. * handled and displayed by a plugin responsible for showing the UI of the notifications. Using this plugin for dispatching
  81458. * notifications makes it possible to switch the notifications UI.
  81459. *
  81460. * Note that every unhandled and not stopped `warning` notification will be displayed as a system alert.
  81461. * See {@link module:ui/notification/notification~Notification#showWarning}.
  81462. *
  81463. * @extends module:core/contextplugin~ContextPlugin
  81464. */
  81465. class Notification extends _ckeditor_ckeditor5_core_src_contextplugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  81466. /**
  81467. * @inheritDoc
  81468. */
  81469. static get pluginName() {
  81470. return 'Notification';
  81471. }
  81472. /**
  81473. * @inheritDoc
  81474. */
  81475. init() {
  81476. // Each unhandled and not stopped `show:warning` event is displayed as a system alert.
  81477. this.on( 'show:warning', ( evt, data ) => {
  81478. window.alert( data.message ); // eslint-disable-line no-alert
  81479. }, { priority: 'lowest' } );
  81480. }
  81481. /**
  81482. * Shows a success notification.
  81483. *
  81484. * By default, it fires the {@link #event:show:success `show:success` event} with the given `data`. The event namespace can be extended
  81485. * using the `data.namespace` option. For example:
  81486. *
  81487. * showSuccess( 'Image is uploaded.', {
  81488. * namespace: 'upload:image'
  81489. * } );
  81490. *
  81491. * will fire the `show:success:upload:image` event.
  81492. *
  81493. * You can provide the title of the notification:
  81494. *
  81495. * showSuccess( 'Image is uploaded.', {
  81496. * title: 'Image upload success'
  81497. * } );
  81498. *
  81499. * @param {String} message The content of the notification.
  81500. * @param {Object} [data={}] Additional data.
  81501. * @param {String} [data.namespace] Additional event namespace.
  81502. * @param {String} [data.title] The title of the notification.
  81503. */
  81504. showSuccess( message, data = {} ) {
  81505. this._showNotification( {
  81506. message,
  81507. type: 'success',
  81508. namespace: data.namespace,
  81509. title: data.title
  81510. } );
  81511. }
  81512. /**
  81513. * Shows an information notification.
  81514. *
  81515. * By default, it fires the {@link #event:show:info `show:info` event} with the given `data`. The event namespace can be extended
  81516. * using the `data.namespace` option. For example:
  81517. *
  81518. * showInfo( 'Editor is offline.', {
  81519. * namespace: 'editor:status'
  81520. * } );
  81521. *
  81522. * will fire the `show:info:editor:status` event.
  81523. *
  81524. * You can provide the title of the notification:
  81525. *
  81526. * showInfo( 'Editor is offline.', {
  81527. * title: 'Network information'
  81528. * } );
  81529. *
  81530. * @param {String} message The content of the notification.
  81531. * @param {Object} [data={}] Additional data.
  81532. * @param {String} [data.namespace] Additional event namespace.
  81533. * @param {String} [data.title] The title of the notification.
  81534. */
  81535. showInfo( message, data = {} ) {
  81536. this._showNotification( {
  81537. message,
  81538. type: 'info',
  81539. namespace: data.namespace,
  81540. title: data.title
  81541. } );
  81542. }
  81543. /**
  81544. * Shows a warning notification.
  81545. *
  81546. * By default, it fires the {@link #event:show:warning `show:warning` event}
  81547. * with the given `data`. The event namespace can be extended using the `data.namespace` option. For example:
  81548. *
  81549. * showWarning( 'Image upload error.', {
  81550. * namespace: 'upload:image'
  81551. * } );
  81552. *
  81553. * will fire the `show:warning:upload:image` event.
  81554. *
  81555. * You can provide the title of the notification:
  81556. *
  81557. * showWarning( 'Image upload error.', {
  81558. * title: 'Upload failed'
  81559. * } );
  81560. *
  81561. * Note that each unhandled and not stopped `warning` notification will be displayed as a system alert.
  81562. * The plugin responsible for displaying warnings should `stop()` the event to prevent displaying it as an alert:
  81563. *
  81564. * notifications.on( 'show:warning', ( evt, data ) => {
  81565. * // Do something with the data.
  81566. *
  81567. * // Stop this event to prevent displaying it as an alert.
  81568. * evt.stop();
  81569. * } );
  81570. *
  81571. * You can attach many listeners to the same event and `stop()` this event in a listener with a low priority:
  81572. *
  81573. * notifications.on( 'show:warning', ( evt, data ) => {
  81574. * // Show the warning in the UI, but do not stop it.
  81575. * } );
  81576. *
  81577. * notifications.on( 'show:warning', ( evt, data ) => {
  81578. * // Log the warning to some error tracker.
  81579. *
  81580. * // Stop this event to prevent displaying it as an alert.
  81581. * evt.stop();
  81582. * }, { priority: 'low' } );
  81583. *
  81584. * @param {String} message The content of the notification.
  81585. * @param {Object} [data={}] Additional data.
  81586. * @param {String} [data.namespace] Additional event namespace.
  81587. * @param {String} [data.title] The title of the notification.
  81588. */
  81589. showWarning( message, data = {} ) {
  81590. this._showNotification( {
  81591. message,
  81592. type: 'warning',
  81593. namespace: data.namespace,
  81594. title: data.title
  81595. } );
  81596. }
  81597. /**
  81598. * Fires the `show` event with the specified type, namespace and message.
  81599. *
  81600. * @private
  81601. * @param {Object} data The message data.
  81602. * @param {String} data.message The content of the notification.
  81603. * @param {'success'|'info'|'warning'} data.type The type of the message.
  81604. * @param {String} [data.namespace] Additional event namespace.
  81605. * @param {String} [data.title=''] The title of the notification.
  81606. */
  81607. _showNotification( data ) {
  81608. const event = `show:${ data.type }` + ( data.namespace ? `:${ data.namespace }` : '' );
  81609. this.fire( event, {
  81610. message: data.message,
  81611. type: data.type,
  81612. title: data.title || ''
  81613. } );
  81614. }
  81615. /**
  81616. * Fired when one of the `showSuccess()`, `showInfo()`, `showWarning()` methods is called.
  81617. *
  81618. * @event show
  81619. * @param {Object} data The notification data.
  81620. * @param {String} data.message The content of the notification.
  81621. * @param {String} data.title The title of the notification.
  81622. * @param {'success'|'info'|'warning'} data.type The type of the notification.
  81623. */
  81624. /**
  81625. * Fired when the `showSuccess()` method is called.
  81626. *
  81627. * @event show:success
  81628. * @param {Object} data The notification data.
  81629. * @param {String} data.message The content of the notification.
  81630. * @param {String} data.title The title of the notification.
  81631. * @param {'success'} data.type The type of the notification.
  81632. */
  81633. /**
  81634. * Fired when the `showInfo()` method is called.
  81635. *
  81636. * @event show:info
  81637. * @param {Object} data The notification data.
  81638. * @param {String} data.message The content of the notification.
  81639. * @param {String} data.title The title of the notification.
  81640. * @param {'info'} data.type The type of the notification.
  81641. */
  81642. /**
  81643. * Fired when the `showWarning()` method is called.
  81644. *
  81645. * When this event is not handled or stopped by `event.stop()`, the `data.message` of this event will
  81646. * be automatically displayed as a system alert.
  81647. *
  81648. * @event show:warning
  81649. * @param {Object} data The notification data.
  81650. * @param {String} data.message The content of the notification.
  81651. * @param {String} data.title The title of the notification.
  81652. * @param {'warning'} data.type The type of the notification.
  81653. */
  81654. }
  81655. /***/ }),
  81656. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js":
  81657. /*!***********************************************************************************!*\
  81658. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js ***!
  81659. \***********************************************************************************/
  81660. /*! exports provided: default, generatePositions */
  81661. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  81662. "use strict";
  81663. __webpack_require__.r(__webpack_exports__);
  81664. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BalloonPanelView; });
  81665. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generatePositions", function() { return generatePositions; });
  81666. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  81667. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/position */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js");
  81668. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_isrange__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/isrange */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js");
  81669. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
  81670. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  81671. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  81672. /* harmony import */ var _theme_components_panel_balloonpanel_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../theme/components/panel/balloonpanel.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css");
  81673. /**
  81674. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  81675. * For licensing, see LICENSE.md.
  81676. */
  81677. /**
  81678. * @module ui/panel/balloon/balloonpanelview
  81679. */
  81680. const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_3__["default"])( 'px' );
  81681. const defaultLimiterElement = _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].document.body;
  81682. /**
  81683. * The balloon panel view class.
  81684. *
  81685. * A floating container which can
  81686. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#pin pin} to any
  81687. * {@link module:utils/dom/position~Options#target target} in the DOM and remain in that position
  81688. * e.g. when the web page is scrolled.
  81689. *
  81690. * The balloon panel can be used to display contextual, non-blocking UI like forms, toolbars and
  81691. * the like in its {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#content} view
  81692. * collection.
  81693. *
  81694. * There is a number of {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}
  81695. * that the balloon can use, automatically switching from one to another when the viewport space becomes
  81696. * scarce to keep the balloon visible to the user as long as it is possible. The balloon will also
  81697. * accept any custom position set provided by the user compatible with the
  81698. * {@link module:utils/dom/position~Options options}.
  81699. *
  81700. * const panel = new BalloonPanelView( locale );
  81701. * const childView = new ChildView();
  81702. * const positions = BalloonPanelView.defaultPositions;
  81703. *
  81704. * panel.render();
  81705. *
  81706. * // Add a child view to the panel's content collection.
  81707. * panel.content.add( childView );
  81708. *
  81709. * // Start pinning the panel to an element with the "target" id DOM.
  81710. * // The balloon will remain pinned until unpin() is called.
  81711. * panel.pin( {
  81712. * target: document.querySelector( '#target' ),
  81713. * positions: [
  81714. * positions.northArrowSouth,
  81715. * positions.southArrowNorth
  81716. * ]
  81717. * } );
  81718. *
  81719. * @extends module:ui/view~View
  81720. */
  81721. class BalloonPanelView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  81722. /**
  81723. * @inheritDoc
  81724. */
  81725. constructor( locale ) {
  81726. super( locale );
  81727. const bind = this.bindTemplate;
  81728. /**
  81729. * The absolute top position of the balloon panel in pixels.
  81730. *
  81731. * @observable
  81732. * @default 0
  81733. * @member {Number} #top
  81734. */
  81735. this.set( 'top', 0 );
  81736. /**
  81737. * The absolute left position of the balloon panel in pixels.
  81738. *
  81739. * @observable
  81740. * @default 0
  81741. * @member {Number} #left
  81742. */
  81743. this.set( 'left', 0 );
  81744. /**
  81745. * The balloon panel's current position. The position name is reflected in the CSS class set
  81746. * to the balloon, i.e. `.ck-balloon-panel_arrow_nw` for the "arrow_nw" position. The class
  81747. * controls the minor aspects of the balloon's visual appearance like the placement
  81748. * of an {@link #withArrow arrow}. To support a new position, an additional CSS must be created.
  81749. *
  81750. * Default position names correspond with
  81751. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
  81752. *
  81753. * See the {@link #attachTo} and {@link #pin} methods to learn about custom balloon positions.
  81754. *
  81755. * @observable
  81756. * @default 'arrow_nw'
  81757. * @member {'arrow_nw'|'arrow_ne'|'arrow_sw'|'arrow_se'} #position
  81758. */
  81759. this.set( 'position', 'arrow_nw' );
  81760. /**
  81761. * Controls whether the balloon panel is visible or not.
  81762. *
  81763. * @observable
  81764. * @default false
  81765. * @member {Boolean} #isVisible
  81766. */
  81767. this.set( 'isVisible', false );
  81768. /**
  81769. * Controls whether the balloon panel has an arrow. The presence of the arrow
  81770. * is reflected in the `ck-balloon-panel_with-arrow` CSS class.
  81771. *
  81772. * @observable
  81773. * @default true
  81774. * @member {Boolean} #withArrow
  81775. */
  81776. this.set( 'withArrow', true );
  81777. /**
  81778. * An additional CSS class added to the {@link #element}.
  81779. *
  81780. * @observable
  81781. * @member {String} #class
  81782. */
  81783. this.set( 'class' );
  81784. /**
  81785. * A callback that starts pinning the panel when {@link #isVisible} gets
  81786. * `true`. Used by {@link #pin}.
  81787. *
  81788. * @private
  81789. * @member {Function} #_pinWhenIsVisibleCallback
  81790. */
  81791. /**
  81792. * A collection of the child views that creates the balloon panel contents.
  81793. *
  81794. * @readonly
  81795. * @member {module:ui/viewcollection~ViewCollection}
  81796. */
  81797. this.content = this.createCollection();
  81798. this.setTemplate( {
  81799. tag: 'div',
  81800. attributes: {
  81801. class: [
  81802. 'ck',
  81803. 'ck-balloon-panel',
  81804. bind.to( 'position', value => `ck-balloon-panel_${ value }` ),
  81805. bind.if( 'isVisible', 'ck-balloon-panel_visible' ),
  81806. bind.if( 'withArrow', 'ck-balloon-panel_with-arrow' ),
  81807. bind.to( 'class' )
  81808. ],
  81809. style: {
  81810. top: bind.to( 'top', toPx ),
  81811. left: bind.to( 'left', toPx )
  81812. }
  81813. },
  81814. children: this.content
  81815. } );
  81816. }
  81817. /**
  81818. * Shows the panel.
  81819. *
  81820. * See {@link #isVisible}.
  81821. */
  81822. show() {
  81823. this.isVisible = true;
  81824. }
  81825. /**
  81826. * Hides the panel.
  81827. *
  81828. * See {@link #isVisible}.
  81829. */
  81830. hide() {
  81831. this.isVisible = false;
  81832. }
  81833. /**
  81834. * Attaches the panel to a specified {@link module:utils/dom/position~Options#target} with a
  81835. * smart positioning heuristics that chooses from available positions to make sure the panel
  81836. * is visible to the user i.e. within the limits of the viewport.
  81837. *
  81838. * This method accepts configuration {@link module:utils/dom/position~Options options}
  81839. * to set the `target`, optional `limiter` and `positions` the balloon should choose from.
  81840. *
  81841. * const panel = new BalloonPanelView( locale );
  81842. * const positions = BalloonPanelView.defaultPositions;
  81843. *
  81844. * panel.render();
  81845. *
  81846. * // Attach the panel to an element with the "target" id DOM.
  81847. * panel.attachTo( {
  81848. * target: document.querySelector( '#target' ),
  81849. * positions: [
  81850. * positions.northArrowSouth,
  81851. * positions.southArrowNorth
  81852. * ]
  81853. * } );
  81854. *
  81855. * **Note**: Attaching the panel will also automatically {@link #show} it.
  81856. *
  81857. * **Note**: An attached panel will not follow its target when the window is scrolled or resized.
  81858. * See the {@link #pin} method for a more permanent positioning strategy.
  81859. *
  81860. * @param {module:utils/dom/position~Options} options Positioning options compatible with
  81861. * {@link module:utils/dom/position~getOptimalPosition}. Default `positions` array is
  81862. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
  81863. */
  81864. attachTo( options ) {
  81865. this.show();
  81866. const defaultPositions = BalloonPanelView.defaultPositions;
  81867. const positionOptions = Object.assign( {}, {
  81868. element: this.element,
  81869. positions: [
  81870. defaultPositions.southArrowNorth,
  81871. defaultPositions.southArrowNorthMiddleWest,
  81872. defaultPositions.southArrowNorthMiddleEast,
  81873. defaultPositions.southArrowNorthWest,
  81874. defaultPositions.southArrowNorthEast,
  81875. defaultPositions.northArrowSouth,
  81876. defaultPositions.northArrowSouthMiddleWest,
  81877. defaultPositions.northArrowSouthMiddleEast,
  81878. defaultPositions.northArrowSouthWest,
  81879. defaultPositions.northArrowSouthEast,
  81880. defaultPositions.viewportStickyNorth
  81881. ],
  81882. limiter: defaultLimiterElement,
  81883. fitInViewport: true
  81884. }, options );
  81885. const optimalPosition = BalloonPanelView._getOptimalPosition( positionOptions );
  81886. // Usually browsers make some problems with super accurate values like 104.345px
  81887. // so it is better to use int values.
  81888. const left = parseInt( optimalPosition.left );
  81889. const top = parseInt( optimalPosition.top );
  81890. const { name: position, config = {} } = optimalPosition;
  81891. const { withArrow = true } = config;
  81892. Object.assign( this, { top, left, position, withArrow } );
  81893. }
  81894. /**
  81895. * Works the same way as the {@link #attachTo} method except that the position of the panel is
  81896. * continuously updated when:
  81897. *
  81898. * * any ancestor of the {@link module:utils/dom/position~Options#target}
  81899. * or {@link module:utils/dom/position~Options#limiter} is scrolled,
  81900. * * the browser window gets resized or scrolled.
  81901. *
  81902. * Thanks to that, the panel always sticks to the {@link module:utils/dom/position~Options#target}
  81903. * and is immune to the changing environment.
  81904. *
  81905. * const panel = new BalloonPanelView( locale );
  81906. * const positions = BalloonPanelView.defaultPositions;
  81907. *
  81908. * panel.render();
  81909. *
  81910. * // Pin the panel to an element with the "target" id DOM.
  81911. * panel.pin( {
  81912. * target: document.querySelector( '#target' ),
  81913. * positions: [
  81914. * positions.northArrowSouth,
  81915. * positions.southArrowNorth
  81916. * ]
  81917. * } );
  81918. *
  81919. * To leave the pinned state, use the {@link #unpin} method.
  81920. *
  81921. * **Note**: Pinning the panel will also automatically {@link #show} it.
  81922. *
  81923. * @param {module:utils/dom/position~Options} options Positioning options compatible with
  81924. * {@link module:utils/dom/position~getOptimalPosition}. Default `positions` array is
  81925. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
  81926. */
  81927. pin( options ) {
  81928. this.unpin();
  81929. this._pinWhenIsVisibleCallback = () => {
  81930. if ( this.isVisible ) {
  81931. this._startPinning( options );
  81932. } else {
  81933. this._stopPinning();
  81934. }
  81935. };
  81936. this._startPinning( options );
  81937. // Control the state of the listeners depending on whether the panel is visible
  81938. // or not.
  81939. // TODO: Use on() (https://github.com/ckeditor/ckeditor5-utils/issues/144).
  81940. this.listenTo( this, 'change:isVisible', this._pinWhenIsVisibleCallback );
  81941. }
  81942. /**
  81943. * Stops pinning the panel, as set up by {@link #pin}.
  81944. */
  81945. unpin() {
  81946. if ( this._pinWhenIsVisibleCallback ) {
  81947. // Deactivate listeners attached by pin().
  81948. this._stopPinning();
  81949. // Deactivate the panel pin() control logic.
  81950. // TODO: Use off() (https://github.com/ckeditor/ckeditor5-utils/issues/144).
  81951. this.stopListening( this, 'change:isVisible', this._pinWhenIsVisibleCallback );
  81952. this._pinWhenIsVisibleCallback = null;
  81953. this.hide();
  81954. }
  81955. }
  81956. /**
  81957. * Starts managing the pinned state of the panel. See {@link #pin}.
  81958. *
  81959. * @private
  81960. * @param {module:utils/dom/position~Options} options Positioning options compatible with
  81961. * {@link module:utils/dom/position~getOptimalPosition}.
  81962. */
  81963. _startPinning( options ) {
  81964. this.attachTo( options );
  81965. const targetElement = getDomElement( options.target );
  81966. const limiterElement = options.limiter ? getDomElement( options.limiter ) : defaultLimiterElement;
  81967. // Then we need to listen on scroll event of eny element in the document.
  81968. this.listenTo( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].document, 'scroll', ( evt, domEvt ) => {
  81969. const scrollTarget = domEvt.target;
  81970. // The position needs to be updated if the positioning target is within the scrolled element.
  81971. const isWithinScrollTarget = targetElement && scrollTarget.contains( targetElement );
  81972. // The position needs to be updated if the positioning limiter is within the scrolled element.
  81973. const isLimiterWithinScrollTarget = limiterElement && scrollTarget.contains( limiterElement );
  81974. // The positioning target and/or limiter can be a Rect, object etc..
  81975. // There's no way to optimize the listener then.
  81976. if ( isWithinScrollTarget || isLimiterWithinScrollTarget || !targetElement || !limiterElement ) {
  81977. this.attachTo( options );
  81978. }
  81979. }, { useCapture: true } );
  81980. // We need to listen on window resize event and update position.
  81981. this.listenTo( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].window, 'resize', () => {
  81982. this.attachTo( options );
  81983. } );
  81984. }
  81985. /**
  81986. * Stops managing the pinned state of the panel. See {@link #pin}.
  81987. *
  81988. * @private
  81989. */
  81990. _stopPinning() {
  81991. this.stopListening( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].document, 'scroll' );
  81992. this.stopListening( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].window, 'resize' );
  81993. }
  81994. }
  81995. // Returns the DOM element for given object or null, if there is none,
  81996. // e.g. when the passed object is a Rect instance or so.
  81997. //
  81998. // @private
  81999. // @param {*} object
  82000. // @returns {HTMLElement|null}
  82001. function getDomElement( object ) {
  82002. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_5__["isElement"])( object ) ) {
  82003. return object;
  82004. }
  82005. if ( Object(_ckeditor_ckeditor5_utils_src_dom_isrange__WEBPACK_IMPORTED_MODULE_2__["default"])( object ) ) {
  82006. return object.commonAncestorContainer;
  82007. }
  82008. if ( typeof object == 'function' ) {
  82009. return getDomElement( object() );
  82010. }
  82011. return null;
  82012. }
  82013. /**
  82014. * A horizontal offset of the arrow tip from the edge of the balloon. Controlled by CSS.
  82015. *
  82016. * +-----|---------...
  82017. * | |
  82018. * | |
  82019. * | |
  82020. * | |
  82021. * +--+ | +------...
  82022. * \ | /
  82023. * \|/
  82024. * >|-----|<---------------- horizontal offset
  82025. *
  82026. * @default 25
  82027. * @member {Number} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowHorizontalOffset
  82028. */
  82029. BalloonPanelView.arrowHorizontalOffset = 25;
  82030. /**
  82031. * A vertical offset of the arrow from the edge of the balloon. Controlled by CSS.
  82032. *
  82033. * +-------------...
  82034. * |
  82035. * |
  82036. * | /-- vertical offset
  82037. * | V
  82038. * +--+ +-----... ---------
  82039. * \ / |
  82040. * \/ |
  82041. * -------------------------------
  82042. * ^
  82043. *
  82044. * @default 10
  82045. * @member {Number} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowVerticalOffset
  82046. */
  82047. BalloonPanelView.arrowVerticalOffset = 10;
  82048. /**
  82049. * A vertical offset of the balloon panel from the edge of the viewport if sticky.
  82050. * It helps in accessing toolbar buttons underneath the balloon panel.
  82051. *
  82052. * +---------------------------------------------------+
  82053. * | Target |
  82054. * | |
  82055. * | /-- vertical offset |
  82056. * +-----------------------------V-------------------------+
  82057. * | Toolbar +-------------+ |
  82058. * +--------------------| Balloon |--------------------+
  82059. * | | +-------------+ | |
  82060. * | | | |
  82061. * | | | |
  82062. * | | | |
  82063. * | +---------------------------------------------------+ |
  82064. * | Viewport |
  82065. * +-------------------------------------------------------+
  82066. *
  82067. * @default 20
  82068. * @member {Number} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.stickyVerticalOffset
  82069. */
  82070. BalloonPanelView.stickyVerticalOffset = 20;
  82071. /**
  82072. * Function used to calculate the optimal position for the balloon.
  82073. *
  82074. * @protected
  82075. * @member {Function} module:ui/panel/balloon/balloonpanelview~BalloonPanelView._getOptimalPosition
  82076. */
  82077. BalloonPanelView._getOptimalPosition = _ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_1__["getOptimalPosition"];
  82078. /**
  82079. * A default set of positioning functions used by the balloon panel view
  82080. * when attaching using the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo} method.
  82081. *
  82082. * The available positioning functions are as follows:
  82083. *
  82084. *
  82085. *
  82086. * **North west**
  82087. *
  82088. * * `northWestArrowSouthWest`
  82089. *
  82090. * +-----------------+
  82091. * | Balloon |
  82092. * +-----------------+
  82093. * V
  82094. * [ Target ]
  82095. *
  82096. * * `northWestArrowSouthMiddleWest`
  82097. *
  82098. * +-----------------+
  82099. * | Balloon |
  82100. * +-----------------+
  82101. * V
  82102. * [ Target ]
  82103. *
  82104. * * `northWestArrowSouth`
  82105. *
  82106. * +-----------------+
  82107. * | Balloon |
  82108. * +-----------------+
  82109. * V
  82110. * [ Target ]
  82111. *
  82112. * * `northWestArrowSouthMiddleEast`
  82113. *
  82114. * +-----------------+
  82115. * | Balloon |
  82116. * +-----------------+
  82117. * V
  82118. * [ Target ]
  82119. *
  82120. * * `northWestArrowSouthEast`
  82121. *
  82122. * +-----------------+
  82123. * | Balloon |
  82124. * +-----------------+
  82125. * V
  82126. * [ Target ]
  82127. *
  82128. *
  82129. *
  82130. * **North**
  82131. *
  82132. * * `northArrowSouthWest`
  82133. *
  82134. * +-----------------+
  82135. * | Balloon |
  82136. * +-----------------+
  82137. * V
  82138. * [ Target ]
  82139. *
  82140. * * `northArrowSouthMiddleWest`
  82141. *
  82142. * +-----------------+
  82143. * | Balloon |
  82144. * +-----------------+
  82145. * V
  82146. * [ Target ]
  82147. *
  82148. * * `northArrowSouth`
  82149. *
  82150. * +-----------------+
  82151. * | Balloon |
  82152. * +-----------------+
  82153. * V
  82154. * [ Target ]
  82155. *
  82156. * * `northArrowSouthMiddleEast`
  82157. *
  82158. * +-----------------+
  82159. * | Balloon |
  82160. * +-----------------+
  82161. * V
  82162. * [ Target ]
  82163. *
  82164. * * `northArrowSouthEast`
  82165. *
  82166. * +-----------------+
  82167. * | Balloon |
  82168. * +-----------------+
  82169. * V
  82170. * [ Target ]
  82171. *
  82172. * **North east**
  82173. *
  82174. * * `northEastArrowSouthWest`
  82175. *
  82176. * +-----------------+
  82177. * | Balloon |
  82178. * +-----------------+
  82179. * V
  82180. * [ Target ]
  82181. *
  82182. *
  82183. * * `northEastArrowSouthMiddleWest`
  82184. *
  82185. * +-----------------+
  82186. * | Balloon |
  82187. * +-----------------+
  82188. * V
  82189. * [ Target ]
  82190. *
  82191. * * `northEastArrowSouth`
  82192. *
  82193. * +-----------------+
  82194. * | Balloon |
  82195. * +-----------------+
  82196. * V
  82197. * [ Target ]
  82198. *
  82199. * * `northEastArrowSouthMiddleEast`
  82200. *
  82201. * +-----------------+
  82202. * | Balloon |
  82203. * +-----------------+
  82204. * V
  82205. * [ Target ]
  82206. *
  82207. * * `northEastArrowSouthEast`
  82208. *
  82209. * +-----------------+
  82210. * | Balloon |
  82211. * +-----------------+
  82212. * V
  82213. * [ Target ]
  82214. *
  82215. *
  82216. *
  82217. * **South**
  82218. *
  82219. *
  82220. * * `southArrowNorthWest`
  82221. *
  82222. * [ Target ]
  82223. * ^
  82224. * +-----------------+
  82225. * | Balloon |
  82226. * +-----------------+
  82227. *
  82228. * * `southArrowNorthMiddleWest`
  82229. *
  82230. * [ Target ]
  82231. * ^
  82232. * +-----------------+
  82233. * | Balloon |
  82234. * +-----------------+
  82235. *
  82236. * * `southArrowNorth`
  82237. *
  82238. * [ Target ]
  82239. * ^
  82240. * +-----------------+
  82241. * | Balloon |
  82242. * +-----------------+
  82243. *
  82244. * * `southArrowNorthMiddleEast`
  82245. *
  82246. * [ Target ]
  82247. * ^
  82248. * +-----------------+
  82249. * | Balloon |
  82250. * +-----------------+
  82251. *
  82252. * * `southArrowNorthEast`
  82253. *
  82254. * [ Target ]
  82255. * ^
  82256. * +-----------------+
  82257. * | Balloon |
  82258. * +-----------------+
  82259. *
  82260. *
  82261. *
  82262. * **South west**
  82263. *
  82264. * * `southWestArrowNorthWest`
  82265. *
  82266. * [ Target ]
  82267. * ^
  82268. * +-----------------+
  82269. * | Balloon |
  82270. * +-----------------+
  82271. *
  82272. * * `southWestArrowNorthMiddleWest`
  82273. *
  82274. * [ Target ]
  82275. * ^
  82276. * +-----------------+
  82277. * | Balloon |
  82278. * +-----------------+
  82279. *
  82280. * * `southWestArrowNorth`
  82281. *
  82282. * [ Target ]
  82283. * ^
  82284. * +-----------------+
  82285. * | Balloon |
  82286. * +-----------------+
  82287. *
  82288. * * `southWestArrowNorthMiddleEast`
  82289. *
  82290. * [ Target ]
  82291. * ^
  82292. * +-----------------+
  82293. * | Balloon |
  82294. * +-----------------+
  82295. *
  82296. * * `southWestArrowNorthEast`
  82297. *
  82298. * [ Target ]
  82299. * ^
  82300. * +-----------------+
  82301. * | Balloon |
  82302. * +-----------------+
  82303. *
  82304. *
  82305. *
  82306. * **South east**
  82307. *
  82308. * * `southEastArrowNorthWest`
  82309. *
  82310. * [ Target ]
  82311. * ^
  82312. * +-----------------+
  82313. * | Balloon |
  82314. * +-----------------+
  82315. * * `southEastArrowNorthMiddleWest`
  82316. *
  82317. * [ Target ]
  82318. * ^
  82319. * +-----------------+
  82320. * | Balloon |
  82321. * +-----------------+
  82322. *
  82323. * * `southEastArrowNorth`
  82324. *
  82325. * [ Target ]
  82326. * ^
  82327. * +-----------------+
  82328. * | Balloon |
  82329. * +-----------------+
  82330. *
  82331. * * `southEastArrowNorthMiddleEast`
  82332. *
  82333. * [ Target ]
  82334. * ^
  82335. * +-----------------+
  82336. * | Balloon |
  82337. * +-----------------+
  82338. *
  82339. * * `southEastArrowNorthEast`
  82340. *
  82341. * [ Target ]
  82342. * ^
  82343. * +-----------------+
  82344. * | Balloon |
  82345. * +-----------------+
  82346. *
  82347. * * `viewportStickyNorth`
  82348. *
  82349. * +---------------------------+
  82350. * | [ Target ] |
  82351. * | |
  82352. * +-----------------------------------+
  82353. * | | +-----------------+ | |
  82354. * | | | Balloon | | |
  82355. * | | +-----------------+ | |
  82356. * | | | |
  82357. * | | | |
  82358. * | | | |
  82359. * | | | |
  82360. * | +---------------------------+ |
  82361. * | Viewport |
  82362. * +-----------------------------------+
  82363. *
  82364. * See {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo}.
  82365. *
  82366. * Positioning functions must be compatible with {@link module:utils/dom/position~Position}.
  82367. *
  82368. * Default positioning functions with customized offsets can be generated using
  82369. * {@link module:ui/panel/balloon/balloonpanelview~generatePositions}.
  82370. *
  82371. * The name that the position function returns will be reflected in the balloon panel's class that
  82372. * controls the placement of the "arrow". See {@link #position} to learn more.
  82373. *
  82374. * @member {Object.<String,module:utils/dom/position~positioningFunction>}
  82375. * module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions
  82376. */
  82377. BalloonPanelView.defaultPositions = generatePositions();
  82378. /**
  82379. * Returns available {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
  82380. * {@link module:utils/dom/position~positioningFunction positioning functions} adjusted by the specific offsets.
  82381. *
  82382. * @protected
  82383. * @param {Object} [options] Options to generate positions. If not specified, this helper will simply return
  82384. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
  82385. * @param {Number} [options.horizontalOffset] A custom horizontal offset (in pixels) of each position. If
  82386. * not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowHorizontalOffset the default value}
  82387. * will be used.
  82388. * @param {Number} [options.verticalOffset] A custom vertical offset (in pixels) of each position. If
  82389. * not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowVerticalOffset the default value}
  82390. * will be used.
  82391. * @param {Number} [options.stickyVerticalOffset] A custom offset (in pixels) of the `viewportStickyNorth` positioning function.
  82392. * If not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.stickyVerticalOffset the default value}
  82393. * will be used.
  82394. * @param {Object} [options.config] Additional configuration of the balloon balloon panel view.
  82395. * Currently only {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#withArrow} is supported. Learn more
  82396. * about {@link module:utils/dom/position~positioningFunction positioning functions}.
  82397. * @returns {Object.<String,module:utils/dom/position~positioningFunction>}
  82398. */
  82399. function generatePositions( {
  82400. horizontalOffset = BalloonPanelView.arrowHorizontalOffset,
  82401. verticalOffset = BalloonPanelView.arrowVerticalOffset,
  82402. stickyVerticalOffset = BalloonPanelView.stickyVerticalOffset,
  82403. config
  82404. } = {} ) {
  82405. return {
  82406. // ------- North west
  82407. northWestArrowSouthWest: ( targetRect, balloonRect ) => ( {
  82408. top: getNorthTop( targetRect, balloonRect ),
  82409. left: targetRect.left - horizontalOffset,
  82410. name: 'arrow_sw',
  82411. ...( config && { config } )
  82412. } ),
  82413. northWestArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
  82414. top: getNorthTop( targetRect, balloonRect ),
  82415. left: targetRect.left - ( balloonRect.width * .25 ) - horizontalOffset,
  82416. name: 'arrow_smw',
  82417. ...( config && { config } )
  82418. } ),
  82419. northWestArrowSouth: ( targetRect, balloonRect ) => ( {
  82420. top: getNorthTop( targetRect, balloonRect ),
  82421. left: targetRect.left - balloonRect.width / 2,
  82422. name: 'arrow_s',
  82423. ...( config && { config } )
  82424. } ),
  82425. northWestArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
  82426. top: getNorthTop( targetRect, balloonRect ),
  82427. left: targetRect.left - ( balloonRect.width * .75 ) + horizontalOffset,
  82428. name: 'arrow_sme',
  82429. ...( config && { config } )
  82430. } ),
  82431. northWestArrowSouthEast: ( targetRect, balloonRect ) => ( {
  82432. top: getNorthTop( targetRect, balloonRect ),
  82433. left: targetRect.left - balloonRect.width + horizontalOffset,
  82434. name: 'arrow_se',
  82435. ...( config && { config } )
  82436. } ),
  82437. // ------- North
  82438. northArrowSouthWest: ( targetRect, balloonRect ) => ( {
  82439. top: getNorthTop( targetRect, balloonRect ),
  82440. left: targetRect.left + targetRect.width / 2 - horizontalOffset,
  82441. name: 'arrow_sw',
  82442. ...( config && { config } )
  82443. } ),
  82444. northArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
  82445. top: getNorthTop( targetRect, balloonRect ),
  82446. left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * .25 ) - horizontalOffset,
  82447. name: 'arrow_smw',
  82448. ...( config && { config } )
  82449. } ),
  82450. northArrowSouth: ( targetRect, balloonRect ) => ( {
  82451. top: getNorthTop( targetRect, balloonRect ),
  82452. left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
  82453. name: 'arrow_s',
  82454. ...( config && { config } )
  82455. } ),
  82456. northArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
  82457. top: getNorthTop( targetRect, balloonRect ),
  82458. left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * .75 ) + horizontalOffset,
  82459. name: 'arrow_sme',
  82460. ...( config && { config } )
  82461. } ),
  82462. northArrowSouthEast: ( targetRect, balloonRect ) => ( {
  82463. top: getNorthTop( targetRect, balloonRect ),
  82464. left: targetRect.left + targetRect.width / 2 - balloonRect.width + horizontalOffset,
  82465. name: 'arrow_se',
  82466. ...( config && { config } )
  82467. } ),
  82468. // ------- North east
  82469. northEastArrowSouthWest: ( targetRect, balloonRect ) => ( {
  82470. top: getNorthTop( targetRect, balloonRect ),
  82471. left: targetRect.right - horizontalOffset,
  82472. name: 'arrow_sw',
  82473. ...( config && { config } )
  82474. } ),
  82475. northEastArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
  82476. top: getNorthTop( targetRect, balloonRect ),
  82477. left: targetRect.right - ( balloonRect.width * .25 ) - horizontalOffset,
  82478. name: 'arrow_smw',
  82479. ...( config && { config } )
  82480. } ),
  82481. northEastArrowSouth: ( targetRect, balloonRect ) => ( {
  82482. top: getNorthTop( targetRect, balloonRect ),
  82483. left: targetRect.right - balloonRect.width / 2,
  82484. name: 'arrow_s',
  82485. ...( config && { config } )
  82486. } ),
  82487. northEastArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
  82488. top: getNorthTop( targetRect, balloonRect ),
  82489. left: targetRect.right - ( balloonRect.width * .75 ) + horizontalOffset,
  82490. name: 'arrow_sme',
  82491. ...( config && { config } )
  82492. } ),
  82493. northEastArrowSouthEast: ( targetRect, balloonRect ) => ( {
  82494. top: getNorthTop( targetRect, balloonRect ),
  82495. left: targetRect.right - balloonRect.width + horizontalOffset,
  82496. name: 'arrow_se',
  82497. ...( config && { config } )
  82498. } ),
  82499. // ------- South west
  82500. southWestArrowNorthWest: ( targetRect, balloonRect ) => ( {
  82501. top: getSouthTop( targetRect, balloonRect ),
  82502. left: targetRect.left - horizontalOffset,
  82503. name: 'arrow_nw',
  82504. ...( config && { config } )
  82505. } ),
  82506. southWestArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
  82507. top: getSouthTop( targetRect, balloonRect ),
  82508. left: targetRect.left - ( balloonRect.width * .25 ) - horizontalOffset,
  82509. name: 'arrow_nmw',
  82510. ...( config && { config } )
  82511. } ),
  82512. southWestArrowNorth: ( targetRect, balloonRect ) => ( {
  82513. top: getSouthTop( targetRect, balloonRect ),
  82514. left: targetRect.left - balloonRect.width / 2,
  82515. name: 'arrow_n',
  82516. ...( config && { config } )
  82517. } ),
  82518. southWestArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
  82519. top: getSouthTop( targetRect, balloonRect ),
  82520. left: targetRect.left - ( balloonRect.width * .75 ) + horizontalOffset,
  82521. name: 'arrow_nme',
  82522. ...( config && { config } )
  82523. } ),
  82524. southWestArrowNorthEast: ( targetRect, balloonRect ) => ( {
  82525. top: getSouthTop( targetRect, balloonRect ),
  82526. left: targetRect.left - balloonRect.width + horizontalOffset,
  82527. name: 'arrow_ne',
  82528. ...( config && { config } )
  82529. } ),
  82530. // ------- South
  82531. southArrowNorthWest: ( targetRect, balloonRect ) => ( {
  82532. top: getSouthTop( targetRect, balloonRect ),
  82533. left: targetRect.left + targetRect.width / 2 - horizontalOffset,
  82534. name: 'arrow_nw',
  82535. ...( config && { config } )
  82536. } ),
  82537. southArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
  82538. top: getSouthTop( targetRect, balloonRect ),
  82539. left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * 0.25 ) - horizontalOffset,
  82540. name: 'arrow_nmw',
  82541. ...( config && { config } )
  82542. } ),
  82543. southArrowNorth: ( targetRect, balloonRect ) => ( {
  82544. top: getSouthTop( targetRect, balloonRect ),
  82545. left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
  82546. name: 'arrow_n',
  82547. ...( config && { config } )
  82548. } ),
  82549. southArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
  82550. top: getSouthTop( targetRect, balloonRect ),
  82551. left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * 0.75 ) + horizontalOffset,
  82552. name: 'arrow_nme',
  82553. ...( config && { config } )
  82554. } ),
  82555. southArrowNorthEast: ( targetRect, balloonRect ) => ( {
  82556. top: getSouthTop( targetRect, balloonRect ),
  82557. left: targetRect.left + targetRect.width / 2 - balloonRect.width + horizontalOffset,
  82558. name: 'arrow_ne',
  82559. ...( config && { config } )
  82560. } ),
  82561. // ------- South east
  82562. southEastArrowNorthWest: ( targetRect, balloonRect ) => ( {
  82563. top: getSouthTop( targetRect, balloonRect ),
  82564. left: targetRect.right - horizontalOffset,
  82565. name: 'arrow_nw',
  82566. ...( config && { config } )
  82567. } ),
  82568. southEastArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
  82569. top: getSouthTop( targetRect, balloonRect ),
  82570. left: targetRect.right - ( balloonRect.width * .25 ) - horizontalOffset,
  82571. name: 'arrow_nmw',
  82572. ...( config && { config } )
  82573. } ),
  82574. southEastArrowNorth: ( targetRect, balloonRect ) => ( {
  82575. top: getSouthTop( targetRect, balloonRect ),
  82576. left: targetRect.right - balloonRect.width / 2,
  82577. name: 'arrow_n',
  82578. ...( config && { config } )
  82579. } ),
  82580. southEastArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
  82581. top: getSouthTop( targetRect, balloonRect ),
  82582. left: targetRect.right - ( balloonRect.width * .75 ) + horizontalOffset,
  82583. name: 'arrow_nme',
  82584. ...( config && { config } )
  82585. } ),
  82586. southEastArrowNorthEast: ( targetRect, balloonRect ) => ( {
  82587. top: getSouthTop( targetRect, balloonRect ),
  82588. left: targetRect.right - balloonRect.width + horizontalOffset,
  82589. name: 'arrow_ne',
  82590. ...( config && { config } )
  82591. } ),
  82592. // ------- Sticky
  82593. viewportStickyNorth: ( targetRect, balloonRect, viewportRect ) => {
  82594. if ( !targetRect.getIntersection( viewportRect ) ) {
  82595. return null;
  82596. }
  82597. return {
  82598. top: viewportRect.top + stickyVerticalOffset,
  82599. left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
  82600. name: 'arrowless',
  82601. config: {
  82602. withArrow: false,
  82603. ...config
  82604. }
  82605. };
  82606. }
  82607. };
  82608. // Returns the top coordinate for positions starting with `north*`.
  82609. //
  82610. // @private
  82611. // @param {utils/dom/rect~Rect} targetRect A rect of the target.
  82612. // @param {utils/dom/rect~Rect} elementRect A rect of the balloon.
  82613. // @returns {Number}
  82614. function getNorthTop( targetRect, balloonRect ) {
  82615. return targetRect.top - balloonRect.height - verticalOffset;
  82616. }
  82617. // Returns the top coordinate for positions starting with `south*`.
  82618. //
  82619. // @private
  82620. // @param {utils/dom/rect~Rect} targetRect A rect of the target.
  82621. // @param {utils/dom/rect~Rect} elementRect A rect of the balloon.
  82622. // @returns {Number}
  82623. function getSouthTop( targetRect ) {
  82624. return targetRect.bottom + verticalOffset;
  82625. }
  82626. }
  82627. /***/ }),
  82628. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js":
  82629. /*!************************************************************************************!*\
  82630. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js ***!
  82631. \************************************************************************************/
  82632. /*! exports provided: default */
  82633. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82634. "use strict";
  82635. __webpack_require__.r(__webpack_exports__);
  82636. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ContextualBalloon; });
  82637. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  82638. /* harmony import */ var _balloonpanelview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./balloonpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
  82639. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  82640. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  82641. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  82642. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  82643. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
  82644. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  82645. /* harmony import */ var _theme_icons_previous_arrow_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../theme/icons/previous-arrow.svg */ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/previous-arrow.svg");
  82646. /* harmony import */ var _theme_icons_next_arrow_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../theme/icons/next-arrow.svg */ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/next-arrow.svg");
  82647. /* harmony import */ var _theme_components_panel_balloonrotator_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../theme/components/panel/balloonrotator.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css");
  82648. /* harmony import */ var _theme_components_panel_fakepanel_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../theme/components/panel/fakepanel.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css");
  82649. /**
  82650. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  82651. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82652. */
  82653. /**
  82654. * @module ui/panel/balloon/contextualballoon
  82655. */
  82656. const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_6__["default"])( 'px' );
  82657. /**
  82658. * Provides the common contextual balloon for the editor.
  82659. *
  82660. * The role of this plugin is to unify the contextual balloons logic, simplify views management and help
  82661. * avoid the unnecessary complexity of handling multiple {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
  82662. * instances in the editor.
  82663. *
  82664. * This plugin allows for creating single or multiple panel stacks.
  82665. *
  82666. * Each stack may have multiple views, with the one on the top being visible. When the visible view is removed from the stack,
  82667. * the previous view becomes visible.
  82668. *
  82669. * It might be useful to implement nested navigation in a balloon. For instance, a toolbar view may contain a link button.
  82670. * When you click it, a link view (which lets you set the URL) is created and put on top of the toolbar view, so the link panel
  82671. * is displayed. When you finish editing the link and close (remove) the link view, the toolbar view is visible again.
  82672. *
  82673. * However, there are cases when there are multiple independent balloons to be displayed, for instance, if the selection
  82674. * is inside two inline comments at the same time. For such cases, you can create two independent panel stacks.
  82675. * The contextual balloon plugin will create a navigation bar to let the users switch between these panel stacks using the "Next"
  82676. * and "Previous" buttons.
  82677. *
  82678. * If there are no views in the current stack, the balloon panel will try to switch to the next stack. If there are no
  82679. * panels in any stack, the balloon panel will be hidden.
  82680. *
  82681. * **Note**: To force the balloon panel to show only one view, even if there are other stacks, use the `singleViewMode=true` option
  82682. * when {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon#add adding} a view to a panel.
  82683. *
  82684. * From the implementation point of view, the contextual ballon plugin is reusing a single
  82685. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView} instance to display multiple contextual balloon
  82686. * panels in the editor. It also creates a special {@link module:ui/panel/balloon/contextualballoon~RotatorView rotator view},
  82687. * used to manage multiple panel stacks. Rotator view is a child of the balloon panel view and the parent of the specific
  82688. * view you want to display. If there is more than one panel stack to be displayed, the rotator view will add a
  82689. * navigation bar. If there is only one stack, the rotator view is transparent (it does not add any UI elements).
  82690. *
  82691. * @extends module:core/plugin~Plugin
  82692. */
  82693. class ContextualBalloon extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  82694. /**
  82695. * @inheritDoc
  82696. */
  82697. static get pluginName() {
  82698. return 'ContextualBalloon';
  82699. }
  82700. /**
  82701. * @inheritDoc
  82702. */
  82703. constructor( editor ) {
  82704. super( editor );
  82705. /**
  82706. * The {@link module:utils/dom/position~Options#limiter position limiter}
  82707. * for the {@link #view balloon}, used when no `limiter` has been passed into {@link #add}
  82708. * or {@link #updatePosition}.
  82709. *
  82710. * By default, a function that obtains the farthest DOM
  82711. * {@link module:engine/view/rooteditableelement~RootEditableElement}
  82712. * of the {@link module:engine/view/document~Document#selection}.
  82713. *
  82714. * @member {module:utils/dom/position~Options#limiter} #positionLimiter
  82715. */
  82716. this.positionLimiter = () => {
  82717. const view = this.editor.editing.view;
  82718. const viewDocument = view.document;
  82719. const editableElement = viewDocument.selection.editableElement;
  82720. if ( editableElement ) {
  82721. return view.domConverter.mapViewToDom( editableElement.root );
  82722. }
  82723. return null;
  82724. };
  82725. /**
  82726. * The currently visible view or `null` when there are no views in any stack.
  82727. *
  82728. * @readonly
  82729. * @observable
  82730. * @member {module:ui/view~View|null} #visibleView
  82731. */
  82732. this.set( 'visibleView', null );
  82733. /**
  82734. * The common balloon panel view.
  82735. *
  82736. * @readonly
  82737. * @member {module:ui/panel/balloon/balloonpanelview~BalloonPanelView} #view
  82738. */
  82739. this.view = new _balloonpanelview__WEBPACK_IMPORTED_MODULE_1__["default"]( editor.locale );
  82740. editor.ui.view.body.add( this.view );
  82741. editor.ui.focusTracker.add( this.view.element );
  82742. /**
  82743. * The map of views and their stacks.
  82744. *
  82745. * @private
  82746. * @type {Map.<module:ui/view~View,Set>}
  82747. */
  82748. this._viewToStack = new Map();
  82749. /**
  82750. * The map of IDs and stacks.
  82751. *
  82752. * @private
  82753. * @type {Map.<String,Set>}
  82754. */
  82755. this._idToStack = new Map();
  82756. /**
  82757. * A total number of all stacks in the balloon.
  82758. *
  82759. * @private
  82760. * @readonly
  82761. * @observable
  82762. * @member {Number} #_numberOfStacks
  82763. */
  82764. this.set( '_numberOfStacks', 0 );
  82765. /**
  82766. * A flag that controls the single view mode.
  82767. *
  82768. * @private
  82769. * @readonly
  82770. * @observable
  82771. * @member {Boolean} #_singleViewMode
  82772. */
  82773. this.set( '_singleViewMode', false );
  82774. /**
  82775. * Rotator view embedded in the contextual balloon.
  82776. * Displays the currently visible view in the balloon and provides navigation for switching stacks.
  82777. *
  82778. * @private
  82779. * @type {module:ui/panel/balloon/contextualballoon~RotatorView}
  82780. */
  82781. this._rotatorView = this._createRotatorView();
  82782. /**
  82783. * Displays fake panels under the balloon panel view when multiple stacks are added to the balloon.
  82784. *
  82785. * @private
  82786. * @type {module:ui/view~View}
  82787. */
  82788. this._fakePanelsView = this._createFakePanelsView();
  82789. }
  82790. /**
  82791. * @inheritDoc
  82792. */
  82793. destroy() {
  82794. super.destroy();
  82795. this.view.destroy();
  82796. this._rotatorView.destroy();
  82797. this._fakePanelsView.destroy();
  82798. }
  82799. /**
  82800. * Returns `true` when the given view is in one of the stacks. Otherwise returns `false`.
  82801. *
  82802. * @param {module:ui/view~View} view
  82803. * @returns {Boolean}
  82804. */
  82805. hasView( view ) {
  82806. return Array.from( this._viewToStack.keys() ).includes( view );
  82807. }
  82808. /**
  82809. * Adds a new view to the stack and makes it visible if the current stack is visible
  82810. * or it is the first view in the balloon.
  82811. *
  82812. * @param {Object} data The configuration of the view.
  82813. * @param {String} [data.stackId='main'] The ID of the stack that the view is added to.
  82814. * @param {module:ui/view~View} [data.view] The content of the balloon.
  82815. * @param {module:utils/dom/position~Options} [data.position] Positioning options.
  82816. * @param {String} [data.balloonClassName] An additional CSS class added to the {@link #view balloon} when visible.
  82817. * @param {Boolean} [data.withArrow=true] Whether the {@link #view balloon} should be rendered with an arrow.
  82818. * @param {Boolean} [data.singleViewMode=false] Whether the view should be the only visible view even if other stacks were added.
  82819. */
  82820. add( data ) {
  82821. if ( this.hasView( data.view ) ) {
  82822. /**
  82823. * Trying to add configuration of the same view more than once.
  82824. *
  82825. * @error contextualballoon-add-view-exist
  82826. */
  82827. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  82828. 'contextualballoon-add-view-exist',
  82829. [ this, data ]
  82830. );
  82831. }
  82832. const stackId = data.stackId || 'main';
  82833. // If new stack is added, creates it and show view from this stack.
  82834. if ( !this._idToStack.has( stackId ) ) {
  82835. this._idToStack.set( stackId, new Map( [ [ data.view, data ] ] ) );
  82836. this._viewToStack.set( data.view, this._idToStack.get( stackId ) );
  82837. this._numberOfStacks = this._idToStack.size;
  82838. if ( !this._visibleStack || data.singleViewMode ) {
  82839. this.showStack( stackId );
  82840. }
  82841. return;
  82842. }
  82843. const stack = this._idToStack.get( stackId );
  82844. if ( data.singleViewMode ) {
  82845. this.showStack( stackId );
  82846. }
  82847. // Add new view to the stack.
  82848. stack.set( data.view, data );
  82849. this._viewToStack.set( data.view, stack );
  82850. // And display it if is added to the currently visible stack.
  82851. if ( stack === this._visibleStack ) {
  82852. this._showView( data );
  82853. }
  82854. }
  82855. /**
  82856. * Removes the given view from the stack. If the removed view was visible,
  82857. * the view preceding it in the stack will become visible instead.
  82858. * When there is no view in the stack, the next stack will be displayed.
  82859. * When there are no more stacks, the balloon will hide.
  82860. *
  82861. * @param {module:ui/view~View} view A view to be removed from the balloon.
  82862. */
  82863. remove( view ) {
  82864. if ( !this.hasView( view ) ) {
  82865. /**
  82866. * Trying to remove the configuration of the view not defined in the stack.
  82867. *
  82868. * @error contextualballoon-remove-view-not-exist
  82869. */
  82870. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  82871. 'contextualballoon-remove-view-not-exist',
  82872. [ this, view ]
  82873. );
  82874. }
  82875. const stack = this._viewToStack.get( view );
  82876. if ( this._singleViewMode && this.visibleView === view ) {
  82877. this._singleViewMode = false;
  82878. }
  82879. // When visible view will be removed we need to show a preceding view or next stack
  82880. // if a view is the only view in the stack.
  82881. if ( this.visibleView === view ) {
  82882. if ( stack.size === 1 ) {
  82883. if ( this._idToStack.size > 1 ) {
  82884. this._showNextStack();
  82885. } else {
  82886. this.view.hide();
  82887. this.visibleView = null;
  82888. this._rotatorView.hideView();
  82889. }
  82890. } else {
  82891. this._showView( Array.from( stack.values() )[ stack.size - 2 ] );
  82892. }
  82893. }
  82894. if ( stack.size === 1 ) {
  82895. this._idToStack.delete( this._getStackId( stack ) );
  82896. this._numberOfStacks = this._idToStack.size;
  82897. } else {
  82898. stack.delete( view );
  82899. }
  82900. this._viewToStack.delete( view );
  82901. }
  82902. /**
  82903. * Updates the position of the balloon using the position data of the first visible view in the stack.
  82904. * When new position data is given, the position data of the currently visible view will be updated.
  82905. *
  82906. * @param {module:utils/dom/position~Options} [position] position options.
  82907. */
  82908. updatePosition( position ) {
  82909. if ( position ) {
  82910. this._visibleStack.get( this.visibleView ).position = position;
  82911. }
  82912. this.view.pin( this._getBalloonPosition() );
  82913. this._fakePanelsView.updatePosition();
  82914. }
  82915. /**
  82916. * Shows the last view from the stack of a given ID.
  82917. *
  82918. * @param {String} id
  82919. */
  82920. showStack( id ) {
  82921. this.visibleStack = id;
  82922. const stack = this._idToStack.get( id );
  82923. if ( !stack ) {
  82924. /**
  82925. * Trying to show a stack that does not exist.
  82926. *
  82927. * @error contextualballoon-showstack-stack-not-exist
  82928. */
  82929. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  82930. 'contextualballoon-showstack-stack-not-exist',
  82931. this
  82932. );
  82933. }
  82934. if ( this._visibleStack === stack ) {
  82935. return;
  82936. }
  82937. this._showView( Array.from( stack.values() ).pop() );
  82938. }
  82939. /**
  82940. * Returns the stack of the currently visible view.
  82941. *
  82942. * @private
  82943. * @type {Set}
  82944. */
  82945. get _visibleStack() {
  82946. return this._viewToStack.get( this.visibleView );
  82947. }
  82948. /**
  82949. * Returns the ID of the given stack.
  82950. *
  82951. * @private
  82952. * @param {Set} stack
  82953. * @returns {String}
  82954. */
  82955. _getStackId( stack ) {
  82956. const entry = Array.from( this._idToStack.entries() ).find( entry => entry[ 1 ] === stack );
  82957. return entry[ 0 ];
  82958. }
  82959. /**
  82960. * Shows the last view from the next stack.
  82961. *
  82962. * @private
  82963. */
  82964. _showNextStack() {
  82965. const stacks = Array.from( this._idToStack.values() );
  82966. let nextIndex = stacks.indexOf( this._visibleStack ) + 1;
  82967. if ( !stacks[ nextIndex ] ) {
  82968. nextIndex = 0;
  82969. }
  82970. this.showStack( this._getStackId( stacks[ nextIndex ] ) );
  82971. }
  82972. /**
  82973. * Shows the last view from the previous stack.
  82974. *
  82975. * @private
  82976. */
  82977. _showPrevStack() {
  82978. const stacks = Array.from( this._idToStack.values() );
  82979. let nextIndex = stacks.indexOf( this._visibleStack ) - 1;
  82980. if ( !stacks[ nextIndex ] ) {
  82981. nextIndex = stacks.length - 1;
  82982. }
  82983. this.showStack( this._getStackId( stacks[ nextIndex ] ) );
  82984. }
  82985. /**
  82986. * Creates a rotator view.
  82987. *
  82988. * @private
  82989. * @returns {module:ui/panel/balloon/contextualballoon~RotatorView}
  82990. */
  82991. _createRotatorView() {
  82992. const view = new RotatorView( this.editor.locale );
  82993. const t = this.editor.locale.t;
  82994. this.view.content.add( view );
  82995. // Hide navigation when there is only a one stack & not in single view mode.
  82996. view.bind( 'isNavigationVisible' ).to( this, '_numberOfStacks', this, '_singleViewMode', ( value, isSingleViewMode ) => {
  82997. return !isSingleViewMode && value > 1;
  82998. } );
  82999. // Update balloon position after toggling navigation.
  83000. view.on( 'change:isNavigationVisible', () => ( this.updatePosition() ), { priority: 'low' } );
  83001. // Update stacks counter value.
  83002. view.bind( 'counter' ).to( this, 'visibleView', this, '_numberOfStacks', ( visibleView, numberOfStacks ) => {
  83003. if ( numberOfStacks < 2 ) {
  83004. return '';
  83005. }
  83006. const current = Array.from( this._idToStack.values() ).indexOf( this._visibleStack ) + 1;
  83007. return t( '%0 of %1', [ current, numberOfStacks ] );
  83008. } );
  83009. view.buttonNextView.on( 'execute', () => {
  83010. // When current view has a focus then move focus to the editable before removing it,
  83011. // otherwise editor will lost focus.
  83012. if ( view.focusTracker.isFocused ) {
  83013. this.editor.editing.view.focus();
  83014. }
  83015. this._showNextStack();
  83016. } );
  83017. view.buttonPrevView.on( 'execute', () => {
  83018. // When current view has a focus then move focus to the editable before removing it,
  83019. // otherwise editor will lost focus.
  83020. if ( view.focusTracker.isFocused ) {
  83021. this.editor.editing.view.focus();
  83022. }
  83023. this._showPrevStack();
  83024. } );
  83025. return view;
  83026. }
  83027. /**
  83028. * @private
  83029. * @returns {module:ui/view~View}
  83030. */
  83031. _createFakePanelsView() {
  83032. const view = new FakePanelsView( this.editor.locale, this.view );
  83033. view.bind( 'numberOfPanels' ).to( this, '_numberOfStacks', this, '_singleViewMode', ( number, isSingleViewMode ) => {
  83034. const showPanels = !isSingleViewMode && number >= 2;
  83035. return showPanels ? Math.min( number - 1, 2 ) : 0;
  83036. } );
  83037. view.listenTo( this.view, 'change:top', () => view.updatePosition() );
  83038. view.listenTo( this.view, 'change:left', () => view.updatePosition() );
  83039. this.editor.ui.view.body.add( view );
  83040. return view;
  83041. }
  83042. /**
  83043. * Sets the view as the content of the balloon and attaches the balloon using position
  83044. * options of the first view.
  83045. *
  83046. * @private
  83047. * @param {Object} data Configuration.
  83048. * @param {module:ui/view~View} [data.view] The view to show in the balloon.
  83049. * @param {String} [data.balloonClassName=''] Additional class name which will be added to the {@link #view balloon}.
  83050. * @param {Boolean} [data.withArrow=true] Whether the {@link #view balloon} should be rendered with an arrow.
  83051. */
  83052. _showView( { view, balloonClassName = '', withArrow = true, singleViewMode = false } ) {
  83053. this.view.class = balloonClassName;
  83054. this.view.withArrow = withArrow;
  83055. this._rotatorView.showView( view );
  83056. this.visibleView = view;
  83057. this.view.pin( this._getBalloonPosition() );
  83058. this._fakePanelsView.updatePosition();
  83059. if ( singleViewMode ) {
  83060. this._singleViewMode = true;
  83061. }
  83062. }
  83063. /**
  83064. * Returns position options of the last view in the stack.
  83065. * This keeps the balloon in the same position when the view is changed.
  83066. *
  83067. * @private
  83068. * @returns {module:utils/dom/position~Options}
  83069. */
  83070. _getBalloonPosition() {
  83071. let position = Array.from( this._visibleStack.values() ).pop().position;
  83072. if ( position ) {
  83073. // Use the default limiter if none has been specified.
  83074. if ( !position.limiter ) {
  83075. // Don't modify the original options object.
  83076. position = Object.assign( {}, position, {
  83077. limiter: this.positionLimiter
  83078. } );
  83079. }
  83080. // Don't modify the original options object.
  83081. position = Object.assign( {}, position, {
  83082. viewportOffsetConfig: this.editor.ui.viewportOffset
  83083. } );
  83084. }
  83085. return position;
  83086. }
  83087. }
  83088. /**
  83089. * Rotator view is a helper class for the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon ContextualBalloon}.
  83090. * It is used for displaying the last view from the current stack and providing navigation buttons for switching stacks.
  83091. * See the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon ContextualBalloon} documentation to learn more.
  83092. *
  83093. * @extends module:ui/view~View
  83094. */
  83095. class RotatorView extends _view__WEBPACK_IMPORTED_MODULE_2__["default"] {
  83096. /**
  83097. * @inheritDoc
  83098. */
  83099. constructor( locale ) {
  83100. super( locale );
  83101. const t = locale.t;
  83102. const bind = this.bindTemplate;
  83103. /**
  83104. * Defines whether navigation is visible or not.
  83105. *
  83106. * @member {Boolean} #isNavigationVisible
  83107. */
  83108. this.set( 'isNavigationVisible', true );
  83109. /**
  83110. * Used for checking if a view is focused or not.
  83111. *
  83112. * @type {module:utils/focustracker~FocusTracker}
  83113. */
  83114. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_5__["default"]();
  83115. /**
  83116. * Navigation button for switching the stack to the previous one.
  83117. *
  83118. * @type {module:ui/button/buttonview~ButtonView}
  83119. */
  83120. this.buttonPrevView = this._createButtonView( t( 'Previous' ), _theme_icons_previous_arrow_svg__WEBPACK_IMPORTED_MODULE_8__["default"] );
  83121. /**
  83122. * Navigation button for switching the stack to the next one.
  83123. *
  83124. * @type {module:ui/button/buttonview~ButtonView}
  83125. */
  83126. this.buttonNextView = this._createButtonView( t( 'Next' ), _theme_icons_next_arrow_svg__WEBPACK_IMPORTED_MODULE_9__["default"] );
  83127. /**
  83128. * A collection of the child views that creates the rotator content.
  83129. *
  83130. * @readonly
  83131. * @type {module:ui/viewcollection~ViewCollection}
  83132. */
  83133. this.content = this.createCollection();
  83134. this.setTemplate( {
  83135. tag: 'div',
  83136. attributes: {
  83137. class: [
  83138. 'ck',
  83139. 'ck-balloon-rotator'
  83140. ],
  83141. 'z-index': '-1'
  83142. },
  83143. children: [
  83144. {
  83145. tag: 'div',
  83146. attributes: {
  83147. class: [
  83148. 'ck-balloon-rotator__navigation',
  83149. bind.to( 'isNavigationVisible', value => value ? '' : 'ck-hidden' )
  83150. ]
  83151. },
  83152. children: [
  83153. this.buttonPrevView,
  83154. {
  83155. tag: 'span',
  83156. attributes: {
  83157. class: [
  83158. 'ck-balloon-rotator__counter'
  83159. ]
  83160. },
  83161. children: [
  83162. {
  83163. text: bind.to( 'counter' )
  83164. }
  83165. ]
  83166. },
  83167. this.buttonNextView
  83168. ]
  83169. },
  83170. {
  83171. tag: 'div',
  83172. attributes: {
  83173. class: 'ck-balloon-rotator__content'
  83174. },
  83175. children: this.content
  83176. }
  83177. ]
  83178. } );
  83179. }
  83180. /**
  83181. * @inheritDoc
  83182. */
  83183. render() {
  83184. super.render();
  83185. this.focusTracker.add( this.element );
  83186. }
  83187. /**
  83188. * @inheritDoc
  83189. */
  83190. destroy() {
  83191. super.destroy();
  83192. this.focusTracker.destroy();
  83193. }
  83194. /**
  83195. * Shows a given view.
  83196. *
  83197. * @param {module:ui/view~View} view The view to show.
  83198. */
  83199. showView( view ) {
  83200. this.hideView();
  83201. this.content.add( view );
  83202. }
  83203. /**
  83204. * Hides the currently displayed view.
  83205. */
  83206. hideView() {
  83207. this.content.clear();
  83208. }
  83209. /**
  83210. * Creates a navigation button view.
  83211. *
  83212. * @private
  83213. * @param {String} label The button label.
  83214. * @param {String} icon The button icon.
  83215. * @returns {module:ui/button/buttonview~ButtonView}
  83216. */
  83217. _createButtonView( label, icon ) {
  83218. const view = new _button_buttonview__WEBPACK_IMPORTED_MODULE_3__["default"]( this.locale );
  83219. view.set( {
  83220. label,
  83221. icon,
  83222. tooltip: true
  83223. } );
  83224. return view;
  83225. }
  83226. }
  83227. // Displays additional layers under the balloon when multiple stacks are added to the balloon.
  83228. //
  83229. // @private
  83230. // @extends module:ui/view~View
  83231. class FakePanelsView extends _view__WEBPACK_IMPORTED_MODULE_2__["default"] {
  83232. // @inheritDoc
  83233. constructor( locale, balloonPanelView ) {
  83234. super( locale );
  83235. const bind = this.bindTemplate;
  83236. // Fake panels top offset.
  83237. //
  83238. // @observable
  83239. // @member {Number} #top
  83240. this.set( 'top', 0 );
  83241. // Fake panels left offset.
  83242. //
  83243. // @observable
  83244. // @member {Number} #left
  83245. this.set( 'left', 0 );
  83246. // Fake panels height.
  83247. //
  83248. // @observable
  83249. // @member {Number} #height
  83250. this.set( 'height', 0 );
  83251. // Fake panels width.
  83252. //
  83253. // @observable
  83254. // @member {Number} #width
  83255. this.set( 'width', 0 );
  83256. // Number of rendered fake panels.
  83257. //
  83258. // @observable
  83259. // @member {Number} #numberOfPanels
  83260. this.set( 'numberOfPanels', 0 );
  83261. // Collection of the child views which creates fake panel content.
  83262. //
  83263. // @readonly
  83264. // @type {module:ui/viewcollection~ViewCollection}
  83265. this.content = this.createCollection();
  83266. // Context.
  83267. //
  83268. // @private
  83269. // @type {module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
  83270. this._balloonPanelView = balloonPanelView;
  83271. this.setTemplate( {
  83272. tag: 'div',
  83273. attributes: {
  83274. class: [
  83275. 'ck-fake-panel',
  83276. bind.to( 'numberOfPanels', number => number ? '' : 'ck-hidden' )
  83277. ],
  83278. style: {
  83279. top: bind.to( 'top', toPx ),
  83280. left: bind.to( 'left', toPx ),
  83281. width: bind.to( 'width', toPx ),
  83282. height: bind.to( 'height', toPx )
  83283. }
  83284. },
  83285. children: this.content
  83286. } );
  83287. this.on( 'change:numberOfPanels', ( evt, name, next, prev ) => {
  83288. if ( next > prev ) {
  83289. this._addPanels( next - prev );
  83290. } else {
  83291. this._removePanels( prev - next );
  83292. }
  83293. this.updatePosition();
  83294. } );
  83295. }
  83296. // @private
  83297. // @param {Number} number
  83298. _addPanels( number ) {
  83299. while ( number-- ) {
  83300. const view = new _view__WEBPACK_IMPORTED_MODULE_2__["default"]();
  83301. view.setTemplate( { tag: 'div' } );
  83302. this.content.add( view );
  83303. this.registerChild( view );
  83304. }
  83305. }
  83306. // @private
  83307. // @param {Number} number
  83308. _removePanels( number ) {
  83309. while ( number-- ) {
  83310. const view = this.content.last;
  83311. this.content.remove( view );
  83312. this.deregisterChild( view );
  83313. view.destroy();
  83314. }
  83315. }
  83316. // Updates coordinates of fake panels.
  83317. updatePosition() {
  83318. if ( this.numberOfPanels ) {
  83319. const { top, left } = this._balloonPanelView;
  83320. const { width, height } = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_7__["default"]( this._balloonPanelView.element );
  83321. Object.assign( this, { top, left, width, height } );
  83322. }
  83323. }
  83324. }
  83325. /***/ }),
  83326. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview.js":
  83327. /*!*********************************************************************************!*\
  83328. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview.js ***!
  83329. \*********************************************************************************/
  83330. /*! exports provided: default */
  83331. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  83332. "use strict";
  83333. __webpack_require__.r(__webpack_exports__);
  83334. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return StickyPanelView; });
  83335. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  83336. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  83337. /* harmony import */ var _template__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
  83338. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
  83339. /* harmony import */ var _theme_components_panel_stickypanel_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../theme/components/panel/stickypanel.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css");
  83340. /**
  83341. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  83342. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  83343. */
  83344. /**
  83345. * @module ui/panel/sticky/stickypanelview
  83346. */
  83347. const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_3__["default"])( 'px' );
  83348. /**
  83349. * The sticky panel view class.
  83350. */
  83351. class StickyPanelView extends _view__WEBPACK_IMPORTED_MODULE_1__["default"] {
  83352. /**
  83353. * @inheritDoc
  83354. */
  83355. constructor( locale ) {
  83356. super( locale );
  83357. const bind = this.bindTemplate;
  83358. /**
  83359. * Controls whether the sticky panel should be active.
  83360. *
  83361. * @readonly
  83362. * @observable
  83363. * @member {Boolean} #isActive
  83364. */
  83365. this.set( 'isActive', false );
  83366. /**
  83367. * Controls whether the sticky panel is in the "sticky" state.
  83368. *
  83369. * @readonly
  83370. * @observable
  83371. * @member {Boolean} #isSticky
  83372. */
  83373. this.set( 'isSticky', false );
  83374. /**
  83375. * The limiter element for the sticky panel instance. Its bounding rect limits
  83376. * the "stickyness" of the panel, i.e. when the panel reaches the bottom
  83377. * edge of the limiter, it becomes sticky to that edge and does not float
  83378. * off the limiter. It is mandatory for the panel to work properly and once
  83379. * set, it cannot be changed.
  83380. *
  83381. * @readonly
  83382. * @observable
  83383. * @member {HTMLElement} #limiterElement
  83384. */
  83385. this.set( 'limiterElement', null );
  83386. /**
  83387. * The offset from the bottom edge of {@link #limiterElement}
  83388. * which stops the panel from stickying any further to prevent limiter's content
  83389. * from being completely covered.
  83390. *
  83391. * @readonly
  83392. * @observable
  83393. * @default 50
  83394. * @member {Number} #limiterBottomOffset
  83395. */
  83396. this.set( 'limiterBottomOffset', 50 );
  83397. /**
  83398. * The offset from the top edge of the web browser's viewport which makes the
  83399. * panel become sticky. The default value is `0`, which means the panel becomes
  83400. * sticky when it's upper edge touches the top of the page viewport.
  83401. *
  83402. * This attribute is useful when the web page has UI elements positioned to the top
  83403. * either using `position: fixed` or `position: sticky`, which would cover the
  83404. * sticky panel or vice–versa (depending on the `z-index` hierarchy).
  83405. *
  83406. * Bound to {@link module:core/editor/editorui~EditorUI#viewportOffset `EditorUI#viewportOffset`}.
  83407. *
  83408. * If {@link module:core/editor/editorconfig~EditorConfig#ui `EditorConfig#ui.viewportOffset.top`} is defined, then
  83409. * it will override the default value.
  83410. *
  83411. * @observable
  83412. * @default 0
  83413. * @member {Number} #viewportTopOffset
  83414. */
  83415. this.set( 'viewportTopOffset', 0 );
  83416. /**
  83417. * Controls the `margin-left` CSS style of the panel.
  83418. *
  83419. * @protected
  83420. * @readonly
  83421. * @observable
  83422. * @member {String} #_marginLeft
  83423. */
  83424. this.set( '_marginLeft', null );
  83425. /**
  83426. * Set `true` if the sticky panel reached the bottom edge of the
  83427. * {@link #limiterElement}.
  83428. *
  83429. * @protected
  83430. * @readonly
  83431. * @observable
  83432. * @member {Boolean} #_isStickyToTheLimiter
  83433. */
  83434. this.set( '_isStickyToTheLimiter', false );
  83435. /**
  83436. * Set `true` if the sticky panel uses the {@link #viewportTopOffset},
  83437. * i.e. not {@link #_isStickyToTheLimiter} and the {@link #viewportTopOffset}
  83438. * is not `0`.
  83439. *
  83440. * @protected
  83441. * @readonly
  83442. * @observable
  83443. * @member {Boolean} #_hasViewportTopOffset
  83444. */
  83445. this.set( '_hasViewportTopOffset', false );
  83446. /**
  83447. * Collection of the child views which creates balloon panel contents.
  83448. *
  83449. * @readonly
  83450. * @member {module:ui/viewcollection~ViewCollection}
  83451. */
  83452. this.content = this.createCollection();
  83453. /**
  83454. * The DOM bounding client rect of the {@link module:ui/view~View#element} of the panel.
  83455. *
  83456. * @protected
  83457. * @member {Object} #_panelRect
  83458. */
  83459. /**
  83460. * The DOM bounding client rect of the {@link #limiterElement}
  83461. * of the panel.
  83462. *
  83463. * @protected
  83464. * @member {Object} #_limiterRect
  83465. */
  83466. /**
  83467. * A dummy element which visually fills the space as long as the
  83468. * actual panel is sticky. It prevents flickering of the UI.
  83469. *
  83470. * @protected
  83471. * @property {HTMLElement}
  83472. */
  83473. this._contentPanelPlaceholder = new _template__WEBPACK_IMPORTED_MODULE_2__["default"]( {
  83474. tag: 'div',
  83475. attributes: {
  83476. class: [
  83477. 'ck',
  83478. 'ck-sticky-panel__placeholder'
  83479. ],
  83480. style: {
  83481. display: bind.to( 'isSticky', isSticky => isSticky ? 'block' : 'none' ),
  83482. height: bind.to( 'isSticky', isSticky => {
  83483. return isSticky ? toPx( this._panelRect.height ) : null;
  83484. } )
  83485. }
  83486. }
  83487. } ).render();
  83488. /**
  83489. * The panel which accepts children into {@link #content} collection.
  83490. * Also an element which is positioned when {@link #isSticky}.
  83491. *
  83492. * @protected
  83493. * @property {HTMLElement}
  83494. */
  83495. this._contentPanel = new _template__WEBPACK_IMPORTED_MODULE_2__["default"]( {
  83496. tag: 'div',
  83497. attributes: {
  83498. class: [
  83499. 'ck',
  83500. 'ck-sticky-panel__content',
  83501. // Toggle class of the panel when "sticky" state changes in the view.
  83502. bind.if( 'isSticky', 'ck-sticky-panel__content_sticky' ),
  83503. bind.if( '_isStickyToTheLimiter', 'ck-sticky-panel__content_sticky_bottom-limit' )
  83504. ],
  83505. style: {
  83506. width: bind.to( 'isSticky', isSticky => {
  83507. return isSticky ? toPx( this._contentPanelPlaceholder.getBoundingClientRect().width ) : null;
  83508. } ),
  83509. top: bind.to( '_hasViewportTopOffset', _hasViewportTopOffset => {
  83510. return _hasViewportTopOffset ? toPx( this.viewportTopOffset ) : null;
  83511. } ),
  83512. bottom: bind.to( '_isStickyToTheLimiter', _isStickyToTheLimiter => {
  83513. return _isStickyToTheLimiter ? toPx( this.limiterBottomOffset ) : null;
  83514. } ),
  83515. marginLeft: bind.to( '_marginLeft' )
  83516. }
  83517. },
  83518. children: this.content
  83519. } ).render();
  83520. this.setTemplate( {
  83521. tag: 'div',
  83522. attributes: {
  83523. class: [
  83524. 'ck',
  83525. 'ck-sticky-panel'
  83526. ]
  83527. },
  83528. children: [
  83529. this._contentPanelPlaceholder,
  83530. this._contentPanel
  83531. ]
  83532. } );
  83533. }
  83534. /**
  83535. * @inheritDoc
  83536. */
  83537. render() {
  83538. super.render();
  83539. // Check if the panel should go into the sticky state immediately.
  83540. this._checkIfShouldBeSticky();
  83541. // Update sticky state of the panel as the window is being scrolled.
  83542. this.listenTo( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__["default"].window, 'scroll', () => {
  83543. this._checkIfShouldBeSticky();
  83544. } );
  83545. // Synchronize with `model.isActive` because sticking an inactive panel is pointless.
  83546. this.listenTo( this, 'change:isActive', () => {
  83547. this._checkIfShouldBeSticky();
  83548. } );
  83549. }
  83550. /**
  83551. * Analyzes the environment to decide whether the panel should
  83552. * be sticky or not.
  83553. *
  83554. * @protected
  83555. */
  83556. _checkIfShouldBeSticky() {
  83557. const panelRect = this._panelRect = this._contentPanel.getBoundingClientRect();
  83558. let limiterRect;
  83559. if ( !this.limiterElement ) {
  83560. this.isSticky = false;
  83561. } else {
  83562. limiterRect = this._limiterRect = this.limiterElement.getBoundingClientRect();
  83563. // The panel must be active to become sticky.
  83564. this.isSticky = this.isActive &&
  83565. // The limiter's top edge must be beyond the upper edge of the visible viewport (+the viewportTopOffset).
  83566. limiterRect.top < this.viewportTopOffset &&
  83567. // The model#limiterElement's height mustn't be smaller than the panel's height and model#limiterBottomOffset.
  83568. // There's no point in entering the sticky mode if the model#limiterElement is very, very small, because
  83569. // it would immediately set model#_isStickyToTheLimiter true and, given model#limiterBottomOffset, the panel
  83570. // would be positioned before the model#limiterElement.
  83571. this._panelRect.height + this.limiterBottomOffset < limiterRect.height;
  83572. }
  83573. // Stick the panel to the top edge of the viewport simulating CSS position:sticky.
  83574. // TODO: Possibly replaced by CSS in the future http://caniuse.com/#feat=css-sticky
  83575. if ( this.isSticky ) {
  83576. this._isStickyToTheLimiter =
  83577. limiterRect.bottom < panelRect.height + this.limiterBottomOffset + this.viewportTopOffset;
  83578. this._hasViewportTopOffset = !this._isStickyToTheLimiter && !!this.viewportTopOffset;
  83579. this._marginLeft = this._isStickyToTheLimiter ? null : toPx( -_ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__["default"].window.scrollX );
  83580. }
  83581. // Detach the panel from the top edge of the viewport.
  83582. else {
  83583. this._isStickyToTheLimiter = false;
  83584. this._hasViewportTopOffset = false;
  83585. this._marginLeft = null;
  83586. }
  83587. }
  83588. }
  83589. /***/ }),
  83590. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js":
  83591. /*!*************************************************************!*\
  83592. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/template.js ***!
  83593. \*************************************************************/
  83594. /*! exports provided: default, TemplateBinding, TemplateToBinding, TemplateIfBinding */
  83595. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  83596. "use strict";
  83597. __webpack_require__.r(__webpack_exports__);
  83598. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Template; });
  83599. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateBinding", function() { return TemplateBinding; });
  83600. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateToBinding", function() { return TemplateToBinding; });
  83601. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateIfBinding", function() { return TemplateIfBinding; });
  83602. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  83603. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  83604. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  83605. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  83606. /* harmony import */ var _viewcollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
  83607. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/isnode */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js");
  83608. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  83609. /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
  83610. /**
  83611. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  83612. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  83613. */
  83614. /**
  83615. * @module ui/template
  83616. */
  83617. /* global document */
  83618. const xhtmlNs = 'http://www.w3.org/1999/xhtml';
  83619. /**
  83620. * A basic Template class. It renders a DOM HTML element or text from a
  83621. * {@link module:ui/template~TemplateDefinition definition} and supports element attributes, children,
  83622. * bindings to {@link module:utils/observablemixin~Observable observables} and DOM event propagation.
  83623. *
  83624. * A simple template can look like this:
  83625. *
  83626. * const bind = Template.bind( observable, emitter );
  83627. *
  83628. * new Template( {
  83629. * tag: 'p',
  83630. * attributes: {
  83631. * class: 'foo',
  83632. * style: {
  83633. * backgroundColor: 'yellow'
  83634. * }
  83635. * },
  83636. * on: {
  83637. * click: bind.to( 'clicked' )
  83638. * },
  83639. * children: [
  83640. * 'A paragraph.'
  83641. * ]
  83642. * } ).render();
  83643. *
  83644. * and it will render the following HTML element:
  83645. *
  83646. * <p class="foo" style="background-color: yellow;">A paragraph.</p>
  83647. *
  83648. * Additionally, the `observable` will always fire `clicked` upon clicking `<p>` in the DOM.
  83649. *
  83650. * See {@link module:ui/template~TemplateDefinition} to know more about templates and complex
  83651. * template definitions.
  83652. *
  83653. * @mixes module:utils/emittermixin~EmitterMixin
  83654. */
  83655. class Template {
  83656. /**
  83657. * Creates an instance of the {@link ~Template} class.
  83658. *
  83659. * @param {module:ui/template~TemplateDefinition} def The definition of the template.
  83660. */
  83661. constructor( def ) {
  83662. Object.assign( this, normalize( clone( def ) ) );
  83663. /**
  83664. * Indicates whether this particular Template instance has been
  83665. * {@link #render rendered}.
  83666. *
  83667. * @readonly
  83668. * @protected
  83669. * @member {Boolean}
  83670. */
  83671. this._isRendered = false;
  83672. /**
  83673. * The tag (`tagName`) of this template, e.g. `div`. It also indicates that the template
  83674. * renders to an HTML element.
  83675. *
  83676. * @member {String} #tag
  83677. */
  83678. /**
  83679. * The text of the template. It also indicates that the template renders to a DOM text node.
  83680. *
  83681. * @member {Array.<String|module:ui/template~TemplateValueSchema>} #text
  83682. */
  83683. /**
  83684. * The attributes of the template, e.g. `{ id: [ 'ck-id' ] }`, corresponding with
  83685. * the attributes of an HTML element.
  83686. *
  83687. * **Note**: This property only makes sense when {@link #tag} is defined.
  83688. *
  83689. * @member {Object} #attributes
  83690. */
  83691. /**
  83692. * The children of the template. They can be either:
  83693. * * independent instances of {@link ~Template} (sub–templates),
  83694. * * native DOM Nodes.
  83695. *
  83696. * **Note**: This property only makes sense when {@link #tag} is defined.
  83697. *
  83698. * @member {Array.<module:ui/template~Template|Node>} #children
  83699. */
  83700. /**
  83701. * The DOM event listeners of the template.
  83702. *
  83703. * @member {Object} #eventListeners
  83704. */
  83705. /**
  83706. * The data used by the {@link #revert} method to restore a node to its original state.
  83707. *
  83708. * See: {@link #apply}.
  83709. *
  83710. * @readonly
  83711. * @protected
  83712. * @member {module:ui/template~RenderData}
  83713. */
  83714. this._revertData = null;
  83715. }
  83716. /**
  83717. * Renders a DOM Node (an HTML element or text) out of the template.
  83718. *
  83719. * const domNode = new Template( { ... } ).render();
  83720. *
  83721. * See: {@link #apply}.
  83722. *
  83723. * @returns {HTMLElement|Text}
  83724. */
  83725. render() {
  83726. const node = this._renderNode( {
  83727. intoFragment: true
  83728. } );
  83729. this._isRendered = true;
  83730. return node;
  83731. }
  83732. /**
  83733. * Applies the template to an existing DOM Node, either HTML element or text.
  83734. *
  83735. * **Note:** No new DOM nodes will be created. Applying extends:
  83736. *
  83737. * {@link module:ui/template~TemplateDefinition attributes},
  83738. * {@link module:ui/template~TemplateDefinition event listeners}, and
  83739. * `textContent` of {@link module:ui/template~TemplateDefinition children} only.
  83740. *
  83741. * **Note:** Existing `class` and `style` attributes are extended when a template
  83742. * is applied to an HTML element, while other attributes and `textContent` are overridden.
  83743. *
  83744. * **Note:** The process of applying a template can be easily reverted using the
  83745. * {@link module:ui/template~Template#revert} method.
  83746. *
  83747. * const element = document.createElement( 'div' );
  83748. * const observable = new Model( { divClass: 'my-div' } );
  83749. * const emitter = Object.create( EmitterMixin );
  83750. * const bind = Template.bind( observable, emitter );
  83751. *
  83752. * new Template( {
  83753. * attributes: {
  83754. * id: 'first-div',
  83755. * class: bind.to( 'divClass' )
  83756. * },
  83757. * on: {
  83758. * click: bind( 'elementClicked' ) // Will be fired by the observable.
  83759. * },
  83760. * children: [
  83761. * 'Div text.'
  83762. * ]
  83763. * } ).apply( element );
  83764. *
  83765. * console.log( element.outerHTML ); // -> '<div id="first-div" class="my-div"></div>'
  83766. *
  83767. * @see module:ui/template~Template#render
  83768. * @see module:ui/template~Template#revert
  83769. * @param {Node} node Root node for the template to apply.
  83770. */
  83771. apply( node ) {
  83772. this._revertData = getEmptyRevertData();
  83773. this._renderNode( {
  83774. node,
  83775. isApplying: true,
  83776. revertData: this._revertData
  83777. } );
  83778. return node;
  83779. }
  83780. /**
  83781. * Reverts a template {@link module:ui/template~Template#apply applied} to a DOM node.
  83782. *
  83783. * @param {Node} node The root node for the template to revert. In most of the cases, it is the
  83784. * same node used by {@link module:ui/template~Template#apply}.
  83785. */
  83786. revert( node ) {
  83787. if ( !this._revertData ) {
  83788. /**
  83789. * Attempting to revert a template which has not been applied yet.
  83790. *
  83791. * @error ui-template-revert-not-applied
  83792. */
  83793. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  83794. 'ui-template-revert-not-applied',
  83795. [ this, node ]
  83796. );
  83797. }
  83798. this._revertTemplateFromNode( node, this._revertData );
  83799. }
  83800. /**
  83801. * Returns an iterator which traverses the template in search of {@link module:ui/view~View}
  83802. * instances and returns them one by one.
  83803. *
  83804. * const viewFoo = new View();
  83805. * const viewBar = new View();
  83806. * const viewBaz = new View();
  83807. * const template = new Template( {
  83808. * tag: 'div',
  83809. * children: [
  83810. * viewFoo,
  83811. * {
  83812. * tag: 'div',
  83813. * children: [
  83814. * viewBar
  83815. * ]
  83816. * },
  83817. * viewBaz
  83818. * ]
  83819. * } );
  83820. *
  83821. * // Logs: viewFoo, viewBar, viewBaz
  83822. * for ( const view of template.getViews() ) {
  83823. * console.log( view );
  83824. * }
  83825. *
  83826. * @returns {Iterable.<module:ui/view~View>}
  83827. */
  83828. * getViews() {
  83829. function* search( def ) {
  83830. if ( def.children ) {
  83831. for ( const child of def.children ) {
  83832. if ( isView( child ) ) {
  83833. yield child;
  83834. } else if ( isTemplate( child ) ) {
  83835. yield* search( child );
  83836. }
  83837. }
  83838. }
  83839. }
  83840. yield* search( this );
  83841. }
  83842. /**
  83843. * An entry point to the interface which binds DOM nodes to
  83844. * {@link module:utils/observablemixin~Observable observables}.
  83845. * There are two types of bindings:
  83846. *
  83847. * * HTML element attributes or text `textContent` synchronized with attributes of an
  83848. * {@link module:utils/observablemixin~Observable}. Learn more about {@link module:ui/template~BindChain#to}
  83849. * and {@link module:ui/template~BindChain#if}.
  83850. *
  83851. * const bind = Template.bind( observable, emitter );
  83852. *
  83853. * new Template( {
  83854. * attributes: {
  83855. * // Binds the element "class" attribute to observable#classAttribute.
  83856. * class: bind.to( 'classAttribute' )
  83857. * }
  83858. * } ).render();
  83859. *
  83860. * * DOM events fired on HTML element propagated through
  83861. * {@link module:utils/observablemixin~Observable}. Learn more about {@link module:ui/template~BindChain#to}.
  83862. *
  83863. * const bind = Template.bind( observable, emitter );
  83864. *
  83865. * new Template( {
  83866. * on: {
  83867. * // Will be fired by the observable.
  83868. * click: bind( 'elementClicked' )
  83869. * }
  83870. * } ).render();
  83871. *
  83872. * Also see {@link module:ui/view~View#bindTemplate}.
  83873. *
  83874. * @param {module:utils/observablemixin~Observable} observable An observable which provides boundable attributes.
  83875. * @param {module:utils/emittermixin~Emitter} emitter An emitter that listens to observable attribute
  83876. * changes or DOM Events (depending on the kind of the binding). Usually, a {@link module:ui/view~View} instance.
  83877. * @returns {module:ui/template~BindChain}
  83878. */
  83879. static bind( observable, emitter ) {
  83880. return {
  83881. to( eventNameOrFunctionOrAttribute, callback ) {
  83882. return new TemplateToBinding( {
  83883. eventNameOrFunction: eventNameOrFunctionOrAttribute,
  83884. attribute: eventNameOrFunctionOrAttribute,
  83885. observable, emitter, callback
  83886. } );
  83887. },
  83888. if( attribute, valueIfTrue, callback ) {
  83889. return new TemplateIfBinding( {
  83890. observable, emitter, attribute, valueIfTrue, callback
  83891. } );
  83892. }
  83893. };
  83894. }
  83895. /**
  83896. * Extends an existing {@link module:ui/template~Template} instance with some additional content
  83897. * from another {@link module:ui/template~TemplateDefinition}.
  83898. *
  83899. * const bind = Template.bind( observable, emitter );
  83900. *
  83901. * const template = new Template( {
  83902. * tag: 'p',
  83903. * attributes: {
  83904. * class: 'a',
  83905. * data-x: bind.to( 'foo' )
  83906. * },
  83907. * children: [
  83908. * {
  83909. * tag: 'span',
  83910. * attributes: {
  83911. * class: 'b'
  83912. * },
  83913. * children: [
  83914. * 'Span'
  83915. * ]
  83916. * }
  83917. * ]
  83918. * } );
  83919. *
  83920. * // Instance-level extension.
  83921. * Template.extend( template, {
  83922. * attributes: {
  83923. * class: 'b',
  83924. * data-x: bind.to( 'bar' )
  83925. * },
  83926. * children: [
  83927. * {
  83928. * attributes: {
  83929. * class: 'c'
  83930. * }
  83931. * }
  83932. * ]
  83933. * } );
  83934. *
  83935. * // Child extension.
  83936. * Template.extend( template.children[ 0 ], {
  83937. * attributes: {
  83938. * class: 'd'
  83939. * }
  83940. * } );
  83941. *
  83942. * the `outerHTML` of `template.render()` is:
  83943. *
  83944. * <p class="a b" data-x="{ observable.foo } { observable.bar }">
  83945. * <span class="b c d">Span</span>
  83946. * </p>
  83947. *
  83948. * @param {module:ui/template~Template} template An existing template instance to be extended.
  83949. * @param {module:ui/template~TemplateDefinition} def Additional definition to be applied to a template.
  83950. */
  83951. static extend( template, def ) {
  83952. if ( template._isRendered ) {
  83953. /**
  83954. * Extending a template after rendering may not work as expected. To make sure
  83955. * the {@link module:ui/template~Template.extend extending} works for an element,
  83956. * make sure it happens before {@link #render} is called.
  83957. *
  83958. * @error template-extend-render
  83959. */
  83960. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  83961. 'template-extend-render',
  83962. [ this, template ]
  83963. );
  83964. }
  83965. extendTemplate( template, normalize( clone( def ) ) );
  83966. }
  83967. /**
  83968. * Renders a DOM Node (either an HTML element or text) out of the template.
  83969. *
  83970. * @protected
  83971. * @param {module:ui/template~RenderData} data Rendering data.
  83972. */
  83973. _renderNode( data ) {
  83974. let isInvalid;
  83975. if ( data.node ) {
  83976. // When applying, a definition cannot have "tag" and "text" at the same time.
  83977. isInvalid = this.tag && this.text;
  83978. } else {
  83979. // When rendering, a definition must have either "tag" or "text": XOR( this.tag, this.text ).
  83980. isInvalid = this.tag ? this.text : !this.text;
  83981. }
  83982. if ( isInvalid ) {
  83983. /**
  83984. * Node definition cannot have the "tag" and "text" properties at the same time.
  83985. * Node definition must have either "tag" or "text" when rendering a new Node.
  83986. *
  83987. * @error ui-template-wrong-syntax
  83988. */
  83989. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  83990. 'ui-template-wrong-syntax',
  83991. this
  83992. );
  83993. }
  83994. if ( this.text ) {
  83995. return this._renderText( data );
  83996. } else {
  83997. return this._renderElement( data );
  83998. }
  83999. }
  84000. /**
  84001. * Renders an HTML element out of the template.
  84002. *
  84003. * @protected
  84004. * @param {module:ui/template~RenderData} data Rendering data.
  84005. */
  84006. _renderElement( data ) {
  84007. let node = data.node;
  84008. if ( !node ) {
  84009. node = data.node = document.createElementNS( this.ns || xhtmlNs, this.tag );
  84010. }
  84011. this._renderAttributes( data );
  84012. this._renderElementChildren( data );
  84013. this._setUpListeners( data );
  84014. return node;
  84015. }
  84016. /**
  84017. * Renders a text node out of {@link module:ui/template~Template#text}.
  84018. *
  84019. * @protected
  84020. * @param {module:ui/template~RenderData} data Rendering data.
  84021. */
  84022. _renderText( data ) {
  84023. let node = data.node;
  84024. // Save the original textContent to revert it in #revert().
  84025. if ( node ) {
  84026. data.revertData.text = node.textContent;
  84027. } else {
  84028. node = data.node = document.createTextNode( '' );
  84029. }
  84030. // Check if this Text Node is bound to Observable. Cases:
  84031. //
  84032. // text: [ Template.bind( ... ).to( ... ) ]
  84033. //
  84034. // text: [
  84035. // 'foo',
  84036. // Template.bind( ... ).to( ... ),
  84037. // ...
  84038. // ]
  84039. //
  84040. if ( hasTemplateBinding( this.text ) ) {
  84041. this._bindToObservable( {
  84042. schema: this.text,
  84043. updater: getTextUpdater( node ),
  84044. data
  84045. } );
  84046. }
  84047. // Simply set text. Cases:
  84048. //
  84049. // text: [ 'all', 'are', 'static' ]
  84050. //
  84051. // text: [ 'foo' ]
  84052. //
  84053. else {
  84054. node.textContent = this.text.join( '' );
  84055. }
  84056. return node;
  84057. }
  84058. /**
  84059. * Renders HTML element attributes out of {@link module:ui/template~Template#attributes}.
  84060. *
  84061. * @protected
  84062. * @param {module:ui/template~RenderData} data Rendering data.
  84063. */
  84064. _renderAttributes( data ) {
  84065. let attrName, attrValue, domAttrValue, attrNs;
  84066. if ( !this.attributes ) {
  84067. return;
  84068. }
  84069. const node = data.node;
  84070. const revertData = data.revertData;
  84071. for ( attrName in this.attributes ) {
  84072. // Current attribute value in DOM.
  84073. domAttrValue = node.getAttribute( attrName );
  84074. // The value to be set.
  84075. attrValue = this.attributes[ attrName ];
  84076. // Save revert data.
  84077. if ( revertData ) {
  84078. revertData.attributes[ attrName ] = domAttrValue;
  84079. }
  84080. // Detect custom namespace:
  84081. //
  84082. // class: {
  84083. // ns: 'abc',
  84084. // value: Template.bind( ... ).to( ... )
  84085. // }
  84086. //
  84087. attrNs = ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["isObject"])( attrValue[ 0 ] ) && attrValue[ 0 ].ns ) ? attrValue[ 0 ].ns : null;
  84088. // Activate binding if one is found. Cases:
  84089. //
  84090. // class: [
  84091. // Template.bind( ... ).to( ... )
  84092. // ]
  84093. //
  84094. // class: [
  84095. // 'bar',
  84096. // Template.bind( ... ).to( ... ),
  84097. // 'baz'
  84098. // ]
  84099. //
  84100. // class: {
  84101. // ns: 'abc',
  84102. // value: Template.bind( ... ).to( ... )
  84103. // }
  84104. //
  84105. if ( hasTemplateBinding( attrValue ) ) {
  84106. // Normalize attributes with additional data like namespace:
  84107. //
  84108. // class: {
  84109. // ns: 'abc',
  84110. // value: [ ... ]
  84111. // }
  84112. //
  84113. const valueToBind = attrNs ? attrValue[ 0 ].value : attrValue;
  84114. // Extend the original value of attributes like "style" and "class",
  84115. // don't override them.
  84116. if ( revertData && shouldExtend( attrName ) ) {
  84117. valueToBind.unshift( domAttrValue );
  84118. }
  84119. this._bindToObservable( {
  84120. schema: valueToBind,
  84121. updater: getAttributeUpdater( node, attrName, attrNs ),
  84122. data
  84123. } );
  84124. }
  84125. // Style attribute could be an Object so it needs to be parsed in a specific way.
  84126. //
  84127. // style: {
  84128. // width: '100px',
  84129. // height: Template.bind( ... ).to( ... )
  84130. // }
  84131. //
  84132. else if ( attrName == 'style' && typeof attrValue[ 0 ] !== 'string' ) {
  84133. this._renderStyleAttribute( attrValue[ 0 ], data );
  84134. }
  84135. // Otherwise simply set the static attribute:
  84136. //
  84137. // class: [ 'foo' ]
  84138. //
  84139. // class: [ 'all', 'are', 'static' ]
  84140. //
  84141. // class: [
  84142. // {
  84143. // ns: 'abc',
  84144. // value: [ 'foo' ]
  84145. // }
  84146. // ]
  84147. //
  84148. else {
  84149. // Extend the original value of attributes like "style" and "class",
  84150. // don't override them.
  84151. if ( revertData && domAttrValue && shouldExtend( attrName ) ) {
  84152. attrValue.unshift( domAttrValue );
  84153. }
  84154. attrValue = attrValue
  84155. // Retrieve "values" from:
  84156. //
  84157. // class: [
  84158. // {
  84159. // ns: 'abc',
  84160. // value: [ ... ]
  84161. // }
  84162. // ]
  84163. //
  84164. .map( val => val ? ( val.value || val ) : val )
  84165. // Flatten the array.
  84166. .reduce( ( prev, next ) => prev.concat( next ), [] )
  84167. // Convert into string.
  84168. .reduce( arrayValueReducer, '' );
  84169. if ( !isFalsy( attrValue ) ) {
  84170. node.setAttributeNS( attrNs, attrName, attrValue );
  84171. }
  84172. }
  84173. }
  84174. }
  84175. /**
  84176. * Renders the `style` attribute of an HTML element based on
  84177. * {@link module:ui/template~Template#attributes}.
  84178. *
  84179. * A style attribute is an {Object} with static values:
  84180. *
  84181. * attributes: {
  84182. * style: {
  84183. * color: 'red'
  84184. * }
  84185. * }
  84186. *
  84187. * or values bound to {@link module:ui/model~Model} properties:
  84188. *
  84189. * attributes: {
  84190. * style: {
  84191. * color: bind.to( ... )
  84192. * }
  84193. * }
  84194. *
  84195. * Note: The `style` attribute is rendered without setting the namespace. It does not seem to be
  84196. * needed.
  84197. *
  84198. * @private
  84199. * @param {Object} styles Styles located in `attributes.style` of {@link module:ui/template~TemplateDefinition}.
  84200. * @param {module:ui/template~RenderData} data Rendering data.
  84201. */
  84202. _renderStyleAttribute( styles, data ) {
  84203. const node = data.node;
  84204. for ( const styleName in styles ) {
  84205. const styleValue = styles[ styleName ];
  84206. // Cases:
  84207. //
  84208. // style: {
  84209. // color: bind.to( 'attribute' )
  84210. // }
  84211. //
  84212. if ( hasTemplateBinding( styleValue ) ) {
  84213. this._bindToObservable( {
  84214. schema: [ styleValue ],
  84215. updater: getStyleUpdater( node, styleName ),
  84216. data
  84217. } );
  84218. }
  84219. // Cases:
  84220. //
  84221. // style: {
  84222. // color: 'red'
  84223. // }
  84224. //
  84225. else {
  84226. node.style[ styleName ] = styleValue;
  84227. }
  84228. }
  84229. }
  84230. /**
  84231. * Recursively renders HTML element's children from {@link module:ui/template~Template#children}.
  84232. *
  84233. * @protected
  84234. * @param {module:ui/template~RenderData} data Rendering data.
  84235. */
  84236. _renderElementChildren( data ) {
  84237. const node = data.node;
  84238. const container = data.intoFragment ? document.createDocumentFragment() : node;
  84239. const isApplying = data.isApplying;
  84240. let childIndex = 0;
  84241. for ( const child of this.children ) {
  84242. if ( isViewCollection( child ) ) {
  84243. if ( !isApplying ) {
  84244. child.setParent( node );
  84245. // Note: ViewCollection renders its children.
  84246. for ( const view of child ) {
  84247. container.appendChild( view.element );
  84248. }
  84249. }
  84250. } else if ( isView( child ) ) {
  84251. if ( !isApplying ) {
  84252. if ( !child.isRendered ) {
  84253. child.render();
  84254. }
  84255. container.appendChild( child.element );
  84256. }
  84257. } else if ( Object(_ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_5__["default"])( child ) ) {
  84258. container.appendChild( child );
  84259. } else {
  84260. if ( isApplying ) {
  84261. const revertData = data.revertData;
  84262. const childRevertData = getEmptyRevertData();
  84263. revertData.children.push( childRevertData );
  84264. child._renderNode( {
  84265. node: container.childNodes[ childIndex++ ],
  84266. isApplying: true,
  84267. revertData: childRevertData
  84268. } );
  84269. } else {
  84270. container.appendChild( child.render() );
  84271. }
  84272. }
  84273. }
  84274. if ( data.intoFragment ) {
  84275. node.appendChild( container );
  84276. }
  84277. }
  84278. /**
  84279. * Activates `on` event listeners from the {@link module:ui/template~TemplateDefinition}
  84280. * on an HTML element.
  84281. *
  84282. * @protected
  84283. * @param {module:ui/template~RenderData} data Rendering data.
  84284. */
  84285. _setUpListeners( data ) {
  84286. if ( !this.eventListeners ) {
  84287. return;
  84288. }
  84289. for ( const key in this.eventListeners ) {
  84290. const revertBindings = this.eventListeners[ key ].map( schemaItem => {
  84291. const [ domEvtName, domSelector ] = key.split( '@' );
  84292. return schemaItem.activateDomEventListener( domEvtName, domSelector, data );
  84293. } );
  84294. if ( data.revertData ) {
  84295. data.revertData.bindings.push( revertBindings );
  84296. }
  84297. }
  84298. }
  84299. /**
  84300. * For a given {@link module:ui/template~TemplateValueSchema} containing {@link module:ui/template~TemplateBinding}
  84301. * activates the binding and sets its initial value.
  84302. *
  84303. * Note: {@link module:ui/template~TemplateValueSchema} can be for HTML element attributes or
  84304. * text node `textContent`.
  84305. *
  84306. * @protected
  84307. * @param {Object} options Binding options.
  84308. * @param {module:ui/template~TemplateValueSchema} options.schema
  84309. * @param {Function} options.updater A function which updates the DOM (like attribute or text).
  84310. * @param {module:ui/template~RenderData} options.data Rendering data.
  84311. */
  84312. _bindToObservable( { schema, updater, data } ) {
  84313. const revertData = data.revertData;
  84314. // Set initial values.
  84315. syncValueSchemaValue( schema, updater, data );
  84316. const revertBindings = schema
  84317. // Filter "falsy" (false, undefined, null, '') value schema components out.
  84318. .filter( item => !isFalsy( item ) )
  84319. // Filter inactive bindings from schema, like static strings ('foo'), numbers (42), etc.
  84320. .filter( item => item.observable )
  84321. // Once only the actual binding are left, let the emitter listen to observable change:attribute event.
  84322. // TODO: Reduce the number of listeners attached as many bindings may listen
  84323. // to the same observable attribute.
  84324. .map( templateBinding => templateBinding.activateAttributeListener( schema, updater, data ) );
  84325. if ( revertData ) {
  84326. revertData.bindings.push( revertBindings );
  84327. }
  84328. }
  84329. /**
  84330. * Reverts {@link module:ui/template~RenderData#revertData template data} from a node to
  84331. * return it to the original state.
  84332. *
  84333. * @protected
  84334. * @param {HTMLElement|Text} node A node to be reverted.
  84335. * @param {Object} revertData An object that stores information about what changes have been made by
  84336. * {@link #apply} to the node. See {@link module:ui/template~RenderData#revertData} for more information.
  84337. */
  84338. _revertTemplateFromNode( node, revertData ) {
  84339. for ( const binding of revertData.bindings ) {
  84340. // Each binding may consist of several observable+observable#attribute.
  84341. // like the following has 2:
  84342. //
  84343. // class: [
  84344. // 'x',
  84345. // bind.to( 'foo' ),
  84346. // 'y',
  84347. // bind.to( 'bar' )
  84348. // ]
  84349. //
  84350. for ( const revertBinding of binding ) {
  84351. revertBinding();
  84352. }
  84353. }
  84354. if ( revertData.text ) {
  84355. node.textContent = revertData.text;
  84356. return;
  84357. }
  84358. for ( const attrName in revertData.attributes ) {
  84359. const attrValue = revertData.attributes[ attrName ];
  84360. // When the attribute has **not** been set before #apply().
  84361. if ( attrValue === null ) {
  84362. node.removeAttribute( attrName );
  84363. } else {
  84364. node.setAttribute( attrName, attrValue );
  84365. }
  84366. }
  84367. for ( let i = 0; i < revertData.children.length; ++i ) {
  84368. this._revertTemplateFromNode( node.childNodes[ i ], revertData.children[ i ] );
  84369. }
  84370. }
  84371. }
  84372. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( Template, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  84373. /**
  84374. * Describes a binding created by the {@link module:ui/template~Template.bind} interface.
  84375. *
  84376. * @protected
  84377. */
  84378. class TemplateBinding {
  84379. /**
  84380. * Creates an instance of the {@link module:ui/template~TemplateBinding} class.
  84381. *
  84382. * @param {module:ui/template~TemplateDefinition} def The definition of the binding.
  84383. */
  84384. constructor( def ) {
  84385. Object.assign( this, def );
  84386. /**
  84387. * An observable instance of the binding. It either:
  84388. *
  84389. * * provides the attribute with the value,
  84390. * * or passes the event when a corresponding DOM event is fired.
  84391. *
  84392. * @member {module:utils/observablemixin~ObservableMixin} module:ui/template~TemplateBinding#observable
  84393. */
  84394. /**
  84395. * An {@link module:utils/emittermixin~Emitter} used by the binding to:
  84396. *
  84397. * * listen to the attribute change in the {@link module:ui/template~TemplateBinding#observable},
  84398. * * or listen to the event in the DOM.
  84399. *
  84400. * @member {module:utils/emittermixin~EmitterMixin} module:ui/template~TemplateBinding#emitter
  84401. */
  84402. /**
  84403. * The name of the {@link module:ui/template~TemplateBinding#observable observed attribute}.
  84404. *
  84405. * @member {String} module:ui/template~TemplateBinding#attribute
  84406. */
  84407. /**
  84408. * A custom function to process the value of the {@link module:ui/template~TemplateBinding#attribute}.
  84409. *
  84410. * @member {Function} [module:ui/template~TemplateBinding#callback]
  84411. */
  84412. }
  84413. /**
  84414. * Returns the value of the binding. It is the value of the {@link module:ui/template~TemplateBinding#attribute} in
  84415. * {@link module:ui/template~TemplateBinding#observable}. The value may be processed by the
  84416. * {@link module:ui/template~TemplateBinding#callback}, if such has been passed to the binding.
  84417. *
  84418. * @param {Node} [node] A native DOM node, passed to the custom {@link module:ui/template~TemplateBinding#callback}.
  84419. * @returns {*} The value of {@link module:ui/template~TemplateBinding#attribute} in
  84420. * {@link module:ui/template~TemplateBinding#observable}.
  84421. */
  84422. getValue( node ) {
  84423. const value = this.observable[ this.attribute ];
  84424. return this.callback ? this.callback( value, node ) : value;
  84425. }
  84426. /**
  84427. * Activates the listener which waits for changes of the {@link module:ui/template~TemplateBinding#attribute} in
  84428. * {@link module:ui/template~TemplateBinding#observable}, then updates the DOM with the aggregated
  84429. * value of {@link module:ui/template~TemplateValueSchema}.
  84430. *
  84431. * @param {module:ui/template~TemplateValueSchema} schema A full schema to generate an attribute or text in the DOM.
  84432. * @param {Function} updater A DOM updater function used to update the native DOM attribute or text.
  84433. * @param {module:ui/template~RenderData} data Rendering data.
  84434. * @returns {Function} A function to sever the listener binding.
  84435. */
  84436. activateAttributeListener( schema, updater, data ) {
  84437. const callback = () => syncValueSchemaValue( schema, updater, data );
  84438. this.emitter.listenTo( this.observable, 'change:' + this.attribute, callback );
  84439. // Allows revert of the listener.
  84440. return () => {
  84441. this.emitter.stopListening( this.observable, 'change:' + this.attribute, callback );
  84442. };
  84443. }
  84444. }
  84445. /**
  84446. * Describes either:
  84447. *
  84448. * * a binding to an {@link module:utils/observablemixin~Observable},
  84449. * * or a native DOM event binding.
  84450. *
  84451. * It is created by the {@link module:ui/template~BindChain#to} method.
  84452. *
  84453. * @protected
  84454. */
  84455. class TemplateToBinding extends TemplateBinding {
  84456. /**
  84457. * Activates the listener for the native DOM event, which when fired, is propagated by
  84458. * the {@link module:ui/template~TemplateBinding#emitter}.
  84459. *
  84460. * @param {String} domEvtName The name of the native DOM event.
  84461. * @param {String} domSelector The selector in the DOM to filter delegated events.
  84462. * @param {module:ui/template~RenderData} data Rendering data.
  84463. * @returns {Function} A function to sever the listener binding.
  84464. */
  84465. activateDomEventListener( domEvtName, domSelector, data ) {
  84466. const callback = ( evt, domEvt ) => {
  84467. if ( !domSelector || domEvt.target.matches( domSelector ) ) {
  84468. if ( typeof this.eventNameOrFunction == 'function' ) {
  84469. this.eventNameOrFunction( domEvt );
  84470. } else {
  84471. this.observable.fire( this.eventNameOrFunction, domEvt );
  84472. }
  84473. }
  84474. };
  84475. this.emitter.listenTo( data.node, domEvtName, callback );
  84476. // Allows revert of the listener.
  84477. return () => {
  84478. this.emitter.stopListening( data.node, domEvtName, callback );
  84479. };
  84480. }
  84481. }
  84482. /**
  84483. * Describes a binding to {@link module:utils/observablemixin~ObservableMixin} created by the {@link module:ui/template~BindChain#if}
  84484. * method.
  84485. *
  84486. * @protected
  84487. */
  84488. class TemplateIfBinding extends TemplateBinding {
  84489. /**
  84490. * @inheritDoc
  84491. */
  84492. getValue( node ) {
  84493. const value = super.getValue( node );
  84494. return isFalsy( value ) ? false : ( this.valueIfTrue || true );
  84495. }
  84496. /**
  84497. * The value of the DOM attribute or text to be set if the {@link module:ui/template~TemplateBinding#attribute} in
  84498. * {@link module:ui/template~TemplateBinding#observable} is `true`.
  84499. *
  84500. * @member {String} [module:ui/template~TemplateIfBinding#valueIfTrue]
  84501. */
  84502. }
  84503. // Checks whether given {@link module:ui/template~TemplateValueSchema} contains a
  84504. // {@link module:ui/template~TemplateBinding}.
  84505. //
  84506. // @param {module:ui/template~TemplateValueSchema} schema
  84507. // @returns {Boolean}
  84508. function hasTemplateBinding( schema ) {
  84509. if ( !schema ) {
  84510. return false;
  84511. }
  84512. // Normalize attributes with additional data like namespace:
  84513. //
  84514. // class: {
  84515. // ns: 'abc',
  84516. // value: [ ... ]
  84517. // }
  84518. //
  84519. if ( schema.value ) {
  84520. schema = schema.value;
  84521. }
  84522. if ( Array.isArray( schema ) ) {
  84523. return schema.some( hasTemplateBinding );
  84524. } else if ( schema instanceof TemplateBinding ) {
  84525. return true;
  84526. }
  84527. return false;
  84528. }
  84529. // Assembles the value using {@link module:ui/template~TemplateValueSchema} and stores it in a form of
  84530. // an Array. Each entry of the Array corresponds to one of {@link module:ui/template~TemplateValueSchema}
  84531. // items.
  84532. //
  84533. // @param {module:ui/template~TemplateValueSchema} schema
  84534. // @param {Node} node DOM Node updated when {@link module:utils/observablemixin~ObservableMixin} changes.
  84535. // @returns {Array}
  84536. function getValueSchemaValue( schema, node ) {
  84537. return schema.map( schemaItem => {
  84538. // Process {@link module:ui/template~TemplateBinding} bindings.
  84539. if ( schemaItem instanceof TemplateBinding ) {
  84540. return schemaItem.getValue( node );
  84541. }
  84542. // All static values like strings, numbers, and "falsy" values (false, null, undefined, '', etc.) just pass.
  84543. return schemaItem;
  84544. } );
  84545. }
  84546. // A function executed each time the bound Observable attribute changes, which updates the DOM with a value
  84547. // constructed from {@link module:ui/template~TemplateValueSchema}.
  84548. //
  84549. // @param {module:ui/template~TemplateValueSchema} schema
  84550. // @param {Function} updater A function which updates the DOM (like attribute or text).
  84551. // @param {Node} node DOM Node updated when {@link module:utils/observablemixin~ObservableMixin} changes.
  84552. function syncValueSchemaValue( schema, updater, { node } ) {
  84553. let value = getValueSchemaValue( schema, node );
  84554. // Check if schema is a single Template.bind.if, like:
  84555. //
  84556. // class: Template.bind.if( 'foo' )
  84557. //
  84558. if ( schema.length == 1 && schema[ 0 ] instanceof TemplateIfBinding ) {
  84559. value = value[ 0 ];
  84560. } else {
  84561. value = value.reduce( arrayValueReducer, '' );
  84562. }
  84563. if ( isFalsy( value ) ) {
  84564. updater.remove();
  84565. } else {
  84566. updater.set( value );
  84567. }
  84568. }
  84569. // Returns an object consisting of `set` and `remove` functions, which
  84570. // can be used in the context of DOM Node to set or reset `textContent`.
  84571. // @see module:ui/view~View#_bindToObservable
  84572. //
  84573. // @param {Node} node DOM Node to be modified.
  84574. // @returns {Object}
  84575. function getTextUpdater( node ) {
  84576. return {
  84577. set( value ) {
  84578. node.textContent = value;
  84579. },
  84580. remove() {
  84581. node.textContent = '';
  84582. }
  84583. };
  84584. }
  84585. // Returns an object consisting of `set` and `remove` functions, which
  84586. // can be used in the context of DOM Node to set or reset an attribute.
  84587. // @see module:ui/view~View#_bindToObservable
  84588. //
  84589. // @param {Node} node DOM Node to be modified.
  84590. // @param {String} attrName Name of the attribute to be modified.
  84591. // @param {String} [ns=null] Namespace to use.
  84592. // @returns {Object}
  84593. function getAttributeUpdater( el, attrName, ns ) {
  84594. return {
  84595. set( value ) {
  84596. el.setAttributeNS( ns, attrName, value );
  84597. },
  84598. remove() {
  84599. el.removeAttributeNS( ns, attrName );
  84600. }
  84601. };
  84602. }
  84603. // Returns an object consisting of `set` and `remove` functions, which
  84604. // can be used in the context of CSSStyleDeclaration to set or remove a style.
  84605. // @see module:ui/view~View#_bindToObservable
  84606. //
  84607. // @param {Node} node DOM Node to be modified.
  84608. // @param {String} styleName Name of the style to be modified.
  84609. // @returns {Object}
  84610. function getStyleUpdater( el, styleName ) {
  84611. return {
  84612. set( value ) {
  84613. el.style[ styleName ] = value;
  84614. },
  84615. remove() {
  84616. el.style[ styleName ] = null;
  84617. }
  84618. };
  84619. }
  84620. // Clones definition of the template.
  84621. //
  84622. // @param {module:ui/template~TemplateDefinition} def
  84623. // @returns {module:ui/template~TemplateDefinition}
  84624. function clone( def ) {
  84625. const clone = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeepWith"])( def, value => {
  84626. // Don't clone the `Template.bind`* bindings because of the references to Observable
  84627. // and DomEmitterMixin instances inside, which would also be traversed and cloned by greedy
  84628. // cloneDeepWith algorithm. There's no point in cloning Observable/DomEmitterMixins
  84629. // along with the definition.
  84630. //
  84631. // Don't clone Template instances if provided as a child. They're simply #render()ed
  84632. // and nothing should interfere.
  84633. //
  84634. // Also don't clone View instances if provided as a child of the Template. The template
  84635. // instance will be extracted from the View during the normalization and there's no need
  84636. // to clone it.
  84637. if ( value && ( value instanceof TemplateBinding || isTemplate( value ) || isView( value ) || isViewCollection( value ) ) ) {
  84638. return value;
  84639. }
  84640. } );
  84641. return clone;
  84642. }
  84643. // Normalizes given {@link module:ui/template~TemplateDefinition}.
  84644. //
  84645. // See:
  84646. // * {@link normalizeAttributes}
  84647. // * {@link normalizeListeners}
  84648. // * {@link normalizePlainTextDefinition}
  84649. // * {@link normalizeTextDefinition}
  84650. //
  84651. // @param {module:ui/template~TemplateDefinition} def
  84652. // @returns {module:ui/template~TemplateDefinition} Normalized definition.
  84653. function normalize( def ) {
  84654. if ( typeof def == 'string' ) {
  84655. def = normalizePlainTextDefinition( def );
  84656. } else if ( def.text ) {
  84657. normalizeTextDefinition( def );
  84658. }
  84659. if ( def.on ) {
  84660. def.eventListeners = normalizeListeners( def.on );
  84661. // Template mixes EmitterMixin, so delete #on to avoid collision.
  84662. delete def.on;
  84663. }
  84664. if ( !def.text ) {
  84665. if ( def.attributes ) {
  84666. normalizeAttributes( def.attributes );
  84667. }
  84668. const children = [];
  84669. if ( def.children ) {
  84670. if ( isViewCollection( def.children ) ) {
  84671. children.push( def.children );
  84672. } else {
  84673. for ( const child of def.children ) {
  84674. if ( isTemplate( child ) || isView( child ) || Object(_ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_5__["default"])( child ) ) {
  84675. children.push( child );
  84676. } else {
  84677. children.push( new Template( child ) );
  84678. }
  84679. }
  84680. }
  84681. }
  84682. def.children = children;
  84683. }
  84684. return def;
  84685. }
  84686. // Normalizes "attributes" section of {@link module:ui/template~TemplateDefinition}.
  84687. //
  84688. // attributes: {
  84689. // a: 'bar',
  84690. // b: {@link module:ui/template~TemplateBinding},
  84691. // c: {
  84692. // value: 'bar'
  84693. // }
  84694. // }
  84695. //
  84696. // becomes
  84697. //
  84698. // attributes: {
  84699. // a: [ 'bar' ],
  84700. // b: [ {@link module:ui/template~TemplateBinding} ],
  84701. // c: {
  84702. // value: [ 'bar' ]
  84703. // }
  84704. // }
  84705. //
  84706. // @param {Object} attributes
  84707. function normalizeAttributes( attributes ) {
  84708. for ( const a in attributes ) {
  84709. if ( attributes[ a ].value ) {
  84710. attributes[ a ].value = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_7__["default"])( attributes[ a ].value );
  84711. }
  84712. arrayify( attributes, a );
  84713. }
  84714. }
  84715. // Normalizes "on" section of {@link module:ui/template~TemplateDefinition}.
  84716. //
  84717. // on: {
  84718. // a: 'bar',
  84719. // b: {@link module:ui/template~TemplateBinding},
  84720. // c: [ {@link module:ui/template~TemplateBinding}, () => { ... } ]
  84721. // }
  84722. //
  84723. // becomes
  84724. //
  84725. // on: {
  84726. // a: [ 'bar' ],
  84727. // b: [ {@link module:ui/template~TemplateBinding} ],
  84728. // c: [ {@link module:ui/template~TemplateBinding}, () => { ... } ]
  84729. // }
  84730. //
  84731. // @param {Object} listeners
  84732. // @returns {Object} Object containing normalized listeners.
  84733. function normalizeListeners( listeners ) {
  84734. for ( const l in listeners ) {
  84735. arrayify( listeners, l );
  84736. }
  84737. return listeners;
  84738. }
  84739. // Normalizes "string" {@link module:ui/template~TemplateDefinition}.
  84740. //
  84741. // "foo"
  84742. //
  84743. // becomes
  84744. //
  84745. // { text: [ 'foo' ] },
  84746. //
  84747. // @param {String} def
  84748. // @returns {module:ui/template~TemplateDefinition} Normalized template definition.
  84749. function normalizePlainTextDefinition( def ) {
  84750. return {
  84751. text: [ def ]
  84752. };
  84753. }
  84754. // Normalizes text {@link module:ui/template~TemplateDefinition}.
  84755. //
  84756. // children: [
  84757. // { text: 'def' },
  84758. // { text: {@link module:ui/template~TemplateBinding} }
  84759. // ]
  84760. //
  84761. // becomes
  84762. //
  84763. // children: [
  84764. // { text: [ 'def' ] },
  84765. // { text: [ {@link module:ui/template~TemplateBinding} ] }
  84766. // ]
  84767. //
  84768. // @param {module:ui/template~TemplateDefinition} def
  84769. function normalizeTextDefinition( def ) {
  84770. def.text = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_7__["default"])( def.text );
  84771. }
  84772. // Wraps an entry in Object in an Array, if not already one.
  84773. //
  84774. // {
  84775. // x: 'y',
  84776. // a: [ 'b' ]
  84777. // }
  84778. //
  84779. // becomes
  84780. //
  84781. // {
  84782. // x: [ 'y' ],
  84783. // a: [ 'b' ]
  84784. // }
  84785. //
  84786. // @param {Object} obj
  84787. // @param {String} key
  84788. function arrayify( obj, key ) {
  84789. obj[ key ] = Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_7__["default"])( obj[ key ] );
  84790. }
  84791. // A helper which concatenates the value avoiding unwanted
  84792. // leading white spaces.
  84793. //
  84794. // @param {String} prev
  84795. // @param {String} cur
  84796. // @returns {String}
  84797. function arrayValueReducer( prev, cur ) {
  84798. if ( isFalsy( cur ) ) {
  84799. return prev;
  84800. } else if ( isFalsy( prev ) ) {
  84801. return cur;
  84802. } else {
  84803. return `${ prev } ${ cur }`;
  84804. }
  84805. }
  84806. // Extends one object defined in the following format:
  84807. //
  84808. // {
  84809. // key1: [Array1],
  84810. // key2: [Array2],
  84811. // ...
  84812. // keyN: [ArrayN]
  84813. // }
  84814. //
  84815. // with another object of the same data format.
  84816. //
  84817. // @param {Object} obj Base object.
  84818. // @param {Object} ext Object extending base.
  84819. // @returns {String}
  84820. function extendObjectValueArray( obj, ext ) {
  84821. for ( const a in ext ) {
  84822. if ( obj[ a ] ) {
  84823. obj[ a ].push( ...ext[ a ] );
  84824. } else {
  84825. obj[ a ] = ext[ a ];
  84826. }
  84827. }
  84828. }
  84829. // A helper for {@link module:ui/template~Template#extend}. Recursively extends {@link module:ui/template~Template} instance
  84830. // with content from {@link module:ui/template~TemplateDefinition}. See {@link module:ui/template~Template#extend} to learn more.
  84831. //
  84832. // @param {module:ui/template~Template} def A template instance to be extended.
  84833. // @param {module:ui/template~TemplateDefinition} def A definition which is to extend the template instance.
  84834. // @param {Object} Error context.
  84835. function extendTemplate( template, def ) {
  84836. if ( def.attributes ) {
  84837. if ( !template.attributes ) {
  84838. template.attributes = {};
  84839. }
  84840. extendObjectValueArray( template.attributes, def.attributes );
  84841. }
  84842. if ( def.eventListeners ) {
  84843. if ( !template.eventListeners ) {
  84844. template.eventListeners = {};
  84845. }
  84846. extendObjectValueArray( template.eventListeners, def.eventListeners );
  84847. }
  84848. if ( def.text ) {
  84849. template.text.push( ...def.text );
  84850. }
  84851. if ( def.children && def.children.length ) {
  84852. if ( template.children.length != def.children.length ) {
  84853. /**
  84854. * The number of children in extended definition does not match.
  84855. *
  84856. * @error ui-template-extend-children-mismatch
  84857. */
  84858. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  84859. 'ui-template-extend-children-mismatch',
  84860. template
  84861. );
  84862. }
  84863. let childIndex = 0;
  84864. for ( const childDef of def.children ) {
  84865. extendTemplate( template.children[ childIndex++ ], childDef );
  84866. }
  84867. }
  84868. }
  84869. // Checks if value is "falsy".
  84870. // Note: 0 (Number) is not "falsy" in this context.
  84871. //
  84872. // @private
  84873. // @param {*} value Value to be checked.
  84874. function isFalsy( value ) {
  84875. return !value && value !== 0;
  84876. }
  84877. // Checks if the item is an instance of {@link module:ui/view~View}
  84878. //
  84879. // @private
  84880. // @param {*} value Value to be checked.
  84881. function isView( item ) {
  84882. return item instanceof _view__WEBPACK_IMPORTED_MODULE_3__["default"];
  84883. }
  84884. // Checks if the item is an instance of {@link module:ui/template~Template}
  84885. //
  84886. // @private
  84887. // @param {*} value Value to be checked.
  84888. function isTemplate( item ) {
  84889. return item instanceof Template;
  84890. }
  84891. // Checks if the item is an instance of {@link module:ui/viewcollection~ViewCollection}
  84892. //
  84893. // @private
  84894. // @param {*} value Value to be checked.
  84895. function isViewCollection( item ) {
  84896. return item instanceof _viewcollection__WEBPACK_IMPORTED_MODULE_4__["default"];
  84897. }
  84898. // Creates an empty skeleton for {@link module:ui/template~Template#revert}
  84899. // data.
  84900. //
  84901. // @private
  84902. function getEmptyRevertData() {
  84903. return {
  84904. children: [],
  84905. bindings: [],
  84906. attributes: {}
  84907. };
  84908. }
  84909. // Checks whether an attribute should be extended when
  84910. // {@link module:ui/template~Template#apply} is called.
  84911. //
  84912. // @private
  84913. // @param {String} attrName Attribute name to check.
  84914. function shouldExtend( attrName ) {
  84915. return attrName == 'class' || attrName == 'style';
  84916. }
  84917. /**
  84918. * A definition of the {@link module:ui/template~Template}. It describes what kind of
  84919. * node a template will render (HTML element or text), attributes of an element, DOM event
  84920. * listeners and children.
  84921. *
  84922. * Also see:
  84923. * * {@link module:ui/template~TemplateValueSchema} to learn about HTML element attributes,
  84924. * * {@link module:ui/template~TemplateListenerSchema} to learn about DOM event listeners.
  84925. *
  84926. * A sample definition on an HTML element can look like this:
  84927. *
  84928. * new Template( {
  84929. * tag: 'p',
  84930. * children: [
  84931. * {
  84932. * tag: 'span',
  84933. * attributes: { ... },
  84934. * children: [ ... ],
  84935. * },
  84936. * {
  84937. * text: 'static–text'
  84938. * },
  84939. * 'also-static–text',
  84940. * ],
  84941. * attributes: {
  84942. * class: {@link module:ui/template~TemplateValueSchema},
  84943. * id: {@link module:ui/template~TemplateValueSchema},
  84944. * style: {@link module:ui/template~TemplateValueSchema}
  84945. *
  84946. * // ...
  84947. * },
  84948. * on: {
  84949. * 'click': {@link module:ui/template~TemplateListenerSchema}
  84950. *
  84951. * // Document.querySelector format is also accepted.
  84952. * 'keyup@a.some-class': {@link module:ui/template~TemplateListenerSchema}
  84953. *
  84954. * // ...
  84955. * }
  84956. * } );
  84957. *
  84958. * A {@link module:ui/view~View}, another {@link module:ui/template~Template} or a native DOM node
  84959. * can also become a child of a template. When a view is passed, its {@link module:ui/view~View#element} is used:
  84960. *
  84961. * const view = new SomeView();
  84962. * const childTemplate = new Template( { ... } );
  84963. * const childNode = document.createElement( 'b' );
  84964. *
  84965. * new Template( {
  84966. * tag: 'p',
  84967. *
  84968. * children: [
  84969. * // view#element will be added as a child of this <p>.
  84970. * view,
  84971. *
  84972. * // The output of childTemplate.render() will be added here.
  84973. * childTemplate,
  84974. *
  84975. * // Native DOM nodes are included directly in the rendered output.
  84976. * childNode
  84977. * ]
  84978. * } );
  84979. *
  84980. * An entire {@link module:ui/viewcollection~ViewCollection} can be used as a child in the definition:
  84981. *
  84982. * const collection = new ViewCollection();
  84983. * collection.add( someView );
  84984. *
  84985. * new Template( {
  84986. * tag: 'p',
  84987. *
  84988. * children: collection
  84989. * } );
  84990. *
  84991. * @typedef module:ui/template~TemplateDefinition
  84992. * @type Object
  84993. *
  84994. * @property {String} tag See the template {@link module:ui/template~Template#tag} property.
  84995. *
  84996. * @property {Array.<module:ui/template~TemplateDefinition>} [children]
  84997. * See the template {@link module:ui/template~Template#children} property.
  84998. *
  84999. * @property {Object.<String, module:ui/template~TemplateValueSchema>} [attributes]
  85000. * See the template {@link module:ui/template~Template#attributes} property.
  85001. *
  85002. * @property {String|module:ui/template~TemplateValueSchema|Array.<String|module:ui/template~TemplateValueSchema>} [text]
  85003. * See the template {@link module:ui/template~Template#text} property.
  85004. *
  85005. * @property {Object.<String, module:ui/template~TemplateListenerSchema>} [on]
  85006. * See the template {@link module:ui/template~Template#eventListeners} property.
  85007. */
  85008. /**
  85009. * Describes a value of an HTML element attribute or `textContent`. It allows combining multiple
  85010. * data sources like static values and {@link module:utils/observablemixin~Observable} attributes.
  85011. *
  85012. * Also see:
  85013. * * {@link module:ui/template~TemplateDefinition} to learn where to use it,
  85014. * * {@link module:ui/template~Template.bind} to learn how to configure
  85015. * {@link module:utils/observablemixin~Observable} attribute bindings,
  85016. * * {@link module:ui/template~Template#render} to learn how to render a template,
  85017. * * {@link module:ui/template~BindChain#to `to()`} and {@link module:ui/template~BindChain#if `if()`}
  85018. * methods to learn more about bindings.
  85019. *
  85020. * Attribute values can be described in many different ways:
  85021. *
  85022. * // Bind helper will create bindings to attributes of the observable.
  85023. * const bind = Template.bind( observable, emitter );
  85024. *
  85025. * new Template( {
  85026. * tag: 'p',
  85027. * attributes: {
  85028. * // A plain string schema.
  85029. * 'class': 'static-text',
  85030. *
  85031. * // An object schema, binds to the "foo" attribute of the
  85032. * // observable and follows its value.
  85033. * 'class': bind.to( 'foo' ),
  85034. *
  85035. * // An array schema, combines the above.
  85036. * 'class': [
  85037. * 'static-text',
  85038. * bind.to( 'bar', () => { ... } ),
  85039. *
  85040. * // Bindings can also be conditional.
  85041. * bind.if( 'baz', 'class-when-baz-is-true' )
  85042. * ],
  85043. *
  85044. * // An array schema, with a custom namespace, e.g. useful for creating SVGs.
  85045. * 'class': {
  85046. * ns: 'http://ns.url',
  85047. * value: [
  85048. * bind.if( 'baz', 'value-when-true' ),
  85049. * 'static-text'
  85050. * ]
  85051. * },
  85052. *
  85053. * // An object schema, specific for styles.
  85054. * style: {
  85055. * color: 'red',
  85056. * backgroundColor: bind.to( 'qux', () => { ... } )
  85057. * }
  85058. * }
  85059. * } );
  85060. *
  85061. * Text nodes can also have complex values:
  85062. *
  85063. * const bind = Template.bind( observable, emitter );
  85064. *
  85065. * // Will render a "foo" text node.
  85066. * new Template( {
  85067. * text: 'foo'
  85068. * } );
  85069. *
  85070. * // Will render a "static text: {observable.foo}" text node.
  85071. * // The text of the node will be updated as the "foo" attribute changes.
  85072. * new Template( {
  85073. * text: [
  85074. * 'static text: ',
  85075. * bind.to( 'foo', () => { ... } )
  85076. * ]
  85077. * } );
  85078. *
  85079. * @typedef module:ui/template~TemplateValueSchema
  85080. * @type {Object|String|Array}
  85081. */
  85082. /**
  85083. * Describes an event listener attached to an HTML element. Such listener can propagate DOM events
  85084. * through an {@link module:utils/observablemixin~Observable} instance, execute custom callbacks
  85085. * or both, if necessary.
  85086. *
  85087. * Also see:
  85088. * * {@link module:ui/template~TemplateDefinition} to learn more about template definitions,
  85089. * * {@link module:ui/template~BindChain#to `to()`} method to learn more about bindings.
  85090. *
  85091. * Check out different ways of attaching event listeners below:
  85092. *
  85093. * // Bind helper will propagate events through the observable.
  85094. * const bind = Template.bind( observable, emitter );
  85095. *
  85096. * new Template( {
  85097. * tag: 'p',
  85098. * on: {
  85099. * // An object schema. The observable will fire the "clicked" event upon DOM "click".
  85100. * click: bind.to( 'clicked' )
  85101. *
  85102. * // An object schema. It will work for "click" event on "a.foo" children only.
  85103. * 'click@a.foo': bind.to( 'clicked' )
  85104. *
  85105. * // An array schema, makes the observable propagate multiple events.
  85106. * click: [
  85107. * bind.to( 'clicked' ),
  85108. * bind.to( 'executed' )
  85109. * ],
  85110. *
  85111. * // An array schema with a custom callback.
  85112. * 'click@a.foo': {
  85113. * bind.to( 'clicked' ),
  85114. * bind.to( evt => {
  85115. * console.log( `${ evt.target } has been clicked!` );
  85116. * } }
  85117. * }
  85118. * }
  85119. * } );
  85120. *
  85121. * @typedef module:ui/template~TemplateListenerSchema
  85122. * @type {Object|String|Array}
  85123. */
  85124. /**
  85125. * The return value of {@link ~Template.bind `Template.bind()`}. It provides `to()` and `if()`
  85126. * methods to create the {@link module:utils/observablemixin~Observable observable} attribute and event bindings.
  85127. *
  85128. * @interface module:ui/template~BindChain
  85129. */
  85130. /**
  85131. * Binds an {@link module:utils/observablemixin~Observable observable} to either:
  85132. *
  85133. * * an HTML element attribute or a text node `textContent`, so it remains in sync with the observable
  85134. * attribute as it changes,
  85135. * * or an HTML element DOM event, so the DOM events are propagated through an observable.
  85136. *
  85137. * Some common use cases of `to()` bindings are presented below:
  85138. *
  85139. * const bind = Template.bind( observable, emitter );
  85140. *
  85141. * new Template( {
  85142. * tag: 'p',
  85143. * attributes: {
  85144. * // class="..." attribute gets bound to `observable#a`
  85145. * class: bind.to( 'a' )
  85146. * },
  85147. * children: [
  85148. * // <p>...</p> gets bound to observable#b; always `toUpperCase()`.
  85149. * {
  85150. * text: bind.to( 'b', ( value, node ) => value.toUpperCase() )
  85151. * }
  85152. * ],
  85153. * on: {
  85154. * click: [
  85155. * // An observable will fire "clicked" upon "click" in the DOM.
  85156. * bind.to( 'clicked' ),
  85157. *
  85158. * // A custom callback will be executed upon "click" in the DOM.
  85159. * bind.to( () => {
  85160. * ...
  85161. * } )
  85162. * ]
  85163. * }
  85164. * } ).render();
  85165. *
  85166. * Learn more about using `to()` in the {@link module:ui/template~TemplateValueSchema} and
  85167. * {@link module:ui/template~TemplateListenerSchema}.
  85168. *
  85169. * @method #to
  85170. * @param {String|Function} eventNameOrFunctionOrAttribute An attribute name of
  85171. * {@link module:utils/observablemixin~Observable} or a DOM event name or an event callback.
  85172. * @param {Function} [callback] Allows for processing of the value. Accepts `Node` and `value` as arguments.
  85173. * @returns {module:ui/template~TemplateBinding}
  85174. */
  85175. /**
  85176. * Binds an {@link module:utils/observablemixin~Observable observable} to an HTML element attribute or a text
  85177. * node `textContent` so it remains in sync with the observable attribute as it changes.
  85178. *
  85179. * Unlike {@link module:ui/template~BindChain#to}, it controls the presence of the attribute or `textContent`
  85180. * depending on the "falseness" of an {@link module:utils/observablemixin~Observable} attribute.
  85181. *
  85182. * const bind = Template.bind( observable, emitter );
  85183. *
  85184. * new Template( {
  85185. * tag: 'input',
  85186. * attributes: {
  85187. * // <input checked> when `observable#a` is not undefined/null/false/''
  85188. * // <input> when `observable#a` is undefined/null/false
  85189. * checked: bind.if( 'a' )
  85190. * },
  85191. * children: [
  85192. * {
  85193. * // <input>"b-is-not-set"</input> when `observable#b` is undefined/null/false/''
  85194. * // <input></input> when `observable#b` is not "falsy"
  85195. * text: bind.if( 'b', 'b-is-not-set', ( value, node ) => !value )
  85196. * }
  85197. * ]
  85198. * } ).render();
  85199. *
  85200. * Learn more about using `if()` in the {@link module:ui/template~TemplateValueSchema}.
  85201. *
  85202. * @method #if
  85203. * @param {String} attribute An attribute name of {@link module:utils/observablemixin~Observable} used in the binding.
  85204. * @param {String} [valueIfTrue] Value set when the {@link module:utils/observablemixin~Observable} attribute is not
  85205. * undefined/null/false/'' (empty string).
  85206. * @param {Function} [callback] Allows for processing of the value. Accepts `Node` and `value` as arguments.
  85207. * @returns {module:ui/template~TemplateBinding}
  85208. */
  85209. /**
  85210. * The {@link module:ui/template~Template#_renderNode} configuration.
  85211. *
  85212. * @private
  85213. * @interface module:ui/template~RenderData
  85214. */
  85215. /**
  85216. * Tells {@link module:ui/template~Template#_renderNode} to render
  85217. * children into `DocumentFragment` first and then append the fragment
  85218. * to the parent element. It is a speed optimization.
  85219. *
  85220. * @member {Boolean} #intoFragment
  85221. */
  85222. /**
  85223. * A node which is being rendered.
  85224. *
  85225. * @member {HTMLElement|Text} #node
  85226. */
  85227. /**
  85228. * Indicates whether the {@module:ui/template~RenderNodeOptions#node} has
  85229. * been provided by {@module:ui/template~Template#apply}.
  85230. *
  85231. * @member {Boolean} #isApplying
  85232. */
  85233. /**
  85234. * An object storing the data that helps {@module:ui/template~Template#revert}
  85235. * bringing back an element to its initial state, i.e. before
  85236. * {@module:ui/template~Template#apply} was called.
  85237. *
  85238. * @member {Object} #revertData
  85239. */
  85240. /***/ }),
  85241. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/balloon/balloontoolbar.js":
  85242. /*!***********************************************************************************!*\
  85243. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/balloon/balloontoolbar.js ***!
  85244. \***********************************************************************************/
  85245. /*! exports provided: default */
  85246. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85247. "use strict";
  85248. __webpack_require__.r(__webpack_exports__);
  85249. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BalloonToolbar; });
  85250. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  85251. /* harmony import */ var _panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../panel/balloon/contextualballoon */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js");
  85252. /* harmony import */ var _toolbarview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../toolbarview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js");
  85253. /* harmony import */ var _panel_balloon_balloonpanelview_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../panel/balloon/balloonpanelview.js */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
  85254. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  85255. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  85256. /* harmony import */ var _normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../normalizetoolbarconfig */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js");
  85257. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  85258. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/resizeobserver */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js");
  85259. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
  85260. /* harmony import */ var _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils */ "./node_modules/@ckeditor/ckeditor5-utils/src/index.js");
  85261. /**
  85262. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  85263. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85264. */
  85265. /**
  85266. * @module ui/toolbar/balloon/balloontoolbar
  85267. */
  85268. const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_9__["default"])( 'px' );
  85269. /**
  85270. * The contextual toolbar.
  85271. *
  85272. * It uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.
  85273. *
  85274. * @extends module:core/plugin~Plugin
  85275. */
  85276. class BalloonToolbar extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  85277. /**
  85278. * @inheritDoc
  85279. */
  85280. static get pluginName() {
  85281. return 'BalloonToolbar';
  85282. }
  85283. /**
  85284. * @inheritDoc
  85285. */
  85286. static get requires() {
  85287. return [ _panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  85288. }
  85289. /**
  85290. * @inheritDoc
  85291. */
  85292. constructor( editor ) {
  85293. super( editor );
  85294. /**
  85295. * A cached and normalized `config.balloonToolbar` object.
  85296. *
  85297. * @type {module:core/editor/editorconfig~EditorConfig#balloonToolbar}
  85298. * @private
  85299. */
  85300. this._balloonConfig = Object(_normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_6__["default"])( editor.config.get( 'balloonToolbar' ) );
  85301. /**
  85302. * The toolbar view displayed in the balloon.
  85303. *
  85304. * @type {module:ui/toolbar/toolbarview~ToolbarView}
  85305. */
  85306. this.toolbarView = this._createToolbarView();
  85307. /**
  85308. * Tracks the focus of the {@link module:core/editor/editorui~EditorUI#getEditableElement editable element}
  85309. * and the {@link #toolbarView}. When both are blurred then the toolbar should hide.
  85310. *
  85311. * @readonly
  85312. * @type {module:utils:focustracker~FocusTracker}
  85313. */
  85314. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_4__["default"]();
  85315. // Wait for the EditorUI#init. EditableElement is not available before.
  85316. editor.ui.once( 'ready', () => {
  85317. this.focusTracker.add( editor.ui.getEditableElement() );
  85318. this.focusTracker.add( this.toolbarView.element );
  85319. } );
  85320. /**
  85321. * An instance of the resize observer that allows to respond to changes in editable's geometry
  85322. * so the toolbar can stay within its boundaries (and group toolbar items that do not fit).
  85323. *
  85324. * **Note**: Used only when `shouldNotGroupWhenFull` was **not** set in the
  85325. * {@link module:core/editor/editorconfig~EditorConfig#balloonToolbar configuration}.
  85326. *
  85327. * **Note:** Created in {@link #init}.
  85328. *
  85329. * @protected
  85330. * @member {module:utils/dom/resizeobserver~ResizeObserver}
  85331. */
  85332. this._resizeObserver = null;
  85333. /**
  85334. * The contextual balloon plugin instance.
  85335. *
  85336. * @private
  85337. * @type {module:ui/panel/balloon/contextualballoon~ContextualBalloon}
  85338. */
  85339. this._balloon = editor.plugins.get( _panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_1__["default"] );
  85340. /**
  85341. * Fires {@link #event:_selectionChangeDebounced} event using `lodash#debounce`.
  85342. *
  85343. * This function is stored as a plugin property to make possible to cancel
  85344. * trailing debounced invocation on destroy.
  85345. *
  85346. * @private
  85347. * @type {Function}
  85348. */
  85349. this._fireSelectionChangeDebounced = Object(lodash_es__WEBPACK_IMPORTED_MODULE_7__["debounce"])( () => this.fire( '_selectionChangeDebounced' ), 200 );
  85350. // The appearance of the BalloonToolbar method is event–driven.
  85351. // It is possible to stop the #show event and this prevent the toolbar from showing up.
  85352. this.decorate( 'show' );
  85353. }
  85354. /**
  85355. * @inheritDoc
  85356. */
  85357. init() {
  85358. const editor = this.editor;
  85359. const selection = editor.model.document.selection;
  85360. // Show/hide the toolbar on editable focus/blur.
  85361. this.listenTo( this.focusTracker, 'change:isFocused', ( evt, name, isFocused ) => {
  85362. const isToolbarVisible = this._balloon.visibleView === this.toolbarView;
  85363. if ( !isFocused && isToolbarVisible ) {
  85364. this.hide();
  85365. } else if ( isFocused ) {
  85366. this.show();
  85367. }
  85368. } );
  85369. // Hide the toolbar when the selection is changed by a direct change or has changed to collapsed.
  85370. this.listenTo( selection, 'change:range', ( evt, data ) => {
  85371. if ( data.directChange || selection.isCollapsed ) {
  85372. this.hide();
  85373. }
  85374. // Fire internal `_selectionChangeDebounced` event to use it for showing
  85375. // the toolbar after the selection stops changing.
  85376. this._fireSelectionChangeDebounced();
  85377. } );
  85378. // Show the toolbar when the selection stops changing.
  85379. this.listenTo( this, '_selectionChangeDebounced', () => {
  85380. if ( this.editor.editing.view.document.isFocused ) {
  85381. this.show();
  85382. }
  85383. } );
  85384. if ( !this._balloonConfig.shouldNotGroupWhenFull ) {
  85385. this.listenTo( editor, 'ready', () => {
  85386. const editableElement = editor.ui.view.editable.element;
  85387. // Set #toolbarView's max-width on the initialization and update it on the editable resize.
  85388. this._resizeObserver = new _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_8__["default"]( editableElement, () => {
  85389. // The max-width equals 90% of the editable's width for the best user experience.
  85390. // The value keeps the balloon very close to the boundaries of the editable and limits the cases
  85391. // when the balloon juts out from the editable element it belongs to.
  85392. this.toolbarView.maxWidth = toPx( new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_5__["default"]( editableElement ).width * .9 );
  85393. } );
  85394. } );
  85395. }
  85396. // Listen to the toolbar view and whenever it changes its geometry due to some items being
  85397. // grouped or ungrouped, update the position of the balloon because a shorter/longer toolbar
  85398. // means the balloon could be pointing at the wrong place. Once updated, the balloon will point
  85399. // at the right selection in the content again.
  85400. // https://github.com/ckeditor/ckeditor5/issues/6444
  85401. this.listenTo( this.toolbarView, 'groupedItemsUpdate', () => {
  85402. this._updatePosition();
  85403. } );
  85404. }
  85405. /**
  85406. * Creates toolbar components based on given configuration.
  85407. * This needs to be done when all plugins are ready.
  85408. *
  85409. * @inheritDoc
  85410. */
  85411. afterInit() {
  85412. const factory = this.editor.ui.componentFactory;
  85413. this.toolbarView.fillFromConfig( this._balloonConfig, factory );
  85414. }
  85415. /**
  85416. * Creates the toolbar view instance.
  85417. *
  85418. * @private
  85419. * @returns {module:ui/toolbar/toolbarview~ToolbarView}
  85420. */
  85421. _createToolbarView() {
  85422. const shouldGroupWhenFull = !this._balloonConfig.shouldNotGroupWhenFull;
  85423. const toolbarView = new _toolbarview__WEBPACK_IMPORTED_MODULE_2__["default"]( this.editor.locale, {
  85424. shouldGroupWhenFull,
  85425. isFloating: true
  85426. } );
  85427. toolbarView.render();
  85428. return toolbarView;
  85429. }
  85430. /**
  85431. * Shows the toolbar and attaches it to the selection.
  85432. *
  85433. * Fires {@link #event:show} event which can be stopped to prevent the toolbar from showing up.
  85434. */
  85435. show() {
  85436. const editor = this.editor;
  85437. const selection = editor.model.document.selection;
  85438. const schema = editor.model.schema;
  85439. // Do not add the toolbar to the balloon stack twice.
  85440. if ( this._balloon.hasView( this.toolbarView ) ) {
  85441. return;
  85442. }
  85443. // Do not show the toolbar when the selection is collapsed.
  85444. if ( selection.isCollapsed ) {
  85445. return;
  85446. }
  85447. // Do not show the toolbar when there is more than one range in the selection and they fully contain selectable elements.
  85448. // See https://github.com/ckeditor/ckeditor5/issues/6443.
  85449. if ( selectionContainsOnlyMultipleSelectables( selection, schema ) ) {
  85450. return;
  85451. }
  85452. // Don not show the toolbar when all components inside are disabled
  85453. // see https://github.com/ckeditor/ckeditor5-ui/issues/269.
  85454. if ( Array.from( this.toolbarView.items ).every( item => item.isEnabled !== undefined && !item.isEnabled ) ) {
  85455. return;
  85456. }
  85457. // Update the toolbar position when the editor ui should be refreshed.
  85458. this.listenTo( this.editor.ui, 'update', () => {
  85459. this._updatePosition();
  85460. } );
  85461. // Add the toolbar to the common editor contextual balloon.
  85462. this._balloon.add( {
  85463. view: this.toolbarView,
  85464. position: this._getBalloonPositionData(),
  85465. balloonClassName: 'ck-toolbar-container'
  85466. } );
  85467. }
  85468. /**
  85469. * Hides the toolbar.
  85470. */
  85471. hide() {
  85472. if ( this._balloon.hasView( this.toolbarView ) ) {
  85473. this.stopListening( this.editor.ui, 'update' );
  85474. this._balloon.remove( this.toolbarView );
  85475. }
  85476. }
  85477. /**
  85478. * Returns positioning options for the {@link #_balloon}. They control the way balloon is attached
  85479. * to the selection.
  85480. *
  85481. * @private
  85482. * @returns {module:utils/dom/position~Options}
  85483. */
  85484. _getBalloonPositionData() {
  85485. const editor = this.editor;
  85486. const view = editor.editing.view;
  85487. const viewDocument = view.document;
  85488. const viewSelection = viewDocument.selection;
  85489. // Get direction of the selection.
  85490. const isBackward = viewDocument.selection.isBackward;
  85491. return {
  85492. // Because the target for BalloonPanelView is a Rect (not DOMRange), it's geometry will stay fixed
  85493. // as the window scrolls. To let the BalloonPanelView follow such Rect, is must be continuously
  85494. // computed and hence, the target is defined as a function instead of a static value.
  85495. // https://github.com/ckeditor/ckeditor5-ui/issues/195
  85496. target: () => {
  85497. const range = isBackward ? viewSelection.getFirstRange() : viewSelection.getLastRange();
  85498. const rangeRects = _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_5__["default"].getDomRangeRects( view.domConverter.viewRangeToDom( range ) );
  85499. // Select the proper range rect depending on the direction of the selection.
  85500. if ( isBackward ) {
  85501. return rangeRects[ 0 ];
  85502. } else {
  85503. // Ditch the zero-width "orphan" rect in the next line for the forward selection if there's
  85504. // another one preceding it. It is not rendered as a selection by the web browser anyway.
  85505. // https://github.com/ckeditor/ckeditor5-ui/issues/308
  85506. if ( rangeRects.length > 1 && rangeRects[ rangeRects.length - 1 ].width === 0 ) {
  85507. rangeRects.pop();
  85508. }
  85509. return rangeRects[ rangeRects.length - 1 ];
  85510. }
  85511. },
  85512. positions: this._getBalloonPositions( isBackward )
  85513. };
  85514. }
  85515. /**
  85516. * Updates the position of the {@link #_balloon} to make up for changes:
  85517. *
  85518. * * in the geometry of the selection it is attached to (e.g. the selection moved in the viewport or expanded or shrunk),
  85519. * * or the geometry of the balloon toolbar itself (e.g. the toolbar has grouped or ungrouped some items and it is shorter or longer).
  85520. *
  85521. * @private
  85522. */
  85523. _updatePosition() {
  85524. this._balloon.updatePosition( this._getBalloonPositionData() );
  85525. }
  85526. /**
  85527. * @inheritDoc
  85528. */
  85529. destroy() {
  85530. super.destroy();
  85531. this.stopListening();
  85532. this._fireSelectionChangeDebounced.cancel();
  85533. this.toolbarView.destroy();
  85534. this.focusTracker.destroy();
  85535. if ( this._resizeObserver ) {
  85536. this._resizeObserver.destroy();
  85537. }
  85538. }
  85539. /**
  85540. * This event is fired just before the toolbar shows up. Stopping this event will prevent this.
  85541. *
  85542. * @event show
  85543. */
  85544. /**
  85545. * This is internal plugin event which is fired 200 ms after model selection last change.
  85546. * This is to makes easy test debounced action without need to use `setTimeout`.
  85547. *
  85548. * @protected
  85549. * @event _selectionChangeDebounced
  85550. */
  85551. /**
  85552. * Returns toolbar positions for the given direction of the selection.
  85553. *
  85554. * @private
  85555. * @param {Boolean} isBackward
  85556. * @returns {Array.<module:utils/dom/position~Position>}
  85557. */
  85558. _getBalloonPositions( isBackward ) {
  85559. const isSafariIniOS = _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_10__["env"].isSafari && _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_10__["env"].isiOS;
  85560. // https://github.com/ckeditor/ckeditor5/issues/7707
  85561. const positions = isSafariIniOS ? Object(_panel_balloon_balloonpanelview_js__WEBPACK_IMPORTED_MODULE_3__["generatePositions"])( {
  85562. // 20px when zoomed out. Less then 20px when zoomed in; the "radius" of the native selection handle gets
  85563. // smaller as the user zooms in. No less than the default v-offset, though.
  85564. verticalOffset: Math.max(
  85565. _panel_balloon_balloonpanelview_js__WEBPACK_IMPORTED_MODULE_3__["default"].arrowVerticalOffset,
  85566. Math.round( 20 / _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_10__["global"].window.visualViewport.scale )
  85567. )
  85568. } ) : _panel_balloon_balloonpanelview_js__WEBPACK_IMPORTED_MODULE_3__["default"].defaultPositions;
  85569. return isBackward ? [
  85570. positions.northWestArrowSouth,
  85571. positions.northWestArrowSouthWest,
  85572. positions.northWestArrowSouthEast,
  85573. positions.northWestArrowSouthMiddleEast,
  85574. positions.northWestArrowSouthMiddleWest,
  85575. positions.southWestArrowNorth,
  85576. positions.southWestArrowNorthWest,
  85577. positions.southWestArrowNorthEast,
  85578. positions.southWestArrowNorthMiddleWest,
  85579. positions.southWestArrowNorthMiddleEast
  85580. ] : [
  85581. positions.southEastArrowNorth,
  85582. positions.southEastArrowNorthEast,
  85583. positions.southEastArrowNorthWest,
  85584. positions.southEastArrowNorthMiddleEast,
  85585. positions.southEastArrowNorthMiddleWest,
  85586. positions.northEastArrowSouth,
  85587. positions.northEastArrowSouthEast,
  85588. positions.northEastArrowSouthWest,
  85589. positions.northEastArrowSouthMiddleEast,
  85590. positions.northEastArrowSouthMiddleWest
  85591. ];
  85592. }
  85593. }
  85594. // Returns "true" when the selection has multiple ranges and each range contains a selectable element
  85595. // and nothing else.
  85596. //
  85597. // @private
  85598. // @param {module:engine/model/selection~Selection} selection
  85599. // @param {module:engine/model/schema~Schema} schema
  85600. // @returns {Boolean}
  85601. function selectionContainsOnlyMultipleSelectables( selection, schema ) {
  85602. // It doesn't contain multiple objects if there is only one range.
  85603. if ( selection.rangeCount === 1 ) {
  85604. return false;
  85605. }
  85606. return [ ...selection.getRanges() ].every( range => {
  85607. const element = range.getContainedElement();
  85608. return element && schema.isSelectable( element );
  85609. } );
  85610. }
  85611. /**
  85612. * Contextual toolbar configuration. Used by the {@link module:ui/toolbar/balloon/balloontoolbar~BalloonToolbar}
  85613. * feature.
  85614. *
  85615. * ## Configuring toolbar items
  85616. *
  85617. * const config = {
  85618. * balloonToolbar: [ 'bold', 'italic', 'undo', 'redo' ]
  85619. * };
  85620. *
  85621. * You can also use `'|'` to create a separator between groups of items:
  85622. *
  85623. * const config = {
  85624. * balloonToolbar: [ 'bold', 'italic', | 'undo', 'redo' ]
  85625. * };
  85626. *
  85627. * Read also about configuring the main editor toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
  85628. *
  85629. * ## Configuring items grouping
  85630. *
  85631. * You can prevent automatic items grouping by setting the `shouldNotGroupWhenFull` option:
  85632. *
  85633. * const config = {
  85634. * balloonToolbar: {
  85635. * items: [ 'bold', 'italic', 'undo', 'redo' ],
  85636. * shouldNotGroupWhenFull: true
  85637. * },
  85638. * };
  85639. *
  85640. * @member {Array.<String>|Object} module:core/editor/editorconfig~EditorConfig#balloonToolbar
  85641. */
  85642. /***/ }),
  85643. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blockbuttonview.js":
  85644. /*!**********************************************************************************!*\
  85645. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blockbuttonview.js ***!
  85646. \**********************************************************************************/
  85647. /*! exports provided: default */
  85648. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85649. "use strict";
  85650. __webpack_require__.r(__webpack_exports__);
  85651. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockButtonView; });
  85652. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  85653. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
  85654. /* harmony import */ var _theme_components_toolbar_blocktoolbar_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../theme/components/toolbar/blocktoolbar.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css");
  85655. /**
  85656. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  85657. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85658. */
  85659. /**
  85660. * @module ui/toolbar/block/blockbuttonview
  85661. */
  85662. const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_1__["default"])( 'px' );
  85663. /**
  85664. * The block button view class.
  85665. *
  85666. * This view represents a button attached next to block element where the selection is anchored.
  85667. *
  85668. * See {@link module:ui/toolbar/block/blocktoolbar~BlockToolbar}.
  85669. *
  85670. * @extends {module:ui/button/buttonview~ButtonView}
  85671. */
  85672. class BlockButtonView extends _button_buttonview__WEBPACK_IMPORTED_MODULE_0__["default"] {
  85673. /**
  85674. * @inheritDoc
  85675. */
  85676. constructor( locale ) {
  85677. super( locale );
  85678. const bind = this.bindTemplate;
  85679. // Hide button on init.
  85680. this.isVisible = false;
  85681. this.isToggleable = true;
  85682. /**
  85683. * Top offset.
  85684. *
  85685. * @member {Number} #top
  85686. */
  85687. this.set( 'top', 0 );
  85688. /**
  85689. * Left offset.
  85690. *
  85691. * @member {Number} #left
  85692. */
  85693. this.set( 'left', 0 );
  85694. this.extendTemplate( {
  85695. attributes: {
  85696. class: 'ck-block-toolbar-button',
  85697. style: {
  85698. top: bind.to( 'top', val => toPx( val ) ),
  85699. left: bind.to( 'left', val => toPx( val ) )
  85700. }
  85701. }
  85702. } );
  85703. }
  85704. }
  85705. /***/ }),
  85706. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blocktoolbar.js":
  85707. /*!*******************************************************************************!*\
  85708. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blocktoolbar.js ***!
  85709. \*******************************************************************************/
  85710. /*! exports provided: default */
  85711. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85712. "use strict";
  85713. __webpack_require__.r(__webpack_exports__);
  85714. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockToolbar; });
  85715. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  85716. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_pilcrow_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/pilcrow.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg");
  85717. /* harmony import */ var _blockbuttonview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./blockbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blockbuttonview.js");
  85718. /* harmony import */ var _panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../panel/balloon/balloonpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
  85719. /* harmony import */ var _toolbarview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../toolbarview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js");
  85720. /* harmony import */ var _bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../bindings/clickoutsidehandler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js");
  85721. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/position */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js");
  85722. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  85723. /* harmony import */ var _normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../normalizetoolbarconfig */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js");
  85724. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/resizeobserver */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js");
  85725. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
  85726. /**
  85727. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  85728. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85729. */
  85730. /**
  85731. * @module ui/toolbar/block/blocktoolbar
  85732. */
  85733. /* global window */
  85734. const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_10__["default"])( 'px' );
  85735. /**
  85736. * The block toolbar plugin.
  85737. *
  85738. * This plugin provides a button positioned next to the block of content where the selection is anchored.
  85739. * Upon clicking the button, a dropdown providing access to editor features shows up, as configured in
  85740. * {@link module:core/editor/editorconfig~EditorConfig#blockToolbar}.
  85741. *
  85742. * By default, the button is displayed next to all elements marked in {@link module:engine/model/schema~Schema}
  85743. * as `$block` for which the toolbar provides at least one option.
  85744. *
  85745. * By default, the button is attached so its right boundary is touching the
  85746. * {@link module:engine/view/editableelement~EditableElement}:
  85747. *
  85748. * __ |
  85749. * | || This is a block of content that the
  85750. * ¯¯ | button is attached to. This is a
  85751. * | block of content that the button is
  85752. * | attached to.
  85753. *
  85754. * The position of the button can be adjusted using the CSS `transform` property:
  85755. *
  85756. * .ck-block-toolbar-button {
  85757. * transform: translateX( -10px );
  85758. * }
  85759. *
  85760. * __ |
  85761. * | | | This is a block of content that the
  85762. * ¯¯ | button is attached to. This is a
  85763. * | block of content that the button is
  85764. * | attached to.
  85765. *
  85766. * **Note**: If you plan to run the editor in a right–to–left (RTL) language, keep in mind the button
  85767. * will be attached to the **right** boundary of the editable area. In that case, make sure the
  85768. * CSS position adjustment works properly by adding the following styles:
  85769. *
  85770. * .ck[dir="rtl"] .ck-block-toolbar-button {
  85771. * transform: translateX( 10px );
  85772. * }
  85773. *
  85774. * @extends module:core/plugin~Plugin
  85775. */
  85776. class BlockToolbar extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  85777. /**
  85778. * @inheritDoc
  85779. */
  85780. static get pluginName() {
  85781. return 'BlockToolbar';
  85782. }
  85783. /**
  85784. * @inheritDoc
  85785. */
  85786. constructor( editor ) {
  85787. super( editor );
  85788. /**
  85789. * A cached and normalized `config.blockToolbar` object.
  85790. *
  85791. * @type {module:core/editor/editorconfig~EditorConfig#blockToolbar}
  85792. * @private
  85793. */
  85794. this._blockToolbarConfig = Object(_normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_8__["default"])( this.editor.config.get( 'blockToolbar' ) );
  85795. /**
  85796. * The toolbar view.
  85797. *
  85798. * @type {module:ui/toolbar/toolbarview~ToolbarView}
  85799. */
  85800. this.toolbarView = this._createToolbarView();
  85801. /**
  85802. * The balloon panel view, containing the {@link #toolbarView}.
  85803. *
  85804. * @type {module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
  85805. */
  85806. this.panelView = this._createPanelView();
  85807. /**
  85808. * The button view that opens the {@link #toolbarView}.
  85809. *
  85810. * @type {module:ui/toolbar/block/blockbuttonview~BlockButtonView}
  85811. */
  85812. this.buttonView = this._createButtonView();
  85813. /**
  85814. * An instance of the resize observer that allows to respond to changes in editable's geometry
  85815. * so the toolbar can stay within its boundaries (and group toolbar items that do not fit).
  85816. *
  85817. * **Note**: Used only when `shouldNotGroupWhenFull` was **not** set in the
  85818. * {@link module:core/editor/editorconfig~EditorConfig#blockToolbar configuration}.
  85819. *
  85820. * **Note:** Created in {@link #afterInit}.
  85821. *
  85822. * @protected
  85823. * @member {module:utils/dom/resizeobserver~ResizeObserver}
  85824. */
  85825. this._resizeObserver = null;
  85826. // Close the #panelView upon clicking outside of the plugin UI.
  85827. Object(_bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_5__["default"])( {
  85828. emitter: this.panelView,
  85829. contextElements: [ this.panelView.element, this.buttonView.element ],
  85830. activator: () => this.panelView.isVisible,
  85831. callback: () => this._hidePanel()
  85832. } );
  85833. }
  85834. /**
  85835. * @inheritDoc
  85836. */
  85837. init() {
  85838. const editor = this.editor;
  85839. // Hides panel on a direct selection change.
  85840. this.listenTo( editor.model.document.selection, 'change:range', ( evt, data ) => {
  85841. if ( data.directChange ) {
  85842. this._hidePanel();
  85843. }
  85844. } );
  85845. this.listenTo( editor.ui, 'update', () => this._updateButton() );
  85846. // `low` priority is used because of https://github.com/ckeditor/ckeditor5-core/issues/133.
  85847. this.listenTo( editor, 'change:isReadOnly', () => this._updateButton(), { priority: 'low' } );
  85848. this.listenTo( editor.ui.focusTracker, 'change:isFocused', () => this._updateButton() );
  85849. // Reposition button on resize.
  85850. this.listenTo( this.buttonView, 'change:isVisible', ( evt, name, isVisible ) => {
  85851. if ( isVisible ) {
  85852. // Keep correct position of button and panel on window#resize.
  85853. this.buttonView.listenTo( window, 'resize', () => this._updateButton() );
  85854. } else {
  85855. // Stop repositioning button when is hidden.
  85856. this.buttonView.stopListening( window, 'resize' );
  85857. // Hide the panel when the button disappears.
  85858. this._hidePanel();
  85859. }
  85860. } );
  85861. }
  85862. /**
  85863. * Fills the toolbar with its items based on the configuration.
  85864. *
  85865. * **Note:** This needs to be done after all plugins are ready.
  85866. *
  85867. * @inheritDoc
  85868. */
  85869. afterInit() {
  85870. const factory = this.editor.ui.componentFactory;
  85871. const config = this._blockToolbarConfig;
  85872. this.toolbarView.fillFromConfig( config, factory );
  85873. // Hide panel before executing each button in the panel.
  85874. for ( const item of this.toolbarView.items ) {
  85875. item.on( 'execute', () => this._hidePanel( true ), { priority: 'high' } );
  85876. }
  85877. if ( !config.shouldNotGroupWhenFull ) {
  85878. this.listenTo( this.editor, 'ready', () => {
  85879. const editableElement = this.editor.ui.view.editable.element;
  85880. // Set #toolbarView's max-width just after the initialization and update it on the editable resize.
  85881. this._resizeObserver = new _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_9__["default"]( editableElement, () => {
  85882. this.toolbarView.maxWidth = this._getToolbarMaxWidth();
  85883. } );
  85884. } );
  85885. }
  85886. }
  85887. /**
  85888. * @inheritDoc
  85889. */
  85890. destroy() {
  85891. super.destroy();
  85892. // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).
  85893. this.panelView.destroy();
  85894. this.buttonView.destroy();
  85895. this.toolbarView.destroy();
  85896. if ( this._resizeObserver ) {
  85897. this._resizeObserver.destroy();
  85898. }
  85899. }
  85900. /**
  85901. * Creates the {@link #toolbarView}.
  85902. *
  85903. * @private
  85904. * @returns {module:ui/toolbar/toolbarview~ToolbarView}
  85905. */
  85906. _createToolbarView() {
  85907. const shouldGroupWhenFull = !this._blockToolbarConfig.shouldNotGroupWhenFull;
  85908. const toolbarView = new _toolbarview__WEBPACK_IMPORTED_MODULE_4__["default"]( this.editor.locale, {
  85909. shouldGroupWhenFull,
  85910. isFloating: true
  85911. } );
  85912. // When toolbar lost focus then panel should hide.
  85913. toolbarView.focusTracker.on( 'change:isFocused', ( evt, name, is ) => {
  85914. if ( !is ) {
  85915. this._hidePanel();
  85916. }
  85917. } );
  85918. return toolbarView;
  85919. }
  85920. /**
  85921. * Creates the {@link #panelView}.
  85922. *
  85923. * @private
  85924. * @returns {module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
  85925. */
  85926. _createPanelView() {
  85927. const editor = this.editor;
  85928. const panelView = new _panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_3__["default"]( editor.locale );
  85929. panelView.content.add( this.toolbarView );
  85930. panelView.class = 'ck-toolbar-container';
  85931. editor.ui.view.body.add( panelView );
  85932. editor.ui.focusTracker.add( panelView.element );
  85933. // Close #panelView on `Esc` press.
  85934. this.toolbarView.keystrokes.set( 'Esc', ( evt, cancel ) => {
  85935. this._hidePanel( true );
  85936. cancel();
  85937. } );
  85938. return panelView;
  85939. }
  85940. /**
  85941. * Creates the {@link #buttonView}.
  85942. *
  85943. * @private
  85944. * @returns {module:ui/toolbar/block/blockbuttonview~BlockButtonView}
  85945. */
  85946. _createButtonView() {
  85947. const editor = this.editor;
  85948. const t = editor.t;
  85949. const buttonView = new _blockbuttonview__WEBPACK_IMPORTED_MODULE_2__["default"]( editor.locale );
  85950. buttonView.set( {
  85951. label: t( 'Edit block' ),
  85952. icon: _ckeditor_ckeditor5_core_theme_icons_pilcrow_svg__WEBPACK_IMPORTED_MODULE_1__["default"],
  85953. withText: false
  85954. } );
  85955. // Bind the panelView observable properties to the buttonView.
  85956. buttonView.bind( 'isOn' ).to( this.panelView, 'isVisible' );
  85957. buttonView.bind( 'tooltip' ).to( this.panelView, 'isVisible', isVisible => !isVisible );
  85958. // Toggle the panelView upon buttonView#execute.
  85959. this.listenTo( buttonView, 'execute', () => {
  85960. if ( !this.panelView.isVisible ) {
  85961. this._showPanel();
  85962. } else {
  85963. this._hidePanel( true );
  85964. }
  85965. } );
  85966. editor.ui.view.body.add( buttonView );
  85967. editor.ui.focusTracker.add( buttonView.element );
  85968. return buttonView;
  85969. }
  85970. /**
  85971. * Shows or hides the button.
  85972. * When all the conditions for displaying the button are matched, it shows the button. Hides otherwise.
  85973. *
  85974. * @private
  85975. */
  85976. _updateButton() {
  85977. const editor = this.editor;
  85978. const model = editor.model;
  85979. const view = editor.editing.view;
  85980. // Hides the button when the editor is not focused.
  85981. if ( !editor.ui.focusTracker.isFocused ) {
  85982. this._hideButton();
  85983. return;
  85984. }
  85985. // Hides the button when the editor switches to the read-only mode.
  85986. if ( editor.isReadOnly ) {
  85987. this._hideButton();
  85988. return;
  85989. }
  85990. // Get the first selected block, button will be attached to this element.
  85991. const modelTarget = Array.from( model.document.selection.getSelectedBlocks() )[ 0 ];
  85992. // Hides the button when there is no enabled item in toolbar for the current block element.
  85993. if ( !modelTarget || Array.from( this.toolbarView.items ).every( item => !item.isEnabled ) ) {
  85994. this._hideButton();
  85995. return;
  85996. }
  85997. // Get DOM target element.
  85998. const domTarget = view.domConverter.mapViewToDom( editor.editing.mapper.toViewElement( modelTarget ) );
  85999. // Show block button.
  86000. this.buttonView.isVisible = true;
  86001. // Attach block button to target DOM element.
  86002. this._attachButtonToElement( domTarget );
  86003. // When panel is opened then refresh it position to be properly aligned with block button.
  86004. if ( this.panelView.isVisible ) {
  86005. this._showPanel();
  86006. }
  86007. }
  86008. /**
  86009. * Hides the button.
  86010. *
  86011. * @private
  86012. */
  86013. _hideButton() {
  86014. this.buttonView.isVisible = false;
  86015. }
  86016. /**
  86017. * Shows the {@link #toolbarView} attached to the {@link #buttonView}.
  86018. * If the toolbar is already visible, then it simply repositions it.
  86019. *
  86020. * @private
  86021. */
  86022. _showPanel() {
  86023. const wasVisible = this.panelView.isVisible;
  86024. // So here's the thing: If there was no initial panelView#show() or these two were in different order, the toolbar
  86025. // positioning will break in RTL editors. Weird, right? What you show know is that the toolbar
  86026. // grouping works thanks to:
  86027. //
  86028. // * the ResizeObserver, which kicks in as soon as the toolbar shows up in DOM (becomes visible again).
  86029. // * the observable ToolbarView#maxWidth, which triggers re-grouping when changed.
  86030. //
  86031. // Here are the possible scenarios:
  86032. //
  86033. // 1. (WRONG ❌) If the #maxWidth is set when the toolbar is invisible, it won't affect item grouping (no DOMRects, no grouping).
  86034. // Then, when panelView.pin() is called, the position of the toolbar will be calculated for the old
  86035. // items grouping state, and when finally ResizeObserver kicks in (hey, the toolbar is visible now, right?)
  86036. // it will group/ungroup some items and the length of the toolbar will change. But since in RTL the toolbar
  86037. // is attached on the right side and the positioning uses CSS "left", it will result in the toolbar shifting
  86038. // to the left and being displayed in the wrong place.
  86039. // 2. (WRONG ❌) If the panelView.pin() is called first and #maxWidth set next, then basically the story repeats. The balloon
  86040. // calculates the position for the old toolbar grouping state, then the toolbar re-groups items and because
  86041. // it is positioned using CSS "left" it will move.
  86042. // 3. (RIGHT ✅) We show the panel first (the toolbar does re-grouping but it does not matter), then the #maxWidth
  86043. // is set allowing the toolbar to re-group again and finally panelView.pin() does the positioning when the
  86044. // items grouping state is stable and final.
  86045. //
  86046. // https://github.com/ckeditor/ckeditor5/issues/6449, https://github.com/ckeditor/ckeditor5/issues/6575
  86047. this.panelView.show();
  86048. this.toolbarView.maxWidth = this._getToolbarMaxWidth();
  86049. this.panelView.pin( {
  86050. target: this.buttonView.element,
  86051. limiter: this.editor.ui.getEditableElement()
  86052. } );
  86053. if ( !wasVisible ) {
  86054. this.toolbarView.items.get( 0 ).focus();
  86055. }
  86056. }
  86057. /**
  86058. * Hides the {@link #toolbarView}.
  86059. *
  86060. * @private
  86061. * @param {Boolean} [focusEditable=false] When `true`, the editable will be focused after hiding the panel.
  86062. */
  86063. _hidePanel( focusEditable ) {
  86064. this.panelView.isVisible = false;
  86065. if ( focusEditable ) {
  86066. this.editor.editing.view.focus();
  86067. }
  86068. }
  86069. /**
  86070. * Attaches the {@link #buttonView} to the target block of content.
  86071. *
  86072. * @protected
  86073. * @param {HTMLElement} targetElement Target element.
  86074. */
  86075. _attachButtonToElement( targetElement ) {
  86076. const contentStyles = window.getComputedStyle( targetElement );
  86077. const editableRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_7__["default"]( this.editor.ui.getEditableElement() );
  86078. const contentPaddingTop = parseInt( contentStyles.paddingTop, 10 );
  86079. // When line height is not an integer then thread it as "normal".
  86080. // MDN says that 'normal' == ~1.2 on desktop browsers.
  86081. const contentLineHeight = parseInt( contentStyles.lineHeight, 10 ) || parseInt( contentStyles.fontSize, 10 ) * 1.2;
  86082. const position = Object(_ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_6__["getOptimalPosition"])( {
  86083. element: this.buttonView.element,
  86084. target: targetElement,
  86085. positions: [
  86086. ( contentRect, buttonRect ) => {
  86087. let left;
  86088. if ( this.editor.locale.uiLanguageDirection === 'ltr' ) {
  86089. left = editableRect.left - buttonRect.width;
  86090. } else {
  86091. left = editableRect.right;
  86092. }
  86093. return {
  86094. top: contentRect.top + contentPaddingTop + ( contentLineHeight - buttonRect.height ) / 2,
  86095. left
  86096. };
  86097. }
  86098. ]
  86099. } );
  86100. this.buttonView.top = position.top;
  86101. this.buttonView.left = position.left;
  86102. }
  86103. /**
  86104. * Gets the {@link #toolbarView} max-width, based on
  86105. * editable width plus distance between farthest edge of the {@link #buttonView} and the editable.
  86106. *
  86107. * @private
  86108. * @returns {String} maxWidth A maximum width that toolbar can have, in pixels.
  86109. */
  86110. _getToolbarMaxWidth() {
  86111. const editableElement = this.editor.ui.view.editable.element;
  86112. const editableRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_7__["default"]( editableElement );
  86113. const buttonRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_7__["default"]( this.buttonView.element );
  86114. const isRTL = this.editor.locale.uiLanguageDirection === 'rtl';
  86115. const offset = isRTL ? ( buttonRect.left - editableRect.right ) + buttonRect.width : editableRect.left - buttonRect.left;
  86116. return toPx( editableRect.width + offset );
  86117. }
  86118. }
  86119. /**
  86120. * The block toolbar configuration. Used by the {@link module:ui/toolbar/block/blocktoolbar~BlockToolbar}
  86121. * feature.
  86122. *
  86123. * const config = {
  86124. * blockToolbar: [ 'paragraph', 'heading1', 'heading2', 'bulletedList', 'numberedList' ]
  86125. * };
  86126. *
  86127. * You can also use `'|'` to create a separator between groups of items:
  86128. *
  86129. * const config = {
  86130. * blockToolbar: [ 'paragraph', 'heading1', 'heading2', '|', 'bulletedList', 'numberedList' ]
  86131. * };
  86132. *
  86133. * ## Configuring items grouping
  86134. *
  86135. * You can prevent automatic items grouping by setting the `shouldNotGroupWhenFull` option:
  86136. *
  86137. * const config = {
  86138. * blockToolbar: {
  86139. * items: [ 'paragraph', 'heading1', 'heading2', '|', 'bulletedList', 'numberedList' ],
  86140. * shouldNotGroupWhenFull: true
  86141. * },
  86142. * };
  86143. *
  86144. * Read more about configuring the main editor toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
  86145. *
  86146. * @member {Array.<String>|Object} module:core/editor/editorconfig~EditorConfig#blockToolbar
  86147. */
  86148. /***/ }),
  86149. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus.js":
  86150. /*!***************************************************************************************!*\
  86151. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus.js ***!
  86152. \***************************************************************************************/
  86153. /*! exports provided: default */
  86154. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  86155. "use strict";
  86156. __webpack_require__.r(__webpack_exports__);
  86157. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return enableToolbarKeyboardFocus; });
  86158. /**
  86159. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  86160. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  86161. */
  86162. /**
  86163. * @module ui/toolbar/enabletoolbarkeyboardfocus
  86164. */
  86165. /**
  86166. * Enables focus/blur toolbar navigation using `Alt+F10` and `Esc` keystrokes.
  86167. *
  86168. * @param {Object} options Options of the utility.
  86169. * @param {*} options.origin A view to which the focus will return when `Esc` is pressed and
  86170. * `options.toolbar` is focused.
  86171. * @param {module:utils/keystrokehandler~KeystrokeHandler} options.originKeystrokeHandler A keystroke
  86172. * handler to register `Alt+F10` keystroke.
  86173. * @param {module:utils/focustracker~FocusTracker} options.originFocusTracker A focus tracker
  86174. * for `options.origin`.
  86175. * @param {module:ui/toolbar/toolbarview~ToolbarView} options.toolbar A toolbar which is to gain
  86176. * focus when `Alt+F10` is pressed.
  86177. * @param {Function} [options.beforeFocus] A callback executed before the `options.toolbar` gains focus
  86178. * upon the `Alt+F10` keystroke.
  86179. * @param {Function} [options.afterBlur] A callback executed after `options.toolbar` loses focus upon
  86180. * `Esc` keystroke but before the focus goes back to `options.origin`.
  86181. */
  86182. function enableToolbarKeyboardFocus( {
  86183. origin,
  86184. originKeystrokeHandler,
  86185. originFocusTracker,
  86186. toolbar,
  86187. beforeFocus,
  86188. afterBlur
  86189. } ) {
  86190. // Because toolbar items can get focus, the overall state of the toolbar must
  86191. // also be tracked.
  86192. originFocusTracker.add( toolbar.element );
  86193. // Focus the toolbar on the keystroke, if not already focused.
  86194. originKeystrokeHandler.set( 'Alt+F10', ( data, cancel ) => {
  86195. if ( originFocusTracker.isFocused && !toolbar.focusTracker.isFocused ) {
  86196. if ( beforeFocus ) {
  86197. beforeFocus();
  86198. }
  86199. toolbar.focus();
  86200. cancel();
  86201. }
  86202. } );
  86203. // Blur the toolbar and bring the focus back to origin.
  86204. toolbar.keystrokes.set( 'Esc', ( data, cancel ) => {
  86205. if ( toolbar.focusTracker.isFocused ) {
  86206. origin.focus();
  86207. if ( afterBlur ) {
  86208. afterBlur();
  86209. }
  86210. cancel();
  86211. }
  86212. } );
  86213. }
  86214. /***/ }),
  86215. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js":
  86216. /*!***********************************************************************************!*\
  86217. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js ***!
  86218. \***********************************************************************************/
  86219. /*! exports provided: default */
  86220. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  86221. "use strict";
  86222. __webpack_require__.r(__webpack_exports__);
  86223. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeToolbarConfig; });
  86224. /**
  86225. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  86226. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  86227. */
  86228. /**
  86229. * @module ui/toolbar/normalizetoolbarconfig
  86230. */
  86231. /**
  86232. * Normalizes the toolbar configuration (`config.toolbar`), which:
  86233. *
  86234. * * may be defined as an `Array`:
  86235. *
  86236. * toolbar: [ 'heading', 'bold', 'italic', 'link', ... ]
  86237. *
  86238. * * or an `Object`:
  86239. *
  86240. * toolbar: {
  86241. * items: [ 'heading', 'bold', 'italic', 'link', ... ],
  86242. * removeItems: [ 'bold' ],
  86243. * ...
  86244. * }
  86245. *
  86246. * * or may not be defined at all (`undefined`)
  86247. *
  86248. * and returns it in the object form.
  86249. *
  86250. * @param {Array|Object|undefined} config The value of `config.toolbar`.
  86251. * @returns {Object} A normalized toolbar config object.
  86252. */
  86253. function normalizeToolbarConfig( config ) {
  86254. if ( Array.isArray( config ) ) {
  86255. return {
  86256. items: config,
  86257. removeItems: []
  86258. };
  86259. }
  86260. if ( !config ) {
  86261. return {
  86262. items: [],
  86263. removeItems: []
  86264. };
  86265. }
  86266. return Object.assign( {
  86267. items: [],
  86268. removeItems: []
  86269. }, config );
  86270. }
  86271. /***/ }),
  86272. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarlinebreakview.js":
  86273. /*!*********************************************************************************!*\
  86274. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarlinebreakview.js ***!
  86275. \*********************************************************************************/
  86276. /*! exports provided: default */
  86277. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  86278. "use strict";
  86279. __webpack_require__.r(__webpack_exports__);
  86280. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ToolbarLineBreakView; });
  86281. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  86282. /**
  86283. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  86284. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  86285. */
  86286. /**
  86287. * @module ui/toolbar/toolbarlinebreakview
  86288. */
  86289. /**
  86290. * The toolbar line break view class.
  86291. *
  86292. * @extends module:ui/view~View
  86293. */
  86294. class ToolbarLineBreakView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  86295. /**
  86296. * @inheritDoc
  86297. */
  86298. constructor( locale ) {
  86299. super( locale );
  86300. this.setTemplate( {
  86301. tag: 'span',
  86302. attributes: {
  86303. class: [
  86304. 'ck',
  86305. 'ck-toolbar__line-break'
  86306. ]
  86307. }
  86308. } );
  86309. }
  86310. }
  86311. /***/ }),
  86312. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js":
  86313. /*!*********************************************************************************!*\
  86314. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js ***!
  86315. \*********************************************************************************/
  86316. /*! exports provided: default */
  86317. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  86318. "use strict";
  86319. __webpack_require__.r(__webpack_exports__);
  86320. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ToolbarSeparatorView; });
  86321. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  86322. /**
  86323. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  86324. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  86325. */
  86326. /**
  86327. * @module ui/toolbar/toolbarseparatorview
  86328. */
  86329. /**
  86330. * The toolbar separator view class.
  86331. *
  86332. * @extends module:ui/view~View
  86333. */
  86334. class ToolbarSeparatorView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  86335. /**
  86336. * @inheritDoc
  86337. */
  86338. constructor( locale ) {
  86339. super( locale );
  86340. this.setTemplate( {
  86341. tag: 'span',
  86342. attributes: {
  86343. class: [
  86344. 'ck',
  86345. 'ck-toolbar__separator'
  86346. ]
  86347. }
  86348. } );
  86349. }
  86350. }
  86351. /***/ }),
  86352. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js":
  86353. /*!************************************************************************!*\
  86354. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js ***!
  86355. \************************************************************************/
  86356. /*! exports provided: default */
  86357. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  86358. "use strict";
  86359. __webpack_require__.r(__webpack_exports__);
  86360. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ToolbarView; });
  86361. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  86362. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  86363. /* harmony import */ var _focuscycler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
  86364. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  86365. /* harmony import */ var _toolbarseparatorview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toolbarseparatorview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js");
  86366. /* harmony import */ var _toolbarlinebreakview__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./toolbarlinebreakview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarlinebreakview.js");
  86367. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/resizeobserver */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js");
  86368. /* harmony import */ var _bindings_preventdefault_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../bindings/preventdefault.js */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/preventdefault.js");
  86369. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  86370. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  86371. /* harmony import */ var _dropdown_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../dropdown/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js");
  86372. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  86373. /* harmony import */ var _normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./normalizetoolbarconfig */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js");
  86374. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_three_vertical_dots_svg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg");
  86375. /* harmony import */ var _theme_components_toolbar_toolbar_css__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../theme/components/toolbar/toolbar.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css");
  86376. /**
  86377. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  86378. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  86379. */
  86380. /**
  86381. * @module ui/toolbar/toolbarview
  86382. */
  86383. /**
  86384. * The toolbar view class.
  86385. *
  86386. * @extends module:ui/view~View
  86387. * @implements module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable
  86388. */
  86389. class ToolbarView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  86390. /**
  86391. * Creates an instance of the {@link module:ui/toolbar/toolbarview~ToolbarView} class.
  86392. *
  86393. * Also see {@link #render}.
  86394. *
  86395. * @param {module:utils/locale~Locale} locale The localization services instance.
  86396. * @param {module:ui/toolbar/toolbarview~ToolbarOptions} [options] Configuration options of the toolbar.
  86397. */
  86398. constructor( locale, options ) {
  86399. super( locale );
  86400. const bind = this.bindTemplate;
  86401. const t = this.t;
  86402. /**
  86403. * A reference to the options object passed to the constructor.
  86404. *
  86405. * @readonly
  86406. * @member {module:ui/toolbar/toolbarview~ToolbarOptions}
  86407. */
  86408. this.options = options || {};
  86409. /**
  86410. * Label used by assistive technologies to describe this toolbar element.
  86411. *
  86412. * @default 'Editor toolbar'
  86413. * @member {String} #ariaLabel
  86414. */
  86415. this.set( 'ariaLabel', t( 'Editor toolbar' ) );
  86416. /**
  86417. * The maximum width of the toolbar element.
  86418. *
  86419. * **Note**: When set to a specific value (e.g. `'200px'`), the value will affect the behavior of the
  86420. * {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull}
  86421. * option by changing the number of {@link #items} that will be displayed in the toolbar at a time.
  86422. *
  86423. * @observable
  86424. * @default 'auto'
  86425. * @member {String} #maxWidth
  86426. */
  86427. this.set( 'maxWidth', 'auto' );
  86428. /**
  86429. * A collection of toolbar items (buttons, dropdowns, etc.).
  86430. *
  86431. * @readonly
  86432. * @member {module:ui/viewcollection~ViewCollection}
  86433. */
  86434. this.items = this.createCollection();
  86435. /**
  86436. * Tracks information about the DOM focus in the toolbar.
  86437. *
  86438. * @readonly
  86439. * @member {module:utils/focustracker~FocusTracker}
  86440. */
  86441. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__["default"]();
  86442. /**
  86443. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}
  86444. * to handle keyboard navigation in the toolbar.
  86445. *
  86446. * @readonly
  86447. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  86448. */
  86449. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_3__["default"]();
  86450. /**
  86451. * An additional CSS class added to the {@link #element}.
  86452. *
  86453. * @observable
  86454. * @member {String} #class
  86455. */
  86456. this.set( 'class' );
  86457. /**
  86458. * When set true, makes the toolbar look compact with {@link #element}.
  86459. *
  86460. * @observable
  86461. * @default false
  86462. * @member {String} #isCompact
  86463. */
  86464. this.set( 'isCompact', false );
  86465. /**
  86466. * A (child) view containing {@link #items toolbar items}.
  86467. *
  86468. * @readonly
  86469. * @member {module:ui/toolbar/toolbarview~ItemsView}
  86470. */
  86471. this.itemsView = new ItemsView( locale );
  86472. /**
  86473. * A top–level collection aggregating building blocks of the toolbar.
  86474. *
  86475. * ┌───────────────── ToolbarView ─────────────────┐
  86476. * | ┌──────────────── #children ────────────────┐ |
  86477. * | | ┌──────────── #itemsView ───────────┐ | |
  86478. * | | | [ item1 ] [ item2 ] ... [ itemN ] | | |
  86479. * | | └──────────────────────────────────-┘ | |
  86480. * | └───────────────────────────────────────────┘ |
  86481. * └───────────────────────────────────────────────┘
  86482. *
  86483. * By default, it contains the {@link #itemsView} but it can be extended with additional
  86484. * UI elements when necessary.
  86485. *
  86486. * @readonly
  86487. * @member {module:ui/viewcollection~ViewCollection}
  86488. */
  86489. this.children = this.createCollection();
  86490. this.children.add( this.itemsView );
  86491. /**
  86492. * A collection of {@link #items} that take part in the focus cycling
  86493. * (i.e. navigation using the keyboard). Usually, it contains a subset of {@link #items} with
  86494. * some optional UI elements that also belong to the toolbar and should be focusable
  86495. * by the user.
  86496. *
  86497. * @readonly
  86498. * @member {module:ui/viewcollection~ViewCollection}
  86499. */
  86500. this.focusables = this.createCollection();
  86501. /**
  86502. * Controls the orientation of toolbar items. Only available when
  86503. * {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull dynamic items grouping}
  86504. * is **disabled**.
  86505. *
  86506. * @observable
  86507. * @member {Boolean} #isVertical
  86508. */
  86509. /**
  86510. * Helps cycling over {@link #focusables focusable items} in the toolbar.
  86511. *
  86512. * @readonly
  86513. * @protected
  86514. * @member {module:ui/focuscycler~FocusCycler}
  86515. */
  86516. const isRtl = locale.uiLanguageDirection === 'rtl';
  86517. this._focusCycler = new _focuscycler__WEBPACK_IMPORTED_MODULE_2__["default"]( {
  86518. focusables: this.focusables,
  86519. focusTracker: this.focusTracker,
  86520. keystrokeHandler: this.keystrokes,
  86521. actions: {
  86522. // Navigate toolbar items backwards using the arrow[left,up] keys.
  86523. focusPrevious: [ isRtl ? 'arrowright' : 'arrowleft', 'arrowup' ],
  86524. // Navigate toolbar items forwards using the arrow[right,down] keys.
  86525. focusNext: [ isRtl ? 'arrowleft' : 'arrowright', 'arrowdown' ]
  86526. }
  86527. } );
  86528. const classes = [
  86529. 'ck',
  86530. 'ck-toolbar',
  86531. bind.to( 'class' ),
  86532. bind.if( 'isCompact', 'ck-toolbar_compact' )
  86533. ];
  86534. if ( this.options.shouldGroupWhenFull && this.options.isFloating ) {
  86535. classes.push( 'ck-toolbar_floating' );
  86536. }
  86537. this.setTemplate( {
  86538. tag: 'div',
  86539. attributes: {
  86540. class: classes,
  86541. role: 'toolbar',
  86542. 'aria-label': bind.to( 'ariaLabel' ),
  86543. style: {
  86544. maxWidth: bind.to( 'maxWidth' )
  86545. }
  86546. },
  86547. children: this.children,
  86548. on: {
  86549. // https://github.com/ckeditor/ckeditor5-ui/issues/206
  86550. mousedown: Object(_bindings_preventdefault_js__WEBPACK_IMPORTED_MODULE_7__["default"])( this )
  86551. }
  86552. } );
  86553. /**
  86554. * An instance of the active toolbar behavior that shapes its look and functionality.
  86555. *
  86556. * See {@link module:ui/toolbar/toolbarview~ToolbarBehavior} to learn more.
  86557. *
  86558. * @protected
  86559. * @readonly
  86560. * @member {module:ui/toolbar/toolbarview~ToolbarBehavior}
  86561. */
  86562. this._behavior = this.options.shouldGroupWhenFull ? new DynamicGrouping( this ) : new StaticLayout( this );
  86563. }
  86564. /**
  86565. * @inheritDoc
  86566. */
  86567. render() {
  86568. super.render();
  86569. // Children added before rendering should be known to the #focusTracker.
  86570. for ( const item of this.items ) {
  86571. this.focusTracker.add( item.element );
  86572. }
  86573. this.items.on( 'add', ( evt, item ) => {
  86574. this.focusTracker.add( item.element );
  86575. } );
  86576. this.items.on( 'remove', ( evt, item ) => {
  86577. this.focusTracker.remove( item.element );
  86578. } );
  86579. // Start listening for the keystrokes coming from #element.
  86580. this.keystrokes.listenTo( this.element );
  86581. this._behavior.render( this );
  86582. }
  86583. /**
  86584. * @inheritDoc
  86585. */
  86586. destroy() {
  86587. this._behavior.destroy();
  86588. this.focusTracker.destroy();
  86589. this.keystrokes.destroy();
  86590. return super.destroy();
  86591. }
  86592. /**
  86593. * Focuses the first focusable in {@link #focusables}.
  86594. */
  86595. focus() {
  86596. this._focusCycler.focusFirst();
  86597. }
  86598. /**
  86599. * Focuses the last focusable in {@link #focusables}.
  86600. */
  86601. focusLast() {
  86602. this._focusCycler.focusLast();
  86603. }
  86604. /**
  86605. * A utility that expands the plain toolbar configuration into
  86606. * {@link module:ui/toolbar/toolbarview~ToolbarView#items} using a given component factory.
  86607. *
  86608. * @param {Array.<String>|Object} itemsOrConfig The toolbar items or the entire toolbar configuration object.
  86609. * @param {module:ui/componentfactory~ComponentFactory} factory A factory producing toolbar items.
  86610. */
  86611. fillFromConfig( itemsOrConfig, factory ) {
  86612. const config = Object(_normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_12__["default"])( itemsOrConfig );
  86613. const itemsToClean = config.items
  86614. .filter( ( name, idx, items ) => {
  86615. if ( name === '|' ) {
  86616. return true;
  86617. }
  86618. // Items listed in `config.removeItems` should not be added to the toolbar.
  86619. if ( config.removeItems.indexOf( name ) !== -1 ) {
  86620. return false;
  86621. }
  86622. if ( name === '-' ) {
  86623. // The toolbar line breaks must not be rendered when toolbar grouping is enabled.
  86624. // (https://github.com/ckeditor/ckeditor5/issues/8582)
  86625. if ( this.options.shouldGroupWhenFull ) {
  86626. /**
  86627. * The toolbar multiline breaks (`-` items) only work when the automatic button grouping
  86628. * is disabled in the toolbar configuration.
  86629. * To do this, set the `shouldNotGroupWhenFull` option to `true` in the editor configuration:
  86630. *
  86631. * const config = {
  86632. * toolbar: {
  86633. * items: [ ... ],
  86634. * shouldNotGroupWhenFull: true
  86635. * }
  86636. * }
  86637. *
  86638. * Learn more about {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar configuration}.
  86639. *
  86640. * @error toolbarview-line-break-ignored-when-grouping-items
  86641. */
  86642. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__["logWarning"])( 'toolbarview-line-break-ignored-when-grouping-items', items );
  86643. return false;
  86644. }
  86645. return true;
  86646. }
  86647. // For the items that cannot be instantiated we are sending warning message. We also filter them out.
  86648. if ( !factory.has( name ) ) {
  86649. /**
  86650. * There was a problem processing the configuration of the toolbar. The item with the given
  86651. * name does not exist so it was omitted when rendering the toolbar.
  86652. *
  86653. * This warning usually shows up when the {@link module:core/plugin~Plugin} which is supposed
  86654. * to provide a toolbar item has not been loaded or there is a typo in the configuration.
  86655. *
  86656. * Make sure the plugin responsible for this toolbar item is loaded and the toolbar configuration
  86657. * is correct, e.g. {@link module:basic-styles/bold~Bold} is loaded for the `'bold'` toolbar item.
  86658. *
  86659. * You can use the following snippet to retrieve all available toolbar items:
  86660. *
  86661. * Array.from( editor.ui.componentFactory.names() );
  86662. *
  86663. * @error toolbarview-item-unavailable
  86664. * @param {String} name The name of the component.
  86665. */
  86666. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__["logWarning"])( 'toolbarview-item-unavailable', { name } );
  86667. return false;
  86668. }
  86669. return true;
  86670. } );
  86671. const itemsToAdd = this._cleanSeparators( itemsToClean )
  86672. // Instantiate toolbar items.
  86673. .map( name => {
  86674. if ( name === '|' ) {
  86675. return new _toolbarseparatorview__WEBPACK_IMPORTED_MODULE_4__["default"]();
  86676. } else if ( name === '-' ) {
  86677. return new _toolbarlinebreakview__WEBPACK_IMPORTED_MODULE_5__["default"]();
  86678. }
  86679. return factory.create( name );
  86680. } );
  86681. this.items.addMany( itemsToAdd );
  86682. }
  86683. /**
  86684. * Remove leading, trailing, and duplicated separators (`-` and `|`).
  86685. *
  86686. * @private
  86687. * @param {Array.<String>} items
  86688. */
  86689. _cleanSeparators( items ) {
  86690. const nonSeparatorPredicate = item => ( item !== '-' && item !== '|' );
  86691. const count = items.length;
  86692. // Find an index of the first item that is not a separator.
  86693. const firstCommandItem = items.findIndex( nonSeparatorPredicate );
  86694. // Search from the end of the list, then convert found index back to the original direction.
  86695. const lastCommandItem = count - items
  86696. .slice()
  86697. .reverse()
  86698. .findIndex( nonSeparatorPredicate );
  86699. return items
  86700. // Return items without the leading and trailing separators.
  86701. .slice( firstCommandItem, lastCommandItem )
  86702. // Remove duplicated separators.
  86703. .filter( ( name, idx, items ) => {
  86704. // Filter only separators.
  86705. if ( nonSeparatorPredicate( name ) ) {
  86706. return true;
  86707. }
  86708. const isDuplicated = idx > 0 && items[ idx - 1 ] === name;
  86709. return !isDuplicated;
  86710. } );
  86711. }
  86712. /**
  86713. * Fired when some toolbar {@link #items} were grouped or ungrouped as a result of some change
  86714. * in the toolbar geometry.
  86715. *
  86716. * **Note**: This event is always fired **once** regardless of the number of items that were be
  86717. * grouped or ungrouped at a time.
  86718. *
  86719. * **Note**: This event is fired only if the items grouping functionality was enabled in
  86720. * the first place (see {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull}).
  86721. *
  86722. * @event groupedItemsUpdate
  86723. */
  86724. }
  86725. /**
  86726. * An inner block of the {@link module:ui/toolbar/toolbarview~ToolbarView} hosting its
  86727. * {@link module:ui/toolbar/toolbarview~ToolbarView#items}.
  86728. *
  86729. * @private
  86730. * @extends module:ui/view~View
  86731. */
  86732. class ItemsView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  86733. /**
  86734. * @inheritDoc
  86735. */
  86736. constructor( locale ) {
  86737. super( locale );
  86738. /**
  86739. * A collection of items (buttons, dropdowns, etc.).
  86740. *
  86741. * @readonly
  86742. * @member {module:ui/viewcollection~ViewCollection}
  86743. */
  86744. this.children = this.createCollection();
  86745. this.setTemplate( {
  86746. tag: 'div',
  86747. attributes: {
  86748. class: [
  86749. 'ck',
  86750. 'ck-toolbar__items'
  86751. ]
  86752. },
  86753. children: this.children
  86754. } );
  86755. }
  86756. }
  86757. /**
  86758. * A toolbar behavior that makes it static and unresponsive to the changes of the environment.
  86759. * At the same time, it also makes it possible to display a toolbar with a vertical layout
  86760. * using the {@link module:ui/toolbar/toolbarview~ToolbarView#isVertical} property.
  86761. *
  86762. * @private
  86763. * @implements module:ui/toolbar/toolbarview~ToolbarBehavior
  86764. */
  86765. class StaticLayout {
  86766. /**
  86767. * Creates an instance of the {@link module:ui/toolbar/toolbarview~StaticLayout} toolbar
  86768. * behavior.
  86769. *
  86770. * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar that this behavior
  86771. * is added to.
  86772. */
  86773. constructor( view ) {
  86774. const bind = view.bindTemplate;
  86775. // Static toolbar can be vertical when needed.
  86776. view.set( 'isVertical', false );
  86777. // 1:1 pass–through binding, all ToolbarView#items are visible.
  86778. view.itemsView.children.bindTo( view.items ).using( item => item );
  86779. // 1:1 pass–through binding, all ToolbarView#items are focusable.
  86780. view.focusables.bindTo( view.items ).using( item => item );
  86781. view.extendTemplate( {
  86782. attributes: {
  86783. class: [
  86784. // When vertical, the toolbar has an additional CSS class.
  86785. bind.if( 'isVertical', 'ck-toolbar_vertical' )
  86786. ]
  86787. }
  86788. } );
  86789. }
  86790. /**
  86791. * @inheritDoc
  86792. */
  86793. render() {}
  86794. /**
  86795. * @inheritDoc
  86796. */
  86797. destroy() {}
  86798. }
  86799. /**
  86800. * A toolbar behavior that makes the items respond to changes in the geometry.
  86801. *
  86802. * In a nutshell, it groups {@link module:ui/toolbar/toolbarview~ToolbarView#items}
  86803. * that do not fit visually into a single row of the toolbar (due to limited space).
  86804. * Items that do not fit are aggregated in a dropdown displayed at the end of the toolbar.
  86805. *
  86806. * ┌──────────────────────────────────────── ToolbarView ──────────────────────────────────────────┐
  86807. * | ┌─────────────────────────────────────── #children ─────────────────────────────────────────┐ |
  86808. * | | ┌─────── #itemsView ────────┐ ┌──────────────────────┐ ┌── #groupedItemsDropdown ───┐ | |
  86809. * | | | #ungroupedItems | | ToolbarSeparatorView | | #groupedItems | | |
  86810. * | | └──────────────────────────-┘ └──────────────────────┘ └────────────────────────────┘ | |
  86811. * | | \---------- only when toolbar items overflow --------/ | |
  86812. * | └───────────────────────────────────────────────────────────────────────────────────────────┘ |
  86813. * └───────────────────────────────────────────────────────────────────────────────────────────────┘
  86814. *
  86815. * @private
  86816. * @implements module:ui/toolbar/toolbarview~ToolbarBehavior
  86817. */
  86818. class DynamicGrouping {
  86819. /**
  86820. * Creates an instance of the {@link module:ui/toolbar/toolbarview~DynamicGrouping} toolbar
  86821. * behavior.
  86822. *
  86823. * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar that this behavior
  86824. * is added to.
  86825. */
  86826. constructor( view ) {
  86827. /**
  86828. * A toolbar view this behavior belongs to.
  86829. *
  86830. * @readonly
  86831. * @member {module:ui/toolbar~ToolbarView}
  86832. */
  86833. this.view = view;
  86834. /**
  86835. * A collection of toolbar children.
  86836. *
  86837. * @readonly
  86838. * @member {module:ui/viewcollection~ViewCollection}
  86839. */
  86840. this.viewChildren = view.children;
  86841. /**
  86842. * A collection of focusable toolbar elements.
  86843. *
  86844. * @readonly
  86845. * @member {module:ui/viewcollection~ViewCollection}
  86846. */
  86847. this.viewFocusables = view.focusables;
  86848. /**
  86849. * A view containing toolbar items.
  86850. *
  86851. * @readonly
  86852. * @member {module:ui/toolbar/toolbarview~ItemsView}
  86853. */
  86854. this.viewItemsView = view.itemsView;
  86855. /**
  86856. * Toolbar focus tracker.
  86857. *
  86858. * @readonly
  86859. * @member {module:utils/focustracker~FocusTracker}
  86860. */
  86861. this.viewFocusTracker = view.focusTracker;
  86862. /**
  86863. * Toolbar locale.
  86864. *
  86865. * @readonly
  86866. * @member {module:utils/locale~Locale}
  86867. */
  86868. this.viewLocale = view.locale;
  86869. /**
  86870. * Toolbar element.
  86871. *
  86872. * @readonly
  86873. * @member {HTMLElement} #viewElement
  86874. */
  86875. /**
  86876. * A subset of toolbar {@link module:ui/toolbar/toolbarview~ToolbarView#items}.
  86877. * Aggregates items that fit into a single row of the toolbar and were not {@link #groupedItems grouped}
  86878. * into a {@link #groupedItemsDropdown dropdown}. Items of this collection are displayed in the
  86879. * {@link module:ui/toolbar/toolbarview~ToolbarView#itemsView}.
  86880. *
  86881. * When none of the {@link module:ui/toolbar/toolbarview~ToolbarView#items} were grouped, it
  86882. * matches the {@link module:ui/toolbar/toolbarview~ToolbarView#items} collection in size and order.
  86883. *
  86884. * @readonly
  86885. * @member {module:ui/viewcollection~ViewCollection}
  86886. */
  86887. this.ungroupedItems = view.createCollection();
  86888. /**
  86889. * A subset of toolbar {@link module:ui/toolbar/toolbarview~ToolbarView#items}.
  86890. * A collection of the toolbar items that do not fit into a single row of the toolbar.
  86891. * Grouped items are displayed in a dedicated {@link #groupedItemsDropdown dropdown}.
  86892. *
  86893. * When none of the {@link module:ui/toolbar/toolbarview~ToolbarView#items} were grouped,
  86894. * this collection is empty.
  86895. *
  86896. * @readonly
  86897. * @member {module:ui/viewcollection~ViewCollection}
  86898. */
  86899. this.groupedItems = view.createCollection();
  86900. /**
  86901. * The dropdown that aggregates {@link #groupedItems grouped items} that do not fit into a single
  86902. * row of the toolbar. It is displayed on demand as the last of
  86903. * {@link module:ui/toolbar/toolbarview~ToolbarView#children toolbar children} and offers another
  86904. * (nested) toolbar which displays items that would normally overflow.
  86905. *
  86906. * @readonly
  86907. * @member {module:ui/dropdown/dropdownview~DropdownView}
  86908. */
  86909. this.groupedItemsDropdown = this._createGroupedItemsDropdown();
  86910. /**
  86911. * An instance of the resize observer that helps dynamically determine the geometry of the toolbar
  86912. * and manage items that do not fit into a single row.
  86913. *
  86914. * **Note:** Created in {@link #_enableGroupingOnResize}.
  86915. *
  86916. * @readonly
  86917. * @member {module:utils/dom/resizeobserver~ResizeObserver}
  86918. */
  86919. this.resizeObserver = null;
  86920. /**
  86921. * A cached value of the horizontal padding style used by {@link #_updateGrouping}
  86922. * to manage the {@link module:ui/toolbar/toolbarview~ToolbarView#items} that do not fit into
  86923. * a single toolbar line. This value can be reused between updates because it is unlikely that
  86924. * the padding will change and re–using `Window.getComputedStyle()` is expensive.
  86925. *
  86926. * @readonly
  86927. * @member {Number}
  86928. */
  86929. this.cachedPadding = null;
  86930. /**
  86931. * A flag indicating that an items grouping update has been queued (e.g. due to the toolbar being visible)
  86932. * and should be executed immediately the next time the toolbar shows up.
  86933. *
  86934. * @readonly
  86935. * @member {Boolean}
  86936. */
  86937. this.shouldUpdateGroupingOnNextResize = false;
  86938. // Only those items that were not grouped are visible to the user.
  86939. view.itemsView.children.bindTo( this.ungroupedItems ).using( item => item );
  86940. // Make sure all #items visible in the main space of the toolbar are "focuscycleable".
  86941. this.ungroupedItems.on( 'add', this._updateFocusCycleableItems.bind( this ) );
  86942. this.ungroupedItems.on( 'remove', this._updateFocusCycleableItems.bind( this ) );
  86943. // Make sure the #groupedItemsDropdown is also included in cycling when it appears.
  86944. view.children.on( 'add', this._updateFocusCycleableItems.bind( this ) );
  86945. view.children.on( 'remove', this._updateFocusCycleableItems.bind( this ) );
  86946. // ToolbarView#items is dynamic. When an item is added or removed, it should be automatically
  86947. // represented in either grouped or ungrouped items at the right index.
  86948. // In other words #items == concat( #ungroupedItems, #groupedItems )
  86949. // (in length and order).
  86950. view.items.on( 'change', ( evt, changeData ) => {
  86951. const index = changeData.index;
  86952. // Removing.
  86953. for ( const removedItem of changeData.removed ) {
  86954. if ( index >= this.ungroupedItems.length ) {
  86955. this.groupedItems.remove( removedItem );
  86956. } else {
  86957. this.ungroupedItems.remove( removedItem );
  86958. }
  86959. }
  86960. // Adding.
  86961. for ( let currentIndex = index; currentIndex < index + changeData.added.length; currentIndex++ ) {
  86962. const addedItem = changeData.added[ currentIndex - index ];
  86963. if ( currentIndex > this.ungroupedItems.length ) {
  86964. this.groupedItems.add( addedItem, currentIndex - this.ungroupedItems.length );
  86965. } else {
  86966. this.ungroupedItems.add( addedItem, currentIndex );
  86967. }
  86968. }
  86969. // When new ungrouped items join in and land in #ungroupedItems, there's a chance it causes
  86970. // the toolbar to overflow.
  86971. // Consequently if removed from grouped or ungrouped items, there is a chance
  86972. // some new space is available and we could do some ungrouping.
  86973. this._updateGrouping();
  86974. } );
  86975. view.extendTemplate( {
  86976. attributes: {
  86977. class: [
  86978. // To group items dynamically, the toolbar needs a dedicated CSS class.
  86979. 'ck-toolbar_grouping'
  86980. ]
  86981. }
  86982. } );
  86983. }
  86984. /**
  86985. * Enables dynamic items grouping based on the dimensions of the toolbar.
  86986. *
  86987. * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar that this behavior
  86988. * is added to.
  86989. */
  86990. render( view ) {
  86991. this.viewElement = view.element;
  86992. this._enableGroupingOnResize();
  86993. this._enableGroupingOnMaxWidthChange( view );
  86994. }
  86995. /**
  86996. * Cleans up the internals used by this behavior.
  86997. */
  86998. destroy() {
  86999. // The dropdown may not be in ToolbarView#children at the moment of toolbar destruction
  87000. // so let's make sure it's actually destroyed along with the toolbar.
  87001. this.groupedItemsDropdown.destroy();
  87002. this.resizeObserver.destroy();
  87003. }
  87004. /**
  87005. * When called, it will check if any of the {@link #ungroupedItems} do not fit into a single row of the toolbar,
  87006. * and it will move them to the {@link #groupedItems} when it happens.
  87007. *
  87008. * At the same time, it will also check if there is enough space in the toolbar for the first of the
  87009. * {@link #groupedItems} to be returned back to {@link #ungroupedItems} and still fit into a single row
  87010. * without the toolbar wrapping.
  87011. *
  87012. * @protected
  87013. */
  87014. _updateGrouping() {
  87015. // Do no grouping–related geometry analysis when the toolbar is detached from visible DOM,
  87016. // for instance before #render(), or after render but without a parent or a parent detached
  87017. // from DOM. DOMRects won't work anyway and there will be tons of warning in the console and
  87018. // nothing else. This happens, for instance, when the toolbar is detached from DOM and
  87019. // some logic adds or removes its #items.
  87020. if ( !this.viewElement.ownerDocument.body.contains( this.viewElement ) ) {
  87021. return;
  87022. }
  87023. // Do not update grouping when the element is invisible. Such toolbar has DOMRect filled with zeros
  87024. // and that would cause all items to be grouped. Instead, queue the grouping so it runs next time
  87025. // the toolbar is visible (the next ResizeObserver callback execution). This is handy because
  87026. // the grouping could be caused by increasing the #maxWidth when the toolbar was invisible and the next
  87027. // time it shows up, some items could actually be ungrouped (https://github.com/ckeditor/ckeditor5/issues/6575).
  87028. if ( !this.viewElement.offsetParent ) {
  87029. this.shouldUpdateGroupingOnNextResize = true;
  87030. return;
  87031. }
  87032. // Remember how many items were initially grouped so at the it is possible to figure out if the number
  87033. // of grouped items has changed. If the number has changed, geometry of the toolbar has also changed.
  87034. const initialGroupedItemsCount = this.groupedItems.length;
  87035. let wereItemsGrouped;
  87036. // Group #items as long as some wrap to the next row. This will happen, for instance,
  87037. // when the toolbar is getting narrow and there is not enough space to display all items in
  87038. // a single row.
  87039. while ( this._areItemsOverflowing ) {
  87040. this._groupLastItem();
  87041. wereItemsGrouped = true;
  87042. }
  87043. // If none were grouped now but there were some items already grouped before,
  87044. // then, what the hell, maybe let's see if some of them can be ungrouped. This happens when,
  87045. // for instance, the toolbar is stretching and there's more space in it than before.
  87046. if ( !wereItemsGrouped && this.groupedItems.length ) {
  87047. // Ungroup items as long as none are overflowing or there are none to ungroup left.
  87048. while ( this.groupedItems.length && !this._areItemsOverflowing ) {
  87049. this._ungroupFirstItem();
  87050. }
  87051. // If the ungrouping ended up with some item wrapping to the next row,
  87052. // put it back to the group toolbar ("undo the last ungroup"). We don't know whether
  87053. // an item will wrap or not until we ungroup it (that's a DOM/CSS thing) so this
  87054. // clean–up is vital for the algorithm.
  87055. if ( this._areItemsOverflowing ) {
  87056. this._groupLastItem();
  87057. }
  87058. }
  87059. if ( this.groupedItems.length !== initialGroupedItemsCount ) {
  87060. this.view.fire( 'groupedItemsUpdate' );
  87061. }
  87062. }
  87063. /**
  87064. * Returns `true` when {@link module:ui/toolbar/toolbarview~ToolbarView#element} children visually overflow,
  87065. * for instance if the toolbar is narrower than its members. Returns `false` otherwise.
  87066. *
  87067. * @private
  87068. * @type {Boolean}
  87069. */
  87070. get _areItemsOverflowing() {
  87071. // An empty toolbar cannot overflow.
  87072. if ( !this.ungroupedItems.length ) {
  87073. return false;
  87074. }
  87075. const element = this.viewElement;
  87076. const uiLanguageDirection = this.viewLocale.uiLanguageDirection;
  87077. const lastChildRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_8__["default"]( element.lastChild );
  87078. const toolbarRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_8__["default"]( element );
  87079. if ( !this.cachedPadding ) {
  87080. const computedStyle = _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_9__["default"].window.getComputedStyle( element );
  87081. const paddingProperty = uiLanguageDirection === 'ltr' ? 'paddingRight' : 'paddingLeft';
  87082. // parseInt() is essential because of quirky floating point numbers logic and DOM.
  87083. // If the padding turned out too big because of that, the grouped items dropdown would
  87084. // always look (from the Rect perspective) like it overflows (while it's not).
  87085. this.cachedPadding = Number.parseInt( computedStyle[ paddingProperty ] );
  87086. }
  87087. if ( uiLanguageDirection === 'ltr' ) {
  87088. return lastChildRect.right > toolbarRect.right - this.cachedPadding;
  87089. } else {
  87090. return lastChildRect.left < toolbarRect.left + this.cachedPadding;
  87091. }
  87092. }
  87093. /**
  87094. * Enables the functionality that prevents {@link #ungroupedItems} from overflowing (wrapping to the next row)
  87095. * upon resize when there is little space available. Instead, the toolbar items are moved to the
  87096. * {@link #groupedItems} collection and displayed in a dropdown at the end of the row (which has its own nested toolbar).
  87097. *
  87098. * When called, the toolbar will automatically analyze the location of its {@link #ungroupedItems} and "group"
  87099. * them in the dropdown if necessary. It will also observe the browser window for size changes in
  87100. * the future and respond to them by grouping more items or reverting already grouped back, depending
  87101. * on the visual space available.
  87102. *
  87103. * @private
  87104. */
  87105. _enableGroupingOnResize() {
  87106. let previousWidth;
  87107. // TODO: Consider debounce.
  87108. this.resizeObserver = new _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_6__["default"]( this.viewElement, entry => {
  87109. if ( !previousWidth || previousWidth !== entry.contentRect.width || this.shouldUpdateGroupingOnNextResize ) {
  87110. this.shouldUpdateGroupingOnNextResize = false;
  87111. this._updateGrouping();
  87112. previousWidth = entry.contentRect.width;
  87113. }
  87114. } );
  87115. this._updateGrouping();
  87116. }
  87117. /**
  87118. * Enables the grouping functionality, just like {@link #_enableGroupingOnResize} but the difference is that
  87119. * it listens to the changes of {@link module:ui/toolbar/toolbarview~ToolbarView#maxWidth} instead.
  87120. *
  87121. * @private
  87122. */
  87123. _enableGroupingOnMaxWidthChange( view ) {
  87124. view.on( 'change:maxWidth', () => {
  87125. this._updateGrouping();
  87126. } );
  87127. }
  87128. /**
  87129. * When called, it will remove the last item from {@link #ungroupedItems} and move it back
  87130. * to the {@link #groupedItems} collection.
  87131. *
  87132. * The opposite of {@link #_ungroupFirstItem}.
  87133. *
  87134. * @private
  87135. */
  87136. _groupLastItem() {
  87137. if ( !this.groupedItems.length ) {
  87138. this.viewChildren.add( new _toolbarseparatorview__WEBPACK_IMPORTED_MODULE_4__["default"]() );
  87139. this.viewChildren.add( this.groupedItemsDropdown );
  87140. this.viewFocusTracker.add( this.groupedItemsDropdown.element );
  87141. }
  87142. this.groupedItems.add( this.ungroupedItems.remove( this.ungroupedItems.last ), 0 );
  87143. }
  87144. /**
  87145. * Moves the very first item belonging to {@link #groupedItems} back
  87146. * to the {@link #ungroupedItems} collection.
  87147. *
  87148. * The opposite of {@link #_groupLastItem}.
  87149. *
  87150. * @private
  87151. */
  87152. _ungroupFirstItem() {
  87153. this.ungroupedItems.add( this.groupedItems.remove( this.groupedItems.first ) );
  87154. if ( !this.groupedItems.length ) {
  87155. this.viewChildren.remove( this.groupedItemsDropdown );
  87156. this.viewChildren.remove( this.viewChildren.last );
  87157. this.viewFocusTracker.remove( this.groupedItemsDropdown.element );
  87158. }
  87159. }
  87160. /**
  87161. * Creates the {@link #groupedItemsDropdown} that hosts the members of the {@link #groupedItems}
  87162. * collection when there is not enough space in the toolbar to display all items in a single row.
  87163. *
  87164. * @private
  87165. * @returns {module:ui/dropdown/dropdownview~DropdownView}
  87166. */
  87167. _createGroupedItemsDropdown() {
  87168. const locale = this.viewLocale;
  87169. const t = locale.t;
  87170. const dropdown = Object(_dropdown_utils__WEBPACK_IMPORTED_MODULE_10__["createDropdown"])( locale );
  87171. dropdown.class = 'ck-toolbar__grouped-dropdown';
  87172. // Make sure the dropdown never sticks out to the left/right. It should be under the main toolbar.
  87173. // (https://github.com/ckeditor/ckeditor5/issues/5608)
  87174. dropdown.panelPosition = locale.uiLanguageDirection === 'ltr' ? 'sw' : 'se';
  87175. Object(_dropdown_utils__WEBPACK_IMPORTED_MODULE_10__["addToolbarToDropdown"])( dropdown, [] );
  87176. dropdown.buttonView.set( {
  87177. label: t( 'Show more items' ),
  87178. tooltip: true,
  87179. tooltipPosition: locale.uiLanguageDirection === 'rtl' ? 'se' : 'sw',
  87180. icon: _ckeditor_ckeditor5_core_theme_icons_three_vertical_dots_svg__WEBPACK_IMPORTED_MODULE_13__["default"]
  87181. } );
  87182. // 1:1 pass–through binding.
  87183. dropdown.toolbarView.items.bindTo( this.groupedItems ).using( item => item );
  87184. return dropdown;
  87185. }
  87186. /**
  87187. * Updates the {@link module:ui/toolbar/toolbarview~ToolbarView#focusables focus–cycleable items}
  87188. * collection so it represents the up–to–date state of the UI from the perspective of the user.
  87189. *
  87190. * For instance, the {@link #groupedItemsDropdown} can show up and hide but when it is visible,
  87191. * it must be subject to focus cycling in the toolbar.
  87192. *
  87193. * See the {@link module:ui/toolbar/toolbarview~ToolbarView#focusables collection} documentation
  87194. * to learn more about the purpose of this method.
  87195. *
  87196. * @private
  87197. */
  87198. _updateFocusCycleableItems() {
  87199. this.viewFocusables.clear();
  87200. this.ungroupedItems.map( item => {
  87201. this.viewFocusables.add( item );
  87202. } );
  87203. if ( this.groupedItems.length ) {
  87204. this.viewFocusables.add( this.groupedItemsDropdown );
  87205. }
  87206. }
  87207. }
  87208. /**
  87209. * Options passed to the {@link module:ui/toolbar/toolbarview~ToolbarView#constructor} of the toolbar.
  87210. *
  87211. * @interface module:ui/toolbar/toolbarview~ToolbarOptions
  87212. */
  87213. /**
  87214. * When set to `true`, the toolbar will automatically group {@link module:ui/toolbar/toolbarview~ToolbarView#items} that
  87215. * would normally wrap to the next line when there is not enough space to display them in a single row, for
  87216. * instance, if the parent container of the toolbar is narrow. For toolbars in absolutely positioned containers
  87217. * without width restrictions also the {@link module:ui/toolbar/toolbarview~ToolbarOptions#isFloating} option is required to be `true`.
  87218. *
  87219. * See also: {@link module:ui/toolbar/toolbarview~ToolbarView#maxWidth}.
  87220. *
  87221. * @member {Boolean} module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull
  87222. */
  87223. /**
  87224. * This option should be enabled for toolbars in absolutely positioned containers without width restrictions
  87225. * to enable automatic {@link module:ui/toolbar/toolbarview~ToolbarView#items} grouping.
  87226. * When this option is set to `true`, the items will stop wrapping to the next line
  87227. * and together with {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull},
  87228. * this will allow grouping them when there is not enough space in a single row.
  87229. *
  87230. * @member {Boolean} module:ui/toolbar/toolbarview~ToolbarOptions#isFloating
  87231. */
  87232. /**
  87233. * A class interface defining the behavior of the {@link module:ui/toolbar/toolbarview~ToolbarView}.
  87234. *
  87235. * Toolbar behaviors extend its look and functionality and have an impact on the
  87236. * {@link module:ui/toolbar/toolbarview~ToolbarView#element} template or
  87237. * {@link module:ui/toolbar/toolbarview~ToolbarView#render rendering}. They can be enabled
  87238. * conditionally, e.g. depending on the configuration of the toolbar.
  87239. *
  87240. * @private
  87241. * @interface module:ui/toolbar/toolbarview~ToolbarBehavior
  87242. */
  87243. /**
  87244. * Creates a new toolbar behavior instance.
  87245. *
  87246. * The instance is created in the {@link module:ui/toolbar/toolbarview~ToolbarView#constructor} of the toolbar.
  87247. * This is the right place to extend the {@link module:ui/toolbar/toolbarview~ToolbarView#template} of
  87248. * the toolbar, define extra toolbar properties, etc.
  87249. *
  87250. * @method #constructor
  87251. * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar that this behavior is added to.
  87252. */
  87253. /**
  87254. * A method called after the toolbar has been {@link module:ui/toolbar/toolbarview~ToolbarView#render rendered}.
  87255. * It can be used to, for example, customize the behavior of the toolbar when its {@link module:ui/toolbar/toolbarview~ToolbarView#element}
  87256. * is available.
  87257. *
  87258. * @readonly
  87259. * @member {Function} #render
  87260. * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar being rendered.
  87261. */
  87262. /**
  87263. * A method called after the toolbar has been {@link module:ui/toolbar/toolbarview~ToolbarView#destroy destroyed}.
  87264. * It allows cleaning up after the toolbar behavior, for instance, this is the right place to detach
  87265. * event listeners, free up references, etc.
  87266. *
  87267. * @readonly
  87268. * @member {Function} #destroy
  87269. */
  87270. /***/ }),
  87271. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/tooltip/tooltipview.js":
  87272. /*!************************************************************************!*\
  87273. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/tooltip/tooltipview.js ***!
  87274. \************************************************************************/
  87275. /*! exports provided: default */
  87276. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87277. "use strict";
  87278. __webpack_require__.r(__webpack_exports__);
  87279. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TooltipView; });
  87280. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  87281. /* harmony import */ var _theme_components_tooltip_tooltip_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/components/tooltip/tooltip.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css");
  87282. /**
  87283. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  87284. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  87285. */
  87286. /**
  87287. * @module ui/tooltip/tooltipview
  87288. */
  87289. /**
  87290. * The tooltip view class.
  87291. *
  87292. * @extends module:ui/view~View
  87293. */
  87294. class TooltipView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  87295. /**
  87296. * @inheritDoc
  87297. */
  87298. constructor( locale ) {
  87299. super( locale );
  87300. /**
  87301. * The text of the tooltip visible to the user.
  87302. *
  87303. * @observable
  87304. * @member {String} #text
  87305. */
  87306. this.set( 'text', '' );
  87307. /**
  87308. * The position of the tooltip (south, south-west, south-east, or north).
  87309. *
  87310. * +-----------+
  87311. * | north |
  87312. * +-----------+
  87313. * V
  87314. * [element]
  87315. *
  87316. * [element]
  87317. * ^
  87318. * +-----------+
  87319. * | south |
  87320. * +-----------+
  87321. *
  87322. * +----------+
  87323. * [element] < | east |
  87324. * +----------+
  87325. *
  87326. * +----------+
  87327. * | west | > [element]
  87328. * +----------+
  87329. *
  87330. * [element]
  87331. * ^
  87332. * +--------------+
  87333. * | south west |
  87334. * +--------------+
  87335. *
  87336. * [element]
  87337. * ^
  87338. * +--------------+
  87339. * | south east |
  87340. * +--------------+
  87341. * @observable
  87342. * @default 's'
  87343. * @member {'s'|'n'|'e'|'w'|'sw'|'se'} #position
  87344. */
  87345. this.set( 'position', 's' );
  87346. const bind = this.bindTemplate;
  87347. this.setTemplate( {
  87348. tag: 'span',
  87349. attributes: {
  87350. class: [
  87351. 'ck',
  87352. 'ck-tooltip',
  87353. bind.to( 'position', position => 'ck-tooltip_' + position ),
  87354. bind.if( 'text', 'ck-hidden', value => !value.trim() )
  87355. ]
  87356. },
  87357. children: [
  87358. {
  87359. tag: 'span',
  87360. attributes: {
  87361. class: [
  87362. 'ck',
  87363. 'ck-tooltip__text'
  87364. ]
  87365. },
  87366. children: [
  87367. {
  87368. text: bind.to( 'text' )
  87369. }
  87370. ]
  87371. }
  87372. ]
  87373. } );
  87374. }
  87375. }
  87376. /***/ }),
  87377. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js":
  87378. /*!*********************************************************!*\
  87379. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/view.js ***!
  87380. \*********************************************************/
  87381. /*! exports provided: default */
  87382. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87383. "use strict";
  87384. __webpack_require__.r(__webpack_exports__);
  87385. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return View; });
  87386. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  87387. /* harmony import */ var _viewcollection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
  87388. /* harmony import */ var _template__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
  87389. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
  87390. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  87391. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  87392. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  87393. /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  87394. /* harmony import */ var _theme_globals_globals_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../theme/globals/globals.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css");
  87395. /**
  87396. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  87397. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  87398. */
  87399. /**
  87400. * @module ui/view
  87401. */
  87402. /**
  87403. * The basic view class, which represents an HTML element created out of a
  87404. * {@link module:ui/view~View#template}. Views are building blocks of the user interface and handle
  87405. * interaction
  87406. *
  87407. * Views {@link module:ui/view~View#registerChild aggregate} children in
  87408. * {@link module:ui/view~View#createCollection collections} and manage the life cycle of DOM
  87409. * listeners e.g. by handling rendering and destruction.
  87410. *
  87411. * See the {@link module:ui/template~TemplateDefinition} syntax to learn more about shaping view
  87412. * elements, attributes and listeners.
  87413. *
  87414. * class SampleView extends View {
  87415. * constructor( locale ) {
  87416. * super( locale );
  87417. *
  87418. * const bind = this.bindTemplate;
  87419. *
  87420. * // Views define their interface (state) using observable attributes.
  87421. * this.set( 'elementClass', 'bar' );
  87422. *
  87423. * this.setTemplate( {
  87424. * tag: 'p',
  87425. *
  87426. * // The element of the view can be defined with its children.
  87427. * children: [
  87428. * 'Hello',
  87429. * {
  87430. * tag: 'b',
  87431. * children: [ 'world!' ]
  87432. * }
  87433. * ],
  87434. * attributes: {
  87435. * class: [
  87436. * 'foo',
  87437. *
  87438. * // Observable attributes control the state of the view in DOM.
  87439. * bind.to( 'elementClass' )
  87440. * ]
  87441. * },
  87442. * on: {
  87443. * // Views listen to DOM events and propagate them.
  87444. * click: bind.to( 'clicked' )
  87445. * }
  87446. * } );
  87447. * }
  87448. * }
  87449. *
  87450. * const view = new SampleView( locale );
  87451. *
  87452. * view.render();
  87453. *
  87454. * // Append <p class="foo bar">Hello<b>world</b></p> to the <body>
  87455. * document.body.appendChild( view.element );
  87456. *
  87457. * // Change the class attribute to <p class="foo baz">Hello<b>world</b></p>
  87458. * view.elementClass = 'baz';
  87459. *
  87460. * // Respond to the "click" event in DOM by executing a custom action.
  87461. * view.on( 'clicked', () => {
  87462. * console.log( 'The view has been clicked!' );
  87463. * } );
  87464. *
  87465. * @mixes module:utils/observablemixin~ObservableMixin
  87466. */
  87467. class View {
  87468. /**
  87469. * Creates an instance of the {@link module:ui/view~View} class.
  87470. *
  87471. * Also see {@link #render}.
  87472. *
  87473. * @param {module:utils/locale~Locale} [locale] The localization services instance.
  87474. */
  87475. constructor( locale ) {
  87476. /**
  87477. * An HTML element of the view. `null` until {@link #render rendered}
  87478. * from the {@link #template}.
  87479. *
  87480. * class SampleView extends View {
  87481. * constructor() {
  87482. * super();
  87483. *
  87484. * // A template instance the #element will be created from.
  87485. * this.setTemplate( {
  87486. * tag: 'p'
  87487. *
  87488. * // ...
  87489. * } );
  87490. * }
  87491. * }
  87492. *
  87493. * const view = new SampleView();
  87494. *
  87495. * // Renders the #template.
  87496. * view.render();
  87497. *
  87498. * // Append the HTML element of the view to <body>.
  87499. * document.body.appendChild( view.element );
  87500. *
  87501. * **Note**: The element of the view can also be assigned directly:
  87502. *
  87503. * view.element = document.querySelector( '#my-container' );
  87504. *
  87505. * @member {HTMLElement}
  87506. */
  87507. this.element = null;
  87508. /**
  87509. * Set `true` when the view has already been {@link module:ui/view~View#render rendered}.
  87510. *
  87511. * @readonly
  87512. * @member {Boolean} #isRendered
  87513. */
  87514. this.isRendered = false;
  87515. /**
  87516. * A set of tools to localize the user interface.
  87517. *
  87518. * Also see {@link module:core/editor/editor~Editor#locale}.
  87519. *
  87520. * @readonly
  87521. * @member {module:utils/locale~Locale}
  87522. */
  87523. this.locale = locale;
  87524. /**
  87525. * Shorthand for {@link module:utils/locale~Locale#t}.
  87526. *
  87527. * Note: If {@link #locale} instance hasn't been passed to the view this method may not
  87528. * be available.
  87529. *
  87530. * @see module:utils/locale~Locale#t
  87531. * @method
  87532. */
  87533. this.t = locale && locale.t;
  87534. /**
  87535. * Collections registered with {@link #createCollection}.
  87536. *
  87537. * @protected
  87538. * @member {Set.<module:ui/viewcollection~ViewCollection>}
  87539. */
  87540. this._viewCollections = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_5__["default"]();
  87541. /**
  87542. * A collection of view instances, which have been added directly
  87543. * into the {@link module:ui/template~Template#children}.
  87544. *
  87545. * @protected
  87546. * @member {module:ui/viewcollection~ViewCollection}
  87547. */
  87548. this._unboundChildren = this.createCollection();
  87549. // Pass parent locale to its children.
  87550. this._viewCollections.on( 'add', ( evt, collection ) => {
  87551. collection.locale = locale;
  87552. } );
  87553. /**
  87554. * Template of this view. It provides the {@link #element} representing
  87555. * the view in DOM, which is {@link #render rendered}.
  87556. *
  87557. * @member {module:ui/template~Template} #template
  87558. */
  87559. /**
  87560. * Cached {@link module:ui/template~BindChain bind chain} object created by the
  87561. * {@link #template}. See {@link #bindTemplate}.
  87562. *
  87563. * @private
  87564. * @member {Object} #_bindTemplate
  87565. */
  87566. this.decorate( 'render' );
  87567. }
  87568. /**
  87569. * Shorthand for {@link module:ui/template~Template.bind}, a binding
  87570. * {@link module:ui/template~BindChain interface} pre–configured for the view instance.
  87571. *
  87572. * It provides {@link module:ui/template~BindChain#to `to()`} and
  87573. * {@link module:ui/template~BindChain#if `if()`} methods that initialize bindings with
  87574. * observable attributes and attach DOM listeners.
  87575. *
  87576. * class SampleView extends View {
  87577. * constructor( locale ) {
  87578. * super( locale );
  87579. *
  87580. * const bind = this.bindTemplate;
  87581. *
  87582. * // These {@link module:utils/observablemixin~Observable observable} attributes will control
  87583. * // the state of the view in DOM.
  87584. * this.set( {
  87585. * elementClass: 'foo',
  87586. * isEnabled: true
  87587. * } );
  87588. *
  87589. * this.setTemplate( {
  87590. * tag: 'p',
  87591. *
  87592. * attributes: {
  87593. * // The class HTML attribute will follow elementClass
  87594. * // and isEnabled view attributes.
  87595. * class: [
  87596. * bind.to( 'elementClass' )
  87597. * bind.if( 'isEnabled', 'present-when-enabled' )
  87598. * ]
  87599. * },
  87600. *
  87601. * on: {
  87602. * // The view will fire the "clicked" event upon clicking <p> in DOM.
  87603. * click: bind.to( 'clicked' )
  87604. * }
  87605. * } );
  87606. * }
  87607. * }
  87608. *
  87609. * @method #bindTemplate
  87610. */
  87611. get bindTemplate() {
  87612. if ( this._bindTemplate ) {
  87613. return this._bindTemplate;
  87614. }
  87615. return ( this._bindTemplate = _template__WEBPACK_IMPORTED_MODULE_2__["default"].bind( this, this ) );
  87616. }
  87617. /**
  87618. * Creates a new collection of views, which can be used as
  87619. * {@link module:ui/template~Template#children} of this view.
  87620. *
  87621. * class SampleView extends View {
  87622. * constructor( locale ) {
  87623. * super( locale );
  87624. *
  87625. * const child = new ChildView( locale );
  87626. * this.items = this.createCollection( [ child ] );
  87627. *
  87628. * this.setTemplate( {
  87629. * tag: 'p',
  87630. *
  87631. * // `items` collection will render here.
  87632. * children: this.items
  87633. * } );
  87634. * }
  87635. * }
  87636. *
  87637. * const view = new SampleView( locale );
  87638. * view.render();
  87639. *
  87640. * // It will append <p><child#element></p> to the <body>.
  87641. * document.body.appendChild( view.element );
  87642. *
  87643. * @param {Iterable.<module:ui/view~View>} [views] Initial views of the collection.
  87644. * @returns {module:ui/viewcollection~ViewCollection} A new collection of view instances.
  87645. */
  87646. createCollection( views ) {
  87647. const collection = new _viewcollection__WEBPACK_IMPORTED_MODULE_1__["default"]( views );
  87648. this._viewCollections.add( collection );
  87649. return collection;
  87650. }
  87651. /**
  87652. * Registers a new child view under the view instance. Once registered, a child
  87653. * view is managed by its parent, including {@link #render rendering}
  87654. * and {@link #destroy destruction}.
  87655. *
  87656. * To revert this, use {@link #deregisterChild}.
  87657. *
  87658. * class SampleView extends View {
  87659. * constructor( locale ) {
  87660. * super( locale );
  87661. *
  87662. * this.childA = new SomeChildView( locale );
  87663. * this.childB = new SomeChildView( locale );
  87664. *
  87665. * this.setTemplate( { tag: 'p' } );
  87666. *
  87667. * // Register the children.
  87668. * this.registerChild( [ this.childA, this.childB ] );
  87669. * }
  87670. *
  87671. * render() {
  87672. * super.render();
  87673. *
  87674. * this.element.appendChild( this.childA.element );
  87675. * this.element.appendChild( this.childB.element );
  87676. * }
  87677. * }
  87678. *
  87679. * const view = new SampleView( locale );
  87680. *
  87681. * view.render();
  87682. *
  87683. * // Will append <p><childA#element><b></b><childB#element></p>.
  87684. * document.body.appendChild( view.element );
  87685. *
  87686. * **Note**: There's no need to add child views if they're already referenced in the
  87687. * {@link #template}:
  87688. *
  87689. * class SampleView extends View {
  87690. * constructor( locale ) {
  87691. * super( locale );
  87692. *
  87693. * this.childA = new SomeChildView( locale );
  87694. * this.childB = new SomeChildView( locale );
  87695. *
  87696. * this.setTemplate( {
  87697. * tag: 'p',
  87698. *
  87699. * // These children will be added automatically. There's no
  87700. * // need to call {@link #registerChild} for any of them.
  87701. * children: [ this.childA, this.childB ]
  87702. * } );
  87703. * }
  87704. *
  87705. * // ...
  87706. * }
  87707. *
  87708. * @param {module:ui/view~View|Iterable.<module:ui/view~View>} children Children views to be registered.
  87709. */
  87710. registerChild( children ) {
  87711. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__["default"])( children ) ) {
  87712. children = [ children ];
  87713. }
  87714. for ( const child of children ) {
  87715. this._unboundChildren.add( child );
  87716. }
  87717. }
  87718. /**
  87719. * The opposite of {@link #registerChild}. Removes a child view from this view instance.
  87720. * Once removed, the child is no longer managed by its parent, e.g. it can safely
  87721. * become a child of another parent view.
  87722. *
  87723. * @see #registerChild
  87724. * @param {module:ui/view~View|Iterable.<module:ui/view~View>} children Child views to be removed.
  87725. */
  87726. deregisterChild( children ) {
  87727. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__["default"])( children ) ) {
  87728. children = [ children ];
  87729. }
  87730. for ( const child of children ) {
  87731. this._unboundChildren.remove( child );
  87732. }
  87733. }
  87734. /**
  87735. * Sets the {@link #template} of the view with with given definition.
  87736. *
  87737. * A shorthand for:
  87738. *
  87739. * view.setTemplate( definition );
  87740. *
  87741. * @param {module:ui/template~TemplateDefinition} definition Definition of view's template.
  87742. */
  87743. setTemplate( definition ) {
  87744. this.template = new _template__WEBPACK_IMPORTED_MODULE_2__["default"]( definition );
  87745. }
  87746. /**
  87747. * {@link module:ui/template~Template.extend Extends} the {@link #template} of the view with
  87748. * with given definition.
  87749. *
  87750. * A shorthand for:
  87751. *
  87752. * Template.extend( view.template, definition );
  87753. *
  87754. * **Note**: Is requires the {@link #template} to be already set. See {@link #setTemplate}.
  87755. *
  87756. * @param {module:ui/template~TemplateDefinition} definition Definition which
  87757. * extends the {@link #template}.
  87758. */
  87759. extendTemplate( definition ) {
  87760. _template__WEBPACK_IMPORTED_MODULE_2__["default"].extend( this.template, definition );
  87761. }
  87762. /**
  87763. * Recursively renders the view.
  87764. *
  87765. * Once the view is rendered:
  87766. * * the {@link #element} becomes an HTML element out of {@link #template},
  87767. * * the {@link #isRendered} flag is set `true`.
  87768. *
  87769. * **Note**: The children of the view:
  87770. * * defined directly in the {@link #template}
  87771. * * residing in collections created by the {@link #createCollection} method,
  87772. * * and added by {@link #registerChild}
  87773. * are also rendered in the process.
  87774. *
  87775. * In general, `render()` method is the right place to keep the code which refers to the
  87776. * {@link #element} and should be executed at the very beginning of the view's life cycle.
  87777. *
  87778. * It is possible to {@link module:ui/template~Template.extend} the {@link #template} before
  87779. * the view is rendered. To allow an early customization of the view (e.g. by its parent),
  87780. * such references should be done in `render()`.
  87781. *
  87782. * class SampleView extends View {
  87783. * constructor() {
  87784. * this.setTemplate( {
  87785. * // ...
  87786. * } );
  87787. * },
  87788. *
  87789. * render() {
  87790. * // View#element becomes available.
  87791. * super.render();
  87792. *
  87793. * // The "scroll" listener depends on #element.
  87794. * this.listenTo( window, 'scroll', () => {
  87795. * // A reference to #element would render the #template and make it non-extendable.
  87796. * if ( window.scrollY > 0 ) {
  87797. * this.element.scrollLeft = 100;
  87798. * } else {
  87799. * this.element.scrollLeft = 0;
  87800. * }
  87801. * } );
  87802. * }
  87803. * }
  87804. *
  87805. * const view = new SampleView();
  87806. *
  87807. * // Let's customize the view before it gets rendered.
  87808. * view.extendTemplate( {
  87809. * attributes: {
  87810. * class: [
  87811. * 'additional-class'
  87812. * ]
  87813. * }
  87814. * } );
  87815. *
  87816. * // Late rendering allows customization of the view.
  87817. * view.render();
  87818. */
  87819. render() {
  87820. if ( this.isRendered ) {
  87821. /**
  87822. * This View has already been rendered.
  87823. *
  87824. * @error ui-view-render-already-rendered
  87825. */
  87826. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'ui-view-render-already-rendered', this );
  87827. }
  87828. // Render #element of the view.
  87829. if ( this.template ) {
  87830. this.element = this.template.render();
  87831. // Auto–register view children from #template.
  87832. this.registerChild( this.template.getViews() );
  87833. }
  87834. this.isRendered = true;
  87835. }
  87836. /**
  87837. * Recursively destroys the view instance and child views added by {@link #registerChild} and
  87838. * residing in collections created by the {@link #createCollection}.
  87839. *
  87840. * Destruction disables all event listeners:
  87841. * * created on the view, e.g. `view.on( 'event', () => {} )`,
  87842. * * defined in the {@link #template} for DOM events.
  87843. */
  87844. destroy() {
  87845. this.stopListening();
  87846. this._viewCollections.map( c => c.destroy() );
  87847. // Template isn't obligatory for views.
  87848. if ( this.template && this.template._revertData ) {
  87849. this.template.revert( this.element );
  87850. }
  87851. }
  87852. /**
  87853. * Event fired by the {@link #render} method. Actual rendering is executed as a listener to
  87854. * this event with the default priority.
  87855. *
  87856. * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.
  87857. *
  87858. * @event render
  87859. */
  87860. }
  87861. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( View, _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  87862. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( View, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
  87863. /***/ }),
  87864. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js":
  87865. /*!*******************************************************************!*\
  87866. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js ***!
  87867. \*******************************************************************/
  87868. /*! exports provided: default */
  87869. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87870. "use strict";
  87871. __webpack_require__.r(__webpack_exports__);
  87872. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ViewCollection; });
  87873. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  87874. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  87875. /**
  87876. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  87877. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  87878. */
  87879. /**
  87880. * @module ui/viewcollection
  87881. */
  87882. /**
  87883. * Collects {@link module:ui/view~View} instances.
  87884. *
  87885. * const parentView = new ParentView( locale );
  87886. * const collection = new ViewCollection( locale );
  87887. *
  87888. * collection.setParent( parentView.element );
  87889. *
  87890. * const viewA = new ChildView( locale );
  87891. * const viewB = new ChildView( locale );
  87892. *
  87893. * View collection renders and manages view {@link module:ui/view~View#element elements}:
  87894. *
  87895. * collection.add( viewA );
  87896. * collection.add( viewB );
  87897. *
  87898. * console.log( parentView.element.firsChild ); // -> viewA.element
  87899. * console.log( parentView.element.lastChild ); // -> viewB.element
  87900. *
  87901. * It {@link module:ui/viewcollection~ViewCollection#delegate propagates} DOM events too:
  87902. *
  87903. * // Delegate #click and #keydown events from viewA and viewB to the parentView.
  87904. * collection.delegate( 'click' ).to( parentView );
  87905. *
  87906. * parentView.on( 'click', ( evt ) => {
  87907. * console.log( `${ evt.source } has been clicked.` );
  87908. * } );
  87909. *
  87910. * // This event will be delegated to the parentView.
  87911. * viewB.fire( 'click' );
  87912. *
  87913. * **Note**: A view collection can be used directly in the {@link module:ui/template~TemplateDefinition definition}
  87914. * of a {@link module:ui/template~Template template}.
  87915. *
  87916. * @extends module:utils/collection~Collection
  87917. * @mixes module:utils/observablemixin~ObservableMixin
  87918. */
  87919. class ViewCollection extends _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__["default"] {
  87920. /**
  87921. * Creates a new instance of the {@link module:ui/viewcollection~ViewCollection}.
  87922. *
  87923. * @param {Iterable.<module:ui/view~View>} [initialItems] The initial items of the collection.
  87924. */
  87925. constructor( initialItems = [] ) {
  87926. super( initialItems, {
  87927. // An #id Number attribute should be legal and not break the `ViewCollection` instance.
  87928. // https://github.com/ckeditor/ckeditor5-ui/issues/93
  87929. idProperty: 'viewUid'
  87930. } );
  87931. // Handle {@link module:ui/view~View#element} in DOM when a new view is added to the collection.
  87932. this.on( 'add', ( evt, view, index ) => {
  87933. this._renderViewIntoCollectionParent( view, index );
  87934. } );
  87935. // Handle {@link module:ui/view~View#element} in DOM when a view is removed from the collection.
  87936. this.on( 'remove', ( evt, view ) => {
  87937. if ( view.element && this._parentElement ) {
  87938. view.element.remove();
  87939. }
  87940. } );
  87941. /**
  87942. * A parent element within which child views are rendered and managed in DOM.
  87943. *
  87944. * @protected
  87945. * @member {HTMLElement}
  87946. */
  87947. this._parentElement = null;
  87948. }
  87949. /**
  87950. * Destroys the view collection along with child views.
  87951. * See the view {@link module:ui/view~View#destroy} method.
  87952. */
  87953. destroy() {
  87954. this.map( view => view.destroy() );
  87955. }
  87956. /**
  87957. * Sets the parent HTML element of this collection. When parent is set, {@link #add adding} and
  87958. * {@link #remove removing} views in the collection synchronizes their
  87959. * {@link module:ui/view~View#element elements} in the parent element.
  87960. *
  87961. * @param {HTMLElement} element A new parent element.
  87962. */
  87963. setParent( elementOrDocFragment ) {
  87964. this._parentElement = elementOrDocFragment;
  87965. // Take care of the initial collection items passed to the constructor.
  87966. for ( const view of this ) {
  87967. this._renderViewIntoCollectionParent( view );
  87968. }
  87969. }
  87970. /**
  87971. * Delegates selected events coming from within views in the collection to any
  87972. * {@link module:utils/emittermixin~Emitter}.
  87973. *
  87974. * For the following views and collection:
  87975. *
  87976. * const viewA = new View();
  87977. * const viewB = new View();
  87978. * const viewC = new View();
  87979. *
  87980. * const views = parentView.createCollection();
  87981. *
  87982. * views.delegate( 'eventX' ).to( viewB );
  87983. * views.delegate( 'eventX', 'eventY' ).to( viewC );
  87984. *
  87985. * views.add( viewA );
  87986. *
  87987. * the `eventX` is delegated (fired by) `viewB` and `viewC` along with `customData`:
  87988. *
  87989. * viewA.fire( 'eventX', customData );
  87990. *
  87991. * and `eventY` is delegated (fired by) `viewC` along with `customData`:
  87992. *
  87993. * viewA.fire( 'eventY', customData );
  87994. *
  87995. * See {@link module:utils/emittermixin~Emitter#delegate}.
  87996. *
  87997. * @param {...String} events {@link module:ui/view~View} event names to be delegated to another
  87998. * {@link module:utils/emittermixin~Emitter}.
  87999. * @returns {Object}
  88000. * @returns {Function} return.to A function which accepts the destination of
  88001. * {@link module:utils/emittermixin~Emitter#delegate delegated} events.
  88002. */
  88003. delegate( ...events ) {
  88004. if ( !events.length || !isStringArray( events ) ) {
  88005. /**
  88006. * All event names must be strings.
  88007. *
  88008. * @error ui-viewcollection-delegate-wrong-events
  88009. */
  88010. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  88011. 'ui-viewcollection-delegate-wrong-events',
  88012. this
  88013. );
  88014. }
  88015. return {
  88016. /**
  88017. * Selects destination for {@link module:utils/emittermixin~Emitter#delegate} events.
  88018. *
  88019. * @memberOf module:ui/viewcollection~ViewCollection#delegate
  88020. * @function module:ui/viewcollection~ViewCollection#delegate.to
  88021. * @param {module:utils/emittermixin~Emitter} dest An `Emitter` instance which is
  88022. * the destination for delegated events.
  88023. */
  88024. to: dest => {
  88025. // Activate delegating on existing views in this collection.
  88026. for ( const view of this ) {
  88027. for ( const evtName of events ) {
  88028. view.delegate( evtName ).to( dest );
  88029. }
  88030. }
  88031. // Activate delegating on future views in this collection.
  88032. this.on( 'add', ( evt, view ) => {
  88033. for ( const evtName of events ) {
  88034. view.delegate( evtName ).to( dest );
  88035. }
  88036. } );
  88037. // Deactivate delegating when view is removed from this collection.
  88038. this.on( 'remove', ( evt, view ) => {
  88039. for ( const evtName of events ) {
  88040. view.stopDelegating( evtName, dest );
  88041. }
  88042. } );
  88043. }
  88044. };
  88045. }
  88046. /**
  88047. * This method {@link module:ui/view~View#render renders} a new view added to the collection.
  88048. *
  88049. * If the {@link #_parentElement parent element} of the collection is set, this method also adds
  88050. * the view's {@link module:ui/view~View#element} as a child of the parent in DOM at a specified index.
  88051. *
  88052. * **Note**: If index is not specified, the view's element is pushed as the last child
  88053. * of the parent element.
  88054. *
  88055. * @private
  88056. * @param {module:ui/view~View} view A new view added to the collection.
  88057. * @param {Number} [index] An index the view holds in the collection. When not specified,
  88058. * the view is added at the end.
  88059. */
  88060. _renderViewIntoCollectionParent( view, index ) {
  88061. if ( !view.isRendered ) {
  88062. view.render();
  88063. }
  88064. if ( view.element && this._parentElement ) {
  88065. this._parentElement.insertBefore( view.element, this._parentElement.children[ index ] );
  88066. }
  88067. }
  88068. /**
  88069. * Removes a child view from the collection. If the {@link #setParent parent element} of the
  88070. * collection has been set, the {@link module:ui/view~View#element element} of the view is also removed
  88071. * in DOM, reflecting the order of the collection.
  88072. *
  88073. * See the {@link #add} method.
  88074. *
  88075. * @method #remove
  88076. * @param {module:ui/view~View|Number|String} subject The view to remove, its id or index in the collection.
  88077. * @returns {Object} The removed view.
  88078. */
  88079. }
  88080. // Check if all entries of the array are of `String` type.
  88081. //
  88082. // @private
  88083. // @param {Array} arr An array to be checked.
  88084. // @returns {Boolean}
  88085. function isStringArray( arr ) {
  88086. return arr.every( a => typeof a == 'string' );
  88087. }
  88088. /***/ }),
  88089. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css":
  88090. /*!********************************************************************************!*\
  88091. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css ***!
  88092. \********************************************************************************/
  88093. /*! exports provided: default */
  88094. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88095. "use strict";
  88096. __webpack_require__.r(__webpack_exports__);
  88097. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88098. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88099. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_button_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./button.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css");
  88100. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88101. options.insert = "head";
  88102. options.singleton = true;
  88103. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_button_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88104. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_button_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88105. /***/ }),
  88106. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css":
  88107. /*!**************************************************************************************!*\
  88108. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css ***!
  88109. \**************************************************************************************/
  88110. /*! exports provided: default */
  88111. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88112. "use strict";
  88113. __webpack_require__.r(__webpack_exports__);
  88114. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88115. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88116. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_switchbutton_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./switchbutton.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css");
  88117. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88118. options.insert = "head";
  88119. options.singleton = true;
  88120. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_switchbutton_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88121. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_switchbutton_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88122. /***/ }),
  88123. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css":
  88124. /*!**************************************************************************************!*\
  88125. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css ***!
  88126. \**************************************************************************************/
  88127. /*! exports provided: default */
  88128. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88129. "use strict";
  88130. __webpack_require__.r(__webpack_exports__);
  88131. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88132. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88133. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_colorgrid_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./colorgrid.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css");
  88134. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88135. options.insert = "head";
  88136. options.singleton = true;
  88137. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_colorgrid_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88138. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_colorgrid_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88139. /***/ }),
  88140. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css":
  88141. /*!************************************************************************************!*\
  88142. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css ***!
  88143. \************************************************************************************/
  88144. /*! exports provided: default */
  88145. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88146. "use strict";
  88147. __webpack_require__.r(__webpack_exports__);
  88148. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88149. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88150. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_dropdown_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./dropdown.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css");
  88151. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88152. options.insert = "head";
  88153. options.singleton = true;
  88154. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_dropdown_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88155. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_dropdown_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88156. /***/ }),
  88157. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css":
  88158. /*!****************************************************************************************!*\
  88159. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css ***!
  88160. \****************************************************************************************/
  88161. /*! exports provided: default */
  88162. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88163. "use strict";
  88164. __webpack_require__.r(__webpack_exports__);
  88165. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88166. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88167. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_listdropdown_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./listdropdown.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css");
  88168. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88169. options.insert = "head";
  88170. options.singleton = true;
  88171. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_listdropdown_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88172. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_listdropdown_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88173. /***/ }),
  88174. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css":
  88175. /*!***************************************************************************************!*\
  88176. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css ***!
  88177. \***************************************************************************************/
  88178. /*! exports provided: default */
  88179. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88180. "use strict";
  88181. __webpack_require__.r(__webpack_exports__);
  88182. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88183. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88184. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_splitbutton_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./splitbutton.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css");
  88185. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88186. options.insert = "head";
  88187. options.singleton = true;
  88188. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_splitbutton_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88189. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_splitbutton_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88190. /***/ }),
  88191. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css":
  88192. /*!*******************************************************************************************!*\
  88193. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css ***!
  88194. \*******************************************************************************************/
  88195. /*! exports provided: default */
  88196. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88197. "use strict";
  88198. __webpack_require__.r(__webpack_exports__);
  88199. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88200. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88201. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_toolbardropdown_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./toolbardropdown.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css");
  88202. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88203. options.insert = "head";
  88204. options.singleton = true;
  88205. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_toolbardropdown_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88206. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_toolbardropdown_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88207. /***/ }),
  88208. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css":
  88209. /*!************************************************************************************!*\
  88210. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css ***!
  88211. \************************************************************************************/
  88212. /*! exports provided: default */
  88213. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88214. "use strict";
  88215. __webpack_require__.r(__webpack_exports__);
  88216. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88217. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88218. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_editorui_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./editorui.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css");
  88219. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88220. options.insert = "head";
  88221. options.singleton = true;
  88222. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_editorui_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88223. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_editorui_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88224. /***/ }),
  88225. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css":
  88226. /*!****************************************************************************************!*\
  88227. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css ***!
  88228. \****************************************************************************************/
  88229. /*! exports provided: default */
  88230. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88231. "use strict";
  88232. __webpack_require__.r(__webpack_exports__);
  88233. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88234. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88235. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_formheader_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./formheader.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css");
  88236. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88237. options.insert = "head";
  88238. options.singleton = true;
  88239. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_formheader_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88240. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_formheader_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88241. /***/ }),
  88242. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css":
  88243. /*!****************************************************************************!*\
  88244. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css ***!
  88245. \****************************************************************************/
  88246. /*! exports provided: default */
  88247. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88248. "use strict";
  88249. __webpack_require__.r(__webpack_exports__);
  88250. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88251. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88252. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_icon_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./icon.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css");
  88253. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88254. options.insert = "head";
  88255. options.singleton = true;
  88256. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_icon_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88257. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_icon_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88258. /***/ }),
  88259. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css":
  88260. /*!**************************************************************************************!*\
  88261. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css ***!
  88262. \**************************************************************************************/
  88263. /*! exports provided: default */
  88264. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88265. "use strict";
  88266. __webpack_require__.r(__webpack_exports__);
  88267. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88268. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88269. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_inputtext_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./inputtext.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css");
  88270. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88271. options.insert = "head";
  88272. options.singleton = true;
  88273. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_inputtext_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88274. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_inputtext_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88275. /***/ }),
  88276. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css":
  88277. /*!******************************************************************************!*\
  88278. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css ***!
  88279. \******************************************************************************/
  88280. /*! exports provided: default */
  88281. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88282. "use strict";
  88283. __webpack_require__.r(__webpack_exports__);
  88284. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88285. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88286. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_label_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./label.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css");
  88287. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88288. options.insert = "head";
  88289. options.singleton = true;
  88290. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_label_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88291. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_label_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88292. /***/ }),
  88293. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css":
  88294. /*!************************************************************************************************!*\
  88295. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css ***!
  88296. \************************************************************************************************/
  88297. /*! exports provided: default */
  88298. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88299. "use strict";
  88300. __webpack_require__.r(__webpack_exports__);
  88301. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88302. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88303. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_labeledfieldview_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./labeledfieldview.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css");
  88304. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88305. options.insert = "head";
  88306. options.singleton = true;
  88307. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_labeledfieldview_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88308. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_labeledfieldview_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88309. /***/ }),
  88310. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css":
  88311. /*!****************************************************************************!*\
  88312. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css ***!
  88313. \****************************************************************************/
  88314. /*! exports provided: default */
  88315. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88316. "use strict";
  88317. __webpack_require__.r(__webpack_exports__);
  88318. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88319. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88320. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_list_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./list.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css");
  88321. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88322. options.insert = "head";
  88323. options.singleton = true;
  88324. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_list_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88325. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_list_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88326. /***/ }),
  88327. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css":
  88328. /*!*************************************************************************************!*\
  88329. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css ***!
  88330. \*************************************************************************************/
  88331. /*! exports provided: default */
  88332. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88333. "use strict";
  88334. __webpack_require__.r(__webpack_exports__);
  88335. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88336. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88337. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_balloonpanel_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./balloonpanel.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css");
  88338. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88339. options.insert = "head";
  88340. options.singleton = true;
  88341. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_balloonpanel_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88342. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_balloonpanel_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88343. /***/ }),
  88344. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css":
  88345. /*!***************************************************************************************!*\
  88346. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css ***!
  88347. \***************************************************************************************/
  88348. /*! exports provided: default */
  88349. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88350. "use strict";
  88351. __webpack_require__.r(__webpack_exports__);
  88352. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88353. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88354. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_balloonrotator_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./balloonrotator.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css");
  88355. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88356. options.insert = "head";
  88357. options.singleton = true;
  88358. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_balloonrotator_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88359. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_balloonrotator_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88360. /***/ }),
  88361. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css":
  88362. /*!**********************************************************************************!*\
  88363. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css ***!
  88364. \**********************************************************************************/
  88365. /*! exports provided: default */
  88366. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88367. "use strict";
  88368. __webpack_require__.r(__webpack_exports__);
  88369. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88370. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88371. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_fakepanel_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./fakepanel.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css");
  88372. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88373. options.insert = "head";
  88374. options.singleton = true;
  88375. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_fakepanel_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88376. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_fakepanel_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88377. /***/ }),
  88378. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css":
  88379. /*!************************************************************************************!*\
  88380. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css ***!
  88381. \************************************************************************************/
  88382. /*! exports provided: default */
  88383. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88384. "use strict";
  88385. __webpack_require__.r(__webpack_exports__);
  88386. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88387. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88388. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_stickypanel_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./stickypanel.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css");
  88389. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88390. options.insert = "head";
  88391. options.singleton = true;
  88392. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_stickypanel_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88393. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_stickypanel_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88394. /***/ }),
  88395. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css":
  88396. /*!*************************************************************************************************!*\
  88397. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css ***!
  88398. \*************************************************************************************************/
  88399. /*! exports provided: default */
  88400. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88401. "use strict";
  88402. __webpack_require__.r(__webpack_exports__);
  88403. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88404. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88405. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_responsiveform_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./responsiveform.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css");
  88406. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88407. options.insert = "head";
  88408. options.singleton = true;
  88409. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_responsiveform_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88410. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_responsiveform_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88411. /***/ }),
  88412. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css":
  88413. /*!***************************************************************************************!*\
  88414. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css ***!
  88415. \***************************************************************************************/
  88416. /*! exports provided: default */
  88417. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88418. "use strict";
  88419. __webpack_require__.r(__webpack_exports__);
  88420. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88421. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88422. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_blocktoolbar_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./blocktoolbar.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css");
  88423. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88424. options.insert = "head";
  88425. options.singleton = true;
  88426. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_blocktoolbar_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88427. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_blocktoolbar_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88428. /***/ }),
  88429. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css":
  88430. /*!**********************************************************************************!*\
  88431. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css ***!
  88432. \**********************************************************************************/
  88433. /*! exports provided: default */
  88434. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88435. "use strict";
  88436. __webpack_require__.r(__webpack_exports__);
  88437. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88438. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88439. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_toolbar_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./toolbar.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css");
  88440. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88441. options.insert = "head";
  88442. options.singleton = true;
  88443. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_toolbar_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88444. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_toolbar_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88445. /***/ }),
  88446. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css":
  88447. /*!**********************************************************************************!*\
  88448. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css ***!
  88449. \**********************************************************************************/
  88450. /*! exports provided: default */
  88451. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88452. "use strict";
  88453. __webpack_require__.r(__webpack_exports__);
  88454. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88455. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88456. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_tooltip_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ref--5-2!./tooltip.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css");
  88457. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88458. options.insert = "head";
  88459. options.singleton = true;
  88460. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_tooltip_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88461. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_tooltip_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88462. /***/ }),
  88463. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css":
  88464. /*!***********************************************************************!*\
  88465. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css ***!
  88466. \***********************************************************************/
  88467. /*! exports provided: default */
  88468. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88469. "use strict";
  88470. __webpack_require__.r(__webpack_exports__);
  88471. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  88472. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  88473. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_globals_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../css-loader/dist/cjs.js!../../../../postcss-loader/dist/cjs.js??ref--5-2!./globals.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css");
  88474. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  88475. options.insert = "head";
  88476. options.singleton = true;
  88477. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_globals_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  88478. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_globals_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  88479. /***/ }),
  88480. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/color-tile-check.svg":
  88481. /*!******************************************************************************!*\
  88482. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/icons/color-tile-check.svg ***!
  88483. \******************************************************************************/
  88484. /*! exports provided: default */
  88485. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88486. "use strict";
  88487. __webpack_require__.r(__webpack_exports__);
  88488. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path class=\"ck-icon__fill\" d=\"M16.935 5.328a2 2 0 0 1 0 2.829l-7.778 7.778a2 2 0 0 1-2.829 0L3.5 13.107a1.999 1.999 0 1 1 2.828-2.829l.707.707a1 1 0 0 0 1.414 0l5.658-5.657a2 2 0 0 1 2.828 0z\"/><path d=\"M14.814 6.035 8.448 12.4a1 1 0 0 1-1.414 0l-1.413-1.415A1 1 0 1 0 4.207 12.4l2.829 2.829a1 1 0 0 0 1.414 0l7.778-7.778a1 1 0 1 0-1.414-1.415z\"/></svg>");
  88489. /***/ }),
  88490. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg":
  88491. /*!****************************************************************************!*\
  88492. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg ***!
  88493. \****************************************************************************/
  88494. /*! exports provided: default */
  88495. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88496. "use strict";
  88497. __webpack_require__.r(__webpack_exports__);
  88498. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 10 10\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z\"/></svg>");
  88499. /***/ }),
  88500. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/next-arrow.svg":
  88501. /*!************************************************************************!*\
  88502. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/icons/next-arrow.svg ***!
  88503. \************************************************************************/
  88504. /*! exports provided: default */
  88505. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88506. "use strict";
  88507. __webpack_require__.r(__webpack_exports__);
  88508. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8.537 14.813a.888.888 0 1 1-1.254-1.255L10.84 10 7.283 6.442a.888.888 0 1 1 1.254-1.255L12.74 9.39a.888.888 0 0 1-.16 1.382l-4.043 4.042z\"/></svg>");
  88509. /***/ }),
  88510. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/previous-arrow.svg":
  88511. /*!****************************************************************************!*\
  88512. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/icons/previous-arrow.svg ***!
  88513. \****************************************************************************/
  88514. /*! exports provided: default */
  88515. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88516. "use strict";
  88517. __webpack_require__.r(__webpack_exports__);
  88518. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z\"/></svg>");
  88519. /***/ }),
  88520. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js":
  88521. /*!******************************************************************!*\
  88522. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js ***!
  88523. \******************************************************************/
  88524. /*! exports provided: default */
  88525. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88526. "use strict";
  88527. __webpack_require__.r(__webpack_exports__);
  88528. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BaseCommand; });
  88529. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  88530. /* harmony import */ var _ckeditor_ckeditor5_engine_src_model_operation_transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/model/operation/transform */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.js");
  88531. /**
  88532. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88533. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88534. */
  88535. /**
  88536. * @module undo/basecommand
  88537. */
  88538. /**
  88539. * Base class for undo feature commands: {@link module:undo/undocommand~UndoCommand} and {@link module:undo/redocommand~RedoCommand}.
  88540. *
  88541. * @protected
  88542. * @extends module:core/command~Command
  88543. */
  88544. class BaseCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  88545. constructor( editor ) {
  88546. super( editor );
  88547. /**
  88548. * Stack of items stored by the command. These are pairs of:
  88549. *
  88550. * * {@link module:engine/model/batch~Batch batch} saved by the command,
  88551. * * {@link module:engine/model/selection~Selection selection} state at the moment of saving the batch.
  88552. *
  88553. * @protected
  88554. * @member {Array} #_stack
  88555. */
  88556. this._stack = [];
  88557. /**
  88558. * Stores all batches that were created by this command.
  88559. *
  88560. * @protected
  88561. * @member {WeakSet.<module:engine/model/batch~Batch>} #_createdBatches
  88562. */
  88563. this._createdBatches = new WeakSet();
  88564. // Refresh state, so the command is inactive right after initialization.
  88565. this.refresh();
  88566. // Set the transparent batch for the `editor.data.set()` call if the
  88567. // batch type is not set already.
  88568. this.listenTo( editor.data, 'set', ( evt, data ) => {
  88569. // Create a shallow copy of the options to not change the original args.
  88570. // And make sure that an object is assigned to data[ 1 ].
  88571. data[ 1 ] = { ...data[ 1 ] };
  88572. const options = data[ 1 ];
  88573. if ( options.batchType ) {
  88574. return;
  88575. }
  88576. options.batchType = 'transparent';
  88577. }, { priority: 'high' } );
  88578. // Clear the stack for the `transparent` batches.
  88579. this.listenTo( editor.data, 'set', ( evt, data ) => {
  88580. // We can assume that the object exists - it was ensured
  88581. // with the high priority listener before.
  88582. const options = data[ 1 ];
  88583. if ( options.batchType === 'transparent' ) {
  88584. this.clearStack();
  88585. }
  88586. } );
  88587. }
  88588. /**
  88589. * @inheritDoc
  88590. */
  88591. refresh() {
  88592. this.isEnabled = this._stack.length > 0;
  88593. }
  88594. /**
  88595. * Stores a batch in the command, together with the selection state of the {@link module:engine/model/document~Document document}
  88596. * created by the editor which this command is registered to.
  88597. *
  88598. * @param {module:engine/model/batch~Batch} batch The batch to add.
  88599. */
  88600. addBatch( batch ) {
  88601. const docSelection = this.editor.model.document.selection;
  88602. const selection = {
  88603. ranges: docSelection.hasOwnRange ? Array.from( docSelection.getRanges() ) : [],
  88604. isBackward: docSelection.isBackward
  88605. };
  88606. this._stack.push( { batch, selection } );
  88607. this.refresh();
  88608. }
  88609. /**
  88610. * Removes all items from the stack.
  88611. */
  88612. clearStack() {
  88613. this._stack = [];
  88614. this.refresh();
  88615. }
  88616. /**
  88617. * Restores the {@link module:engine/model/document~Document#selection document selection} state after a batch was undone.
  88618. *
  88619. * @protected
  88620. * @param {Array.<module:engine/model/range~Range>} ranges Ranges to be restored.
  88621. * @param {Boolean} isBackward A flag describing whether the restored range was selected forward or backward.
  88622. * @param {Array.<module:engine/model/operation/operation~Operation>} operations Operations which has been applied
  88623. * since selection has been stored.
  88624. */
  88625. _restoreSelection( ranges, isBackward, operations ) {
  88626. const model = this.editor.model;
  88627. const document = model.document;
  88628. // This will keep the transformed selection ranges.
  88629. const selectionRanges = [];
  88630. // Transform all ranges from the restored selection.
  88631. const transformedRangeGroups = ranges.map( range => range.getTransformedByOperations( operations ) );
  88632. const allRanges = transformedRangeGroups.flat();
  88633. for ( const rangeGroup of transformedRangeGroups ) {
  88634. // While transforming there could appear ranges that are contained by other ranges, we shall ignore them.
  88635. const transformed = rangeGroup
  88636. .filter( range => range.root != document.graveyard )
  88637. .filter( range => !isRangeContainedByAnyOtherRange( range, allRanges ) );
  88638. // All the transformed ranges ended up in graveyard.
  88639. if ( !transformed.length ) {
  88640. continue;
  88641. }
  88642. // After the range got transformed, we have an array of ranges. Some of those
  88643. // ranges may be "touching" -- they can be next to each other and could be merged.
  88644. normalizeRanges( transformed );
  88645. // For each `range` from `ranges`, we take only one transformed range.
  88646. // This is because we want to prevent situation where single-range selection
  88647. // got transformed to multi-range selection.
  88648. selectionRanges.push( transformed[ 0 ] );
  88649. }
  88650. // @if CK_DEBUG_ENGINE // console.log( `Restored selection by undo: ${ selectionRanges.join( ', ' ) }` );
  88651. // `selectionRanges` may be empty if all ranges ended up in graveyard. If that is the case, do not restore selection.
  88652. if ( selectionRanges.length ) {
  88653. model.change( writer => {
  88654. writer.setSelection( selectionRanges, { backward: isBackward } );
  88655. } );
  88656. }
  88657. }
  88658. /**
  88659. * Undoes a batch by reversing that batch, transforming reversed batch and finally applying it.
  88660. * This is a helper method for {@link #execute}.
  88661. *
  88662. * @protected
  88663. * @param {module:engine/model/batch~Batch} batchToUndo The batch to be undone.
  88664. * @param {module:engine/model/batch~Batch} undoingBatch The batch that will contain undoing changes.
  88665. */
  88666. _undo( batchToUndo, undoingBatch ) {
  88667. const model = this.editor.model;
  88668. const document = model.document;
  88669. // All changes done by the command execution will be saved as one batch.
  88670. this._createdBatches.add( undoingBatch );
  88671. const operationsToUndo = batchToUndo.operations.slice().filter( operation => operation.isDocumentOperation );
  88672. operationsToUndo.reverse();
  88673. // We will process each operation from `batchToUndo`, in reverse order. If there were operations A, B and C in undone batch,
  88674. // we need to revert them in reverse order, so first C' (reversed C), then B', then A'.
  88675. for ( const operationToUndo of operationsToUndo ) {
  88676. const nextBaseVersion = operationToUndo.baseVersion + 1;
  88677. const historyOperations = Array.from( document.history.getOperations( nextBaseVersion ) );
  88678. const transformedSets = Object(_ckeditor_ckeditor5_engine_src_model_operation_transform__WEBPACK_IMPORTED_MODULE_1__["transformSets"])(
  88679. [ operationToUndo.getReversed() ],
  88680. historyOperations,
  88681. {
  88682. useRelations: true,
  88683. document: this.editor.model.document,
  88684. padWithNoOps: false,
  88685. forceWeakRemove: true
  88686. }
  88687. );
  88688. const reversedOperations = transformedSets.operationsA;
  88689. // After reversed operation has been transformed by all history operations, apply it.
  88690. for ( const operation of reversedOperations ) {
  88691. // Before applying, add the operation to the `undoingBatch`.
  88692. undoingBatch.addOperation( operation );
  88693. model.applyOperation( operation );
  88694. document.history.setOperationAsUndone( operationToUndo, operation );
  88695. }
  88696. }
  88697. }
  88698. }
  88699. // Normalizes list of ranges by joining intersecting or "touching" ranges.
  88700. //
  88701. // @param {Array.<module:engine/model/range~Range>} ranges
  88702. //
  88703. function normalizeRanges( ranges ) {
  88704. ranges.sort( ( a, b ) => a.start.isBefore( b.start ) ? -1 : 1 );
  88705. for ( let i = 1; i < ranges.length; i++ ) {
  88706. const previousRange = ranges[ i - 1 ];
  88707. const joinedRange = previousRange.getJoined( ranges[ i ], true );
  88708. if ( joinedRange ) {
  88709. // Replace the ranges on the list with the new joined range.
  88710. i--;
  88711. ranges.splice( i, 2, joinedRange );
  88712. }
  88713. }
  88714. }
  88715. function isRangeContainedByAnyOtherRange( range, ranges ) {
  88716. return ranges.some( otherRange => otherRange !== range && otherRange.containsRange( range, true ) );
  88717. }
  88718. /***/ }),
  88719. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/index.js":
  88720. /*!************************************************************!*\
  88721. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/index.js ***!
  88722. \************************************************************/
  88723. /*! exports provided: Undo, UndoEditing, UndoUi */
  88724. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88725. "use strict";
  88726. __webpack_require__.r(__webpack_exports__);
  88727. /* harmony import */ var _undo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./undo */ "./node_modules/@ckeditor/ckeditor5-undo/src/undo.js");
  88728. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Undo", function() { return _undo__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  88729. /* harmony import */ var _undoediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./undoediting */ "./node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js");
  88730. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UndoEditing", function() { return _undoediting__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  88731. /* harmony import */ var _undoui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./undoui */ "./node_modules/@ckeditor/ckeditor5-undo/src/undoui.js");
  88732. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UndoUi", function() { return _undoui__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  88733. /**
  88734. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88735. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88736. */
  88737. /**
  88738. * @module undo
  88739. */
  88740. /***/ }),
  88741. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/redocommand.js":
  88742. /*!******************************************************************!*\
  88743. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/redocommand.js ***!
  88744. \******************************************************************/
  88745. /*! exports provided: default */
  88746. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88747. "use strict";
  88748. __webpack_require__.r(__webpack_exports__);
  88749. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RedoCommand; });
  88750. /* harmony import */ var _basecommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basecommand */ "./node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js");
  88751. /**
  88752. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88753. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88754. */
  88755. /**
  88756. * @module undo/redocommand
  88757. */
  88758. /**
  88759. * The redo command stores {@link module:engine/model/batch~Batch batches} that were used to undo a batch by
  88760. * {@link module:undo/undocommand~UndoCommand}. It is able to redo a previously undone batch by reversing the undoing
  88761. * batches created by `UndoCommand`. The reversed batch is transformed by all the batches from
  88762. * {@link module:engine/model/document~Document#history history} that happened after the reversed undo batch.
  88763. *
  88764. * The redo command also takes care of restoring the {@link module:engine/model/document~Document#selection document selection}.
  88765. *
  88766. * @extends module:undo/basecommand~BaseCommand
  88767. */
  88768. class RedoCommand extends _basecommand__WEBPACK_IMPORTED_MODULE_0__["default"] {
  88769. /**
  88770. * Executes the command. This method reverts the last {@link module:engine/model/batch~Batch batch} added to
  88771. * the command's stack, applies the reverted and transformed version on the
  88772. * {@link module:engine/model/document~Document document} and removes the batch from the stack.
  88773. * Then, it restores the {@link module:engine/model/document~Document#selection document selection}.
  88774. *
  88775. * @fires execute
  88776. */
  88777. execute() {
  88778. const item = this._stack.pop();
  88779. const redoingBatch = this.editor.model.createBatch( 'transparent' );
  88780. // All changes have to be done in one `enqueueChange` callback so other listeners will not step between consecutive
  88781. // operations, or won't do changes to the document before selection is properly restored.
  88782. this.editor.model.enqueueChange( redoingBatch, () => {
  88783. const lastOperation = item.batch.operations[ item.batch.operations.length - 1 ];
  88784. const nextBaseVersion = lastOperation.baseVersion + 1;
  88785. const operations = this.editor.model.document.history.getOperations( nextBaseVersion );
  88786. this._restoreSelection( item.selection.ranges, item.selection.isBackward, operations );
  88787. this._undo( item.batch, redoingBatch );
  88788. } );
  88789. this.refresh();
  88790. }
  88791. }
  88792. /***/ }),
  88793. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/undo.js":
  88794. /*!***********************************************************!*\
  88795. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/undo.js ***!
  88796. \***********************************************************/
  88797. /*! exports provided: default */
  88798. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88799. "use strict";
  88800. __webpack_require__.r(__webpack_exports__);
  88801. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Undo; });
  88802. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  88803. /* harmony import */ var _undoediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./undoediting */ "./node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js");
  88804. /* harmony import */ var _undoui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./undoui */ "./node_modules/@ckeditor/ckeditor5-undo/src/undoui.js");
  88805. /**
  88806. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88807. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88808. */
  88809. /**
  88810. * @module undo/undo
  88811. */
  88812. /**
  88813. * The undo feature.
  88814. *
  88815. * This is a "glue" plugin which loads the {@link module:undo/undoediting~UndoEditing undo editing feature}
  88816. * and {@link module:undo/undoui~UndoUI undo UI feature}.
  88817. *
  88818. * Below is the explanation of the undo mechanism working together with {@link module:engine/model/history~History History}:
  88819. *
  88820. * Whenever a {@link module:engine/model/operation/operation~Operation operation} is applied to the
  88821. * {@link module:engine/model/document~Document document}, it is saved to `History` as is.
  88822. * The {@link module:engine/model/batch~Batch batch} that owns that operation is also saved, in
  88823. * {@link module:undo/undocommand~UndoCommand}, together with the selection that was present in the document before the
  88824. * operation was applied. A batch is saved instead of the operation because changes are undone batch-by-batch, not operation-by-operation
  88825. * and a batch is seen as one undo step.
  88826. *
  88827. * After some changes happen to the document, the `History` and `UndoCommand` stack can be represented as follows:
  88828. *
  88829. * History Undo stack
  88830. * ============== ==================================
  88831. * [operation A1] [batch A]
  88832. * [operation B1] [batch B]
  88833. * [operation B2] [batch C]
  88834. * [operation C1]
  88835. * [operation C2]
  88836. * [operation B3]
  88837. * [operation C3]
  88838. *
  88839. * Where operations starting with the same letter are from same batch.
  88840. *
  88841. * Undoing a batch means that a set of operations which will reverse the effects of that batch needs to be generated.
  88842. * For example, if a batch added several letters, undoing the batch should remove them. It is important to apply undoing
  88843. * operations in the reversed order, so if a batch has operation `X`, `Y`, `Z`, reversed operations `Zr`, `Yr` and `Xr`
  88844. * need to be applied. Otherwise reversed operation `Xr` would operate on a wrong document state, because operation `X`
  88845. * does not know that operations `Y` and `Z` happened.
  88846. *
  88847. * After operations from an undone batch got {@link module:engine/model/operation/operation~Operation#getReversed reversed},
  88848. * one needs to make sure if they are ready to be applied. In the scenario above, operation `C3` is the last operation and `C3r`
  88849. * bases on up-to-date document state, so it can be applied to the document.
  88850. *
  88851. * History Undo stack
  88852. * ================= ==================================
  88853. * [ operation A1 ] [ batch A ]
  88854. * [ operation B1 ] [ batch B ]
  88855. * [ operation B2 ] [ processing undoing batch C ]
  88856. * [ operation C1 ]
  88857. * [ operation C2 ]
  88858. * [ operation B3 ]
  88859. * [ operation C3 ]
  88860. * [ operation C3r ]
  88861. *
  88862. * Next is operation `C2`, reversed to `C2r`. `C2r` bases on `C2`, so it bases on the wrong document state. It needs to be
  88863. * transformed by operations from history that happened after it, so it "knows" about them. Let us assume that `C2' = C2r * B3 * C3 * C3r`,
  88864. * where `*` means "transformed by". Rest of operations from that batch are processed in the same fashion.
  88865. *
  88866. * History Undo stack Redo stack
  88867. * ================= ================================== ==================================
  88868. * [ operation A1 ] [ batch A ] [ batch Cr ]
  88869. * [ operation B1 ] [ batch B ]
  88870. * [ operation B2 ]
  88871. * [ operation C1 ]
  88872. * [ operation C2 ]
  88873. * [ operation B3 ]
  88874. * [ operation C3 ]
  88875. * [ operation C3r ]
  88876. * [ operation C2' ]
  88877. * [ operation C1' ]
  88878. *
  88879. * Selective undo works on the same basis, however, instead of undoing the last batch in the undo stack, any batch can be undone.
  88880. * The same algorithm applies: operations from a batch (i.e. `A1`) are reversed and then transformed by operations stored in history.
  88881. *
  88882. * Redo also is very similar to undo. It has its own stack that is filled with undoing (reversed batches). Operations from
  88883. * batch that is re-done are reversed-back, transformed in proper order and applied to the document.
  88884. *
  88885. * History Undo stack Redo stack
  88886. * ================= ================================== ==================================
  88887. * [ operation A1 ] [ batch A ]
  88888. * [ operation B1 ] [ batch B ]
  88889. * [ operation B2 ] [ batch Crr ]
  88890. * [ operation C1 ]
  88891. * [ operation C2 ]
  88892. * [ operation B3 ]
  88893. * [ operation C3 ]
  88894. * [ operation C3r ]
  88895. * [ operation C2' ]
  88896. * [ operation C1' ]
  88897. * [ operation C1'r]
  88898. * [ operation C2'r]
  88899. * [ operation C3rr]
  88900. *
  88901. * @extends module:core/plugin~Plugin
  88902. */
  88903. class Undo extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  88904. /**
  88905. * @inheritDoc
  88906. */
  88907. static get requires() {
  88908. return [ _undoediting__WEBPACK_IMPORTED_MODULE_1__["default"], _undoui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  88909. }
  88910. /**
  88911. * @inheritDoc
  88912. */
  88913. static get pluginName() {
  88914. return 'Undo';
  88915. }
  88916. }
  88917. /***/ }),
  88918. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/undocommand.js":
  88919. /*!******************************************************************!*\
  88920. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/undocommand.js ***!
  88921. \******************************************************************/
  88922. /*! exports provided: default */
  88923. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88924. "use strict";
  88925. __webpack_require__.r(__webpack_exports__);
  88926. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UndoCommand; });
  88927. /* harmony import */ var _basecommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basecommand */ "./node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js");
  88928. /**
  88929. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88930. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88931. */
  88932. /**
  88933. * @module undo/undocommand
  88934. */
  88935. /**
  88936. * The undo command stores {@link module:engine/model/batch~Batch batches} applied to the
  88937. * {@link module:engine/model/document~Document document} and is able to undo a batch by reversing it and transforming by
  88938. * batches from {@link module:engine/model/document~Document#history history} that happened after the reversed batch.
  88939. *
  88940. * The undo command also takes care of restoring the {@link module:engine/model/document~Document#selection document selection}.
  88941. *
  88942. * @extends module:undo/basecommand~BaseCommand
  88943. */
  88944. class UndoCommand extends _basecommand__WEBPACK_IMPORTED_MODULE_0__["default"] {
  88945. /**
  88946. * Executes the command. This method reverts a {@link module:engine/model/batch~Batch batch} added to the command's stack, transforms
  88947. * and applies the reverted version on the {@link module:engine/model/document~Document document} and removes the batch from the stack.
  88948. * Then, it restores the {@link module:engine/model/document~Document#selection document selection}.
  88949. *
  88950. * @fires execute
  88951. * @fires revert
  88952. * @param {module:engine/model/batch~Batch} [batch] A batch that should be undone. If not set, the last added batch will be undone.
  88953. */
  88954. execute( batch = null ) {
  88955. // If batch is not given, set `batchIndex` to the last index in command stack.
  88956. const batchIndex = batch ? this._stack.findIndex( a => a.batch == batch ) : this._stack.length - 1;
  88957. const item = this._stack.splice( batchIndex, 1 )[ 0 ];
  88958. const undoingBatch = this.editor.model.createBatch( 'transparent' );
  88959. // All changes has to be done in one `enqueueChange` callback so other listeners will not
  88960. // step between consecutive operations, or won't do changes to the document before selection is properly restored.
  88961. this.editor.model.enqueueChange( undoingBatch, () => {
  88962. this._undo( item.batch, undoingBatch );
  88963. const operations = this.editor.model.document.history.getOperations( item.batch.baseVersion );
  88964. this._restoreSelection( item.selection.ranges, item.selection.isBackward, operations );
  88965. this.fire( 'revert', item.batch, undoingBatch );
  88966. } );
  88967. this.refresh();
  88968. }
  88969. }
  88970. /**
  88971. * Fired when execution of the command reverts some batch.
  88972. *
  88973. * @event revert
  88974. */
  88975. /***/ }),
  88976. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js":
  88977. /*!******************************************************************!*\
  88978. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js ***!
  88979. \******************************************************************/
  88980. /*! exports provided: default */
  88981. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88982. "use strict";
  88983. __webpack_require__.r(__webpack_exports__);
  88984. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UndoEditing; });
  88985. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  88986. /* harmony import */ var _undocommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./undocommand */ "./node_modules/@ckeditor/ckeditor5-undo/src/undocommand.js");
  88987. /* harmony import */ var _redocommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./redocommand */ "./node_modules/@ckeditor/ckeditor5-undo/src/redocommand.js");
  88988. /**
  88989. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  88990. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88991. */
  88992. /**
  88993. * @module undo/undoediting
  88994. */
  88995. /**
  88996. * The undo engine feature.
  88997. *
  88998. * It introduces the `'undo'` and `'redo'` commands to the editor.
  88999. *
  89000. * @extends module:core/plugin~Plugin
  89001. */
  89002. class UndoEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  89003. /**
  89004. * @inheritDoc
  89005. */
  89006. static get pluginName() {
  89007. return 'UndoEditing';
  89008. }
  89009. /**
  89010. * @inheritDoc
  89011. */
  89012. constructor( editor ) {
  89013. super( editor );
  89014. /**
  89015. * The command that manages undo {@link module:engine/model/batch~Batch batches} stack (history).
  89016. * Created and registered during the {@link #init feature initialization}.
  89017. *
  89018. * @private
  89019. * @member {module:undo/undocommand~UndoCommand} #_undoCommand
  89020. */
  89021. /**
  89022. * The command that manages redo {@link module:engine/model/batch~Batch batches} stack (history).
  89023. * Created and registered during the {@link #init feature initialization}.
  89024. *
  89025. * @private
  89026. * @member {module:undo/undocommand~UndoCommand} #_redoCommand
  89027. */
  89028. /**
  89029. * Keeps track of which batches were registered in undo.
  89030. *
  89031. * @private
  89032. * @member {WeakSet.<module:engine/model/batch~Batch>}
  89033. */
  89034. this._batchRegistry = new WeakSet();
  89035. }
  89036. /**
  89037. * @inheritDoc
  89038. */
  89039. init() {
  89040. const editor = this.editor;
  89041. // Create commands.
  89042. this._undoCommand = new _undocommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor );
  89043. this._redoCommand = new _redocommand__WEBPACK_IMPORTED_MODULE_2__["default"]( editor );
  89044. // Register command to the editor.
  89045. editor.commands.add( 'undo', this._undoCommand );
  89046. editor.commands.add( 'redo', this._redoCommand );
  89047. this.listenTo( editor.model, 'applyOperation', ( evt, args ) => {
  89048. const operation = args[ 0 ];
  89049. // Do not register batch if the operation is not a document operation.
  89050. // This prevents from creating empty undo steps, where all operations where non-document operations.
  89051. // Non-document operations creates and alters content in detached tree fragments (for example, document fragments).
  89052. // Most of time this is preparing data before it is inserted into actual tree (for example during copy & paste).
  89053. // Such operations should not be reversed.
  89054. if ( !operation.isDocumentOperation ) {
  89055. return;
  89056. }
  89057. const batch = operation.batch;
  89058. const isRedoBatch = this._redoCommand._createdBatches.has( batch );
  89059. const isUndoBatch = this._undoCommand._createdBatches.has( batch );
  89060. const isRegisteredBatch = this._batchRegistry.has( batch );
  89061. // If changes are not a part of a batch or this is not a new batch, omit those changes.
  89062. if ( isRegisteredBatch || ( batch.type == 'transparent' && !isRedoBatch && !isUndoBatch ) ) {
  89063. return;
  89064. } else {
  89065. if ( isRedoBatch ) {
  89066. // If this batch comes from `redoCommand`, add it to `undoCommand` stack.
  89067. this._undoCommand.addBatch( batch );
  89068. } else if ( !isUndoBatch ) {
  89069. // A default batch - these are new changes in the document, not introduced by undo feature.
  89070. // Add them to `undoCommand` stack and clear `redoCommand` stack.
  89071. this._undoCommand.addBatch( batch );
  89072. this._redoCommand.clearStack();
  89073. }
  89074. }
  89075. // Add the batch to the registry so it will not be processed again.
  89076. this._batchRegistry.add( batch );
  89077. }, { priority: 'highest' } );
  89078. this.listenTo( this._undoCommand, 'revert', ( evt, undoneBatch, undoingBatch ) => {
  89079. this._redoCommand.addBatch( undoingBatch );
  89080. } );
  89081. editor.keystrokes.set( 'CTRL+Z', 'undo' );
  89082. editor.keystrokes.set( 'CTRL+Y', 'redo' );
  89083. editor.keystrokes.set( 'CTRL+SHIFT+Z', 'redo' );
  89084. }
  89085. }
  89086. /***/ }),
  89087. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/undoui.js":
  89088. /*!*************************************************************!*\
  89089. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/undoui.js ***!
  89090. \*************************************************************/
  89091. /*! exports provided: default */
  89092. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89093. "use strict";
  89094. __webpack_require__.r(__webpack_exports__);
  89095. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UndoUI; });
  89096. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  89097. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  89098. /* harmony import */ var _theme_icons_undo_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/undo.svg */ "./node_modules/@ckeditor/ckeditor5-undo/theme/icons/undo.svg");
  89099. /* harmony import */ var _theme_icons_redo_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/icons/redo.svg */ "./node_modules/@ckeditor/ckeditor5-undo/theme/icons/redo.svg");
  89100. /**
  89101. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  89102. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  89103. */
  89104. /**
  89105. * @module undo/undoui
  89106. */
  89107. /**
  89108. * The undo UI feature. It introduces the `'undo'` and `'redo'` buttons to the editor.
  89109. *
  89110. * @extends module:core/plugin~Plugin
  89111. */
  89112. class UndoUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  89113. /**
  89114. * @inheritDoc
  89115. */
  89116. static get pluginName() {
  89117. return 'UndoUI';
  89118. }
  89119. /**
  89120. * @inheritDoc
  89121. */
  89122. init() {
  89123. const editor = this.editor;
  89124. const locale = editor.locale;
  89125. const t = editor.t;
  89126. const localizedUndoIcon = locale.uiLanguageDirection == 'ltr' ? _theme_icons_undo_svg__WEBPACK_IMPORTED_MODULE_2__["default"] : _theme_icons_redo_svg__WEBPACK_IMPORTED_MODULE_3__["default"];
  89127. const localizedRedoIcon = locale.uiLanguageDirection == 'ltr' ? _theme_icons_redo_svg__WEBPACK_IMPORTED_MODULE_3__["default"] : _theme_icons_undo_svg__WEBPACK_IMPORTED_MODULE_2__["default"];
  89128. this._addButton( 'undo', t( 'Undo' ), 'CTRL+Z', localizedUndoIcon );
  89129. this._addButton( 'redo', t( 'Redo' ), 'CTRL+Y', localizedRedoIcon );
  89130. }
  89131. /**
  89132. * Creates a button for the specified command.
  89133. *
  89134. * @private
  89135. * @param {String} name Command name.
  89136. * @param {String} label Button label.
  89137. * @param {String} keystroke Command keystroke.
  89138. * @param {String} Icon Source of the icon.
  89139. */
  89140. _addButton( name, label, keystroke, Icon ) {
  89141. const editor = this.editor;
  89142. editor.ui.componentFactory.add( name, locale => {
  89143. const command = editor.commands.get( name );
  89144. const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  89145. view.set( {
  89146. label,
  89147. icon: Icon,
  89148. keystroke,
  89149. tooltip: true
  89150. } );
  89151. view.bind( 'isEnabled' ).to( command, 'isEnabled' );
  89152. this.listenTo( view, 'execute', () => {
  89153. editor.execute( name );
  89154. editor.editing.view.focus();
  89155. } );
  89156. return view;
  89157. } );
  89158. }
  89159. }
  89160. /***/ }),
  89161. /***/ "./node_modules/@ckeditor/ckeditor5-undo/theme/icons/redo.svg":
  89162. /*!********************************************************************!*\
  89163. !*** ./node_modules/@ckeditor/ckeditor5-undo/theme/icons/redo.svg ***!
  89164. \********************************************************************/
  89165. /*! exports provided: default */
  89166. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89167. "use strict";
  89168. __webpack_require__.r(__webpack_exports__);
  89169. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m14.958 9.367-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.747.747 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.75.75 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032h8.927z\"/></svg>");
  89170. /***/ }),
  89171. /***/ "./node_modules/@ckeditor/ckeditor5-undo/theme/icons/undo.svg":
  89172. /*!********************************************************************!*\
  89173. !*** ./node_modules/@ckeditor/ckeditor5-undo/theme/icons/undo.svg ***!
  89174. \********************************************************************/
  89175. /*! exports provided: default */
  89176. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89177. "use strict";
  89178. __webpack_require__.r(__webpack_exports__);
  89179. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m5.042 9.367 2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.747.747 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.75.75 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032H5.042z\"/></svg>");
  89180. /***/ }),
  89181. /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/adapters/base64uploadadapter.js":
  89182. /*!*************************************************************************************!*\
  89183. !*** ./node_modules/@ckeditor/ckeditor5-upload/src/adapters/base64uploadadapter.js ***!
  89184. \*************************************************************************************/
  89185. /*! exports provided: default */
  89186. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89187. "use strict";
  89188. __webpack_require__.r(__webpack_exports__);
  89189. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Base64UploadAdapter; });
  89190. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  89191. /* harmony import */ var _filerepository__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../filerepository */ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js");
  89192. /**
  89193. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  89194. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  89195. */
  89196. /**
  89197. * @module upload/adapters/base64uploadadapter
  89198. */
  89199. /* globals window */
  89200. /**
  89201. * A plugin that converts images inserted into the editor into [Base64 strings](https://en.wikipedia.org/wiki/Base64)
  89202. * in the {@glink builds/guides/integration/saving-data editor output}.
  89203. *
  89204. * This kind of image upload does not require server processing – images are stored with the rest of the text and
  89205. * displayed by the web browser without additional requests.
  89206. *
  89207. * Check out the {@glink features/images/image-upload/image-upload comprehensive "Image upload overview"} to learn about
  89208. * other ways to upload images into CKEditor 5.
  89209. *
  89210. * @extends module:core/plugin~Plugin
  89211. */
  89212. class Base64UploadAdapter extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  89213. /**
  89214. * @inheritDoc
  89215. */
  89216. static get requires() {
  89217. return [ _filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  89218. }
  89219. /**
  89220. * @inheritDoc
  89221. */
  89222. static get pluginName() {
  89223. return 'Base64UploadAdapter';
  89224. }
  89225. /**
  89226. * @inheritDoc
  89227. */
  89228. init() {
  89229. this.editor.plugins.get( _filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] ).createUploadAdapter = loader => new Adapter( loader );
  89230. }
  89231. }
  89232. /**
  89233. * The upload adapter that converts images inserted into the editor into Base64 strings.
  89234. *
  89235. * @private
  89236. * @implements module:upload/filerepository~UploadAdapter
  89237. */
  89238. class Adapter {
  89239. /**
  89240. * Creates a new adapter instance.
  89241. *
  89242. * @param {module:upload/filerepository~FileLoader} loader
  89243. */
  89244. constructor( loader ) {
  89245. /**
  89246. * `FileLoader` instance to use during the upload.
  89247. *
  89248. * @member {module:upload/filerepository~FileLoader} #loader
  89249. */
  89250. this.loader = loader;
  89251. }
  89252. /**
  89253. * Starts the upload process.
  89254. *
  89255. * @see module:upload/filerepository~UploadAdapter#upload
  89256. * @returns {Promise}
  89257. */
  89258. upload() {
  89259. return new Promise( ( resolve, reject ) => {
  89260. const reader = this.reader = new window.FileReader();
  89261. reader.addEventListener( 'load', () => {
  89262. resolve( { default: reader.result } );
  89263. } );
  89264. reader.addEventListener( 'error', err => {
  89265. reject( err );
  89266. } );
  89267. reader.addEventListener( 'abort', () => {
  89268. reject();
  89269. } );
  89270. this.loader.file.then( file => {
  89271. reader.readAsDataURL( file );
  89272. } );
  89273. } );
  89274. }
  89275. /**
  89276. * Aborts the upload process.
  89277. *
  89278. * @see module:upload/filerepository~UploadAdapter#abort
  89279. * @returns {Promise}
  89280. */
  89281. abort() {
  89282. this.reader.abort();
  89283. }
  89284. }
  89285. /***/ }),
  89286. /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter.js":
  89287. /*!*************************************************************************************!*\
  89288. !*** ./node_modules/@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter.js ***!
  89289. \*************************************************************************************/
  89290. /*! exports provided: default */
  89291. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89292. "use strict";
  89293. __webpack_require__.r(__webpack_exports__);
  89294. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SimpleUploadAdapter; });
  89295. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  89296. /* harmony import */ var _filerepository__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../filerepository */ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js");
  89297. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  89298. /**
  89299. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  89300. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  89301. */
  89302. /**
  89303. * @module upload/adapters/simpleuploadadapter
  89304. */
  89305. /* globals XMLHttpRequest, FormData */
  89306. /**
  89307. * The Simple upload adapter allows uploading images to an application running on your server using
  89308. * the [`XMLHttpRequest`](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) API with a
  89309. * minimal {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig editor configuration}.
  89310. *
  89311. * ClassicEditor
  89312. * .create( document.querySelector( '#editor' ), {
  89313. * simpleUpload: {
  89314. * uploadUrl: 'http://example.com',
  89315. * headers: {
  89316. * ...
  89317. * }
  89318. * }
  89319. * } )
  89320. * .then( ... )
  89321. * .catch( ... );
  89322. *
  89323. * See the {@glink features/images/image-upload/simple-upload-adapter "Simple upload adapter"} guide to learn how to
  89324. * learn more about the feature (configuration, server–side requirements, etc.).
  89325. *
  89326. * Check out the {@glink features/images/image-upload/image-upload comprehensive "Image upload overview"} to learn about
  89327. * other ways to upload images into CKEditor 5.
  89328. *
  89329. * @extends module:core/plugin~Plugin
  89330. */
  89331. class SimpleUploadAdapter extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  89332. /**
  89333. * @inheritDoc
  89334. */
  89335. static get requires() {
  89336. return [ _filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  89337. }
  89338. /**
  89339. * @inheritDoc
  89340. */
  89341. static get pluginName() {
  89342. return 'SimpleUploadAdapter';
  89343. }
  89344. /**
  89345. * @inheritDoc
  89346. */
  89347. init() {
  89348. const options = this.editor.config.get( 'simpleUpload' );
  89349. if ( !options ) {
  89350. return;
  89351. }
  89352. if ( !options.uploadUrl ) {
  89353. /**
  89354. * The {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#uploadUrl `config.simpleUpload.uploadUrl`}
  89355. * configuration required by the {@link module:upload/adapters/simpleuploadadapter~SimpleUploadAdapter `SimpleUploadAdapter`}
  89356. * is missing. Make sure the correct URL is specified for the image upload to work properly.
  89357. *
  89358. * @error simple-upload-adapter-missing-uploadurl
  89359. */
  89360. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["logWarning"])( 'simple-upload-adapter-missing-uploadurl' );
  89361. return;
  89362. }
  89363. this.editor.plugins.get( _filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] ).createUploadAdapter = loader => {
  89364. return new Adapter( loader, options );
  89365. };
  89366. }
  89367. }
  89368. /**
  89369. * Upload adapter.
  89370. *
  89371. * @private
  89372. * @implements module:upload/filerepository~UploadAdapter
  89373. */
  89374. class Adapter {
  89375. /**
  89376. * Creates a new adapter instance.
  89377. *
  89378. * @param {module:upload/filerepository~FileLoader} loader
  89379. * @param {module:upload/adapters/simpleuploadadapter~SimpleUploadConfig} options
  89380. */
  89381. constructor( loader, options ) {
  89382. /**
  89383. * FileLoader instance to use during the upload.
  89384. *
  89385. * @member {module:upload/filerepository~FileLoader} #loader
  89386. */
  89387. this.loader = loader;
  89388. /**
  89389. * The configuration of the adapter.
  89390. *
  89391. * @member {module:upload/adapters/simpleuploadadapter~SimpleUploadConfig} #options
  89392. */
  89393. this.options = options;
  89394. }
  89395. /**
  89396. * Starts the upload process.
  89397. *
  89398. * @see module:upload/filerepository~UploadAdapter#upload
  89399. * @returns {Promise}
  89400. */
  89401. upload() {
  89402. return this.loader.file
  89403. .then( file => new Promise( ( resolve, reject ) => {
  89404. this._initRequest();
  89405. this._initListeners( resolve, reject, file );
  89406. this._sendRequest( file );
  89407. } ) );
  89408. }
  89409. /**
  89410. * Aborts the upload process.
  89411. *
  89412. * @see module:upload/filerepository~UploadAdapter#abort
  89413. * @returns {Promise}
  89414. */
  89415. abort() {
  89416. if ( this.xhr ) {
  89417. this.xhr.abort();
  89418. }
  89419. }
  89420. /**
  89421. * Initializes the `XMLHttpRequest` object using the URL specified as
  89422. * {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#uploadUrl `simpleUpload.uploadUrl`} in the editor's
  89423. * configuration.
  89424. *
  89425. * @private
  89426. */
  89427. _initRequest() {
  89428. const xhr = this.xhr = new XMLHttpRequest();
  89429. xhr.open( 'POST', this.options.uploadUrl, true );
  89430. xhr.responseType = 'json';
  89431. }
  89432. /**
  89433. * Initializes XMLHttpRequest listeners
  89434. *
  89435. * @private
  89436. * @param {Function} resolve Callback function to be called when the request is successful.
  89437. * @param {Function} reject Callback function to be called when the request cannot be completed.
  89438. * @param {File} file Native File object.
  89439. */
  89440. _initListeners( resolve, reject, file ) {
  89441. const xhr = this.xhr;
  89442. const loader = this.loader;
  89443. const genericErrorText = `Couldn't upload file: ${ file.name }.`;
  89444. xhr.addEventListener( 'error', () => reject( genericErrorText ) );
  89445. xhr.addEventListener( 'abort', () => reject() );
  89446. xhr.addEventListener( 'load', () => {
  89447. const response = xhr.response;
  89448. if ( !response || response.error ) {
  89449. return reject( response && response.error && response.error.message ? response.error.message : genericErrorText );
  89450. }
  89451. const urls = response.url ? { default: response.url } : response.urls;
  89452. // Resolve with the normalized `urls` property and pass the rest of the response
  89453. // to allow customizing the behavior of features relying on the upload adapters.
  89454. resolve( {
  89455. ...response,
  89456. urls
  89457. } );
  89458. } );
  89459. // Upload progress when it is supported.
  89460. /* istanbul ignore else */
  89461. if ( xhr.upload ) {
  89462. xhr.upload.addEventListener( 'progress', evt => {
  89463. if ( evt.lengthComputable ) {
  89464. loader.uploadTotal = evt.total;
  89465. loader.uploaded = evt.loaded;
  89466. }
  89467. } );
  89468. }
  89469. }
  89470. /**
  89471. * Prepares the data and sends the request.
  89472. *
  89473. * @private
  89474. * @param {File} file File instance to be uploaded.
  89475. */
  89476. _sendRequest( file ) {
  89477. // Set headers if specified.
  89478. const headers = this.options.headers || {};
  89479. // Use the withCredentials flag if specified.
  89480. const withCredentials = this.options.withCredentials || false;
  89481. for ( const headerName of Object.keys( headers ) ) {
  89482. this.xhr.setRequestHeader( headerName, headers[ headerName ] );
  89483. }
  89484. this.xhr.withCredentials = withCredentials;
  89485. // Prepare the form data.
  89486. const data = new FormData();
  89487. data.append( 'upload', file );
  89488. // Send the request.
  89489. this.xhr.send( data );
  89490. }
  89491. }
  89492. /**
  89493. * The configuration of the {@link module:upload/adapters/simpleuploadadapter~SimpleUploadAdapter simple upload adapter}.
  89494. *
  89495. * ClassicEditor
  89496. * .create( editorElement, {
  89497. * simpleUpload: {
  89498. * // The URL the images are uploaded to.
  89499. * uploadUrl: 'http://example.com',
  89500. *
  89501. * // Headers sent along with the XMLHttpRequest to the upload server.
  89502. * headers: {
  89503. * ...
  89504. * }
  89505. * }
  89506. * } );
  89507. * .then( ... )
  89508. * .catch( ... );
  89509. *
  89510. * See the {@glink features/images/image-upload/simple-upload-adapter "Simple upload adapter"} guide to learn more.
  89511. *
  89512. * See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
  89513. *
  89514. * @interface SimpleUploadConfig
  89515. */
  89516. /**
  89517. * The configuration of the {@link module:upload/adapters/simpleuploadadapter~SimpleUploadAdapter simple upload adapter}.
  89518. *
  89519. * Read more in {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig}.
  89520. *
  89521. * @member {module:upload/adapters/simpleuploadadapter~SimpleUploadConfig} module:core/editor/editorconfig~EditorConfig#simpleUpload
  89522. */
  89523. /**
  89524. * The path (URL) to the server (application) which handles the file upload. When specified, enables the automatic
  89525. * upload of resources (images) inserted into the editor content.
  89526. *
  89527. * Learn more about the server application requirements in the
  89528. * {@glink features/images/image-upload/simple-upload-adapter#server-side-configuration "Server-side configuration"} section
  89529. * of the feature guide.
  89530. *
  89531. * @member {String} module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#uploadUrl
  89532. */
  89533. /**
  89534. * An object that defines additional [headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers) sent with
  89535. * the request to the server during the upload. This is the right place to implement security mechanisms like
  89536. * authentication and [CSRF](https://developer.mozilla.org/en-US/docs/Glossary/CSRF) protection.
  89537. *
  89538. * ClassicEditor
  89539. * .create( editorElement, {
  89540. * simpleUpload: {
  89541. * headers: {
  89542. * 'X-CSRF-TOKEN': 'CSRF-Token',
  89543. * Authorization: 'Bearer <JSON Web Token>'
  89544. * }
  89545. * }
  89546. * } );
  89547. * .then( ... )
  89548. * .catch( ... );
  89549. *
  89550. * Learn more about the server application requirements in the
  89551. * {@glink features/images/image-upload/simple-upload-adapter#server-side-configuration "Server-side configuration"} section
  89552. * of the feature guide.
  89553. *
  89554. * @member {Object.<String, String>} module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#headers
  89555. */
  89556. /**
  89557. * This flag enables the
  89558. * [`withCredentials`](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials)
  89559. * property of the request sent to the server during the upload. It affects cross-site requests only and, for instance,
  89560. * allows credentials such as cookies to be sent along with the request.
  89561. *
  89562. * ClassicEditor
  89563. * .create( editorElement, {
  89564. * simpleUpload: {
  89565. * withCredentials: true
  89566. * }
  89567. * } );
  89568. * .then( ... )
  89569. * .catch( ... );
  89570. *
  89571. * Learn more about the server application requirements in the
  89572. * {@glink features/images/image-upload/simple-upload-adapter#server-side-configuration "Server-side configuration"} section
  89573. * of the feature guide.
  89574. *
  89575. * @member {Boolean} [module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#withCredentials=false]
  89576. */
  89577. /***/ }),
  89578. /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/filereader.js":
  89579. /*!*******************************************************************!*\
  89580. !*** ./node_modules/@ckeditor/ckeditor5-upload/src/filereader.js ***!
  89581. \*******************************************************************/
  89582. /*! exports provided: default */
  89583. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89584. "use strict";
  89585. __webpack_require__.r(__webpack_exports__);
  89586. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FileReader; });
  89587. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  89588. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  89589. /**
  89590. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  89591. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  89592. */
  89593. /**
  89594. * @module upload/filereader
  89595. */
  89596. /* globals window */
  89597. /**
  89598. * Wrapper over the native `FileReader`.
  89599. */
  89600. class FileReader {
  89601. /**
  89602. * Creates an instance of the FileReader.
  89603. */
  89604. constructor() {
  89605. const reader = new window.FileReader();
  89606. /**
  89607. * Instance of native FileReader.
  89608. *
  89609. * @private
  89610. * @member {FileReader} #_reader
  89611. */
  89612. this._reader = reader;
  89613. this._data = undefined;
  89614. /**
  89615. * Number of bytes loaded.
  89616. *
  89617. * @readonly
  89618. * @observable
  89619. * @member {Number} #loaded
  89620. */
  89621. this.set( 'loaded', 0 );
  89622. reader.onprogress = evt => {
  89623. this.loaded = evt.loaded;
  89624. };
  89625. }
  89626. /**
  89627. * Returns error that occurred during file reading.
  89628. *
  89629. * @returns {Error}
  89630. */
  89631. get error() {
  89632. return this._reader.error;
  89633. }
  89634. /**
  89635. * Holds the data of an already loaded file. The file must be first loaded
  89636. * by using {@link module:upload/filereader~FileReader#read `read()`}.
  89637. *
  89638. * @type {File|undefined}
  89639. */
  89640. get data() {
  89641. return this._data;
  89642. }
  89643. /**
  89644. * Reads the provided file.
  89645. *
  89646. * @param {File} file Native File object.
  89647. * @returns {Promise.<String>} Returns a promise that will be resolved with file's content.
  89648. * The promise will be rejected in case of an error or when the reading process is aborted.
  89649. */
  89650. read( file ) {
  89651. const reader = this._reader;
  89652. this.total = file.size;
  89653. return new Promise( ( resolve, reject ) => {
  89654. reader.onload = () => {
  89655. const result = reader.result;
  89656. this._data = result;
  89657. resolve( result );
  89658. };
  89659. reader.onerror = () => {
  89660. reject( 'error' );
  89661. };
  89662. reader.onabort = () => {
  89663. reject( 'aborted' );
  89664. };
  89665. this._reader.readAsDataURL( file );
  89666. } );
  89667. }
  89668. /**
  89669. * Aborts file reader.
  89670. */
  89671. abort() {
  89672. this._reader.abort();
  89673. }
  89674. }
  89675. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( FileReader, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  89676. /***/ }),
  89677. /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js":
  89678. /*!***********************************************************************!*\
  89679. !*** ./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js ***!
  89680. \***********************************************************************/
  89681. /*! exports provided: default */
  89682. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89683. "use strict";
  89684. __webpack_require__.r(__webpack_exports__);
  89685. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FileRepository; });
  89686. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  89687. /* harmony import */ var _ckeditor_ckeditor5_core_src_pendingactions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/pendingactions */ "./node_modules/@ckeditor/ckeditor5-core/src/pendingactions.js");
  89688. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  89689. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  89690. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  89691. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  89692. /* harmony import */ var _filereader_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./filereader.js */ "./node_modules/@ckeditor/ckeditor5-upload/src/filereader.js");
  89693. /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid.js */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  89694. /**
  89695. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  89696. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  89697. */
  89698. /**
  89699. * @module upload/filerepository
  89700. */
  89701. /**
  89702. * File repository plugin. A central point for managing file upload.
  89703. *
  89704. * To use it, first you need an upload adapter. Upload adapter's job is to handle communication with the server
  89705. * (sending the file and handling server's response). You can use one of the existing plugins introducing upload adapters
  89706. * (e.g. {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter} or
  89707. * {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter}) or write your own one – see
  89708. * the {@glink framework/guides/deep-dive/upload-adapter Custom image upload adapter deep dive guide}.
  89709. *
  89710. * Then, you can use {@link module:upload/filerepository~FileRepository#createLoader `createLoader()`} and the returned
  89711. * {@link module:upload/filerepository~FileLoader} instance to load and upload files.
  89712. *
  89713. * @extends module:core/plugin~Plugin
  89714. */
  89715. class FileRepository extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  89716. /**
  89717. * @inheritDoc
  89718. */
  89719. static get pluginName() {
  89720. return 'FileRepository';
  89721. }
  89722. /**
  89723. * @inheritDoc
  89724. */
  89725. static get requires() {
  89726. return [ _ckeditor_ckeditor5_core_src_pendingactions__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  89727. }
  89728. /**
  89729. * @inheritDoc
  89730. */
  89731. init() {
  89732. /**
  89733. * Collection of loaders associated with this repository.
  89734. *
  89735. * @member {module:utils/collection~Collection} #loaders
  89736. */
  89737. this.loaders = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__["default"]();
  89738. // Keeps upload in a sync with pending actions.
  89739. this.loaders.on( 'add', () => this._updatePendingAction() );
  89740. this.loaders.on( 'remove', () => this._updatePendingAction() );
  89741. /**
  89742. * Loaders mappings used to retrieve loaders references.
  89743. *
  89744. * @private
  89745. * @member {Map<File|Promise, FileLoader>} #_loadersMap
  89746. */
  89747. this._loadersMap = new Map();
  89748. /**
  89749. * Reference to a pending action registered in a {@link module:core/pendingactions~PendingActions} plugin
  89750. * while upload is in progress. When there is no upload then value is `null`.
  89751. *
  89752. * @private
  89753. * @member {Object} #_pendingAction
  89754. */
  89755. this._pendingAction = null;
  89756. /**
  89757. * A factory function which should be defined before using `FileRepository`.
  89758. *
  89759. * It should return a new instance of {@link module:upload/filerepository~UploadAdapter} that will be used to upload files.
  89760. * {@link module:upload/filerepository~FileLoader} instance associated with the adapter
  89761. * will be passed to that function.
  89762. *
  89763. * For more information and example see {@link module:upload/filerepository~UploadAdapter}.
  89764. *
  89765. * @member {Function} #createUploadAdapter
  89766. */
  89767. /**
  89768. * Number of bytes uploaded.
  89769. *
  89770. * @readonly
  89771. * @observable
  89772. * @member {Number} #uploaded
  89773. */
  89774. this.set( 'uploaded', 0 );
  89775. /**
  89776. * Number of total bytes to upload.
  89777. *
  89778. * It might be different than the file size because of headers and additional data.
  89779. * It contains `null` if value is not available yet, so it's better to use {@link #uploadedPercent} to monitor
  89780. * the progress.
  89781. *
  89782. * @readonly
  89783. * @observable
  89784. * @member {Number|null} #uploadTotal
  89785. */
  89786. this.set( 'uploadTotal', null );
  89787. /**
  89788. * Upload progress in percents.
  89789. *
  89790. * @readonly
  89791. * @observable
  89792. * @member {Number} #uploadedPercent
  89793. */
  89794. this.bind( 'uploadedPercent' ).to( this, 'uploaded', this, 'uploadTotal', ( uploaded, total ) => {
  89795. return total ? ( uploaded / total * 100 ) : 0;
  89796. } );
  89797. }
  89798. /**
  89799. * Returns the loader associated with specified file or promise.
  89800. *
  89801. * To get loader by id use `fileRepository.loaders.get( id )`.
  89802. *
  89803. * @param {File|Promise.<File>} fileOrPromise Native file or promise handle.
  89804. * @returns {module:upload/filerepository~FileLoader|null}
  89805. */
  89806. getLoader( fileOrPromise ) {
  89807. return this._loadersMap.get( fileOrPromise ) || null;
  89808. }
  89809. /**
  89810. * Creates a loader instance for the given file.
  89811. *
  89812. * Requires {@link #createUploadAdapter} factory to be defined.
  89813. *
  89814. * @param {File|Promise.<File>} fileOrPromise Native File object or native Promise object which resolves to a File.
  89815. * @returns {module:upload/filerepository~FileLoader|null}
  89816. */
  89817. createLoader( fileOrPromise ) {
  89818. if ( !this.createUploadAdapter ) {
  89819. /**
  89820. * You need to enable an upload adapter in order to be able to upload files.
  89821. *
  89822. * This warning shows up when {@link module:upload/filerepository~FileRepository} is being used
  89823. * without {@link #createUploadAdapter defining an upload adapter}.
  89824. *
  89825. * **If you see this warning when using one of the {@glink builds/index CKEditor 5 Builds}**
  89826. * it means that you did not configure any of the upload adapters available by default in those builds.
  89827. *
  89828. * See the {@glink features/images/image-upload/image-upload comprehensive "Image upload overview"} to learn which upload
  89829. * adapters are available in the builds and how to configure them.
  89830. *
  89831. * **If you see this warning when using a custom build** there is a chance that you enabled
  89832. * a feature like {@link module:image/imageupload~ImageUpload},
  89833. * or {@link module:image/imageupload/imageuploadui~ImageUploadUI} but you did not enable any upload adapter.
  89834. * You can choose one of the existing upload adapters listed in the
  89835. * {@glink features/images/image-upload/image-upload "Image upload overview"}.
  89836. *
  89837. * You can also implement your {@glink framework/guides/deep-dive/upload-adapter own image upload adapter}.
  89838. *
  89839. * @error filerepository-no-upload-adapter
  89840. */
  89841. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["logWarning"])( 'filerepository-no-upload-adapter' );
  89842. return null;
  89843. }
  89844. const loader = new FileLoader( Promise.resolve( fileOrPromise ), this.createUploadAdapter );
  89845. this.loaders.add( loader );
  89846. this._loadersMap.set( fileOrPromise, loader );
  89847. // Store also file => loader mapping so loader can be retrieved by file instance returned upon Promise resolution.
  89848. if ( fileOrPromise instanceof Promise ) {
  89849. loader.file
  89850. .then( file => {
  89851. this._loadersMap.set( file, loader );
  89852. } )
  89853. // Every then() must have a catch().
  89854. // File loader state (and rejections) are handled in read() and upload().
  89855. // Also, see the "does not swallow the file promise rejection" test.
  89856. .catch( () => {} );
  89857. }
  89858. loader.on( 'change:uploaded', () => {
  89859. let aggregatedUploaded = 0;
  89860. for ( const loader of this.loaders ) {
  89861. aggregatedUploaded += loader.uploaded;
  89862. }
  89863. this.uploaded = aggregatedUploaded;
  89864. } );
  89865. loader.on( 'change:uploadTotal', () => {
  89866. let aggregatedTotal = 0;
  89867. for ( const loader of this.loaders ) {
  89868. if ( loader.uploadTotal ) {
  89869. aggregatedTotal += loader.uploadTotal;
  89870. }
  89871. }
  89872. this.uploadTotal = aggregatedTotal;
  89873. } );
  89874. return loader;
  89875. }
  89876. /**
  89877. * Destroys the given loader.
  89878. *
  89879. * @param {File|Promise|module:upload/filerepository~FileLoader} fileOrPromiseOrLoader File or Promise associated
  89880. * with that loader or loader itself.
  89881. */
  89882. destroyLoader( fileOrPromiseOrLoader ) {
  89883. const loader = fileOrPromiseOrLoader instanceof FileLoader ? fileOrPromiseOrLoader : this.getLoader( fileOrPromiseOrLoader );
  89884. loader._destroy();
  89885. this.loaders.remove( loader );
  89886. this._loadersMap.forEach( ( value, key ) => {
  89887. if ( value === loader ) {
  89888. this._loadersMap.delete( key );
  89889. }
  89890. } );
  89891. }
  89892. /**
  89893. * Registers or deregisters pending action bound with upload progress.
  89894. *
  89895. * @private
  89896. */
  89897. _updatePendingAction() {
  89898. const pendingActions = this.editor.plugins.get( _ckeditor_ckeditor5_core_src_pendingactions__WEBPACK_IMPORTED_MODULE_1__["default"] );
  89899. if ( this.loaders.length ) {
  89900. if ( !this._pendingAction ) {
  89901. const t = this.editor.t;
  89902. const getMessage = value => `${ t( 'Upload in progress' ) } ${ parseInt( value ) }%.`;
  89903. this._pendingAction = pendingActions.add( getMessage( this.uploadedPercent ) );
  89904. this._pendingAction.bind( 'message' ).to( this, 'uploadedPercent', getMessage );
  89905. }
  89906. } else {
  89907. pendingActions.remove( this._pendingAction );
  89908. this._pendingAction = null;
  89909. }
  89910. }
  89911. }
  89912. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__["default"])( FileRepository, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  89913. /**
  89914. * File loader class.
  89915. *
  89916. * It is used to control the process of reading the file and uploading it using the specified upload adapter.
  89917. */
  89918. class FileLoader {
  89919. /**
  89920. * Creates a new instance of `FileLoader`.
  89921. *
  89922. * @param {Promise.<File>} filePromise A promise which resolves to a file instance.
  89923. * @param {Function} uploadAdapterCreator The function which returns {@link module:upload/filerepository~UploadAdapter} instance.
  89924. */
  89925. constructor( filePromise, uploadAdapterCreator ) {
  89926. /**
  89927. * Unique id of FileLoader instance.
  89928. *
  89929. * @readonly
  89930. * @member {Number}
  89931. */
  89932. this.id = Object(_ckeditor_ckeditor5_utils_src_uid_js__WEBPACK_IMPORTED_MODULE_7__["default"])();
  89933. /**
  89934. * Additional wrapper over the initial file promise passed to this loader.
  89935. *
  89936. * @protected
  89937. * @member {module:upload/filerepository~FilePromiseWrapper}
  89938. */
  89939. this._filePromiseWrapper = this._createFilePromiseWrapper( filePromise );
  89940. /**
  89941. * Adapter instance associated with this file loader.
  89942. *
  89943. * @private
  89944. * @member {module:upload/filerepository~UploadAdapter}
  89945. */
  89946. this._adapter = uploadAdapterCreator( this );
  89947. /**
  89948. * FileReader used by FileLoader.
  89949. *
  89950. * @protected
  89951. * @member {module:upload/filereader~FileReader}
  89952. */
  89953. this._reader = new _filereader_js__WEBPACK_IMPORTED_MODULE_6__["default"]();
  89954. /**
  89955. * Current status of FileLoader. It can be one of the following:
  89956. *
  89957. * * 'idle',
  89958. * * 'reading',
  89959. * * 'uploading',
  89960. * * 'aborted',
  89961. * * 'error'.
  89962. *
  89963. * When reading status can change in a following way:
  89964. *
  89965. * `idle` -> `reading` -> `idle`
  89966. * `idle` -> `reading -> `aborted`
  89967. * `idle` -> `reading -> `error`
  89968. *
  89969. * When uploading status can change in a following way:
  89970. *
  89971. * `idle` -> `uploading` -> `idle`
  89972. * `idle` -> `uploading` -> `aborted`
  89973. * `idle` -> `uploading` -> `error`
  89974. *
  89975. * @readonly
  89976. * @observable
  89977. * @member {String} #status
  89978. */
  89979. this.set( 'status', 'idle' );
  89980. /**
  89981. * Number of bytes uploaded.
  89982. *
  89983. * @readonly
  89984. * @observable
  89985. * @member {Number} #uploaded
  89986. */
  89987. this.set( 'uploaded', 0 );
  89988. /**
  89989. * Number of total bytes to upload.
  89990. *
  89991. * @readonly
  89992. * @observable
  89993. * @member {Number|null} #uploadTotal
  89994. */
  89995. this.set( 'uploadTotal', null );
  89996. /**
  89997. * Upload progress in percents.
  89998. *
  89999. * @readonly
  90000. * @observable
  90001. * @member {Number} #uploadedPercent
  90002. */
  90003. this.bind( 'uploadedPercent' ).to( this, 'uploaded', this, 'uploadTotal', ( uploaded, total ) => {
  90004. return total ? ( uploaded / total * 100 ) : 0;
  90005. } );
  90006. /**
  90007. * Response of the upload.
  90008. *
  90009. * @readonly
  90010. * @observable
  90011. * @member {Object|null} #uploadResponse
  90012. */
  90013. this.set( 'uploadResponse', null );
  90014. }
  90015. /**
  90016. * A `Promise` which resolves to a `File` instance associated with this file loader.
  90017. *
  90018. * @type {Promise.<File|null>}
  90019. */
  90020. get file() {
  90021. if ( !this._filePromiseWrapper ) {
  90022. // Loader was destroyed, return promise which resolves to null.
  90023. return Promise.resolve( null );
  90024. } else {
  90025. // The `this._filePromiseWrapper.promise` is chained and not simply returned to handle a case when:
  90026. //
  90027. // * The `loader.file.then( ... )` is called by external code (returned promise is pending).
  90028. // * Then `loader._destroy()` is called (call is synchronous) which destroys the `loader`.
  90029. // * Promise returned by the first `loader.file.then( ... )` call is resolved.
  90030. //
  90031. // Returning `this._filePromiseWrapper.promise` will still resolve to a `File` instance so there
  90032. // is an additional check needed in the chain to see if `loader` was destroyed in the meantime.
  90033. return this._filePromiseWrapper.promise.then( file => this._filePromiseWrapper ? file : null );
  90034. }
  90035. }
  90036. /**
  90037. * Returns the file data. To read its data, you need for first load the file
  90038. * by using the {@link module:upload/filerepository~FileLoader#read `read()`} method.
  90039. *
  90040. * @type {File|undefined}
  90041. */
  90042. get data() {
  90043. return this._reader.data;
  90044. }
  90045. /**
  90046. * Reads file using {@link module:upload/filereader~FileReader}.
  90047. *
  90048. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `filerepository-read-wrong-status` when status
  90049. * is different than `idle`.
  90050. *
  90051. * Example usage:
  90052. *
  90053. * fileLoader.read()
  90054. * .then( data => { ... } )
  90055. * .catch( err => {
  90056. * if ( err === 'aborted' ) {
  90057. * console.log( 'Reading aborted.' );
  90058. * } else {
  90059. * console.log( 'Reading error.', err );
  90060. * }
  90061. * } );
  90062. *
  90063. * @returns {Promise.<String>} Returns promise that will be resolved with read data. Promise will be rejected if error
  90064. * occurs or if read process is aborted.
  90065. */
  90066. read() {
  90067. if ( this.status != 'idle' ) {
  90068. /**
  90069. * You cannot call read if the status is different than idle.
  90070. *
  90071. * @error filerepository-read-wrong-status
  90072. */
  90073. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'filerepository-read-wrong-status', this );
  90074. }
  90075. this.status = 'reading';
  90076. return this.file
  90077. .then( file => this._reader.read( file ) )
  90078. .then( data => {
  90079. // Edge case: reader was aborted after file was read - double check for proper status.
  90080. // It can happen when image was deleted during its upload.
  90081. if ( this.status !== 'reading' ) {
  90082. throw this.status;
  90083. }
  90084. this.status = 'idle';
  90085. return data;
  90086. } )
  90087. .catch( err => {
  90088. if ( err === 'aborted' ) {
  90089. this.status = 'aborted';
  90090. throw 'aborted';
  90091. }
  90092. this.status = 'error';
  90093. throw this._reader.error ? this._reader.error : err;
  90094. } );
  90095. }
  90096. /**
  90097. * Reads file using the provided {@link module:upload/filerepository~UploadAdapter}.
  90098. *
  90099. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `filerepository-upload-wrong-status` when status
  90100. * is different than `idle`.
  90101. * Example usage:
  90102. *
  90103. * fileLoader.upload()
  90104. * .then( data => { ... } )
  90105. * .catch( e => {
  90106. * if ( e === 'aborted' ) {
  90107. * console.log( 'Uploading aborted.' );
  90108. * } else {
  90109. * console.log( 'Uploading error.', e );
  90110. * }
  90111. * } );
  90112. *
  90113. * @returns {Promise.<Object>} Returns promise that will be resolved with response data. Promise will be rejected if error
  90114. * occurs or if read process is aborted.
  90115. */
  90116. upload() {
  90117. if ( this.status != 'idle' ) {
  90118. /**
  90119. * You cannot call upload if the status is different than idle.
  90120. *
  90121. * @error filerepository-upload-wrong-status
  90122. */
  90123. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'filerepository-upload-wrong-status', this );
  90124. }
  90125. this.status = 'uploading';
  90126. return this.file
  90127. .then( () => this._adapter.upload() )
  90128. .then( data => {
  90129. this.uploadResponse = data;
  90130. this.status = 'idle';
  90131. return data;
  90132. } )
  90133. .catch( err => {
  90134. if ( this.status === 'aborted' ) {
  90135. throw 'aborted';
  90136. }
  90137. this.status = 'error';
  90138. throw err;
  90139. } );
  90140. }
  90141. /**
  90142. * Aborts loading process.
  90143. */
  90144. abort() {
  90145. const status = this.status;
  90146. this.status = 'aborted';
  90147. if ( !this._filePromiseWrapper.isFulfilled ) {
  90148. // Edge case: file loader is aborted before read() is called
  90149. // so it might happen that no one handled the rejection of this promise.
  90150. // See https://github.com/ckeditor/ckeditor5-upload/pull/100
  90151. this._filePromiseWrapper.promise.catch( () => {} );
  90152. this._filePromiseWrapper.rejecter( 'aborted' );
  90153. } else if ( status == 'reading' ) {
  90154. this._reader.abort();
  90155. } else if ( status == 'uploading' && this._adapter.abort ) {
  90156. this._adapter.abort();
  90157. }
  90158. this._destroy();
  90159. }
  90160. /**
  90161. * Performs cleanup.
  90162. *
  90163. * @private
  90164. */
  90165. _destroy() {
  90166. this._filePromiseWrapper = undefined;
  90167. this._reader = undefined;
  90168. this._adapter = undefined;
  90169. this.uploadResponse = undefined;
  90170. }
  90171. /**
  90172. * Wraps a given file promise into another promise giving additional
  90173. * control (resolving, rejecting, checking if fulfilled) over it.
  90174. *
  90175. * @private
  90176. * @param filePromise The initial file promise to be wrapped.
  90177. * @returns {module:upload/filerepository~FilePromiseWrapper}
  90178. */
  90179. _createFilePromiseWrapper( filePromise ) {
  90180. const wrapper = {};
  90181. wrapper.promise = new Promise( ( resolve, reject ) => {
  90182. wrapper.rejecter = reject;
  90183. wrapper.isFulfilled = false;
  90184. filePromise
  90185. .then( file => {
  90186. wrapper.isFulfilled = true;
  90187. resolve( file );
  90188. } )
  90189. .catch( err => {
  90190. wrapper.isFulfilled = true;
  90191. reject( err );
  90192. } );
  90193. } );
  90194. return wrapper;
  90195. }
  90196. }
  90197. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__["default"])( FileLoader, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  90198. /**
  90199. * Upload adapter interface used by the {@link module:upload/filerepository~FileRepository file repository}
  90200. * to handle file upload. An upload adapter is a bridge between the editor and server that handles file uploads.
  90201. * It should contain a logic necessary to initiate an upload process and monitor its progress.
  90202. *
  90203. * Learn how to develop your own upload adapter for CKEditor 5 in the
  90204. * {@glink framework/guides/deep-dive/upload-adapter "Custom upload adapter" guide}.
  90205. *
  90206. * @interface UploadAdapter
  90207. */
  90208. /**
  90209. * Executes the upload process.
  90210. * This method should return a promise that will resolve when data will be uploaded to server. Promise should be
  90211. * resolved with an object containing information about uploaded file:
  90212. *
  90213. * {
  90214. * default: 'http://server/default-size.image.png'
  90215. * }
  90216. *
  90217. * Additionally, other image sizes can be provided:
  90218. *
  90219. * {
  90220. * default: 'http://server/default-size.image.png',
  90221. * '160': 'http://server/size-160.image.png',
  90222. * '500': 'http://server/size-500.image.png',
  90223. * '1000': 'http://server/size-1000.image.png',
  90224. * '1052': 'http://server/default-size.image.png'
  90225. * }
  90226. *
  90227. * You can also pass additional properties from the server. In this case you need to wrap URLs
  90228. * in the `urls` object and pass additional properties along the `urls` property.
  90229. *
  90230. * {
  90231. * myCustomProperty: 'foo',
  90232. * urls: {
  90233. * default: 'http://server/default-size.image.png',
  90234. * '160': 'http://server/size-160.image.png',
  90235. * '500': 'http://server/size-500.image.png',
  90236. * '1000': 'http://server/size-1000.image.png',
  90237. * '1052': 'http://server/default-size.image.png'
  90238. * }
  90239. * }
  90240. *
  90241. * NOTE: When returning multiple images, the widest returned one should equal the default one. It is essential to
  90242. * correctly set `width` attribute of the image. See this discussion:
  90243. * https://github.com/ckeditor/ckeditor5-easy-image/issues/4 for more information.
  90244. *
  90245. * Take a look at {@link module:upload/filerepository~UploadAdapter example Adapter implementation} and
  90246. * {@link module:upload/filerepository~FileRepository#createUploadAdapter createUploadAdapter method}.
  90247. *
  90248. * @method module:upload/filerepository~UploadAdapter#upload
  90249. * @returns {Promise.<Object>} Promise that should be resolved when data is uploaded.
  90250. */
  90251. /**
  90252. * Aborts the upload process.
  90253. * After aborting it should reject promise returned from {@link #upload upload()}.
  90254. *
  90255. * Take a look at {@link module:upload/filerepository~UploadAdapter example Adapter implementation} and
  90256. * {@link module:upload/filerepository~FileRepository#createUploadAdapter createUploadAdapter method}.
  90257. *
  90258. * @method module:upload/filerepository~UploadAdapter#abort
  90259. */
  90260. /**
  90261. * Object returned by {@link module:upload/filerepository~FileLoader#_createFilePromiseWrapper} method
  90262. * to add more control over the initial file promise passed to {@link module:upload/filerepository~FileLoader}.
  90263. *
  90264. * @protected
  90265. * @typedef {Object} module:upload/filerepository~FilePromiseWrapper
  90266. * @property {Promise.<File>} promise Wrapper promise which can be chained for further processing.
  90267. * @property {Function} rejecter Rejects the promise when called.
  90268. * @property {Boolean} isFulfilled Whether original promise is already fulfilled.
  90269. */
  90270. /***/ }),
  90271. /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/index.js":
  90272. /*!**************************************************************!*\
  90273. !*** ./node_modules/@ckeditor/ckeditor5-upload/src/index.js ***!
  90274. \**************************************************************/
  90275. /*! exports provided: FileRepository, FileDialogButtonView, Base64UploadAdapter, SimpleUploadAdapter */
  90276. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90277. "use strict";
  90278. __webpack_require__.r(__webpack_exports__);
  90279. /* harmony import */ var _filerepository__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filerepository */ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js");
  90280. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FileRepository", function() { return _filerepository__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  90281. /* harmony import */ var _ui_filedialogbuttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ui/filedialogbuttonview */ "./node_modules/@ckeditor/ckeditor5-upload/src/ui/filedialogbuttonview.js");
  90282. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FileDialogButtonView", function() { return _ui_filedialogbuttonview__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  90283. /* harmony import */ var _adapters_base64uploadadapter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./adapters/base64uploadadapter */ "./node_modules/@ckeditor/ckeditor5-upload/src/adapters/base64uploadadapter.js");
  90284. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Base64UploadAdapter", function() { return _adapters_base64uploadadapter__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  90285. /* harmony import */ var _adapters_simpleuploadadapter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./adapters/simpleuploadadapter */ "./node_modules/@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter.js");
  90286. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SimpleUploadAdapter", function() { return _adapters_simpleuploadadapter__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  90287. /**
  90288. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  90289. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  90290. */
  90291. /**
  90292. * @module upload
  90293. */
  90294. /***/ }),
  90295. /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/ui/filedialogbuttonview.js":
  90296. /*!********************************************************************************!*\
  90297. !*** ./node_modules/@ckeditor/ckeditor5-upload/src/ui/filedialogbuttonview.js ***!
  90298. \********************************************************************************/
  90299. /*! exports provided: default */
  90300. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90301. "use strict";
  90302. __webpack_require__.r(__webpack_exports__);
  90303. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FileDialogButtonView; });
  90304. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  90305. /* harmony import */ var _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  90306. /**
  90307. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  90308. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  90309. */
  90310. /**
  90311. * @module upload/ui/filedialogbuttonview
  90312. */
  90313. /**
  90314. * The file dialog button view.
  90315. *
  90316. * This component provides a button that opens the native file selection dialog.
  90317. * It can be used to implement the UI of a file upload feature.
  90318. *
  90319. * const view = new FileDialogButtonView( locale );
  90320. *
  90321. * view.set( {
  90322. * acceptedType: 'image/*',
  90323. * allowMultipleFiles: true
  90324. * } );
  90325. *
  90326. * view.buttonView.set( {
  90327. * label: t( 'Insert image' ),
  90328. * icon: imageIcon,
  90329. * tooltip: true
  90330. * } );
  90331. *
  90332. * view.on( 'done', ( evt, files ) => {
  90333. * for ( const file of Array.from( files ) ) {
  90334. * console.log( 'Selected file', file );
  90335. * }
  90336. * } );
  90337. *
  90338. * @extends module:ui/view~View
  90339. */
  90340. class FileDialogButtonView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_1__["default"] {
  90341. /**
  90342. * @inheritDoc
  90343. */
  90344. constructor( locale ) {
  90345. super( locale );
  90346. /**
  90347. * The button view of the component.
  90348. *
  90349. * @member {module:ui/button/buttonview~ButtonView}
  90350. */
  90351. this.buttonView = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_0__["default"]( locale );
  90352. /**
  90353. * A hidden `<input>` view used to execute file dialog.
  90354. *
  90355. * @protected
  90356. * @member {module:upload/ui/filedialogbuttonview~FileInputView}
  90357. */
  90358. this._fileInputView = new FileInputView( locale );
  90359. /**
  90360. * Accepted file types. Can be provided in form of file extensions, media type or one of:
  90361. * * `audio/*`,
  90362. * * `video/*`,
  90363. * * `image/*`.
  90364. *
  90365. * @observable
  90366. * @member {String} #acceptedType
  90367. */
  90368. this._fileInputView.bind( 'acceptedType' ).to( this );
  90369. /**
  90370. * Indicates if multiple files can be selected. Defaults to `true`.
  90371. *
  90372. * @observable
  90373. * @member {Boolean} #allowMultipleFiles
  90374. */
  90375. this._fileInputView.bind( 'allowMultipleFiles' ).to( this );
  90376. /**
  90377. * Fired when file dialog is closed with file selected.
  90378. *
  90379. * view.on( 'done', ( evt, files ) => {
  90380. * for ( const file of files ) {
  90381. * console.log( 'Selected file', file );
  90382. * }
  90383. * }
  90384. *
  90385. * @event done
  90386. * @param {Array.<File>} files Array of selected files.
  90387. */
  90388. this._fileInputView.delegate( 'done' ).to( this );
  90389. this.setTemplate( {
  90390. tag: 'span',
  90391. attributes: {
  90392. class: 'ck-file-dialog-button'
  90393. },
  90394. children: [
  90395. this.buttonView,
  90396. this._fileInputView
  90397. ]
  90398. } );
  90399. this.buttonView.on( 'execute', () => {
  90400. this._fileInputView.open();
  90401. } );
  90402. }
  90403. /**
  90404. * Focuses the {@link #buttonView}.
  90405. */
  90406. focus() {
  90407. this.buttonView.focus();
  90408. }
  90409. }
  90410. /**
  90411. * The hidden file input view class.
  90412. *
  90413. * @private
  90414. * @extends module:ui/view~View
  90415. */
  90416. class FileInputView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_1__["default"] {
  90417. /**
  90418. * @inheritDoc
  90419. */
  90420. constructor( locale ) {
  90421. super( locale );
  90422. /**
  90423. * Accepted file types. Can be provided in form of file extensions, media type or one of:
  90424. * * `audio/*`,
  90425. * * `video/*`,
  90426. * * `image/*`.
  90427. *
  90428. * @observable
  90429. * @member {String} #acceptedType
  90430. */
  90431. this.set( 'acceptedType' );
  90432. /**
  90433. * Indicates if multiple files can be selected. Defaults to `false`.
  90434. *
  90435. * @observable
  90436. * @member {Boolean} #allowMultipleFiles
  90437. */
  90438. this.set( 'allowMultipleFiles', false );
  90439. const bind = this.bindTemplate;
  90440. this.setTemplate( {
  90441. tag: 'input',
  90442. attributes: {
  90443. class: [
  90444. 'ck-hidden'
  90445. ],
  90446. type: 'file',
  90447. tabindex: '-1',
  90448. accept: bind.to( 'acceptedType' ),
  90449. multiple: bind.to( 'allowMultipleFiles' )
  90450. },
  90451. on: {
  90452. // Removing from code coverage since we cannot programmatically set input element files.
  90453. change: bind.to( /* istanbul ignore next */ () => {
  90454. if ( this.element && this.element.files && this.element.files.length ) {
  90455. this.fire( 'done', this.element.files );
  90456. }
  90457. this.element.value = '';
  90458. } )
  90459. }
  90460. } );
  90461. }
  90462. /**
  90463. * Opens file dialog.
  90464. */
  90465. open() {
  90466. this.element.click();
  90467. }
  90468. }
  90469. /***/ }),
  90470. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js":
  90471. /*!*********************************************************************!*\
  90472. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js ***!
  90473. \*********************************************************************/
  90474. /*! exports provided: DOCUMENTATION_URL, default, logWarning, logError */
  90475. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90476. "use strict";
  90477. __webpack_require__.r(__webpack_exports__);
  90478. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOCUMENTATION_URL", function() { return DOCUMENTATION_URL; });
  90479. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKEditorError; });
  90480. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logWarning", function() { return logWarning; });
  90481. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logError", function() { return logError; });
  90482. /**
  90483. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  90484. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  90485. */
  90486. /**
  90487. * @module utils/ckeditorerror
  90488. */
  90489. /* globals console */
  90490. /**
  90491. * URL to the documentation with error codes.
  90492. */
  90493. const DOCUMENTATION_URL =
  90494. 'https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html';
  90495. /**
  90496. * The CKEditor error class.
  90497. *
  90498. * You should throw `CKEditorError` when:
  90499. *
  90500. * * An unexpected situation occurred and the editor (most probably) will not work properly. Such exception will be handled
  90501. * by the {@link module:watchdog/watchdog~Watchdog watchdog} (if it is integrated),
  90502. * * If the editor is incorrectly integrated or the editor API is used in the wrong way. This way you will give
  90503. * feedback to the developer as soon as possible. Keep in mind that for common integration issues which should not
  90504. * stop editor initialization (like missing upload adapter, wrong name of a toolbar component) we use
  90505. * {@link module:utils/ckeditorerror~logWarning `logWarning()`} and
  90506. * {@link module:utils/ckeditorerror~logError `logError()`}
  90507. * to improve developers experience and let them see the a working editor as soon as possible.
  90508. *
  90509. * /**
  90510. * * Error thrown when a plugin cannot be loaded due to JavaScript errors, lack of plugins with a given name, etc.
  90511. * *
  90512. * * @error plugin-load
  90513. * * @param pluginName The name of the plugin that could not be loaded.
  90514. * * @param moduleName The name of the module which tried to load this plugin.
  90515. * * /
  90516. * throw new CKEditorError( 'plugin-load', {
  90517. * pluginName: 'foo',
  90518. * moduleName: 'bar'
  90519. * } );
  90520. *
  90521. * @extends Error
  90522. */
  90523. class CKEditorError extends Error {
  90524. /**
  90525. * Creates an instance of the CKEditorError class.
  90526. *
  90527. * @param {String} errorName The error id in an `error-name` format. A link to this error documentation page will be added
  90528. * to the thrown error's `message`.
  90529. * @param {Object|null} context A context of the error by which the {@link module:watchdog/watchdog~Watchdog watchdog}
  90530. * is able to determine which editor crashed. It should be an editor instance or a property connected to it. It can be also
  90531. * a `null` value if the editor should not be restarted in case of the error (e.g. during the editor initialization).
  90532. * The error context should be checked using the `areConnectedThroughProperties( editor, context )` utility
  90533. * to check if the object works as the context.
  90534. * @param {Object} [data] Additional data describing the error. A stringified version of this object
  90535. * will be appended to the error message, so the data are quickly visible in the console. The original
  90536. * data object will also be later available under the {@link #data} property.
  90537. */
  90538. constructor( errorName, context, data ) {
  90539. super( getErrorMessage( errorName, data ) );
  90540. /**
  90541. * @type {String}
  90542. */
  90543. this.name = 'CKEditorError';
  90544. /**
  90545. * A context of the error by which the Watchdog is able to determine which editor crashed.
  90546. *
  90547. * @type {Object|null}
  90548. */
  90549. this.context = context;
  90550. /**
  90551. * The additional error data passed to the constructor. Undefined if none was passed.
  90552. *
  90553. * @type {Object|undefined}
  90554. */
  90555. this.data = data;
  90556. }
  90557. /**
  90558. * Checks if the error is of the `CKEditorError` type.
  90559. * @returns {Boolean}
  90560. */
  90561. is( type ) {
  90562. return type === 'CKEditorError';
  90563. }
  90564. /**
  90565. * A utility that ensures that the thrown error is a {@link module:utils/ckeditorerror~CKEditorError} one.
  90566. * It is useful when combined with the {@link module:watchdog/watchdog~Watchdog} feature, which can restart the editor in case
  90567. * of a {@link module:utils/ckeditorerror~CKEditorError} error.
  90568. *
  90569. * @static
  90570. * @param {Error} err The error to rethrow.
  90571. * @param {Object} context An object connected through properties with the editor instance. This context will be used
  90572. * by the watchdog to verify which editor should be restarted.
  90573. */
  90574. static rethrowUnexpectedError( err, context ) {
  90575. if ( err.is && err.is( 'CKEditorError' ) ) {
  90576. throw err;
  90577. }
  90578. /**
  90579. * An unexpected error occurred inside the CKEditor 5 codebase. This error will look like the original one
  90580. * to make the debugging easier.
  90581. *
  90582. * This error is only useful when the editor is initialized using the {@link module:watchdog/watchdog~Watchdog} feature.
  90583. * In case of such error (or any {@link module:utils/ckeditorerror~CKEditorError} error) the watchdog should restart the editor.
  90584. *
  90585. * @error unexpected-error
  90586. */
  90587. const error = new CKEditorError( err.message, context );
  90588. // Restore the original stack trace to make the error look like the original one.
  90589. // See https://github.com/ckeditor/ckeditor5/issues/5595 for more details.
  90590. error.stack = err.stack;
  90591. throw error;
  90592. }
  90593. }
  90594. /**
  90595. * Logs a warning to the console with a properly formatted message and adds a link to the documentation.
  90596. * Use whenever you want to log a warning to the console.
  90597. *
  90598. * /**
  90599. * * There was a problem processing the configuration of the toolbar. The item with the given
  90600. * * name does not exist, so it was omitted when rendering the toolbar.
  90601. * *
  90602. * * @error toolbarview-item-unavailable
  90603. * * @param {String} name The name of the component.
  90604. * * /
  90605. * logWarning( 'toolbarview-item-unavailable', { name } );
  90606. *
  90607. * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to throw an error and when to log
  90608. * a warning or an error to the console.
  90609. *
  90610. * @param {String} errorName The error name to be logged.
  90611. * @param {Object} [data] Additional data to be logged.
  90612. */
  90613. function logWarning( errorName, data ) {
  90614. console.warn( ...formatConsoleArguments( errorName, data ) );
  90615. }
  90616. /**
  90617. * Logs an error to the console with a properly formatted message and adds a link to the documentation.
  90618. * Use whenever you want to log an error to the console.
  90619. *
  90620. * /**
  90621. * * There was a problem processing the configuration of the toolbar. The item with the given
  90622. * * name does not exist, so it was omitted when rendering the toolbar.
  90623. * *
  90624. * * @error toolbarview-item-unavailable
  90625. * * @param {String} name The name of the component.
  90626. * * /
  90627. * logError( 'toolbarview-item-unavailable', { name } );
  90628. *
  90629. * **Note**: In most cases logging a warning using {@link module:utils/ckeditorerror~logWarning} is enough.
  90630. *
  90631. * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to use each method.
  90632. *
  90633. * @param {String} errorName The error name to be logged.
  90634. * @param {Object} [data] Additional data to be logged.
  90635. */
  90636. function logError( errorName, data ) {
  90637. console.error( ...formatConsoleArguments( errorName, data ) );
  90638. }
  90639. // Returns formatted link to documentation message.
  90640. //
  90641. // @private
  90642. // @param {String} errorName
  90643. // @returns {string}
  90644. function getLinkToDocumentationMessage( errorName ) {
  90645. return `\nRead more: ${ DOCUMENTATION_URL }#error-${ errorName }`;
  90646. }
  90647. // Returns formatted error message.
  90648. //
  90649. // @private
  90650. // @param {String} errorName
  90651. // @param {Object} [data]
  90652. // @returns {string}
  90653. function getErrorMessage( errorName, data ) {
  90654. const processedObjects = new WeakSet();
  90655. const circularReferencesReplacer = ( key, value ) => {
  90656. if ( typeof value === 'object' && value !== null ) {
  90657. if ( processedObjects.has( value ) ) {
  90658. return `[object ${ value.constructor.name }]`;
  90659. }
  90660. processedObjects.add( value );
  90661. }
  90662. return value;
  90663. };
  90664. const stringifiedData = data ? ` ${ JSON.stringify( data, circularReferencesReplacer ) }` : '';
  90665. const documentationLink = getLinkToDocumentationMessage( errorName );
  90666. return errorName + stringifiedData + documentationLink;
  90667. }
  90668. // Returns formatted console error arguments.
  90669. //
  90670. // @private
  90671. // @param {String} errorName
  90672. // @param {Object} [data]
  90673. // @returns {Array}
  90674. function formatConsoleArguments( errorName, data ) {
  90675. const documentationMessage = getLinkToDocumentationMessage( errorName );
  90676. return data ? [ errorName, data, documentationMessage ] : [ errorName, documentationMessage ];
  90677. }
  90678. /***/ }),
  90679. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js":
  90680. /*!******************************************************************!*\
  90681. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/collection.js ***!
  90682. \******************************************************************/
  90683. /*! exports provided: default */
  90684. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90685. "use strict";
  90686. __webpack_require__.r(__webpack_exports__);
  90687. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Collection; });
  90688. /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  90689. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  90690. /* harmony import */ var _uid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  90691. /* harmony import */ var _isiterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  90692. /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  90693. /**
  90694. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  90695. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  90696. */
  90697. /**
  90698. * @module utils/collection
  90699. */
  90700. /**
  90701. * Collections are ordered sets of objects. Items in the collection can be retrieved by their indexes
  90702. * in the collection (like in an array) or by their ids.
  90703. *
  90704. * If an object without an `id` property is being added to the collection, the `id` property will be generated
  90705. * automatically. Note that the automatically generated id is unique only within this single collection instance.
  90706. *
  90707. * By default an item in the collection is identified by its `id` property. The name of the identifier can be
  90708. * configured through the constructor of the collection.
  90709. *
  90710. * @mixes module:utils/emittermixin~EmitterMixin
  90711. */
  90712. class Collection {
  90713. /**
  90714. * Creates a new Collection instance.
  90715. *
  90716. * You can provide an iterable of initial items the collection will be created with:
  90717. *
  90718. * const collection = new Collection( [ { id: 'John' }, { id: 'Mike' } ] );
  90719. *
  90720. * console.log( collection.get( 0 ) ); // -> { id: 'John' }
  90721. * console.log( collection.get( 1 ) ); // -> { id: 'Mike' }
  90722. * console.log( collection.get( 'Mike' ) ); // -> { id: 'Mike' }
  90723. *
  90724. * Or you can first create a collection and then add new items using the {@link #add} method:
  90725. *
  90726. * const collection = new Collection();
  90727. *
  90728. * collection.add( { id: 'John' } );
  90729. * console.log( collection.get( 0 ) ); // -> { id: 'John' }
  90730. *
  90731. * Whatever option you choose, you can always pass a configuration object as the last argument
  90732. * of the constructor:
  90733. *
  90734. * const emptyCollection = new Collection( { idProperty: 'name' } );
  90735. * emptyCollection.add( { name: 'John' } );
  90736. * console.log( collection.get( 'John' ) ); // -> { name: 'John' }
  90737. *
  90738. * const nonEmptyCollection = new Collection( [ { name: 'John' } ], { idProperty: 'name' } );
  90739. * nonEmptyCollection.add( { name: 'George' } );
  90740. * console.log( collection.get( 'George' ) ); // -> { name: 'George' }
  90741. * console.log( collection.get( 'John' ) ); // -> { name: 'John' }
  90742. *
  90743. * @param {Iterable.<Object>|Object} [initialItemsOrOptions] The initial items of the collection or
  90744. * the options object.
  90745. * @param {Object} [options={}] The options object, when the first argument is an array of initial items.
  90746. * @param {String} [options.idProperty='id'] The name of the property which is used to identify an item.
  90747. * Items that do not have such a property will be assigned one when added to the collection.
  90748. */
  90749. constructor( initialItemsOrOptions = {}, options = {} ) {
  90750. const hasInitialItems = Object(_isiterable__WEBPACK_IMPORTED_MODULE_3__["default"])( initialItemsOrOptions );
  90751. if ( !hasInitialItems ) {
  90752. options = initialItemsOrOptions;
  90753. }
  90754. /**
  90755. * The internal list of items in the collection.
  90756. *
  90757. * @private
  90758. * @member {Object[]}
  90759. */
  90760. this._items = [];
  90761. /**
  90762. * The internal map of items in the collection.
  90763. *
  90764. * @private
  90765. * @member {Map}
  90766. */
  90767. this._itemMap = new Map();
  90768. /**
  90769. * The name of the property which is considered to identify an item.
  90770. *
  90771. * @private
  90772. * @member {String}
  90773. */
  90774. this._idProperty = options.idProperty || 'id';
  90775. /**
  90776. * A helper mapping external items of a bound collection ({@link #bindTo})
  90777. * and actual items of this collection. It provides information
  90778. * necessary to properly remove items bound to another collection.
  90779. *
  90780. * See {@link #_bindToInternalToExternalMap}.
  90781. *
  90782. * @protected
  90783. * @member {WeakMap}
  90784. */
  90785. this._bindToExternalToInternalMap = new WeakMap();
  90786. /**
  90787. * A helper mapping items of this collection to external items of a bound collection
  90788. * ({@link #bindTo}). It provides information necessary to manage the bindings, e.g.
  90789. * to avoid loops in two–way bindings.
  90790. *
  90791. * See {@link #_bindToExternalToInternalMap}.
  90792. *
  90793. * @protected
  90794. * @member {WeakMap}
  90795. */
  90796. this._bindToInternalToExternalMap = new WeakMap();
  90797. /**
  90798. * Stores indexes of skipped items from bound external collection.
  90799. *
  90800. * @private
  90801. * @member {Array}
  90802. */
  90803. this._skippedIndexesFromExternal = [];
  90804. // Set the initial content of the collection (if provided in the constructor).
  90805. if ( hasInitialItems ) {
  90806. for ( const item of initialItemsOrOptions ) {
  90807. this._items.push( item );
  90808. this._itemMap.set( this._getItemIdBeforeAdding( item ), item );
  90809. }
  90810. }
  90811. /**
  90812. * A collection instance this collection is bound to as a result
  90813. * of calling {@link #bindTo} method.
  90814. *
  90815. * @protected
  90816. * @member {module:utils/collection~Collection} #_bindToCollection
  90817. */
  90818. }
  90819. /**
  90820. * The number of items available in the collection.
  90821. *
  90822. * @member {Number} #length
  90823. */
  90824. get length() {
  90825. return this._items.length;
  90826. }
  90827. /**
  90828. * Returns the first item from the collection or null when collection is empty.
  90829. *
  90830. * @returns {Object|null} The first item or `null` if collection is empty.
  90831. */
  90832. get first() {
  90833. return this._items[ 0 ] || null;
  90834. }
  90835. /**
  90836. * Returns the last item from the collection or null when collection is empty.
  90837. *
  90838. * @returns {Object|null} The last item or `null` if collection is empty.
  90839. */
  90840. get last() {
  90841. return this._items[ this.length - 1 ] || null;
  90842. }
  90843. /**
  90844. * Adds an item into the collection.
  90845. *
  90846. * If the item does not have an id, then it will be automatically generated and set on the item.
  90847. *
  90848. * @chainable
  90849. * @param {Object} item
  90850. * @param {Number} [index] The position of the item in the collection. The item
  90851. * is pushed to the collection when `index` not specified.
  90852. * @fires add
  90853. * @fires change
  90854. */
  90855. add( item, index ) {
  90856. return this.addMany( [ item ], index );
  90857. }
  90858. /**
  90859. * Adds multiple items into the collection.
  90860. *
  90861. * Any item not containing an id will get an automatically generated one.
  90862. *
  90863. * @chainable
  90864. * @param {Iterable.<Object>} item
  90865. * @param {Number} [index] The position of the insertion. Items will be appended if no `index` is specified.
  90866. * @fires add
  90867. * @fires change
  90868. */
  90869. addMany( items, index ) {
  90870. if ( index === undefined ) {
  90871. index = this._items.length;
  90872. } else if ( index > this._items.length || index < 0 ) {
  90873. /**
  90874. * The `index` passed to {@link module:utils/collection~Collection#addMany `Collection#addMany()`}
  90875. * is invalid. It must be a number between 0 and the collection's length.
  90876. *
  90877. * @error collection-add-item-invalid-index
  90878. */
  90879. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-add-item-invalid-index', this );
  90880. }
  90881. for ( let offset = 0; offset < items.length; offset++ ) {
  90882. const item = items[ offset ];
  90883. const itemId = this._getItemIdBeforeAdding( item );
  90884. const currentItemIndex = index + offset;
  90885. this._items.splice( currentItemIndex, 0, item );
  90886. this._itemMap.set( itemId, item );
  90887. this.fire( 'add', item, currentItemIndex );
  90888. }
  90889. this.fire( 'change', {
  90890. added: items,
  90891. removed: [],
  90892. index
  90893. } );
  90894. return this;
  90895. }
  90896. /**
  90897. * Gets an item by its ID or index.
  90898. *
  90899. * @param {String|Number} idOrIndex The item ID or index in the collection.
  90900. * @returns {Object|null} The requested item or `null` if such item does not exist.
  90901. */
  90902. get( idOrIndex ) {
  90903. let item;
  90904. if ( typeof idOrIndex == 'string' ) {
  90905. item = this._itemMap.get( idOrIndex );
  90906. } else if ( typeof idOrIndex == 'number' ) {
  90907. item = this._items[ idOrIndex ];
  90908. } else {
  90909. /**
  90910. * An index or ID must be given.
  90911. *
  90912. * @error collection-get-invalid-arg
  90913. */
  90914. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-get-invalid-arg', this );
  90915. }
  90916. return item || null;
  90917. }
  90918. /**
  90919. * Returns a Boolean indicating whether the collection contains an item.
  90920. *
  90921. * @param {Object|String} itemOrId The item or its ID in the collection.
  90922. * @returns {Boolean} `true` if the collection contains the item, `false` otherwise.
  90923. */
  90924. has( itemOrId ) {
  90925. if ( typeof itemOrId == 'string' ) {
  90926. return this._itemMap.has( itemOrId );
  90927. } else { // Object
  90928. const idProperty = this._idProperty;
  90929. const id = itemOrId[ idProperty ];
  90930. return this._itemMap.has( id );
  90931. }
  90932. }
  90933. /**
  90934. * Gets an index of an item in the collection.
  90935. * When an item is not defined in the collection, the index will equal -1.
  90936. *
  90937. * @param {Object|String} itemOrId The item or its ID in the collection.
  90938. * @returns {Number} The index of a given item.
  90939. */
  90940. getIndex( itemOrId ) {
  90941. let item;
  90942. if ( typeof itemOrId == 'string' ) {
  90943. item = this._itemMap.get( itemOrId );
  90944. } else {
  90945. item = itemOrId;
  90946. }
  90947. return this._items.indexOf( item );
  90948. }
  90949. /**
  90950. * Removes an item from the collection.
  90951. *
  90952. * @param {Object|Number|String} subject The item to remove, its ID or index in the collection.
  90953. * @returns {Object} The removed item.
  90954. * @fires remove
  90955. * @fires change
  90956. */
  90957. remove( subject ) {
  90958. const [ item, index ] = this._remove( subject );
  90959. this.fire( 'change', {
  90960. added: [],
  90961. removed: [ item ],
  90962. index
  90963. } );
  90964. return item;
  90965. }
  90966. /**
  90967. * Executes the callback for each item in the collection and composes an array or values returned by this callback.
  90968. *
  90969. * @param {Function} callback
  90970. * @param {Object} callback.item
  90971. * @param {Number} callback.index
  90972. * @param {Object} ctx Context in which the `callback` will be called.
  90973. * @returns {Array} The result of mapping.
  90974. */
  90975. map( callback, ctx ) {
  90976. return this._items.map( callback, ctx );
  90977. }
  90978. /**
  90979. * Finds the first item in the collection for which the `callback` returns a true value.
  90980. *
  90981. * @param {Function} callback
  90982. * @param {Object} callback.item
  90983. * @param {Number} callback.index
  90984. * @param {Object} ctx Context in which the `callback` will be called.
  90985. * @returns {Object} The item for which `callback` returned a true value.
  90986. */
  90987. find( callback, ctx ) {
  90988. return this._items.find( callback, ctx );
  90989. }
  90990. /**
  90991. * Returns an array with items for which the `callback` returned a true value.
  90992. *
  90993. * @param {Function} callback
  90994. * @param {Object} callback.item
  90995. * @param {Number} callback.index
  90996. * @param {Object} ctx Context in which the `callback` will be called.
  90997. * @returns {Object[]} The array with matching items.
  90998. */
  90999. filter( callback, ctx ) {
  91000. return this._items.filter( callback, ctx );
  91001. }
  91002. /**
  91003. * Removes all items from the collection and destroys the binding created using
  91004. * {@link #bindTo}.
  91005. *
  91006. * @fires remove
  91007. * @fires change
  91008. */
  91009. clear() {
  91010. if ( this._bindToCollection ) {
  91011. this.stopListening( this._bindToCollection );
  91012. this._bindToCollection = null;
  91013. }
  91014. const removedItems = Array.from( this._items );
  91015. while ( this.length ) {
  91016. this._remove( 0 );
  91017. }
  91018. this.fire( 'change', {
  91019. added: [],
  91020. removed: removedItems,
  91021. index: 0
  91022. } );
  91023. }
  91024. /**
  91025. * Binds and synchronizes the collection with another one.
  91026. *
  91027. * The binding can be a simple factory:
  91028. *
  91029. * class FactoryClass {
  91030. * constructor( data ) {
  91031. * this.label = data.label;
  91032. * }
  91033. * }
  91034. *
  91035. * const source = new Collection( { idProperty: 'label' } );
  91036. * const target = new Collection();
  91037. *
  91038. * target.bindTo( source ).as( FactoryClass );
  91039. *
  91040. * source.add( { label: 'foo' } );
  91041. * source.add( { label: 'bar' } );
  91042. *
  91043. * console.log( target.length ); // 2
  91044. * console.log( target.get( 1 ).label ); // 'bar'
  91045. *
  91046. * source.remove( 0 );
  91047. * console.log( target.length ); // 1
  91048. * console.log( target.get( 0 ).label ); // 'bar'
  91049. *
  91050. * or the factory driven by a custom callback:
  91051. *
  91052. * class FooClass {
  91053. * constructor( data ) {
  91054. * this.label = data.label;
  91055. * }
  91056. * }
  91057. *
  91058. * class BarClass {
  91059. * constructor( data ) {
  91060. * this.label = data.label;
  91061. * }
  91062. * }
  91063. *
  91064. * const source = new Collection( { idProperty: 'label' } );
  91065. * const target = new Collection();
  91066. *
  91067. * target.bindTo( source ).using( ( item ) => {
  91068. * if ( item.label == 'foo' ) {
  91069. * return new FooClass( item );
  91070. * } else {
  91071. * return new BarClass( item );
  91072. * }
  91073. * } );
  91074. *
  91075. * source.add( { label: 'foo' } );
  91076. * source.add( { label: 'bar' } );
  91077. *
  91078. * console.log( target.length ); // 2
  91079. * console.log( target.get( 0 ) instanceof FooClass ); // true
  91080. * console.log( target.get( 1 ) instanceof BarClass ); // true
  91081. *
  91082. * or the factory out of property name:
  91083. *
  91084. * const source = new Collection( { idProperty: 'label' } );
  91085. * const target = new Collection();
  91086. *
  91087. * target.bindTo( source ).using( 'label' );
  91088. *
  91089. * source.add( { label: { value: 'foo' } } );
  91090. * source.add( { label: { value: 'bar' } } );
  91091. *
  91092. * console.log( target.length ); // 2
  91093. * console.log( target.get( 0 ).value ); // 'foo'
  91094. * console.log( target.get( 1 ).value ); // 'bar'
  91095. *
  91096. * It's possible to skip specified items by returning falsy value:
  91097. *
  91098. * const source = new Collection();
  91099. * const target = new Collection();
  91100. *
  91101. * target.bindTo( source ).using( item => {
  91102. * if ( item.hidden ) {
  91103. * return null;
  91104. * }
  91105. *
  91106. * return item;
  91107. * } );
  91108. *
  91109. * source.add( { hidden: true } );
  91110. * source.add( { hidden: false } );
  91111. *
  91112. * console.log( source.length ); // 2
  91113. * console.log( target.length ); // 1
  91114. *
  91115. * **Note**: {@link #clear} can be used to break the binding.
  91116. *
  91117. * @param {module:utils/collection~Collection} externalCollection A collection to be bound.
  91118. * @returns {Object}
  91119. * @returns {module:utils/collection~CollectionBindToChain} The binding chain object.
  91120. */
  91121. bindTo( externalCollection ) {
  91122. if ( this._bindToCollection ) {
  91123. /**
  91124. * The collection cannot be bound more than once.
  91125. *
  91126. * @error collection-bind-to-rebind
  91127. */
  91128. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-bind-to-rebind', this );
  91129. }
  91130. this._bindToCollection = externalCollection;
  91131. return {
  91132. as: Class => {
  91133. this._setUpBindToBinding( item => new Class( item ) );
  91134. },
  91135. using: callbackOrProperty => {
  91136. if ( typeof callbackOrProperty == 'function' ) {
  91137. this._setUpBindToBinding( item => callbackOrProperty( item ) );
  91138. } else {
  91139. this._setUpBindToBinding( item => item[ callbackOrProperty ] );
  91140. }
  91141. }
  91142. };
  91143. }
  91144. /**
  91145. * Finalizes and activates a binding initiated by {#bindTo}.
  91146. *
  91147. * @protected
  91148. * @param {Function} factory A function which produces collection items.
  91149. */
  91150. _setUpBindToBinding( factory ) {
  91151. const externalCollection = this._bindToCollection;
  91152. // Adds the item to the collection once a change has been done to the external collection.
  91153. //
  91154. // @private
  91155. const addItem = ( evt, externalItem, index ) => {
  91156. const isExternalBoundToThis = externalCollection._bindToCollection == this;
  91157. const externalItemBound = externalCollection._bindToInternalToExternalMap.get( externalItem );
  91158. // If an external collection is bound to this collection, which makes it a 2–way binding,
  91159. // and the particular external collection item is already bound, don't add it here.
  91160. // The external item has been created **out of this collection's item** and (re)adding it will
  91161. // cause a loop.
  91162. if ( isExternalBoundToThis && externalItemBound ) {
  91163. this._bindToExternalToInternalMap.set( externalItem, externalItemBound );
  91164. this._bindToInternalToExternalMap.set( externalItemBound, externalItem );
  91165. } else {
  91166. const item = factory( externalItem );
  91167. // When there is no item we need to remember skipped index first and then we can skip this item.
  91168. if ( !item ) {
  91169. this._skippedIndexesFromExternal.push( index );
  91170. return;
  91171. }
  91172. // Lets try to put item at the same index as index in external collection
  91173. // but when there are a skipped items in one or both collections we need to recalculate this index.
  91174. let finalIndex = index;
  91175. // When we try to insert item after some skipped items from external collection we need
  91176. // to include this skipped items and decrease index.
  91177. //
  91178. // For the following example:
  91179. // external -> [ 'A', 'B - skipped for internal', 'C - skipped for internal' ]
  91180. // internal -> [ A ]
  91181. //
  91182. // Another item is been added at the end of external collection:
  91183. // external.add( 'D' )
  91184. // external -> [ 'A', 'B - skipped for internal', 'C - skipped for internal', 'D' ]
  91185. //
  91186. // We can't just add 'D' to internal at the same index as index in external because
  91187. // this will produce empty indexes what is invalid:
  91188. // internal -> [ 'A', empty, empty, 'D' ]
  91189. //
  91190. // So we need to include skipped items and decrease index
  91191. // internal -> [ 'A', 'D' ]
  91192. for ( const skipped of this._skippedIndexesFromExternal ) {
  91193. if ( index > skipped ) {
  91194. finalIndex--;
  91195. }
  91196. }
  91197. // We need to take into consideration that external collection could skip some items from
  91198. // internal collection.
  91199. //
  91200. // For the following example:
  91201. // internal -> [ 'A', 'B - skipped for external', 'C - skipped for external' ]
  91202. // external -> [ A ]
  91203. //
  91204. // Another item is been added at the end of external collection:
  91205. // external.add( 'D' )
  91206. // external -> [ 'A', 'D' ]
  91207. //
  91208. // We need to include skipped items and place new item after them:
  91209. // internal -> [ 'A', 'B - skipped for external', 'C - skipped for external', 'D' ]
  91210. for ( const skipped of externalCollection._skippedIndexesFromExternal ) {
  91211. if ( finalIndex >= skipped ) {
  91212. finalIndex++;
  91213. }
  91214. }
  91215. this._bindToExternalToInternalMap.set( externalItem, item );
  91216. this._bindToInternalToExternalMap.set( item, externalItem );
  91217. this.add( item, finalIndex );
  91218. // After adding new element to internal collection we need update indexes
  91219. // of skipped items in external collection.
  91220. for ( let i = 0; i < externalCollection._skippedIndexesFromExternal.length; i++ ) {
  91221. if ( finalIndex <= externalCollection._skippedIndexesFromExternal[ i ] ) {
  91222. externalCollection._skippedIndexesFromExternal[ i ]++;
  91223. }
  91224. }
  91225. }
  91226. };
  91227. // Load the initial content of the collection.
  91228. for ( const externalItem of externalCollection ) {
  91229. addItem( null, externalItem, externalCollection.getIndex( externalItem ) );
  91230. }
  91231. // Synchronize the with collection as new items are added.
  91232. this.listenTo( externalCollection, 'add', addItem );
  91233. // Synchronize the with collection as new items are removed.
  91234. this.listenTo( externalCollection, 'remove', ( evt, externalItem, index ) => {
  91235. const item = this._bindToExternalToInternalMap.get( externalItem );
  91236. if ( item ) {
  91237. this.remove( item );
  91238. }
  91239. // After removing element from external collection we need update/remove indexes
  91240. // of skipped items in internal collection.
  91241. this._skippedIndexesFromExternal = this._skippedIndexesFromExternal.reduce( ( result, skipped ) => {
  91242. if ( index < skipped ) {
  91243. result.push( skipped - 1 );
  91244. }
  91245. if ( index > skipped ) {
  91246. result.push( skipped );
  91247. }
  91248. return result;
  91249. }, [] );
  91250. } );
  91251. }
  91252. /**
  91253. * Returns an unique id property for a given `item`.
  91254. *
  91255. * The method will generate new id and assign it to the `item` if it doesn't have any.
  91256. *
  91257. * @private
  91258. * @param {Object} item Item to be added.
  91259. * @returns {String}
  91260. */
  91261. _getItemIdBeforeAdding( item ) {
  91262. const idProperty = this._idProperty;
  91263. let itemId;
  91264. if ( ( idProperty in item ) ) {
  91265. itemId = item[ idProperty ];
  91266. if ( typeof itemId != 'string' ) {
  91267. /**
  91268. * This item's ID should be a string.
  91269. *
  91270. * @error collection-add-invalid-id
  91271. */
  91272. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-add-invalid-id', this );
  91273. }
  91274. if ( this.get( itemId ) ) {
  91275. /**
  91276. * This item already exists in the collection.
  91277. *
  91278. * @error collection-add-item-already-exists
  91279. */
  91280. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-add-item-already-exists', this );
  91281. }
  91282. } else {
  91283. item[ idProperty ] = itemId = Object(_uid__WEBPACK_IMPORTED_MODULE_2__["default"])();
  91284. }
  91285. return itemId;
  91286. }
  91287. /**
  91288. * Core {@link #remove} method implementation shared in other functions.
  91289. *
  91290. * In contrast this method **does not** fire the {@link #event:change} event.
  91291. *
  91292. * @private
  91293. * @param {Object} subject The item to remove, its id or index in the collection.
  91294. * @returns {Array} Returns an array with the removed item and its index.
  91295. * @fires remove
  91296. */
  91297. _remove( subject ) {
  91298. let index, id, item;
  91299. let itemDoesNotExist = false;
  91300. const idProperty = this._idProperty;
  91301. if ( typeof subject == 'string' ) {
  91302. id = subject;
  91303. item = this._itemMap.get( id );
  91304. itemDoesNotExist = !item;
  91305. if ( item ) {
  91306. index = this._items.indexOf( item );
  91307. }
  91308. } else if ( typeof subject == 'number' ) {
  91309. index = subject;
  91310. item = this._items[ index ];
  91311. itemDoesNotExist = !item;
  91312. if ( item ) {
  91313. id = item[ idProperty ];
  91314. }
  91315. } else {
  91316. item = subject;
  91317. id = item[ idProperty ];
  91318. index = this._items.indexOf( item );
  91319. itemDoesNotExist = ( index == -1 || !this._itemMap.get( id ) );
  91320. }
  91321. if ( itemDoesNotExist ) {
  91322. /**
  91323. * Item not found.
  91324. *
  91325. * @error collection-remove-404
  91326. */
  91327. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-remove-404', this );
  91328. }
  91329. this._items.splice( index, 1 );
  91330. this._itemMap.delete( id );
  91331. const externalItem = this._bindToInternalToExternalMap.get( item );
  91332. this._bindToInternalToExternalMap.delete( item );
  91333. this._bindToExternalToInternalMap.delete( externalItem );
  91334. this.fire( 'remove', item, index );
  91335. return [ item, index ];
  91336. }
  91337. /**
  91338. * Iterable interface.
  91339. *
  91340. * @returns {Iterable.<*>}
  91341. */
  91342. [ Symbol.iterator ]() {
  91343. return this._items[ Symbol.iterator ]();
  91344. }
  91345. /**
  91346. * Fired when an item is added to the collection.
  91347. *
  91348. * @event add
  91349. * @param {Object} item The added item.
  91350. */
  91351. /**
  91352. * Fired when the collection was changed due to adding or removing items.
  91353. *
  91354. * @event change
  91355. * @param {Iterable.<Object>} added A list of added items.
  91356. * @param {Iterable.<Object>} removed A list of removed items.
  91357. * @param {Number} index An index where the addition or removal occurred.
  91358. */
  91359. /**
  91360. * Fired when an item is removed from the collection.
  91361. *
  91362. * @event remove
  91363. * @param {Object} item The removed item.
  91364. * @param {Number} index Index from which item was removed.
  91365. */
  91366. }
  91367. Object(_mix__WEBPACK_IMPORTED_MODULE_4__["default"])( Collection, _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  91368. /**
  91369. * An object returned by the {@link module:utils/collection~Collection#bindTo `bindTo()`} method
  91370. * providing functions that specify the type of the binding.
  91371. *
  91372. * See the {@link module:utils/collection~Collection#bindTo `bindTo()`} documentation for examples.
  91373. *
  91374. * @interface module:utils/collection~CollectionBindToChain
  91375. */
  91376. /**
  91377. * Creates a callback or a property binding.
  91378. *
  91379. * @method #using
  91380. * @param {Function|String} callbackOrProperty When the function is passed, it should return
  91381. * the collection items. When the string is provided, the property value is used to create the bound collection items.
  91382. */
  91383. /**
  91384. * Creates the class factory binding in which items of the source collection are passed to
  91385. * the constructor of the specified class.
  91386. *
  91387. * @method #as
  91388. * @param {Function} Class The class constructor used to create instances in the factory.
  91389. */
  91390. /***/ }),
  91391. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js":
  91392. /*!*********************************************************************!*\
  91393. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js ***!
  91394. \*********************************************************************/
  91395. /*! exports provided: default */
  91396. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91397. "use strict";
  91398. __webpack_require__.r(__webpack_exports__);
  91399. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return compareArrays; });
  91400. /**
  91401. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  91402. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  91403. */
  91404. /**
  91405. * @module utils/comparearrays
  91406. */
  91407. /**
  91408. * Compares how given arrays relate to each other. One array can be: same as another array, prefix of another array
  91409. * or completely different. If arrays are different, first index at which they differ is returned. Otherwise,
  91410. * a flag specifying the relation is returned. Flags are negative numbers, so whenever a number >= 0 is returned
  91411. * it means that arrays differ.
  91412. *
  91413. * compareArrays( [ 0, 2 ], [ 0, 2 ] ); // 'same'
  91414. * compareArrays( [ 0, 2 ], [ 0, 2, 1 ] ); // 'prefix'
  91415. * compareArrays( [ 0, 2 ], [ 0 ] ); // 'extension'
  91416. * compareArrays( [ 0, 2 ], [ 1, 2 ] ); // 0
  91417. * compareArrays( [ 0, 2 ], [ 0, 1 ] ); // 1
  91418. *
  91419. * @param {Array} a Array that is compared.
  91420. * @param {Array} b Array to compare with.
  91421. * @returns {module:utils/comparearrays~ArrayRelation} How array `a` is related to `b`.
  91422. */
  91423. function compareArrays( a, b ) {
  91424. const minLen = Math.min( a.length, b.length );
  91425. for ( let i = 0; i < minLen; i++ ) {
  91426. if ( a[ i ] != b[ i ] ) {
  91427. // The arrays are different.
  91428. return i;
  91429. }
  91430. }
  91431. // Both arrays were same at all points.
  91432. if ( a.length == b.length ) {
  91433. // If their length is also same, they are the same.
  91434. return 'same';
  91435. } else if ( a.length < b.length ) {
  91436. // Compared array is shorter so it is a prefix of the other array.
  91437. return 'prefix';
  91438. } else {
  91439. // Compared array is longer so it is an extension of the other array.
  91440. return 'extension';
  91441. }
  91442. }
  91443. /**
  91444. * @typedef {'extension'|'same'|'prefix'} module:utils/comparearrays~ArrayRelation
  91445. */
  91446. /***/ }),
  91447. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/config.js":
  91448. /*!**************************************************************!*\
  91449. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/config.js ***!
  91450. \**************************************************************/
  91451. /*! exports provided: default */
  91452. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91453. "use strict";
  91454. __webpack_require__.r(__webpack_exports__);
  91455. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Config; });
  91456. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  91457. /**
  91458. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  91459. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  91460. */
  91461. /**
  91462. * @module utils/config
  91463. */
  91464. /**
  91465. * Handles a configuration dictionary.
  91466. */
  91467. class Config {
  91468. /**
  91469. * Creates an instance of the {@link ~Config} class.
  91470. *
  91471. * @param {Object} [configurations] The initial configurations to be set. Usually, provided by the user.
  91472. * @param {Object} [defaultConfigurations] The default configurations. Usually, provided by the system.
  91473. */
  91474. constructor( configurations, defaultConfigurations ) {
  91475. /**
  91476. * Store for the whole configuration.
  91477. *
  91478. * @private
  91479. * @member {Object}
  91480. */
  91481. this._config = {};
  91482. // Set default configuration.
  91483. if ( defaultConfigurations ) {
  91484. // Clone the configuration to make sure that the properties will not be shared
  91485. // between editors and make the watchdog feature work correctly.
  91486. this.define( cloneConfig( defaultConfigurations ) );
  91487. }
  91488. // Set initial configuration.
  91489. if ( configurations ) {
  91490. this._setObjectToTarget( this._config, configurations );
  91491. }
  91492. }
  91493. /**
  91494. * Set configuration values.
  91495. *
  91496. * It accepts both a name/value pair or an object, which properties and values will be used to set
  91497. * configurations.
  91498. *
  91499. * It also accepts setting a "deep configuration" by using dots in the name. For example, `'resize.width'` sets
  91500. * the value for the `width` configuration in the `resize` subset.
  91501. *
  91502. * config.set( 'width', 500 );
  91503. * config.set( 'toolbar.collapsed', true );
  91504. *
  91505. * // Equivalent to:
  91506. * config.set( {
  91507. * width: 500
  91508. * toolbar: {
  91509. * collapsed: true
  91510. * }
  91511. * } );
  91512. *
  91513. * Passing an object as the value will amend the configuration, not replace it.
  91514. *
  91515. * config.set( 'toolbar', {
  91516. * collapsed: true,
  91517. * } );
  91518. *
  91519. * config.set( 'toolbar', {
  91520. * color: 'red',
  91521. * } );
  91522. *
  91523. * config.get( 'toolbar.collapsed' ); // true
  91524. * config.get( 'toolbar.color' ); // 'red'
  91525. *
  91526. * @param {String|Object} name The configuration name or an object from which take properties as
  91527. * configuration entries. Configuration names are case-sensitive.
  91528. * @param {*} value The configuration value. Used if a name is passed.
  91529. */
  91530. set( name, value ) {
  91531. this._setToTarget( this._config, name, value );
  91532. }
  91533. /**
  91534. * Does exactly the same as {@link #set} with one exception – passed configuration extends
  91535. * existing one, but does not overwrite already defined values.
  91536. *
  91537. * This method is supposed to be called by plugin developers to setup plugin's configurations. It would be
  91538. * rarely used for other needs.
  91539. *
  91540. * @param {String|Object} name The configuration name or an object from which take properties as
  91541. * configuration entries. Configuration names are case-sensitive.
  91542. * @param {*} value The configuration value. Used if a name is passed.
  91543. */
  91544. define( name, value ) {
  91545. const isDefine = true;
  91546. this._setToTarget( this._config, name, value, isDefine );
  91547. }
  91548. /**
  91549. * Gets the value for a configuration entry.
  91550. *
  91551. * config.get( 'name' );
  91552. *
  91553. * Deep configurations can be retrieved by separating each part with a dot.
  91554. *
  91555. * config.get( 'toolbar.collapsed' );
  91556. *
  91557. * @param {String} name The configuration name. Configuration names are case-sensitive.
  91558. * @returns {*} The configuration value or `undefined` if the configuration entry was not found.
  91559. */
  91560. get( name ) {
  91561. return this._getFromSource( this._config, name );
  91562. }
  91563. /**
  91564. * Iterates over all top level configuration names.
  91565. *
  91566. * @returns {Iterable.<String>}
  91567. */
  91568. * names() {
  91569. for ( const name of Object.keys( this._config ) ) {
  91570. yield name;
  91571. }
  91572. }
  91573. /**
  91574. * Saves passed configuration to the specified target (nested object).
  91575. *
  91576. * @private
  91577. * @param {Object} target Nested config object.
  91578. * @param {String|Object} name The configuration name or an object from which take properties as
  91579. * configuration entries. Configuration names are case-sensitive.
  91580. * @param {*} value The configuration value. Used if a name is passed.
  91581. * @param {Boolean} [isDefine=false] Define if passed configuration should overwrite existing one.
  91582. */
  91583. _setToTarget( target, name, value, isDefine = false ) {
  91584. // In case of an object, iterate through it and call `_setToTarget` again for each property.
  91585. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( name ) ) {
  91586. this._setObjectToTarget( target, name, isDefine );
  91587. return;
  91588. }
  91589. // The configuration name should be split into parts if it has dots. E.g. `resize.width` -> [`resize`, `width`].
  91590. const parts = name.split( '.' );
  91591. // Take the name of the configuration out of the parts. E.g. `resize.width` -> `width`.
  91592. name = parts.pop();
  91593. // Iterate over parts to check if currently stored configuration has proper structure.
  91594. for ( const part of parts ) {
  91595. // If there is no object for specified part then create one.
  91596. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( target[ part ] ) ) {
  91597. target[ part ] = {};
  91598. }
  91599. // Nested object becomes a target.
  91600. target = target[ part ];
  91601. }
  91602. // In case of value is an object.
  91603. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( value ) ) {
  91604. // We take care of proper config structure.
  91605. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( target[ name ] ) ) {
  91606. target[ name ] = {};
  91607. }
  91608. target = target[ name ];
  91609. // And iterate through this object calling `_setToTarget` again for each property.
  91610. this._setObjectToTarget( target, value, isDefine );
  91611. return;
  91612. }
  91613. // Do nothing if we are defining configuration for non empty name.
  91614. if ( isDefine && typeof target[ name ] != 'undefined' ) {
  91615. return;
  91616. }
  91617. target[ name ] = value;
  91618. }
  91619. /**
  91620. * Get specified configuration from specified source (nested object).
  91621. *
  91622. * @private
  91623. * @param {Object} source level of nested object.
  91624. * @param {String} name The configuration name. Configuration names are case-sensitive.
  91625. * @returns {*} The configuration value or `undefined` if the configuration entry was not found.
  91626. */
  91627. _getFromSource( source, name ) {
  91628. // The configuration name should be split into parts if it has dots. E.g. `resize.width` -> [`resize`, `width`].
  91629. const parts = name.split( '.' );
  91630. // Take the name of the configuration out of the parts. E.g. `resize.width` -> `width`.
  91631. name = parts.pop();
  91632. // Iterate over parts to check if currently stored configuration has proper structure.
  91633. for ( const part of parts ) {
  91634. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( source[ part ] ) ) {
  91635. source = null;
  91636. break;
  91637. }
  91638. // Nested object becomes a source.
  91639. source = source[ part ];
  91640. }
  91641. // Always returns undefined for non existing configuration.
  91642. return source ? cloneConfig( source[ name ] ) : undefined;
  91643. }
  91644. /**
  91645. * Iterates through passed object and calls {@link #_setToTarget} method with object key and value for each property.
  91646. *
  91647. * @private
  91648. * @param {Object} target Nested config object.
  91649. * @param {Object} configuration Configuration data set
  91650. * @param {Boolean} [isDefine] Defines if passed configuration is default configuration or not.
  91651. */
  91652. _setObjectToTarget( target, configuration, isDefine ) {
  91653. Object.keys( configuration ).forEach( key => {
  91654. this._setToTarget( target, key, configuration[ key ], isDefine );
  91655. } );
  91656. }
  91657. }
  91658. // Clones configuration object or value.
  91659. // @param {*} source Source configuration
  91660. // @returns {*} Cloned configuration value.
  91661. function cloneConfig( source ) {
  91662. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["cloneDeepWith"])( source, leaveDOMReferences );
  91663. }
  91664. // A customized function for cloneDeepWith.
  91665. // It will leave references to DOM Elements instead of cloning them.
  91666. //
  91667. // @param {*} value
  91668. // @returns {Element|undefined}
  91669. function leaveDOMReferences( value ) {
  91670. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isElement"])( value ) ? value : undefined;
  91671. }
  91672. /***/ }),
  91673. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/count.js":
  91674. /*!*************************************************************!*\
  91675. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/count.js ***!
  91676. \*************************************************************/
  91677. /*! exports provided: default */
  91678. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91679. "use strict";
  91680. __webpack_require__.r(__webpack_exports__);
  91681. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return count; });
  91682. /**
  91683. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  91684. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  91685. */
  91686. /**
  91687. * @module utils/count
  91688. */
  91689. /**
  91690. * Returns the number of items return by the iterator.
  91691. *
  91692. * count( [ 1, 2, 3, 4, 5 ] ); // 5;
  91693. *
  91694. * @param {Iterable.<*>} iterator Any iterator.
  91695. * @returns {Number} Number of items returned by that iterator.
  91696. */
  91697. function count( iterator ) {
  91698. let count = 0;
  91699. for ( const _ of iterator ) { // eslint-disable-line no-unused-vars
  91700. count++;
  91701. }
  91702. return count;
  91703. }
  91704. /***/ }),
  91705. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/diff.js":
  91706. /*!************************************************************!*\
  91707. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/diff.js ***!
  91708. \************************************************************/
  91709. /*! exports provided: default */
  91710. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91711. "use strict";
  91712. __webpack_require__.r(__webpack_exports__);
  91713. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return diff; });
  91714. /* harmony import */ var _src_fastdiff__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../src/fastdiff */ "./node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js");
  91715. /**
  91716. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  91717. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  91718. */
  91719. /**
  91720. * @module utils/diff
  91721. */
  91722. // The following code is based on the "O(NP) Sequence Comparison Algorithm"
  91723. // by Sun Wu, Udi Manber, Gene Myers, Webb Miller.
  91724. /**
  91725. * Calculates the difference between two arrays or strings producing an array containing a list of changes
  91726. * necessary to transform input into output.
  91727. *
  91728. * diff( 'aba', 'acca' ); // [ 'equal', 'insert', 'insert', 'delete', 'equal' ]
  91729. *
  91730. * This function is based on the "O(NP) Sequence Comparison Algorithm" by Sun Wu, Udi Manber, Gene Myers, Webb Miller.
  91731. * Unfortunately, while it gives the most precise results, its to complex for longer strings/arrow (above 200 items).
  91732. * Therefore, `diff()` automatically switches to {@link module:utils/fastdiff~fastDiff `fastDiff()`} when detecting
  91733. * such a scenario. The return formats of both functions are identical.
  91734. *
  91735. * @param {Array|String} a Input array or string.
  91736. * @param {Array|String} b Output array or string.
  91737. * @param {Function} [cmp] Optional function used to compare array values, by default === is used.
  91738. * @returns {Array} Array of changes.
  91739. */
  91740. function diff( a, b, cmp ) {
  91741. // Set the comparator function.
  91742. cmp = cmp || function( a, b ) {
  91743. return a === b;
  91744. };
  91745. const aLength = a.length;
  91746. const bLength = b.length;
  91747. // Perform `fastDiff` for longer strings/arrays (see #269).
  91748. if ( aLength > 200 || bLength > 200 || aLength + bLength > 300 ) {
  91749. return diff.fastDiff( a, b, cmp, true );
  91750. }
  91751. // Temporary action type statics.
  91752. let _insert, _delete;
  91753. // Swapped the arrays to use the shorter one as the first one.
  91754. if ( bLength < aLength ) {
  91755. const tmp = a;
  91756. a = b;
  91757. b = tmp;
  91758. // We swap the action types as well.
  91759. _insert = 'delete';
  91760. _delete = 'insert';
  91761. } else {
  91762. _insert = 'insert';
  91763. _delete = 'delete';
  91764. }
  91765. const m = a.length;
  91766. const n = b.length;
  91767. const delta = n - m;
  91768. // Edit scripts, for each diagonal.
  91769. const es = {};
  91770. // Furthest points, the furthest y we can get on each diagonal.
  91771. const fp = {};
  91772. function snake( k ) {
  91773. // We use -1 as an alternative below to handle initial values ( instead of filling the fp with -1 first ).
  91774. // Furthest points (y) on the diagonal below k.
  91775. const y1 = ( fp[ k - 1 ] !== undefined ? fp[ k - 1 ] : -1 ) + 1;
  91776. // Furthest points (y) on the diagonal above k.
  91777. const y2 = fp[ k + 1 ] !== undefined ? fp[ k + 1 ] : -1;
  91778. // The way we should go to get further.
  91779. const dir = y1 > y2 ? -1 : 1;
  91780. // Clone previous changes array (if any).
  91781. if ( es[ k + dir ] ) {
  91782. es[ k ] = es[ k + dir ].slice( 0 );
  91783. }
  91784. // Create changes array.
  91785. if ( !es[ k ] ) {
  91786. es[ k ] = [];
  91787. }
  91788. // Push the action.
  91789. es[ k ].push( y1 > y2 ? _insert : _delete );
  91790. // Set the beginning coordinates.
  91791. let y = Math.max( y1, y2 );
  91792. let x = y - k;
  91793. // Traverse the diagonal as long as the values match.
  91794. while ( x < m && y < n && cmp( a[ x ], b[ y ] ) ) {
  91795. x++;
  91796. y++;
  91797. // Push no change action.
  91798. es[ k ].push( 'equal' );
  91799. }
  91800. return y;
  91801. }
  91802. let p = 0;
  91803. let k;
  91804. // Traverse the graph until we reach the end of the longer string.
  91805. do {
  91806. // Updates furthest points and edit scripts for diagonals below delta.
  91807. for ( k = -p; k < delta; k++ ) {
  91808. fp[ k ] = snake( k );
  91809. }
  91810. // Updates furthest points and edit scripts for diagonals above delta.
  91811. for ( k = delta + p; k > delta; k-- ) {
  91812. fp[ k ] = snake( k );
  91813. }
  91814. // Updates furthest point and edit script for the delta diagonal.
  91815. // note that the delta diagonal is the one which goes through the sink (m, n).
  91816. fp[ delta ] = snake( delta );
  91817. p++;
  91818. } while ( fp[ delta ] !== n );
  91819. // Return the final list of edit changes.
  91820. // We remove the first item that represents the action for the injected nulls.
  91821. return es[ delta ].slice( 1 );
  91822. }
  91823. // Store the API in static property to easily overwrite it in tests.
  91824. // Too bad dependency injection does not work in Webpack + ES 6 (const) + Babel.
  91825. diff.fastDiff = _src_fastdiff__WEBPACK_IMPORTED_MODULE_0__["default"];
  91826. /***/ }),
  91827. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/difftochanges.js":
  91828. /*!*********************************************************************!*\
  91829. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/difftochanges.js ***!
  91830. \*********************************************************************/
  91831. /*! exports provided: default */
  91832. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91833. "use strict";
  91834. __webpack_require__.r(__webpack_exports__);
  91835. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return diffToChanges; });
  91836. /**
  91837. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  91838. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  91839. */
  91840. /**
  91841. * @module utils/difftochanges
  91842. */
  91843. /**
  91844. * Creates a set of changes which need to be applied to the input in order to transform
  91845. * it into the output. This function can be used with strings or arrays.
  91846. *
  91847. * const input = Array.from( 'abc' );
  91848. * const output = Array.from( 'xaby' );
  91849. * const changes = diffToChanges( diff( input, output ), output );
  91850. *
  91851. * changes.forEach( change => {
  91852. * if ( change.type == 'insert' ) {
  91853. * input.splice( change.index, 0, ...change.values );
  91854. * } else if ( change.type == 'delete' ) {
  91855. * input.splice( change.index, change.howMany );
  91856. * }
  91857. * } );
  91858. *
  91859. * input.join( '' ) == output.join( '' ); // -> true
  91860. *
  91861. * @param {Array.<'equal'|'insert'|'delete'>} diff Result of {@link module:utils/diff~diff}.
  91862. * @param {String|Array} output The string or array which was passed as diff's output.
  91863. * @returns {Array.<Object>} Set of changes (insert or delete) which need to be applied to the input
  91864. * in order to transform it into the output.
  91865. */
  91866. function diffToChanges( diff, output ) {
  91867. const changes = [];
  91868. let index = 0;
  91869. let lastOperation;
  91870. diff.forEach( change => {
  91871. if ( change == 'equal' ) {
  91872. pushLast();
  91873. index++;
  91874. } else if ( change == 'insert' ) {
  91875. if ( isContinuationOf( 'insert' ) ) {
  91876. lastOperation.values.push( output[ index ] );
  91877. } else {
  91878. pushLast();
  91879. lastOperation = {
  91880. type: 'insert',
  91881. index,
  91882. values: [ output[ index ] ]
  91883. };
  91884. }
  91885. index++;
  91886. } else /* if ( change == 'delete' ) */ {
  91887. if ( isContinuationOf( 'delete' ) ) {
  91888. lastOperation.howMany++;
  91889. } else {
  91890. pushLast();
  91891. lastOperation = {
  91892. type: 'delete',
  91893. index,
  91894. howMany: 1
  91895. };
  91896. }
  91897. }
  91898. } );
  91899. pushLast();
  91900. return changes;
  91901. function pushLast() {
  91902. if ( lastOperation ) {
  91903. changes.push( lastOperation );
  91904. lastOperation = null;
  91905. }
  91906. }
  91907. function isContinuationOf( expected ) {
  91908. return lastOperation && lastOperation.type == expected;
  91909. }
  91910. }
  91911. /***/ }),
  91912. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.js":
  91913. /*!*************************************************************************!*\
  91914. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.js ***!
  91915. \*************************************************************************/
  91916. /*! exports provided: default */
  91917. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91918. "use strict";
  91919. __webpack_require__.r(__webpack_exports__);
  91920. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createElement; });
  91921. /* harmony import */ var _isiterable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  91922. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  91923. /**
  91924. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  91925. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  91926. */
  91927. /**
  91928. * @module utils/dom/createelement
  91929. */
  91930. /**
  91931. * Creates element with attributes and children.
  91932. *
  91933. * createElement( document, 'p' ); // <p>
  91934. * createElement( document, 'p', { class: 'foo' } ); // <p class="foo">
  91935. * createElement( document, 'p', null, 'foo' ); // <p>foo</p>
  91936. * createElement( document, 'p', null, [ 'foo', createElement( document, 'img' ) ] ); // <p>foo<img></p>
  91937. *
  91938. * @param {Document} doc Document used to create element.
  91939. * @param {String} name Name of the element.
  91940. * @param {Object} [attributes] Object keys will become attributes keys and object values will became attributes values.
  91941. * @param {Node|String|Array.<Node|String>} [children] Child or array of children. Strings will be automatically turned
  91942. * into Text nodes.
  91943. * @returns {Element} Created element.
  91944. */
  91945. function createElement( doc, name, attributes = {}, children = [] ) {
  91946. const namespace = attributes && attributes.xmlns;
  91947. const element = namespace ? doc.createElementNS( namespace, name ) : doc.createElement( name );
  91948. for ( const key in attributes ) {
  91949. element.setAttribute( key, attributes[ key ] );
  91950. }
  91951. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_1__["isString"])( children ) || !Object(_isiterable__WEBPACK_IMPORTED_MODULE_0__["default"])( children ) ) {
  91952. children = [ children ];
  91953. }
  91954. for ( let child of children ) {
  91955. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_1__["isString"])( child ) ) {
  91956. child = doc.createTextNode( child );
  91957. }
  91958. element.appendChild( child );
  91959. }
  91960. return element;
  91961. }
  91962. /***/ }),
  91963. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js":
  91964. /*!************************************************************************!*\
  91965. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js ***!
  91966. \************************************************************************/
  91967. /*! exports provided: default */
  91968. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91969. "use strict";
  91970. __webpack_require__.r(__webpack_exports__);
  91971. /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  91972. /* harmony import */ var _uid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  91973. /* harmony import */ var _isnode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isnode */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js");
  91974. /* harmony import */ var _iswindow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./iswindow */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js");
  91975. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  91976. /**
  91977. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  91978. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  91979. */
  91980. /**
  91981. * @module utils/dom/emittermixin
  91982. */
  91983. /**
  91984. * Mixin that injects the DOM events API into its host. It provides the API
  91985. * compatible with {@link module:utils/emittermixin~EmitterMixin}.
  91986. *
  91987. * DOM emitter mixin is by default available in the {@link module:ui/view~View} class,
  91988. * but it can also be mixed into any other class:
  91989. *
  91990. * import mix from '../utils/mix.js';
  91991. * import DomEmitterMixin from '../utils/dom/emittermixin.js';
  91992. *
  91993. * class SomeView {}
  91994. * mix( SomeView, DomEmitterMixin );
  91995. *
  91996. * const view = new SomeView();
  91997. * view.listenTo( domElement, ( evt, domEvt ) => {
  91998. * console.log( evt, domEvt );
  91999. * } );
  92000. *
  92001. * @mixin EmitterMixin
  92002. * @mixes module:utils/emittermixin~EmitterMixin
  92003. * @implements module:utils/dom/emittermixin~Emitter
  92004. */
  92005. const DomEmitterMixin = Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["extend"])( {}, _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"], {
  92006. /**
  92007. * Registers a callback function to be executed when an event is fired in a specific Emitter or DOM Node.
  92008. * It is backwards compatible with {@link module:utils/emittermixin~EmitterMixin#listenTo}.
  92009. *
  92010. * @param {module:utils/emittermixin~Emitter|Node} emitter The object that fires the event.
  92011. * @param {String} event The name of the event.
  92012. * @param {Function} callback The function to be called on event.
  92013. * @param {Object} [options={}] Additional options.
  92014. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  92015. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  92016. * order they were added.
  92017. * @param {Boolean} [options.useCapture=false] Indicates that events of this type will be dispatched to the registered
  92018. * listener before being dispatched to any EventTarget beneath it in the DOM tree.
  92019. * @param {Boolean} [options.usePassive=false] Indicates that the function specified by listener will never call preventDefault()
  92020. * and prevents blocking browser's main thread by this event handler.
  92021. */
  92022. listenTo( emitter, event, callback, options = {} ) {
  92023. // Check if emitter is an instance of DOM Node. If so, use corresponding ProxyEmitter (or create one if not existing).
  92024. if ( Object(_isnode__WEBPACK_IMPORTED_MODULE_2__["default"])( emitter ) || Object(_iswindow__WEBPACK_IMPORTED_MODULE_3__["default"])( emitter ) ) {
  92025. const proxyOptions = {
  92026. capture: !!options.useCapture,
  92027. passive: !!options.usePassive
  92028. };
  92029. const proxyEmitter = this._getProxyEmitter( emitter, proxyOptions ) || new ProxyEmitter( emitter, proxyOptions );
  92030. this.listenTo( proxyEmitter, event, callback, options );
  92031. } else {
  92032. // Execute parent class method with Emitter (or ProxyEmitter) instance.
  92033. _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"].listenTo.call( this, emitter, event, callback, options );
  92034. }
  92035. },
  92036. /**
  92037. * Stops listening for events. It can be used at different levels:
  92038. * It is backwards compatible with {@link module:utils/emittermixin~EmitterMixin#listenTo}.
  92039. *
  92040. * * To stop listening to a specific callback.
  92041. * * To stop listening to a specific event.
  92042. * * To stop listening to all events fired by a specific object.
  92043. * * To stop listening to all events fired by all object.
  92044. *
  92045. * @param {module:utils/emittermixin~Emitter|Node} [emitter] The object to stop listening to. If omitted, stops it for all objects.
  92046. * @param {String} [event] (Requires the `emitter`) The name of the event to stop listening to. If omitted, stops it
  92047. * for all events from `emitter`.
  92048. * @param {Function} [callback] (Requires the `event`) The function to be removed from the call list for the given
  92049. * `event`.
  92050. */
  92051. stopListening( emitter, event, callback ) {
  92052. // Check if the emitter is an instance of DOM Node. If so, forward the call to the corresponding ProxyEmitters.
  92053. if ( Object(_isnode__WEBPACK_IMPORTED_MODULE_2__["default"])( emitter ) || Object(_iswindow__WEBPACK_IMPORTED_MODULE_3__["default"])( emitter ) ) {
  92054. const proxyEmitters = this._getAllProxyEmitters( emitter );
  92055. for ( const proxy of proxyEmitters ) {
  92056. this.stopListening( proxy, event, callback );
  92057. }
  92058. } else {
  92059. // Execute parent class method with Emitter (or ProxyEmitter) instance.
  92060. _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"].stopListening.call( this, emitter, event, callback );
  92061. }
  92062. },
  92063. /**
  92064. * Retrieves ProxyEmitter instance for given DOM Node residing in this Host and given options.
  92065. *
  92066. * @private
  92067. * @param {Node} node DOM Node of the ProxyEmitter.
  92068. * @param {Object} [options] Additional options.
  92069. * @param {Boolean} [options.useCapture=false] Indicates that events of this type will be dispatched to the registered
  92070. * listener before being dispatched to any EventTarget beneath it in the DOM tree.
  92071. * @param {Boolean} [options.usePassive=false] Indicates that the function specified by listener will never call preventDefault()
  92072. * and prevents blocking browser's main thread by this event handler.
  92073. * @returns {module:utils/dom/emittermixin~ProxyEmitter|null} ProxyEmitter instance bound to the DOM Node.
  92074. */
  92075. _getProxyEmitter( node, options ) {
  92076. return Object(_emittermixin__WEBPACK_IMPORTED_MODULE_0__["_getEmitterListenedTo"])( this, getProxyEmitterId( node, options ) );
  92077. },
  92078. /**
  92079. * Retrieves all the ProxyEmitter instances for given DOM Node residing in this Host.
  92080. *
  92081. * @private
  92082. * @param {Node} node DOM Node of the ProxyEmitter.
  92083. * @returns {Array.<module:utils/dom/emittermixin~ProxyEmitter>}
  92084. */
  92085. _getAllProxyEmitters( node ) {
  92086. return [
  92087. { capture: false, passive: false },
  92088. { capture: false, passive: true },
  92089. { capture: true, passive: false },
  92090. { capture: true, passive: true }
  92091. ].map( options => this._getProxyEmitter( node, options ) ).filter( proxy => !!proxy );
  92092. }
  92093. } );
  92094. /* harmony default export */ __webpack_exports__["default"] = (DomEmitterMixin);
  92095. /**
  92096. * Creates a ProxyEmitter instance. Such an instance is a bridge between a DOM Node firing events
  92097. * and any Host listening to them. It is backwards compatible with {@link module:utils/emittermixin~EmitterMixin#on}.
  92098. * There is a separate instance for each combination of modes (useCapture & usePassive). The mode is concatenated with
  92099. * UID stored in HTMLElement to give each instance unique identifier.
  92100. *
  92101. * listenTo( click, ... )
  92102. * +-----------------------------------------+
  92103. * | stopListening( ... ) |
  92104. * +----------------------------+ | addEventListener( click, ... )
  92105. * | Host | | +---------------------------------------------+
  92106. * +----------------------------+ | | removeEventListener( click, ... ) |
  92107. * | _listeningTo: { | +----------v-------------+ |
  92108. * | UID+mode: { | | ProxyEmitter | |
  92109. * | emitter: ProxyEmitter, | +------------------------+ +------------v----------+
  92110. * | callbacks: { | | events: { | | Node (HTMLElement) |
  92111. * | click: [ callbacks ] | | click: [ callbacks ] | +-----------------------+
  92112. * | } | | }, | | data-ck-expando: UID |
  92113. * | } | | _domNode: Node, | +-----------------------+
  92114. * | } | | _domListeners: {}, | |
  92115. * | +------------------------+ | | _emitterId: UID+mode | |
  92116. * | | DomEmitterMixin | | +--------------^---------+ |
  92117. * | +------------------------+ | | | |
  92118. * +--------------^-------------+ | +---------------------------------------------+
  92119. * | | click (DOM Event)
  92120. * +-----------------------------------------+
  92121. * fire( click, DOM Event )
  92122. *
  92123. * @mixes module:utils/emittermixin~EmitterMixin
  92124. * @implements module:utils/dom/emittermixin~Emitter
  92125. * @private
  92126. */
  92127. class ProxyEmitter {
  92128. /**
  92129. * @param {Node} node DOM Node that fires events.
  92130. * @param {Object} [options] Additional options.
  92131. * @param {Boolean} [options.useCapture=false] Indicates that events of this type will be dispatched to the registered
  92132. * listener before being dispatched to any EventTarget beneath it in the DOM tree.
  92133. * @param {Boolean} [options.usePassive=false] Indicates that the function specified by listener will never call preventDefault()
  92134. * and prevents blocking browser's main thread by this event handler.
  92135. */
  92136. constructor( node, options ) {
  92137. // Set emitter ID to match DOM Node "expando" property.
  92138. Object(_emittermixin__WEBPACK_IMPORTED_MODULE_0__["_setEmitterId"])( this, getProxyEmitterId( node, options ) );
  92139. // Remember the DOM Node this ProxyEmitter is bound to.
  92140. this._domNode = node;
  92141. // And given options.
  92142. this._options = options;
  92143. }
  92144. }
  92145. Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["extend"])( ProxyEmitter.prototype, _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"], {
  92146. /**
  92147. * Collection of native DOM listeners.
  92148. *
  92149. * @private
  92150. * @member {Object} module:utils/dom/emittermixin~ProxyEmitter#_domListeners
  92151. */
  92152. /**
  92153. * Registers a callback function to be executed when an event is fired.
  92154. *
  92155. * It attaches a native DOM listener to the DOM Node. When fired,
  92156. * a corresponding Emitter event will also fire with DOM Event object as an argument.
  92157. *
  92158. * **Note**: This is automatically called by the
  92159. * {@link module:utils/emittermixin~EmitterMixin#listenTo `EmitterMixin#listenTo()`}.
  92160. *
  92161. * @method module:utils/dom/emittermixin~ProxyEmitter#attach
  92162. * @param {String} event The name of the event.
  92163. */
  92164. attach( event ) {
  92165. // If the DOM Listener for given event already exist it is pointless
  92166. // to attach another one.
  92167. if ( this._domListeners && this._domListeners[ event ] ) {
  92168. return;
  92169. }
  92170. const domListener = this._createDomListener( event );
  92171. // Attach the native DOM listener to DOM Node.
  92172. this._domNode.addEventListener( event, domListener, this._options );
  92173. if ( !this._domListeners ) {
  92174. this._domListeners = {};
  92175. }
  92176. // Store the native DOM listener in this ProxyEmitter. It will be helpful
  92177. // when stopping listening to the event.
  92178. this._domListeners[ event ] = domListener;
  92179. },
  92180. /**
  92181. * Stops executing the callback on the given event.
  92182. *
  92183. * **Note**: This is automatically called by the
  92184. * {@link module:utils/emittermixin~EmitterMixin#stopListening `EmitterMixin#stopListening()`}.
  92185. *
  92186. * @method module:utils/dom/emittermixin~ProxyEmitter#detach
  92187. * @param {String} event The name of the event.
  92188. */
  92189. detach( event ) {
  92190. let events;
  92191. // Remove native DOM listeners which are orphans. If no callbacks
  92192. // are awaiting given event, detach native DOM listener from DOM Node.
  92193. // See: {@link attach}.
  92194. if ( this._domListeners[ event ] && ( !( events = this._events[ event ] ) || !events.callbacks.length ) ) {
  92195. this._domListeners[ event ].removeListener();
  92196. }
  92197. },
  92198. /**
  92199. * Adds callback to emitter for given event.
  92200. *
  92201. * @protected
  92202. * @method module:utils/dom/emittermixin~ProxyEmitter#_addEventListener
  92203. * @param {String} event The name of the event.
  92204. * @param {Function} callback The function to be called on event.
  92205. * @param {Object} [options={}] Additional options.
  92206. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  92207. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  92208. * order they were added.
  92209. */
  92210. _addEventListener( event, callback, options ) {
  92211. this.attach( event );
  92212. _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"]._addEventListener.call( this, event, callback, options );
  92213. },
  92214. /**
  92215. * Removes callback from emitter for given event.
  92216. *
  92217. * @protected
  92218. * @method module:utils/dom/emittermixin~ProxyEmitter#_removeEventListener
  92219. * @param {String} event The name of the event.
  92220. * @param {Function} callback The function to stop being called.
  92221. */
  92222. _removeEventListener( event, callback ) {
  92223. _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"]._removeEventListener.call( this, event, callback );
  92224. this.detach( event );
  92225. },
  92226. /**
  92227. * Creates a native DOM listener callback. When the native DOM event
  92228. * is fired it will fire corresponding event on this ProxyEmitter.
  92229. * Note: A native DOM Event is passed as an argument.
  92230. *
  92231. * @private
  92232. * @method module:utils/dom/emittermixin~ProxyEmitter#_createDomListener
  92233. * @param {String} event The name of the event.
  92234. * @returns {Function} The DOM listener callback.
  92235. */
  92236. _createDomListener( event ) {
  92237. const domListener = domEvt => {
  92238. this.fire( event, domEvt );
  92239. };
  92240. // Supply the DOM listener callback with a function that will help
  92241. // detach it from the DOM Node, when it is no longer necessary.
  92242. // See: {@link detach}.
  92243. domListener.removeListener = () => {
  92244. this._domNode.removeEventListener( event, domListener, this._options );
  92245. delete this._domListeners[ event ];
  92246. };
  92247. return domListener;
  92248. }
  92249. } );
  92250. // Gets an unique DOM Node identifier. The identifier will be set if not defined.
  92251. //
  92252. // @private
  92253. // @param {Node} node
  92254. // @returns {String} UID for given DOM Node.
  92255. function getNodeUID( node ) {
  92256. return node[ 'data-ck-expando' ] || ( node[ 'data-ck-expando' ] = Object(_uid__WEBPACK_IMPORTED_MODULE_1__["default"])() );
  92257. }
  92258. // Gets id of the ProxyEmitter for the given node.
  92259. //
  92260. // Combines DOM Node identifier and additional options.
  92261. //
  92262. // @private
  92263. // @param {Node} node
  92264. // @param {Object} options Additional options.
  92265. // @returns {String} ProxyEmitter id.
  92266. function getProxyEmitterId( node, options ) {
  92267. let id = getNodeUID( node );
  92268. for ( const option of Object.keys( options ).sort() ) {
  92269. if ( options[ option ] ) {
  92270. id += '-' + option;
  92271. }
  92272. }
  92273. return id;
  92274. }
  92275. /**
  92276. * Interface representing classes which mix in {@link module:utils/dom/emittermixin~EmitterMixin}.
  92277. *
  92278. * @interface Emitter
  92279. */
  92280. /***/ }),
  92281. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js":
  92282. /*!************************************************************************!*\
  92283. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js ***!
  92284. \************************************************************************/
  92285. /*! exports provided: default */
  92286. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92287. "use strict";
  92288. __webpack_require__.r(__webpack_exports__);
  92289. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getAncestors; });
  92290. /**
  92291. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92292. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92293. */
  92294. /* globals Node */
  92295. /**
  92296. * @module utils/dom/getancestors
  92297. */
  92298. /**
  92299. * Returns all ancestors of given DOM node, starting from the top-most (root). Includes the given node itself. If the
  92300. * node is a part of `DocumentFragment` that `DocumentFragment` will be returned. In contrary, if the node is
  92301. * appended to a `Document`, that `Document` will not be returned (algorithms operating on DOM tree care for `Document#documentElement`
  92302. * at most, which will be returned).
  92303. *
  92304. * @param {Node} node DOM node.
  92305. * @returns {Array.<Node|DocumentFragment>} Array of given `node` parents.
  92306. */
  92307. function getAncestors( node ) {
  92308. const nodes = [];
  92309. // We are interested in `Node`s `DocumentFragment`s only.
  92310. while ( node && node.nodeType != Node.DOCUMENT_NODE ) {
  92311. nodes.unshift( node );
  92312. node = node.parentNode;
  92313. }
  92314. return nodes;
  92315. }
  92316. /***/ }),
  92317. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js":
  92318. /*!***************************************************************************!*\
  92319. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js ***!
  92320. \***************************************************************************/
  92321. /*! exports provided: default */
  92322. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92323. "use strict";
  92324. __webpack_require__.r(__webpack_exports__);
  92325. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getBorderWidths; });
  92326. /**
  92327. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92328. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92329. */
  92330. /**
  92331. * @module utils/dom/getborderwidths
  92332. */
  92333. /**
  92334. * Returns an object containing CSS border widths of a specified HTML element.
  92335. *
  92336. * @param {HTMLElement} element An element which has CSS borders.
  92337. * @returns {Object} An object containing `top`, `left`, `right` and `bottom` properties
  92338. * with numerical values of the `border-[top,left,right,bottom]-width` CSS styles.
  92339. */
  92340. function getBorderWidths( element ) {
  92341. // Call getComputedStyle on the window the element document belongs to.
  92342. const style = element.ownerDocument.defaultView.getComputedStyle( element );
  92343. return {
  92344. top: parseInt( style.borderTopWidth, 10 ),
  92345. right: parseInt( style.borderRightWidth, 10 ),
  92346. bottom: parseInt( style.borderBottomWidth, 10 ),
  92347. left: parseInt( style.borderLeftWidth, 10 )
  92348. };
  92349. }
  92350. /***/ }),
  92351. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getdatafromelement.js":
  92352. /*!******************************************************************************!*\
  92353. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getdatafromelement.js ***!
  92354. \******************************************************************************/
  92355. /*! exports provided: default */
  92356. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92357. "use strict";
  92358. __webpack_require__.r(__webpack_exports__);
  92359. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getDataFromElement; });
  92360. /**
  92361. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92362. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92363. */
  92364. /* globals HTMLTextAreaElement */
  92365. /**
  92366. * @module utils/dom/getdatafromelement
  92367. */
  92368. /**
  92369. * Gets data from a given source element.
  92370. *
  92371. * @param {HTMLElement} el The element from which the data will be retrieved.
  92372. * @returns {String} The data string.
  92373. */
  92374. function getDataFromElement( el ) {
  92375. if ( el instanceof HTMLTextAreaElement ) {
  92376. return el.value;
  92377. }
  92378. return el.innerHTML;
  92379. }
  92380. /***/ }),
  92381. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getpositionedancestor.js":
  92382. /*!*********************************************************************************!*\
  92383. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getpositionedancestor.js ***!
  92384. \*********************************************************************************/
  92385. /*! exports provided: default */
  92386. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92387. "use strict";
  92388. __webpack_require__.r(__webpack_exports__);
  92389. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getPositionedAncestor; });
  92390. /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  92391. /**
  92392. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92393. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92394. */
  92395. /**
  92396. * @module utils/dom/getpositionedancestor
  92397. */
  92398. /**
  92399. * For a given element, returns the nearest ancestor element which CSS position is not "static".
  92400. *
  92401. * @param {HTMLElement} element The native DOM element to be checked.
  92402. * @returns {HTMLElement|null}
  92403. */
  92404. function getPositionedAncestor( element ) {
  92405. if ( !element || !element.parentNode ) {
  92406. return null;
  92407. }
  92408. if ( element.offsetParent === _global__WEBPACK_IMPORTED_MODULE_0__["default"].document.body ) {
  92409. return null;
  92410. }
  92411. return element.offsetParent;
  92412. }
  92413. /***/ }),
  92414. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js":
  92415. /*!******************************************************************!*\
  92416. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js ***!
  92417. \******************************************************************/
  92418. /*! exports provided: default */
  92419. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92420. "use strict";
  92421. __webpack_require__.r(__webpack_exports__);
  92422. /**
  92423. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92424. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92425. */
  92426. /* globals window, document */
  92427. /**
  92428. * @module utils/dom/global
  92429. */
  92430. /**
  92431. * A helper (module) giving an access to the global DOM objects such as `window` and
  92432. * `document`. Accessing these objects using this helper allows easy and bulletproof
  92433. * testing, i.e. stubbing native properties:
  92434. *
  92435. * import global from 'ckeditor5/utils/dom/global.js';
  92436. *
  92437. * // This stub will work for any code using global module.
  92438. * testUtils.sinon.stub( global, 'window', {
  92439. * innerWidth: 10000
  92440. * } );
  92441. *
  92442. * console.log( global.window.innerWidth );
  92443. */
  92444. /* harmony default export */ __webpack_exports__["default"] = ({ window, document });
  92445. /***/ }),
  92446. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/indexof.js":
  92447. /*!*******************************************************************!*\
  92448. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/indexof.js ***!
  92449. \*******************************************************************/
  92450. /*! exports provided: default */
  92451. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92452. "use strict";
  92453. __webpack_require__.r(__webpack_exports__);
  92454. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return indexOf; });
  92455. /**
  92456. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92457. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92458. */
  92459. /**
  92460. * @module utils/dom/indexof
  92461. */
  92462. /**
  92463. * Returns index of the node in the parent element.
  92464. *
  92465. * @param {Node} node Node which index is tested.
  92466. * @returns {Number} Index of the node in the parent element. Returns 0 if node has no parent.
  92467. */
  92468. function indexOf( node ) {
  92469. let index = 0;
  92470. while ( node.previousSibling ) {
  92471. node = node.previousSibling;
  92472. index++;
  92473. }
  92474. return index;
  92475. }
  92476. /***/ }),
  92477. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/insertat.js":
  92478. /*!********************************************************************!*\
  92479. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/insertat.js ***!
  92480. \********************************************************************/
  92481. /*! exports provided: default */
  92482. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92483. "use strict";
  92484. __webpack_require__.r(__webpack_exports__);
  92485. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return insertAt; });
  92486. /**
  92487. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92488. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92489. */
  92490. /**
  92491. * @module utils/dom/insertat
  92492. */
  92493. /**
  92494. * Inserts node to the parent at given index.
  92495. *
  92496. * @param {Element} parentElement Parent element.
  92497. * @param {Number} index Insertions index.
  92498. * @param {Node} nodeToInsert Node to insert.
  92499. */
  92500. function insertAt( parentElement, index, nodeToInsert ) {
  92501. parentElement.insertBefore( nodeToInsert, parentElement.childNodes[ index ] || null );
  92502. }
  92503. /***/ }),
  92504. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js":
  92505. /*!******************************************************************!*\
  92506. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js ***!
  92507. \******************************************************************/
  92508. /*! exports provided: default */
  92509. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92510. "use strict";
  92511. __webpack_require__.r(__webpack_exports__);
  92512. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isNode; });
  92513. /**
  92514. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92515. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92516. */
  92517. /**
  92518. * @module utils/dom/isnode
  92519. */
  92520. /**
  92521. * Checks if the object is a native DOM Node.
  92522. *
  92523. * @param {*} obj
  92524. * @returns {Boolean}
  92525. */
  92526. function isNode( obj ) {
  92527. if ( obj ) {
  92528. if ( obj.defaultView ) {
  92529. return obj instanceof obj.defaultView.Document;
  92530. } else if ( obj.ownerDocument && obj.ownerDocument.defaultView ) {
  92531. return obj instanceof obj.ownerDocument.defaultView.Node;
  92532. }
  92533. }
  92534. return false;
  92535. }
  92536. /***/ }),
  92537. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js":
  92538. /*!*******************************************************************!*\
  92539. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js ***!
  92540. \*******************************************************************/
  92541. /*! exports provided: default */
  92542. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92543. "use strict";
  92544. __webpack_require__.r(__webpack_exports__);
  92545. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isRange; });
  92546. /**
  92547. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92548. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92549. */
  92550. /**
  92551. * @module utils/dom/isrange
  92552. */
  92553. /**
  92554. * Checks if the object is a native DOM Range.
  92555. *
  92556. * @param {*} obj
  92557. * @returns {Boolean}
  92558. */
  92559. function isRange( obj ) {
  92560. return Object.prototype.toString.apply( obj ) == '[object Range]';
  92561. }
  92562. /***/ }),
  92563. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js":
  92564. /*!******************************************************************!*\
  92565. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js ***!
  92566. \******************************************************************/
  92567. /*! exports provided: default */
  92568. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92569. "use strict";
  92570. __webpack_require__.r(__webpack_exports__);
  92571. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isText; });
  92572. /**
  92573. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92574. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92575. */
  92576. /**
  92577. * @module utils/dom/istext
  92578. */
  92579. /**
  92580. * Checks if the object is a native DOM Text node.
  92581. *
  92582. * @param {*} obj
  92583. * @returns {Boolean}
  92584. */
  92585. function isText( obj ) {
  92586. return Object.prototype.toString.call( obj ) == '[object Text]';
  92587. }
  92588. /***/ }),
  92589. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js":
  92590. /*!********************************************************************!*\
  92591. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js ***!
  92592. \********************************************************************/
  92593. /*! exports provided: default */
  92594. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92595. "use strict";
  92596. __webpack_require__.r(__webpack_exports__);
  92597. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isWindow; });
  92598. /**
  92599. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92600. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92601. */
  92602. /**
  92603. * @module utils/dom/iswindow
  92604. */
  92605. /**
  92606. * Checks if the object is a native DOM Window.
  92607. *
  92608. * @param {*} obj
  92609. * @returns {Boolean}
  92610. */
  92611. function isWindow( obj ) {
  92612. const stringifiedObject = Object.prototype.toString.apply( obj );
  92613. // Returns `true` for the `window` object in browser environments.
  92614. if ( stringifiedObject == '[object Window]' ) {
  92615. return true;
  92616. }
  92617. // Returns `true` for the `window` object in the Electron environment.
  92618. if ( stringifiedObject == '[object global]' ) {
  92619. return true;
  92620. }
  92621. return false;
  92622. }
  92623. /***/ }),
  92624. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js":
  92625. /*!********************************************************************!*\
  92626. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js ***!
  92627. \********************************************************************/
  92628. /*! exports provided: getOptimalPosition, Position */
  92629. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92630. "use strict";
  92631. __webpack_require__.r(__webpack_exports__);
  92632. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOptimalPosition", function() { return getOptimalPosition; });
  92633. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; });
  92634. /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  92635. /* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  92636. /* harmony import */ var _getpositionedancestor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getpositionedancestor */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getpositionedancestor.js");
  92637. /* harmony import */ var _getborderwidths__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getborderwidths */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js");
  92638. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  92639. /**
  92640. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  92641. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  92642. */
  92643. /**
  92644. * @module utils/dom/position
  92645. */
  92646. // @if CK_DEBUG_POSITION // import { RectDrawer } from '@ckeditor/ckeditor5-minimap/src/utils';
  92647. /**
  92648. * Calculates the `position: absolute` coordinates of a given element so it can be positioned with respect to the
  92649. * target in the visually most efficient way, taking various restrictions like viewport or limiter geometry
  92650. * into consideration.
  92651. *
  92652. * // The element which is to be positioned.
  92653. * const element = document.body.querySelector( '#toolbar' );
  92654. *
  92655. * // A target to which the element is positioned relatively.
  92656. * const target = document.body.querySelector( '#container' );
  92657. *
  92658. * // Finding the optimal coordinates for the positioning.
  92659. * const { left, top, name } = getOptimalPosition( {
  92660. * element: element,
  92661. * target: target,
  92662. *
  92663. * // The algorithm will chose among these positions to meet the requirements such
  92664. * // as "limiter" element or "fitInViewport", set below. The positions are considered
  92665. * // in the order of the array.
  92666. * positions: [
  92667. * //
  92668. * // [ Target ]
  92669. * // +-----------------+
  92670. * // | Element |
  92671. * // +-----------------+
  92672. * //
  92673. * targetRect => ( {
  92674. * top: targetRect.bottom,
  92675. * left: targetRect.left,
  92676. * name: 'mySouthEastPosition'
  92677. * } ),
  92678. *
  92679. * //
  92680. * // +-----------------+
  92681. * // | Element |
  92682. * // +-----------------+
  92683. * // [ Target ]
  92684. * //
  92685. * ( targetRect, elementRect ) => ( {
  92686. * top: targetRect.top - elementRect.height,
  92687. * left: targetRect.left,
  92688. * name: 'myNorthEastPosition'
  92689. * } )
  92690. * ],
  92691. *
  92692. * // Find a position such guarantees the element remains within visible boundaries of <body>.
  92693. * limiter: document.body,
  92694. *
  92695. * // Find a position such guarantees the element remains within visible boundaries of the browser viewport.
  92696. * fitInViewport: true
  92697. * } );
  92698. *
  92699. * // The best position which fits into document.body and the viewport. May be useful
  92700. * // to set proper class on the `element`.
  92701. * console.log( name ); // -> "myNorthEastPosition"
  92702. *
  92703. * // Using the absolute coordinates which has been found to position the element
  92704. * // as in the diagram depicting the "myNorthEastPosition" position.
  92705. * element.style.top = top;
  92706. * element.style.left = left;
  92707. *
  92708. * @param {module:utils/dom/position~Options} options The input data and configuration of the helper.
  92709. * @returns {module:utils/dom/position~Position}
  92710. */
  92711. function getOptimalPosition( { element, target, positions, limiter, fitInViewport, viewportOffsetConfig } ) {
  92712. // If the {@link module:utils/dom/position~Options#target} is a function, use what it returns.
  92713. // https://github.com/ckeditor/ckeditor5-utils/issues/157
  92714. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isFunction"])( target ) ) {
  92715. target = target();
  92716. }
  92717. // If the {@link module:utils/dom/position~Options#limiter} is a function, use what it returns.
  92718. // https://github.com/ckeditor/ckeditor5-ui/issues/260
  92719. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isFunction"])( limiter ) ) {
  92720. limiter = limiter();
  92721. }
  92722. const positionedElementAncestor = Object(_getpositionedancestor__WEBPACK_IMPORTED_MODULE_2__["default"])( element );
  92723. const elementRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( element );
  92724. const targetRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( target );
  92725. let bestPosition;
  92726. // @if CK_DEBUG_POSITION // RectDrawer.clear();
  92727. // @if CK_DEBUG_POSITION // RectDrawer.draw( targetRect, { outlineWidth: '5px' }, 'Target' );
  92728. const positionOptions = { targetRect, elementRect, positionedElementAncestor };
  92729. // If there are no limits, just grab the very first position and be done with that drama.
  92730. if ( !limiter && !fitInViewport ) {
  92731. bestPosition = new Position( positions[ 0 ], positionOptions );
  92732. } else {
  92733. const limiterRect = limiter && new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( limiter ).getVisible();
  92734. const viewportRect = fitInViewport && getConstrainedViewportRect( viewportOffsetConfig );
  92735. // @if CK_DEBUG_POSITION // if ( viewportRect ) {
  92736. // @if CK_DEBUG_POSITION // RectDrawer.draw( viewportRect, { outlineWidth: '5px' }, 'Viewport' );
  92737. // @if CK_DEBUG_POSITION // }
  92738. // @if CK_DEBUG_POSITION // if ( limiter ) {
  92739. // @if CK_DEBUG_POSITION // RectDrawer.draw( limiterRect, { outlineWidth: '5px', outlineColor: 'green' }, 'Visible limiter' );
  92740. // @if CK_DEBUG_POSITION // }
  92741. Object.assign( positionOptions, { limiterRect, viewportRect } );
  92742. // If there's no best position found, i.e. when all intersections have no area because
  92743. // rects have no width or height, then just use the first available position.
  92744. bestPosition = getBestPosition( positions, positionOptions ) || new Position( positions[ 0 ], positionOptions );
  92745. }
  92746. return bestPosition;
  92747. }
  92748. // Returns a viewport `Rect` shrunk by the viewport offset config from all sides.
  92749. //
  92750. // @private
  92751. // @param {Object} An object containing viewportOffset config.
  92752. // @returns {utils/dom/rect~Rect} A shrunken rect of the viewport.
  92753. function getConstrainedViewportRect( viewportOffsetConfig ) {
  92754. viewportOffsetConfig = Object.assign( { top: 0, bottom: 0, left: 0, right: 0 }, viewportOffsetConfig );
  92755. const viewportRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( _global__WEBPACK_IMPORTED_MODULE_0__["default"].window );
  92756. viewportRect.top += viewportOffsetConfig.top;
  92757. viewportRect.height -= viewportOffsetConfig.top;
  92758. viewportRect.bottom -= viewportOffsetConfig.bottom;
  92759. viewportRect.height -= viewportOffsetConfig.bottom;
  92760. return viewportRect;
  92761. }
  92762. // For a given array of positioning functions, returns such that provides the best
  92763. // fit of the `elementRect` into the `limiterRect` and `viewportRect`.
  92764. //
  92765. // @private
  92766. //
  92767. // @param {Object} options
  92768. // @param {module:utils/dom/position~Options#positions} positions Functions returning
  92769. // {@link module:utils/dom/position~Position}to be checked, in the order of preference.
  92770. // @param {Object} options
  92771. // @param {utils/dom/rect~Rect} options.targetRect A rect of the {@link module:utils/dom/position~Options#target}.
  92772. // @param {utils/dom/rect~Rect} options.elementRect A rect of positioned
  92773. // {@link module:utils/dom/position~Options#element}.
  92774. // @param {utils/dom/rect~Rect} options.limiterRect A rect of the {@link module:utils/dom/position~Options#limiter}.
  92775. // @param {utils/dom/rect~Rect} options.viewportRect A rect of the {@link module:utils/dom/position~Options#viewport}.
  92776. //
  92777. // @returns {Array} An array containing the name of the position and it's rect.
  92778. function getBestPosition( positions, options ) {
  92779. const { elementRect } = options;
  92780. // This is when element is fully visible.
  92781. const elementRectArea = elementRect.getArea();
  92782. const positionInstances = positions
  92783. .map( positioningFunction => new Position( positioningFunction, options ) )
  92784. // Some positioning functions may return `null` if they don't want to participate.
  92785. .filter( position => !!position.name );
  92786. let maxFitFactor = 0;
  92787. let bestPosition = null;
  92788. for ( const position of positionInstances ) {
  92789. const { _limiterIntersectionArea, _viewportIntersectionArea } = position;
  92790. // If a such position is found that element is fully contained by the limiter then, obviously,
  92791. // there will be no better one, so finishing.
  92792. if ( _limiterIntersectionArea === elementRectArea ) {
  92793. return position;
  92794. }
  92795. // To maximize both viewport and limiter intersection areas we use distance on _viewportIntersectionArea
  92796. // and _limiterIntersectionArea plane (without sqrt because we are looking for max value).
  92797. const fitFactor = _viewportIntersectionArea ** 2 + _limiterIntersectionArea ** 2;
  92798. if ( fitFactor > maxFitFactor ) {
  92799. maxFitFactor = fitFactor;
  92800. bestPosition = position;
  92801. }
  92802. }
  92803. return bestPosition;
  92804. }
  92805. // For a given absolute Rect coordinates object and a positioned element ancestor, it returns an object with
  92806. // new Rect coordinates that make up for the position and the scroll of the ancestor.
  92807. //
  92808. // This is necessary because while Rects (and DOMRects) are relative to the browser's viewport, their coordinates
  92809. // are used in real–life to position elements with `position: absolute`, which are scoped by any positioned
  92810. // (and scrollable) ancestors.
  92811. //
  92812. // @private
  92813. //
  92814. // @param {utils/dom/rect~Rect} rect A rect with absolute rect coordinates.
  92815. // @param {Number} rect.top
  92816. // @param {Number} rect.left
  92817. // @param {HTMLElement} positionedElementAncestor An ancestor element that should be considered.
  92818. //
  92819. // @returns {utils/dom/rect~Rect} A rect corresponding to `absoluteRect` input but with values shifted
  92820. // to make up for the positioned element ancestor.
  92821. function shiftRectToCompensatePositionedAncestor( rect, positionedElementAncestor ) {
  92822. const ancestorPosition = getRectForAbsolutePositioning( new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( positionedElementAncestor ) );
  92823. const ancestorBorderWidths = Object(_getborderwidths__WEBPACK_IMPORTED_MODULE_3__["default"])( positionedElementAncestor );
  92824. let moveX = 0;
  92825. let moveY = 0;
  92826. // (https://github.com/ckeditor/ckeditor5-ui-default/issues/126)
  92827. // If there's some positioned ancestor of the panel, then its `Rect` must be taken into
  92828. // consideration. `Rect` is always relative to the viewport while `position: absolute` works
  92829. // with respect to that positioned ancestor.
  92830. moveX -= ancestorPosition.left;
  92831. moveY -= ancestorPosition.top;
  92832. // (https://github.com/ckeditor/ckeditor5-utils/issues/139)
  92833. // If there's some positioned ancestor of the panel, not only its position must be taken into
  92834. // consideration (see above) but also its internal scrolls. Scroll have an impact here because `Rect`
  92835. // is relative to the viewport (it doesn't care about scrolling), while `position: absolute`
  92836. // must compensate that scrolling.
  92837. moveX += positionedElementAncestor.scrollLeft;
  92838. moveY += positionedElementAncestor.scrollTop;
  92839. // (https://github.com/ckeditor/ckeditor5-utils/issues/139)
  92840. // If there's some positioned ancestor of the panel, then its `Rect` includes its CSS `borderWidth`
  92841. // while `position: absolute` positioning does not consider it.
  92842. // E.g. `{ position: absolute, top: 0, left: 0 }` means upper left corner of the element,
  92843. // not upper-left corner of its border.
  92844. moveX -= ancestorBorderWidths.left;
  92845. moveY -= ancestorBorderWidths.top;
  92846. rect.moveBy( moveX, moveY );
  92847. }
  92848. // DOMRect (also Rect) works in a scroll–independent geometry but `position: absolute` doesn't.
  92849. // This function converts Rect to `position: absolute` coordinates.
  92850. //
  92851. // @private
  92852. // @param {utils/dom/rect~Rect} rect A rect to be converted.
  92853. // @returns {Object} Object containing `left` and `top` properties, in absolute coordinates.
  92854. function getRectForAbsolutePositioning( rect ) {
  92855. const { scrollX, scrollY } = _global__WEBPACK_IMPORTED_MODULE_0__["default"].window;
  92856. return rect.clone().moveBy( scrollX, scrollY );
  92857. }
  92858. /**
  92859. * A position class which instances are created and used by the {@link module:utils/dom/position~getOptimalPosition} helper.
  92860. *
  92861. * {@link module:utils/dom/position~Position#top} and {@link module:utils/dom/position~Position#left} properties of the position instance
  92862. * translate directly to the `top` and `left` properties in CSS "`position: absolute` coordinate system". If set on the positioned element
  92863. * in DOM, they will make it display it in the right place in the viewport.
  92864. */
  92865. class Position {
  92866. /**
  92867. * Creates an instance of the {@link module:utils/dom/position~Position} class.
  92868. *
  92869. * @param {module:utils/dom/position~positioningFunction} [positioningFunction] function The function that defines the expected
  92870. * coordinates the positioned element should move to.
  92871. * @param {Object} [options] options object.
  92872. * @param {module:utils/dom/rect~Rect} options.elementRect The positioned element rect.
  92873. * @param {module:utils/dom/rect~Rect} options.targetRect The target element rect.
  92874. * @param {module:utils/dom/rect~Rect} options.viewportRect The viewport rect.
  92875. * @param {HTMLElement|null} [options.positionedElementAncestor] Nearest element ancestor element which CSS position is not "static".
  92876. */
  92877. constructor( positioningFunction, options ) {
  92878. const positioningFunctionOutput = positioningFunction( options.targetRect, options.elementRect, options.viewportRect );
  92879. // Nameless position for a function that didn't participate.
  92880. if ( !positioningFunctionOutput ) {
  92881. return;
  92882. }
  92883. const { left, top, name, config } = positioningFunctionOutput;
  92884. Object.assign( this, { name, config } );
  92885. this._positioningFunctionCorrdinates = { left, top };
  92886. this._options = options;
  92887. /**
  92888. * Position name.
  92889. *
  92890. * @readonly
  92891. * @member {String} #name
  92892. */
  92893. /**
  92894. * Additional position configuration, as passed from the {@link module:utils/dom/position~positioningFunction positioning function}.
  92895. *
  92896. * This object can be use, for instance, to pass through presentation options used by the consumer of the
  92897. * {@link module:utils/dom/position~getOptimalPosition} helper.
  92898. *
  92899. * @readonly
  92900. * @member {Object} #config
  92901. */
  92902. }
  92903. /**
  92904. * The left value in pixels in the CSS `position: absolute` coordinate system.
  92905. * Set it on the positioned element in DOM to move it to the position.
  92906. *
  92907. * @readonly
  92908. * @type {Number}
  92909. */
  92910. get left() {
  92911. return this._absoluteRect.left;
  92912. }
  92913. /**
  92914. * The top value in pixels in the CSS `position: absolute` coordinate system.
  92915. * Set it on the positioned element in DOM to move it to the position.
  92916. *
  92917. * @readonly
  92918. * @type {Number}
  92919. */
  92920. get top() {
  92921. return this._absoluteRect.top;
  92922. }
  92923. /**
  92924. * An intersection area between positioned element and limiter within viewport constraints.
  92925. *
  92926. * @readonly
  92927. * @private
  92928. * @type {Number}
  92929. */
  92930. get _limiterIntersectionArea() {
  92931. const limiterRect = this._options.limiterRect;
  92932. if ( limiterRect ) {
  92933. const viewportRect = this._options.viewportRect;
  92934. if ( viewportRect ) {
  92935. // Consider only the part of the limiter which is visible in the viewport. So the limiter is getting limited.
  92936. const limiterViewportIntersectRect = limiterRect.getIntersection( viewportRect );
  92937. if ( limiterViewportIntersectRect ) {
  92938. // If the limiter is within the viewport, then check the intersection between that part of the
  92939. // limiter and actual position.
  92940. return limiterViewportIntersectRect.getIntersectionArea( this._rect );
  92941. }
  92942. } else {
  92943. return limiterRect.getIntersectionArea( this._rect );
  92944. }
  92945. }
  92946. return 0;
  92947. }
  92948. /**
  92949. * An intersection area between positioned element and viewport.
  92950. *
  92951. * @readonly
  92952. * @private
  92953. * @type {Number}
  92954. */
  92955. get _viewportIntersectionArea() {
  92956. const viewportRect = this._options.viewportRect;
  92957. if ( viewportRect ) {
  92958. return viewportRect.getIntersectionArea( this._rect );
  92959. }
  92960. return 0;
  92961. }
  92962. /**
  92963. * An already positioned element rect. A clone of the element rect passed to the constructor
  92964. * but placed in the viewport according to the positioning function.
  92965. *
  92966. * @private
  92967. * @type {module:utils/dom/rect~Rect}
  92968. */
  92969. get _rect() {
  92970. if ( this._cachedRect ) {
  92971. return this._cachedRect;
  92972. }
  92973. this._cachedRect = this._options.elementRect.clone().moveTo(
  92974. this._positioningFunctionCorrdinates.left,
  92975. this._positioningFunctionCorrdinates.top
  92976. );
  92977. return this._cachedRect;
  92978. }
  92979. /**
  92980. * An already absolutely positioned element rect. See ({@link #_rect}).
  92981. *
  92982. * @private
  92983. * @type {module:utils/dom/rect~Rect}
  92984. */
  92985. get _absoluteRect() {
  92986. if ( this._cachedAbsoluteRect ) {
  92987. return this._cachedAbsoluteRect;
  92988. }
  92989. this._cachedAbsoluteRect = getRectForAbsolutePositioning( this._rect );
  92990. if ( this._options.positionedElementAncestor ) {
  92991. shiftRectToCompensatePositionedAncestor( this._cachedAbsoluteRect, this._options.positionedElementAncestor );
  92992. }
  92993. return this._cachedAbsoluteRect;
  92994. }
  92995. }
  92996. /**
  92997. * The `getOptimalPosition()` helper options.
  92998. *
  92999. * @interface module:utils/dom/position~Options
  93000. */
  93001. /**
  93002. * Element that is to be positioned.
  93003. *
  93004. * @member {HTMLElement} #element
  93005. */
  93006. /**
  93007. * Target with respect to which the `element` is to be positioned.
  93008. *
  93009. * @member {HTMLElement|Range|Window|ClientRect|DOMRect|module:utils/dom/rect~Rect|Object|Function} #target
  93010. */
  93011. /**
  93012. * An array of positioning functions.
  93013. *
  93014. * **Note**: Positioning functions are processed in the order of preference. The first function that works
  93015. * in the current environment (e.g. offers the complete fit in the viewport geometry) will be picked by
  93016. * `getOptimalPosition()`.
  93017. *
  93018. * **Note**: Any positioning function returning `null` is ignored.
  93019. *
  93020. * @member {Array.<module:utils/dom/position~positioningFunction>} #positions
  93021. */
  93022. /**
  93023. * When set, the algorithm will chose position which fits the most in the
  93024. * limiter's bounding rect.
  93025. *
  93026. * @member {HTMLElement|Range|Window|ClientRect|DOMRect|module:utils/dom/rect~Rect|Object|Function} #limiter
  93027. */
  93028. /**
  93029. * When set, the algorithm will chose such a position which fits `element`
  93030. * the most inside visible viewport.
  93031. *
  93032. * @member {Boolean} #fitInViewport
  93033. */
  93034. /**
  93035. * Viewport offset config object. It restricts the visible viewport available to the `getOptimalPosition()` from each side.
  93036. *
  93037. * {
  93038. * top: 50,
  93039. * right: 50,
  93040. * bottom: 50,
  93041. * left: 50
  93042. * }
  93043. *
  93044. * @member {Object} #viewportOffsetConfig
  93045. */
  93046. /**
  93047. * A positioning function which, based on positioned element and target {@link module:utils/dom/rect~Rect Rects}, returns rect coordinates
  93048. * representing the geometrical relation between them. Used by the {@link module:utils/dom/position~getOptimalPosition} helper.
  93049. *
  93050. * // This simple position will place the element directly under the target, in the middle:
  93051. * //
  93052. * // [ Target ]
  93053. * // +-----------------+
  93054. * // | Element |
  93055. * // +-----------------+
  93056. * //
  93057. * const position = ( targetRect, elementRect, [ viewportRect ] ) => ( {
  93058. * top: targetRect.bottom,
  93059. * left: targetRect.left + targetRect.width / 2 - elementRect.width / 2,
  93060. * name: 'bottomMiddle',
  93061. *
  93062. * // Note: The config is optional.
  93063. * config: {
  93064. * zIndex: '999'
  93065. * }
  93066. * } );
  93067. *
  93068. * @callback module:utils/dom/position~positioningFunction
  93069. * @param {module:utils/dom/rect~Rect} elementRect The rect of the element to be positioned.
  93070. * @param {module:utils/dom/rect~Rect} targetRect The rect of the target the element (its rect) is relatively positioned to.
  93071. * @param {module:utils/dom/rect~Rect} viewportRect The rect of the visual browser viewport.
  93072. * @returns {Object|null} return When the function returns `null`, it will not be considered by
  93073. * {@link module:utils/dom/position~getOptimalPosition}.
  93074. * @returns {Number} return.top The `top` value of the element rect that would represent the position.
  93075. * @returns {Number} return.left The `left` value of the element rect that would represent the position.
  93076. * @returns {Number} return.name The name of the position. It helps the user of the {@link module:utils/dom/position~getOptimalPosition}
  93077. * helper to recognize different positioning function results. It will pass through to the {@link module:utils/dom/position~Position}
  93078. * returned by the helper.
  93079. * @returns {Number} [return.config] An optional configuration that will pass-through the
  93080. * {@link module:utils/dom/position~getOptimalPosition} helper to the {@link module:utils/dom/position~Position} returned by this helper.
  93081. * This configuration may, for instance, let the user of {@link module:utils/dom/position~getOptimalPosition} know that this particular
  93082. * position comes with a certain presentation.
  93083. */
  93084. /***/ }),
  93085. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js":
  93086. /*!****************************************************************!*\
  93087. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js ***!
  93088. \****************************************************************/
  93089. /*! exports provided: default */
  93090. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93091. "use strict";
  93092. __webpack_require__.r(__webpack_exports__);
  93093. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Rect; });
  93094. /* harmony import */ var _isrange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isrange */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js");
  93095. /* harmony import */ var _iswindow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iswindow */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js");
  93096. /* harmony import */ var _getborderwidths__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getborderwidths */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js");
  93097. /* harmony import */ var _istext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
  93098. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  93099. /**
  93100. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  93101. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  93102. */
  93103. /**
  93104. * @module utils/dom/rect
  93105. */
  93106. const rectProperties = [ 'top', 'right', 'bottom', 'left', 'width', 'height' ];
  93107. /**
  93108. * A helper class representing a `ClientRect` object, e.g. value returned by
  93109. * the native `object.getBoundingClientRect()` method. Provides a set of methods
  93110. * to manipulate the rect and compare it against other rect instances.
  93111. */
  93112. class Rect {
  93113. /**
  93114. * Creates an instance of rect.
  93115. *
  93116. * // Rect of an HTMLElement.
  93117. * const rectA = new Rect( document.body );
  93118. *
  93119. * // Rect of a DOM Range.
  93120. * const rectB = new Rect( document.getSelection().getRangeAt( 0 ) );
  93121. *
  93122. * // Rect of a window (web browser viewport).
  93123. * const rectC = new Rect( window );
  93124. *
  93125. * // Rect out of an object.
  93126. * const rectD = new Rect( { top: 0, right: 10, bottom: 10, left: 0, width: 10, height: 10 } );
  93127. *
  93128. * // Rect out of another Rect instance.
  93129. * const rectE = new Rect( rectD );
  93130. *
  93131. * // Rect out of a ClientRect.
  93132. * const rectF = new Rect( document.body.getClientRects().item( 0 ) );
  93133. *
  93134. * **Note**: By default a rect of an HTML element includes its CSS borders and scrollbars (if any)
  93135. * ant the rect of a `window` includes scrollbars too. Use {@link #excludeScrollbarsAndBorders}
  93136. * to get the inner part of the rect.
  93137. *
  93138. * @param {HTMLElement|Range|Window|ClientRect|DOMRect|module:utils/dom/rect~Rect|Object} source A source object to create the rect.
  93139. */
  93140. constructor( source ) {
  93141. const isSourceRange = Object(_isrange__WEBPACK_IMPORTED_MODULE_0__["default"])( source );
  93142. /**
  93143. * The object this rect is for.
  93144. *
  93145. * @protected
  93146. * @readonly
  93147. * @member {HTMLElement|Range|Window|ClientRect|DOMRect|module:utils/dom/rect~Rect|Object} #_source
  93148. */
  93149. Object.defineProperty( this, '_source', {
  93150. // If the source is a Rect instance, copy it's #_source.
  93151. value: source._source || source,
  93152. writable: true,
  93153. enumerable: false
  93154. } );
  93155. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isElement"])( source ) || isSourceRange ) {
  93156. // The `Rect` class depends on `getBoundingClientRect` and `getClientRects` DOM methods. If the source
  93157. // of a rect in an HTML element or a DOM range but it does not belong to any rendered DOM tree, these methods
  93158. // will fail to obtain the geometry and the rect instance makes little sense to the features using it.
  93159. // To get rid of this warning make sure the source passed to the constructor is a descendant of `window.document.body`.
  93160. // @if CK_DEBUG // const sourceNode = isSourceRange ? source.startContainer : source;
  93161. // @if CK_DEBUG // if ( !sourceNode.ownerDocument || !sourceNode.ownerDocument.body.contains( sourceNode ) ) {
  93162. // @if CK_DEBUG // console.warn(
  93163. // @if CK_DEBUG // 'rect-source-not-in-dom: The source of this rect does not belong to any rendered DOM tree.',
  93164. // @if CK_DEBUG // { source } );
  93165. // @if CK_DEBUG // }
  93166. if ( isSourceRange ) {
  93167. const rangeRects = Rect.getDomRangeRects( source );
  93168. copyRectProperties( this, Rect.getBoundingRect( rangeRects ) );
  93169. } else {
  93170. copyRectProperties( this, source.getBoundingClientRect() );
  93171. }
  93172. } else if ( Object(_iswindow__WEBPACK_IMPORTED_MODULE_1__["default"])( source ) ) {
  93173. const { innerWidth, innerHeight } = source;
  93174. copyRectProperties( this, {
  93175. top: 0,
  93176. right: innerWidth,
  93177. bottom: innerHeight,
  93178. left: 0,
  93179. width: innerWidth,
  93180. height: innerHeight
  93181. } );
  93182. } else {
  93183. copyRectProperties( this, source );
  93184. }
  93185. /**
  93186. * The "top" value of the rect.
  93187. *
  93188. * @readonly
  93189. * @member {Number} #top
  93190. */
  93191. /**
  93192. * The "right" value of the rect.
  93193. *
  93194. * @readonly
  93195. * @member {Number} #right
  93196. */
  93197. /**
  93198. * The "bottom" value of the rect.
  93199. *
  93200. * @readonly
  93201. * @member {Number} #bottom
  93202. */
  93203. /**
  93204. * The "left" value of the rect.
  93205. *
  93206. * @readonly
  93207. * @member {Number} #left
  93208. */
  93209. /**
  93210. * The "width" value of the rect.
  93211. *
  93212. * @readonly
  93213. * @member {Number} #width
  93214. */
  93215. /**
  93216. * The "height" value of the rect.
  93217. *
  93218. * @readonly
  93219. * @member {Number} #height
  93220. */
  93221. }
  93222. /**
  93223. * Returns a clone of the rect.
  93224. *
  93225. * @returns {module:utils/dom/rect~Rect} A cloned rect.
  93226. */
  93227. clone() {
  93228. return new Rect( this );
  93229. }
  93230. /**
  93231. * Moves the rect so that its upper–left corner lands in desired `[ x, y ]` location.
  93232. *
  93233. * @param {Number} x Desired horizontal location.
  93234. * @param {Number} y Desired vertical location.
  93235. * @returns {module:utils/dom/rect~Rect} A rect which has been moved.
  93236. */
  93237. moveTo( x, y ) {
  93238. this.top = y;
  93239. this.right = x + this.width;
  93240. this.bottom = y + this.height;
  93241. this.left = x;
  93242. return this;
  93243. }
  93244. /**
  93245. * Moves the rect in–place by a dedicated offset.
  93246. *
  93247. * @param {Number} x A horizontal offset.
  93248. * @param {Number} y A vertical offset
  93249. * @returns {module:utils/dom/rect~Rect} A rect which has been moved.
  93250. */
  93251. moveBy( x, y ) {
  93252. this.top += y;
  93253. this.right += x;
  93254. this.left += x;
  93255. this.bottom += y;
  93256. return this;
  93257. }
  93258. /**
  93259. * Returns a new rect a a result of intersection with another rect.
  93260. *
  93261. * @param {module:utils/dom/rect~Rect} anotherRect
  93262. * @returns {module:utils/dom/rect~Rect}
  93263. */
  93264. getIntersection( anotherRect ) {
  93265. const rect = {
  93266. top: Math.max( this.top, anotherRect.top ),
  93267. right: Math.min( this.right, anotherRect.right ),
  93268. bottom: Math.min( this.bottom, anotherRect.bottom ),
  93269. left: Math.max( this.left, anotherRect.left )
  93270. };
  93271. rect.width = rect.right - rect.left;
  93272. rect.height = rect.bottom - rect.top;
  93273. if ( rect.width < 0 || rect.height < 0 ) {
  93274. return null;
  93275. } else {
  93276. return new Rect( rect );
  93277. }
  93278. }
  93279. /**
  93280. * Returns the area of intersection with another rect.
  93281. *
  93282. * @param {module:utils/dom/rect~Rect} anotherRect [description]
  93283. * @returns {Number} Area of intersection.
  93284. */
  93285. getIntersectionArea( anotherRect ) {
  93286. const rect = this.getIntersection( anotherRect );
  93287. if ( rect ) {
  93288. return rect.getArea();
  93289. } else {
  93290. return 0;
  93291. }
  93292. }
  93293. /**
  93294. * Returns the area of the rect.
  93295. *
  93296. * @returns {Number}
  93297. */
  93298. getArea() {
  93299. return this.width * this.height;
  93300. }
  93301. /**
  93302. * Returns a new rect, a part of the original rect, which is actually visible to the user,
  93303. * e.g. an original rect cropped by parent element rects which have `overflow` set in CSS
  93304. * other than `"visible"`.
  93305. *
  93306. * If there's no such visible rect, which is when the rect is limited by one or many of
  93307. * the ancestors, `null` is returned.
  93308. *
  93309. * @returns {module:utils/dom/rect~Rect|null} A visible rect instance or `null`, if there's none.
  93310. */
  93311. getVisible() {
  93312. const source = this._source;
  93313. let visibleRect = this.clone();
  93314. // There's no ancestor to crop <body> with the overflow.
  93315. if ( !isBody( source ) ) {
  93316. let parent = source.parentNode || source.commonAncestorContainer;
  93317. // Check the ancestors all the way up to the <body>.
  93318. while ( parent && !isBody( parent ) ) {
  93319. const parentRect = new Rect( parent );
  93320. const intersectionRect = visibleRect.getIntersection( parentRect );
  93321. if ( intersectionRect ) {
  93322. if ( intersectionRect.getArea() < visibleRect.getArea() ) {
  93323. // Reduce the visible rect to the intersection.
  93324. visibleRect = intersectionRect;
  93325. }
  93326. } else {
  93327. // There's no intersection, the rect is completely invisible.
  93328. return null;
  93329. }
  93330. parent = parent.parentNode;
  93331. }
  93332. }
  93333. return visibleRect;
  93334. }
  93335. /**
  93336. * Checks if all property values ({@link #top}, {@link #left}, {@link #right},
  93337. * {@link #bottom}, {@link #width} and {@link #height}) are the equal in both rect
  93338. * instances.
  93339. *
  93340. * @param {module:utils/dom/rect~Rect} rect A rect instance to compare with.
  93341. * @returns {Boolean} `true` when Rects are equal. `false` otherwise.
  93342. */
  93343. isEqual( anotherRect ) {
  93344. for ( const prop of rectProperties ) {
  93345. if ( this[ prop ] !== anotherRect[ prop ] ) {
  93346. return false;
  93347. }
  93348. }
  93349. return true;
  93350. }
  93351. /**
  93352. * Checks whether a rect fully contains another rect instance.
  93353. *
  93354. * @param {module:utils/dom/rect~Rect} anotherRect
  93355. * @returns {Boolean} `true` if contains, `false` otherwise.
  93356. */
  93357. contains( anotherRect ) {
  93358. const intersectRect = this.getIntersection( anotherRect );
  93359. return !!( intersectRect && intersectRect.isEqual( anotherRect ) );
  93360. }
  93361. /**
  93362. * Excludes scrollbars and CSS borders from the rect.
  93363. *
  93364. * * Borders are removed when {@link #_source} is an HTML element.
  93365. * * Scrollbars are excluded from HTML elements and the `window`.
  93366. *
  93367. * @returns {module:utils/dom/rect~Rect} A rect which has been updated.
  93368. */
  93369. excludeScrollbarsAndBorders() {
  93370. const source = this._source;
  93371. let scrollBarWidth, scrollBarHeight, direction;
  93372. if ( Object(_iswindow__WEBPACK_IMPORTED_MODULE_1__["default"])( source ) ) {
  93373. scrollBarWidth = source.innerWidth - source.document.documentElement.clientWidth;
  93374. scrollBarHeight = source.innerHeight - source.document.documentElement.clientHeight;
  93375. direction = source.getComputedStyle( source.document.documentElement ).direction;
  93376. } else {
  93377. const borderWidths = Object(_getborderwidths__WEBPACK_IMPORTED_MODULE_2__["default"])( this._source );
  93378. scrollBarWidth = source.offsetWidth - source.clientWidth - borderWidths.left - borderWidths.right;
  93379. scrollBarHeight = source.offsetHeight - source.clientHeight - borderWidths.top - borderWidths.bottom;
  93380. direction = source.ownerDocument.defaultView.getComputedStyle( source ).direction;
  93381. this.left += borderWidths.left;
  93382. this.top += borderWidths.top;
  93383. this.right -= borderWidths.right;
  93384. this.bottom -= borderWidths.bottom;
  93385. this.width = this.right - this.left;
  93386. this.height = this.bottom - this.top;
  93387. }
  93388. this.width -= scrollBarWidth;
  93389. if ( direction === 'ltr' ) {
  93390. this.right -= scrollBarWidth;
  93391. } else {
  93392. this.left += scrollBarWidth;
  93393. }
  93394. this.height -= scrollBarHeight;
  93395. this.bottom -= scrollBarHeight;
  93396. return this;
  93397. }
  93398. /**
  93399. * Returns an array of rects of the given native DOM Range.
  93400. *
  93401. * @param {Range} range A native DOM range.
  93402. * @returns {Array.<module:utils/dom/rect~Rect>} DOM Range rects.
  93403. */
  93404. static getDomRangeRects( range ) {
  93405. const rects = [];
  93406. // Safari does not iterate over ClientRectList using for...of loop.
  93407. const clientRects = Array.from( range.getClientRects() );
  93408. if ( clientRects.length ) {
  93409. for ( const rect of clientRects ) {
  93410. rects.push( new Rect( rect ) );
  93411. }
  93412. }
  93413. // If there's no client rects for the Range, use parent container's bounding rect
  93414. // instead and adjust rect's width to simulate the actual geometry of such range.
  93415. // https://github.com/ckeditor/ckeditor5-utils/issues/153
  93416. // https://github.com/ckeditor/ckeditor5-ui/issues/317
  93417. else {
  93418. let startContainer = range.startContainer;
  93419. if ( Object(_istext__WEBPACK_IMPORTED_MODULE_3__["default"])( startContainer ) ) {
  93420. startContainer = startContainer.parentNode;
  93421. }
  93422. const rect = new Rect( startContainer.getBoundingClientRect() );
  93423. rect.right = rect.left;
  93424. rect.width = 0;
  93425. rects.push( rect );
  93426. }
  93427. return rects;
  93428. }
  93429. /**
  93430. * Returns a bounding rectangle that contains all the given `rects`.
  93431. *
  93432. * @param {Iterable.<module:utils/dom/rect~Rect>} rects A list of rectangles that should be contained in the result rectangle.
  93433. * @returns {module:utils/dom/rect~Rect|null} Bounding rectangle or `null` if no `rects` were given.
  93434. */
  93435. static getBoundingRect( rects ) {
  93436. const boundingRectData = {
  93437. left: Number.POSITIVE_INFINITY,
  93438. top: Number.POSITIVE_INFINITY,
  93439. right: Number.NEGATIVE_INFINITY,
  93440. bottom: Number.NEGATIVE_INFINITY
  93441. };
  93442. let rectangleCount = 0;
  93443. for ( const rect of rects ) {
  93444. rectangleCount++;
  93445. boundingRectData.left = Math.min( boundingRectData.left, rect.left );
  93446. boundingRectData.top = Math.min( boundingRectData.top, rect.top );
  93447. boundingRectData.right = Math.max( boundingRectData.right, rect.right );
  93448. boundingRectData.bottom = Math.max( boundingRectData.bottom, rect.bottom );
  93449. }
  93450. if ( rectangleCount == 0 ) {
  93451. return null;
  93452. }
  93453. boundingRectData.width = boundingRectData.right - boundingRectData.left;
  93454. boundingRectData.height = boundingRectData.bottom - boundingRectData.top;
  93455. return new Rect( boundingRectData );
  93456. }
  93457. }
  93458. // Acquires all the rect properties from the passed source.
  93459. //
  93460. // @private
  93461. // @param {module:utils/dom/rect~Rect} rect
  93462. // @param {ClientRect|module:utils/dom/rect~Rect|Object} source
  93463. function copyRectProperties( rect, source ) {
  93464. for ( const p of rectProperties ) {
  93465. rect[ p ] = source[ p ];
  93466. }
  93467. }
  93468. // Checks if provided object is a <body> HTML element.
  93469. //
  93470. // @private
  93471. // @param {HTMLElement|Range} elementOrRange
  93472. // @returns {Boolean}
  93473. function isBody( elementOrRange ) {
  93474. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isElement"])( elementOrRange ) ) {
  93475. return false;
  93476. }
  93477. return elementOrRange === elementOrRange.ownerDocument.body;
  93478. }
  93479. /***/ }),
  93480. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/remove.js":
  93481. /*!******************************************************************!*\
  93482. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/remove.js ***!
  93483. \******************************************************************/
  93484. /*! exports provided: default */
  93485. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93486. "use strict";
  93487. __webpack_require__.r(__webpack_exports__);
  93488. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return remove; });
  93489. /**
  93490. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  93491. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  93492. */
  93493. /**
  93494. * @module utils/dom/remove
  93495. */
  93496. /**
  93497. * Removes given node from parent.
  93498. *
  93499. * @param {Node} node Node to remove.
  93500. */
  93501. function remove( node ) {
  93502. const parent = node.parentNode;
  93503. if ( parent ) {
  93504. parent.removeChild( node );
  93505. }
  93506. }
  93507. /***/ }),
  93508. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js":
  93509. /*!**************************************************************************!*\
  93510. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js ***!
  93511. \**************************************************************************/
  93512. /*! exports provided: default */
  93513. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93514. "use strict";
  93515. __webpack_require__.r(__webpack_exports__);
  93516. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ResizeObserver; });
  93517. /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  93518. /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  93519. /* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  93520. /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
  93521. /**
  93522. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  93523. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  93524. */
  93525. /**
  93526. * @module utils/dom/resizeobserver
  93527. */
  93528. /* globals setTimeout, clearTimeout */
  93529. const RESIZE_CHECK_INTERVAL = 100;
  93530. /**
  93531. * A helper class which instances allow performing custom actions when native DOM elements are resized.
  93532. *
  93533. * const editableElement = editor.editing.view.getDomRoot();
  93534. *
  93535. * const observer = new ResizeObserver( editableElement, entry => {
  93536. * console.log( 'The editable element has been resized in DOM.' );
  93537. * console.log( entry.target ); // -> editableElement
  93538. * console.log( entry.contentRect.width ); // -> e.g. '423px'
  93539. * } );
  93540. *
  93541. * By default, it uses the [native DOM resize observer](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)
  93542. * under the hood and in browsers that do not support the native API yet, a polyfilled observer is
  93543. * used instead.
  93544. */
  93545. class ResizeObserver {
  93546. /**
  93547. * Creates an instance of the `ResizeObserver` class.
  93548. *
  93549. * @param {HTMLElement} element A DOM element that is to be observed for resizing. Note that
  93550. * the element must be visible (i.e. not detached from DOM) for the observer to work.
  93551. * @param {Function} callback A function called when the observed element was resized. It passes
  93552. * the [`ResizeObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry)
  93553. * object with information about the resize event.
  93554. */
  93555. constructor( element, callback ) {
  93556. // **Note**: For the maximum performance, this class ensures only a single instance of the native
  93557. // (or polyfilled) observer is used no matter how many instances of this class were created.
  93558. if ( !ResizeObserver._observerInstance ) {
  93559. ResizeObserver._createObserver();
  93560. }
  93561. /**
  93562. * The element observer by this observer.
  93563. *
  93564. * @readonly
  93565. * @private
  93566. * @member {HTMLElement}
  93567. */
  93568. this._element = element;
  93569. /**
  93570. * The callback executed each time {@link #_element} is resized.
  93571. *
  93572. * @readonly
  93573. * @private
  93574. * @member {Function}
  93575. */
  93576. this._callback = callback;
  93577. ResizeObserver._addElementCallback( element, callback );
  93578. ResizeObserver._observerInstance.observe( element );
  93579. }
  93580. /**
  93581. * Destroys the observer which disables the `callback` passed to the {@link #constructor}.
  93582. */
  93583. destroy() {
  93584. ResizeObserver._deleteElementCallback( this._element, this._callback );
  93585. }
  93586. /**
  93587. * Registers a new resize callback for the DOM element.
  93588. *
  93589. * @private
  93590. * @static
  93591. * @param {HTMLElement} element
  93592. * @param {Function} callback
  93593. */
  93594. static _addElementCallback( element, callback ) {
  93595. if ( !ResizeObserver._elementCallbacks ) {
  93596. ResizeObserver._elementCallbacks = new Map();
  93597. }
  93598. let callbacks = ResizeObserver._elementCallbacks.get( element );
  93599. if ( !callbacks ) {
  93600. callbacks = new Set();
  93601. ResizeObserver._elementCallbacks.set( element, callbacks );
  93602. }
  93603. callbacks.add( callback );
  93604. }
  93605. /**
  93606. * Removes a resize callback from the DOM element. If no callbacks are left
  93607. * for the element, it removes the element from the native observer.
  93608. *
  93609. * @private
  93610. * @static
  93611. * @param {HTMLElement} element
  93612. * @param {Function} callback
  93613. */
  93614. static _deleteElementCallback( element, callback ) {
  93615. const callbacks = ResizeObserver._getElementCallbacks( element );
  93616. // Remove the element callback. Check if exist first in case someone
  93617. // called destroy() twice.
  93618. if ( callbacks ) {
  93619. callbacks.delete( callback );
  93620. // If no callbacks left for the element, also remove the element.
  93621. if ( !callbacks.size ) {
  93622. ResizeObserver._elementCallbacks.delete( element );
  93623. ResizeObserver._observerInstance.unobserve( element );
  93624. }
  93625. }
  93626. if ( ResizeObserver._elementCallbacks && !ResizeObserver._elementCallbacks.size ) {
  93627. ResizeObserver._observerInstance = null;
  93628. ResizeObserver._elementCallbacks = null;
  93629. }
  93630. }
  93631. /**
  93632. * Returns are registered resize callbacks for the DOM element.
  93633. *
  93634. * @private
  93635. * @static
  93636. * @param {HTMLElement} element
  93637. * @returns {Set.<HTMLElement>|null}
  93638. */
  93639. static _getElementCallbacks( element ) {
  93640. if ( !ResizeObserver._elementCallbacks ) {
  93641. return null;
  93642. }
  93643. return ResizeObserver._elementCallbacks.get( element );
  93644. }
  93645. /**
  93646. * Creates the single native observer shared across all `ResizeObserver` instances.
  93647. * If the browser does not support the native API, it creates a polyfill.
  93648. *
  93649. * @private
  93650. * @static
  93651. */
  93652. static _createObserver() {
  93653. let ObserverConstructor;
  93654. // TODO: One day, the `ResizeObserver` API will be supported in all modern web browsers.
  93655. // When it happens, this module will no longer make sense and should be removed and
  93656. // the native implementation should be used across the project to save bytes.
  93657. // Check out https://caniuse.com/#feat=resizeobserver.
  93658. if ( typeof _global__WEBPACK_IMPORTED_MODULE_1__["default"].window.ResizeObserver === 'function' ) {
  93659. ObserverConstructor = _global__WEBPACK_IMPORTED_MODULE_1__["default"].window.ResizeObserver;
  93660. } else {
  93661. ObserverConstructor = ResizeObserverPolyfill;
  93662. }
  93663. ResizeObserver._observerInstance = new ObserverConstructor( entries => {
  93664. for ( const entry of entries ) {
  93665. const callbacks = ResizeObserver._getElementCallbacks( entry.target );
  93666. if ( callbacks ) {
  93667. for ( const callback of callbacks ) {
  93668. callback( entry );
  93669. }
  93670. }
  93671. }
  93672. } );
  93673. }
  93674. }
  93675. /**
  93676. * The single native observer instance (or polyfill in browsers that do not support the API)
  93677. * shared across all {@link module:utils/dom/resizeobserver~ResizeObserver} instances.
  93678. *
  93679. * @static
  93680. * @protected
  93681. * @readonly
  93682. * @property {Object|null} module:utils/dom/resizeobserver~ResizeObserver#_observerInstance
  93683. */
  93684. ResizeObserver._observerInstance = null;
  93685. /**
  93686. * A mapping of native DOM elements and their callbacks shared across all
  93687. * {@link module:utils/dom/resizeobserver~ResizeObserver} instances.
  93688. *
  93689. * @static
  93690. * @private
  93691. * @readonly
  93692. * @property {Map.<HTMLElement,Set>|null} module:utils/dom/resizeobserver~ResizeObserver#_elementCallbacks
  93693. */
  93694. ResizeObserver._elementCallbacks = null;
  93695. /**
  93696. * A polyfill class for the native [`ResizeObserver`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver).
  93697. *
  93698. * @private
  93699. * @mixes module:utils/domemittermixin~DomEmitterMixin
  93700. */
  93701. class ResizeObserverPolyfill {
  93702. /**
  93703. * Creates an instance of the {@link module:utils/dom/resizeobserver~ResizeObserverPolyfill} class.
  93704. *
  93705. * It synchronously reacts to resize of the window to check if observed elements' geometry changed.
  93706. *
  93707. * Additionally, the polyfilled observer uses a timeout to check if observed elements' geometry has changed
  93708. * in some other way (dynamic layouts, scrollbars showing up, etc.), so its response can also be asynchronous.
  93709. *
  93710. * @param {Function} callback A function called when any observed element was resized. Refer to the
  93711. * native [`ResizeObserver`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) API to
  93712. * learn more.
  93713. */
  93714. constructor( callback ) {
  93715. /**
  93716. * A function called when any observed {@link #_elements element} was resized.
  93717. *
  93718. * @readonly
  93719. * @protected
  93720. * @member {Function}
  93721. */
  93722. this._callback = callback;
  93723. /**
  93724. * DOM elements currently observed by the observer instance.
  93725. *
  93726. * @readonly
  93727. * @protected
  93728. * @member {Set}
  93729. */
  93730. this._elements = new Set();
  93731. /**
  93732. * Cached DOM {@link #_elements elements} bounding rects to compare to upon the next check.
  93733. *
  93734. * @readonly
  93735. * @protected
  93736. * @member {Map.<HTMLElement,module:utils/dom/rect~Rect>}
  93737. */
  93738. this._previousRects = new Map();
  93739. /**
  93740. * An UID of the current timeout upon which the observed elements rects
  93741. * will be compared to the {@link #_previousRects previous rects} from the past.
  93742. *
  93743. * @readonly
  93744. * @protected
  93745. * @member {Map.<HTMLElement,module:utils/dom/rect~Rect>}
  93746. */
  93747. this._periodicCheckTimeout = null;
  93748. }
  93749. /**
  93750. * Starts observing a DOM element.
  93751. *
  93752. * Learn more in the
  93753. * [native method documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/observe).
  93754. *
  93755. * @param {HTMLElement} element
  93756. */
  93757. observe( element ) {
  93758. this._elements.add( element );
  93759. this._checkElementRectsAndExecuteCallback();
  93760. if ( this._elements.size === 1 ) {
  93761. this._startPeriodicCheck();
  93762. }
  93763. }
  93764. /**
  93765. * Stops observing a DOM element.
  93766. *
  93767. * Learn more in the
  93768. * [native method documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/unobserve).
  93769. *
  93770. * @param {HTMLElement} element
  93771. */
  93772. unobserve( element ) {
  93773. this._elements.delete( element );
  93774. this._previousRects.delete( element );
  93775. if ( !this._elements.size ) {
  93776. this._stopPeriodicCheck();
  93777. }
  93778. }
  93779. /**
  93780. * When called, the observer calls the {@link #_callback resize callback} for all observed
  93781. * {@link #_elements elements} but also starts checking periodically for changes in the elements' geometry.
  93782. * If some are detected, {@link #_callback resize callback} is called for relevant elements that were resized.
  93783. *
  93784. * @protected
  93785. */
  93786. _startPeriodicCheck() {
  93787. const periodicCheck = () => {
  93788. this._checkElementRectsAndExecuteCallback();
  93789. this._periodicCheckTimeout = setTimeout( periodicCheck, RESIZE_CHECK_INTERVAL );
  93790. };
  93791. this.listenTo( _global__WEBPACK_IMPORTED_MODULE_1__["default"].window, 'resize', () => {
  93792. this._checkElementRectsAndExecuteCallback();
  93793. } );
  93794. this._periodicCheckTimeout = setTimeout( periodicCheck, RESIZE_CHECK_INTERVAL );
  93795. }
  93796. /**
  93797. * Stops checking for changes in all observed {@link #_elements elements} geometry.
  93798. *
  93799. * @protected
  93800. */
  93801. _stopPeriodicCheck() {
  93802. clearTimeout( this._periodicCheckTimeout );
  93803. this.stopListening();
  93804. this._previousRects.clear();
  93805. }
  93806. /**
  93807. * Checks if the geometry of any of the {@link #_elements element} has changed. If so, executes
  93808. * the {@link #_callback resize callback} with element geometry data.
  93809. *
  93810. * @protected
  93811. */
  93812. _checkElementRectsAndExecuteCallback() {
  93813. const entries = [];
  93814. for ( const element of this._elements ) {
  93815. if ( this._hasRectChanged( element ) ) {
  93816. entries.push( {
  93817. target: element,
  93818. contentRect: this._previousRects.get( element )
  93819. } );
  93820. }
  93821. }
  93822. if ( entries.length ) {
  93823. this._callback( entries );
  93824. }
  93825. }
  93826. /**
  93827. * Compares the DOM element geometry to the {@link #_previousRects cached geometry} from the past.
  93828. * Returns `true` if geometry has changed or the element is checked for the first time.
  93829. *
  93830. * @protected
  93831. * @param {HTMLElement} element
  93832. * @returns {Boolean}
  93833. */
  93834. _hasRectChanged( element ) {
  93835. if ( !element.ownerDocument.body.contains( element ) ) {
  93836. return false;
  93837. }
  93838. const currentRect = new _rect__WEBPACK_IMPORTED_MODULE_2__["default"]( element );
  93839. const previousRect = this._previousRects.get( element );
  93840. // The first check should always yield true despite no Previous rect to compare to.
  93841. // The native ResizeObserver does that and... that makes sense. Sort of.
  93842. const hasChanged = !previousRect || !previousRect.isEqual( currentRect );
  93843. this._previousRects.set( element, currentRect );
  93844. return hasChanged;
  93845. }
  93846. }
  93847. Object(_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( ResizeObserverPolyfill, _emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  93848. /***/ }),
  93849. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/scroll.js":
  93850. /*!******************************************************************!*\
  93851. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/scroll.js ***!
  93852. \******************************************************************/
  93853. /*! exports provided: scrollViewportToShowTarget, scrollAncestorsToShowTarget */
  93854. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93855. "use strict";
  93856. __webpack_require__.r(__webpack_exports__);
  93857. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollViewportToShowTarget", function() { return scrollViewportToShowTarget; });
  93858. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollAncestorsToShowTarget", function() { return scrollAncestorsToShowTarget; });
  93859. /* harmony import */ var _isrange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isrange */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js");
  93860. /* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  93861. /* harmony import */ var _istext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
  93862. /**
  93863. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  93864. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  93865. */
  93866. /**
  93867. * @module utils/dom/scroll
  93868. */
  93869. const utils = {};
  93870. /**
  93871. * Makes any page `HTMLElement` or `Range` (`target`) visible inside the browser viewport.
  93872. * This helper will scroll all `target` ancestors and the web browser viewport to reveal the target to
  93873. * the user. If the `target` is already visible, nothing will happen.
  93874. *
  93875. * @param {HTMLElement|Range} options.target A target, which supposed to become visible to the user.
  93876. * @param {Number} [options.viewportOffset] An offset from the edge of the viewport (in pixels)
  93877. * the `target` will be moved by when the viewport is scrolled. It enhances the user experience
  93878. * by keeping the `target` some distance from the edge of the viewport and thus making it easier to
  93879. * read or edit by the user.
  93880. */
  93881. function scrollViewportToShowTarget( { target, viewportOffset = 0 } ) {
  93882. const targetWindow = getWindow( target );
  93883. let currentWindow = targetWindow;
  93884. let currentFrame = null;
  93885. // Iterate over all windows, starting from target's parent window up to window#top.
  93886. while ( currentWindow ) {
  93887. let firstAncestorToScroll;
  93888. // Let's scroll target's ancestors first to reveal it. Then, once the ancestor scrolls
  93889. // settled down, the algorithm can eventually scroll the viewport of the current window.
  93890. //
  93891. // Note: If the current window is target's **original** window (e.g. the first one),
  93892. // start scrolling the closest parent of the target. If not, scroll the closest parent
  93893. // of an iframe that resides in the current window.
  93894. if ( currentWindow == targetWindow ) {
  93895. firstAncestorToScroll = getParentElement( target );
  93896. } else {
  93897. firstAncestorToScroll = getParentElement( currentFrame );
  93898. }
  93899. // Scroll the target's ancestors first. Once done, scrolling the viewport is easy.
  93900. scrollAncestorsToShowRect( firstAncestorToScroll, () => {
  93901. // Note: If the target does not belong to the current window **directly**,
  93902. // i.e. it resides in an iframe belonging to the window, obtain the target's rect
  93903. // in the coordinates of the current window. By default, a Rect returns geometry
  93904. // relative to the current window's viewport. To make it work in a parent window,
  93905. // it must be shifted.
  93906. return getRectRelativeToWindow( target, currentWindow );
  93907. } );
  93908. // Obtain the rect of the target after it has been scrolled within its ancestors.
  93909. // It's time to scroll the viewport.
  93910. const targetRect = getRectRelativeToWindow( target, currentWindow );
  93911. scrollWindowToShowRect( currentWindow, targetRect, viewportOffset );
  93912. if ( currentWindow.parent != currentWindow ) {
  93913. // Keep the reference to the <iframe> element the "previous current window" was
  93914. // rendered within. It will be useful to re–calculate the rect of the target
  93915. // in the parent window's relative geometry. The target's rect must be shifted
  93916. // by it's iframe's position.
  93917. currentFrame = currentWindow.frameElement;
  93918. currentWindow = currentWindow.parent;
  93919. // If the current window has some parent but frameElement is inaccessible, then they have
  93920. // different domains/ports and, due to security reasons, accessing and scrolling
  93921. // the parent window won't be possible.
  93922. // See https://github.com/ckeditor/ckeditor5/issues/930.
  93923. if ( !currentFrame ) {
  93924. return;
  93925. }
  93926. } else {
  93927. currentWindow = null;
  93928. }
  93929. }
  93930. }
  93931. /**
  93932. * Makes any page `HTMLElement` or `Range` (target) visible within its scrollable ancestors,
  93933. * e.g. if they have `overflow: scroll` CSS style.
  93934. *
  93935. * @param {HTMLElement|Range} target A target, which supposed to become visible to the user.
  93936. */
  93937. function scrollAncestorsToShowTarget( target ) {
  93938. const targetParent = getParentElement( target );
  93939. scrollAncestorsToShowRect( targetParent, () => {
  93940. return new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( target );
  93941. } );
  93942. }
  93943. // TODO: Using a property value shorthand in the top of the file
  93944. // causes JSDoc to throw errors. See https://github.com/cksource/docs-builder/issues/75.
  93945. Object.assign( utils, {
  93946. scrollViewportToShowTarget,
  93947. scrollAncestorsToShowTarget
  93948. } );
  93949. // Makes a given rect visible within its parent window.
  93950. //
  93951. // Note: Avoid the situation where the caret is still in the viewport, but totally
  93952. // at the edge of it. In such situation, if it moved beyond the viewport in the next
  93953. // action e.g. after paste, the scrolling would move it to the viewportOffset level
  93954. // and it all would look like the caret visually moved up/down:
  93955. //
  93956. // 1.
  93957. // | foo[]
  93958. // | <--- N px of space below the caret
  93959. // +---------------------------------...
  93960. //
  93961. // 2. *paste*
  93962. // 3.
  93963. // |
  93964. // |
  93965. // +-foo-----------------------------...
  93966. // bar[] <--- caret below viewport, scrolling...
  93967. //
  93968. // 4. *scrolling*
  93969. // 5.
  93970. // |
  93971. // | foo
  93972. // | bar[] <--- caret precisely at the edge
  93973. // +---------------------------------...
  93974. //
  93975. // To prevent this, this method checks the rects moved by the viewportOffset to cover
  93976. // the upper/lower edge of the viewport. It makes sure if the action repeats, there's
  93977. // no twitching – it's a purely visual improvement:
  93978. //
  93979. // 5. (after fix)
  93980. // |
  93981. // | foo
  93982. // | bar[]
  93983. // | <--- N px of space below the caret
  93984. // +---------------------------------...
  93985. //
  93986. // @private
  93987. // @param {Window} window A window which is scrolled to reveal the rect.
  93988. // @param {module:utils/dom/rect~Rect} rect A rect which is to be revealed.
  93989. // @param {Number} viewportOffset See scrollViewportToShowTarget.
  93990. function scrollWindowToShowRect( window, rect, viewportOffset ) {
  93991. const targetShiftedDownRect = rect.clone().moveBy( 0, viewportOffset );
  93992. const targetShiftedUpRect = rect.clone().moveBy( 0, -viewportOffset );
  93993. const viewportRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( window ).excludeScrollbarsAndBorders();
  93994. const rects = [ targetShiftedUpRect, targetShiftedDownRect ];
  93995. if ( !rects.every( rect => viewportRect.contains( rect ) ) ) {
  93996. let { scrollX, scrollY } = window;
  93997. if ( isAbove( targetShiftedUpRect, viewportRect ) ) {
  93998. scrollY -= viewportRect.top - rect.top + viewportOffset;
  93999. } else if ( isBelow( targetShiftedDownRect, viewportRect ) ) {
  94000. scrollY += rect.bottom - viewportRect.bottom + viewportOffset;
  94001. }
  94002. // TODO: Web browsers scroll natively to place the target in the middle
  94003. // of the viewport. It's not a very popular case, though.
  94004. if ( isLeftOf( rect, viewportRect ) ) {
  94005. scrollX -= viewportRect.left - rect.left + viewportOffset;
  94006. } else if ( isRightOf( rect, viewportRect ) ) {
  94007. scrollX += rect.right - viewportRect.right + viewportOffset;
  94008. }
  94009. window.scrollTo( scrollX, scrollY );
  94010. }
  94011. }
  94012. // Recursively scrolls element ancestors to visually reveal a rect.
  94013. //
  94014. // @private
  94015. // @param {HTMLElement} A parent The first ancestors to start scrolling.
  94016. // @param {Function} getRect A function which returns the Rect, which is to be revealed.
  94017. function scrollAncestorsToShowRect( parent, getRect ) {
  94018. const parentWindow = getWindow( parent );
  94019. let parentRect, targetRect;
  94020. while ( parent != parentWindow.document.body ) {
  94021. targetRect = getRect();
  94022. parentRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( parent ).excludeScrollbarsAndBorders();
  94023. if ( !parentRect.contains( targetRect ) ) {
  94024. if ( isAbove( targetRect, parentRect ) ) {
  94025. parent.scrollTop -= parentRect.top - targetRect.top;
  94026. } else if ( isBelow( targetRect, parentRect ) ) {
  94027. parent.scrollTop += targetRect.bottom - parentRect.bottom;
  94028. }
  94029. if ( isLeftOf( targetRect, parentRect ) ) {
  94030. parent.scrollLeft -= parentRect.left - targetRect.left;
  94031. } else if ( isRightOf( targetRect, parentRect ) ) {
  94032. parent.scrollLeft += targetRect.right - parentRect.right;
  94033. }
  94034. }
  94035. parent = parent.parentNode;
  94036. }
  94037. }
  94038. // Determines if a given `Rect` extends beyond the bottom edge of the second `Rect`.
  94039. //
  94040. // @private
  94041. // @param {module:utils/dom/rect~Rect} firstRect
  94042. // @param {module:utils/dom/rect~Rect} secondRect
  94043. function isBelow( firstRect, secondRect ) {
  94044. return firstRect.bottom > secondRect.bottom;
  94045. }
  94046. // Determines if a given `Rect` extends beyond the top edge of the second `Rect`.
  94047. //
  94048. // @private
  94049. // @param {module:utils/dom/rect~Rect} firstRect
  94050. // @param {module:utils/dom/rect~Rect} secondRect
  94051. function isAbove( firstRect, secondRect ) {
  94052. return firstRect.top < secondRect.top;
  94053. }
  94054. // Determines if a given `Rect` extends beyond the left edge of the second `Rect`.
  94055. //
  94056. // @private
  94057. // @param {module:utils/dom/rect~Rect} firstRect
  94058. // @param {module:utils/dom/rect~Rect} secondRect
  94059. function isLeftOf( firstRect, secondRect ) {
  94060. return firstRect.left < secondRect.left;
  94061. }
  94062. // Determines if a given `Rect` extends beyond the right edge of the second `Rect`.
  94063. //
  94064. // @private
  94065. // @param {module:utils/dom/rect~Rect} firstRect
  94066. // @param {module:utils/dom/rect~Rect} secondRect
  94067. function isRightOf( firstRect, secondRect ) {
  94068. return firstRect.right > secondRect.right;
  94069. }
  94070. // Returns the closest window of an element or range.
  94071. //
  94072. // @private
  94073. // @param {HTMLElement|Range} firstRect
  94074. // @returns {Window}
  94075. function getWindow( elementOrRange ) {
  94076. if ( Object(_isrange__WEBPACK_IMPORTED_MODULE_0__["default"])( elementOrRange ) ) {
  94077. return elementOrRange.startContainer.ownerDocument.defaultView;
  94078. } else {
  94079. return elementOrRange.ownerDocument.defaultView;
  94080. }
  94081. }
  94082. // Returns the closest parent of an element or DOM range.
  94083. //
  94084. // @private
  94085. // @param {HTMLElement|Range} firstRect
  94086. // @returns {HTMLelement}
  94087. function getParentElement( elementOrRange ) {
  94088. if ( Object(_isrange__WEBPACK_IMPORTED_MODULE_0__["default"])( elementOrRange ) ) {
  94089. let parent = elementOrRange.commonAncestorContainer;
  94090. // If a Range is attached to the Text, use the closest element ancestor.
  94091. if ( Object(_istext__WEBPACK_IMPORTED_MODULE_2__["default"])( parent ) ) {
  94092. parent = parent.parentNode;
  94093. }
  94094. return parent;
  94095. } else {
  94096. return elementOrRange.parentNode;
  94097. }
  94098. }
  94099. // Returns the rect of an element or range residing in an iframe.
  94100. // The result rect is relative to the geometry of the passed window instance.
  94101. //
  94102. // @private
  94103. // @param {HTMLElement|Range} target Element or range which rect should be returned.
  94104. // @param {Window} relativeWindow A window the rect should be relative to.
  94105. // @returns {module:utils/dom/rect~Rect}
  94106. function getRectRelativeToWindow( target, relativeWindow ) {
  94107. const targetWindow = getWindow( target );
  94108. const rect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( target );
  94109. if ( targetWindow === relativeWindow ) {
  94110. return rect;
  94111. } else {
  94112. let currentWindow = targetWindow;
  94113. while ( currentWindow != relativeWindow ) {
  94114. const frame = currentWindow.frameElement;
  94115. const frameRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( frame ).excludeScrollbarsAndBorders();
  94116. rect.moveBy( frameRect.left, frameRect.top );
  94117. currentWindow = currentWindow.parent;
  94118. }
  94119. }
  94120. return rect;
  94121. }
  94122. /***/ }),
  94123. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js":
  94124. /*!****************************************************************************!*\
  94125. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js ***!
  94126. \****************************************************************************/
  94127. /*! exports provided: default */
  94128. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94129. "use strict";
  94130. __webpack_require__.r(__webpack_exports__);
  94131. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setDataInElement; });
  94132. /**
  94133. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  94134. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  94135. */
  94136. /**
  94137. * @module utils/dom/setdatainelement
  94138. */
  94139. /* globals HTMLTextAreaElement */
  94140. /**
  94141. * Sets data in a given element.
  94142. *
  94143. * @param {HTMLElement} el The element in which the data will be set.
  94144. * @param {String} data The data string.
  94145. */
  94146. function setDataInElement( el, data ) {
  94147. if ( el instanceof HTMLTextAreaElement ) {
  94148. el.value = data;
  94149. }
  94150. el.innerHTML = data;
  94151. }
  94152. /***/ }),
  94153. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js":
  94154. /*!******************************************************************!*\
  94155. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js ***!
  94156. \******************************************************************/
  94157. /*! exports provided: default */
  94158. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94159. "use strict";
  94160. __webpack_require__.r(__webpack_exports__);
  94161. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return toUnit; });
  94162. /**
  94163. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  94164. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  94165. */
  94166. /**
  94167. * @module utils/dom/tounit
  94168. */
  94169. /**
  94170. * Returns a helper function, which adds a desired trailing
  94171. * `unit` to the passed value.
  94172. *
  94173. * @param {String} unit An unit like "px" or "em".
  94174. * @returns {module:utils/dom/tounit~helper}
  94175. */
  94176. function toUnit( unit ) {
  94177. /**
  94178. * A function, which adds a pre–defined trailing `unit`
  94179. * to the passed `value`.
  94180. *
  94181. * @function helper
  94182. * @param {*} value A value to be given the unit.
  94183. * @returns {String} A value with the trailing unit.
  94184. */
  94185. return value => value + unit;
  94186. }
  94187. /***/ }),
  94188. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/elementreplacer.js":
  94189. /*!***********************************************************************!*\
  94190. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/elementreplacer.js ***!
  94191. \***********************************************************************/
  94192. /*! exports provided: default */
  94193. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94194. "use strict";
  94195. __webpack_require__.r(__webpack_exports__);
  94196. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ElementReplacer; });
  94197. /**
  94198. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  94199. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  94200. */
  94201. /**
  94202. * @module utils/elementreplacer
  94203. */
  94204. /**
  94205. * Utility class allowing to hide existing HTML elements or replace them with given ones in a way that doesn't remove
  94206. * the original elements from the DOM.
  94207. */
  94208. class ElementReplacer {
  94209. constructor() {
  94210. /**
  94211. * The elements replaced by {@link #replace} and their replacements.
  94212. *
  94213. * @private
  94214. * @member {Array.<Object>}
  94215. */
  94216. this._replacedElements = [];
  94217. }
  94218. /**
  94219. * Hides the `element` and, if specified, inserts the the given element next to it.
  94220. *
  94221. * The effect of this method can be reverted by {@link #restore}.
  94222. *
  94223. * @param {HTMLElement} element The element to replace.
  94224. * @param {HTMLElement} [newElement] The replacement element. If not passed, then the `element` will just be hidden.
  94225. */
  94226. replace( element, newElement ) {
  94227. this._replacedElements.push( { element, newElement } );
  94228. element.style.display = 'none';
  94229. if ( newElement ) {
  94230. element.parentNode.insertBefore( newElement, element.nextSibling );
  94231. }
  94232. }
  94233. /**
  94234. * Restores what {@link #replace} did.
  94235. */
  94236. restore() {
  94237. this._replacedElements.forEach( ( { element, newElement } ) => {
  94238. element.style.display = '';
  94239. if ( newElement ) {
  94240. newElement.remove();
  94241. }
  94242. } );
  94243. this._replacedElements = [];
  94244. }
  94245. }
  94246. /***/ }),
  94247. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js":
  94248. /*!********************************************************************!*\
  94249. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js ***!
  94250. \********************************************************************/
  94251. /*! exports provided: default, _getEmitterListenedTo, _setEmitterId, _getEmitterId */
  94252. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94253. "use strict";
  94254. __webpack_require__.r(__webpack_exports__);
  94255. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_getEmitterListenedTo", function() { return _getEmitterListenedTo; });
  94256. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_setEmitterId", function() { return _setEmitterId; });
  94257. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_getEmitterId", function() { return _getEmitterId; });
  94258. /* harmony import */ var _eventinfo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eventinfo */ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js");
  94259. /* harmony import */ var _uid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  94260. /* harmony import */ var _priorities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./priorities */ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js");
  94261. /* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
  94262. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  94263. /**
  94264. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  94265. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  94266. */
  94267. /**
  94268. * @module utils/emittermixin
  94269. */
  94270. // To check if component is loaded more than once.
  94271. const _listeningTo = Symbol( 'listeningTo' );
  94272. const _emitterId = Symbol( 'emitterId' );
  94273. /**
  94274. * Mixin that injects the {@link ~Emitter events API} into its host.
  94275. *
  94276. * Read more about the concept of emitters in the:
  94277. * * {@glink framework/guides/architecture/core-editor-architecture#event-system-and-observables Event system and observables}
  94278. * section of the {@glink framework/guides/architecture/core-editor-architecture Core editor architecture} guide.
  94279. * * {@glink framework/guides/deep-dive/event-system Event system} deep dive guide.
  94280. *
  94281. * @mixin EmitterMixin
  94282. * @implements module:utils/emittermixin~Emitter
  94283. */
  94284. const EmitterMixin = {
  94285. /**
  94286. * @inheritDoc
  94287. */
  94288. on( event, callback, options = {} ) {
  94289. this.listenTo( this, event, callback, options );
  94290. },
  94291. /**
  94292. * @inheritDoc
  94293. */
  94294. once( event, callback, options ) {
  94295. let wasFired = false;
  94296. const onceCallback = function( event, ...args ) {
  94297. // Ensure the callback is called only once even if the callback itself leads to re-firing the event
  94298. // (which would call the callback again).
  94299. if ( !wasFired ) {
  94300. wasFired = true;
  94301. // Go off() at the first call.
  94302. event.off();
  94303. // Go with the original callback.
  94304. callback.call( this, event, ...args );
  94305. }
  94306. };
  94307. // Make a similar on() call, simply replacing the callback.
  94308. this.listenTo( this, event, onceCallback, options );
  94309. },
  94310. /**
  94311. * @inheritDoc
  94312. */
  94313. off( event, callback ) {
  94314. this.stopListening( this, event, callback );
  94315. },
  94316. /**
  94317. * @inheritDoc
  94318. */
  94319. listenTo( emitter, event, callback, options = {} ) {
  94320. let emitterInfo, eventCallbacks;
  94321. // _listeningTo contains a list of emitters that this object is listening to.
  94322. // This list has the following format:
  94323. //
  94324. // _listeningTo: {
  94325. // emitterId: {
  94326. // emitter: emitter,
  94327. // callbacks: {
  94328. // event1: [ callback1, callback2, ... ]
  94329. // ....
  94330. // }
  94331. // },
  94332. // ...
  94333. // }
  94334. if ( !this[ _listeningTo ] ) {
  94335. this[ _listeningTo ] = {};
  94336. }
  94337. const emitters = this[ _listeningTo ];
  94338. if ( !_getEmitterId( emitter ) ) {
  94339. _setEmitterId( emitter );
  94340. }
  94341. const emitterId = _getEmitterId( emitter );
  94342. if ( !( emitterInfo = emitters[ emitterId ] ) ) {
  94343. emitterInfo = emitters[ emitterId ] = {
  94344. emitter,
  94345. callbacks: {}
  94346. };
  94347. }
  94348. if ( !( eventCallbacks = emitterInfo.callbacks[ event ] ) ) {
  94349. eventCallbacks = emitterInfo.callbacks[ event ] = [];
  94350. }
  94351. eventCallbacks.push( callback );
  94352. // Finally register the callback to the event.
  94353. addEventListener( this, emitter, event, callback, options );
  94354. },
  94355. /**
  94356. * @inheritDoc
  94357. */
  94358. stopListening( emitter, event, callback ) {
  94359. const emitters = this[ _listeningTo ];
  94360. let emitterId = emitter && _getEmitterId( emitter );
  94361. const emitterInfo = emitters && emitterId && emitters[ emitterId ];
  94362. const eventCallbacks = emitterInfo && event && emitterInfo.callbacks[ event ];
  94363. // Stop if nothing has been listened.
  94364. if ( !emitters || ( emitter && !emitterInfo ) || ( event && !eventCallbacks ) ) {
  94365. return;
  94366. }
  94367. // All params provided. off() that single callback.
  94368. if ( callback ) {
  94369. removeEventListener( this, emitter, event, callback );
  94370. // We must remove callbacks as well in order to prevent memory leaks.
  94371. // See https://github.com/ckeditor/ckeditor5/pull/8480
  94372. const index = eventCallbacks.indexOf( callback );
  94373. if ( index !== -1 ) {
  94374. if ( eventCallbacks.length === 1 ) {
  94375. delete emitterInfo.callbacks[ event ];
  94376. } else {
  94377. removeEventListener( this, emitter, event, callback );
  94378. }
  94379. }
  94380. }
  94381. // Only `emitter` and `event` provided. off() all callbacks for that event.
  94382. else if ( eventCallbacks ) {
  94383. while ( ( callback = eventCallbacks.pop() ) ) {
  94384. removeEventListener( this, emitter, event, callback );
  94385. }
  94386. delete emitterInfo.callbacks[ event ];
  94387. }
  94388. // Only `emitter` provided. off() all events for that emitter.
  94389. else if ( emitterInfo ) {
  94390. for ( event in emitterInfo.callbacks ) {
  94391. this.stopListening( emitter, event );
  94392. }
  94393. delete emitters[ emitterId ];
  94394. }
  94395. // No params provided. off() all emitters.
  94396. else {
  94397. for ( emitterId in emitters ) {
  94398. this.stopListening( emitters[ emitterId ].emitter );
  94399. }
  94400. delete this[ _listeningTo ];
  94401. }
  94402. },
  94403. /**
  94404. * @inheritDoc
  94405. */
  94406. fire( eventOrInfo, ...args ) {
  94407. try {
  94408. const eventInfo = eventOrInfo instanceof _eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"] ? eventOrInfo : new _eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"]( this, eventOrInfo );
  94409. const event = eventInfo.name;
  94410. let callbacks = getCallbacksForEvent( this, event );
  94411. // Record that the event passed this emitter on its path.
  94412. eventInfo.path.push( this );
  94413. // Handle event listener callbacks first.
  94414. if ( callbacks ) {
  94415. // Arguments passed to each callback.
  94416. const callbackArgs = [ eventInfo, ...args ];
  94417. // Copying callbacks array is the easiest and most secure way of preventing infinite loops, when event callbacks
  94418. // are added while processing other callbacks. Previous solution involved adding counters (unique ids) but
  94419. // failed if callbacks were added to the queue before currently processed callback.
  94420. // If this proves to be too inefficient, another method is to change `.on()` so callbacks are stored if same
  94421. // event is currently processed. Then, `.fire()` at the end, would have to add all stored events.
  94422. callbacks = Array.from( callbacks );
  94423. for ( let i = 0; i < callbacks.length; i++ ) {
  94424. callbacks[ i ].callback.apply( this, callbackArgs );
  94425. // Remove the callback from future requests if off() has been called.
  94426. if ( eventInfo.off.called ) {
  94427. // Remove the called mark for the next calls.
  94428. delete eventInfo.off.called;
  94429. this._removeEventListener( event, callbacks[ i ].callback );
  94430. }
  94431. // Do not execute next callbacks if stop() was called.
  94432. if ( eventInfo.stop.called ) {
  94433. break;
  94434. }
  94435. }
  94436. }
  94437. // Delegate event to other emitters if needed.
  94438. if ( this._delegations ) {
  94439. const destinations = this._delegations.get( event );
  94440. const passAllDestinations = this._delegations.get( '*' );
  94441. if ( destinations ) {
  94442. fireDelegatedEvents( destinations, eventInfo, args );
  94443. }
  94444. if ( passAllDestinations ) {
  94445. fireDelegatedEvents( passAllDestinations, eventInfo, args );
  94446. }
  94447. }
  94448. return eventInfo.return;
  94449. } catch ( err ) {
  94450. // @if CK_DEBUG // throw err;
  94451. /* istanbul ignore next */
  94452. _ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"].rethrowUnexpectedError( err, this );
  94453. }
  94454. },
  94455. /**
  94456. * @inheritDoc
  94457. */
  94458. delegate( ...events ) {
  94459. return {
  94460. to: ( emitter, nameOrFunction ) => {
  94461. if ( !this._delegations ) {
  94462. this._delegations = new Map();
  94463. }
  94464. // Originally there was a for..of loop which unfortunately caused an error in Babel that didn't allow
  94465. // build an application. See: https://github.com/ckeditor/ckeditor5-react/issues/40.
  94466. events.forEach( eventName => {
  94467. const destinations = this._delegations.get( eventName );
  94468. if ( !destinations ) {
  94469. this._delegations.set( eventName, new Map( [ [ emitter, nameOrFunction ] ] ) );
  94470. } else {
  94471. destinations.set( emitter, nameOrFunction );
  94472. }
  94473. } );
  94474. }
  94475. };
  94476. },
  94477. /**
  94478. * @inheritDoc
  94479. */
  94480. stopDelegating( event, emitter ) {
  94481. if ( !this._delegations ) {
  94482. return;
  94483. }
  94484. if ( !event ) {
  94485. this._delegations.clear();
  94486. } else if ( !emitter ) {
  94487. this._delegations.delete( event );
  94488. } else {
  94489. const destinations = this._delegations.get( event );
  94490. if ( destinations ) {
  94491. destinations.delete( emitter );
  94492. }
  94493. }
  94494. },
  94495. /**
  94496. * @inheritDoc
  94497. */
  94498. _addEventListener( event, callback, options ) {
  94499. createEventNamespace( this, event );
  94500. const lists = getCallbacksListsForNamespace( this, event );
  94501. const priority = _priorities__WEBPACK_IMPORTED_MODULE_2__["default"].get( options.priority );
  94502. const callbackDefinition = {
  94503. callback,
  94504. priority
  94505. };
  94506. // Add the callback to all callbacks list.
  94507. for ( const callbacks of lists ) {
  94508. // Add the callback to the list in the right priority position.
  94509. let added = false;
  94510. for ( let i = 0; i < callbacks.length; i++ ) {
  94511. if ( callbacks[ i ].priority < priority ) {
  94512. callbacks.splice( i, 0, callbackDefinition );
  94513. added = true;
  94514. break;
  94515. }
  94516. }
  94517. // Add at the end, if right place was not found.
  94518. if ( !added ) {
  94519. callbacks.push( callbackDefinition );
  94520. }
  94521. }
  94522. },
  94523. /**
  94524. * @inheritDoc
  94525. */
  94526. _removeEventListener( event, callback ) {
  94527. const lists = getCallbacksListsForNamespace( this, event );
  94528. for ( const callbacks of lists ) {
  94529. for ( let i = 0; i < callbacks.length; i++ ) {
  94530. if ( callbacks[ i ].callback == callback ) {
  94531. // Remove the callback from the list (fixing the next index).
  94532. callbacks.splice( i, 1 );
  94533. i--;
  94534. }
  94535. }
  94536. }
  94537. }
  94538. };
  94539. /* harmony default export */ __webpack_exports__["default"] = (EmitterMixin);
  94540. /**
  94541. * Emitter/listener interface.
  94542. *
  94543. * Can be easily implemented by a class by mixing the {@link module:utils/emittermixin~EmitterMixin} mixin.
  94544. *
  94545. * Read more about the usage of this interface in the:
  94546. * * {@glink framework/guides/architecture/core-editor-architecture#event-system-and-observables Event system and observables}
  94547. * section of the {@glink framework/guides/architecture/core-editor-architecture Core editor architecture} guide.
  94548. * * {@glink framework/guides/deep-dive/event-system Event system} deep dive guide.
  94549. *
  94550. * @interface Emitter
  94551. */
  94552. /**
  94553. * Registers a callback function to be executed when an event is fired.
  94554. *
  94555. * Shorthand for {@link #listenTo `this.listenTo( this, event, callback, options )`} (it makes the emitter
  94556. * listen on itself).
  94557. *
  94558. * @method #on
  94559. * @param {String} event The name of the event.
  94560. * @param {Function} callback The function to be called on event.
  94561. * @param {Object} [options={}] Additional options.
  94562. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  94563. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  94564. * order they were added.
  94565. */
  94566. /**
  94567. * Registers a callback function to be executed on the next time the event is fired only. This is similar to
  94568. * calling {@link #on} followed by {@link #off} in the callback.
  94569. *
  94570. * @method #once
  94571. * @param {String} event The name of the event.
  94572. * @param {Function} callback The function to be called on event.
  94573. * @param {Object} [options={}] Additional options.
  94574. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  94575. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  94576. * order they were added.
  94577. */
  94578. /**
  94579. * Stops executing the callback on the given event.
  94580. * Shorthand for {@link #stopListening `this.stopListening( this, event, callback )`}.
  94581. *
  94582. * @method #off
  94583. * @param {String} event The name of the event.
  94584. * @param {Function} callback The function to stop being called.
  94585. */
  94586. /**
  94587. * Registers a callback function to be executed when an event is fired in a specific (emitter) object.
  94588. *
  94589. * Events can be grouped in namespaces using `:`.
  94590. * When namespaced event is fired, it additionally fires all callbacks for that namespace.
  94591. *
  94592. * // myEmitter.on( ... ) is a shorthand for myEmitter.listenTo( myEmitter, ... ).
  94593. * myEmitter.on( 'myGroup', genericCallback );
  94594. * myEmitter.on( 'myGroup:myEvent', specificCallback );
  94595. *
  94596. * // genericCallback is fired.
  94597. * myEmitter.fire( 'myGroup' );
  94598. * // both genericCallback and specificCallback are fired.
  94599. * myEmitter.fire( 'myGroup:myEvent' );
  94600. * // genericCallback is fired even though there are no callbacks for "foo".
  94601. * myEmitter.fire( 'myGroup:foo' );
  94602. *
  94603. * An event callback can {@link module:utils/eventinfo~EventInfo#stop stop the event} and
  94604. * set the {@link module:utils/eventinfo~EventInfo#return return value} of the {@link #fire} method.
  94605. *
  94606. * @method #listenTo
  94607. * @param {module:utils/emittermixin~Emitter} emitter The object that fires the event.
  94608. * @param {String} event The name of the event.
  94609. * @param {Function} callback The function to be called on event.
  94610. * @param {Object} [options={}] Additional options.
  94611. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  94612. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  94613. * order they were added.
  94614. */
  94615. /**
  94616. * Stops listening for events. It can be used at different levels:
  94617. *
  94618. * * To stop listening to a specific callback.
  94619. * * To stop listening to a specific event.
  94620. * * To stop listening to all events fired by a specific object.
  94621. * * To stop listening to all events fired by all objects.
  94622. *
  94623. * @method #stopListening
  94624. * @param {module:utils/emittermixin~Emitter} [emitter] The object to stop listening to. If omitted, stops it for all objects.
  94625. * @param {String} [event] (Requires the `emitter`) The name of the event to stop listening to. If omitted, stops it
  94626. * for all events from `emitter`.
  94627. * @param {Function} [callback] (Requires the `event`) The function to be removed from the call list for the given
  94628. * `event`.
  94629. */
  94630. /**
  94631. * Fires an event, executing all callbacks registered for it.
  94632. *
  94633. * The first parameter passed to callbacks is an {@link module:utils/eventinfo~EventInfo} object,
  94634. * followed by the optional `args` provided in the `fire()` method call.
  94635. *
  94636. * @method #fire
  94637. * @param {String|module:utils/eventinfo~EventInfo} eventOrInfo The name of the event or `EventInfo` object if event is delegated.
  94638. * @param {...*} [args] Additional arguments to be passed to the callbacks.
  94639. * @returns {*} By default the method returns `undefined`. However, the return value can be changed by listeners
  94640. * through modification of the {@link module:utils/eventinfo~EventInfo#return `evt.return`}'s property (the event info
  94641. * is the first param of every callback).
  94642. */
  94643. /**
  94644. * Delegates selected events to another {@link module:utils/emittermixin~Emitter}. For instance:
  94645. *
  94646. * emitterA.delegate( 'eventX' ).to( emitterB );
  94647. * emitterA.delegate( 'eventX', 'eventY' ).to( emitterC );
  94648. *
  94649. * then `eventX` is delegated (fired by) `emitterB` and `emitterC` along with `data`:
  94650. *
  94651. * emitterA.fire( 'eventX', data );
  94652. *
  94653. * and `eventY` is delegated (fired by) `emitterC` along with `data`:
  94654. *
  94655. * emitterA.fire( 'eventY', data );
  94656. *
  94657. * @method #delegate
  94658. * @param {...String} events Event names that will be delegated to another emitter.
  94659. * @returns {module:utils/emittermixin~EmitterMixinDelegateChain}
  94660. */
  94661. /**
  94662. * Stops delegating events. It can be used at different levels:
  94663. *
  94664. * * To stop delegating all events.
  94665. * * To stop delegating a specific event to all emitters.
  94666. * * To stop delegating a specific event to a specific emitter.
  94667. *
  94668. * @method #stopDelegating
  94669. * @param {String} [event] The name of the event to stop delegating. If omitted, stops it all delegations.
  94670. * @param {module:utils/emittermixin~Emitter} [emitter] (requires `event`) The object to stop delegating a particular event to.
  94671. * If omitted, stops delegation of `event` to all emitters.
  94672. */
  94673. /**
  94674. * Adds callback to emitter for given event.
  94675. *
  94676. * @protected
  94677. * @method #_addEventListener
  94678. * @param {String} event The name of the event.
  94679. * @param {Function} callback The function to be called on event.
  94680. * @param {Object} [options={}] Additional options.
  94681. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  94682. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  94683. * order they were added.
  94684. */
  94685. /**
  94686. * Removes callback from emitter for given event.
  94687. *
  94688. * @protected
  94689. * @method #_removeEventListener
  94690. * @param {String} event The name of the event.
  94691. * @param {Function} callback The function to stop being called.
  94692. */
  94693. /**
  94694. * Checks if `listeningEmitter` listens to an emitter with given `listenedToEmitterId` and if so, returns that emitter.
  94695. * If not, returns `null`.
  94696. *
  94697. * @protected
  94698. * @param {module:utils/emittermixin~Emitter} listeningEmitter An emitter that listens.
  94699. * @param {String} listenedToEmitterId Unique emitter id of emitter listened to.
  94700. * @returns {module:utils/emittermixin~Emitter|null}
  94701. */
  94702. function _getEmitterListenedTo( listeningEmitter, listenedToEmitterId ) {
  94703. if ( listeningEmitter[ _listeningTo ] && listeningEmitter[ _listeningTo ][ listenedToEmitterId ] ) {
  94704. return listeningEmitter[ _listeningTo ][ listenedToEmitterId ].emitter;
  94705. }
  94706. return null;
  94707. }
  94708. /**
  94709. * Sets emitter's unique id.
  94710. *
  94711. * **Note:** `_emitterId` can be set only once.
  94712. *
  94713. * @protected
  94714. * @param {module:utils/emittermixin~Emitter} emitter An emitter for which id will be set.
  94715. * @param {String} [id] Unique id to set. If not passed, random unique id will be set.
  94716. */
  94717. function _setEmitterId( emitter, id ) {
  94718. if ( !emitter[ _emitterId ] ) {
  94719. emitter[ _emitterId ] = id || Object(_uid__WEBPACK_IMPORTED_MODULE_1__["default"])();
  94720. }
  94721. }
  94722. /**
  94723. * Returns emitter's unique id.
  94724. *
  94725. * @protected
  94726. * @param {module:utils/emittermixin~Emitter} emitter An emitter which id will be returned.
  94727. */
  94728. function _getEmitterId( emitter ) {
  94729. return emitter[ _emitterId ];
  94730. }
  94731. // Gets the internal `_events` property of the given object.
  94732. // `_events` property store all lists with callbacks for registered event names.
  94733. // If there were no events registered on the object, empty `_events` object is created.
  94734. function getEvents( source ) {
  94735. if ( !source._events ) {
  94736. Object.defineProperty( source, '_events', {
  94737. value: {}
  94738. } );
  94739. }
  94740. return source._events;
  94741. }
  94742. // Creates event node for generic-specific events relation architecture.
  94743. function makeEventNode() {
  94744. return {
  94745. callbacks: [],
  94746. childEvents: []
  94747. };
  94748. }
  94749. // Creates an architecture for generic-specific events relation.
  94750. // If needed, creates all events for given eventName, i.e. if the first registered event
  94751. // is foo:bar:abc, it will create foo:bar:abc, foo:bar and foo event and tie them together.
  94752. // It also copies callbacks from more generic events to more specific events when
  94753. // specific events are created.
  94754. function createEventNamespace( source, eventName ) {
  94755. const events = getEvents( source );
  94756. // First, check if the event we want to add to the structure already exists.
  94757. if ( events[ eventName ] ) {
  94758. // If it exists, we don't have to do anything.
  94759. return;
  94760. }
  94761. // In other case, we have to create the structure for the event.
  94762. // Note, that we might need to create intermediate events too.
  94763. // I.e. if foo:bar:abc is being registered and we only have foo in the structure,
  94764. // we need to also register foo:bar.
  94765. // Currently processed event name.
  94766. let name = eventName;
  94767. // Name of the event that is a child event for currently processed event.
  94768. let childEventName = null;
  94769. // Array containing all newly created specific events.
  94770. const newEventNodes = [];
  94771. // While loop can't check for ':' index because we have to handle generic events too.
  94772. // In each loop, we truncate event name, going from the most specific name to the generic one.
  94773. // I.e. foo:bar:abc -> foo:bar -> foo.
  94774. while ( name !== '' ) {
  94775. if ( events[ name ] ) {
  94776. // If the currently processed event name is already registered, we can be sure
  94777. // that it already has all the structure created, so we can break the loop here
  94778. // as no more events need to be registered.
  94779. break;
  94780. }
  94781. // If this event is not yet registered, create a new object for it.
  94782. events[ name ] = makeEventNode();
  94783. // Add it to the array with newly created events.
  94784. newEventNodes.push( events[ name ] );
  94785. // Add previously processed event name as a child of this event.
  94786. if ( childEventName ) {
  94787. events[ name ].childEvents.push( childEventName );
  94788. }
  94789. childEventName = name;
  94790. // If `.lastIndexOf()` returns -1, `.substr()` will return '' which will break the loop.
  94791. name = name.substr( 0, name.lastIndexOf( ':' ) );
  94792. }
  94793. if ( name !== '' ) {
  94794. // If name is not empty, we found an already registered event that was a parent of the
  94795. // event we wanted to register.
  94796. // Copy that event's callbacks to newly registered events.
  94797. for ( const node of newEventNodes ) {
  94798. node.callbacks = events[ name ].callbacks.slice();
  94799. }
  94800. // Add last newly created event to the already registered event.
  94801. events[ name ].childEvents.push( childEventName );
  94802. }
  94803. }
  94804. // Gets an array containing callbacks list for a given event and it's more specific events.
  94805. // I.e. if given event is foo:bar and there is also foo:bar:abc event registered, this will
  94806. // return callback list of foo:bar and foo:bar:abc (but not foo).
  94807. function getCallbacksListsForNamespace( source, eventName ) {
  94808. const eventNode = getEvents( source )[ eventName ];
  94809. if ( !eventNode ) {
  94810. return [];
  94811. }
  94812. let callbacksLists = [ eventNode.callbacks ];
  94813. for ( let i = 0; i < eventNode.childEvents.length; i++ ) {
  94814. const childCallbacksLists = getCallbacksListsForNamespace( source, eventNode.childEvents[ i ] );
  94815. callbacksLists = callbacksLists.concat( childCallbacksLists );
  94816. }
  94817. return callbacksLists;
  94818. }
  94819. // Get the list of callbacks for a given event, but only if there any callbacks have been registered.
  94820. // If there are no callbacks registered for given event, it checks if this is a specific event and looks
  94821. // for callbacks for it's more generic version.
  94822. function getCallbacksForEvent( source, eventName ) {
  94823. let event;
  94824. if ( !source._events || !( event = source._events[ eventName ] ) || !event.callbacks.length ) {
  94825. // There are no callbacks registered for specified eventName.
  94826. // But this could be a specific-type event that is in a namespace.
  94827. if ( eventName.indexOf( ':' ) > -1 ) {
  94828. // If the eventName is specific, try to find callback lists for more generic event.
  94829. return getCallbacksForEvent( source, eventName.substr( 0, eventName.lastIndexOf( ':' ) ) );
  94830. } else {
  94831. // If this is a top-level generic event, return null;
  94832. return null;
  94833. }
  94834. }
  94835. return event.callbacks;
  94836. }
  94837. // Fires delegated events for given map of destinations.
  94838. //
  94839. // @private
  94840. // * @param {Map.<utils.Emitter>} destinations A map containing
  94841. // `[ {@link module:utils/emittermixin~Emitter}, "event name" ]` pair destinations.
  94842. // * @param {utils.EventInfo} eventInfo The original event info object.
  94843. // * @param {Array.<*>} fireArgs Arguments the original event was fired with.
  94844. function fireDelegatedEvents( destinations, eventInfo, fireArgs ) {
  94845. for ( let [ emitter, name ] of destinations ) {
  94846. if ( !name ) {
  94847. name = eventInfo.name;
  94848. } else if ( typeof name == 'function' ) {
  94849. name = name( eventInfo.name );
  94850. }
  94851. const delegatedInfo = new _eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"]( eventInfo.source, name );
  94852. delegatedInfo.path = [ ...eventInfo.path ];
  94853. emitter.fire( delegatedInfo, ...fireArgs );
  94854. }
  94855. }
  94856. // Helper for registering event callback on the emitter.
  94857. function addEventListener( listener, emitter, event, callback, options ) {
  94858. if ( emitter._addEventListener ) {
  94859. emitter._addEventListener( event, callback, options );
  94860. } else {
  94861. // Allow listening on objects that do not implement Emitter interface.
  94862. // This is needed in some tests that are using mocks instead of the real objects with EmitterMixin mixed.
  94863. listener._addEventListener.call( emitter, event, callback, options );
  94864. }
  94865. }
  94866. // Helper for removing event callback from the emitter.
  94867. function removeEventListener( listener, emitter, event, callback ) {
  94868. if ( emitter._removeEventListener ) {
  94869. emitter._removeEventListener( event, callback );
  94870. } else {
  94871. // Allow listening on objects that do not implement Emitter interface.
  94872. // This is needed in some tests that are using mocks instead of the real objects with EmitterMixin mixed.
  94873. listener._removeEventListener.call( emitter, event, callback );
  94874. }
  94875. }
  94876. /**
  94877. * The return value of {@link ~EmitterMixin#delegate}.
  94878. *
  94879. * @interface module:utils/emittermixin~EmitterMixinDelegateChain
  94880. */
  94881. /**
  94882. * Selects destination for {@link module:utils/emittermixin~EmitterMixin#delegate} events.
  94883. *
  94884. * @method #to
  94885. * @param {module:utils/emittermixin~Emitter} emitter An `EmitterMixin` instance which is the destination for delegated events.
  94886. * @param {String|Function} [nameOrFunction] A custom event name or function which converts the original name string.
  94887. */
  94888. /***/ }),
  94889. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js":
  94890. /*!***********************************************************!*\
  94891. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/env.js ***!
  94892. \***********************************************************/
  94893. /*! exports provided: default, isMac, isWindows, isGecko, isSafari, isiOS, isAndroid, isBlink, isRegExpUnicodePropertySupported */
  94894. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94895. "use strict";
  94896. __webpack_require__.r(__webpack_exports__);
  94897. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMac", function() { return isMac; });
  94898. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWindows", function() { return isWindows; });
  94899. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isGecko", function() { return isGecko; });
  94900. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSafari", function() { return isSafari; });
  94901. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isiOS", function() { return isiOS; });
  94902. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAndroid", function() { return isAndroid; });
  94903. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBlink", function() { return isBlink; });
  94904. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRegExpUnicodePropertySupported", function() { return isRegExpUnicodePropertySupported; });
  94905. /**
  94906. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  94907. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  94908. */
  94909. /* globals navigator:false */
  94910. /**
  94911. * @module utils/env
  94912. */
  94913. const userAgent = navigator.userAgent.toLowerCase();
  94914. /**
  94915. * A namespace containing environment and browser information.
  94916. *
  94917. * @namespace
  94918. */
  94919. const env = {
  94920. /**
  94921. * Indicates that the application is running on Macintosh.
  94922. *
  94923. * @static
  94924. * @type {Boolean}
  94925. */
  94926. isMac: isMac( userAgent ),
  94927. /**
  94928. * Indicates that the application is running on Windows.
  94929. *
  94930. * @static
  94931. * @type {Boolean}
  94932. */
  94933. isWindows: isWindows( userAgent ),
  94934. /**
  94935. * Indicates that the application is running in Firefox (Gecko).
  94936. *
  94937. * @static
  94938. * @type {Boolean}
  94939. */
  94940. isGecko: isGecko( userAgent ),
  94941. /**
  94942. * Indicates that the application is running in Safari.
  94943. *
  94944. * @static
  94945. * @type {Boolean}
  94946. */
  94947. isSafari: isSafari( userAgent ),
  94948. /**
  94949. * Indicates the the application is running in iOS.
  94950. *
  94951. * @static
  94952. * @type {Boolean}
  94953. */
  94954. isiOS: isiOS( userAgent ),
  94955. /**
  94956. * Indicates that the application is running on Android mobile device.
  94957. *
  94958. * @static
  94959. * @type {Boolean}
  94960. */
  94961. isAndroid: isAndroid( userAgent ),
  94962. /**
  94963. * Indicates that the application is running in a browser using the Blink engine.
  94964. *
  94965. * @static
  94966. * @type {Boolean}
  94967. */
  94968. isBlink: isBlink( userAgent ),
  94969. /**
  94970. * Environment features information.
  94971. *
  94972. * @memberOf module:utils/env~env
  94973. * @namespace
  94974. */
  94975. features: {
  94976. /**
  94977. * Indicates that the environment supports ES2018 Unicode property escapes — like `\p{P}` or `\p{L}`.
  94978. * More information about unicode properties might be found
  94979. * [in Unicode Standard Annex #44](https://www.unicode.org/reports/tr44/#GC_Values_Table).
  94980. *
  94981. * @type {Boolean}
  94982. */
  94983. isRegExpUnicodePropertySupported: isRegExpUnicodePropertySupported()
  94984. }
  94985. };
  94986. /* harmony default export */ __webpack_exports__["default"] = (env);
  94987. /**
  94988. * Checks if User Agent represented by the string is running on Macintosh.
  94989. *
  94990. * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
  94991. * @returns {Boolean} Whether User Agent is running on Macintosh or not.
  94992. */
  94993. function isMac( userAgent ) {
  94994. return userAgent.indexOf( 'macintosh' ) > -1;
  94995. }
  94996. /**
  94997. * Checks if User Agent represented by the string is running on Windows.
  94998. *
  94999. * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
  95000. * @returns {Boolean} Whether User Agent is running on Windows or not.
  95001. */
  95002. function isWindows( userAgent ) {
  95003. return userAgent.indexOf( 'windows' ) > -1;
  95004. }
  95005. /**
  95006. * Checks if User Agent represented by the string is Firefox (Gecko).
  95007. *
  95008. * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
  95009. * @returns {Boolean} Whether User Agent is Firefox or not.
  95010. */
  95011. function isGecko( userAgent ) {
  95012. return !!userAgent.match( /gecko\/\d+/ );
  95013. }
  95014. /**
  95015. * Checks if User Agent represented by the string is Safari.
  95016. *
  95017. * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
  95018. * @returns {Boolean} Whether User Agent is Safari or not.
  95019. */
  95020. function isSafari( userAgent ) {
  95021. return userAgent.indexOf( ' applewebkit/' ) > -1 && userAgent.indexOf( 'chrome' ) === -1;
  95022. }
  95023. /**
  95024. * Checks if User Agent represented by the string is running in iOS.
  95025. *
  95026. * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
  95027. * @returns {Boolean} Whether User Agent is running in iOS or not.
  95028. */
  95029. function isiOS( userAgent ) {
  95030. // "Request mobile site" || "Request desktop site".
  95031. return !!userAgent.match( /iphone|ipad/i ) || ( isMac( userAgent ) && navigator.maxTouchPoints > 0 );
  95032. }
  95033. /**
  95034. * Checks if User Agent represented by the string is Android mobile device.
  95035. *
  95036. * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
  95037. * @returns {Boolean} Whether User Agent is Safari or not.
  95038. */
  95039. function isAndroid( userAgent ) {
  95040. return userAgent.indexOf( 'android' ) > -1;
  95041. }
  95042. /**
  95043. * Checks if User Agent represented by the string is Blink engine.
  95044. *
  95045. * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
  95046. * @returns {Boolean} Whether User Agent is Blink engine or not.
  95047. */
  95048. function isBlink( userAgent ) {
  95049. // The Edge browser before switching to the Blink engine used to report itself as Chrome (and "Edge/")
  95050. // but after switching to the Blink it replaced "Edge/" with "Edg/".
  95051. return userAgent.indexOf( 'chrome/' ) > -1 && userAgent.indexOf( 'edge/' ) < 0;
  95052. }
  95053. /**
  95054. * Checks if the current environment supports ES2018 Unicode properties like `\p{P}` or `\p{L}`.
  95055. * More information about unicode properties might be found
  95056. * [in Unicode Standard Annex #44](https://www.unicode.org/reports/tr44/#GC_Values_Table).
  95057. *
  95058. * @returns {Boolean}
  95059. */
  95060. function isRegExpUnicodePropertySupported() {
  95061. let isSupported = false;
  95062. // Feature detection for Unicode properties. Added in ES2018. Currently Firefox does not support it.
  95063. // See https://github.com/ckeditor/ckeditor5-mention/issues/44#issuecomment-487002174.
  95064. try {
  95065. // Usage of regular expression literal cause error during build (ckeditor/ckeditor5-dev#534).
  95066. isSupported = 'ć'.search( new RegExp( '[\\p{L}]', 'u' ) ) === 0;
  95067. } catch ( error ) {
  95068. // Firefox throws a SyntaxError when the group is unsupported.
  95069. }
  95070. return isSupported;
  95071. }
  95072. /***/ }),
  95073. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js":
  95074. /*!*****************************************************************!*\
  95075. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js ***!
  95076. \*****************************************************************/
  95077. /*! exports provided: default */
  95078. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95079. "use strict";
  95080. __webpack_require__.r(__webpack_exports__);
  95081. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EventInfo; });
  95082. /* harmony import */ var _spy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./spy */ "./node_modules/@ckeditor/ckeditor5-utils/src/spy.js");
  95083. /**
  95084. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  95085. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  95086. */
  95087. /**
  95088. * @module utils/eventinfo
  95089. */
  95090. /**
  95091. * The event object passed to event callbacks. It is used to provide information about the event as well as a tool to
  95092. * manipulate it.
  95093. */
  95094. class EventInfo {
  95095. /**
  95096. * @param {Object} source The emitter.
  95097. * @param {String} name The event name.
  95098. */
  95099. constructor( source, name ) {
  95100. /**
  95101. * The object that fired the event.
  95102. *
  95103. * @readonly
  95104. * @member {Object}
  95105. */
  95106. this.source = source;
  95107. /**
  95108. * The event name.
  95109. *
  95110. * @readonly
  95111. * @member {String}
  95112. */
  95113. this.name = name;
  95114. /**
  95115. * Path this event has followed. See {@link module:utils/emittermixin~EmitterMixin#delegate}.
  95116. *
  95117. * @readonly
  95118. * @member {Array.<Object>}
  95119. */
  95120. this.path = [];
  95121. // The following methods are defined in the constructor because they must be re-created per instance.
  95122. /**
  95123. * Stops the event emitter to call further callbacks for this event interaction.
  95124. *
  95125. * @method #stop
  95126. */
  95127. this.stop = Object(_spy__WEBPACK_IMPORTED_MODULE_0__["default"])();
  95128. /**
  95129. * Removes the current callback from future interactions of this event.
  95130. *
  95131. * @method #off
  95132. */
  95133. this.off = Object(_spy__WEBPACK_IMPORTED_MODULE_0__["default"])();
  95134. /**
  95135. * The value which will be returned by {@link module:utils/emittermixin~EmitterMixin#fire}.
  95136. *
  95137. * It's `undefined` by default and can be changed by an event listener:
  95138. *
  95139. * dataController.fire( 'getSelectedContent', ( evt ) => {
  95140. * // This listener will make `dataController.fire( 'getSelectedContent' )`
  95141. * // always return an empty DocumentFragment.
  95142. * evt.return = new DocumentFragment();
  95143. *
  95144. * // Make sure no other listeners are executed.
  95145. * evt.stop();
  95146. * } );
  95147. *
  95148. * @member #return
  95149. */
  95150. }
  95151. }
  95152. /***/ }),
  95153. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js":
  95154. /*!****************************************************************!*\
  95155. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js ***!
  95156. \****************************************************************/
  95157. /*! exports provided: default */
  95158. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95159. "use strict";
  95160. __webpack_require__.r(__webpack_exports__);
  95161. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return fastDiff; });
  95162. /**
  95163. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  95164. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  95165. */
  95166. /**
  95167. * @module utils/fastdiff
  95168. */
  95169. /**
  95170. * Finds positions of the first and last change in the given string/array and generates a set of changes:
  95171. *
  95172. * fastDiff( '12a', '12xyza' );
  95173. * // [ { index: 2, type: 'insert', values: [ 'x', 'y', 'z' ] } ]
  95174. *
  95175. * fastDiff( '12a', '12aa' );
  95176. * // [ { index: 3, type: 'insert', values: [ 'a' ] } ]
  95177. *
  95178. * fastDiff( '12xyza', '12a' );
  95179. * // [ { index: 2, type: 'delete', howMany: 3 } ]
  95180. *
  95181. * fastDiff( [ '1', '2', 'a', 'a' ], [ '1', '2', 'a' ] );
  95182. * // [ { index: 3, type: 'delete', howMany: 1 } ]
  95183. *
  95184. * fastDiff( [ '1', '2', 'a', 'b', 'c', '3' ], [ '2', 'a', 'b' ] );
  95185. * // [ { index: 0, type: 'insert', values: [ '2', 'a', 'b' ] }, { index: 3, type: 'delete', howMany: 6 } ]
  95186. *
  95187. * Passed arrays can contain any type of data, however to compare them correctly custom comparator function
  95188. * should be passed as a third parameter:
  95189. *
  95190. * fastDiff( [ { value: 1 }, { value: 2 } ], [ { value: 1 }, { value: 3 } ], ( a, b ) => {
  95191. * return a.value === b.value;
  95192. * } );
  95193. * // [ { index: 1, type: 'insert', values: [ { value: 3 } ] }, { index: 2, type: 'delete', howMany: 1 } ]
  95194. *
  95195. * The resulted set of changes can be applied to the input in order to transform it into the output, for example:
  95196. *
  95197. * let input = '12abc3';
  95198. * const output = '2ab';
  95199. * const changes = fastDiff( input, output );
  95200. *
  95201. * changes.forEach( change => {
  95202. * if ( change.type == 'insert' ) {
  95203. * input = input.substring( 0, change.index ) + change.values.join( '' ) + input.substring( change.index );
  95204. * } else if ( change.type == 'delete' ) {
  95205. * input = input.substring( 0, change.index ) + input.substring( change.index + change.howMany );
  95206. * }
  95207. * } );
  95208. *
  95209. * // input equals output now
  95210. *
  95211. * or in case of arrays:
  95212. *
  95213. * let input = [ '1', '2', 'a', 'b', 'c', '3' ];
  95214. * const output = [ '2', 'a', 'b' ];
  95215. * const changes = fastDiff( input, output );
  95216. *
  95217. * changes.forEach( change => {
  95218. * if ( change.type == 'insert' ) {
  95219. * input = input.slice( 0, change.index ).concat( change.values, input.slice( change.index ) );
  95220. * } else if ( change.type == 'delete' ) {
  95221. * input = input.slice( 0, change.index ).concat( input.slice( change.index + change.howMany ) );
  95222. * }
  95223. * } );
  95224. *
  95225. * // input equals output now
  95226. *
  95227. * By passing `true` as the fourth parameter (`atomicChanges`) the output of this function will become compatible with
  95228. * the {@link module:utils/diff~diff `diff()`} function:
  95229. *
  95230. * fastDiff( '12a', '12xyza' );
  95231. * // [ 'equal', 'equal', 'insert', 'insert', 'insert', 'equal' ]
  95232. *
  95233. * The default output format of this function is compatible with the output format of
  95234. * {@link module:utils/difftochanges~diffToChanges `diffToChanges()`}. The `diffToChanges()` input format is, in turn,
  95235. * compatible with the output of {@link module:utils/diff~diff `diff()`}:
  95236. *
  95237. * const a = '1234';
  95238. * const b = '12xyz34';
  95239. *
  95240. * // Both calls will return the same results (grouped changes format).
  95241. * fastDiff( a, b );
  95242. * diffToChanges( diff( a, b ) );
  95243. *
  95244. * // Again, both calls will return the same results (atomic changes format).
  95245. * fastDiff( a, b, null, true );
  95246. * diff( a, b );
  95247. *
  95248. *
  95249. * @param {Array|String} a Input array or string.
  95250. * @param {Array|String} b Input array or string.
  95251. * @param {Function} [cmp] Optional function used to compare array values, by default `===` (strict equal operator) is used.
  95252. * @param {Boolean} [atomicChanges=false] Whether an array of `inset|delete|equal` operations should
  95253. * be returned instead of changes set. This makes this function compatible with {@link module:utils/diff~diff `diff()`}.
  95254. * @returns {Array} Array of changes.
  95255. */
  95256. function fastDiff( a, b, cmp, atomicChanges = false ) {
  95257. // Set the comparator function.
  95258. cmp = cmp || function( a, b ) {
  95259. return a === b;
  95260. };
  95261. // Convert the string (or any array-like object - eg. NodeList) to an array by using the slice() method because,
  95262. // unlike Array.from(), it returns array of UTF-16 code units instead of the code points of a string.
  95263. // One code point might be a surrogate pair of two code units. All text offsets are expected to be in code units.
  95264. // See ckeditor/ckeditor5#3147.
  95265. //
  95266. // We need to make sure here that fastDiff() works identical to diff().
  95267. if ( !Array.isArray( a ) ) {
  95268. a = Array.prototype.slice.call( a );
  95269. }
  95270. if ( !Array.isArray( b ) ) {
  95271. b = Array.prototype.slice.call( b );
  95272. }
  95273. // Find first and last change.
  95274. const changeIndexes = findChangeBoundaryIndexes( a, b, cmp );
  95275. // Transform into changes array.
  95276. return atomicChanges ? changeIndexesToAtomicChanges( changeIndexes, b.length ) : changeIndexesToChanges( b, changeIndexes );
  95277. }
  95278. // Finds position of the first and last change in the given arrays. For example:
  95279. //
  95280. // const indexes = findChangeBoundaryIndexes( [ '1', '2', '3', '4' ], [ '1', '3', '4', '2', '4' ] );
  95281. // console.log( indexes ); // { firstIndex: 1, lastIndexOld: 3, lastIndexNew: 4 }
  95282. //
  95283. // The above indexes means that in the first array the modified part is `1[23]4` and in the second array it is `1[342]4`.
  95284. // Based on such indexes, array with `insert`/`delete` operations which allows transforming first value into the second one
  95285. // can be generated.
  95286. //
  95287. // @param {Array} arr1
  95288. // @param {Array} arr2
  95289. // @param {Function} cmp Comparator function.
  95290. // @returns {Object}
  95291. // @returns {Number} return.firstIndex Index of the first change in both values (always the same for both).
  95292. // @returns {Number} result.lastIndexOld Index of the last common value in `arr1`.
  95293. // @returns {Number} result.lastIndexNew Index of the last common value in `arr2`.
  95294. function findChangeBoundaryIndexes( arr1, arr2, cmp ) {
  95295. // Find the first difference between passed values.
  95296. const firstIndex = findFirstDifferenceIndex( arr1, arr2, cmp );
  95297. // If arrays are equal return -1 indexes object.
  95298. if ( firstIndex === -1 ) {
  95299. return { firstIndex: -1, lastIndexOld: -1, lastIndexNew: -1 };
  95300. }
  95301. // Remove the common part of each value and reverse them to make it simpler to find the last difference between them.
  95302. const oldArrayReversed = cutAndReverse( arr1, firstIndex );
  95303. const newArrayReversed = cutAndReverse( arr2, firstIndex );
  95304. // Find the first difference between reversed values.
  95305. // It should be treated as "how many elements from the end the last difference occurred".
  95306. //
  95307. // For example:
  95308. //
  95309. // initial -> after cut -> reversed:
  95310. // oldValue: '321ba' -> '21ba' -> 'ab12'
  95311. // newValue: '31xba' -> '1xba' -> 'abx1'
  95312. // lastIndex: -> 2
  95313. //
  95314. // So the last change occurred two characters from the end of the arrays.
  95315. const lastIndex = findFirstDifferenceIndex( oldArrayReversed, newArrayReversed, cmp );
  95316. // Use `lastIndex` to calculate proper offset, starting from the beginning (`lastIndex` kind of starts from the end).
  95317. const lastIndexOld = arr1.length - lastIndex;
  95318. const lastIndexNew = arr2.length - lastIndex;
  95319. return { firstIndex, lastIndexOld, lastIndexNew };
  95320. }
  95321. // Returns a first index on which given arrays differ. If both arrays are the same, -1 is returned.
  95322. //
  95323. // @param {Array} arr1
  95324. // @param {Array} arr2
  95325. // @param {Function} cmp Comparator function.
  95326. // @returns {Number}
  95327. function findFirstDifferenceIndex( arr1, arr2, cmp ) {
  95328. for ( let i = 0; i < Math.max( arr1.length, arr2.length ); i++ ) {
  95329. if ( arr1[ i ] === undefined || arr2[ i ] === undefined || !cmp( arr1[ i ], arr2[ i ] ) ) {
  95330. return i;
  95331. }
  95332. }
  95333. return -1; // Return -1 if arrays are equal.
  95334. }
  95335. // Returns a copy of the given array with `howMany` elements removed starting from the beginning and in reversed order.
  95336. //
  95337. // @param {Array} arr Array to be processed.
  95338. // @param {Number} howMany How many elements from array beginning to remove.
  95339. // @returns {Array} Shortened and reversed array.
  95340. function cutAndReverse( arr, howMany ) {
  95341. return arr.slice( howMany ).reverse();
  95342. }
  95343. // Generates changes array based on change indexes from `findChangeBoundaryIndexes` function. This function will
  95344. // generate array with 0 (no changes), 1 (deletion or insertion) or 2 records (insertion and deletion).
  95345. //
  95346. // @param {Array} newArray New array for which change indexes were calculated.
  95347. // @param {Object} changeIndexes Change indexes object from `findChangeBoundaryIndexes` function.
  95348. // @returns {Array.<Object>} Array of changes compatible with {@link module:utils/difftochanges~diffToChanges} format.
  95349. function changeIndexesToChanges( newArray, changeIndexes ) {
  95350. const result = [];
  95351. const { firstIndex, lastIndexOld, lastIndexNew } = changeIndexes;
  95352. // Order operations as 'insert', 'delete' array to keep compatibility with {@link module:utils/difftochanges~diffToChanges}
  95353. // in most cases. However, 'diffToChanges' does not stick to any order so in some cases
  95354. // (for example replacing '12345' with 'abcd') it will generate 'delete', 'insert' order.
  95355. if ( lastIndexNew - firstIndex > 0 ) {
  95356. result.push( {
  95357. index: firstIndex,
  95358. type: 'insert',
  95359. values: newArray.slice( firstIndex, lastIndexNew )
  95360. } );
  95361. }
  95362. if ( lastIndexOld - firstIndex > 0 ) {
  95363. result.push( {
  95364. index: firstIndex + ( lastIndexNew - firstIndex ), // Increase index of what was inserted.
  95365. type: 'delete',
  95366. howMany: lastIndexOld - firstIndex
  95367. } );
  95368. }
  95369. return result;
  95370. }
  95371. // Generates array with set `equal|insert|delete` operations based on change indexes from `findChangeBoundaryIndexes` function.
  95372. //
  95373. // @param {Object} changeIndexes Change indexes object from `findChangeBoundaryIndexes` function.
  95374. // @param {Number} newLength Length of the new array on which `findChangeBoundaryIndexes` calculated change indexes.
  95375. // @returns {Array.<String>} Array of changes compatible with {@link module:utils/diff~diff} format.
  95376. function changeIndexesToAtomicChanges( changeIndexes, newLength ) {
  95377. const { firstIndex, lastIndexOld, lastIndexNew } = changeIndexes;
  95378. // No changes.
  95379. if ( firstIndex === -1 ) {
  95380. return Array( newLength ).fill( 'equal' );
  95381. }
  95382. let result = [];
  95383. if ( firstIndex > 0 ) {
  95384. result = result.concat( Array( firstIndex ).fill( 'equal' ) );
  95385. }
  95386. if ( lastIndexNew - firstIndex > 0 ) {
  95387. result = result.concat( Array( lastIndexNew - firstIndex ).fill( 'insert' ) );
  95388. }
  95389. if ( lastIndexOld - firstIndex > 0 ) {
  95390. result = result.concat( Array( lastIndexOld - firstIndex ).fill( 'delete' ) );
  95391. }
  95392. if ( lastIndexNew < newLength ) {
  95393. result = result.concat( Array( newLength - lastIndexNew ).fill( 'equal' ) );
  95394. }
  95395. return result;
  95396. }
  95397. /***/ }),
  95398. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js":
  95399. /*!*************************************************************!*\
  95400. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/first.js ***!
  95401. \*************************************************************/
  95402. /*! exports provided: default */
  95403. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95404. "use strict";
  95405. __webpack_require__.r(__webpack_exports__);
  95406. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return first; });
  95407. /**
  95408. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  95409. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  95410. */
  95411. /**
  95412. * @module utils/first
  95413. */
  95414. /**
  95415. * Returns first item of the given `iterable`.
  95416. *
  95417. * @param {Iterable.<*>} iterable
  95418. * @returns {*}
  95419. */
  95420. function first( iterable ) {
  95421. const iteratorItem = iterable.next();
  95422. if ( iteratorItem.done ) {
  95423. return null;
  95424. }
  95425. return iteratorItem.value;
  95426. }
  95427. /***/ }),
  95428. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js":
  95429. /*!********************************************************************!*\
  95430. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js ***!
  95431. \********************************************************************/
  95432. /*! exports provided: default */
  95433. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95434. "use strict";
  95435. __webpack_require__.r(__webpack_exports__);
  95436. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FocusTracker; });
  95437. /* harmony import */ var _dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
  95438. /* harmony import */ var _observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  95439. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  95440. /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  95441. /**
  95442. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  95443. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  95444. */
  95445. /* global setTimeout, clearTimeout */
  95446. /**
  95447. * @module utils/focustracker
  95448. */
  95449. /**
  95450. * Allows observing a group of `HTMLElement`s whether at least one of them is focused.
  95451. *
  95452. * Used by the {@link module:core/editor/editor~Editor} in order to track whether the focus is still within the application,
  95453. * or were used outside of its UI.
  95454. *
  95455. * **Note** `focus` and `blur` listeners use event capturing, so it is only needed to register wrapper `HTMLElement`
  95456. * which contain other `focusable` elements. But note that this wrapper element has to be focusable too
  95457. * (have e.g. `tabindex="-1"`).
  95458. *
  95459. * Check out the {@glink framework/guides/deep-dive/ui/focus-tracking "Deep dive into focus tracking" guide} to learn more.
  95460. *
  95461. * @mixes module:utils/dom/emittermixin~EmitterMixin
  95462. * @mixes module:utils/observablemixin~ObservableMixin
  95463. */
  95464. class FocusTracker {
  95465. constructor() {
  95466. /**
  95467. * True when one of the registered elements is focused.
  95468. *
  95469. * @readonly
  95470. * @observable
  95471. * @member {Boolean} #isFocused
  95472. */
  95473. this.set( 'isFocused', false );
  95474. /**
  95475. * The currently focused element.
  95476. *
  95477. * While {@link #isFocused `isFocused`} remains `true`, the focus can
  95478. * move between different UI elements. This property tracks those
  95479. * elements and tells which one is currently focused.
  95480. *
  95481. * @readonly
  95482. * @observable
  95483. * @member {HTMLElement|null} #focusedElement
  95484. */
  95485. this.set( 'focusedElement', null );
  95486. /**
  95487. * List of registered elements.
  95488. *
  95489. * @private
  95490. * @member {Set.<HTMLElement>}
  95491. */
  95492. this._elements = new Set();
  95493. /**
  95494. * Event loop timeout.
  95495. *
  95496. * @private
  95497. * @member {Number}
  95498. */
  95499. this._nextEventLoopTimeout = null;
  95500. }
  95501. /**
  95502. * Starts tracking the specified element.
  95503. *
  95504. * @param {HTMLElement} element
  95505. */
  95506. add( element ) {
  95507. if ( this._elements.has( element ) ) {
  95508. /**
  95509. * This element is already tracked by {@link module:utils/focustracker~FocusTracker}.
  95510. *
  95511. * @error focustracker-add-element-already-exist
  95512. */
  95513. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'focustracker-add-element-already-exist', this );
  95514. }
  95515. this.listenTo( element, 'focus', () => this._focus( element ), { useCapture: true } );
  95516. this.listenTo( element, 'blur', () => this._blur(), { useCapture: true } );
  95517. this._elements.add( element );
  95518. }
  95519. /**
  95520. * Stops tracking the specified element and stops listening on this element.
  95521. *
  95522. * @param {HTMLElement} element
  95523. */
  95524. remove( element ) {
  95525. if ( element === this.focusedElement ) {
  95526. this._blur( element );
  95527. }
  95528. if ( this._elements.has( element ) ) {
  95529. this.stopListening( element );
  95530. this._elements.delete( element );
  95531. }
  95532. }
  95533. /**
  95534. * Destroys the focus tracker by:
  95535. * - Disabling all event listeners attached to tracked elements.
  95536. * - Removing all tracked elements that were previously added.
  95537. */
  95538. destroy() {
  95539. this.stopListening();
  95540. }
  95541. /**
  95542. * Stores currently focused element and set {#isFocused} as `true`.
  95543. *
  95544. * @private
  95545. * @param {HTMLElement} element Element which has been focused.
  95546. */
  95547. _focus( element ) {
  95548. clearTimeout( this._nextEventLoopTimeout );
  95549. this.focusedElement = element;
  95550. this.isFocused = true;
  95551. }
  95552. /**
  95553. * Clears currently focused element and set {@link #isFocused} as `false`.
  95554. * This method uses `setTimeout` to change order of fires `blur` and `focus` events.
  95555. *
  95556. * @private
  95557. * @fires blur
  95558. */
  95559. _blur() {
  95560. clearTimeout( this._nextEventLoopTimeout );
  95561. this._nextEventLoopTimeout = setTimeout( () => {
  95562. this.focusedElement = null;
  95563. this.isFocused = false;
  95564. }, 0 );
  95565. }
  95566. /**
  95567. * @event focus
  95568. */
  95569. /**
  95570. * @event blur
  95571. */
  95572. }
  95573. Object(_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( FocusTracker, _dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  95574. Object(_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( FocusTracker, _observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  95575. /***/ }),
  95576. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/index.js":
  95577. /*!*************************************************************!*\
  95578. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/index.js ***!
  95579. \*************************************************************/
  95580. /*! exports provided: env, diff, mix, EmitterMixin, ObservableMixin, CKEditorError, logError, logWarning, ElementReplacer, createElement, DomEmitterMixin, global, getDataFromElement, Rect, ResizeObserver, setDataInElement, toUnit, keyCodes, getCode, parseKeystroke, getEnvKeystrokeText, isArrowKeyCode, getLocalizedArrowKeyCodeDirection, isForwardArrowKeyCode, getLanguageDirection, Locale, Collection, first, FocusTracker, KeystrokeHandler, toArray, toMap, priorities, uid, version */
  95581. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95582. "use strict";
  95583. __webpack_require__.r(__webpack_exports__);
  95584. /* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  95585. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "env", function() { return _env__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  95586. /* harmony import */ var _diff__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./diff */ "./node_modules/@ckeditor/ckeditor5-utils/src/diff.js");
  95587. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "diff", function() { return _diff__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  95588. /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  95589. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mix", function() { return _mix__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  95590. /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  95591. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EmitterMixin", function() { return _emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  95592. /* harmony import */ var _observablemixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  95593. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ObservableMixin", function() { return _observablemixin__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  95594. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  95595. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CKEditorError", function() { return _ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  95596. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "logError", function() { return _ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["logError"]; });
  95597. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "logWarning", function() { return _ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["logWarning"]; });
  95598. /* harmony import */ var _elementreplacer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./elementreplacer */ "./node_modules/@ckeditor/ckeditor5-utils/src/elementreplacer.js");
  95599. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ElementReplacer", function() { return _elementreplacer__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  95600. /* harmony import */ var _dom_createelement__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./dom/createelement */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.js");
  95601. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createElement", function() { return _dom_createelement__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  95602. /* harmony import */ var _dom_emittermixin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
  95603. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEmitterMixin", function() { return _dom_emittermixin__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  95604. /* harmony import */ var _dom_global__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  95605. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "global", function() { return _dom_global__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  95606. /* harmony import */ var _dom_getdatafromelement__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./dom/getdatafromelement */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getdatafromelement.js");
  95607. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDataFromElement", function() { return _dom_getdatafromelement__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  95608. /* harmony import */ var _dom_rect__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  95609. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Rect", function() { return _dom_rect__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  95610. /* harmony import */ var _dom_resizeobserver__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./dom/resizeobserver */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js");
  95611. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResizeObserver", function() { return _dom_resizeobserver__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  95612. /* harmony import */ var _dom_setdatainelement__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./dom/setdatainelement */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js");
  95613. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setDataInElement", function() { return _dom_setdatainelement__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  95614. /* harmony import */ var _dom_tounit__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
  95615. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toUnit", function() { return _dom_tounit__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  95616. /* harmony import */ var _keyboard__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  95617. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keyCodes", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["keyCodes"]; });
  95618. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["getCode"]; });
  95619. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseKeystroke", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["parseKeystroke"]; });
  95620. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEnvKeystrokeText", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["getEnvKeystrokeText"]; });
  95621. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrowKeyCode", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["isArrowKeyCode"]; });
  95622. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLocalizedArrowKeyCodeDirection", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["getLocalizedArrowKeyCodeDirection"]; });
  95623. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isForwardArrowKeyCode", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_15__["isForwardArrowKeyCode"]; });
  95624. /* harmony import */ var _language__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./language */ "./node_modules/@ckeditor/ckeditor5-utils/src/language.js");
  95625. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLanguageDirection", function() { return _language__WEBPACK_IMPORTED_MODULE_16__["getLanguageDirection"]; });
  95626. /* harmony import */ var _locale__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./locale */ "./node_modules/@ckeditor/ckeditor5-utils/src/locale.js");
  95627. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Locale", function() { return _locale__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  95628. /* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  95629. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Collection", function() { return _collection__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  95630. /* harmony import */ var _first__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./first */ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js");
  95631. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _first__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  95632. /* harmony import */ var _focustracker__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  95633. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocusTracker", function() { return _focustracker__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  95634. /* harmony import */ var _keystrokehandler__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  95635. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "KeystrokeHandler", function() { return _keystrokehandler__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  95636. /* harmony import */ var _toarray__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
  95637. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _toarray__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  95638. /* harmony import */ var _tomap__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
  95639. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toMap", function() { return _tomap__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  95640. /* harmony import */ var _priorities__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./priorities */ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js");
  95641. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "priorities", function() { return _priorities__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  95642. /* harmony import */ var _uid__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  95643. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uid", function() { return _uid__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  95644. /* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
  95645. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "version", function() { return _version__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  95646. /**
  95647. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  95648. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  95649. */
  95650. /**
  95651. * @module utils
  95652. */
  95653. /***/ }),
  95654. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js":
  95655. /*!******************************************************************!*\
  95656. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js ***!
  95657. \******************************************************************/
  95658. /*! exports provided: default */
  95659. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95660. "use strict";
  95661. __webpack_require__.r(__webpack_exports__);
  95662. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isIterable; });
  95663. /**
  95664. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  95665. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  95666. */
  95667. /**
  95668. * @module utils/isiterable
  95669. */
  95670. /**
  95671. * Checks if value implements iterator interface.
  95672. *
  95673. * @param {*} value The value to check.
  95674. * @returns {Boolean} True if value implements iterator interface.
  95675. */
  95676. function isIterable( value ) {
  95677. return !!( value && value[ Symbol.iterator ] );
  95678. }
  95679. /***/ }),
  95680. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js":
  95681. /*!****************************************************************!*\
  95682. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js ***!
  95683. \****************************************************************/
  95684. /*! exports provided: keyCodes, getCode, parseKeystroke, getEnvKeystrokeText, isArrowKeyCode, getLocalizedArrowKeyCodeDirection, isForwardArrowKeyCode */
  95685. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95686. "use strict";
  95687. __webpack_require__.r(__webpack_exports__);
  95688. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keyCodes", function() { return keyCodes; });
  95689. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return getCode; });
  95690. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseKeystroke", function() { return parseKeystroke; });
  95691. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEnvKeystrokeText", function() { return getEnvKeystrokeText; });
  95692. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArrowKeyCode", function() { return isArrowKeyCode; });
  95693. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalizedArrowKeyCodeDirection", function() { return getLocalizedArrowKeyCodeDirection; });
  95694. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isForwardArrowKeyCode", function() { return isForwardArrowKeyCode; });
  95695. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  95696. /* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  95697. /**
  95698. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  95699. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  95700. */
  95701. /**
  95702. * A set of utilities related to keyboard support.
  95703. *
  95704. * @module utils/keyboard
  95705. */
  95706. const modifiersToGlyphsMac = {
  95707. ctrl: '⌃',
  95708. cmd: '⌘',
  95709. alt: '⌥',
  95710. shift: '⇧'
  95711. };
  95712. const modifiersToGlyphsNonMac = {
  95713. ctrl: 'Ctrl+',
  95714. alt: 'Alt+',
  95715. shift: 'Shift+'
  95716. };
  95717. /**
  95718. * An object with `keyName => keyCode` pairs for a set of known keys.
  95719. *
  95720. * Contains:
  95721. *
  95722. * * `a-z`,
  95723. * * `0-9`,
  95724. * * `f1-f12`,
  95725. * * `` ` ``, `-`, `=`, `[`, `]`, `;`, `'`, `,`, `.`, `/`, `\`,
  95726. * * `arrow(left|up|right|bottom)`,
  95727. * * `backspace`, `delete`, `enter`, `esc`, `tab`,
  95728. * * `ctrl`, `cmd`, `shift`, `alt`.
  95729. */
  95730. const keyCodes = generateKnownKeyCodes();
  95731. const keyCodeNames = Object.fromEntries(
  95732. Object.entries( keyCodes ).map( ( [ name, code ] ) => [ code, name.charAt( 0 ).toUpperCase() + name.slice( 1 ) ] )
  95733. );
  95734. /**
  95735. * Converts a key name or {@link module:utils/keyboard~KeystrokeInfo keystroke info} into a key code.
  95736. *
  95737. * Note: Key names are matched with {@link module:utils/keyboard~keyCodes} in a case-insensitive way.
  95738. *
  95739. * @param {String|module:utils/keyboard~KeystrokeInfo} A key name (see {@link module:utils/keyboard~keyCodes})
  95740. * or a keystroke data object.
  95741. * @returns {Number} Key or keystroke code.
  95742. */
  95743. function getCode( key ) {
  95744. let keyCode;
  95745. if ( typeof key == 'string' ) {
  95746. keyCode = keyCodes[ key.toLowerCase() ];
  95747. if ( !keyCode ) {
  95748. /**
  95749. * Unknown key name. Only key names included in the {@link module:utils/keyboard~keyCodes} can be used.
  95750. *
  95751. * @error keyboard-unknown-key
  95752. * @param {String} key
  95753. */
  95754. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'keyboard-unknown-key', null, { key } );
  95755. }
  95756. } else {
  95757. keyCode = key.keyCode +
  95758. ( key.altKey ? keyCodes.alt : 0 ) +
  95759. ( key.ctrlKey ? keyCodes.ctrl : 0 ) +
  95760. ( key.shiftKey ? keyCodes.shift : 0 ) +
  95761. ( key.metaKey ? keyCodes.cmd : 0 );
  95762. }
  95763. return keyCode;
  95764. }
  95765. /**
  95766. * Parses the keystroke and returns a keystroke code that will match the code returned by
  95767. * {@link module:utils/keyboard~getCode} for the corresponding {@link module:utils/keyboard~KeystrokeInfo keystroke info}.
  95768. *
  95769. * The keystroke can be passed in two formats:
  95770. *
  95771. * * as a single string – e.g. `ctrl + A`,
  95772. * * as an array of {@link module:utils/keyboard~keyCodes known key names} and key codes – e.g.:
  95773. * * `[ 'ctrl', 32 ]` (ctrl + space),
  95774. * * `[ 'ctrl', 'a' ]` (ctrl + A).
  95775. *
  95776. * Note: Key names are matched with {@link module:utils/keyboard~keyCodes} in a case-insensitive way.
  95777. *
  95778. * Note: Only keystrokes with a single non-modifier key are supported (e.g. `ctrl+A` is OK, but `ctrl+A+B` is not).
  95779. *
  95780. * Note: On macOS, keystroke handling is translating the `Ctrl` key to the `Cmd` key and handling only that keystroke.
  95781. * For example, a registered keystroke `Ctrl+A` will be translated to `Cmd+A` on macOS. To disable the translation of some keystroke,
  95782. * use the forced modifier: `Ctrl!+A` (note the exclamation mark).
  95783. *
  95784. * @param {String|Array.<Number|String>} keystroke The keystroke definition.
  95785. * @returns {Number} Keystroke code.
  95786. */
  95787. function parseKeystroke( keystroke ) {
  95788. if ( typeof keystroke == 'string' ) {
  95789. keystroke = splitKeystrokeText( keystroke );
  95790. }
  95791. return keystroke
  95792. .map( key => ( typeof key == 'string' ) ? getEnvKeyCode( key ) : key )
  95793. .reduce( ( key, sum ) => sum + key, 0 );
  95794. }
  95795. /**
  95796. * Translates any keystroke string text like `"Ctrl+A"` to an
  95797. * environment–specific keystroke, i.e. `"⌘A"` on macOS.
  95798. *
  95799. * @param {String} keystroke The keystroke text.
  95800. * @returns {String} The keystroke text specific for the environment.
  95801. */
  95802. function getEnvKeystrokeText( keystroke ) {
  95803. let keystrokeCode = parseKeystroke( keystroke );
  95804. const modifiersToGlyphs = Object.entries( _env__WEBPACK_IMPORTED_MODULE_1__["default"].isMac ? modifiersToGlyphsMac : modifiersToGlyphsNonMac );
  95805. const modifiers = modifiersToGlyphs.reduce( ( modifiers, [ name, glyph ] ) => {
  95806. // Modifier keys are stored as a bit mask so extract those from the keystroke code.
  95807. if ( ( keystrokeCode & keyCodes[ name ] ) != 0 ) {
  95808. keystrokeCode &= ~keyCodes[ name ];
  95809. modifiers += glyph;
  95810. }
  95811. return modifiers;
  95812. }, '' );
  95813. return modifiers + ( keystrokeCode ? keyCodeNames[ keystrokeCode ] : '' );
  95814. }
  95815. /**
  95816. * Returns `true` if the provided key code represents one of the arrow keys.
  95817. *
  95818. * @param {Number} keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
  95819. * @returns {Boolean}
  95820. */
  95821. function isArrowKeyCode( keyCode ) {
  95822. return keyCode == keyCodes.arrowright ||
  95823. keyCode == keyCodes.arrowleft ||
  95824. keyCode == keyCodes.arrowup ||
  95825. keyCode == keyCodes.arrowdown;
  95826. }
  95827. /**
  95828. * Returns the direction in which the {@link module:engine/model/documentselection~DocumentSelection selection}
  95829. * will move when the provided arrow key code is pressed considering the language direction of the editor content.
  95830. *
  95831. * For instance, in right–to–left (RTL) content languages, pressing the left arrow means moving the selection right (forward)
  95832. * in the model structure. Similarly, pressing the right arrow moves the selection left (backward).
  95833. *
  95834. * @param {Number} keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
  95835. * @param {'ltr'|'rtl'} contentLanguageDirection The content language direction, corresponding to
  95836. * {@link module:utils/locale~Locale#contentLanguageDirection}.
  95837. * @returns {'left'|'up'|'right'|'down'} Localized arrow direction.
  95838. */
  95839. function getLocalizedArrowKeyCodeDirection( keyCode, contentLanguageDirection ) {
  95840. const isLtrContent = contentLanguageDirection === 'ltr';
  95841. switch ( keyCode ) {
  95842. case keyCodes.arrowleft:
  95843. return isLtrContent ? 'left' : 'right';
  95844. case keyCodes.arrowright:
  95845. return isLtrContent ? 'right' : 'left';
  95846. case keyCodes.arrowup:
  95847. return 'up';
  95848. case keyCodes.arrowdown:
  95849. return 'down';
  95850. }
  95851. }
  95852. // Converts a key name to the key code with mapping based on the env.
  95853. //
  95854. // See: {@link module:utils/keyboard~getCode}.
  95855. //
  95856. // @param {String} key The key name (see {@link module:utils/keyboard~keyCodes}).
  95857. // @returns {Number} Key code.
  95858. function getEnvKeyCode( key ) {
  95859. // Don't remap modifier key for forced modifiers.
  95860. if ( key.endsWith( '!' ) ) {
  95861. return getCode( key.slice( 0, -1 ) );
  95862. }
  95863. const code = getCode( key );
  95864. return _env__WEBPACK_IMPORTED_MODULE_1__["default"].isMac && code == keyCodes.ctrl ? keyCodes.cmd : code;
  95865. }
  95866. /**
  95867. * Determines if the provided key code moves the {@link module:engine/model/documentselection~DocumentSelection selection}
  95868. * forward or backward considering the language direction of the editor content.
  95869. *
  95870. * For instance, in right–to–left (RTL) languages, pressing the left arrow means moving forward
  95871. * in the model structure. Similarly, pressing the right arrow moves the selection backward.
  95872. *
  95873. * @param {Number} keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
  95874. * @param {'ltr'|'rtl'} contentLanguageDirection The content language direction, corresponding to
  95875. * {@link module:utils/locale~Locale#contentLanguageDirection}.
  95876. * @returns {Boolean}
  95877. */
  95878. function isForwardArrowKeyCode( keyCode, contentLanguageDirection ) {
  95879. const localizedKeyCodeDirection = getLocalizedArrowKeyCodeDirection( keyCode, contentLanguageDirection );
  95880. return localizedKeyCodeDirection === 'down' || localizedKeyCodeDirection === 'right';
  95881. }
  95882. function generateKnownKeyCodes() {
  95883. const keyCodes = {
  95884. arrowleft: 37,
  95885. arrowup: 38,
  95886. arrowright: 39,
  95887. arrowdown: 40,
  95888. backspace: 8,
  95889. delete: 46,
  95890. enter: 13,
  95891. space: 32,
  95892. esc: 27,
  95893. tab: 9,
  95894. // The idea about these numbers is that they do not collide with any real key codes, so we can use them
  95895. // like bit masks.
  95896. ctrl: 0x110000,
  95897. shift: 0x220000,
  95898. alt: 0x440000,
  95899. cmd: 0x880000
  95900. };
  95901. // a-z
  95902. for ( let code = 65; code <= 90; code++ ) {
  95903. const letter = String.fromCharCode( code );
  95904. keyCodes[ letter.toLowerCase() ] = code;
  95905. }
  95906. // 0-9
  95907. for ( let code = 48; code <= 57; code++ ) {
  95908. keyCodes[ code - 48 ] = code;
  95909. }
  95910. // F1-F12
  95911. for ( let code = 112; code <= 123; code++ ) {
  95912. keyCodes[ 'f' + ( code - 111 ) ] = code;
  95913. }
  95914. // other characters
  95915. for ( const char of '`-=[];\',./\\' ) {
  95916. keyCodes[ char ] = char.charCodeAt( 0 );
  95917. }
  95918. return keyCodes;
  95919. }
  95920. function splitKeystrokeText( keystroke ) {
  95921. return keystroke.split( '+' ).map( key => key.trim() );
  95922. }
  95923. /**
  95924. * Information about the keystroke.
  95925. *
  95926. * @interface module:utils/keyboard~KeystrokeInfo
  95927. */
  95928. /**
  95929. * The [key code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode).
  95930. *
  95931. * @member {Number} module:utils/keyboard~KeystrokeInfo#keyCode
  95932. */
  95933. /**
  95934. * Whether the <kbd>Alt</kbd> modifier was pressed.
  95935. *
  95936. * @member {Boolean} module:utils/keyboard~KeystrokeInfo#altKey
  95937. */
  95938. /**
  95939. * Whether the <kbd>Ctrl</kbd> modifier was pressed.
  95940. *
  95941. * @member {Boolean} module:utils/keyboard~KeystrokeInfo#ctrlKey
  95942. */
  95943. /**
  95944. * Whether the <kbd>Shift</kbd> modifier was pressed.
  95945. *
  95946. * @member {Boolean} module:utils/keyboard~KeystrokeInfo#shiftKey
  95947. */
  95948. /**
  95949. * Whether the <kbd>Cmd</kbd> modifier was pressed.
  95950. *
  95951. * @member {Boolean} module:utils/keyboard~KeystrokeInfo#metaKey
  95952. */
  95953. /***/ }),
  95954. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js":
  95955. /*!************************************************************************!*\
  95956. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js ***!
  95957. \************************************************************************/
  95958. /*! exports provided: default */
  95959. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95960. "use strict";
  95961. __webpack_require__.r(__webpack_exports__);
  95962. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return KeystrokeHandler; });
  95963. /* harmony import */ var _dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
  95964. /* harmony import */ var _keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  95965. /**
  95966. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  95967. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  95968. */
  95969. /**
  95970. * @module utils/keystrokehandler
  95971. */
  95972. /**
  95973. * Keystroke handler allows registering callbacks for given keystrokes.
  95974. *
  95975. * The most frequent use of this class is through the {@link module:core/editor/editor~Editor#keystrokes `editor.keystrokes`}
  95976. * property. It allows listening to keystrokes executed in the editing view:
  95977. *
  95978. * editor.keystrokes.set( 'Ctrl+A', ( keyEvtData, cancel ) => {
  95979. * console.log( 'Ctrl+A has been pressed' );
  95980. * cancel();
  95981. * } );
  95982. *
  95983. * However, this utility class can be used in various part of the UI. For instance, a certain {@link module:ui/view~View}
  95984. * can use it like this:
  95985. *
  95986. * class MyView extends View {
  95987. * constructor() {
  95988. * this.keystrokes = new KeystrokeHandler();
  95989. *
  95990. * this.keystrokes.set( 'tab', handleTabKey );
  95991. * }
  95992. *
  95993. * render() {
  95994. * super.render();
  95995. *
  95996. * this.keystrokes.listenTo( this.element );
  95997. * }
  95998. * }
  95999. *
  96000. * That keystroke handler will listen to `keydown` events fired in this view's main element.
  96001. *
  96002. */
  96003. class KeystrokeHandler {
  96004. /**
  96005. * Creates an instance of the keystroke handler.
  96006. */
  96007. constructor() {
  96008. /**
  96009. * Listener used to listen to events for easier keystroke handler destruction.
  96010. *
  96011. * @protected
  96012. * @member {module:utils/dom/emittermixin~Emitter}
  96013. */
  96014. this._listener = Object.create( _dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  96015. }
  96016. /**
  96017. * Starts listening for `keydown` events from a given emitter.
  96018. *
  96019. * @param {module:utils/emittermixin~Emitter} emitter
  96020. */
  96021. listenTo( emitter ) {
  96022. // The #_listener works here as a kind of dispatcher. It groups the events coming from the same
  96023. // keystroke so the listeners can be attached to them with different priorities.
  96024. //
  96025. // E.g. all the keystrokes with the `keyCode` of 42 coming from the `emitter` are propagated
  96026. // as a `_keydown:42` event by the `_listener`. If there's a callback created by the `set`
  96027. // method for this 42 keystroke, it listens to the `_listener#_keydown:42` event only and interacts
  96028. // only with other listeners of this particular event, thus making it possible to prioritize
  96029. // the listeners and safely cancel execution, when needed. Instead of duplicating the Emitter logic,
  96030. // the KeystrokeHandler re–uses it to do its job.
  96031. this._listener.listenTo( emitter, 'keydown', ( evt, keyEvtData ) => {
  96032. this._listener.fire( '_keydown:' + Object(_keyboard__WEBPACK_IMPORTED_MODULE_1__["getCode"])( keyEvtData ), keyEvtData );
  96033. } );
  96034. }
  96035. /**
  96036. * Registers a handler for the specified keystroke.
  96037. *
  96038. * @param {String|Array.<String|Number>} keystroke Keystroke defined in a format accepted by
  96039. * the {@link module:utils/keyboard~parseKeystroke} function.
  96040. * @param {Function} callback A function called with the
  96041. * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and
  96042. * a helper funcion to call both `preventDefault()` and `stopPropagation()` on the underlying event.
  96043. * @param {Object} [options={}] Additional options.
  96044. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of the keystroke
  96045. * callback. The higher the priority value the sooner the callback will be executed. Keystrokes having the same priority
  96046. * are called in the order they were added.
  96047. */
  96048. set( keystroke, callback, options = {} ) {
  96049. const keyCode = Object(_keyboard__WEBPACK_IMPORTED_MODULE_1__["parseKeystroke"])( keystroke );
  96050. const priority = options.priority;
  96051. // Execute the passed callback on KeystrokeHandler#_keydown.
  96052. // TODO: https://github.com/ckeditor/ckeditor5-utils/issues/144
  96053. this._listener.listenTo( this._listener, '_keydown:' + keyCode, ( evt, keyEvtData ) => {
  96054. callback( keyEvtData, () => {
  96055. // Stop the event in the DOM: no listener in the web page
  96056. // will be triggered by this event.
  96057. keyEvtData.preventDefault();
  96058. keyEvtData.stopPropagation();
  96059. // Stop the event in the KeystrokeHandler: no more callbacks
  96060. // will be executed for this keystroke.
  96061. evt.stop();
  96062. } );
  96063. // Mark this keystroke as handled by the callback. See: #press.
  96064. evt.return = true;
  96065. }, { priority } );
  96066. }
  96067. /**
  96068. * Triggers a keystroke handler for a specified key combination, if such a keystroke was {@link #set defined}.
  96069. *
  96070. * @param {module:engine/view/observer/keyobserver~KeyEventData} keyEvtData Key event data.
  96071. * @returns {Boolean} Whether the keystroke was handled.
  96072. */
  96073. press( keyEvtData ) {
  96074. return !!this._listener.fire( '_keydown:' + Object(_keyboard__WEBPACK_IMPORTED_MODULE_1__["getCode"])( keyEvtData ), keyEvtData );
  96075. }
  96076. /**
  96077. * Destroys the keystroke handler.
  96078. */
  96079. destroy() {
  96080. this._listener.stopListening();
  96081. }
  96082. }
  96083. /***/ }),
  96084. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/language.js":
  96085. /*!****************************************************************!*\
  96086. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/language.js ***!
  96087. \****************************************************************/
  96088. /*! exports provided: getLanguageDirection */
  96089. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96090. "use strict";
  96091. __webpack_require__.r(__webpack_exports__);
  96092. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLanguageDirection", function() { return getLanguageDirection; });
  96093. /**
  96094. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  96095. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  96096. */
  96097. /**
  96098. * @module utils/language
  96099. */
  96100. const RTL_LANGUAGE_CODES = [
  96101. 'ar', 'ara', // Arabic
  96102. 'fa', 'per', 'fas', // Persian
  96103. 'he', 'heb', // Hebrew
  96104. 'ku', 'kur', // Kurdish
  96105. 'ug', 'uig' // Uighur, Uyghur
  96106. ];
  96107. /**
  96108. * Helps determine whether a language text direction is LTR or RTL.
  96109. *
  96110. * @param {String} language The ISO 639-1 or ISO 639-2 language code.
  96111. * @returns {'ltr'|'rtl'}
  96112. */
  96113. function getLanguageDirection( languageCode ) {
  96114. return RTL_LANGUAGE_CODES.includes( languageCode ) ? 'rtl' : 'ltr';
  96115. }
  96116. /***/ }),
  96117. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/locale.js":
  96118. /*!**************************************************************!*\
  96119. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/locale.js ***!
  96120. \**************************************************************/
  96121. /*! exports provided: default */
  96122. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96123. "use strict";
  96124. __webpack_require__.r(__webpack_exports__);
  96125. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Locale; });
  96126. /* harmony import */ var _toarray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
  96127. /* harmony import */ var _translation_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./translation-service */ "./node_modules/@ckeditor/ckeditor5-utils/src/translation-service.js");
  96128. /* harmony import */ var _language__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./language */ "./node_modules/@ckeditor/ckeditor5-utils/src/language.js");
  96129. /**
  96130. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  96131. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  96132. */
  96133. /**
  96134. * @module utils/locale
  96135. */
  96136. /* globals console */
  96137. /**
  96138. * Represents the localization services.
  96139. */
  96140. class Locale {
  96141. /**
  96142. * Creates a new instance of the locale class. Learn more about
  96143. * {@glink features/ui-language configuring the language of the editor}.
  96144. *
  96145. * @param {Object} [options] Locale configuration.
  96146. * @param {String} [options.uiLanguage='en'] The editor UI language code in the
  96147. * [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format. See {@link #uiLanguage}.
  96148. * @param {String} [options.contentLanguage] The editor content language code in the
  96149. * [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format. If not specified, the same as `options.language`.
  96150. * See {@link #contentLanguage}.
  96151. */
  96152. constructor( options = {} ) {
  96153. /**
  96154. * The editor UI language code in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.
  96155. *
  96156. * If the {@link #contentLanguage content language} was not specified in the `Locale` constructor,
  96157. * it also defines the language of the content.
  96158. *
  96159. * @readonly
  96160. * @member {String}
  96161. */
  96162. this.uiLanguage = options.uiLanguage || 'en';
  96163. /**
  96164. * The editor content language code in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.
  96165. *
  96166. * Usually the same as the {@link #uiLanguage editor language}, it can be customized by passing an optional
  96167. * argument to the `Locale` constructor.
  96168. *
  96169. * @readonly
  96170. * @member {String}
  96171. */
  96172. this.contentLanguage = options.contentLanguage || this.uiLanguage;
  96173. /**
  96174. * Text direction of the {@link #uiLanguage editor UI language}. Either `'ltr'` or `'rtl'`.
  96175. *
  96176. * @readonly
  96177. * @member {String}
  96178. */
  96179. this.uiLanguageDirection = Object(_language__WEBPACK_IMPORTED_MODULE_2__["getLanguageDirection"])( this.uiLanguage );
  96180. /**
  96181. * Text direction of the {@link #contentLanguage editor content language}.
  96182. *
  96183. * If the content language was passed directly to the `Locale` constructor, this property represents the
  96184. * direction of that language.
  96185. *
  96186. * If the {@link #contentLanguage editor content language} was derived from the {@link #uiLanguage editor language},
  96187. * the content language direction is the same as the {@link #uiLanguageDirection UI language direction}.
  96188. *
  96189. * The value is either `'ltr'` or `'rtl'`.
  96190. *
  96191. * @readonly
  96192. * @member {String}
  96193. */
  96194. this.contentLanguageDirection = Object(_language__WEBPACK_IMPORTED_MODULE_2__["getLanguageDirection"])( this.contentLanguage );
  96195. /**
  96196. * Translates the given message to the {@link #uiLanguage}. This method is also available in
  96197. * {@link module:core/editor/editor~Editor#t `Editor`} and {@link module:ui/view~View#t `View`}.
  96198. *
  96199. * This method's context is statically bound to the `Locale` instance and **should always be called as a function**:
  96200. *
  96201. * const t = locale.t;
  96202. * t( 'Label' );
  96203. *
  96204. * The message can be either a string or an object implementing the {@link module:utils/translation-service~Message} interface.
  96205. *
  96206. * The message may contain placeholders (`%<index>`) for value(s) that are passed as a `values` parameter.
  96207. * For an array of values, the `%<index>` will be changed to an element of that array at the given index.
  96208. * For a single value passed as the second argument, only the `%0` placeholders will be changed to the provided value.
  96209. *
  96210. * t( 'Created file "%0" in %1ms.', [ fileName, timeTaken ] );
  96211. * t( 'Created file "%0", fileName );
  96212. *
  96213. * The message supports plural forms. To specify the plural form, use the `plural` property. Singular or plural form
  96214. * will be chosen depending on the first value from the passed `values`. The value of the `plural` property is used
  96215. * as a default plural translation when the translation for the target language is missing.
  96216. *
  96217. * t( { string: 'Add a space', plural: 'Add %0 spaces' }, 1 ); // 'Add a space' for the English language.
  96218. * t( { string: 'Add a space', plural: 'Add %0 spaces' }, 5 ); // 'Add 5 spaces' for the English language.
  96219. * t( { string: '%1 a space', plural: '%1 %0 spaces' }, [ 2, 'Add' ] ); // 'Add 2 spaces' for the English language.
  96220. *
  96221. * t( { string: 'Add a space', plural: 'Add %0 spaces' }, 1 ); // 'Dodaj spację' for the Polish language.
  96222. * t( { string: 'Add a space', plural: 'Add %0 spaces' }, 5 ); // 'Dodaj 5 spacji' for the Polish language.
  96223. * t( { string: '%1 a space', plural: '%1 %0 spaces' }, [ 2, 'Add' ] ); // 'Dodaj 2 spacje' for the Polish language.
  96224. *
  96225. * * The message should provide an ID using the `id` property when the message strings are not unique and their
  96226. * translations should be different.
  96227. *
  96228. * translate( 'en', { string: 'image', id: 'ADD_IMAGE' } );
  96229. * translate( 'en', { string: 'image', id: 'AN_IMAGE' } );
  96230. *
  96231. * @method #t
  96232. * @param {String|module:utils/translation-service~Message} message A message that will be localized (translated).
  96233. * @param {String|Number|Array.<String|Number>} [values] A value or an array of values that will fill message placeholders.
  96234. * For messages supporting plural forms the first value will determine the plural form.
  96235. * @returns {String}
  96236. */
  96237. this.t = ( message, values ) => this._t( message, values );
  96238. }
  96239. /**
  96240. * The editor UI language code in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.
  96241. *
  96242. * **Note**: This property was deprecated. Please use {@link #uiLanguage} and {@link #contentLanguage}
  96243. * properties instead.
  96244. *
  96245. * @deprecated
  96246. * @member {String}
  96247. */
  96248. get language() {
  96249. /**
  96250. * The {@link module:utils/locale~Locale#language `Locale#language`} property was deprecated and will
  96251. * be removed in the near future. Please use the {@link #uiLanguage} and {@link #contentLanguage} properties instead.
  96252. *
  96253. * @error locale-deprecated-language-property
  96254. */
  96255. console.warn(
  96256. 'locale-deprecated-language-property: ' +
  96257. 'The Locale#language property has been deprecated and will be removed in the near future. ' +
  96258. 'Please use #uiLanguage and #contentLanguage properties instead.' );
  96259. return this.uiLanguage;
  96260. }
  96261. /**
  96262. * An unbound version of the {@link #t} method.
  96263. *
  96264. * @private
  96265. * @param {String|module:utils/translation-service~Message} message
  96266. * @param {Number|String|Array.<Number|String>} [values]
  96267. * @returns {String}
  96268. */
  96269. _t( message, values = [] ) {
  96270. values = Object(_toarray__WEBPACK_IMPORTED_MODULE_0__["default"])( values );
  96271. if ( typeof message === 'string' ) {
  96272. message = { string: message };
  96273. }
  96274. const hasPluralForm = !!message.plural;
  96275. const quantity = hasPluralForm ? values[ 0 ] : 1;
  96276. const translatedString = Object(_translation_service__WEBPACK_IMPORTED_MODULE_1__["_translate"])( this.uiLanguage, message, quantity );
  96277. return interpolateString( translatedString, values );
  96278. }
  96279. }
  96280. // Fills the `%0, %1, ...` string placeholders with values.
  96281. function interpolateString( string, values ) {
  96282. return string.replace( /%(\d+)/g, ( match, index ) => {
  96283. return ( index < values.length ) ? values[ index ] : match;
  96284. } );
  96285. }
  96286. /***/ }),
  96287. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js":
  96288. /*!***********************************************************!*\
  96289. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/mix.js ***!
  96290. \***********************************************************/
  96291. /*! exports provided: default */
  96292. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96293. "use strict";
  96294. __webpack_require__.r(__webpack_exports__);
  96295. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return mix; });
  96296. /**
  96297. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  96298. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  96299. */
  96300. /**
  96301. * @module utils/mix
  96302. */
  96303. /**
  96304. * Copies enumerable properties and symbols from the objects given as 2nd+ parameters to the
  96305. * prototype of first object (a constructor).
  96306. *
  96307. * class Editor {
  96308. * ...
  96309. * }
  96310. *
  96311. * const SomeMixin = {
  96312. * a() {
  96313. * return 'a';
  96314. * }
  96315. * };
  96316. *
  96317. * mix( Editor, SomeMixin, ... );
  96318. *
  96319. * new Editor().a(); // -> 'a'
  96320. *
  96321. * Note: Properties which already exist in the base class will not be overriden.
  96322. *
  96323. * @param {Function} [baseClass] Class which prototype will be extended.
  96324. * @param {Object} [...mixins] Objects from which to get properties.
  96325. */
  96326. function mix( baseClass, ...mixins ) {
  96327. mixins.forEach( mixin => {
  96328. Object.getOwnPropertyNames( mixin ).concat( Object.getOwnPropertySymbols( mixin ) )
  96329. .forEach( key => {
  96330. if ( key in baseClass.prototype ) {
  96331. return;
  96332. }
  96333. const sourceDescriptor = Object.getOwnPropertyDescriptor( mixin, key );
  96334. sourceDescriptor.enumerable = false;
  96335. Object.defineProperty( baseClass.prototype, key, sourceDescriptor );
  96336. } );
  96337. } );
  96338. }
  96339. /***/ }),
  96340. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.js":
  96341. /*!*******************************************************************!*\
  96342. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.js ***!
  96343. \*******************************************************************/
  96344. /*! exports provided: default */
  96345. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96346. "use strict";
  96347. __webpack_require__.r(__webpack_exports__);
  96348. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return objectToMap; });
  96349. /**
  96350. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  96351. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  96352. */
  96353. /**
  96354. * @module utils/objecttomap
  96355. */
  96356. /**
  96357. * Transforms object to map.
  96358. *
  96359. * const map = objectToMap( { 'foo': 1, 'bar': 2 } );
  96360. * map.get( 'foo' ); // 1
  96361. *
  96362. * **Note**: For mixed data (`Object` or `Iterable`) there's a dedicated {@link module:utils/tomap~toMap} function.
  96363. *
  96364. * @param {Object} obj Object to transform.
  96365. * @returns {Map} Map created from object.
  96366. */
  96367. function objectToMap( obj ) {
  96368. const map = new Map();
  96369. for ( const key in obj ) {
  96370. map.set( key, obj[ key ] );
  96371. }
  96372. return map;
  96373. }
  96374. /***/ }),
  96375. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js":
  96376. /*!***********************************************************************!*\
  96377. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js ***!
  96378. \***********************************************************************/
  96379. /*! exports provided: default */
  96380. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96381. "use strict";
  96382. __webpack_require__.r(__webpack_exports__);
  96383. /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  96384. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  96385. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  96386. /**
  96387. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  96388. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  96389. */
  96390. /**
  96391. * @module utils/observablemixin
  96392. */
  96393. const observablePropertiesSymbol = Symbol( 'observableProperties' );
  96394. const boundObservablesSymbol = Symbol( 'boundObservables' );
  96395. const boundPropertiesSymbol = Symbol( 'boundProperties' );
  96396. const _decoratedMethods = Symbol( 'decoratedMethods' );
  96397. const _decoratedOriginal = Symbol( 'decoratedOriginal' );
  96398. /**
  96399. * A mixin that injects the "observable properties" and data binding functionality described in the
  96400. * {@link ~Observable} interface.
  96401. *
  96402. * Read more about the concept of observables in the:
  96403. * * {@glink framework/guides/architecture/core-editor-architecture#event-system-and-observables Event system and observables}
  96404. * section of the {@glink framework/guides/architecture/core-editor-architecture Core editor architecture} guide,
  96405. * * {@glink framework/guides/deep-dive/observables Observables deep dive} guide.
  96406. *
  96407. * @mixin ObservableMixin
  96408. * @mixes module:utils/emittermixin~EmitterMixin
  96409. * @implements module:utils/observablemixin~Observable
  96410. */
  96411. const ObservableMixin = {
  96412. /**
  96413. * @inheritDoc
  96414. */
  96415. set( name, value ) {
  96416. // If the first parameter is an Object, iterate over its properties.
  96417. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["isObject"])( name ) ) {
  96418. Object.keys( name ).forEach( property => {
  96419. this.set( property, name[ property ] );
  96420. }, this );
  96421. return;
  96422. }
  96423. initObservable( this );
  96424. const properties = this[ observablePropertiesSymbol ];
  96425. if ( ( name in this ) && !properties.has( name ) ) {
  96426. /**
  96427. * Cannot override an existing property.
  96428. *
  96429. * This error is thrown when trying to {@link ~Observable#set set} a property with
  96430. * a name of an already existing property. For example:
  96431. *
  96432. * let observable = new Model();
  96433. * observable.property = 1;
  96434. * observable.set( 'property', 2 ); // throws
  96435. *
  96436. * observable.set( 'property', 1 );
  96437. * observable.set( 'property', 2 ); // ok, because this is an existing property.
  96438. *
  96439. * @error observable-set-cannot-override
  96440. */
  96441. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-set-cannot-override', this );
  96442. }
  96443. Object.defineProperty( this, name, {
  96444. enumerable: true,
  96445. configurable: true,
  96446. get() {
  96447. return properties.get( name );
  96448. },
  96449. set( value ) {
  96450. const oldValue = properties.get( name );
  96451. // Fire `set` event before the new value will be set to make it possible
  96452. // to override observable property without affecting `change` event.
  96453. // See https://github.com/ckeditor/ckeditor5-utils/issues/171.
  96454. let newValue = this.fire( 'set:' + name, name, value, oldValue );
  96455. if ( newValue === undefined ) {
  96456. newValue = value;
  96457. }
  96458. // Allow undefined as an initial value like A.define( 'x', undefined ) (#132).
  96459. // Note: When properties map has no such own property, then its value is undefined.
  96460. if ( oldValue !== newValue || !properties.has( name ) ) {
  96461. properties.set( name, newValue );
  96462. this.fire( 'change:' + name, name, newValue, oldValue );
  96463. }
  96464. }
  96465. } );
  96466. this[ name ] = value;
  96467. },
  96468. /**
  96469. * @inheritDoc
  96470. */
  96471. bind( ...bindProperties ) {
  96472. if ( !bindProperties.length || !isStringArray( bindProperties ) ) {
  96473. /**
  96474. * All properties must be strings.
  96475. *
  96476. * @error observable-bind-wrong-properties
  96477. */
  96478. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-wrong-properties', this );
  96479. }
  96480. if ( ( new Set( bindProperties ) ).size !== bindProperties.length ) {
  96481. /**
  96482. * Properties must be unique.
  96483. *
  96484. * @error observable-bind-duplicate-properties
  96485. */
  96486. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-duplicate-properties', this );
  96487. }
  96488. initObservable( this );
  96489. const boundProperties = this[ boundPropertiesSymbol ];
  96490. bindProperties.forEach( propertyName => {
  96491. if ( boundProperties.has( propertyName ) ) {
  96492. /**
  96493. * Cannot bind the same property more than once.
  96494. *
  96495. * @error observable-bind-rebind
  96496. */
  96497. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-rebind', this );
  96498. }
  96499. } );
  96500. const bindings = new Map();
  96501. // @typedef {Object} Binding
  96502. // @property {Array} property Property which is bound.
  96503. // @property {Array} to Array of observable–property components of the binding (`{ observable: ..., property: .. }`).
  96504. // @property {Array} callback A function which processes `to` components.
  96505. bindProperties.forEach( a => {
  96506. const binding = { property: a, to: [] };
  96507. boundProperties.set( a, binding );
  96508. bindings.set( a, binding );
  96509. } );
  96510. // @typedef {Object} BindChain
  96511. // @property {Function} to See {@link ~ObservableMixin#_bindTo}.
  96512. // @property {Function} toMany See {@link ~ObservableMixin#_bindToMany}.
  96513. // @property {module:utils/observablemixin~Observable} _observable The observable which initializes the binding.
  96514. // @property {Array} _bindProperties Array of `_observable` properties to be bound.
  96515. // @property {Array} _to Array of `to()` observable–properties (`{ observable: toObservable, properties: ...toProperties }`).
  96516. // @property {Map} _bindings Stores bindings to be kept in
  96517. // {@link ~ObservableMixin#_boundProperties}/{@link ~ObservableMixin#_boundObservables}
  96518. // initiated in this binding chain.
  96519. return {
  96520. to: bindTo,
  96521. toMany: bindToMany,
  96522. _observable: this,
  96523. _bindProperties: bindProperties,
  96524. _to: [],
  96525. _bindings: bindings
  96526. };
  96527. },
  96528. /**
  96529. * @inheritDoc
  96530. */
  96531. unbind( ...unbindProperties ) {
  96532. // Nothing to do here if not inited yet.
  96533. if ( !( this[ observablePropertiesSymbol ] ) ) {
  96534. return;
  96535. }
  96536. const boundProperties = this[ boundPropertiesSymbol ];
  96537. const boundObservables = this[ boundObservablesSymbol ];
  96538. if ( unbindProperties.length ) {
  96539. if ( !isStringArray( unbindProperties ) ) {
  96540. /**
  96541. * Properties must be strings.
  96542. *
  96543. * @error observable-unbind-wrong-properties
  96544. */
  96545. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-unbind-wrong-properties', this );
  96546. }
  96547. unbindProperties.forEach( propertyName => {
  96548. const binding = boundProperties.get( propertyName );
  96549. // Nothing to do if the binding is not defined
  96550. if ( !binding ) {
  96551. return;
  96552. }
  96553. let toObservable, toProperty, toProperties, toPropertyBindings;
  96554. binding.to.forEach( to => {
  96555. // TODO: ES6 destructuring.
  96556. toObservable = to[ 0 ];
  96557. toProperty = to[ 1 ];
  96558. toProperties = boundObservables.get( toObservable );
  96559. toPropertyBindings = toProperties[ toProperty ];
  96560. toPropertyBindings.delete( binding );
  96561. if ( !toPropertyBindings.size ) {
  96562. delete toProperties[ toProperty ];
  96563. }
  96564. if ( !Object.keys( toProperties ).length ) {
  96565. boundObservables.delete( toObservable );
  96566. this.stopListening( toObservable, 'change' );
  96567. }
  96568. } );
  96569. boundProperties.delete( propertyName );
  96570. } );
  96571. } else {
  96572. boundObservables.forEach( ( bindings, boundObservable ) => {
  96573. this.stopListening( boundObservable, 'change' );
  96574. } );
  96575. boundObservables.clear();
  96576. boundProperties.clear();
  96577. }
  96578. },
  96579. /**
  96580. * @inheritDoc
  96581. */
  96582. decorate( methodName ) {
  96583. const originalMethod = this[ methodName ];
  96584. if ( !originalMethod ) {
  96585. /**
  96586. * Cannot decorate an undefined method.
  96587. *
  96588. * @error observablemixin-cannot-decorate-undefined
  96589. * @param {Object} object The object which method should be decorated.
  96590. * @param {String} methodName Name of the method which does not exist.
  96591. */
  96592. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  96593. 'observablemixin-cannot-decorate-undefined',
  96594. this,
  96595. { object: this, methodName }
  96596. );
  96597. }
  96598. this.on( methodName, ( evt, args ) => {
  96599. evt.return = originalMethod.apply( this, args );
  96600. } );
  96601. this[ methodName ] = function( ...args ) {
  96602. return this.fire( methodName, args );
  96603. };
  96604. this[ methodName ][ _decoratedOriginal ] = originalMethod;
  96605. if ( !this[ _decoratedMethods ] ) {
  96606. this[ _decoratedMethods ] = [];
  96607. }
  96608. this[ _decoratedMethods ].push( methodName );
  96609. }
  96610. };
  96611. Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["extend"])( ObservableMixin, _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  96612. // Override the EmitterMixin stopListening method to be able to clean (and restore) decorated methods.
  96613. // This is needed in case of:
  96614. // 1. Have x.foo() decorated.
  96615. // 2. Call x.stopListening()
  96616. // 3. Call x.foo(). Problem: nothing happens (the original foo() method is not executed)
  96617. ObservableMixin.stopListening = function( emitter, event, callback ) {
  96618. // Removing all listeners so let's clean the decorated methods to the original state.
  96619. if ( !emitter && this[ _decoratedMethods ] ) {
  96620. for ( const methodName of this[ _decoratedMethods ] ) {
  96621. this[ methodName ] = this[ methodName ][ _decoratedOriginal ];
  96622. }
  96623. delete this[ _decoratedMethods ];
  96624. }
  96625. _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"].stopListening.call( this, emitter, event, callback );
  96626. };
  96627. /* harmony default export */ __webpack_exports__["default"] = (ObservableMixin);
  96628. // Init symbol properties needed for the observable mechanism to work.
  96629. //
  96630. // @private
  96631. // @param {module:utils/observablemixin~ObservableMixin} observable
  96632. function initObservable( observable ) {
  96633. // Do nothing if already inited.
  96634. if ( observable[ observablePropertiesSymbol ] ) {
  96635. return;
  96636. }
  96637. // The internal hash containing the observable's state.
  96638. //
  96639. // @private
  96640. // @type {Map}
  96641. Object.defineProperty( observable, observablePropertiesSymbol, {
  96642. value: new Map()
  96643. } );
  96644. // Map containing bindings to external observables. It shares the binding objects
  96645. // (`{ observable: A, property: 'a', to: ... }`) with {@link module:utils/observablemixin~ObservableMixin#_boundProperties} and
  96646. // it is used to observe external observables to update own properties accordingly.
  96647. // See {@link module:utils/observablemixin~ObservableMixin#bind}.
  96648. //
  96649. // A.bind( 'a', 'b', 'c' ).to( B, 'x', 'y', 'x' );
  96650. // console.log( A._boundObservables );
  96651. //
  96652. // Map( {
  96653. // B: {
  96654. // x: Set( [
  96655. // { observable: A, property: 'a', to: [ [ B, 'x' ] ] },
  96656. // { observable: A, property: 'c', to: [ [ B, 'x' ] ] }
  96657. // ] ),
  96658. // y: Set( [
  96659. // { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
  96660. // ] )
  96661. // }
  96662. // } )
  96663. //
  96664. // A.bind( 'd' ).to( B, 'z' ).to( C, 'w' ).as( callback );
  96665. // console.log( A._boundObservables );
  96666. //
  96667. // Map( {
  96668. // B: {
  96669. // x: Set( [
  96670. // { observable: A, property: 'a', to: [ [ B, 'x' ] ] },
  96671. // { observable: A, property: 'c', to: [ [ B, 'x' ] ] }
  96672. // ] ),
  96673. // y: Set( [
  96674. // { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
  96675. // ] ),
  96676. // z: Set( [
  96677. // { observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }
  96678. // ] )
  96679. // },
  96680. // C: {
  96681. // w: Set( [
  96682. // { observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }
  96683. // ] )
  96684. // }
  96685. // } )
  96686. //
  96687. // @private
  96688. // @type {Map}
  96689. Object.defineProperty( observable, boundObservablesSymbol, {
  96690. value: new Map()
  96691. } );
  96692. // Object that stores which properties of this observable are bound and how. It shares
  96693. // the binding objects (`{ observable: A, property: 'a', to: ... }`) with
  96694. // {@link module:utils/observablemixin~ObservableMixin#_boundObservables}. This data structure is
  96695. // a reverse of {@link module:utils/observablemixin~ObservableMixin#_boundObservables} and it is helpful for
  96696. // {@link module:utils/observablemixin~ObservableMixin#unbind}.
  96697. //
  96698. // See {@link module:utils/observablemixin~ObservableMixin#bind}.
  96699. //
  96700. // A.bind( 'a', 'b', 'c' ).to( B, 'x', 'y', 'x' );
  96701. // console.log( A._boundProperties );
  96702. //
  96703. // Map( {
  96704. // a: { observable: A, property: 'a', to: [ [ B, 'x' ] ] },
  96705. // b: { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
  96706. // c: { observable: A, property: 'c', to: [ [ B, 'x' ] ] }
  96707. // } )
  96708. //
  96709. // A.bind( 'd' ).to( B, 'z' ).to( C, 'w' ).as( callback );
  96710. // console.log( A._boundProperties );
  96711. //
  96712. // Map( {
  96713. // a: { observable: A, property: 'a', to: [ [ B, 'x' ] ] },
  96714. // b: { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
  96715. // c: { observable: A, property: 'c', to: [ [ B, 'x' ] ] },
  96716. // d: { observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }
  96717. // } )
  96718. //
  96719. // @private
  96720. // @type {Map}
  96721. Object.defineProperty( observable, boundPropertiesSymbol, {
  96722. value: new Map()
  96723. } );
  96724. }
  96725. // A chaining for {@link module:utils/observablemixin~ObservableMixin#bind} providing `.to()` interface.
  96726. //
  96727. // @private
  96728. // @param {...[Observable|String|Function]} args Arguments of the `.to( args )` binding.
  96729. function bindTo( ...args ) {
  96730. const parsedArgs = parseBindToArgs( ...args );
  96731. const bindingsKeys = Array.from( this._bindings.keys() );
  96732. const numberOfBindings = bindingsKeys.length;
  96733. // Eliminate A.bind( 'x' ).to( B, C )
  96734. if ( !parsedArgs.callback && parsedArgs.to.length > 1 ) {
  96735. /**
  96736. * Binding multiple observables only possible with callback.
  96737. *
  96738. * @error observable-bind-to-no-callback
  96739. */
  96740. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-no-callback', this );
  96741. }
  96742. // Eliminate A.bind( 'x', 'y' ).to( B, callback )
  96743. if ( numberOfBindings > 1 && parsedArgs.callback ) {
  96744. /**
  96745. * Cannot bind multiple properties and use a callback in one binding.
  96746. *
  96747. * @error observable-bind-to-extra-callback
  96748. */
  96749. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  96750. 'observable-bind-to-extra-callback',
  96751. this
  96752. );
  96753. }
  96754. parsedArgs.to.forEach( to => {
  96755. // Eliminate A.bind( 'x', 'y' ).to( B, 'a' )
  96756. if ( to.properties.length && to.properties.length !== numberOfBindings ) {
  96757. /**
  96758. * The number of properties must match.
  96759. *
  96760. * @error observable-bind-to-properties-length
  96761. */
  96762. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-properties-length', this );
  96763. }
  96764. // When no to.properties specified, observing source properties instead i.e.
  96765. // A.bind( 'x', 'y' ).to( B ) -> Observe B.x and B.y
  96766. if ( !to.properties.length ) {
  96767. to.properties = this._bindProperties;
  96768. }
  96769. } );
  96770. this._to = parsedArgs.to;
  96771. // Fill {@link BindChain#_bindings} with callback. When the callback is set there's only one binding.
  96772. if ( parsedArgs.callback ) {
  96773. this._bindings.get( bindingsKeys[ 0 ] ).callback = parsedArgs.callback;
  96774. }
  96775. attachBindToListeners( this._observable, this._to );
  96776. // Update observable._boundProperties and observable._boundObservables.
  96777. updateBindToBound( this );
  96778. // Set initial values of bound properties.
  96779. this._bindProperties.forEach( propertyName => {
  96780. updateBoundObservableProperty( this._observable, propertyName );
  96781. } );
  96782. }
  96783. // Binds to an attribute in a set of iterable observables.
  96784. //
  96785. // @private
  96786. // @param {Array.<Observable>} observables
  96787. // @param {String} attribute
  96788. // @param {Function} callback
  96789. function bindToMany( observables, attribute, callback ) {
  96790. if ( this._bindings.size > 1 ) {
  96791. /**
  96792. * Binding one attribute to many observables only possible with one attribute.
  96793. *
  96794. * @error observable-bind-to-many-not-one-binding
  96795. */
  96796. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-many-not-one-binding', this );
  96797. }
  96798. this.to(
  96799. // Bind to #attribute of each observable...
  96800. ...getBindingTargets( observables, attribute ),
  96801. // ...using given callback to parse attribute values.
  96802. callback
  96803. );
  96804. }
  96805. // Returns an array of binding components for
  96806. // {@link Observable#bind} from a set of iterable observables.
  96807. //
  96808. // @param {Array.<Observable>} observables
  96809. // @param {String} attribute
  96810. // @returns {Array.<String|Observable>}
  96811. function getBindingTargets( observables, attribute ) {
  96812. const observableAndAttributePairs = observables.map( observable => [ observable, attribute ] );
  96813. // Merge pairs to one-dimension array of observables and attributes.
  96814. return Array.prototype.concat.apply( [], observableAndAttributePairs );
  96815. }
  96816. // Check if all entries of the array are of `String` type.
  96817. //
  96818. // @private
  96819. // @param {Array} arr An array to be checked.
  96820. // @returns {Boolean}
  96821. function isStringArray( arr ) {
  96822. return arr.every( a => typeof a == 'string' );
  96823. }
  96824. // Parses and validates {@link Observable#bind}`.to( args )` arguments and returns
  96825. // an object with a parsed structure. For example
  96826. //
  96827. // A.bind( 'x' ).to( B, 'a', C, 'b', call );
  96828. //
  96829. // becomes
  96830. //
  96831. // {
  96832. // to: [
  96833. // { observable: B, properties: [ 'a' ] },
  96834. // { observable: C, properties: [ 'b' ] },
  96835. // ],
  96836. // callback: call
  96837. // }
  96838. //
  96839. // @private
  96840. // @param {...*} args Arguments of {@link Observable#bind}`.to( args )`.
  96841. // @returns {Object}
  96842. function parseBindToArgs( ...args ) {
  96843. // Eliminate A.bind( 'x' ).to()
  96844. if ( !args.length ) {
  96845. /**
  96846. * Invalid argument syntax in `to()`.
  96847. *
  96848. * @error observable-bind-to-parse-error
  96849. */
  96850. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-parse-error', null );
  96851. }
  96852. const parsed = { to: [] };
  96853. let lastObservable;
  96854. if ( typeof args[ args.length - 1 ] == 'function' ) {
  96855. parsed.callback = args.pop();
  96856. }
  96857. args.forEach( a => {
  96858. if ( typeof a == 'string' ) {
  96859. lastObservable.properties.push( a );
  96860. } else if ( typeof a == 'object' ) {
  96861. lastObservable = { observable: a, properties: [] };
  96862. parsed.to.push( lastObservable );
  96863. } else {
  96864. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-parse-error', null );
  96865. }
  96866. } );
  96867. return parsed;
  96868. }
  96869. // Synchronizes {@link module:utils/observablemixin#_boundObservables} with {@link Binding}.
  96870. //
  96871. // @private
  96872. // @param {Binding} binding A binding to store in {@link Observable#_boundObservables}.
  96873. // @param {Observable} toObservable A observable, which is a new component of `binding`.
  96874. // @param {String} toPropertyName A name of `toObservable`'s property, a new component of the `binding`.
  96875. function updateBoundObservables( observable, binding, toObservable, toPropertyName ) {
  96876. const boundObservables = observable[ boundObservablesSymbol ];
  96877. const bindingsToObservable = boundObservables.get( toObservable );
  96878. const bindings = bindingsToObservable || {};
  96879. if ( !bindings[ toPropertyName ] ) {
  96880. bindings[ toPropertyName ] = new Set();
  96881. }
  96882. // Pass the binding to a corresponding Set in `observable._boundObservables`.
  96883. bindings[ toPropertyName ].add( binding );
  96884. if ( !bindingsToObservable ) {
  96885. boundObservables.set( toObservable, bindings );
  96886. }
  96887. }
  96888. // Synchronizes {@link Observable#_boundProperties} and {@link Observable#_boundObservables}
  96889. // with {@link BindChain}.
  96890. //
  96891. // Assuming the following binding being created
  96892. //
  96893. // A.bind( 'a', 'b' ).to( B, 'x', 'y' );
  96894. //
  96895. // the following bindings were initialized by {@link Observable#bind} in {@link BindChain#_bindings}:
  96896. //
  96897. // {
  96898. // a: { observable: A, property: 'a', to: [] },
  96899. // b: { observable: A, property: 'b', to: [] },
  96900. // }
  96901. //
  96902. // Iterate over all bindings in this chain and fill their `to` properties with
  96903. // corresponding to( ... ) arguments (components of the binding), so
  96904. //
  96905. // {
  96906. // a: { observable: A, property: 'a', to: [ B, 'x' ] },
  96907. // b: { observable: A, property: 'b', to: [ B, 'y' ] },
  96908. // }
  96909. //
  96910. // Then update the structure of {@link Observable#_boundObservables} with updated
  96911. // binding, so it becomes:
  96912. //
  96913. // Map( {
  96914. // B: {
  96915. // x: Set( [
  96916. // { observable: A, property: 'a', to: [ [ B, 'x' ] ] }
  96917. // ] ),
  96918. // y: Set( [
  96919. // { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
  96920. // ] )
  96921. // }
  96922. // } )
  96923. //
  96924. // @private
  96925. // @param {BindChain} chain The binding initialized by {@link Observable#bind}.
  96926. function updateBindToBound( chain ) {
  96927. let toProperty;
  96928. chain._bindings.forEach( ( binding, propertyName ) => {
  96929. // Note: For a binding without a callback, this will run only once
  96930. // like in A.bind( 'x', 'y' ).to( B, 'a', 'b' )
  96931. // TODO: ES6 destructuring.
  96932. chain._to.forEach( to => {
  96933. toProperty = to.properties[ binding.callback ? 0 : chain._bindProperties.indexOf( propertyName ) ];
  96934. binding.to.push( [ to.observable, toProperty ] );
  96935. updateBoundObservables( chain._observable, binding, to.observable, toProperty );
  96936. } );
  96937. } );
  96938. }
  96939. // Updates an property of a {@link Observable} with a value
  96940. // determined by an entry in {@link Observable#_boundProperties}.
  96941. //
  96942. // @private
  96943. // @param {Observable} observable A observable which property is to be updated.
  96944. // @param {String} propertyName An property to be updated.
  96945. function updateBoundObservableProperty( observable, propertyName ) {
  96946. const boundProperties = observable[ boundPropertiesSymbol ];
  96947. const binding = boundProperties.get( propertyName );
  96948. let propertyValue;
  96949. // When a binding with callback is created like
  96950. //
  96951. // A.bind( 'a' ).to( B, 'b', C, 'c', callback );
  96952. //
  96953. // collect B.b and C.c, then pass them to callback to set A.a.
  96954. if ( binding.callback ) {
  96955. propertyValue = binding.callback.apply( observable, binding.to.map( to => to[ 0 ][ to[ 1 ] ] ) );
  96956. } else {
  96957. propertyValue = binding.to[ 0 ];
  96958. propertyValue = propertyValue[ 0 ][ propertyValue[ 1 ] ];
  96959. }
  96960. if ( Object.prototype.hasOwnProperty.call( observable, propertyName ) ) {
  96961. observable[ propertyName ] = propertyValue;
  96962. } else {
  96963. observable.set( propertyName, propertyValue );
  96964. }
  96965. }
  96966. // Starts listening to changes in {@link BindChain._to} observables to update
  96967. // {@link BindChain._observable} {@link BindChain._bindProperties}. Also sets the
  96968. // initial state of {@link BindChain._observable}.
  96969. //
  96970. // @private
  96971. // @param {BindChain} chain The chain initialized by {@link Observable#bind}.
  96972. function attachBindToListeners( observable, toBindings ) {
  96973. toBindings.forEach( to => {
  96974. const boundObservables = observable[ boundObservablesSymbol ];
  96975. let bindings;
  96976. // If there's already a chain between the observables (`observable` listens to
  96977. // `to.observable`), there's no need to create another `change` event listener.
  96978. if ( !boundObservables.get( to.observable ) ) {
  96979. observable.listenTo( to.observable, 'change', ( evt, propertyName ) => {
  96980. bindings = boundObservables.get( to.observable )[ propertyName ];
  96981. // Note: to.observable will fire for any property change, react
  96982. // to changes of properties which are bound only.
  96983. if ( bindings ) {
  96984. bindings.forEach( binding => {
  96985. updateBoundObservableProperty( observable, binding.property );
  96986. } );
  96987. }
  96988. } );
  96989. }
  96990. } );
  96991. }
  96992. /**
  96993. * An interface which adds "observable properties" and data binding functionality.
  96994. *
  96995. * Can be easily implemented by a class by mixing the {@link module:utils/observablemixin~ObservableMixin} mixin.
  96996. *
  96997. * Read more about the usage of this interface in the:
  96998. * * {@glink framework/guides/architecture/core-editor-architecture#event-system-and-observables Event system and observables}
  96999. * section of the {@glink framework/guides/architecture/core-editor-architecture Core editor architecture} guide,
  97000. * * {@glink framework/guides/deep-dive/observables Observables deep dive} guide.
  97001. *
  97002. * @interface Observable
  97003. * @extends module:utils/emittermixin~Emitter
  97004. */
  97005. /**
  97006. * Fired when a property changed value.
  97007. *
  97008. * observable.set( 'prop', 1 );
  97009. *
  97010. * observable.on( 'change:prop', ( evt, propertyName, newValue, oldValue ) => {
  97011. * console.log( `${ propertyName } has changed from ${ oldValue } to ${ newValue }` );
  97012. * } );
  97013. *
  97014. * observable.prop = 2; // -> 'prop has changed from 1 to 2'
  97015. *
  97016. * @event change:{property}
  97017. * @param {String} name The property name.
  97018. * @param {*} value The new property value.
  97019. * @param {*} oldValue The previous property value.
  97020. */
  97021. /**
  97022. * Fired when a property value is going to be set but is not set yet (before the `change` event is fired).
  97023. *
  97024. * You can control the final value of the property by using
  97025. * the {@link module:utils/eventinfo~EventInfo#return event's `return` property}.
  97026. *
  97027. * observable.set( 'prop', 1 );
  97028. *
  97029. * observable.on( 'set:prop', ( evt, propertyName, newValue, oldValue ) => {
  97030. * console.log( `Value is going to be changed from ${ oldValue } to ${ newValue }` );
  97031. * console.log( `Current property value is ${ observable[ propertyName ] }` );
  97032. *
  97033. * // Let's override the value.
  97034. * evt.return = 3;
  97035. * } );
  97036. *
  97037. * observable.on( 'change:prop', ( evt, propertyName, newValue, oldValue ) => {
  97038. * console.log( `Value has changed from ${ oldValue } to ${ newValue }` );
  97039. * } );
  97040. *
  97041. * observable.prop = 2; // -> 'Value is going to be changed from 1 to 2'
  97042. * // -> 'Current property value is 1'
  97043. * // -> 'Value has changed from 1 to 3'
  97044. *
  97045. * **Note:** The event is fired even when the new value is the same as the old value.
  97046. *
  97047. * @event set:{property}
  97048. * @param {String} name The property name.
  97049. * @param {*} value The new property value.
  97050. * @param {*} oldValue The previous property value.
  97051. */
  97052. /**
  97053. * Creates and sets the value of an observable property of this object. Such a property becomes a part
  97054. * of the state and is observable.
  97055. *
  97056. * It accepts also a single object literal containing key/value pairs with properties to be set.
  97057. *
  97058. * This method throws the `observable-set-cannot-override` error if the observable instance already
  97059. * has a property with the given property name. This prevents from mistakenly overriding existing
  97060. * properties and methods, but means that `foo.set( 'bar', 1 )` may be slightly slower than `foo.bar = 1`.
  97061. *
  97062. * @method #set
  97063. * @param {String|Object} name The property's name or object with `name=>value` pairs.
  97064. * @param {*} [value] The property's value (if `name` was passed in the first parameter).
  97065. */
  97066. /**
  97067. * Binds {@link #set observable properties} to other objects implementing the
  97068. * {@link module:utils/observablemixin~Observable} interface.
  97069. *
  97070. * Read more in the {@glink framework/guides/deep-dive/observables#property-bindings dedicated guide}
  97071. * covering the topic of property bindings with some additional examples.
  97072. *
  97073. * Consider two objects: a `button` and an associated `command` (both `Observable`).
  97074. *
  97075. * A simple property binding could be as follows:
  97076. *
  97077. * button.bind( 'isEnabled' ).to( command, 'isEnabled' );
  97078. *
  97079. * or even shorter:
  97080. *
  97081. * button.bind( 'isEnabled' ).to( command );
  97082. *
  97083. * which works in the following way:
  97084. *
  97085. * * `button.isEnabled` **instantly equals** `command.isEnabled`,
  97086. * * whenever `command.isEnabled` changes, `button.isEnabled` will immediately reflect its value.
  97087. *
  97088. * **Note**: To release the binding, use {@link module:utils/observablemixin~Observable#unbind}.
  97089. *
  97090. * You can also "rename" the property in the binding by specifying the new name in the `to()` chain:
  97091. *
  97092. * button.bind( 'isEnabled' ).to( command, 'isWorking' );
  97093. *
  97094. * It is possible to bind more than one property at a time to shorten the code:
  97095. *
  97096. * button.bind( 'isEnabled', 'value' ).to( command );
  97097. *
  97098. * which corresponds to:
  97099. *
  97100. * button.bind( 'isEnabled' ).to( command );
  97101. * button.bind( 'value' ).to( command );
  97102. *
  97103. * The binding can include more than one observable, combining multiple data sources in a custom callback:
  97104. *
  97105. * button.bind( 'isEnabled' ).to( command, 'isEnabled', ui, 'isVisible',
  97106. * ( isCommandEnabled, isUIVisible ) => isCommandEnabled && isUIVisible );
  97107. *
  97108. * Using a custom callback allows processing the value before passing it to the target property:
  97109. *
  97110. * button.bind( 'isEnabled' ).to( command, 'value', value => value === 'heading1' );
  97111. *
  97112. * It is also possible to bind to the same property in an array of observables.
  97113. * To bind a `button` to multiple commands (also `Observables`) so that each and every one of them
  97114. * must be enabled for the button to become enabled, use the following code:
  97115. *
  97116. * button.bind( 'isEnabled' ).toMany( [ commandA, commandB, commandC ], 'isEnabled',
  97117. * ( isAEnabled, isBEnabled, isCEnabled ) => isAEnabled && isBEnabled && isCEnabled );
  97118. *
  97119. * @method #bind
  97120. * @param {...String} bindProperties Observable properties that will be bound to other observable(s).
  97121. * @returns {Object} The bind chain with the `to()` and `toMany()` methods.
  97122. */
  97123. /**
  97124. * Removes the binding created with {@link #bind}.
  97125. *
  97126. * // Removes the binding for the 'a' property.
  97127. * A.unbind( 'a' );
  97128. *
  97129. * // Removes bindings for all properties.
  97130. * A.unbind();
  97131. *
  97132. * @method #unbind
  97133. * @param {...String} [unbindProperties] Observable properties to be unbound. All the bindings will
  97134. * be released if no properties are provided.
  97135. */
  97136. /**
  97137. * Turns the given methods of this object into event-based ones. This means that the new method will fire an event
  97138. * (named after the method) and the original action will be plugged as a listener to that event.
  97139. *
  97140. * Read more in the {@glink framework/guides/deep-dive/observables#decorating-object-methods dedicated guide}
  97141. * covering the topic of decorating methods with some additional examples.
  97142. *
  97143. * Decorating the method does not change its behavior (it only adds an event),
  97144. * but it allows to modify it later on by listening to the method's event.
  97145. *
  97146. * For example, to cancel the method execution the event can be {@link module:utils/eventinfo~EventInfo#stop stopped}:
  97147. *
  97148. * class Foo {
  97149. * constructor() {
  97150. * this.decorate( 'method' );
  97151. * }
  97152. *
  97153. * method() {
  97154. * console.log( 'called!' );
  97155. * }
  97156. * }
  97157. *
  97158. * const foo = new Foo();
  97159. * foo.on( 'method', ( evt ) => {
  97160. * evt.stop();
  97161. * }, { priority: 'high' } );
  97162. *
  97163. * foo.method(); // Nothing is logged.
  97164. *
  97165. *
  97166. * **Note**: The high {@link module:utils/priorities~PriorityString priority} listener
  97167. * has been used to execute this particular callback before the one which calls the original method
  97168. * (which uses the "normal" priority).
  97169. *
  97170. * It is also possible to change the returned value:
  97171. *
  97172. * foo.on( 'method', ( evt ) => {
  97173. * evt.return = 'Foo!';
  97174. * } );
  97175. *
  97176. * foo.method(); // -> 'Foo'
  97177. *
  97178. * Finally, it is possible to access and modify the arguments the method is called with:
  97179. *
  97180. * method( a, b ) {
  97181. * console.log( `${ a }, ${ b }` );
  97182. * }
  97183. *
  97184. * // ...
  97185. *
  97186. * foo.on( 'method', ( evt, args ) => {
  97187. * args[ 0 ] = 3;
  97188. *
  97189. * console.log( args[ 1 ] ); // -> 2
  97190. * }, { priority: 'high' } );
  97191. *
  97192. * foo.method( 1, 2 ); // -> '3, 2'
  97193. *
  97194. * @method #decorate
  97195. * @param {String} methodName Name of the method to decorate.
  97196. */
  97197. /***/ }),
  97198. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js":
  97199. /*!******************************************************************!*\
  97200. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js ***!
  97201. \******************************************************************/
  97202. /*! exports provided: default */
  97203. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97204. "use strict";
  97205. __webpack_require__.r(__webpack_exports__);
  97206. /**
  97207. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97208. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97209. */
  97210. /**
  97211. * @module utils/priorities
  97212. */
  97213. /**
  97214. * String representing a priority value.
  97215. *
  97216. * @typedef {'highest'|'high'|'normal'|'low'|'lowest'} module:utils/priorities~PriorityString
  97217. */
  97218. /**
  97219. * Provides group of constants to use instead of hardcoding numeric priority values.
  97220. *
  97221. * @namespace
  97222. */
  97223. const priorities = {
  97224. /**
  97225. * Converts a string with priority name to it's numeric value. If `Number` is given, it just returns it.
  97226. *
  97227. * @static
  97228. * @param {module:utils/priorities~PriorityString|Number} priority Priority to convert.
  97229. * @returns {Number} Converted priority.
  97230. */
  97231. get( priority ) {
  97232. if ( typeof priority != 'number' ) {
  97233. return this[ priority ] || this.normal;
  97234. } else {
  97235. return priority;
  97236. }
  97237. },
  97238. highest: 100000,
  97239. high: 1000,
  97240. normal: 0,
  97241. low: -1000,
  97242. lowest: -100000
  97243. };
  97244. /* harmony default export */ __webpack_exports__["default"] = (priorities);
  97245. /***/ }),
  97246. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/spy.js":
  97247. /*!***********************************************************!*\
  97248. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/spy.js ***!
  97249. \***********************************************************/
  97250. /*! exports provided: default */
  97251. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97252. "use strict";
  97253. __webpack_require__.r(__webpack_exports__);
  97254. /**
  97255. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97256. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97257. */
  97258. /**
  97259. * @module utils/spy
  97260. */
  97261. /**
  97262. * Creates a spy function (ala Sinon.js) that can be used to inspect call to it.
  97263. *
  97264. * The following are the present features:
  97265. *
  97266. * * spy.called: property set to `true` if the function has been called at least once.
  97267. *
  97268. * @returns {Function} The spy function.
  97269. */
  97270. function spy() {
  97271. return function spy() {
  97272. spy.called = true;
  97273. };
  97274. }
  97275. /* harmony default export */ __webpack_exports__["default"] = (spy);
  97276. /***/ }),
  97277. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js":
  97278. /*!***************************************************************!*\
  97279. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js ***!
  97280. \***************************************************************/
  97281. /*! exports provided: default */
  97282. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97283. "use strict";
  97284. __webpack_require__.r(__webpack_exports__);
  97285. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return toArray; });
  97286. /**
  97287. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97288. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97289. */
  97290. /**
  97291. * @module utils/toarray
  97292. */
  97293. /**
  97294. * Transforms any value to an array. If the provided value is already an array, it is returned unchanged.
  97295. *
  97296. * @param {*} data The value to transform to an array.
  97297. * @returns {Array} An array created from data.
  97298. */
  97299. function toArray( data ) {
  97300. return Array.isArray( data ) ? data : [ data ];
  97301. }
  97302. /***/ }),
  97303. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js":
  97304. /*!*************************************************************!*\
  97305. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js ***!
  97306. \*************************************************************/
  97307. /*! exports provided: default */
  97308. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97309. "use strict";
  97310. __webpack_require__.r(__webpack_exports__);
  97311. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return toMap; });
  97312. /* harmony import */ var _objecttomap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./objecttomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.js");
  97313. /* harmony import */ var _isiterable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  97314. /**
  97315. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97316. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97317. */
  97318. /**
  97319. * @module utils/tomap
  97320. */
  97321. /**
  97322. * Transforms object or iterable to map. Iterable needs to be in the format acceptable by the `Map` constructor.
  97323. *
  97324. * map = toMap( { 'foo': 1, 'bar': 2 } );
  97325. * map = toMap( [ [ 'foo', 1 ], [ 'bar', 2 ] ] );
  97326. * map = toMap( anotherMap );
  97327. *
  97328. * @param {Object|Iterable} data Object or iterable to transform.
  97329. * @returns {Map} Map created from data.
  97330. */
  97331. function toMap( data ) {
  97332. if ( Object(_isiterable__WEBPACK_IMPORTED_MODULE_1__["default"])( data ) ) {
  97333. return new Map( data );
  97334. } else {
  97335. return Object(_objecttomap__WEBPACK_IMPORTED_MODULE_0__["default"])( data );
  97336. }
  97337. }
  97338. /***/ }),
  97339. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/translation-service.js":
  97340. /*!***************************************************************************!*\
  97341. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/translation-service.js ***!
  97342. \***************************************************************************/
  97343. /*! exports provided: add, _translate, _clear */
  97344. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97345. "use strict";
  97346. __webpack_require__.r(__webpack_exports__);
  97347. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  97348. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_translate", function() { return _translate; });
  97349. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_clear", function() { return _clear; });
  97350. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  97351. /**
  97352. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97353. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97354. */
  97355. /* globals window */
  97356. /**
  97357. * @module utils/translation-service
  97358. */
  97359. /* istanbul ignore else */
  97360. if ( !window.CKEDITOR_TRANSLATIONS ) {
  97361. window.CKEDITOR_TRANSLATIONS = {};
  97362. }
  97363. /**
  97364. * Adds translations to existing ones or overrides the existing translations. These translations will later
  97365. * be available for the {@link module:utils/locale~Locale#t `t()`} function.
  97366. *
  97367. * The `translations` is an object which consists of `messageId: translation` pairs. Note that the message ID can be
  97368. * either constructed from the message string or from the message ID if it was passed
  97369. * (this happens rarely and mostly for short messages or messages with placeholders).
  97370. * Since the editor displays only the message string, the message ID can be found either in the source code or in the
  97371. * built translations for another language.
  97372. *
  97373. * add( 'pl', {
  97374. * 'Cancel': 'Anuluj',
  97375. * 'IMAGE': 'obraz', // Note that the `IMAGE` comes from the message ID, while the string can be `image`.
  97376. * } );
  97377. *
  97378. * If the message is supposed to support various plural forms, make sure to provide an array with the singular form and all plural forms:
  97379. *
  97380. * add( 'pl', {
  97381. * 'Add space': [ 'Dodaj spację', 'Dodaj %0 spacje', 'Dodaj %0 spacji' ]
  97382. * } );
  97383. *
  97384. * You should also specify the third argument (the `getPluralForm()` function) that will be used to determine the plural form if no
  97385. * language file was loaded for that language. All language files coming from CKEditor 5 sources will have this option set, so
  97386. * these plural form rules will be reused by other translations added to the registered languages. The `getPluralForm()` function
  97387. * can return either a Boolean or a number.
  97388. *
  97389. * add( 'en', {
  97390. * // ... Translations.
  97391. * }, n => n !== 1 );
  97392. * add( 'pl', {
  97393. * // ... Translations.
  97394. * }, n => n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && ( n % 100 < 10 || n % 100 >= 20 ) ? 1 : 2 );
  97395. *
  97396. * All translations extend the global `window.CKEDITOR_TRANSLATIONS` object. An example of this object can be found below:
  97397. *
  97398. * {
  97399. * pl: {
  97400. * dictionary: {
  97401. * 'Cancel': 'Anuluj',
  97402. * 'Add space': [ 'Dodaj spację', 'Dodaj %0 spacje', 'Dodaj %0 spacji' ]
  97403. * },
  97404. * // A function that returns the plural form index.
  97405. * getPluralForm: n => n !==1
  97406. * }
  97407. * // Other languages.
  97408. * }
  97409. *
  97410. * If you cannot import this function from this module (e.g. because you use a CKEditor 5 build), you can
  97411. * still add translations by extending the global `window.CKEDITOR_TRANSLATIONS` object by using a function like
  97412. * the one below:
  97413. *
  97414. * function addTranslations( language, translations, getPluralForm ) {
  97415. * if ( !window.CKEDITOR_TRANSLATIONS ) {
  97416. * window.CKEDITOR_TRANSLATIONS = {};
  97417. * }
  97418. * if ( !window.CKEDITOR_TRANSLATIONS[ language ] ) {
  97419. * window.CKEDITOR_TRANSLATIONS[ language ] = {};
  97420. * }
  97421. *
  97422. * const languageTranslations = window.CKEDITOR_TRANSLATIONS[ language ];
  97423. *
  97424. * languageTranslations.dictionary = languageTranslations.dictionary || {};
  97425. * languageTranslations.getPluralForm = getPluralForm || languageTranslations.getPluralForm;
  97426. *
  97427. * // Extend the dictionary for the given language.
  97428. * Object.assign( languageTranslations.dictionary, translations );
  97429. * }
  97430. *
  97431. * @param {String} language Target language.
  97432. * @param {Object.<String,*>} translations An object with translations which will be added to the dictionary.
  97433. * For each message ID the value should be either a translation or an array of translations if the message
  97434. * should support plural forms.
  97435. * @param {Function} getPluralForm A function that returns the plural form index (a number).
  97436. */
  97437. function add( language, translations, getPluralForm ) {
  97438. if ( !window.CKEDITOR_TRANSLATIONS[ language ] ) {
  97439. window.CKEDITOR_TRANSLATIONS[ language ] = {};
  97440. }
  97441. const languageTranslations = window.CKEDITOR_TRANSLATIONS[ language ];
  97442. languageTranslations.dictionary = languageTranslations.dictionary || {};
  97443. languageTranslations.getPluralForm = getPluralForm || languageTranslations.getPluralForm;
  97444. Object.assign( languageTranslations.dictionary, translations );
  97445. }
  97446. /**
  97447. * **Note:** This method is internal, use {@link module:utils/locale~Locale#t the `t()` function} instead to translate
  97448. * the editor UI parts.
  97449. *
  97450. * This function is responsible for translating messages to the specified language. It uses translations added perviously
  97451. * by {@link module:utils/translation-service~add} (a translations dictionary and the `getPluralForm()` function
  97452. * to provide accurate translations of plural forms).
  97453. *
  97454. * When no translation is defined in the dictionary or the dictionary does not exist, this function returns
  97455. * the original message string or the message plural depending on the number of elements.
  97456. *
  97457. * translate( 'pl', { string: 'Cancel' } ); // 'Cancel'
  97458. *
  97459. * The third optional argument is the number of elements, based on which the single form or one of the plural forms
  97460. * should be picked when the message is supposed to support various plural forms.
  97461. *
  97462. * translate( 'en', { string: 'Add a space', plural: 'Add %0 spaces' }, 1 ); // 'Add a space'
  97463. * translate( 'en', { string: 'Add a space', plural: 'Add %0 spaces' }, 3 ); // 'Add %0 spaces'
  97464. *
  97465. * The message should provide an ID using the `id` property when the message strings are not unique and their
  97466. * translations should be different.
  97467. *
  97468. * translate( 'en', { string: 'image', id: 'ADD_IMAGE' } );
  97469. * translate( 'en', { string: 'image', id: 'AN_IMAGE' } );
  97470. *
  97471. * @protected
  97472. * @param {String} language Target language.
  97473. * @param {module:utils/translation-service~Message} message A message that will be translated.
  97474. * @param {Number} [quantity] The number of elements for which a plural form should be picked from the target language dictionary.
  97475. * @returns {String} Translated sentence.
  97476. */
  97477. function _translate( language, message, quantity = 1 ) {
  97478. if ( typeof quantity !== 'number' ) {
  97479. /**
  97480. * An incorrect value was passed to the translation function. This was probably caused
  97481. * by an incorrect message interpolation of a plural form. Note that for messages supporting plural forms
  97482. * the second argument of the `t()` function should always be a number or an array with a number as the first element.
  97483. *
  97484. * @error translation-service-quantity-not-a-number
  97485. */
  97486. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'translation-service-quantity-not-a-number', null, { quantity } );
  97487. }
  97488. const numberOfLanguages = getNumberOfLanguages();
  97489. if ( numberOfLanguages === 1 ) {
  97490. // Override the language to the only supported one.
  97491. // This can't be done in the `Locale` class, because the translations comes after the `Locale` class initialization.
  97492. language = Object.keys( window.CKEDITOR_TRANSLATIONS )[ 0 ];
  97493. }
  97494. const messageId = message.id || message.string;
  97495. if ( numberOfLanguages === 0 || !hasTranslation( language, messageId ) ) {
  97496. if ( quantity !== 1 ) {
  97497. // Return the default plural form that was passed in the `message.plural` parameter.
  97498. return message.plural;
  97499. }
  97500. return message.string;
  97501. }
  97502. const dictionary = window.CKEDITOR_TRANSLATIONS[ language ].dictionary;
  97503. const getPluralForm = window.CKEDITOR_TRANSLATIONS[ language ].getPluralForm || ( n => n === 1 ? 0 : 1 );
  97504. if ( typeof dictionary[ messageId ] === 'string' ) {
  97505. return dictionary[ messageId ];
  97506. }
  97507. const pluralFormIndex = Number( getPluralForm( quantity ) );
  97508. // Note: The `translate` function is not responsible for replacing `%0, %1, ...` with values.
  97509. return dictionary[ messageId ][ pluralFormIndex ];
  97510. }
  97511. /**
  97512. * Clears dictionaries for test purposes.
  97513. *
  97514. * @protected
  97515. */
  97516. function _clear() {
  97517. window.CKEDITOR_TRANSLATIONS = {};
  97518. }
  97519. // Checks whether the dictionary exists and translation in that dictionary exists.
  97520. function hasTranslation( language, messageId ) {
  97521. return (
  97522. !!window.CKEDITOR_TRANSLATIONS[ language ] &&
  97523. !!window.CKEDITOR_TRANSLATIONS[ language ].dictionary[ messageId ]
  97524. );
  97525. }
  97526. function getNumberOfLanguages() {
  97527. return Object.keys( window.CKEDITOR_TRANSLATIONS ).length;
  97528. }
  97529. /**
  97530. * The internationalization message interface. A message that implements this interface can be passed to the `t()` function
  97531. * to be translated to the target UI language.
  97532. *
  97533. * @typedef {Object} module:utils/translation-service~Message
  97534. *
  97535. * @property {String} string The message string to translate. Acts as a default translation if the translation for a given language
  97536. * is not defined. When the message is supposed to support plural forms, the string should be the English singular form of the message.
  97537. * @property {String} [id] The message ID. If passed, the message ID is taken from this property instead of the `message.string`.
  97538. * This property is useful when various messages share the same message string, for example, the `editor` string in `in the editor`
  97539. * and `my editor` sentences.
  97540. * @property {String} [plural] The plural form of the message. This property should be skipped when a message is not supposed
  97541. * to support plural forms. Otherwise it should always be set to a string with the English plural form of the message.
  97542. */
  97543. /***/ }),
  97544. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js":
  97545. /*!***********************************************************!*\
  97546. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/uid.js ***!
  97547. \***********************************************************/
  97548. /*! exports provided: default */
  97549. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97550. "use strict";
  97551. __webpack_require__.r(__webpack_exports__);
  97552. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return uid; });
  97553. /**
  97554. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97555. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97556. */
  97557. /**
  97558. * @module utils/uid
  97559. */
  97560. // A hash table of hex numbers to avoid using toString() in uid() which is costly.
  97561. // [ '00', '01', '02', ..., 'fe', 'ff' ]
  97562. const HEX_NUMBERS = new Array( 256 ).fill()
  97563. .map( ( val, index ) => ( '0' + ( index ).toString( 16 ) ).slice( -2 ) );
  97564. /**
  97565. * Returns a unique id. The id starts with an "e" character and a randomly generated string of
  97566. * 32 alphanumeric characters.
  97567. *
  97568. * **Note**: The characters the unique id is built from correspond to the hex number notation
  97569. * (from "0" to "9", from "a" to "f"). In other words, each id corresponds to an "e" followed
  97570. * by 16 8-bit numbers next to each other.
  97571. *
  97572. * @returns {String} An unique id string.
  97573. */
  97574. function uid() {
  97575. // Let's create some positive random 32bit integers first.
  97576. //
  97577. // 1. Math.random() is a float between 0 and 1.
  97578. // 2. 0x100000000 is 2^32 = 4294967296.
  97579. // 3. >>> 0 enforces integer (in JS all numbers are floating point).
  97580. //
  97581. // For instance:
  97582. // Math.random() * 0x100000000 = 3366450031.853859
  97583. // but
  97584. // Math.random() * 0x100000000 >>> 0 = 3366450031.
  97585. const r1 = Math.random() * 0x100000000 >>> 0;
  97586. const r2 = Math.random() * 0x100000000 >>> 0;
  97587. const r3 = Math.random() * 0x100000000 >>> 0;
  97588. const r4 = Math.random() * 0x100000000 >>> 0;
  97589. // Make sure that id does not start with number.
  97590. return 'e' +
  97591. HEX_NUMBERS[ r1 >> 0 & 0xFF ] +
  97592. HEX_NUMBERS[ r1 >> 8 & 0xFF ] +
  97593. HEX_NUMBERS[ r1 >> 16 & 0xFF ] +
  97594. HEX_NUMBERS[ r1 >> 24 & 0xFF ] +
  97595. HEX_NUMBERS[ r2 >> 0 & 0xFF ] +
  97596. HEX_NUMBERS[ r2 >> 8 & 0xFF ] +
  97597. HEX_NUMBERS[ r2 >> 16 & 0xFF ] +
  97598. HEX_NUMBERS[ r2 >> 24 & 0xFF ] +
  97599. HEX_NUMBERS[ r3 >> 0 & 0xFF ] +
  97600. HEX_NUMBERS[ r3 >> 8 & 0xFF ] +
  97601. HEX_NUMBERS[ r3 >> 16 & 0xFF ] +
  97602. HEX_NUMBERS[ r3 >> 24 & 0xFF ] +
  97603. HEX_NUMBERS[ r4 >> 0 & 0xFF ] +
  97604. HEX_NUMBERS[ r4 >> 8 & 0xFF ] +
  97605. HEX_NUMBERS[ r4 >> 16 & 0xFF ] +
  97606. HEX_NUMBERS[ r4 >> 24 & 0xFF ];
  97607. }
  97608. /***/ }),
  97609. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/unicode.js":
  97610. /*!***************************************************************!*\
  97611. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/unicode.js ***!
  97612. \***************************************************************/
  97613. /*! exports provided: isCombiningMark, isHighSurrogateHalf, isLowSurrogateHalf, isInsideSurrogatePair, isInsideCombinedSymbol */
  97614. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97615. "use strict";
  97616. __webpack_require__.r(__webpack_exports__);
  97617. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isCombiningMark", function() { return isCombiningMark; });
  97618. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHighSurrogateHalf", function() { return isHighSurrogateHalf; });
  97619. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowSurrogateHalf", function() { return isLowSurrogateHalf; });
  97620. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInsideSurrogatePair", function() { return isInsideSurrogatePair; });
  97621. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInsideCombinedSymbol", function() { return isInsideCombinedSymbol; });
  97622. /**
  97623. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97624. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97625. */
  97626. /**
  97627. * Set of utils to handle unicode characters.
  97628. *
  97629. * @module utils/unicode
  97630. */
  97631. /**
  97632. * Checks whether given `character` is a combining mark.
  97633. *
  97634. * @param {String} character Character to check.
  97635. * @returns {Boolean}
  97636. */
  97637. function isCombiningMark( character ) {
  97638. // eslint-disable-next-line no-misleading-character-class
  97639. return !!character && character.length == 1 && /[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test( character );
  97640. }
  97641. /**
  97642. * Checks whether given `character` is a high half of surrogate pair.
  97643. *
  97644. * Using UTF-16 terminology, a surrogate pair denotes UTF-16 character using two UTF-8 characters. The surrogate pair
  97645. * consist of high surrogate pair character followed by low surrogate pair character.
  97646. *
  97647. * @param {String} character Character to check.
  97648. * @returns {Boolean}
  97649. */
  97650. function isHighSurrogateHalf( character ) {
  97651. return !!character && character.length == 1 && /[\ud800-\udbff]/.test( character );
  97652. }
  97653. /**
  97654. * Checks whether given `character` is a low half of surrogate pair.
  97655. *
  97656. * Using UTF-16 terminology, a surrogate pair denotes UTF-16 character using two UTF-8 characters. The surrogate pair
  97657. * consist of high surrogate pair character followed by low surrogate pair character.
  97658. *
  97659. * @param {String} character Character to check.
  97660. * @returns {Boolean}
  97661. */
  97662. function isLowSurrogateHalf( character ) {
  97663. return !!character && character.length == 1 && /[\udc00-\udfff]/.test( character );
  97664. }
  97665. /**
  97666. * Checks whether given offset in a string is inside a surrogate pair (between two surrogate halves).
  97667. *
  97668. * @param {String} string String to check.
  97669. * @param {Number} offset Offset to check.
  97670. * @returns {Boolean}
  97671. */
  97672. function isInsideSurrogatePair( string, offset ) {
  97673. return isHighSurrogateHalf( string.charAt( offset - 1 ) ) && isLowSurrogateHalf( string.charAt( offset ) );
  97674. }
  97675. /**
  97676. * Checks whether given offset in a string is between base character and combining mark or between two combining marks.
  97677. *
  97678. * @param {String} string String to check.
  97679. * @param {Number} offset Offset to check.
  97680. * @returns {Boolean}
  97681. */
  97682. function isInsideCombinedSymbol( string, offset ) {
  97683. return isCombiningMark( string.charAt( offset ) );
  97684. }
  97685. /***/ }),
  97686. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js":
  97687. /*!***************************************************************!*\
  97688. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/version.js ***!
  97689. \***************************************************************/
  97690. /*! exports provided: default */
  97691. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97692. "use strict";
  97693. __webpack_require__.r(__webpack_exports__);
  97694. /* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  97695. /**
  97696. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97697. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97698. */
  97699. /**
  97700. * @module utils/version
  97701. */
  97702. /* globals window, global */
  97703. const version = '31.1.0';
  97704. /* harmony default export */ __webpack_exports__["default"] = (version);
  97705. /* istanbul ignore next */
  97706. const windowOrGlobal = typeof window === 'object' ? window : global;
  97707. /* istanbul ignore next */
  97708. if ( windowOrGlobal.CKEDITOR_VERSION ) {
  97709. /**
  97710. * This error is thrown when due to a mistake in how CKEditor 5 was installed or initialized, some
  97711. * of its modules were duplicated (evaluated and executed twice). Module duplication leads to inevitable runtime
  97712. * errors.
  97713. *
  97714. * There are many situations in which some modules can be loaded twice. In the worst case scenario,
  97715. * you may need to check your project for each of these issues and fix them all.
  97716. *
  97717. * # Trying to add a plugin to an existing build
  97718. *
  97719. * If you import an existing CKEditor 5 build and a plugin like this:
  97720. *
  97721. * import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
  97722. * import Highlight from '@ckeditor/ckeditor5-highlight/src/highlight';
  97723. *
  97724. * Then your project loads some CKEditor 5 packages twice. How does it happen?
  97725. *
  97726. * The build package contains a file which is already compiled with webpack. This means
  97727. * that it contains all the necessary code from e.g. `@ckeditor/ckeditor5-engine` and `@ckeditor/ckeditor5-utils`.
  97728. *
  97729. * However, the `Highlight` plugin imports some of the modules from these packages, too. If you ask webpack to
  97730. * build such a project, you will end up with the modules being included (and run) twice &mdash; first, because they are
  97731. * included inside the build package, and second, because they are required by the `Highlight` plugin.
  97732. *
  97733. * Therefore, **you must never add plugins to an existing build** unless your plugin has no dependencies.
  97734. *
  97735. * Adding plugins to a build is done by taking the source version of this build (so, before it was built with webpack)
  97736. * and adding plugins there. In this situation, webpack will know that it only needs to load each plugin once.
  97737. *
  97738. * Read more in the {@glink builds/guides/integration/installing-plugins "Installing plugins"} guide.
  97739. *
  97740. * # Confused an editor build with an editor implementation
  97741. *
  97742. * This scenario is very similar to the previous one, but has a different origin.
  97743. *
  97744. * Let's assume that you wanted to use CKEditor 5 from source, as explained in the
  97745. * {@glink builds/guides/integration/advanced-setup#scenario-2-building-from-source "Building from source"} section
  97746. * or in the {@glink framework/guides/quick-start "Quick start"} guide of CKEditor 5 Framework.
  97747. *
  97748. * The correct way to do so is to import an editor and plugins and run them together like this:
  97749. *
  97750. * import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
  97751. * import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
  97752. * import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
  97753. * import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
  97754. * import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
  97755. *
  97756. * ClassicEditor
  97757. * .create( document.querySelector( '#editor' ), {
  97758. * plugins: [ Essentials, Paragraph, Bold, Italic ],
  97759. * toolbar: [ 'bold', 'italic' ]
  97760. * } )
  97761. * .then( editor => {
  97762. * console.log( 'Editor was initialized', editor );
  97763. * } )
  97764. * .catch( error => {
  97765. * console.error( error.stack );
  97766. * } );
  97767. *
  97768. * However, you might have mistakenly imported a build instead of the source `ClassicEditor`. In this case
  97769. * your imports will look like this:
  97770. *
  97771. * import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
  97772. * import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
  97773. * import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
  97774. * import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
  97775. * import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
  97776. *
  97777. * This creates the same situation as in the previous section because you use a build together with source plugins.
  97778. *
  97779. * Remember: `@ckeditor/ckeditor5-build-*` packages contain editor builds and `@ckeditor/ckeditor5-editor-*` contain source editors.
  97780. *
  97781. * # Loading two or more builds on one page
  97782. *
  97783. * If you use CKEditor 5 builds, you might have loaded two (or more) `ckeditor.js` files on one web page.
  97784. * Check your web page for duplicated `<script>` elements or make sure your page builder/bundler includes CKEditor only once.
  97785. *
  97786. * If you want to use two different types of editors at once, see the
  97787. * {@glink builds/guides/integration/advanced-setup#scenario-3-using-two-different-editors "Using two different editors"}
  97788. * section.
  97789. *
  97790. * # Using outdated packages
  97791. *
  97792. * Building CKEditor 5 from source requires using multiple npm packages. These packages have their dependencies
  97793. * to other packages. If you use the latest version of, for example, `@ckeditor/ckeditor5-editor-classic` with
  97794. * an outdated version of `@ckeditor/ckeditor5-image`, npm or yarn will need to install two different versions of
  97795. * `@ckeditor/ckeditor5-core` because `@ckeditor/ckeditor5-editor-classic` and `@ckeditor/ckeditor5-image` may require
  97796. * different versions of the core package.
  97797. *
  97798. * The solution to this issue is to update all packages to their latest version. We recommend
  97799. * using tools like [`npm-check-updates`](https://www.npmjs.com/package/npm-check-updates) which simplify this process.
  97800. *
  97801. * # Conflicting version of dependencies
  97802. *
  97803. * This is a special case of the previous scenario. If you use CKEditor 5 with some third-party plugins,
  97804. * it may happen that even if you use the latest versions of the official packages and the latest version of
  97805. * these third-party packages, there will be a conflict between some of their dependencies.
  97806. *
  97807. * Such a problem can be resolved by either downgrading CKEditor 5 packages (which we do not recommend) or
  97808. * asking the author of the third-party package to upgrade its depdendencies (or forking their project and doing this yourself).
  97809. *
  97810. * **Note:** All official CKEditor 5 packages (excluding integrations and `ckeditor5-dev-*` packages) are released in the
  97811. * same major version. This is &mdash; in the `x.y.z`, the `x` is the same for all packages. This is the simplest way to check
  97812. * whether you use packages coming from the same CKEditor 5 version. You can read more about versioning in the
  97813. * {@glink framework/guides/support/versioning-policy Versioning policy} guide.
  97814. *
  97815. * # Packages were duplicated in `node_modules`
  97816. *
  97817. * In some situations, especially when calling `npm install` multiple times, it may happen
  97818. * that npm will not correctly "deduplicate" packages.
  97819. *
  97820. * Normally, npm deduplicates all packages so, for example, `@ckeditor/ckeditor5-core` is installed only once in `node_modules/`.
  97821. * However, it is known to fail to do so from time to time.
  97822. *
  97823. * We recommend checking if any of the steps listed below help:
  97824. *
  97825. * * `rm -rf node_modules && npm install` to make sure you have a clean `node_modules/` directory. This step
  97826. * is known to help in most cases.
  97827. * * If you use `yarn.lock` or `package-lock.json`, remove it before `npm install`.
  97828. * * Check whether all CKEditor 5 packages are up to date and reinstall them
  97829. * if you changed anything (`rm -rf node_modules && npm install`).
  97830. *
  97831. * If all packages are correct and compatible with each other, the steps above are known to help. If not, you may
  97832. * try to check with `npm ls` how many times packages like `@ckeditor/ckeditor5-core`, `@ckeditor/ckeditor5-engine` and
  97833. *`@ckeditor/ckeditor5-utils` are installed. If more than once, verify which package causes that.
  97834. *
  97835. * @error ckeditor-duplicated-modules
  97836. */
  97837. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  97838. 'ckeditor-duplicated-modules',
  97839. null
  97840. );
  97841. } else {
  97842. windowOrGlobal.CKEDITOR_VERSION = version;
  97843. }
  97844. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  97845. /***/ }),
  97846. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/highlightstack.js":
  97847. /*!***********************************************************************!*\
  97848. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/highlightstack.js ***!
  97849. \***********************************************************************/
  97850. /*! exports provided: default */
  97851. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97852. "use strict";
  97853. __webpack_require__.r(__webpack_exports__);
  97854. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HighlightStack; });
  97855. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  97856. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  97857. /**
  97858. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  97859. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  97860. */
  97861. /**
  97862. * @module widget/highlightstack
  97863. */
  97864. /**
  97865. * Class used to handle correct order of highlights on elements.
  97866. *
  97867. * When different highlights are applied to same element correct order should be preserved:
  97868. *
  97869. * * highlight with highest priority should be applied,
  97870. * * if two highlights have same priority - sort by CSS class provided in
  97871. * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor}.
  97872. *
  97873. * This way, highlight will be applied with the same rules it is applied on texts.
  97874. */
  97875. class HighlightStack {
  97876. /**
  97877. * Creates class instance.
  97878. */
  97879. constructor() {
  97880. this._stack = [];
  97881. }
  97882. /**
  97883. * Adds highlight descriptor to the stack.
  97884. *
  97885. * @fires change:top
  97886. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
  97887. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  97888. */
  97889. add( descriptor, writer ) {
  97890. const stack = this._stack;
  97891. // Save top descriptor and insert new one. If top is changed - fire event.
  97892. const oldTop = stack[ 0 ];
  97893. this._insertDescriptor( descriptor );
  97894. const newTop = stack[ 0 ];
  97895. // When new object is at the top and stores different information.
  97896. if ( oldTop !== newTop && !compareDescriptors( oldTop, newTop ) ) {
  97897. this.fire( 'change:top', {
  97898. oldDescriptor: oldTop,
  97899. newDescriptor: newTop,
  97900. writer
  97901. } );
  97902. }
  97903. }
  97904. /**
  97905. * Removes highlight descriptor from the stack.
  97906. *
  97907. * @fires change:top
  97908. * @param {String} id Id of the descriptor to remove.
  97909. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  97910. */
  97911. remove( id, writer ) {
  97912. const stack = this._stack;
  97913. const oldTop = stack[ 0 ];
  97914. this._removeDescriptor( id );
  97915. const newTop = stack[ 0 ];
  97916. // When new object is at the top and stores different information.
  97917. if ( oldTop !== newTop && !compareDescriptors( oldTop, newTop ) ) {
  97918. this.fire( 'change:top', {
  97919. oldDescriptor: oldTop,
  97920. newDescriptor: newTop,
  97921. writer
  97922. } );
  97923. }
  97924. }
  97925. /**
  97926. * Inserts given descriptor in correct place in the stack. It also takes care about updating information when
  97927. * descriptor with same id is already present.
  97928. *
  97929. * @private
  97930. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
  97931. */
  97932. _insertDescriptor( descriptor ) {
  97933. const stack = this._stack;
  97934. const index = stack.findIndex( item => item.id === descriptor.id );
  97935. // Inserting exact same descriptor - do nothing.
  97936. if ( compareDescriptors( descriptor, stack[ index ] ) ) {
  97937. return;
  97938. }
  97939. // If descriptor with same id but with different information is on the stack - remove it.
  97940. if ( index > -1 ) {
  97941. stack.splice( index, 1 );
  97942. }
  97943. // Find correct place to insert descriptor in the stack.
  97944. // It have different information (for example priority) so it must be re-inserted in correct place.
  97945. let i = 0;
  97946. while ( stack[ i ] && shouldABeBeforeB( stack[ i ], descriptor ) ) {
  97947. i++;
  97948. }
  97949. stack.splice( i, 0, descriptor );
  97950. }
  97951. /**
  97952. * Removes descriptor with given id from the stack.
  97953. *
  97954. * @private
  97955. * @param {String} id Descriptor's id.
  97956. */
  97957. _removeDescriptor( id ) {
  97958. const stack = this._stack;
  97959. const index = stack.findIndex( item => item.id === id );
  97960. // If descriptor with same id is on the list - remove it.
  97961. if ( index > -1 ) {
  97962. stack.splice( index, 1 );
  97963. }
  97964. }
  97965. }
  97966. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( HighlightStack, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  97967. // Compares two descriptors by checking their priority and class list.
  97968. //
  97969. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} a
  97970. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} b
  97971. // @returns {Boolean} Returns true if both descriptors are defined and have same priority and classes.
  97972. function compareDescriptors( a, b ) {
  97973. return a && b && a.priority == b.priority && classesToString( a.classes ) == classesToString( b.classes );
  97974. }
  97975. // Checks whenever first descriptor should be placed in the stack before second one.
  97976. //
  97977. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} a
  97978. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} b
  97979. // @returns {Boolean}
  97980. function shouldABeBeforeB( a, b ) {
  97981. if ( a.priority > b.priority ) {
  97982. return true;
  97983. } else if ( a.priority < b.priority ) {
  97984. return false;
  97985. }
  97986. // When priorities are equal and names are different - use classes to compare.
  97987. return classesToString( a.classes ) > classesToString( b.classes );
  97988. }
  97989. // Converts CSS classes passed with {@link module:engine/conversion/downcasthelpers~HighlightDescriptor} to
  97990. // sorted string.
  97991. //
  97992. // @param {String|Array<String>} descriptor
  97993. // @returns {String}
  97994. function classesToString( classes ) {
  97995. return Array.isArray( classes ) ? classes.sort().join( ',' ) : classes;
  97996. }
  97997. /**
  97998. * Fired when top element on {@link module:widget/highlightstack~HighlightStack} has been changed
  97999. *
  98000. * @event change:top
  98001. * @param {Object} data Additional information about the change.
  98002. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} [data.newDescriptor] New highlight
  98003. * descriptor. It will be `undefined` when last descriptor is removed from the stack.
  98004. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} [data.oldDescriptor] Old highlight
  98005. * descriptor. It will be `undefined` when first descriptor is added to the stack.
  98006. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that can be used to modify element.
  98007. */
  98008. /***/ }),
  98009. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/index.js":
  98010. /*!**************************************************************!*\
  98011. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/index.js ***!
  98012. \**************************************************************/
  98013. /*! exports provided: Widget, WidgetToolbarRepository, WidgetResize, WidgetTypeAround, WIDGET_CLASS_NAME, WIDGET_SELECTED_CLASS_NAME, isWidget, toWidget, setHighlightHandling, setLabel, getLabel, toWidgetEditable, findOptimalInsertionRange, viewToModelPositionOutsideModelElement */
  98014. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98015. "use strict";
  98016. __webpack_require__.r(__webpack_exports__);
  98017. /* harmony import */ var _widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./widget */ "./node_modules/@ckeditor/ckeditor5-widget/src/widget.js");
  98018. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Widget", function() { return _widget__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  98019. /* harmony import */ var _widgettoolbarrepository__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./widgettoolbarrepository */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettoolbarrepository.js");
  98020. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetToolbarRepository", function() { return _widgettoolbarrepository__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  98021. /* harmony import */ var _widgetresize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./widgetresize */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize.js");
  98022. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetResize", function() { return _widgetresize__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  98023. /* harmony import */ var _widgettypearound_widgettypearound__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./widgettypearound/widgettypearound */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js");
  98024. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetTypeAround", function() { return _widgettypearound_widgettypearound__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  98025. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  98026. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WIDGET_CLASS_NAME", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["WIDGET_CLASS_NAME"]; });
  98027. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WIDGET_SELECTED_CLASS_NAME", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["WIDGET_SELECTED_CLASS_NAME"]; });
  98028. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWidget", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["isWidget"]; });
  98029. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toWidget", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["toWidget"]; });
  98030. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setHighlightHandling", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["setHighlightHandling"]; });
  98031. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setLabel", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["setLabel"]; });
  98032. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLabel", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["getLabel"]; });
  98033. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toWidgetEditable", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["toWidgetEditable"]; });
  98034. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findOptimalInsertionRange", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["findOptimalInsertionRange"]; });
  98035. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "viewToModelPositionOutsideModelElement", function() { return _utils__WEBPACK_IMPORTED_MODULE_4__["viewToModelPositionOutsideModelElement"]; });
  98036. /**
  98037. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  98038. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  98039. */
  98040. /***/ }),
  98041. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js":
  98042. /*!**************************************************************!*\
  98043. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/utils.js ***!
  98044. \**************************************************************/
  98045. /*! exports provided: WIDGET_CLASS_NAME, WIDGET_SELECTED_CLASS_NAME, isWidget, toWidget, setHighlightHandling, setLabel, getLabel, toWidgetEditable, findOptimalInsertionRange, viewToModelPositionOutsideModelElement */
  98046. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98047. "use strict";
  98048. __webpack_require__.r(__webpack_exports__);
  98049. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WIDGET_CLASS_NAME", function() { return WIDGET_CLASS_NAME; });
  98050. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WIDGET_SELECTED_CLASS_NAME", function() { return WIDGET_SELECTED_CLASS_NAME; });
  98051. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWidget", function() { return isWidget; });
  98052. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toWidget", function() { return toWidget; });
  98053. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setHighlightHandling", function() { return setHighlightHandling; });
  98054. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLabel", function() { return setLabel; });
  98055. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLabel", function() { return getLabel; });
  98056. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toWidgetEditable", function() { return toWidgetEditable; });
  98057. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findOptimalInsertionRange", function() { return findOptimalInsertionRange; });
  98058. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewToModelPositionOutsideModelElement", function() { return viewToModelPositionOutsideModelElement; });
  98059. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  98060. /* harmony import */ var _ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/toarray */ "./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js");
  98061. /* harmony import */ var _highlightstack__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./highlightstack */ "./node_modules/@ckeditor/ckeditor5-widget/src/highlightstack.js");
  98062. /* harmony import */ var _widgettypearound_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./widgettypearound/utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js");
  98063. /* harmony import */ var _ckeditor_ckeditor5_ui_src_icon_iconview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/icon/iconview */ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js");
  98064. /* harmony import */ var _theme_icons_drag_handle_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../theme/icons/drag-handle.svg */ "./node_modules/@ckeditor/ckeditor5-widget/theme/icons/drag-handle.svg");
  98065. /**
  98066. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  98067. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  98068. */
  98069. /**
  98070. * @module widget/utils
  98071. */
  98072. /**
  98073. * CSS class added to each widget element.
  98074. *
  98075. * @const {String}
  98076. */
  98077. const WIDGET_CLASS_NAME = 'ck-widget';
  98078. /**
  98079. * CSS class added to currently selected widget element.
  98080. *
  98081. * @const {String}
  98082. */
  98083. const WIDGET_SELECTED_CLASS_NAME = 'ck-widget_selected';
  98084. /**
  98085. * Returns `true` if given {@link module:engine/view/node~Node} is an {@link module:engine/view/element~Element} and a widget.
  98086. *
  98087. * @param {module:engine/view/node~Node} node
  98088. * @returns {Boolean}
  98089. */
  98090. function isWidget( node ) {
  98091. if ( !node.is( 'element' ) ) {
  98092. return false;
  98093. }
  98094. return !!node.getCustomProperty( 'widget' );
  98095. }
  98096. /**
  98097. * Converts the given {@link module:engine/view/element~Element} to a widget in the following way:
  98098. *
  98099. * * sets the `contenteditable` attribute to `"false"`,
  98100. * * adds the `ck-widget` CSS class,
  98101. * * adds a custom {@link module:engine/view/element~Element#getFillerOffset `getFillerOffset()`} method returning `null`,
  98102. * * adds a custom property allowing to recognize widget elements by using {@link ~isWidget `isWidget()`},
  98103. * * implements the {@link ~setHighlightHandling view highlight on widgets}.
  98104. *
  98105. * This function needs to be used in conjunction with
  98106. * {@link module:engine/conversion/downcasthelpers~DowncastHelpers downcast conversion helpers}
  98107. * like {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.
  98108. * Moreover, typically you will want to use `toWidget()` only for `editingDowncast`, while keeping the `dataDowncast` clean.
  98109. *
  98110. * For example, in order to convert a `<widget>` model element to `<div class="widget">` in the view, you can define
  98111. * such converters:
  98112. *
  98113. * editor.conversion.for( 'editingDowncast' )
  98114. * .elementToElement( {
  98115. * model: 'widget',
  98116. * view: ( modelItem, { writer } ) => {
  98117. * const div = writer.createContainerElement( 'div', { class: 'widget' } );
  98118. *
  98119. * return toWidget( div, writer, { label: 'some widget' } );
  98120. * }
  98121. * } );
  98122. *
  98123. * editor.conversion.for( 'dataDowncast' )
  98124. * .elementToElement( {
  98125. * model: 'widget',
  98126. * view: ( modelItem, { writer } ) => {
  98127. * return writer.createContainerElement( 'div', { class: 'widget' } );
  98128. * }
  98129. * } );
  98130. *
  98131. * See the full source code of the widget (with a nested editable) schema definition and converters in
  98132. * [this sample](https://github.com/ckeditor/ckeditor5-widget/blob/master/tests/manual/widget-with-nestededitable.js).
  98133. *
  98134. * @param {module:engine/view/element~Element} element
  98135. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  98136. * @param {Object} [options={}]
  98137. * @param {String|Function} [options.label] Element's label provided to the {@link ~setLabel} function. It can be passed as
  98138. * a plain string or a function returning a string. It represents the widget for assistive technologies (like screen readers).
  98139. * @param {Boolean} [options.hasSelectionHandle=false] If `true`, the widget will have a selection handle added.
  98140. * @returns {module:engine/view/element~Element} Returns the same element.
  98141. */
  98142. function toWidget( element, writer, options = {} ) {
  98143. if ( !element.is( 'containerElement' ) ) {
  98144. /**
  98145. * The element passed to `toWidget()` must be a {@link module:engine/view/containerelement~ContainerElement}
  98146. * instance.
  98147. *
  98148. * @error widget-to-widget-wrong-element-type
  98149. * @param {String} element The view element passed to `toWidget()`.
  98150. */
  98151. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  98152. 'widget-to-widget-wrong-element-type',
  98153. null,
  98154. { element }
  98155. );
  98156. }
  98157. writer.setAttribute( 'contenteditable', 'false', element );
  98158. writer.addClass( WIDGET_CLASS_NAME, element );
  98159. writer.setCustomProperty( 'widget', true, element );
  98160. element.getFillerOffset = getFillerOffset;
  98161. if ( options.label ) {
  98162. setLabel( element, options.label, writer );
  98163. }
  98164. if ( options.hasSelectionHandle ) {
  98165. addSelectionHandle( element, writer );
  98166. }
  98167. setHighlightHandling( element, writer );
  98168. return element;
  98169. }
  98170. // Default handler for adding a highlight on a widget.
  98171. // It adds CSS class and attributes basing on the given highlight descriptor.
  98172. //
  98173. // @param {module:engine/view/element~Element} element
  98174. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
  98175. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  98176. function addHighlight( element, descriptor, writer ) {
  98177. if ( descriptor.classes ) {
  98178. writer.addClass( Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_1__["default"])( descriptor.classes ), element );
  98179. }
  98180. if ( descriptor.attributes ) {
  98181. for ( const key in descriptor.attributes ) {
  98182. writer.setAttribute( key, descriptor.attributes[ key ], element );
  98183. }
  98184. }
  98185. }
  98186. // Default handler for removing a highlight from a widget.
  98187. // It removes CSS class and attributes basing on the given highlight descriptor.
  98188. //
  98189. // @param {module:engine/view/element~Element} element
  98190. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
  98191. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  98192. function removeHighlight( element, descriptor, writer ) {
  98193. if ( descriptor.classes ) {
  98194. writer.removeClass( Object(_ckeditor_ckeditor5_utils_src_toarray__WEBPACK_IMPORTED_MODULE_1__["default"])( descriptor.classes ), element );
  98195. }
  98196. if ( descriptor.attributes ) {
  98197. for ( const key in descriptor.attributes ) {
  98198. writer.removeAttribute( key, element );
  98199. }
  98200. }
  98201. }
  98202. /**
  98203. * Sets highlight handling methods. Uses {@link module:widget/highlightstack~HighlightStack} to
  98204. * properly determine which highlight descriptor should be used at given time.
  98205. *
  98206. * @param {module:engine/view/element~Element} element
  98207. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  98208. * @param {Function} [add]
  98209. * @param {Function} [remove]
  98210. */
  98211. function setHighlightHandling( element, writer, add = addHighlight, remove = removeHighlight ) {
  98212. const stack = new _highlightstack__WEBPACK_IMPORTED_MODULE_2__["default"]();
  98213. stack.on( 'change:top', ( evt, data ) => {
  98214. if ( data.oldDescriptor ) {
  98215. remove( element, data.oldDescriptor, data.writer );
  98216. }
  98217. if ( data.newDescriptor ) {
  98218. add( element, data.newDescriptor, data.writer );
  98219. }
  98220. } );
  98221. writer.setCustomProperty( 'addHighlight', ( element, descriptor, writer ) => stack.add( descriptor, writer ), element );
  98222. writer.setCustomProperty( 'removeHighlight', ( element, id, writer ) => stack.remove( id, writer ), element );
  98223. }
  98224. /**
  98225. * Sets label for given element.
  98226. * It can be passed as a plain string or a function returning a string. Function will be called each time label is retrieved by
  98227. * {@link ~getLabel `getLabel()`}.
  98228. *
  98229. * @param {module:engine/view/element~Element} element
  98230. * @param {String|Function} labelOrCreator
  98231. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  98232. */
  98233. function setLabel( element, labelOrCreator, writer ) {
  98234. writer.setCustomProperty( 'widgetLabel', labelOrCreator, element );
  98235. }
  98236. /**
  98237. * Returns the label of the provided element.
  98238. *
  98239. * @param {module:engine/view/element~Element} element
  98240. * @returns {String}
  98241. */
  98242. function getLabel( element ) {
  98243. const labelCreator = element.getCustomProperty( 'widgetLabel' );
  98244. if ( !labelCreator ) {
  98245. return '';
  98246. }
  98247. return typeof labelCreator == 'function' ? labelCreator() : labelCreator;
  98248. }
  98249. /**
  98250. * Adds functionality to the provided {@link module:engine/view/editableelement~EditableElement} to act as a widget's editable:
  98251. *
  98252. * * sets the `contenteditable` attribute to `true` when {@link module:engine/view/editableelement~EditableElement#isReadOnly} is `false`,
  98253. * otherwise sets it to `false`,
  98254. * * adds the `ck-editor__editable` and `ck-editor__nested-editable` CSS classes,
  98255. * * adds the `ck-editor__nested-editable_focused` CSS class when the editable is focused and removes it when it is blurred.
  98256. * * implements the {@link ~setHighlightHandling view highlight on widget's editable}.
  98257. *
  98258. * Similarly to {@link ~toWidget `toWidget()`} this function should be used in `editingDowncast` only and it is usually
  98259. * used together with {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.
  98260. *
  98261. * For example, in order to convert a `<nested>` model element to `<div class="nested">` in the view, you can define
  98262. * such converters:
  98263. *
  98264. * editor.conversion.for( 'editingDowncast' )
  98265. * .elementToElement( {
  98266. * model: 'nested',
  98267. * view: ( modelItem, { writer } ) => {
  98268. * const div = writer.createEditableElement( 'div', { class: 'nested' } );
  98269. *
  98270. * return toWidgetEditable( nested, writer );
  98271. * }
  98272. * } );
  98273. *
  98274. * editor.conversion.for( 'dataDowncast' )
  98275. * .elementToElement( {
  98276. * model: 'nested',
  98277. * view: ( modelItem, { writer } ) => {
  98278. * return writer.createContainerElement( 'div', { class: 'nested' } );
  98279. * }
  98280. * } );
  98281. *
  98282. * See the full source code of the widget (with nested editable) schema definition and converters in
  98283. * [this sample](https://github.com/ckeditor/ckeditor5-widget/blob/master/tests/manual/widget-with-nestededitable.js).
  98284. *
  98285. * @param {module:engine/view/editableelement~EditableElement} editable
  98286. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  98287. * @returns {module:engine/view/editableelement~EditableElement} Returns the same element that was provided in the `editable` parameter
  98288. */
  98289. function toWidgetEditable( editable, writer ) {
  98290. writer.addClass( [ 'ck-editor__editable', 'ck-editor__nested-editable' ], editable );
  98291. // Set initial contenteditable value.
  98292. writer.setAttribute( 'contenteditable', editable.isReadOnly ? 'false' : 'true', editable );
  98293. // Bind the contenteditable property to element#isReadOnly.
  98294. editable.on( 'change:isReadOnly', ( evt, property, is ) => {
  98295. writer.setAttribute( 'contenteditable', is ? 'false' : 'true', editable );
  98296. } );
  98297. editable.on( 'change:isFocused', ( evt, property, is ) => {
  98298. if ( is ) {
  98299. writer.addClass( 'ck-editor__nested-editable_focused', editable );
  98300. } else {
  98301. writer.removeClass( 'ck-editor__nested-editable_focused', editable );
  98302. }
  98303. } );
  98304. setHighlightHandling( editable, writer );
  98305. return editable;
  98306. }
  98307. /**
  98308. * Returns a model range which is optimal (in terms of UX) for inserting a widget block.
  98309. *
  98310. * For instance, if a selection is in the middle of a paragraph, the collapsed range before this paragraph
  98311. * will be returned so that it is not split. If the selection is at the end of a paragraph,
  98312. * the collapsed range after this paragraph will be returned.
  98313. *
  98314. * Note: If the selection is placed in an empty block, the range in that block will be returned. If that range
  98315. * is then passed to {@link module:engine/model/model~Model#insertContent}, the block will be fully replaced
  98316. * by the inserted widget block.
  98317. *
  98318. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  98319. * The selection based on which the insertion position should be calculated.
  98320. * @param {module:engine/model/model~Model} model Model instance.
  98321. * @returns {module:engine/model/range~Range} The optimal range.
  98322. */
  98323. function findOptimalInsertionRange( selection, model ) {
  98324. const selectedElement = selection.getSelectedElement();
  98325. if ( selectedElement ) {
  98326. const typeAroundFakeCaretPosition = Object(_widgettypearound_utils__WEBPACK_IMPORTED_MODULE_3__["getTypeAroundFakeCaretPosition"])( selection );
  98327. // If the WidgetTypeAround "fake caret" is displayed, use its position for the insertion
  98328. // to provide the most predictable UX (https://github.com/ckeditor/ckeditor5/issues/7438).
  98329. if ( typeAroundFakeCaretPosition ) {
  98330. return model.createRange( model.createPositionAt( selectedElement, typeAroundFakeCaretPosition ) );
  98331. }
  98332. if ( model.schema.isObject( selectedElement ) && !model.schema.isInline( selectedElement ) ) {
  98333. return model.createRangeOn( selectedElement );
  98334. }
  98335. }
  98336. const firstBlock = selection.getSelectedBlocks().next().value;
  98337. if ( firstBlock ) {
  98338. // If inserting into an empty block – return position in that block. It will get
  98339. // replaced with the image by insertContent(). #42.
  98340. if ( firstBlock.isEmpty ) {
  98341. return model.createRange( model.createPositionAt( firstBlock, 0 ) );
  98342. }
  98343. const positionAfter = model.createPositionAfter( firstBlock );
  98344. // If selection is at the end of the block - return position after the block.
  98345. if ( selection.focus.isTouching( positionAfter ) ) {
  98346. return model.createRange( positionAfter );
  98347. }
  98348. // Otherwise return position before the block.
  98349. return model.createRange( model.createPositionBefore( firstBlock ) );
  98350. }
  98351. return model.createRange( selection.focus );
  98352. }
  98353. /**
  98354. * A util to be used in order to map view positions to correct model positions when implementing a widget
  98355. * which renders non-empty view element for an empty model element.
  98356. *
  98357. * For example:
  98358. *
  98359. * // Model:
  98360. * <placeholder type="name"></placeholder>
  98361. *
  98362. * // View:
  98363. * <span class="placeholder">name</span>
  98364. *
  98365. * In such case, view positions inside `<span>` cannot be correct mapped to the model (because the model element is empty).
  98366. * To handle mapping positions inside `<span class="placeholder">` to the model use this util as follows:
  98367. *
  98368. * editor.editing.mapper.on(
  98369. * 'viewToModelPosition',
  98370. * viewToModelPositionOutsideModelElement( model, viewElement => viewElement.hasClass( 'placeholder' ) )
  98371. * );
  98372. *
  98373. * The callback will try to map the view offset of selection to an expected model position.
  98374. *
  98375. * 1. When the position is at the end (or in the middle) of the inline widget:
  98376. *
  98377. * // View:
  98378. * <p>foo <span class="placeholder">name|</span> bar</p>
  98379. *
  98380. * // Model:
  98381. * <paragraph>foo <placeholder type="name"></placeholder>| bar</paragraph>
  98382. *
  98383. * 2. When the position is at the beginning of the inline widget:
  98384. *
  98385. * // View:
  98386. * <p>foo <span class="placeholder">|name</span> bar</p>
  98387. *
  98388. * // Model:
  98389. * <paragraph>foo |<placeholder type="name"></placeholder> bar</paragraph>
  98390. *
  98391. * @param {module:engine/model/model~Model} model Model instance on which the callback operates.
  98392. * @param {Function} viewElementMatcher Function that is passed a view element and should return `true` if the custom mapping
  98393. * should be applied to the given view element.
  98394. * @return {Function}
  98395. */
  98396. function viewToModelPositionOutsideModelElement( model, viewElementMatcher ) {
  98397. return ( evt, data ) => {
  98398. const { mapper, viewPosition } = data;
  98399. const viewParent = mapper.findMappedViewAncestor( viewPosition );
  98400. if ( !viewElementMatcher( viewParent ) ) {
  98401. return;
  98402. }
  98403. const modelParent = mapper.toModelElement( viewParent );
  98404. data.modelPosition = model.createPositionAt( modelParent, viewPosition.isAtStart ? 'before' : 'after' );
  98405. };
  98406. }
  98407. // Default filler offset function applied to all widget elements.
  98408. //
  98409. // @returns {null}
  98410. function getFillerOffset() {
  98411. return null;
  98412. }
  98413. // Adds a drag handle to the widget.
  98414. //
  98415. // @param {module:engine/view/containerelement~ContainerElement}
  98416. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  98417. function addSelectionHandle( widgetElement, writer ) {
  98418. const selectionHandle = writer.createUIElement( 'div', { class: 'ck ck-widget__selection-handle' }, function( domDocument ) {
  98419. const domElement = this.toDomElement( domDocument );
  98420. // Use the IconView from the ui library.
  98421. const icon = new _ckeditor_ckeditor5_ui_src_icon_iconview__WEBPACK_IMPORTED_MODULE_4__["default"]();
  98422. icon.set( 'content', _theme_icons_drag_handle_svg__WEBPACK_IMPORTED_MODULE_5__["default"] );
  98423. // Render the icon view right away to append its #element to the selectionHandle DOM element.
  98424. icon.render();
  98425. domElement.appendChild( icon.element );
  98426. return domElement;
  98427. } );
  98428. // Append the selection handle into the widget wrapper.
  98429. writer.insert( writer.createPositionAt( widgetElement, 0 ), selectionHandle );
  98430. writer.addClass( [ 'ck-widget_with-selection-handle' ], widgetElement );
  98431. }
  98432. /***/ }),
  98433. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/verticalnavigation.js":
  98434. /*!***************************************************************************!*\
  98435. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/verticalnavigation.js ***!
  98436. \***************************************************************************/
  98437. /*! exports provided: default */
  98438. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98439. "use strict";
  98440. __webpack_require__.r(__webpack_exports__);
  98441. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return verticalNavigationHandler; });
  98442. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  98443. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  98444. /**
  98445. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  98446. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  98447. */
  98448. /**
  98449. * @module widget/verticalnavigationhandler
  98450. */
  98451. /**
  98452. * Returns 'keydown' handler for up/down arrow keys that modifies the caret movement if it's in a text line next to an object.
  98453. *
  98454. * @param {module:engine/controller/editingcontroller~EditingController} editing The editing controller.
  98455. * @returns {Function}
  98456. */
  98457. function verticalNavigationHandler( editing ) {
  98458. const model = editing.model;
  98459. return ( evt, data ) => {
  98460. const arrowUpPressed = data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].arrowup;
  98461. const arrowDownPressed = data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].arrowdown;
  98462. const expandSelection = data.shiftKey;
  98463. const selection = model.document.selection;
  98464. if ( !arrowUpPressed && !arrowDownPressed ) {
  98465. return;
  98466. }
  98467. const isForward = arrowDownPressed;
  98468. // Navigation is in the opposite direction than the selection direction so this is shrinking of the selection.
  98469. // Selection for sure will not approach any object.
  98470. if ( expandSelection && selectionWillShrink( selection, isForward ) ) {
  98471. return;
  98472. }
  98473. // Find a range between selection and closest limit element.
  98474. const range = findTextRangeFromSelection( editing, selection, isForward );
  98475. // There is no selection position inside the limit element.
  98476. if ( !range ) {
  98477. return;
  98478. }
  98479. // If already at the edge of a limit element.
  98480. if ( range.isCollapsed ) {
  98481. // A collapsed selection at limit edge - nothing more to do.
  98482. if ( selection.isCollapsed ) {
  98483. return;
  98484. }
  98485. // A non collapsed selection is at the limit edge while expanding the selection - let others do their stuff.
  98486. else if ( expandSelection ) {
  98487. return;
  98488. }
  98489. }
  98490. // If the range is a single line (there is no word wrapping) then move the selection to the position closest to the limit element.
  98491. //
  98492. // We can't move the selection directly to the isObject element (eg. table cell) because of dual position at the end/beginning
  98493. // of wrapped line (it's at the same time at the end of one line and at the start of the next line).
  98494. if ( range.isCollapsed || isSingleLineRange( editing, range, isForward ) ) {
  98495. model.change( writer => {
  98496. const newPosition = isForward ? range.end : range.start;
  98497. if ( expandSelection ) {
  98498. const newSelection = model.createSelection( selection.anchor );
  98499. newSelection.setFocus( newPosition );
  98500. writer.setSelection( newSelection );
  98501. } else {
  98502. writer.setSelection( newPosition );
  98503. }
  98504. } );
  98505. evt.stop();
  98506. data.preventDefault();
  98507. data.stopPropagation();
  98508. }
  98509. };
  98510. }
  98511. // Finds the range between selection and closest limit element (in the direction of navigation).
  98512. // The position next to limit element is adjusted to the closest allowed `$text` position.
  98513. //
  98514. // Returns `null` if, according to the schema, the resulting range cannot contain a `$text` element.
  98515. //
  98516. // @param {module:engine/controller/editingcontroller~EditingController} editing The editing controller.
  98517. // @param {module:engine/model/selection~Selection} selection The current selection.
  98518. // @param {Boolean} isForward The expected navigation direction.
  98519. // @returns {module:engine/model/range~Range|null}
  98520. //
  98521. function findTextRangeFromSelection( editing, selection, isForward ) {
  98522. const model = editing.model;
  98523. if ( isForward ) {
  98524. const startPosition = selection.isCollapsed ? selection.focus : selection.getLastPosition();
  98525. const endPosition = getNearestNonInlineLimit( model, startPosition, 'forward' );
  98526. // There is no limit element, browser should handle this.
  98527. if ( !endPosition ) {
  98528. return null;
  98529. }
  98530. const range = model.createRange( startPosition, endPosition );
  98531. const lastRangePosition = getNearestTextPosition( model.schema, range, 'backward' );
  98532. if ( lastRangePosition ) {
  98533. return model.createRange( startPosition, lastRangePosition );
  98534. }
  98535. return null;
  98536. } else {
  98537. const endPosition = selection.isCollapsed ? selection.focus : selection.getFirstPosition();
  98538. const startPosition = getNearestNonInlineLimit( model, endPosition, 'backward' );
  98539. // There is no limit element, browser should handle this.
  98540. if ( !startPosition ) {
  98541. return null;
  98542. }
  98543. const range = model.createRange( startPosition, endPosition );
  98544. const firstRangePosition = getNearestTextPosition( model.schema, range, 'forward' );
  98545. if ( firstRangePosition ) {
  98546. return model.createRange( firstRangePosition, endPosition );
  98547. }
  98548. return null;
  98549. }
  98550. }
  98551. // Finds the limit element position that is closest to startPosition.
  98552. //
  98553. // @param {module:engine/model/model~Model} model
  98554. // @param {<module:engine/model/position~Position>} startPosition
  98555. // @param {'forward'|'backward'} direction Search direction.
  98556. // @returns {<module:engine/model/position~Position>|null}
  98557. //
  98558. function getNearestNonInlineLimit( model, startPosition, direction ) {
  98559. const schema = model.schema;
  98560. const range = model.createRangeIn( startPosition.root );
  98561. const walkerValueType = direction == 'forward' ? 'elementStart' : 'elementEnd';
  98562. for ( const { previousPosition, item, type } of range.getWalker( { startPosition, direction } ) ) {
  98563. if ( schema.isLimit( item ) && !schema.isInline( item ) ) {
  98564. return previousPosition;
  98565. }
  98566. // Stop looking for isLimit element if the next element is a block element (it is for sure not single line).
  98567. if ( type == walkerValueType && schema.isBlock( item ) ) {
  98568. return null;
  98569. }
  98570. }
  98571. return null;
  98572. }
  98573. // Basing on the provided range, finds the first or last (depending on `direction`) position inside the range
  98574. // that can contain `$text` (according to schema).
  98575. //
  98576. // @param {module:engine/model/schema~Schema} schema The schema.
  98577. // @param {module:engine/model/range~Range} range The range to find the position in.
  98578. // @param {'forward'|'backward'} direction Search direction.
  98579. // @returns {module:engine/model/position~Position|null} The nearest selection position.
  98580. //
  98581. function getNearestTextPosition( schema, range, direction ) {
  98582. const position = direction == 'backward' ? range.end : range.start;
  98583. if ( schema.checkChild( position, '$text' ) ) {
  98584. return position;
  98585. }
  98586. for ( const { nextPosition } of range.getWalker( { direction } ) ) {
  98587. if ( schema.checkChild( nextPosition, '$text' ) ) {
  98588. return nextPosition;
  98589. }
  98590. }
  98591. return null;
  98592. }
  98593. // Checks if the DOM range corresponding to the provided model range renders as a single line by analyzing DOMRects
  98594. // (verifying if they visually wrap content to the next line).
  98595. //
  98596. // @param {module:engine/controller/editingcontroller~EditingController} editing The editing controller.
  98597. // @param {module:engine/model/range~Range} modelRange The current table cell content range.
  98598. // @param {Boolean} isForward The expected navigation direction.
  98599. // @returns {Boolean}
  98600. //
  98601. function isSingleLineRange( editing, modelRange, isForward ) {
  98602. const model = editing.model;
  98603. const domConverter = editing.view.domConverter;
  98604. // Wrapped lines contain exactly the same position at the end of current line
  98605. // and at the beginning of next line. That position's client rect is at the end
  98606. // of current line. In case of caret at first position of the last line that 'dual'
  98607. // position would be detected as it's not the last line.
  98608. if ( isForward ) {
  98609. const probe = model.createSelection( modelRange.start );
  98610. model.modifySelection( probe );
  98611. // If the new position is at the end of the container then we can't use this position
  98612. // because it would provide incorrect result for eg caption of image and selection
  98613. // just before end of it. Also in this case there is no "dual" position.
  98614. if ( !probe.focus.isAtEnd && !modelRange.start.isEqual( probe.focus ) ) {
  98615. modelRange = model.createRange( probe.focus, modelRange.end );
  98616. }
  98617. }
  98618. const viewRange = editing.mapper.toViewRange( modelRange );
  98619. const domRange = domConverter.viewRangeToDom( viewRange );
  98620. const rects = _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_1__["default"].getDomRangeRects( domRange );
  98621. let boundaryVerticalPosition;
  98622. for ( const rect of rects ) {
  98623. if ( boundaryVerticalPosition === undefined ) {
  98624. boundaryVerticalPosition = Math.round( rect.bottom );
  98625. continue;
  98626. }
  98627. // Let's check if this rect is in new line.
  98628. if ( Math.round( rect.top ) >= boundaryVerticalPosition ) {
  98629. return false;
  98630. }
  98631. boundaryVerticalPosition = Math.max( boundaryVerticalPosition, Math.round( rect.bottom ) );
  98632. }
  98633. return true;
  98634. }
  98635. function selectionWillShrink( selection, isForward ) {
  98636. return !selection.isCollapsed && selection.isBackward == isForward;
  98637. }
  98638. /***/ }),
  98639. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widget.js":
  98640. /*!***************************************************************!*\
  98641. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widget.js ***!
  98642. \***************************************************************/
  98643. /*! exports provided: default */
  98644. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98645. "use strict";
  98646. __webpack_require__.r(__webpack_exports__);
  98647. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Widget; });
  98648. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  98649. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/mouseobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js");
  98650. /* harmony import */ var _widgettypearound_widgettypearound__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./widgettypearound/widgettypearound */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js");
  98651. /* harmony import */ var _ckeditor_ckeditor5_typing_src_delete__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/delete */ "./node_modules/@ckeditor/ckeditor5-typing/src/delete.js");
  98652. /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  98653. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  98654. /* harmony import */ var _verticalnavigation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./verticalnavigation */ "./node_modules/@ckeditor/ckeditor5-widget/src/verticalnavigation.js");
  98655. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  98656. /* harmony import */ var _theme_widget_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../theme/widget.css */ "./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css");
  98657. /**
  98658. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  98659. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  98660. */
  98661. /**
  98662. * @module widget/widget
  98663. */
  98664. /**
  98665. * The widget plugin. It enables base support for widgets.
  98666. *
  98667. * See {@glink api/widget package page} for more details and documentation.
  98668. *
  98669. * This plugin enables multiple behaviors required by widgets:
  98670. *
  98671. * * The model to view selection converter for the editing pipeline (it handles widget custom selection rendering).
  98672. * If a converted selection wraps around a widget element, that selection is marked as
  98673. * {@link module:engine/view/selection~Selection#isFake fake}. Additionally, the `ck-widget_selected` CSS class
  98674. * is added to indicate that widget has been selected.
  98675. * * The mouse and keyboard events handling on and around widget elements.
  98676. *
  98677. * @extends module:core/plugin~Plugin
  98678. */
  98679. class Widget extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  98680. /**
  98681. * @inheritDoc
  98682. */
  98683. static get pluginName() {
  98684. return 'Widget';
  98685. }
  98686. /**
  98687. * @inheritDoc
  98688. */
  98689. static get requires() {
  98690. return [ _widgettypearound_widgettypearound__WEBPACK_IMPORTED_MODULE_2__["default"], _ckeditor_ckeditor5_typing_src_delete__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  98691. }
  98692. /**
  98693. * @inheritDoc
  98694. */
  98695. init() {
  98696. const editor = this.editor;
  98697. const view = editor.editing.view;
  98698. const viewDocument = view.document;
  98699. /**
  98700. * Holds previously selected widgets.
  98701. *
  98702. * @private
  98703. * @type {Set.<module:engine/view/element~Element>}
  98704. */
  98705. this._previouslySelected = new Set();
  98706. // Model to view selection converter.
  98707. // Converts selection placed over widget element to fake selection.
  98708. //
  98709. // By default, the selection is downcasted by the engine to surround the attribute element, even though its only
  98710. // child is an inline widget. A similar thing also happens when a collapsed marker is rendered as a UI element
  98711. // next to an inline widget: the view selection contains both the widget and the marker.
  98712. //
  98713. // This prevents creating a correct fake selection when this inline widget is selected. Normalize the selection
  98714. // in these cases based on the model:
  98715. //
  98716. // [<attributeElement><inlineWidget /></attributeElement>] -> <attributeElement>[<inlineWidget />]</attributeElement>
  98717. // [<uiElement></uiElement><inlineWidget />] -> <uiElement></uiElement>[<inlineWidget />]
  98718. //
  98719. // Thanks to this:
  98720. //
  98721. // * fake selection can be set correctly,
  98722. // * any logic depending on (View)Selection#getSelectedElement() also works OK.
  98723. //
  98724. // See https://github.com/ckeditor/ckeditor5/issues/9524.
  98725. this.editor.editing.downcastDispatcher.on( 'selection', ( evt, data, conversionApi ) => {
  98726. const viewWriter = conversionApi.writer;
  98727. const modelSelection = data.selection;
  98728. // The collapsed selection can't contain any widget.
  98729. if ( modelSelection.isCollapsed ) {
  98730. return;
  98731. }
  98732. const selectedModelElement = modelSelection.getSelectedElement();
  98733. if ( !selectedModelElement ) {
  98734. return;
  98735. }
  98736. const selectedViewElement = editor.editing.mapper.toViewElement( selectedModelElement );
  98737. if ( !Object(_utils__WEBPACK_IMPORTED_MODULE_7__["isWidget"])( selectedViewElement ) ) {
  98738. return;
  98739. }
  98740. if ( !conversionApi.consumable.consume( modelSelection, 'selection' ) ) {
  98741. return;
  98742. }
  98743. viewWriter.setSelection( viewWriter.createRangeOn( selectedViewElement ), {
  98744. fake: true,
  98745. label: Object(_utils__WEBPACK_IMPORTED_MODULE_7__["getLabel"])( selectedViewElement )
  98746. } );
  98747. } );
  98748. // Mark all widgets inside the selection with the css class.
  98749. // This handler is registered at the 'low' priority so it's triggered after the real selection conversion.
  98750. this.editor.editing.downcastDispatcher.on( 'selection', ( evt, data, conversionApi ) => {
  98751. // Remove selected class from previously selected widgets.
  98752. this._clearPreviouslySelectedWidgets( conversionApi.writer );
  98753. const viewWriter = conversionApi.writer;
  98754. const viewSelection = viewWriter.document.selection;
  98755. let lastMarked = null;
  98756. for ( const range of viewSelection.getRanges() ) {
  98757. // Note: There could be multiple selected widgets in a range but no fake selection.
  98758. // All of them must be marked as selected, for instance [<widget></widget><widget></widget>]
  98759. for ( const value of range ) {
  98760. const node = value.item;
  98761. // Do not mark nested widgets in selected one. See: #4594
  98762. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_7__["isWidget"])( node ) && !isChild( node, lastMarked ) ) {
  98763. viewWriter.addClass( _utils__WEBPACK_IMPORTED_MODULE_7__["WIDGET_SELECTED_CLASS_NAME"], node );
  98764. this._previouslySelected.add( node );
  98765. lastMarked = node;
  98766. }
  98767. }
  98768. }
  98769. }, { priority: 'low' } );
  98770. // If mouse down is pressed on widget - create selection over whole widget.
  98771. view.addObserver( _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
  98772. this.listenTo( viewDocument, 'mousedown', ( ...args ) => this._onMousedown( ...args ) );
  98773. // There are two keydown listeners working on different priorities. This allows other
  98774. // features such as WidgetTypeAround or TableKeyboard to attach their listeners in between
  98775. // and customize the behavior even further in different content/selection scenarios.
  98776. //
  98777. // * The first listener handles changing the selection on arrow key press
  98778. // if the widget is selected or if the selection is next to a widget and the widget
  98779. // should become selected upon the arrow key press.
  98780. //
  98781. // * The second (late) listener makes sure the default browser action on arrow key press is
  98782. // prevented when a widget is selected. This prevents the selection from being moved
  98783. // from a fake selection container.
  98784. this.listenTo( viewDocument, 'arrowKey', ( ...args ) => {
  98785. this._handleSelectionChangeOnArrowKeyPress( ...args );
  98786. }, { context: [ _utils__WEBPACK_IMPORTED_MODULE_7__["isWidget"], '$text' ] } );
  98787. this.listenTo( viewDocument, 'arrowKey', ( ...args ) => {
  98788. this._preventDefaultOnArrowKeyPress( ...args );
  98789. }, { context: '$root' } );
  98790. this.listenTo( viewDocument, 'arrowKey', Object(_verticalnavigation__WEBPACK_IMPORTED_MODULE_6__["default"])( this.editor.editing ), { context: '$text' } );
  98791. // Handle custom delete behaviour.
  98792. this.listenTo( viewDocument, 'delete', ( evt, data ) => {
  98793. if ( this._handleDelete( data.direction == 'forward' ) ) {
  98794. data.preventDefault();
  98795. evt.stop();
  98796. }
  98797. }, { context: '$root' } );
  98798. }
  98799. /**
  98800. * Handles {@link module:engine/view/document~Document#event:mousedown mousedown} events on widget elements.
  98801. *
  98802. * @private
  98803. * @param {module:utils/eventinfo~EventInfo} eventInfo
  98804. * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
  98805. */
  98806. _onMousedown( eventInfo, domEventData ) {
  98807. const editor = this.editor;
  98808. const view = editor.editing.view;
  98809. const viewDocument = view.document;
  98810. let element = domEventData.target;
  98811. // Do nothing for single or double click inside nested editable.
  98812. if ( isInsideNestedEditable( element ) ) {
  98813. // But at least triple click inside nested editable causes broken selection in Safari.
  98814. // For such event, we select the entire nested editable element.
  98815. // See: https://github.com/ckeditor/ckeditor5/issues/1463.
  98816. if ( ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_4__["default"].isSafari || _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_4__["default"].isGecko ) && domEventData.domEvent.detail >= 3 ) {
  98817. const mapper = editor.editing.mapper;
  98818. const viewElement = element.is( 'attributeElement' ) ?
  98819. element.findAncestor( element => !element.is( 'attributeElement' ) ) : element;
  98820. const modelElement = mapper.toModelElement( viewElement );
  98821. domEventData.preventDefault();
  98822. this.editor.model.change( writer => {
  98823. writer.setSelection( modelElement, 'in' );
  98824. } );
  98825. }
  98826. return;
  98827. }
  98828. // If target is not a widget element - check if one of the ancestors is.
  98829. if ( !Object(_utils__WEBPACK_IMPORTED_MODULE_7__["isWidget"])( element ) ) {
  98830. element = element.findAncestor( _utils__WEBPACK_IMPORTED_MODULE_7__["isWidget"] );
  98831. if ( !element ) {
  98832. return;
  98833. }
  98834. }
  98835. // On Android selection would jump to the first table cell, on other devices
  98836. // we can't block it (and don't need to) because of drag and drop support.
  98837. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_4__["default"].isAndroid ) {
  98838. domEventData.preventDefault();
  98839. }
  98840. // Focus editor if is not focused already.
  98841. if ( !viewDocument.isFocused ) {
  98842. view.focus();
  98843. }
  98844. // Create model selection over widget.
  98845. const modelElement = editor.editing.mapper.toModelElement( element );
  98846. this._setSelectionOverElement( modelElement );
  98847. }
  98848. /**
  98849. * Handles {@link module:engine/view/document~Document#event:keydown keydown} events and changes
  98850. * the model selection when:
  98851. *
  98852. * * arrow key is pressed when the widget is selected,
  98853. * * the selection is next to a widget and the widget should become selected upon the arrow key press.
  98854. *
  98855. * See {@link #_preventDefaultOnArrowKeyPress}.
  98856. *
  98857. * @private
  98858. * @param {module:utils/eventinfo~EventInfo} eventInfo
  98859. * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
  98860. */
  98861. _handleSelectionChangeOnArrowKeyPress( eventInfo, domEventData ) {
  98862. const keyCode = domEventData.keyCode;
  98863. const model = this.editor.model;
  98864. const schema = model.schema;
  98865. const modelSelection = model.document.selection;
  98866. const objectElement = modelSelection.getSelectedElement();
  98867. const direction = Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_5__["getLocalizedArrowKeyCodeDirection"])( keyCode, this.editor.locale.contentLanguageDirection );
  98868. const isForward = direction == 'down' || direction == 'right';
  98869. const isVerticalNavigation = direction == 'up' || direction == 'down';
  98870. // If object element is selected.
  98871. if ( objectElement && schema.isObject( objectElement ) ) {
  98872. const position = isForward ? modelSelection.getLastPosition() : modelSelection.getFirstPosition();
  98873. const newRange = schema.getNearestSelectionRange( position, isForward ? 'forward' : 'backward' );
  98874. if ( newRange ) {
  98875. model.change( writer => {
  98876. writer.setSelection( newRange );
  98877. } );
  98878. domEventData.preventDefault();
  98879. eventInfo.stop();
  98880. }
  98881. return;
  98882. }
  98883. // Handle collapsing of the selection when there is any widget on the edge of selection.
  98884. // This is needed because browsers have problems with collapsing such selection.
  98885. if ( !modelSelection.isCollapsed && !domEventData.shiftKey ) {
  98886. const firstPosition = modelSelection.getFirstPosition();
  98887. const lastPosition = modelSelection.getLastPosition();
  98888. const firstSelectedNode = firstPosition.nodeAfter;
  98889. const lastSelectedNode = lastPosition.nodeBefore;
  98890. if ( firstSelectedNode && schema.isObject( firstSelectedNode ) || lastSelectedNode && schema.isObject( lastSelectedNode ) ) {
  98891. model.change( writer => {
  98892. writer.setSelection( isForward ? lastPosition : firstPosition );
  98893. } );
  98894. domEventData.preventDefault();
  98895. eventInfo.stop();
  98896. }
  98897. return;
  98898. }
  98899. // Return if not collapsed.
  98900. if ( !modelSelection.isCollapsed ) {
  98901. return;
  98902. }
  98903. // If selection is next to object element.
  98904. const objectElementNextToSelection = this._getObjectElementNextToSelection( isForward );
  98905. if ( objectElementNextToSelection && schema.isObject( objectElementNextToSelection ) ) {
  98906. // Do not select an inline widget while handling up/down arrow.
  98907. if ( schema.isInline( objectElementNextToSelection ) && isVerticalNavigation ) {
  98908. return;
  98909. }
  98910. this._setSelectionOverElement( objectElementNextToSelection );
  98911. domEventData.preventDefault();
  98912. eventInfo.stop();
  98913. }
  98914. }
  98915. /**
  98916. * Handles {@link module:engine/view/document~Document#event:keydown keydown} events and prevents
  98917. * the default browser behavior to make sure the fake selection is not being moved from a fake selection
  98918. * container.
  98919. *
  98920. * See {@link #_handleSelectionChangeOnArrowKeyPress}.
  98921. *
  98922. * @private
  98923. * @param {module:utils/eventinfo~EventInfo} eventInfo
  98924. * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
  98925. */
  98926. _preventDefaultOnArrowKeyPress( eventInfo, domEventData ) {
  98927. const model = this.editor.model;
  98928. const schema = model.schema;
  98929. const objectElement = model.document.selection.getSelectedElement();
  98930. // If object element is selected.
  98931. if ( objectElement && schema.isObject( objectElement ) ) {
  98932. domEventData.preventDefault();
  98933. eventInfo.stop();
  98934. }
  98935. }
  98936. /**
  98937. * Handles delete keys: backspace and delete.
  98938. *
  98939. * @private
  98940. * @param {Boolean} isForward Set to true if delete was performed in forward direction.
  98941. * @returns {Boolean|undefined} Returns `true` if keys were handled correctly.
  98942. */
  98943. _handleDelete( isForward ) {
  98944. // Do nothing when the read only mode is enabled.
  98945. if ( this.editor.isReadOnly ) {
  98946. return;
  98947. }
  98948. const modelDocument = this.editor.model.document;
  98949. const modelSelection = modelDocument.selection;
  98950. // Do nothing on non-collapsed selection.
  98951. if ( !modelSelection.isCollapsed ) {
  98952. return;
  98953. }
  98954. const objectElement = this._getObjectElementNextToSelection( isForward );
  98955. if ( objectElement ) {
  98956. this.editor.model.change( writer => {
  98957. let previousNode = modelSelection.anchor.parent;
  98958. // Remove previous element if empty.
  98959. while ( previousNode.isEmpty ) {
  98960. const nodeToRemove = previousNode;
  98961. previousNode = nodeToRemove.parent;
  98962. writer.remove( nodeToRemove );
  98963. }
  98964. this._setSelectionOverElement( objectElement );
  98965. } );
  98966. return true;
  98967. }
  98968. }
  98969. /**
  98970. * Sets {@link module:engine/model/selection~Selection document's selection} over given element.
  98971. *
  98972. * @protected
  98973. * @param {module:engine/model/element~Element} element
  98974. */
  98975. _setSelectionOverElement( element ) {
  98976. this.editor.model.change( writer => {
  98977. writer.setSelection( writer.createRangeOn( element ) );
  98978. } );
  98979. }
  98980. /**
  98981. * Checks if {@link module:engine/model/element~Element element} placed next to the current
  98982. * {@link module:engine/model/selection~Selection model selection} exists and is marked in
  98983. * {@link module:engine/model/schema~Schema schema} as `object`.
  98984. *
  98985. * @protected
  98986. * @param {Boolean} forward Direction of checking.
  98987. * @returns {module:engine/model/element~Element|null}
  98988. */
  98989. _getObjectElementNextToSelection( forward ) {
  98990. const model = this.editor.model;
  98991. const schema = model.schema;
  98992. const modelSelection = model.document.selection;
  98993. // Clone current selection to use it as a probe. We must leave default selection as it is so it can return
  98994. // to its current state after undo.
  98995. const probe = model.createSelection( modelSelection );
  98996. model.modifySelection( probe, { direction: forward ? 'forward' : 'backward' } );
  98997. // The selection didn't change so there is nothing there.
  98998. if ( probe.isEqual( modelSelection ) ) {
  98999. return null;
  99000. }
  99001. const objectElement = forward ? probe.focus.nodeBefore : probe.focus.nodeAfter;
  99002. if ( !!objectElement && schema.isObject( objectElement ) ) {
  99003. return objectElement;
  99004. }
  99005. return null;
  99006. }
  99007. /**
  99008. * Removes CSS class from previously selected widgets.
  99009. *
  99010. * @private
  99011. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  99012. */
  99013. _clearPreviouslySelectedWidgets( writer ) {
  99014. for ( const widget of this._previouslySelected ) {
  99015. writer.removeClass( _utils__WEBPACK_IMPORTED_MODULE_7__["WIDGET_SELECTED_CLASS_NAME"], widget );
  99016. }
  99017. this._previouslySelected.clear();
  99018. }
  99019. }
  99020. // Returns `true` when element is a nested editable or is placed inside one.
  99021. //
  99022. // @param {module:engine/view/element~Element}
  99023. // @returns {Boolean}
  99024. function isInsideNestedEditable( element ) {
  99025. while ( element ) {
  99026. if ( element.is( 'editableElement' ) && !element.is( 'rootElement' ) ) {
  99027. return true;
  99028. }
  99029. // Click on nested widget should select it.
  99030. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_7__["isWidget"])( element ) ) {
  99031. return false;
  99032. }
  99033. element = element.parent;
  99034. }
  99035. return false;
  99036. }
  99037. // Checks whether the specified `element` is a child of the `parent` element.
  99038. //
  99039. // @param {module:engine/view/element~Element} element An element to check.
  99040. // @param {module:engine/view/element~Element|null} parent A parent for the element.
  99041. // @returns {Boolean}
  99042. function isChild( element, parent ) {
  99043. if ( !parent ) {
  99044. return false;
  99045. }
  99046. return Array.from( element.getAncestors() ).includes( parent );
  99047. }
  99048. /***/ }),
  99049. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize.js":
  99050. /*!*********************************************************************!*\
  99051. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize.js ***!
  99052. \*********************************************************************/
  99053. /*! exports provided: default */
  99054. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99055. "use strict";
  99056. __webpack_require__.r(__webpack_exports__);
  99057. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WidgetResize; });
  99058. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  99059. /* harmony import */ var _widgetresize_resizer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./widgetresize/resizer */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizer.js");
  99060. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
  99061. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  99062. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  99063. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/mouseobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js");
  99064. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  99065. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  99066. /* harmony import */ var _theme_widgetresize_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../theme/widgetresize.css */ "./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css");
  99067. /**
  99068. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  99069. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  99070. */
  99071. /**
  99072. * @module widget/widgetresize
  99073. */
  99074. /**
  99075. * The widget resize feature plugin.
  99076. *
  99077. * Use the {@link module:widget/widgetresize~WidgetResize#attachTo} method to create a resizer for the specified widget.
  99078. *
  99079. * @extends module:core/plugin~Plugin
  99080. * @mixes module:utils/observablemixin~ObservableMixin
  99081. */
  99082. class WidgetResize extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  99083. /**
  99084. * @inheritDoc
  99085. */
  99086. static get pluginName() {
  99087. return 'WidgetResize';
  99088. }
  99089. /**
  99090. * @inheritDoc
  99091. */
  99092. init() {
  99093. const editing = this.editor.editing;
  99094. const domDocument = _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_3__["default"].window.document;
  99095. /**
  99096. * The currently visible resizer.
  99097. *
  99098. * @observable
  99099. * @member {module:widget/widgetresize/resizer~Resizer|null} #visibleResizer
  99100. */
  99101. this.set( 'visibleResizer', null );
  99102. /**
  99103. * References an active resizer.
  99104. *
  99105. * Active resizer means a resizer which handle is actively used by the end user.
  99106. *
  99107. * @protected
  99108. * @observable
  99109. * @member {module:widget/widgetresize/resizer~Resizer|null} #_activeResizer
  99110. */
  99111. this.set( '_activeResizer', null );
  99112. /**
  99113. * A map of resizers created using this plugin instance.
  99114. *
  99115. * @protected
  99116. * @type {Map.<module:engine/view/containerelement~ContainerElement, module:widget/widgetresize/resizer~Resizer>}
  99117. */
  99118. this._resizers = new Map();
  99119. editing.view.addObserver( _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_5__["default"] );
  99120. this._observer = Object.create( _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  99121. this.listenTo( editing.view.document, 'mousedown', this._mouseDownListener.bind( this ), { priority: 'high' } );
  99122. this._observer.listenTo( domDocument, 'mousemove', this._mouseMoveListener.bind( this ) );
  99123. this._observer.listenTo( domDocument, 'mouseup', this._mouseUpListener.bind( this ) );
  99124. const redrawFocusedResizer = () => {
  99125. if ( this.visibleResizer ) {
  99126. this.visibleResizer.redraw();
  99127. }
  99128. };
  99129. this._redrawFocusedResizerThrottled = Object(lodash_es__WEBPACK_IMPORTED_MODULE_7__["throttle"])( redrawFocusedResizer, 200 );
  99130. // Redraws occurring upon a change of visible resizer must not be throttled, as it is crucial for the initial
  99131. // render. Without it the resizer frame would be misaligned with resizing host for a fraction of second.
  99132. this.on( 'change:visibleResizer', redrawFocusedResizer );
  99133. // Redrawing on any change of the UI of the editor (including content changes).
  99134. this.editor.ui.on( 'update', this._redrawFocusedResizerThrottled );
  99135. // Remove view widget-resizer mappings for widgets that have been removed from the document.
  99136. // https://github.com/ckeditor/ckeditor5/issues/10156
  99137. // https://github.com/ckeditor/ckeditor5/issues/10266
  99138. this.editor.model.document.on( 'change', () => {
  99139. for ( const [ viewElement, resizer ] of this._resizers ) {
  99140. if ( !viewElement.isAttached() ) {
  99141. this._resizers.delete( viewElement );
  99142. resizer.destroy();
  99143. }
  99144. }
  99145. }, { priority: 'lowest' } );
  99146. // Resizers need to be redrawn upon window resize, because new window might shrink resize host.
  99147. this._observer.listenTo( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_3__["default"].window, 'resize', this._redrawFocusedResizerThrottled );
  99148. const viewSelection = this.editor.editing.view.document.selection;
  99149. viewSelection.on( 'change', () => {
  99150. const selectedElement = viewSelection.getSelectedElement();
  99151. this.visibleResizer = this.getResizerByViewElement( selectedElement ) || null;
  99152. } );
  99153. }
  99154. /**
  99155. * @inheritDoc
  99156. */
  99157. destroy() {
  99158. this._observer.stopListening();
  99159. for ( const resizer of this._resizers.values() ) {
  99160. resizer.destroy();
  99161. }
  99162. this._redrawFocusedResizerThrottled.cancel();
  99163. }
  99164. /**
  99165. * @param {module:widget/widgetresize~ResizerOptions} [options] Resizer options.
  99166. * @returns {module:widget/widgetresize/resizer~Resizer}
  99167. */
  99168. attachTo( options ) {
  99169. const resizer = new _widgetresize_resizer__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  99170. const plugins = this.editor.plugins;
  99171. resizer.attach();
  99172. if ( plugins.has( 'WidgetToolbarRepository' ) ) {
  99173. // Hiding widget toolbar to improve the performance
  99174. // (https://github.com/ckeditor/ckeditor5-widget/pull/112#issuecomment-564528765).
  99175. const widgetToolbarRepository = plugins.get( 'WidgetToolbarRepository' );
  99176. resizer.on( 'begin', () => {
  99177. widgetToolbarRepository.forceDisabled( 'resize' );
  99178. }, { priority: 'lowest' } );
  99179. resizer.on( 'cancel', () => {
  99180. widgetToolbarRepository.clearForceDisabled( 'resize' );
  99181. }, { priority: 'highest' } );
  99182. resizer.on( 'commit', () => {
  99183. widgetToolbarRepository.clearForceDisabled( 'resize' );
  99184. }, { priority: 'highest' } );
  99185. }
  99186. this._resizers.set( options.viewElement, resizer );
  99187. const viewSelection = this.editor.editing.view.document.selection;
  99188. const selectedElement = viewSelection.getSelectedElement();
  99189. // If the element the resizer is created for is currently focused, it should become visible.
  99190. if ( this.getResizerByViewElement( selectedElement ) == resizer ) {
  99191. this.visibleResizer = resizer;
  99192. }
  99193. return resizer;
  99194. }
  99195. /**
  99196. * Returns a resizer created for a given view element (widget element).
  99197. *
  99198. * @param {module:engine/view/containerelement~ContainerElement} viewElement View element associated with the resizer.
  99199. * @returns {module:widget/widgetresize/resizer~Resizer|undefined}
  99200. */
  99201. getResizerByViewElement( viewElement ) {
  99202. return this._resizers.get( viewElement );
  99203. }
  99204. /**
  99205. * Returns a resizer that contains a given resize handle.
  99206. *
  99207. * @protected
  99208. * @param {HTMLElement} domResizeHandle
  99209. * @returns {module:widget/widgetresize/resizer~Resizer}
  99210. */
  99211. _getResizerByHandle( domResizeHandle ) {
  99212. for ( const resizer of this._resizers.values() ) {
  99213. if ( resizer.containsHandle( domResizeHandle ) ) {
  99214. return resizer;
  99215. }
  99216. }
  99217. }
  99218. /**
  99219. * @protected
  99220. * @param {module:utils/eventinfo~EventInfo} event
  99221. * @param {Event} domEventData Native DOM event.
  99222. */
  99223. _mouseDownListener( event, domEventData ) {
  99224. const resizeHandle = domEventData.domTarget;
  99225. if ( !_widgetresize_resizer__WEBPACK_IMPORTED_MODULE_1__["default"].isResizeHandle( resizeHandle ) ) {
  99226. return;
  99227. }
  99228. this._activeResizer = this._getResizerByHandle( resizeHandle );
  99229. if ( this._activeResizer ) {
  99230. this._activeResizer.begin( resizeHandle );
  99231. // Do not call other events when resizing. See: #6755.
  99232. event.stop();
  99233. domEventData.preventDefault();
  99234. }
  99235. }
  99236. /**
  99237. * @protected
  99238. * @param {module:utils/eventinfo~EventInfo} event
  99239. * @param {Event} domEventData Native DOM event.
  99240. */
  99241. _mouseMoveListener( event, domEventData ) {
  99242. if ( this._activeResizer ) {
  99243. this._activeResizer.updateSize( domEventData );
  99244. }
  99245. }
  99246. /**
  99247. * @protected
  99248. */
  99249. _mouseUpListener() {
  99250. if ( this._activeResizer ) {
  99251. this._activeResizer.commit();
  99252. this._activeResizer = null;
  99253. }
  99254. }
  99255. }
  99256. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( WidgetResize, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
  99257. /**
  99258. * Interface describing a resizer. It allows to specify the resizing host, custom logic for calculating aspect ratio, etc.
  99259. *
  99260. * @interface ResizerOptions
  99261. */
  99262. /**
  99263. * Editor instance associated with the resizer.
  99264. *
  99265. * @member {module:core/editor/editor~Editor} module:widget/widgetresize~ResizerOptions#editor
  99266. */
  99267. /**
  99268. * @member {module:engine/model/element~Element} module:widget/widgetresize~ResizerOptions#modelElement
  99269. */
  99270. /**
  99271. * A view of an element to be resized. Typically it's the main widget's view instance.
  99272. *
  99273. * @member {module:engine/view/containerelement~ContainerElement} module:widget/widgetresize~ResizerOptions#viewElement
  99274. */
  99275. /**
  99276. * A callback to be executed once the resizing process is done.
  99277. *
  99278. * It receives a `Number` (`newValue`) as a parameter.
  99279. *
  99280. * For example, {@link module:image/imageresize~ImageResize} uses it to execute the resize image command
  99281. * which puts the new value into the model.
  99282. *
  99283. * ```js
  99284. * {
  99285. * editor,
  99286. * modelElement: data.item,
  99287. * viewElement: widget,
  99288. *
  99289. * onCommit( newValue ) {
  99290. * editor.execute( 'resizeImage', { width: newValue } );
  99291. * }
  99292. * };
  99293. * ```
  99294. *
  99295. *
  99296. * @member {Function} module:widget/widgetresize~ResizerOptions#onCommit
  99297. */
  99298. /**
  99299. * @member {Function} module:widget/widgetresize~ResizerOptions#getResizeHost
  99300. */
  99301. /**
  99302. * @member {Function} module:widget/widgetresize~ResizerOptions#isCentered
  99303. */
  99304. /***/ }),
  99305. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizer.js":
  99306. /*!*****************************************************************************!*\
  99307. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizer.js ***!
  99308. \*****************************************************************************/
  99309. /*! exports provided: default */
  99310. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99311. "use strict";
  99312. __webpack_require__.r(__webpack_exports__);
  99313. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Resizer; });
  99314. /* harmony import */ var _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
  99315. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  99316. /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
  99317. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  99318. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  99319. /* harmony import */ var _resizerstate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./resizerstate */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate.js");
  99320. /* harmony import */ var _sizeview__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./sizeview */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/sizeview.js");
  99321. /**
  99322. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  99323. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  99324. */
  99325. /**
  99326. * @module widget/widgetresize/resizer
  99327. */
  99328. /**
  99329. * Represents a resizer for a single resizable object.
  99330. *
  99331. * @mixes module:utils/observablemixin~ObservableMixin
  99332. */
  99333. class Resizer {
  99334. /**
  99335. * @param {module:widget/widgetresize~ResizerOptions} options Resizer options.
  99336. */
  99337. constructor( options ) {
  99338. /**
  99339. * Stores the state of the resizable host geometry, such as the original width, the currently proposed height, etc.
  99340. *
  99341. * Note that a new state is created for each resize transaction.
  99342. *
  99343. * @readonly
  99344. * @member {module:widget/widgetresize/resizerstate~ResizerState} #state
  99345. */
  99346. /**
  99347. * A view displaying the proposed new element size during the resizing.
  99348. *
  99349. * @protected
  99350. * @readonly
  99351. * @member {module:widget/widgetresize/sizeview~SizeView} #_sizeView
  99352. */
  99353. /**
  99354. * Options passed to the {@link #constructor}.
  99355. *
  99356. * @private
  99357. * @type {module:widget/widgetresize~ResizerOptions}
  99358. */
  99359. this._options = options;
  99360. /**
  99361. * A wrapper that is controlled by the resizer. This is usually a widget element.
  99362. *
  99363. * @private
  99364. * @type {module:engine/view/element~Element|null}
  99365. */
  99366. this._viewResizerWrapper = null;
  99367. /**
  99368. * The width of the resized {@link module:widget/widgetresize~ResizerOptions#viewElement viewElement} before the resizing started.
  99369. *
  99370. * @private
  99371. * @member {Number|String|undefined} #_initialViewWidth
  99372. */
  99373. /**
  99374. * @observable
  99375. */
  99376. this.set( 'isEnabled', true );
  99377. this.decorate( 'begin' );
  99378. this.decorate( 'cancel' );
  99379. this.decorate( 'commit' );
  99380. this.decorate( 'updateSize' );
  99381. this.on( 'commit', event => {
  99382. // State might not be initialized yet. In this case, prevent further handling and make sure that the resizer is
  99383. // cleaned up (#5195).
  99384. if ( !this.state.proposedWidth && !this.state.proposedWidthPercents ) {
  99385. this._cleanup();
  99386. event.stop();
  99387. }
  99388. }, { priority: 'high' } );
  99389. this.on( 'change:isEnabled', () => {
  99390. // We should redraw the resize handles when the plugin is enabled again.
  99391. // Otherwise they won't show up.
  99392. if ( this.isEnabled ) {
  99393. this.redraw();
  99394. }
  99395. } );
  99396. }
  99397. /**
  99398. * Attaches the resizer to the DOM.
  99399. */
  99400. attach() {
  99401. const that = this;
  99402. const widgetElement = this._options.viewElement;
  99403. const editingView = this._options.editor.editing.view;
  99404. editingView.change( writer => {
  99405. const viewResizerWrapper = writer.createUIElement( 'div', {
  99406. class: 'ck ck-reset_all ck-widget__resizer'
  99407. }, function( domDocument ) {
  99408. const domElement = this.toDomElement( domDocument );
  99409. that._appendHandles( domElement );
  99410. that._appendSizeUI( domElement );
  99411. that.on( 'change:isEnabled', ( evt, propName, newValue ) => {
  99412. domElement.style.display = newValue ? '' : 'none';
  99413. } );
  99414. domElement.style.display = that.isEnabled ? '' : 'none';
  99415. return domElement;
  99416. } );
  99417. // Append the resizer wrapper to the widget's wrapper.
  99418. writer.insert( writer.createPositionAt( widgetElement, 'end' ), viewResizerWrapper );
  99419. writer.addClass( 'ck-widget_with-resizer', widgetElement );
  99420. this._viewResizerWrapper = viewResizerWrapper;
  99421. } );
  99422. }
  99423. /**
  99424. * Starts the resizing process.
  99425. *
  99426. * Creates a new {@link #state} for the current process.
  99427. *
  99428. * @fires begin
  99429. * @param {HTMLElement} domResizeHandle Clicked handle.
  99430. */
  99431. begin( domResizeHandle ) {
  99432. this.state = new _resizerstate__WEBPACK_IMPORTED_MODULE_5__["default"]( this._options );
  99433. this._sizeView._bindToState( this._options, this.state );
  99434. this._initialViewWidth = this._options.viewElement.getStyle( 'width' );
  99435. this.state.begin( domResizeHandle, this._getHandleHost(), this._getResizeHost() );
  99436. }
  99437. /**
  99438. * Updates the proposed size based on `domEventData`.
  99439. *
  99440. * @fires updateSize
  99441. * @param {Event} domEventData
  99442. */
  99443. updateSize( domEventData ) {
  99444. const newSize = this._proposeNewSize( domEventData );
  99445. const editingView = this._options.editor.editing.view;
  99446. editingView.change( writer => {
  99447. const unit = this._options.unit || '%';
  99448. const newWidth = ( unit === '%' ? newSize.widthPercents : newSize.width ) + unit;
  99449. writer.setStyle( 'width', newWidth, this._options.viewElement );
  99450. } );
  99451. // Get an actual image width, and:
  99452. // * reflect this size to the resize wrapper
  99453. // * apply this **real** size to the state
  99454. const domHandleHost = this._getHandleHost();
  99455. const domHandleHostRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_1__["default"]( domHandleHost );
  99456. newSize.handleHostWidth = Math.round( domHandleHostRect.width );
  99457. newSize.handleHostHeight = Math.round( domHandleHostRect.height );
  99458. // Handle max-width limitation.
  99459. const domResizeHostRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_1__["default"]( domHandleHost );
  99460. newSize.width = Math.round( domResizeHostRect.width );
  99461. newSize.height = Math.round( domResizeHostRect.height );
  99462. this.redraw( domHandleHostRect );
  99463. this.state.update( newSize );
  99464. }
  99465. /**
  99466. * Applies the geometry proposed with the resizer.
  99467. *
  99468. * @fires commit
  99469. */
  99470. commit() {
  99471. const unit = this._options.unit || '%';
  99472. const newValue = ( unit === '%' ? this.state.proposedWidthPercents : this.state.proposedWidth ) + unit;
  99473. // Both cleanup and onCommit callback are very likely to make view changes. Ensure that it is made in a single step.
  99474. this._options.editor.editing.view.change( () => {
  99475. this._cleanup();
  99476. this._options.onCommit( newValue );
  99477. } );
  99478. }
  99479. /**
  99480. * Cancels and rejects the proposed resize dimensions, hiding the UI.
  99481. *
  99482. * @fires cancel
  99483. */
  99484. cancel() {
  99485. this._cleanup();
  99486. }
  99487. /**
  99488. * Destroys the resizer.
  99489. */
  99490. destroy() {
  99491. this.cancel();
  99492. }
  99493. /**
  99494. * Redraws the resizer.
  99495. *
  99496. * @param {module:utils/dom/rect~Rect} [handleHostRect] Handle host rectangle might be given to improve performance.
  99497. */
  99498. redraw( handleHostRect ) {
  99499. const domWrapper = this._domResizerWrapper;
  99500. // Refresh only if resizer exists in the DOM.
  99501. if ( !existsInDom( domWrapper ) ) {
  99502. return;
  99503. }
  99504. const widgetWrapper = domWrapper.parentElement;
  99505. const handleHost = this._getHandleHost();
  99506. const resizerWrapper = this._viewResizerWrapper;
  99507. const currentDimensions = [
  99508. resizerWrapper.getStyle( 'width' ),
  99509. resizerWrapper.getStyle( 'height' ),
  99510. resizerWrapper.getStyle( 'left' ),
  99511. resizerWrapper.getStyle( 'top' )
  99512. ];
  99513. let newDimensions;
  99514. if ( widgetWrapper.isSameNode( handleHost ) ) {
  99515. const clientRect = handleHostRect || new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_1__["default"]( handleHost );
  99516. newDimensions = [
  99517. clientRect.width + 'px',
  99518. clientRect.height + 'px',
  99519. undefined,
  99520. undefined
  99521. ];
  99522. }
  99523. // In case a resizing host is not a widget wrapper, we need to compensate
  99524. // for any additional offsets the resize host might have. E.g. wrapper padding
  99525. // or simply another editable. By doing that the border and resizers are shown
  99526. // only around the resize host.
  99527. else {
  99528. newDimensions = [
  99529. handleHost.offsetWidth + 'px',
  99530. handleHost.offsetHeight + 'px',
  99531. handleHost.offsetLeft + 'px',
  99532. handleHost.offsetTop + 'px'
  99533. ];
  99534. }
  99535. // Make changes to the view only if the resizer should actually get new dimensions.
  99536. // Otherwise, if View#change() was always called, this would cause EditorUI#update
  99537. // loops because the WidgetResize plugin listens to EditorUI#update and updates
  99538. // the resizer.
  99539. // https://github.com/ckeditor/ckeditor5/issues/7633
  99540. if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_2__["default"])( currentDimensions, newDimensions ) !== 'same' ) {
  99541. this._options.editor.editing.view.change( writer => {
  99542. writer.setStyle( {
  99543. width: newDimensions[ 0 ],
  99544. height: newDimensions[ 1 ],
  99545. left: newDimensions[ 2 ],
  99546. top: newDimensions[ 3 ]
  99547. }, resizerWrapper );
  99548. } );
  99549. }
  99550. }
  99551. containsHandle( domElement ) {
  99552. return this._domResizerWrapper.contains( domElement );
  99553. }
  99554. static isResizeHandle( domElement ) {
  99555. return domElement.classList.contains( 'ck-widget__resizer__handle' );
  99556. }
  99557. /**
  99558. * Cleans up the context state.
  99559. *
  99560. * @protected
  99561. */
  99562. _cleanup() {
  99563. this._sizeView._dismiss();
  99564. const editingView = this._options.editor.editing.view;
  99565. editingView.change( writer => {
  99566. writer.setStyle( 'width', this._initialViewWidth, this._options.viewElement );
  99567. } );
  99568. }
  99569. /**
  99570. * Calculates the proposed size as the resize handles are dragged.
  99571. *
  99572. * @private
  99573. * @param {Event} domEventData Event data that caused the size update request. It should be used to calculate the proposed size.
  99574. * @returns {Object} return
  99575. * @returns {Number} return.width Proposed width.
  99576. * @returns {Number} return.height Proposed height.
  99577. */
  99578. _proposeNewSize( domEventData ) {
  99579. const state = this.state;
  99580. const currentCoordinates = extractCoordinates( domEventData );
  99581. const isCentered = this._options.isCentered ? this._options.isCentered( this ) : true;
  99582. // Enlargement defines how much the resize host has changed in a given axis. Naturally it could be a negative number
  99583. // meaning that it has been shrunk.
  99584. //
  99585. // +----------------+--+
  99586. // | | |
  99587. // | img | |
  99588. // | /handle host | |
  99589. // +----------------+ | ^
  99590. // | | | - enlarge y
  99591. // +-------------------+ v
  99592. // <-->
  99593. // enlarge x
  99594. const enlargement = {
  99595. x: state._referenceCoordinates.x - ( currentCoordinates.x + state.originalWidth ),
  99596. y: ( currentCoordinates.y - state.originalHeight ) - state._referenceCoordinates.y
  99597. };
  99598. if ( isCentered && state.activeHandlePosition.endsWith( '-right' ) ) {
  99599. enlargement.x = currentCoordinates.x - ( state._referenceCoordinates.x + state.originalWidth );
  99600. }
  99601. // Objects needs to be resized twice as much in horizontal axis if centered, since enlargement is counted from
  99602. // one resized corner to your cursor. It needs to be duplicated to compensate for the other side too.
  99603. if ( isCentered ) {
  99604. enlargement.x *= 2;
  99605. }
  99606. // const resizeHost = this._getResizeHost();
  99607. // The size proposed by the user. It does not consider the aspect ratio.
  99608. const proposedSize = {
  99609. width: Math.abs( state.originalWidth + enlargement.x ),
  99610. height: Math.abs( state.originalHeight + enlargement.y )
  99611. };
  99612. // Dominant determination must take the ratio into account.
  99613. proposedSize.dominant = proposedSize.width / state.aspectRatio > proposedSize.height ? 'width' : 'height';
  99614. proposedSize.max = proposedSize[ proposedSize.dominant ];
  99615. // Proposed size, respecting the aspect ratio.
  99616. const targetSize = {
  99617. width: proposedSize.width,
  99618. height: proposedSize.height
  99619. };
  99620. if ( proposedSize.dominant == 'width' ) {
  99621. targetSize.height = targetSize.width / state.aspectRatio;
  99622. } else {
  99623. targetSize.width = targetSize.height * state.aspectRatio;
  99624. }
  99625. return {
  99626. width: Math.round( targetSize.width ),
  99627. height: Math.round( targetSize.height ),
  99628. widthPercents: Math.min( Math.round( state.originalWidthPercents / state.originalWidth * targetSize.width * 100 ) / 100, 100 )
  99629. };
  99630. }
  99631. /**
  99632. * Obtains the resize host.
  99633. *
  99634. * Resize host is an object that receives dimensions which are the result of resizing.
  99635. *
  99636. * @protected
  99637. * @returns {HTMLElement}
  99638. */
  99639. _getResizeHost() {
  99640. const widgetWrapper = this._domResizerWrapper.parentElement;
  99641. return this._options.getResizeHost( widgetWrapper );
  99642. }
  99643. /**
  99644. * Obtains the handle host.
  99645. *
  99646. * Handle host is an object that the handles are aligned to.
  99647. *
  99648. * Handle host will not always be an entire widget itself. Take an image as an example. The image widget
  99649. * contains an image and a caption. Only the image should be surrounded with handles.
  99650. *
  99651. * @protected
  99652. * @returns {HTMLElement}
  99653. */
  99654. _getHandleHost() {
  99655. const widgetWrapper = this._domResizerWrapper.parentElement;
  99656. return this._options.getHandleHost( widgetWrapper );
  99657. }
  99658. /**
  99659. * DOM container of the entire resize UI.
  99660. *
  99661. * Note that this property will have a value only after the element bound with the resizer is rendered
  99662. * (otherwise `null`).
  99663. *
  99664. * @private
  99665. * @member {HTMLElement|null}
  99666. */
  99667. get _domResizerWrapper() {
  99668. return this._options.editor.editing.view.domConverter.mapViewToDom( this._viewResizerWrapper );
  99669. }
  99670. /**
  99671. * Renders the resize handles in the DOM.
  99672. *
  99673. * @private
  99674. * @param {HTMLElement} domElement The resizer wrapper.
  99675. */
  99676. _appendHandles( domElement ) {
  99677. const resizerPositions = [ 'top-left', 'top-right', 'bottom-right', 'bottom-left' ];
  99678. for ( const currentPosition of resizerPositions ) {
  99679. domElement.appendChild( ( new _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_0__["default"]( {
  99680. tag: 'div',
  99681. attributes: {
  99682. class: `ck-widget__resizer__handle ${ getResizerClass( currentPosition ) }`
  99683. }
  99684. } ).render() ) );
  99685. }
  99686. }
  99687. /**
  99688. * Sets up the {@link #_sizeView} property and adds it to the passed `domElement`.
  99689. *
  99690. * @private
  99691. * @param {HTMLElement} domElement
  99692. */
  99693. _appendSizeUI( domElement ) {
  99694. this._sizeView = new _sizeview__WEBPACK_IMPORTED_MODULE_6__["default"]();
  99695. // Make sure icon#element is rendered before passing to appendChild().
  99696. this._sizeView.render();
  99697. domElement.appendChild( this._sizeView.element );
  99698. }
  99699. /**
  99700. * @event begin
  99701. */
  99702. /**
  99703. * @event updateSize
  99704. */
  99705. /**
  99706. * @event commit
  99707. */
  99708. /**
  99709. * @event cancel
  99710. */
  99711. }
  99712. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_4__["default"])( Resizer, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  99713. // @private
  99714. // @param {String} resizerPosition Expected resizer position like `"top-left"`, `"bottom-right"`.
  99715. // @returns {String} A prefixed HTML class name for the resizer element
  99716. function getResizerClass( resizerPosition ) {
  99717. return `ck-widget__resizer__handle-${ resizerPosition }`;
  99718. }
  99719. function extractCoordinates( event ) {
  99720. return {
  99721. x: event.pageX,
  99722. y: event.pageY
  99723. };
  99724. }
  99725. function existsInDom( element ) {
  99726. return element && element.ownerDocument && element.ownerDocument.contains( element );
  99727. }
  99728. /***/ }),
  99729. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate.js":
  99730. /*!**********************************************************************************!*\
  99731. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate.js ***!
  99732. \**********************************************************************************/
  99733. /*! exports provided: default */
  99734. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99735. "use strict";
  99736. __webpack_require__.r(__webpack_exports__);
  99737. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ResizeState; });
  99738. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  99739. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  99740. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  99741. /**
  99742. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  99743. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  99744. */
  99745. /**
  99746. * @module widget/widgetresize/resizerstate
  99747. */
  99748. /**
  99749. * Stores the internal state of a single resizable object.
  99750. *
  99751. */
  99752. class ResizeState {
  99753. /**
  99754. * @param {module:widget/widgetresize~ResizerOptions} options Resizer options.
  99755. */
  99756. constructor( options ) {
  99757. /**
  99758. * The original width (pixels) of the resized object when the resize process was started.
  99759. *
  99760. * @readonly
  99761. * @member {Number} #originalWidth
  99762. */
  99763. /**
  99764. * The original height (pixels) of the resized object when the resize process was started.
  99765. *
  99766. * @readonly
  99767. * @member {Number} #originalHeight
  99768. */
  99769. /**
  99770. * The original width (percents) of the resized object when the resize process was started.
  99771. *
  99772. * @readonly
  99773. * @member {Number} #originalWidthPercents
  99774. */
  99775. /**
  99776. * The position of the handle that initiated the resizing. E.g. `"top-left"`, `"bottom-right"` etc. or `null`
  99777. * if unknown.
  99778. *
  99779. * @readonly
  99780. * @observable
  99781. * @member {String|null} #activeHandlePosition
  99782. */
  99783. this.set( 'activeHandlePosition', null );
  99784. /**
  99785. * The width (percents) proposed, but not committed yet, in the current resize process.
  99786. *
  99787. * @readonly
  99788. * @observable
  99789. * @member {Number|null} #proposedWidthPercents
  99790. */
  99791. this.set( 'proposedWidthPercents', null );
  99792. /**
  99793. * The width (pixels) proposed, but not committed yet, in the current resize process.
  99794. *
  99795. * @readonly
  99796. * @observable
  99797. * @member {Number|null} #proposedWidthPixels
  99798. */
  99799. this.set( 'proposedWidth', null );
  99800. /**
  99801. * The height (pixels) proposed, but not committed yet, in the current resize process.
  99802. *
  99803. * @readonly
  99804. * @observable
  99805. * @member {Number|null} #proposedHeightPixels
  99806. */
  99807. this.set( 'proposedHeight', null );
  99808. this.set( 'proposedHandleHostWidth', null );
  99809. this.set( 'proposedHandleHostHeight', null );
  99810. /**
  99811. * A width to height ratio of the resized image.
  99812. *
  99813. * @readonly
  99814. * @member {Number} #aspectRatio
  99815. */
  99816. /**
  99817. * @private
  99818. * @type {module:widget/widgetresize~ResizerOptions}
  99819. */
  99820. this._options = options;
  99821. /**
  99822. * The reference point of the resizer where the dragging started. It is used to measure the distance the user cursor
  99823. * traveled, so how much the image should be enlarged.
  99824. * This information is only known after the DOM was rendered, so it will be updated later.
  99825. *
  99826. * @private
  99827. * @type {Object}
  99828. */
  99829. this._referenceCoordinates = null;
  99830. }
  99831. /**
  99832. *
  99833. * @param {HTMLElement} domResizeHandle The handle used to calculate the reference point.
  99834. * @param {HTMLElement} domHandleHost
  99835. * @param {HTMLElement} domResizeHost
  99836. */
  99837. begin( domResizeHandle, domHandleHost, domResizeHost ) {
  99838. const clientRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_0__["default"]( domHandleHost );
  99839. this.activeHandlePosition = getHandlePosition( domResizeHandle );
  99840. this._referenceCoordinates = getAbsoluteBoundaryPoint( domHandleHost, getOppositePosition( this.activeHandlePosition ) );
  99841. this.originalWidth = clientRect.width;
  99842. this.originalHeight = clientRect.height;
  99843. this.aspectRatio = clientRect.width / clientRect.height;
  99844. const widthStyle = domResizeHost.style.width;
  99845. if ( widthStyle && widthStyle.match( /^\d+(\.\d*)?%$/ ) ) {
  99846. this.originalWidthPercents = parseFloat( widthStyle );
  99847. } else {
  99848. this.originalWidthPercents = calculateHostPercentageWidth( domResizeHost, clientRect );
  99849. }
  99850. }
  99851. update( newSize ) {
  99852. this.proposedWidth = newSize.width;
  99853. this.proposedHeight = newSize.height;
  99854. this.proposedWidthPercents = newSize.widthPercents;
  99855. this.proposedHandleHostWidth = newSize.handleHostWidth;
  99856. this.proposedHandleHostHeight = newSize.handleHostHeight;
  99857. }
  99858. }
  99859. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( ResizeState, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  99860. // Calculates a relative width of a `domResizeHost` compared to it's parent in percents.
  99861. //
  99862. // @private
  99863. // @param {HTMLElement} domResizeHost
  99864. // @param {module:utils/dom/rect~Rect} resizeHostRect
  99865. // @returns {Number}
  99866. function calculateHostPercentageWidth( domResizeHost, resizeHostRect ) {
  99867. const domResizeHostParent = domResizeHost.parentElement;
  99868. // Need to use computed style as it properly excludes parent's paddings from the returned value.
  99869. const parentWidth = parseFloat( domResizeHostParent.ownerDocument.defaultView.getComputedStyle( domResizeHostParent ).width );
  99870. return resizeHostRect.width / parentWidth * 100;
  99871. }
  99872. // Returns coordinates of the top-left corner of an element, relative to the document's top-left corner.
  99873. //
  99874. // @private
  99875. // @param {HTMLElement} element
  99876. // @param {String} resizerPosition The position of the resize handle, e.g. `"top-left"`, `"bottom-right"`.
  99877. // @returns {Object} return
  99878. // @returns {Number} return.x
  99879. // @returns {Number} return.y
  99880. function getAbsoluteBoundaryPoint( element, resizerPosition ) {
  99881. const elementRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_0__["default"]( element );
  99882. const positionParts = resizerPosition.split( '-' );
  99883. const ret = {
  99884. x: positionParts[ 1 ] == 'right' ? elementRect.right : elementRect.left,
  99885. y: positionParts[ 0 ] == 'bottom' ? elementRect.bottom : elementRect.top
  99886. };
  99887. ret.x += element.ownerDocument.defaultView.scrollX;
  99888. ret.y += element.ownerDocument.defaultView.scrollY;
  99889. return ret;
  99890. }
  99891. // @private
  99892. // @param {String} resizerPosition The expected resizer position, like `"top-left"`, `"bottom-right"`.
  99893. // @returns {String} A prefixed HTML class name for the resizer element.
  99894. function getResizerHandleClass( resizerPosition ) {
  99895. return `ck-widget__resizer__handle-${ resizerPosition }`;
  99896. }
  99897. // Determines the position of a given resize handle.
  99898. //
  99899. // @private
  99900. // @param {HTMLElement} domHandle Handle used to calculate the reference point.
  99901. // @returns {String|undefined} Returns a string like `"top-left"` or `undefined` if not matched.
  99902. function getHandlePosition( domHandle ) {
  99903. const resizerPositions = [ 'top-left', 'top-right', 'bottom-right', 'bottom-left' ];
  99904. for ( const position of resizerPositions ) {
  99905. if ( domHandle.classList.contains( getResizerHandleClass( position ) ) ) {
  99906. return position;
  99907. }
  99908. }
  99909. }
  99910. // @private
  99911. // @param {String} position Like `"top-left"`.
  99912. // @returns {String} Inverted `position`, e.g. it returns `"bottom-right"` if `"top-left"` was given as `position`.
  99913. function getOppositePosition( position ) {
  99914. const parts = position.split( '-' );
  99915. const replacements = {
  99916. top: 'bottom',
  99917. bottom: 'top',
  99918. left: 'right',
  99919. right: 'left'
  99920. };
  99921. return `${ replacements[ parts[ 0 ] ] }-${ replacements[ parts[ 1 ] ] }`;
  99922. }
  99923. /***/ }),
  99924. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/sizeview.js":
  99925. /*!******************************************************************************!*\
  99926. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/sizeview.js ***!
  99927. \******************************************************************************/
  99928. /*! exports provided: default */
  99929. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99930. "use strict";
  99931. __webpack_require__.r(__webpack_exports__);
  99932. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SizeView; });
  99933. /* harmony import */ var _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  99934. /**
  99935. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  99936. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  99937. */
  99938. /**
  99939. * @module widget/widgetresize/sizeview
  99940. */
  99941. /**
  99942. * A view displaying the proposed new element size during the resizing.
  99943. *
  99944. * @protected
  99945. * @extends {module:ui/view~View}
  99946. */
  99947. class SizeView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  99948. constructor() {
  99949. super();
  99950. /**
  99951. * The visibility of the view defined based on the existence of the host proposed dimensions.
  99952. *
  99953. * @private
  99954. * @observable
  99955. * @readonly
  99956. * @member {Boolean} #_isVisible
  99957. */
  99958. /**
  99959. * The text that will be displayed in the `SizeView` child.
  99960. * It can be formatted as the pixel values (e.g. 10x20) or the percentage value (e.g. 10%).
  99961. *
  99962. * @private
  99963. * @observable
  99964. * @readonly
  99965. * @member {Boolean} #_label
  99966. */
  99967. /**
  99968. * The position of the view defined based on the host size and active handle position.
  99969. *
  99970. * @private
  99971. * @observable
  99972. * @readonly
  99973. * @member {String} #_viewPosition
  99974. */
  99975. const bind = this.bindTemplate;
  99976. this.setTemplate( {
  99977. tag: 'div',
  99978. attributes: {
  99979. class: [
  99980. 'ck',
  99981. 'ck-size-view',
  99982. bind.to( '_viewPosition', value => value ? `ck-orientation-${ value }` : '' )
  99983. ],
  99984. style: {
  99985. display: bind.if( '_isVisible', 'none', visible => !visible )
  99986. }
  99987. },
  99988. children: [ {
  99989. text: bind.to( '_label' )
  99990. } ]
  99991. } );
  99992. }
  99993. /**
  99994. * A method used for binding the `SizeView` instance properties to the `ResizeState` instance observable properties.
  99995. *
  99996. * @protected
  99997. * @param {module:widget/widgetresize~ResizerOptions} options
  99998. * An object defining the resizer options, used for setting the proper size label.
  99999. * @param {module:widget/widgetresize/resizerstate~ResizeState} resizeState
  100000. * The `ResizeState` class instance, used for keeping the `SizeView` state up to date.
  100001. */
  100002. _bindToState( options, resizeState ) {
  100003. this.bind( '_isVisible' ).to( resizeState, 'proposedWidth', resizeState, 'proposedHeight', ( width, height ) =>
  100004. width !== null && height !== null );
  100005. this.bind( '_label' ).to(
  100006. resizeState, 'proposedHandleHostWidth',
  100007. resizeState, 'proposedHandleHostHeight',
  100008. resizeState, 'proposedWidthPercents',
  100009. ( width, height, widthPercents ) => {
  100010. if ( options.unit === 'px' ) {
  100011. return `${ width }×${ height }`;
  100012. } else {
  100013. return `${ widthPercents }%`;
  100014. }
  100015. }
  100016. );
  100017. this.bind( '_viewPosition' ).to(
  100018. resizeState, 'activeHandlePosition',
  100019. resizeState, 'proposedHandleHostWidth',
  100020. resizeState, 'proposedHandleHostHeight',
  100021. // If the widget is too small to contain the size label, display the label above.
  100022. ( position, width, height ) => width < 50 || height < 50 ? 'above-center' : position
  100023. );
  100024. }
  100025. /**
  100026. * A method used for cleaning up. It removes the bindings and hides the view.
  100027. *
  100028. * @protected
  100029. */
  100030. _dismiss() {
  100031. this.unbind();
  100032. this._isVisible = false;
  100033. }
  100034. }
  100035. /***/ }),
  100036. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettoolbarrepository.js":
  100037. /*!********************************************************************************!*\
  100038. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgettoolbarrepository.js ***!
  100039. \********************************************************************************/
  100040. /*! exports provided: default */
  100041. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100042. "use strict";
  100043. __webpack_require__.r(__webpack_exports__);
  100044. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WidgetToolbarRepository; });
  100045. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  100046. /* harmony import */ var _ckeditor_ckeditor5_ui_src_panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js");
  100047. /* harmony import */ var _ckeditor_ckeditor5_ui_src_toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/toolbar/toolbarview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js");
  100048. /* harmony import */ var _ckeditor_ckeditor5_ui_src_panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
  100049. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  100050. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  100051. /**
  100052. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  100053. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  100054. */
  100055. /**
  100056. * @module widget/widgettoolbarrepository
  100057. */
  100058. /**
  100059. * Widget toolbar repository plugin. A central point for registering widget toolbars. This plugin handles the whole
  100060. * toolbar rendering process and exposes a concise API.
  100061. *
  100062. * To add a toolbar for your widget use the {@link ~WidgetToolbarRepository#register `WidgetToolbarRepository#register()`} method.
  100063. *
  100064. * The following example comes from the {@link module:image/imagetoolbar~ImageToolbar} plugin:
  100065. *
  100066. * class ImageToolbar extends Plugin {
  100067. * static get requires() {
  100068. * return [ WidgetToolbarRepository ];
  100069. * }
  100070. *
  100071. * afterInit() {
  100072. * const editor = this.editor;
  100073. * const widgetToolbarRepository = editor.plugins.get( WidgetToolbarRepository );
  100074. *
  100075. * widgetToolbarRepository.register( 'image', {
  100076. * items: editor.config.get( 'image.toolbar' ),
  100077. * getRelatedElement: getClosestSelectedImageWidget
  100078. * } );
  100079. * }
  100080. * }
  100081. */
  100082. class WidgetToolbarRepository extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  100083. /**
  100084. * @inheritDoc
  100085. */
  100086. static get requires() {
  100087. return [ _ckeditor_ckeditor5_ui_src_panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  100088. }
  100089. /**
  100090. * @inheritDoc
  100091. */
  100092. static get pluginName() {
  100093. return 'WidgetToolbarRepository';
  100094. }
  100095. /**
  100096. * @inheritDoc
  100097. */
  100098. init() {
  100099. const editor = this.editor;
  100100. // Disables the default balloon toolbar for all widgets.
  100101. if ( editor.plugins.has( 'BalloonToolbar' ) ) {
  100102. const balloonToolbar = editor.plugins.get( 'BalloonToolbar' );
  100103. this.listenTo( balloonToolbar, 'show', evt => {
  100104. if ( isWidgetSelected( editor.editing.view.document.selection ) ) {
  100105. evt.stop();
  100106. }
  100107. }, { priority: 'high' } );
  100108. }
  100109. /**
  100110. * A map of toolbar definitions.
  100111. *
  100112. * @protected
  100113. * @member {Map.<String,module:widget/widgettoolbarrepository~WidgetRepositoryToolbarDefinition>} #_toolbarDefinitions
  100114. */
  100115. this._toolbarDefinitions = new Map();
  100116. /**
  100117. * @private
  100118. */
  100119. this._balloon = this.editor.plugins.get( 'ContextualBalloon' );
  100120. this.on( 'change:isEnabled', () => {
  100121. this._updateToolbarsVisibility();
  100122. } );
  100123. this.listenTo( editor.ui, 'update', () => {
  100124. this._updateToolbarsVisibility();
  100125. } );
  100126. // UI#update is not fired after focus is back in editor, we need to check if balloon panel should be visible.
  100127. this.listenTo( editor.ui.focusTracker, 'change:isFocused', () => {
  100128. this._updateToolbarsVisibility();
  100129. }, { priority: 'low' } );
  100130. }
  100131. destroy() {
  100132. super.destroy();
  100133. for ( const toolbarConfig of this._toolbarDefinitions.values() ) {
  100134. toolbarConfig.view.destroy();
  100135. }
  100136. }
  100137. /**
  100138. * Registers toolbar in the WidgetToolbarRepository. It renders it in the `ContextualBalloon` based on the value of the invoked
  100139. * `getRelatedElement` function. Toolbar items are gathered from `items` array.
  100140. * The balloon's CSS class is by default `ck-toolbar-container` and may be override with the `balloonClassName` option.
  100141. *
  100142. * Note: This method should be called in the {@link module:core/plugin~PluginInterface#afterInit `Plugin#afterInit()`}
  100143. * callback (or later) to make sure that the given toolbar items were already registered by other plugins.
  100144. *
  100145. * @param {String} toolbarId An id for the toolbar. Used to
  100146. * @param {Object} options
  100147. * @param {String} [options.ariaLabel] Label used by assistive technologies to describe this toolbar element.
  100148. * @param {Array.<String>} options.items Array of toolbar items.
  100149. * @param {Function} options.getRelatedElement Callback which returns an element the toolbar should be attached to.
  100150. * @param {String} [options.balloonClassName='ck-toolbar-container'] CSS class for the widget balloon.
  100151. */
  100152. register( toolbarId, { ariaLabel, items, getRelatedElement, balloonClassName = 'ck-toolbar-container' } ) {
  100153. // Trying to register a toolbar without any item.
  100154. if ( !items.length ) {
  100155. /**
  100156. * When {@link #register} a new toolbar, you need to provide a non-empty array with
  100157. * the items that will be inserted into the toolbar.
  100158. *
  100159. * @error widget-toolbar-no-items
  100160. */
  100161. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["logWarning"])( 'widget-toolbar-no-items', { toolbarId } );
  100162. return;
  100163. }
  100164. const editor = this.editor;
  100165. const t = editor.t;
  100166. const toolbarView = new _ckeditor_ckeditor5_ui_src_toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_2__["default"]( editor.locale );
  100167. toolbarView.ariaLabel = ariaLabel || t( 'Widget toolbar' );
  100168. if ( this._toolbarDefinitions.has( toolbarId ) ) {
  100169. /**
  100170. * Toolbar with the given id was already added.
  100171. *
  100172. * @error widget-toolbar-duplicated
  100173. * @param toolbarId Toolbar id.
  100174. */
  100175. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'widget-toolbar-duplicated', this, { toolbarId } );
  100176. }
  100177. toolbarView.fillFromConfig( items, editor.ui.componentFactory );
  100178. this._toolbarDefinitions.set( toolbarId, {
  100179. view: toolbarView,
  100180. getRelatedElement,
  100181. balloonClassName
  100182. } );
  100183. }
  100184. /**
  100185. * Iterates over stored toolbars and makes them visible or hidden.
  100186. *
  100187. * @private
  100188. */
  100189. _updateToolbarsVisibility() {
  100190. let maxRelatedElementDepth = 0;
  100191. let deepestRelatedElement = null;
  100192. let deepestToolbarDefinition = null;
  100193. for ( const definition of this._toolbarDefinitions.values() ) {
  100194. const relatedElement = definition.getRelatedElement( this.editor.editing.view.document.selection );
  100195. if ( !this.isEnabled || !relatedElement ) {
  100196. if ( this._isToolbarInBalloon( definition ) ) {
  100197. this._hideToolbar( definition );
  100198. }
  100199. } else if ( !this.editor.ui.focusTracker.isFocused ) {
  100200. if ( this._isToolbarVisible( definition ) ) {
  100201. this._hideToolbar( definition );
  100202. }
  100203. } else {
  100204. const relatedElementDepth = relatedElement.getAncestors().length;
  100205. // Many toolbars can express willingness to be displayed but they do not know about
  100206. // each other. Figure out which toolbar is deepest in the view tree to decide which
  100207. // should be displayed. For instance, if a selected image is inside a table cell, display
  100208. // the ImageToolbar rather than the TableToolbar (#60).
  100209. if ( relatedElementDepth > maxRelatedElementDepth ) {
  100210. maxRelatedElementDepth = relatedElementDepth;
  100211. deepestRelatedElement = relatedElement;
  100212. deepestToolbarDefinition = definition;
  100213. }
  100214. }
  100215. }
  100216. if ( deepestToolbarDefinition ) {
  100217. this._showToolbar( deepestToolbarDefinition, deepestRelatedElement );
  100218. }
  100219. }
  100220. /**
  100221. * Hides the given toolbar.
  100222. *
  100223. * @private
  100224. * @param {module:widget/widgettoolbarrepository~WidgetRepositoryToolbarDefinition} toolbarDefinition
  100225. */
  100226. _hideToolbar( toolbarDefinition ) {
  100227. this._balloon.remove( toolbarDefinition.view );
  100228. this.stopListening( this._balloon, 'change:visibleView' );
  100229. }
  100230. /**
  100231. * Shows up the toolbar if the toolbar is not visible.
  100232. * Otherwise, repositions the toolbar's balloon when toolbar's view is the most top view in balloon stack.
  100233. *
  100234. * It might happen here that the toolbar's view is under another view. Then do nothing as the other toolbar view
  100235. * should be still visible after the {@link module:core/editor/editorui~EditorUI#event:update}.
  100236. *
  100237. * @private
  100238. * @param {module:widget/widgettoolbarrepository~WidgetRepositoryToolbarDefinition} toolbarDefinition
  100239. * @param {module:engine/view/element~Element} relatedElement
  100240. */
  100241. _showToolbar( toolbarDefinition, relatedElement ) {
  100242. if ( this._isToolbarVisible( toolbarDefinition ) ) {
  100243. repositionContextualBalloon( this.editor, relatedElement );
  100244. } else if ( !this._isToolbarInBalloon( toolbarDefinition ) ) {
  100245. this._balloon.add( {
  100246. view: toolbarDefinition.view,
  100247. position: getBalloonPositionData( this.editor, relatedElement ),
  100248. balloonClassName: toolbarDefinition.balloonClassName
  100249. } );
  100250. // Update toolbar position each time stack with toolbar view is switched to visible.
  100251. // This is in a case target element has changed when toolbar was in invisible stack
  100252. // e.g. target image was wrapped by a block quote.
  100253. // See https://github.com/ckeditor/ckeditor5-widget/issues/92.
  100254. this.listenTo( this._balloon, 'change:visibleView', () => {
  100255. for ( const definition of this._toolbarDefinitions.values() ) {
  100256. if ( this._isToolbarVisible( definition ) ) {
  100257. const relatedElement = definition.getRelatedElement( this.editor.editing.view.document.selection );
  100258. repositionContextualBalloon( this.editor, relatedElement );
  100259. }
  100260. }
  100261. } );
  100262. }
  100263. }
  100264. /**
  100265. * @private
  100266. * @param {Object} toolbar
  100267. * @returns {Boolean}
  100268. */
  100269. _isToolbarVisible( toolbar ) {
  100270. return this._balloon.visibleView === toolbar.view;
  100271. }
  100272. /**
  100273. * @private
  100274. * @param {Object} toolbar
  100275. * @returns {Boolean}
  100276. */
  100277. _isToolbarInBalloon( toolbar ) {
  100278. return this._balloon.hasView( toolbar.view );
  100279. }
  100280. }
  100281. function repositionContextualBalloon( editor, relatedElement ) {
  100282. const balloon = editor.plugins.get( 'ContextualBalloon' );
  100283. const position = getBalloonPositionData( editor, relatedElement );
  100284. balloon.updatePosition( position );
  100285. }
  100286. function getBalloonPositionData( editor, relatedElement ) {
  100287. const editingView = editor.editing.view;
  100288. const defaultPositions = _ckeditor_ckeditor5_ui_src_panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_3__["default"].defaultPositions;
  100289. return {
  100290. target: editingView.domConverter.mapViewToDom( relatedElement ),
  100291. positions: [
  100292. defaultPositions.northArrowSouth,
  100293. defaultPositions.northArrowSouthWest,
  100294. defaultPositions.northArrowSouthEast,
  100295. defaultPositions.southArrowNorth,
  100296. defaultPositions.southArrowNorthWest,
  100297. defaultPositions.southArrowNorthEast,
  100298. defaultPositions.viewportStickyNorth
  100299. ]
  100300. };
  100301. }
  100302. function isWidgetSelected( selection ) {
  100303. const viewElement = selection.getSelectedElement();
  100304. return !!( viewElement && Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isWidget"])( viewElement ) );
  100305. }
  100306. /**
  100307. * The toolbar definition object used by the toolbar repository to manage toolbars.
  100308. * It contains information necessary to display the toolbar in the
  100309. * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} and
  100310. * update it during its life (display) cycle.
  100311. *
  100312. * @typedef {Object} module:widget/widgettoolbarrepository~WidgetRepositoryToolbarDefinition
  100313. *
  100314. * @property {module:ui/view~View} view The UI view of the toolbar.
  100315. * @property {Function} getRelatedElement A function that returns an engine {@link module:engine/view/view~View}
  100316. * element the toolbar is to be attached to. For instance, an image widget or a table widget (or `null` when
  100317. * there is no such element). The function accepts an instance of {@link module:engine/view/selection~Selection}.
  100318. * @property {String} balloonClassName CSS class for the widget balloon when a toolbar is displayed.
  100319. */
  100320. /***/ }),
  100321. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js":
  100322. /*!*******************************************************************************!*\
  100323. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js ***!
  100324. \*******************************************************************************/
  100325. /*! exports provided: TYPE_AROUND_SELECTION_ATTRIBUTE, isTypeAroundWidget, getClosestTypeAroundDomButton, getTypeAroundButtonPosition, getClosestWidgetViewElement, getTypeAroundFakeCaretPosition */
  100326. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100327. "use strict";
  100328. __webpack_require__.r(__webpack_exports__);
  100329. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TYPE_AROUND_SELECTION_ATTRIBUTE", function() { return TYPE_AROUND_SELECTION_ATTRIBUTE; });
  100330. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isTypeAroundWidget", function() { return isTypeAroundWidget; });
  100331. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClosestTypeAroundDomButton", function() { return getClosestTypeAroundDomButton; });
  100332. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTypeAroundButtonPosition", function() { return getTypeAroundButtonPosition; });
  100333. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClosestWidgetViewElement", function() { return getClosestWidgetViewElement; });
  100334. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTypeAroundFakeCaretPosition", function() { return getTypeAroundFakeCaretPosition; });
  100335. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  100336. /**
  100337. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  100338. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  100339. */
  100340. /**
  100341. * @module widget/widgettypearound/utils
  100342. */
  100343. /**
  100344. * The name of the type around model selection attribute responsible for
  100345. * displaying a fake caret next to a selected widget.
  100346. */
  100347. const TYPE_AROUND_SELECTION_ATTRIBUTE = 'widget-type-around';
  100348. /**
  100349. * Checks if an element is a widget that qualifies to get the widget type around UI.
  100350. *
  100351. * @param {module:engine/view/element~Element} viewElement
  100352. * @param {module:engine/model/element~Element} modelElement
  100353. * @param {module:engine/model/schema~Schema} schema
  100354. * @returns {Boolean}
  100355. */
  100356. function isTypeAroundWidget( viewElement, modelElement, schema ) {
  100357. return viewElement && Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isWidget"])( viewElement ) && !schema.isInline( modelElement );
  100358. }
  100359. /**
  100360. * For the passed HTML element, this helper finds the closest widget type around button ancestor.
  100361. *
  100362. * @param {HTMLElement} domElement
  100363. * @returns {HTMLElement|null}
  100364. */
  100365. function getClosestTypeAroundDomButton( domElement ) {
  100366. return domElement.closest( '.ck-widget__type-around__button' );
  100367. }
  100368. /**
  100369. * For the passed widget type around button element, this helper determines at which position
  100370. * the paragraph would be inserted into the content if, for instance, the button was
  100371. * clicked by the user.
  100372. *
  100373. * @param {HTMLElement} domElement
  100374. * @returns {'before'|'after'} The position of the button.
  100375. */
  100376. function getTypeAroundButtonPosition( domElement ) {
  100377. return domElement.classList.contains( 'ck-widget__type-around__button_before' ) ? 'before' : 'after';
  100378. }
  100379. /**
  100380. * For the passed HTML element, this helper returns the closest view widget ancestor.
  100381. *
  100382. * @param {HTMLElement} domElement
  100383. * @param {module:engine/view/domconverter~DomConverter} domConverter
  100384. * @returns {module:engine/view/element~Element}
  100385. */
  100386. function getClosestWidgetViewElement( domElement, domConverter ) {
  100387. const widgetDomElement = domElement.closest( '.ck-widget' );
  100388. return domConverter.mapDomToView( widgetDomElement );
  100389. }
  100390. /**
  100391. * For the passed selection instance, it returns the position of the fake caret displayed next to a widget.
  100392. *
  100393. * **Note**: If the fake caret is not currently displayed, `null` is returned.
  100394. *
  100395. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  100396. * @returns {'before'|'after'|null} The position of the fake caret or `null` when none is present.
  100397. */
  100398. function getTypeAroundFakeCaretPosition( selection ) {
  100399. return selection.getAttribute( TYPE_AROUND_SELECTION_ATTRIBUTE );
  100400. }
  100401. /***/ }),
  100402. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js":
  100403. /*!******************************************************************************************!*\
  100404. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js ***!
  100405. \******************************************************************************************/
  100406. /*! exports provided: default */
  100407. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100408. "use strict";
  100409. __webpack_require__.r(__webpack_exports__);
  100410. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WidgetTypeAround; });
  100411. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  100412. /* harmony import */ var _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
  100413. /* harmony import */ var _ckeditor_ckeditor5_enter_src_enter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-enter/src/enter */ "./node_modules/@ckeditor/ckeditor5-enter/src/enter.js");
  100414. /* harmony import */ var _ckeditor_ckeditor5_typing_src_delete__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/delete */ "./node_modules/@ckeditor/ckeditor5-typing/src/delete.js");
  100415. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  100416. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js");
  100417. /* harmony import */ var _ckeditor_ckeditor5_typing_src_utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js");
  100418. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  100419. /* harmony import */ var _theme_icons_return_arrow_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../theme/icons/return-arrow.svg */ "./node_modules/@ckeditor/ckeditor5-widget/theme/icons/return-arrow.svg");
  100420. /* harmony import */ var _theme_widgettypearound_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../theme/widgettypearound.css */ "./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css");
  100421. /**
  100422. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  100423. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  100424. */
  100425. /* global DOMParser */
  100426. /**
  100427. * @module widget/widgettypearound
  100428. */
  100429. const POSSIBLE_INSERTION_POSITIONS = [ 'before', 'after' ];
  100430. // Do the SVG parsing once and then clone the result <svg> DOM element for each new button.
  100431. const RETURN_ARROW_ICON_ELEMENT = new DOMParser().parseFromString( _theme_icons_return_arrow_svg__WEBPACK_IMPORTED_MODULE_8__["default"], 'image/svg+xml' ).firstChild;
  100432. const PLUGIN_DISABLED_EDITING_ROOT_CLASS = 'ck-widget__type-around_disabled';
  100433. /**
  100434. * A plugin that allows users to type around widgets where normally it is impossible to place the caret due
  100435. * to limitations of web browsers. These "tight spots" occur, for instance, before (or after) a widget being
  100436. * the first (or last) child of its parent or between two block widgets.
  100437. *
  100438. * This plugin extends the {@link module:widget/widget~Widget `Widget`} plugin and injects the user interface
  100439. * with two buttons into each widget instance in the editor. Each of the buttons can be clicked by the
  100440. * user if the widget is next to the "tight spot". Once clicked, a paragraph is created with the selection anchored
  100441. * in it so that users can type (or insert content, paste, etc.) straight away.
  100442. *
  100443. * @extends module:core/plugin~Plugin
  100444. */
  100445. class WidgetTypeAround extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  100446. /**
  100447. * @inheritDoc
  100448. */
  100449. static get pluginName() {
  100450. return 'WidgetTypeAround';
  100451. }
  100452. /**
  100453. * @inheritDoc
  100454. */
  100455. static get requires() {
  100456. return [ _ckeditor_ckeditor5_enter_src_enter__WEBPACK_IMPORTED_MODULE_2__["default"], _ckeditor_ckeditor5_typing_src_delete__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  100457. }
  100458. /**
  100459. * @inheritDoc
  100460. */
  100461. constructor( editor ) {
  100462. super( editor );
  100463. /**
  100464. * A reference to the model widget element that has the fake caret active
  100465. * on either side of it. It is later used to remove CSS classes associated with the fake caret
  100466. * when the widget no longer needs it.
  100467. *
  100468. * @private
  100469. * @member {module:engine/model/element~Element|null}
  100470. */
  100471. this._currentFakeCaretModelElement = null;
  100472. }
  100473. /**
  100474. * @inheritDoc
  100475. */
  100476. init() {
  100477. const editor = this.editor;
  100478. const editingView = editor.editing.view;
  100479. // Set a CSS class on the view editing root when the plugin is disabled so all the buttons
  100480. // and lines visually disappear. All the interactions are disabled in individual plugin methods.
  100481. this.on( 'change:isEnabled', ( evt, data, isEnabled ) => {
  100482. editingView.change( writer => {
  100483. for ( const root of editingView.document.roots ) {
  100484. if ( isEnabled ) {
  100485. writer.removeClass( PLUGIN_DISABLED_EDITING_ROOT_CLASS, root );
  100486. } else {
  100487. writer.addClass( PLUGIN_DISABLED_EDITING_ROOT_CLASS, root );
  100488. }
  100489. }
  100490. } );
  100491. if ( !isEnabled ) {
  100492. editor.model.change( writer => {
  100493. writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
  100494. } );
  100495. }
  100496. } );
  100497. this._enableTypeAroundUIInjection();
  100498. this._enableInsertingParagraphsOnButtonClick();
  100499. this._enableInsertingParagraphsOnEnterKeypress();
  100500. this._enableInsertingParagraphsOnTypingKeystroke();
  100501. this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows();
  100502. this._enableDeleteIntegration();
  100503. this._enableInsertContentIntegration();
  100504. this._enableDeleteContentIntegration();
  100505. }
  100506. /**
  100507. * @inheritDoc
  100508. */
  100509. destroy() {
  100510. this._currentFakeCaretModelElement = null;
  100511. }
  100512. /**
  100513. * Inserts a new paragraph next to a widget element with the selection anchored in it.
  100514. *
  100515. * **Note**: This method is heavily user-oriented and will both focus the editing view and scroll
  100516. * the viewport to the selection in the inserted paragraph.
  100517. *
  100518. * @protected
  100519. * @param {module:engine/model/element~Element} widgetModelElement The model widget element next to which a paragraph is inserted.
  100520. * @param {'before'|'after'} position The position where the paragraph is inserted. Either `'before'` or `'after'` the widget.
  100521. */
  100522. _insertParagraph( widgetModelElement, position ) {
  100523. const editor = this.editor;
  100524. const editingView = editor.editing.view;
  100525. editor.execute( 'insertParagraph', {
  100526. position: editor.model.createPositionAt( widgetModelElement, position )
  100527. } );
  100528. editingView.focus();
  100529. editingView.scrollToTheSelection();
  100530. }
  100531. /**
  100532. * A wrapper for the {@link module:utils/emittermixin~EmitterMixin#listenTo} method that executes the callbacks only
  100533. * when the plugin {@link #isEnabled is enabled}.
  100534. *
  100535. * @private
  100536. * @param {module:utils/emittermixin~Emitter} emitter The object that fires the event.
  100537. * @param {String} event The name of the event.
  100538. * @param {Function} callback The function to be called on event.
  100539. * @param {Object} [options={}] Additional options.
  100540. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  100541. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  100542. * order they were added.
  100543. */
  100544. _listenToIfEnabled( emitter, event, callback, options ) {
  100545. this.listenTo( emitter, event, ( ...args ) => {
  100546. // Do not respond if the plugin is disabled.
  100547. if ( this.isEnabled ) {
  100548. callback( ...args );
  100549. }
  100550. }, options );
  100551. }
  100552. /**
  100553. * Similar to {@link #_insertParagraph}, this method inserts a paragraph except that it
  100554. * does not expect a position. Instead, it performs the insertion next to a selected widget
  100555. * according to the `widget-type-around` model selection attribute value (fake caret position).
  100556. *
  100557. * Because this method requires the `widget-type-around` attribute to be set,
  100558. * the insertion can only happen when the widget's fake caret is active (e.g. activated
  100559. * using the keyboard).
  100560. *
  100561. * @private
  100562. * @returns {Boolean} Returns `true` when the paragraph was inserted (the attribute was present) and `false` otherwise.
  100563. */
  100564. _insertParagraphAccordingToFakeCaretPosition() {
  100565. const editor = this.editor;
  100566. const model = editor.model;
  100567. const modelSelection = model.document.selection;
  100568. const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( modelSelection );
  100569. if ( !typeAroundFakeCaretPosition ) {
  100570. return false;
  100571. }
  100572. const selectedModelElement = modelSelection.getSelectedElement();
  100573. this._insertParagraph( selectedModelElement, typeAroundFakeCaretPosition );
  100574. return true;
  100575. }
  100576. /**
  100577. * Creates a listener in the editing conversion pipeline that injects the widget type around
  100578. * UI into every single widget instance created in the editor.
  100579. *
  100580. * The UI is delivered as a {@link module:engine/view/uielement~UIElement}
  100581. * wrapper which renders DOM buttons that users can use to insert paragraphs.
  100582. *
  100583. * @private
  100584. */
  100585. _enableTypeAroundUIInjection() {
  100586. const editor = this.editor;
  100587. const schema = editor.model.schema;
  100588. const t = editor.locale.t;
  100589. const buttonTitles = {
  100590. before: t( 'Insert paragraph before block' ),
  100591. after: t( 'Insert paragraph after block' )
  100592. };
  100593. editor.editing.downcastDispatcher.on( 'insert', ( evt, data, conversionApi ) => {
  100594. const viewElement = conversionApi.mapper.toViewElement( data.item );
  100595. // Filter out non-widgets and inline widgets.
  100596. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( viewElement, data.item, schema ) ) {
  100597. injectUIIntoWidget( conversionApi.writer, buttonTitles, viewElement );
  100598. }
  100599. }, { priority: 'low' } );
  100600. }
  100601. /**
  100602. * Brings support for the fake caret that appears when either:
  100603. *
  100604. * * the selection moves to a widget from a position next to it using arrow keys,
  100605. * * the arrow key is pressed when the widget is already selected.
  100606. *
  100607. * The fake caret lets the user know that they can start typing or just press
  100608. * <kbd>Enter</kbd> to insert a paragraph at the position next to a widget as suggested by the fake caret.
  100609. *
  100610. * The fake caret disappears when the user changes the selection or the editor
  100611. * gets blurred.
  100612. *
  100613. * The whole idea is as follows:
  100614. *
  100615. * 1. A user does one of the 2 scenarios described at the beginning.
  100616. * 2. The "keydown" listener is executed and the decision is made whether to show or hide the fake caret.
  100617. * 3. If it should show up, the `widget-type-around` model selection attribute is set indicating
  100618. * on which side of the widget it should appear.
  100619. * 4. The selection dispatcher reacts to the selection attribute and sets CSS classes responsible for the
  100620. * fake caret on the view widget.
  100621. * 5. If the fake caret should disappear, the selection attribute is removed and the dispatcher
  100622. * does the CSS class clean-up in the view.
  100623. * 6. Additionally, `change:range` and `FocusTracker#isFocused` listeners also remove the selection
  100624. * attribute (the former also removes widget CSS classes).
  100625. *
  100626. * @private
  100627. */
  100628. _enableTypeAroundFakeCaretActivationUsingKeyboardArrows() {
  100629. const editor = this.editor;
  100630. const model = editor.model;
  100631. const modelSelection = model.document.selection;
  100632. const schema = model.schema;
  100633. const editingView = editor.editing.view;
  100634. // This is the main listener responsible for the fake caret.
  100635. // Note: The priority must precede the default Widget class keydown handler ("high").
  100636. this._listenToIfEnabled( editingView.document, 'arrowKey', ( evt, domEventData ) => {
  100637. this._handleArrowKeyPress( evt, domEventData );
  100638. }, { context: [ _utils__WEBPACK_IMPORTED_MODULE_7__["isWidget"], '$text' ], priority: 'high' } );
  100639. // This listener makes sure the widget type around selection attribute will be gone from the model
  100640. // selection as soon as the model range changes. This attribute only makes sense when a widget is selected
  100641. // (and the "fake horizontal caret" is visible) so whenever the range changes (e.g. selection moved somewhere else),
  100642. // let's get rid of the attribute so that the selection downcast dispatcher isn't even bothered.
  100643. this._listenToIfEnabled( modelSelection, 'change:range', ( evt, data ) => {
  100644. // Do not reset the selection attribute when the change was indirect.
  100645. if ( !data.directChange ) {
  100646. return;
  100647. }
  100648. // Get rid of the widget type around attribute of the selection on every change:range.
  100649. // If the range changes, it means for sure, the user is no longer in the active ("fake horizontal caret") mode.
  100650. editor.model.change( writer => {
  100651. writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
  100652. } );
  100653. } );
  100654. // Get rid of the widget type around attribute of the selection on every document change
  100655. // that makes widget not selected any more (i.e. widget was removed).
  100656. this._listenToIfEnabled( model.document, 'change:data', () => {
  100657. const selectedModelElement = modelSelection.getSelectedElement();
  100658. if ( selectedModelElement ) {
  100659. const selectedViewElement = editor.editing.mapper.toViewElement( selectedModelElement );
  100660. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( selectedViewElement, selectedModelElement, schema ) ) {
  100661. return;
  100662. }
  100663. }
  100664. editor.model.change( writer => {
  100665. writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
  100666. } );
  100667. } );
  100668. // React to changes of the model selection attribute made by the arrow keys listener.
  100669. // If the block widget is selected and the attribute changes, downcast the attribute to special
  100670. // CSS classes associated with the active ("fake horizontal caret") mode of the widget.
  100671. this._listenToIfEnabled( editor.editing.downcastDispatcher, 'selection', ( evt, data, conversionApi ) => {
  100672. const writer = conversionApi.writer;
  100673. if ( this._currentFakeCaretModelElement ) {
  100674. const selectedViewElement = conversionApi.mapper.toViewElement( this._currentFakeCaretModelElement );
  100675. if ( selectedViewElement ) {
  100676. // Get rid of CSS classes associated with the active ("fake horizontal caret") mode from the view widget.
  100677. writer.removeClass( POSSIBLE_INSERTION_POSITIONS.map( positionToWidgetCssClass ), selectedViewElement );
  100678. this._currentFakeCaretModelElement = null;
  100679. }
  100680. }
  100681. const selectedModelElement = data.selection.getSelectedElement();
  100682. if ( !selectedModelElement ) {
  100683. return;
  100684. }
  100685. const selectedViewElement = conversionApi.mapper.toViewElement( selectedModelElement );
  100686. if ( !Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( selectedViewElement, selectedModelElement, schema ) ) {
  100687. return;
  100688. }
  100689. const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( data.selection );
  100690. if ( !typeAroundFakeCaretPosition ) {
  100691. return;
  100692. }
  100693. writer.addClass( positionToWidgetCssClass( typeAroundFakeCaretPosition ), selectedViewElement );
  100694. // Remember the view widget that got the "fake-caret" CSS class. This class should be removed ASAP when the
  100695. // selection changes
  100696. this._currentFakeCaretModelElement = selectedModelElement;
  100697. } );
  100698. this._listenToIfEnabled( editor.ui.focusTracker, 'change:isFocused', ( evt, name, isFocused ) => {
  100699. if ( !isFocused ) {
  100700. editor.model.change( writer => {
  100701. writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
  100702. } );
  100703. }
  100704. } );
  100705. function positionToWidgetCssClass( position ) {
  100706. return `ck-widget_type-around_show-fake-caret_${ position }`;
  100707. }
  100708. }
  100709. /**
  100710. * A listener executed on each "keydown" in the view document, a part of
  100711. * {@link #_enableTypeAroundFakeCaretActivationUsingKeyboardArrows}.
  100712. *
  100713. * It decides whether the arrow keypress should activate the fake caret or not (also whether it should
  100714. * be deactivated).
  100715. *
  100716. * The fake caret activation is done by setting the `widget-type-around` model selection attribute
  100717. * in this listener, and stopping and preventing the event that would normally be handled by the widget
  100718. * plugin that is responsible for the regular keyboard navigation near/across all widgets (that
  100719. * includes inline widgets, which are ignored by the widget type around plugin).
  100720. *
  100721. * @private
  100722. */
  100723. _handleArrowKeyPress( evt, domEventData ) {
  100724. const editor = this.editor;
  100725. const model = editor.model;
  100726. const modelSelection = model.document.selection;
  100727. const schema = model.schema;
  100728. const editingView = editor.editing.view;
  100729. const keyCode = domEventData.keyCode;
  100730. const isForward = Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["isForwardArrowKeyCode"])( keyCode, editor.locale.contentLanguageDirection );
  100731. const selectedViewElement = editingView.document.selection.getSelectedElement();
  100732. const selectedModelElement = editor.editing.mapper.toModelElement( selectedViewElement );
  100733. let shouldStopAndPreventDefault;
  100734. // Handle keyboard navigation when a type-around-compatible widget is currently selected.
  100735. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( selectedViewElement, selectedModelElement, schema ) ) {
  100736. shouldStopAndPreventDefault = this._handleArrowKeyPressOnSelectedWidget( isForward );
  100737. }
  100738. // Handle keyboard arrow navigation when the selection is next to a type-around-compatible widget
  100739. // and the widget is about to be selected.
  100740. else if ( modelSelection.isCollapsed ) {
  100741. shouldStopAndPreventDefault = this._handleArrowKeyPressWhenSelectionNextToAWidget( isForward );
  100742. }
  100743. // Handle collapsing a non-collapsed selection that is wider than on a single widget.
  100744. else if ( !domEventData.shiftKey ) {
  100745. shouldStopAndPreventDefault = this._handleArrowKeyPressWhenNonCollapsedSelection( isForward );
  100746. }
  100747. if ( shouldStopAndPreventDefault ) {
  100748. domEventData.preventDefault();
  100749. evt.stop();
  100750. }
  100751. }
  100752. /**
  100753. * Handles the keyboard navigation on "keydown" when a widget is currently selected and activates or deactivates
  100754. * the fake caret for that widget, depending on the current value of the `widget-type-around` model
  100755. * selection attribute and the direction of the pressed arrow key.
  100756. *
  100757. * @private
  100758. * @param {Boolean} isForward `true` when the pressed arrow key was responsible for the forward model selection movement
  100759. * as in {@link module:utils/keyboard~isForwardArrowKeyCode}.
  100760. * @returns {Boolean} Returns `true` when the keypress was handled and no other keydown listener of the editor should
  100761. * process the event any further. Returns `false` otherwise.
  100762. */
  100763. _handleArrowKeyPressOnSelectedWidget( isForward ) {
  100764. const editor = this.editor;
  100765. const model = editor.model;
  100766. const modelSelection = model.document.selection;
  100767. const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( modelSelection );
  100768. return model.change( writer => {
  100769. // If the fake caret is displayed...
  100770. if ( typeAroundFakeCaretPosition ) {
  100771. const isLeavingWidget = typeAroundFakeCaretPosition === ( isForward ? 'after' : 'before' );
  100772. // If the keyboard arrow works against the value of the selection attribute...
  100773. // then remove the selection attribute but prevent default DOM actions
  100774. // and do not let the Widget plugin listener move the selection. This brings
  100775. // the widget back to the state, for instance, like if was selected using the mouse.
  100776. //
  100777. // **Note**: If leaving the widget when the fake caret is active, then the default
  100778. // Widget handler will change the selection and, in turn, this will automatically discard
  100779. // the selection attribute.
  100780. if ( !isLeavingWidget ) {
  100781. writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
  100782. return true;
  100783. }
  100784. }
  100785. // If the fake caret wasn't displayed, let's set it now according to the direction of the arrow
  100786. // key press. This also means we cannot let the Widget plugin listener move the selection.
  100787. else {
  100788. writer.setSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"], isForward ? 'after' : 'before' );
  100789. return true;
  100790. }
  100791. return false;
  100792. } );
  100793. }
  100794. /**
  100795. * Handles the keyboard navigation on "keydown" when **no** widget is selected but the selection is **directly** next
  100796. * to one and upon the fake caret should become active for this widget upon arrow keypress
  100797. * (AKA entering/selecting the widget).
  100798. *
  100799. * **Note**: This code mirrors the implementation from the widget plugin but also adds the selection attribute.
  100800. * Unfortunately, there is no safe way to let the widget plugin do the selection part first and then just set the
  100801. * selection attribute here in the widget type around plugin. This is why this code must duplicate some from the widget plugin.
  100802. *
  100803. * @private
  100804. * @param {Boolean} isForward `true` when the pressed arrow key was responsible for the forward model selection movement
  100805. * as in {@link module:utils/keyboard~isForwardArrowKeyCode}.
  100806. * @returns {Boolean} Returns `true` when the keypress was handled and no other keydown listener of the editor should
  100807. * process the event any further. Returns `false` otherwise.
  100808. */
  100809. _handleArrowKeyPressWhenSelectionNextToAWidget( isForward ) {
  100810. const editor = this.editor;
  100811. const model = editor.model;
  100812. const schema = model.schema;
  100813. const widgetPlugin = editor.plugins.get( 'Widget' );
  100814. // This is the widget the selection is about to be set on.
  100815. const modelElementNextToSelection = widgetPlugin._getObjectElementNextToSelection( isForward );
  100816. const viewElementNextToSelection = editor.editing.mapper.toViewElement( modelElementNextToSelection );
  100817. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( viewElementNextToSelection, modelElementNextToSelection, schema ) ) {
  100818. model.change( writer => {
  100819. widgetPlugin._setSelectionOverElement( modelElementNextToSelection );
  100820. writer.setSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"], isForward ? 'before' : 'after' );
  100821. } );
  100822. // The change() block above does the same job as the Widget plugin. The event can
  100823. // be safely canceled.
  100824. return true;
  100825. }
  100826. return false;
  100827. }
  100828. /**
  100829. * Handles the keyboard navigation on "keydown" when a widget is currently selected (together with some other content)
  100830. * and the widget is the first or last element in the selection. It activates or deactivates the fake caret for that widget.
  100831. *
  100832. * @private
  100833. * @param {Boolean} isForward `true` when the pressed arrow key was responsible for the forward model selection movement
  100834. * as in {@link module:utils/keyboard~isForwardArrowKeyCode}.
  100835. * @returns {Boolean} Returns `true` when the keypress was handled and no other keydown listener of the editor should
  100836. * process the event any further. Returns `false` otherwise.
  100837. */
  100838. _handleArrowKeyPressWhenNonCollapsedSelection( isForward ) {
  100839. const editor = this.editor;
  100840. const model = editor.model;
  100841. const schema = model.schema;
  100842. const mapper = editor.editing.mapper;
  100843. const modelSelection = model.document.selection;
  100844. const selectedModelNode = isForward ?
  100845. modelSelection.getLastPosition().nodeBefore :
  100846. modelSelection.getFirstPosition().nodeAfter;
  100847. const selectedViewNode = mapper.toViewElement( selectedModelNode );
  100848. // There is a widget at the collapse position so collapse the selection to the fake caret on it.
  100849. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( selectedViewNode, selectedModelNode, schema ) ) {
  100850. model.change( writer => {
  100851. writer.setSelection( selectedModelNode, 'on' );
  100852. writer.setSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_5__["TYPE_AROUND_SELECTION_ATTRIBUTE"], isForward ? 'after' : 'before' );
  100853. } );
  100854. return true;
  100855. }
  100856. return false;
  100857. }
  100858. /**
  100859. * Registers a `mousedown` listener for the view document which intercepts events
  100860. * coming from the widget type around UI, which happens when a user clicks one of the buttons
  100861. * that insert a paragraph next to a widget.
  100862. *
  100863. * @private
  100864. */
  100865. _enableInsertingParagraphsOnButtonClick() {
  100866. const editor = this.editor;
  100867. const editingView = editor.editing.view;
  100868. this._listenToIfEnabled( editingView.document, 'mousedown', ( evt, domEventData ) => {
  100869. const button = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getClosestTypeAroundDomButton"])( domEventData.domTarget );
  100870. if ( !button ) {
  100871. return;
  100872. }
  100873. const buttonPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundButtonPosition"])( button );
  100874. const widgetViewElement = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getClosestWidgetViewElement"])( button, editingView.domConverter );
  100875. const widgetModelElement = editor.editing.mapper.toModelElement( widgetViewElement );
  100876. this._insertParagraph( widgetModelElement, buttonPosition );
  100877. domEventData.preventDefault();
  100878. evt.stop();
  100879. } );
  100880. }
  100881. /**
  100882. * Creates the <kbd>Enter</kbd> key listener on the view document that allows the user to insert a paragraph
  100883. * near the widget when either:
  100884. *
  100885. * * The fake caret was first activated using the arrow keys,
  100886. * * The entire widget is selected in the model.
  100887. *
  100888. * In the first case, the new paragraph is inserted according to the `widget-type-around` selection
  100889. * attribute (see {@link #_handleArrowKeyPress}).
  100890. *
  100891. * In the second case, the new paragraph is inserted based on whether a soft (<kbd>Shift</kbd>+<kbd>Enter</kbd>) keystroke
  100892. * was pressed or not.
  100893. *
  100894. * @private
  100895. */
  100896. _enableInsertingParagraphsOnEnterKeypress() {
  100897. const editor = this.editor;
  100898. const selection = editor.model.document.selection;
  100899. const editingView = editor.editing.view;
  100900. this._listenToIfEnabled( editingView.document, 'enter', ( evt, domEventData ) => {
  100901. // This event could be triggered from inside the widget but we are interested
  100902. // only when the widget is selected itself.
  100903. if ( evt.eventPhase != 'atTarget' ) {
  100904. return;
  100905. }
  100906. const selectedModelElement = selection.getSelectedElement();
  100907. const selectedViewElement = editor.editing.mapper.toViewElement( selectedModelElement );
  100908. const schema = editor.model.schema;
  100909. let wasHandled;
  100910. // First check if the widget is selected and there's a type around selection attribute associated
  100911. // with the fake caret that would tell where to insert a new paragraph.
  100912. if ( this._insertParagraphAccordingToFakeCaretPosition() ) {
  100913. wasHandled = true;
  100914. }
  100915. // Then, if there is no selection attribute associated with the fake caret, check if the widget
  100916. // simply is selected and create a new paragraph according to the keystroke (Shift+)Enter.
  100917. else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_5__["isTypeAroundWidget"])( selectedViewElement, selectedModelElement, schema ) ) {
  100918. this._insertParagraph( selectedModelElement, domEventData.isSoft ? 'before' : 'after' );
  100919. wasHandled = true;
  100920. }
  100921. if ( wasHandled ) {
  100922. domEventData.preventDefault();
  100923. evt.stop();
  100924. }
  100925. }, { context: _utils__WEBPACK_IMPORTED_MODULE_7__["isWidget"] } );
  100926. }
  100927. /**
  100928. * Similar to the {@link #_enableInsertingParagraphsOnEnterKeypress}, it allows the user
  100929. * to insert a paragraph next to a widget when the fake caret was activated using arrow
  100930. * keys but it responds to typing keystrokes instead of <kbd>Enter</kbd>.
  100931. *
  100932. * "Typing keystrokes" are keystrokes that insert new content into the document,
  100933. * for instance, letters ("a") or numbers ("4"). The "keydown" listener enabled by this method
  100934. * will insert a new paragraph according to the `widget-type-around` model selection attribute
  100935. * as the user simply starts typing, which creates the impression that the fake caret
  100936. * behaves like a real one rendered by the browser (AKA your text appears where the caret was).
  100937. *
  100938. * **Note**: At the moment this listener creates 2 undo steps: one for the `insertParagraph` command
  100939. * and another one for actual typing. It is not a disaster but this may need to be fixed
  100940. * sooner or later.
  100941. *
  100942. * Learn more in {@link module:typing/utils/injectunsafekeystrokeshandling}.
  100943. *
  100944. * @private
  100945. */
  100946. _enableInsertingParagraphsOnTypingKeystroke() {
  100947. const editor = this.editor;
  100948. const editingView = editor.editing.view;
  100949. const keyCodesHandledSomewhereElse = [
  100950. _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].enter,
  100951. _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].delete,
  100952. _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["keyCodes"].backspace
  100953. ];
  100954. // Note: The priority must precede the default observers.
  100955. this._listenToIfEnabled( editingView.document, 'keydown', ( evt, domEventData ) => {
  100956. // Don't handle enter/backspace/delete here. They are handled in dedicated listeners.
  100957. if ( !keyCodesHandledSomewhereElse.includes( domEventData.keyCode ) && !Object(_ckeditor_ckeditor5_typing_src_utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_6__["isNonTypingKeystroke"])( domEventData ) ) {
  100958. this._insertParagraphAccordingToFakeCaretPosition();
  100959. }
  100960. }, { priority: 'high' } );
  100961. }
  100962. /**
  100963. * It creates a "delete" event listener on the view document to handle cases when the <kbd>Delete</kbd> or <kbd>Backspace</kbd>
  100964. * is pressed and the fake caret is currently active.
  100965. *
  100966. * The fake caret should create an illusion of a real browser caret so that when it appears before or after
  100967. * a widget, pressing <kbd>Delete</kbd> or <kbd>Backspace</kbd> should remove a widget or delete the content
  100968. * before or after a widget (depending on the content surrounding the widget).
  100969. *
  100970. * @private
  100971. */
  100972. _enableDeleteIntegration() {
  100973. const editor = this.editor;
  100974. const editingView = editor.editing.view;
  100975. const model = editor.model;
  100976. const schema = model.schema;
  100977. this._listenToIfEnabled( editingView.document, 'delete', ( evt, domEventData ) => {
  100978. // This event could be triggered from inside the widget but we are interested
  100979. // only when the widget is selected itself.
  100980. if ( evt.eventPhase != 'atTarget' ) {
  100981. return;
  100982. }
  100983. const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( model.document.selection );
  100984. // This listener handles only these cases when the fake caret is active.
  100985. if ( !typeAroundFakeCaretPosition ) {
  100986. return;
  100987. }
  100988. const direction = domEventData.direction;
  100989. const selectedModelWidget = model.document.selection.getSelectedElement();
  100990. const isFakeCaretBefore = typeAroundFakeCaretPosition === 'before';
  100991. const isDeleteForward = direction == 'forward';
  100992. const shouldDeleteEntireWidget = isFakeCaretBefore === isDeleteForward;
  100993. if ( shouldDeleteEntireWidget ) {
  100994. editor.execute( 'delete', {
  100995. selection: model.createSelection( selectedModelWidget, 'on' )
  100996. } );
  100997. } else {
  100998. const range = schema.getNearestSelectionRange(
  100999. model.createPositionAt( selectedModelWidget, typeAroundFakeCaretPosition ),
  101000. direction
  101001. );
  101002. // If there is somewhere to move selection to, then there will be something to delete.
  101003. if ( range ) {
  101004. // If the range is NOT collapsed, then we know that the range contains an object (see getNearestSelectionRange() docs).
  101005. if ( !range.isCollapsed ) {
  101006. model.change( writer => {
  101007. writer.setSelection( range );
  101008. editor.execute( isDeleteForward ? 'deleteForward' : 'delete' );
  101009. } );
  101010. } else {
  101011. const probe = model.createSelection( range.start );
  101012. model.modifySelection( probe, { direction } );
  101013. // If the range is collapsed, let's see if a non-collapsed range exists that can could be deleted.
  101014. // If such range exists, use the editor command because it it safe for collaboration (it merges where it can).
  101015. if ( !probe.focus.isEqual( range.start ) ) {
  101016. model.change( writer => {
  101017. writer.setSelection( range );
  101018. editor.execute( isDeleteForward ? 'deleteForward' : 'delete' );
  101019. } );
  101020. }
  101021. // If there is no non-collapsed range to be deleted then we are sure that there is an empty element
  101022. // next to a widget that should be removed. "delete" and "deleteForward" commands cannot get rid of it
  101023. // so calling Model#deleteContent here manually.
  101024. else {
  101025. const deepestEmptyRangeAncestor = getDeepestEmptyElementAncestor( schema, range.start.parent );
  101026. model.deleteContent( model.createSelection( deepestEmptyRangeAncestor, 'on' ), {
  101027. doNotAutoparagraph: true
  101028. } );
  101029. }
  101030. }
  101031. }
  101032. }
  101033. // If some content was deleted, don't let the handler from the Widget plugin kick in.
  101034. // If nothing was deleted, then the default handler will have nothing to do anyway.
  101035. domEventData.preventDefault();
  101036. evt.stop();
  101037. }, { context: _utils__WEBPACK_IMPORTED_MODULE_7__["isWidget"] } );
  101038. }
  101039. /**
  101040. * Attaches the {@link module:engine/model/model~Model#event:insertContent} event listener that, for instance, allows the user to paste
  101041. * content near a widget when the fake caret is first activated using the arrow keys.
  101042. *
  101043. * The content is inserted according to the `widget-type-around` selection attribute (see {@link #_handleArrowKeyPress}).
  101044. *
  101045. * @private
  101046. */
  101047. _enableInsertContentIntegration() {
  101048. const editor = this.editor;
  101049. const model = this.editor.model;
  101050. const documentSelection = model.document.selection;
  101051. this._listenToIfEnabled( editor.model, 'insertContent', ( evt, [ content, selectable ] ) => {
  101052. if ( selectable && !selectable.is( 'documentSelection' ) ) {
  101053. return;
  101054. }
  101055. const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( documentSelection );
  101056. if ( !typeAroundFakeCaretPosition ) {
  101057. return;
  101058. }
  101059. evt.stop();
  101060. return model.change( writer => {
  101061. const selectedElement = documentSelection.getSelectedElement();
  101062. const position = model.createPositionAt( selectedElement, typeAroundFakeCaretPosition );
  101063. const selection = writer.createSelection( position );
  101064. const result = model.insertContent( content, selection );
  101065. writer.setSelection( selection );
  101066. return result;
  101067. } );
  101068. }, { priority: 'high' } );
  101069. }
  101070. /**
  101071. * Attaches the {@link module:engine/model/model~Model#event:deleteContent} event listener to block the event when the fake
  101072. * caret is active.
  101073. *
  101074. * This is required for cases that trigger {@link module:engine/model/model~Model#deleteContent `model.deleteContent()`}
  101075. * before calling {@link module:engine/model/model~Model#insertContent `model.insertContent()`} like, for instance,
  101076. * plain text pasting.
  101077. *
  101078. * @private
  101079. */
  101080. _enableDeleteContentIntegration() {
  101081. const editor = this.editor;
  101082. const model = this.editor.model;
  101083. const documentSelection = model.document.selection;
  101084. this._listenToIfEnabled( editor.model, 'deleteContent', ( evt, [ selection ] ) => {
  101085. if ( selection && !selection.is( 'documentSelection' ) ) {
  101086. return;
  101087. }
  101088. const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["getTypeAroundFakeCaretPosition"])( documentSelection );
  101089. // Disable removing the selection content while pasting plain text.
  101090. if ( typeAroundFakeCaretPosition ) {
  101091. evt.stop();
  101092. }
  101093. }, { priority: 'high' } );
  101094. }
  101095. }
  101096. // Injects the type around UI into a view widget instance.
  101097. //
  101098. // @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter
  101099. // @param {Object.<String,String>} buttonTitles
  101100. // @param {module:engine/view/element~Element} widgetViewElement
  101101. function injectUIIntoWidget( viewWriter, buttonTitles, widgetViewElement ) {
  101102. const typeAroundWrapper = viewWriter.createUIElement( 'div', {
  101103. class: 'ck ck-reset_all ck-widget__type-around'
  101104. }, function( domDocument ) {
  101105. const wrapperDomElement = this.toDomElement( domDocument );
  101106. injectButtons( wrapperDomElement, buttonTitles );
  101107. injectFakeCaret( wrapperDomElement );
  101108. return wrapperDomElement;
  101109. } );
  101110. // Inject the type around wrapper into the widget's wrapper.
  101111. viewWriter.insert( viewWriter.createPositionAt( widgetViewElement, 'end' ), typeAroundWrapper );
  101112. }
  101113. // FYI: Not using the IconView class because each instance would need to be destroyed to avoid memory leaks
  101114. // and it's pretty hard to figure out when a view (widget) is gone for good so it's cheaper to use raw
  101115. // <svg> here.
  101116. //
  101117. // @param {HTMLElement} wrapperDomElement
  101118. // @param {Object.<String,String>} buttonTitles
  101119. function injectButtons( wrapperDomElement, buttonTitles ) {
  101120. for ( const position of POSSIBLE_INSERTION_POSITIONS ) {
  101121. const buttonTemplate = new _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_1__["default"]( {
  101122. tag: 'div',
  101123. attributes: {
  101124. class: [
  101125. 'ck',
  101126. 'ck-widget__type-around__button',
  101127. `ck-widget__type-around__button_${ position }`
  101128. ],
  101129. title: buttonTitles[ position ]
  101130. },
  101131. children: [
  101132. wrapperDomElement.ownerDocument.importNode( RETURN_ARROW_ICON_ELEMENT, true )
  101133. ]
  101134. } );
  101135. wrapperDomElement.appendChild( buttonTemplate.render() );
  101136. }
  101137. }
  101138. // @param {HTMLElement} wrapperDomElement
  101139. function injectFakeCaret( wrapperDomElement ) {
  101140. const caretTemplate = new _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_1__["default"]( {
  101141. tag: 'div',
  101142. attributes: {
  101143. class: [
  101144. 'ck',
  101145. 'ck-widget__type-around__fake-caret'
  101146. ]
  101147. }
  101148. } );
  101149. wrapperDomElement.appendChild( caretTemplate.render() );
  101150. }
  101151. // Returns the ancestor of an element closest to the root which is empty. For instance,
  101152. // for `<baz>`:
  101153. //
  101154. // <foo>abc<bar><baz></baz></bar></foo>
  101155. //
  101156. // it returns `<bar>`.
  101157. //
  101158. // @param {module:engine/model/schema~Schema} schema
  101159. // @param {module:engine/model/element~Element} element
  101160. // @returns {module:engine/model/element~Element|null}
  101161. function getDeepestEmptyElementAncestor( schema, element ) {
  101162. let deepestEmptyAncestor = element;
  101163. for ( const ancestor of element.getAncestors( { parentFirst: true } ) ) {
  101164. if ( ancestor.childCount > 1 || schema.isLimit( ancestor ) ) {
  101165. break;
  101166. }
  101167. deepestEmptyAncestor = ancestor;
  101168. }
  101169. return deepestEmptyAncestor;
  101170. }
  101171. /***/ }),
  101172. /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/icons/drag-handle.svg":
  101173. /*!*****************************************************************************!*\
  101174. !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/icons/drag-handle.svg ***!
  101175. \*****************************************************************************/
  101176. /*! exports provided: default */
  101177. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101178. "use strict";
  101179. __webpack_require__.r(__webpack_exports__);
  101180. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0H4zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3V0zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3v1zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5H12z\"/><path fill-opacity=\".256\" d=\"M1 1h14v14H1z\"/><g class=\"ck-icon__selected-indicator\"><path d=\"M7 0h2v1H7V0zM0 7h1v2H0V7zm15 0h1v2h-1V7zm-8 8h2v1H7v-1z\"/><path fill-opacity=\".254\" d=\"M1 1h14v14H1z\"/></g></svg>");
  101181. /***/ }),
  101182. /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/icons/return-arrow.svg":
  101183. /*!******************************************************************************!*\
  101184. !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/icons/return-arrow.svg ***!
  101185. \******************************************************************************/
  101186. /*! exports provided: default */
  101187. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101188. "use strict";
  101189. __webpack_require__.r(__webpack_exports__);
  101190. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 10 8\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M9.055.263v3.972h-6.77M1 4.216l2-2.038m-2 2 2 2.038\"/></svg>");
  101191. /***/ }),
  101192. /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css":
  101193. /*!******************************************************************!*\
  101194. !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css ***!
  101195. \******************************************************************/
  101196. /*! exports provided: default */
  101197. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101198. "use strict";
  101199. __webpack_require__.r(__webpack_exports__);
  101200. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  101201. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  101202. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_widget_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./widget.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css");
  101203. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  101204. options.insert = "head";
  101205. options.singleton = true;
  101206. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_widget_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  101207. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_widget_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  101208. /***/ }),
  101209. /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css":
  101210. /*!************************************************************************!*\
  101211. !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css ***!
  101212. \************************************************************************/
  101213. /*! exports provided: default */
  101214. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101215. "use strict";
  101216. __webpack_require__.r(__webpack_exports__);
  101217. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  101218. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  101219. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_widgetresize_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./widgetresize.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css");
  101220. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  101221. options.insert = "head";
  101222. options.singleton = true;
  101223. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_widgetresize_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  101224. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_widgetresize_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  101225. /***/ }),
  101226. /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css":
  101227. /*!****************************************************************************!*\
  101228. !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css ***!
  101229. \****************************************************************************/
  101230. /*! exports provided: default */
  101231. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101232. "use strict";
  101233. __webpack_require__.r(__webpack_exports__);
  101234. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  101235. /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  101236. /* harmony import */ var _css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_widgettypearound_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ref--5-2!./widgettypearound.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css");
  101237. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  101238. options.insert = "head";
  101239. options.singleton = true;
  101240. var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_widgettypearound_css__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  101241. /* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_postcss_loader_dist_cjs_js_ref_5_2_widgettypearound_css__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  101242. /***/ }),
  101243. /***/ "./node_modules/ckeditor5/src/clipboard.js":
  101244. /*!*************************************************!*\
  101245. !*** ./node_modules/ckeditor5/src/clipboard.js ***!
  101246. \*************************************************/
  101247. /*! exports provided: Clipboard, ClipboardPipeline, DragDrop, PastePlainText */
  101248. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101249. "use strict";
  101250. __webpack_require__.r(__webpack_exports__);
  101251. /* harmony import */ var _ckeditor_ckeditor5_clipboard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-clipboard */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/index.js");
  101252. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Clipboard", function() { return _ckeditor_ckeditor5_clipboard__WEBPACK_IMPORTED_MODULE_0__["Clipboard"]; });
  101253. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClipboardPipeline", function() { return _ckeditor_ckeditor5_clipboard__WEBPACK_IMPORTED_MODULE_0__["ClipboardPipeline"]; });
  101254. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragDrop", function() { return _ckeditor_ckeditor5_clipboard__WEBPACK_IMPORTED_MODULE_0__["DragDrop"]; });
  101255. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PastePlainText", function() { return _ckeditor_ckeditor5_clipboard__WEBPACK_IMPORTED_MODULE_0__["PastePlainText"]; });
  101256. /**
  101257. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  101258. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  101259. */
  101260. /**
  101261. * @module ckeditor5/clipboard
  101262. */
  101263. /***/ }),
  101264. /***/ "./node_modules/ckeditor5/src/core.js":
  101265. /*!********************************************!*\
  101266. !*** ./node_modules/ckeditor5/src/core.js ***!
  101267. \********************************************/
  101268. /*! exports provided: Plugin, Command, MultiCommand, Context, ContextPlugin, Editor, EditorUI, attachToForm, DataApiMixin, ElementApiMixin, secureSourceElement, PendingActions, icons */
  101269. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101270. "use strict";
  101271. __webpack_require__.r(__webpack_exports__);
  101272. /* harmony import */ var _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core */ "./node_modules/@ckeditor/ckeditor5-core/src/index.js");
  101273. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Plugin", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["Plugin"]; });
  101274. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["Command"]; });
  101275. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiCommand", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["MultiCommand"]; });
  101276. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["Context"]; });
  101277. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContextPlugin", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["ContextPlugin"]; });
  101278. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Editor", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["Editor"]; });
  101279. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorUI", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["EditorUI"]; });
  101280. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "attachToForm", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["attachToForm"]; });
  101281. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataApiMixin", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["DataApiMixin"]; });
  101282. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ElementApiMixin", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["ElementApiMixin"]; });
  101283. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "secureSourceElement", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["secureSourceElement"]; });
  101284. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PendingActions", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["PendingActions"]; });
  101285. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "icons", function() { return _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__["icons"]; });
  101286. /**
  101287. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  101288. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  101289. */
  101290. /**
  101291. * @module ckeditor5/core
  101292. */
  101293. /***/ }),
  101294. /***/ "./node_modules/ckeditor5/src/engine.js":
  101295. /*!**********************************************!*\
  101296. !*** ./node_modules/ckeditor5/src/engine.js ***!
  101297. \**********************************************/
  101298. /*! exports provided: enablePlaceholder, disablePlaceholder, showPlaceholder, hidePlaceholder, needsPlaceholder, EditingController, DataController, Conversion, HtmlDataProcessor, InsertOperation, MarkerOperation, OperationFactory, transformSets, DocumentSelection, Range, LiveRange, LivePosition, Model, TreeWalker, Element, DomConverter, Renderer, ViewDocument, getFillerOffset, Observer, ClickObserver, DomEventObserver, MouseObserver, DowncastWriter, UpcastWriter, Matcher, DomEventData, StylesProcessor, addBackgroundRules, addBorderRules, addMarginRules, addPaddingRules, isColor, isLineStyle, isLength, isPercentage, isRepeat, isPosition, isAttachment, isURL, getBoxSidesValues, getBoxSidesValueReducer, getBoxSidesShorthandValue, getPositionShorthandNormalizer, getShorthandValues */
  101299. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101300. "use strict";
  101301. __webpack_require__.r(__webpack_exports__);
  101302. /* harmony import */ var _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine */ "./node_modules/@ckeditor/ckeditor5-engine/src/index.js");
  101303. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "enablePlaceholder", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["enablePlaceholder"]; });
  101304. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "disablePlaceholder", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["disablePlaceholder"]; });
  101305. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "showPlaceholder", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["showPlaceholder"]; });
  101306. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hidePlaceholder", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["hidePlaceholder"]; });
  101307. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "needsPlaceholder", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["needsPlaceholder"]; });
  101308. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditingController", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["EditingController"]; });
  101309. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataController", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DataController"]; });
  101310. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Conversion", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Conversion"]; });
  101311. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HtmlDataProcessor", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["HtmlDataProcessor"]; });
  101312. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InsertOperation", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["InsertOperation"]; });
  101313. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkerOperation", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["MarkerOperation"]; });
  101314. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OperationFactory", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["OperationFactory"]; });
  101315. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transformSets", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["transformSets"]; });
  101316. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentSelection", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DocumentSelection"]; });
  101317. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Range"]; });
  101318. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LiveRange", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["LiveRange"]; });
  101319. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LivePosition", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["LivePosition"]; });
  101320. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Model", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Model"]; });
  101321. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TreeWalker", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["TreeWalker"]; });
  101322. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Element", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Element"]; });
  101323. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomConverter", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DomConverter"]; });
  101324. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Renderer", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Renderer"]; });
  101325. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewDocument", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["ViewDocument"]; });
  101326. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFillerOffset", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getFillerOffset"]; });
  101327. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Observer", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Observer"]; });
  101328. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClickObserver", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["ClickObserver"]; });
  101329. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEventObserver", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DomEventObserver"]; });
  101330. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MouseObserver", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["MouseObserver"]; });
  101331. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DowncastWriter", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DowncastWriter"]; });
  101332. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UpcastWriter", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["UpcastWriter"]; });
  101333. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Matcher", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["Matcher"]; });
  101334. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEventData", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["DomEventData"]; });
  101335. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StylesProcessor", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["StylesProcessor"]; });
  101336. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBackgroundRules", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["addBackgroundRules"]; });
  101337. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addBorderRules", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["addBorderRules"]; });
  101338. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addMarginRules", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["addMarginRules"]; });
  101339. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addPaddingRules", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["addPaddingRules"]; });
  101340. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isColor", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isColor"]; });
  101341. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLineStyle", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isLineStyle"]; });
  101342. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isLength"]; });
  101343. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPercentage", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isPercentage"]; });
  101344. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRepeat", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isRepeat"]; });
  101345. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPosition", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isPosition"]; });
  101346. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isAttachment", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isAttachment"]; });
  101347. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isURL", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["isURL"]; });
  101348. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValues", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValues"]; });
  101349. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValueReducer", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesValueReducer"]; });
  101350. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesShorthandValue", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getBoxSidesShorthandValue"]; });
  101351. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getPositionShorthandNormalizer", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getPositionShorthandNormalizer"]; });
  101352. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getShorthandValues", function() { return _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_0__["getShorthandValues"]; });
  101353. /**
  101354. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  101355. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  101356. */
  101357. /**
  101358. * @module ckeditor5/engine
  101359. */
  101360. /***/ }),
  101361. /***/ "./node_modules/ckeditor5/src/enter.js":
  101362. /*!*********************************************!*\
  101363. !*** ./node_modules/ckeditor5/src/enter.js ***!
  101364. \*********************************************/
  101365. /*! exports provided: Enter, ShiftEnter */
  101366. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101367. "use strict";
  101368. __webpack_require__.r(__webpack_exports__);
  101369. /* harmony import */ var _ckeditor_ckeditor5_enter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-enter */ "./node_modules/@ckeditor/ckeditor5-enter/src/index.js");
  101370. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Enter", function() { return _ckeditor_ckeditor5_enter__WEBPACK_IMPORTED_MODULE_0__["Enter"]; });
  101371. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShiftEnter", function() { return _ckeditor_ckeditor5_enter__WEBPACK_IMPORTED_MODULE_0__["ShiftEnter"]; });
  101372. /**
  101373. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  101374. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  101375. */
  101376. /**
  101377. * @module ckeditor5/enter
  101378. */
  101379. /***/ }),
  101380. /***/ "./node_modules/ckeditor5/src/paragraph.js":
  101381. /*!*************************************************!*\
  101382. !*** ./node_modules/ckeditor5/src/paragraph.js ***!
  101383. \*************************************************/
  101384. /*! exports provided: Paragraph, ParagraphButtonUI */
  101385. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101386. "use strict";
  101387. __webpack_require__.r(__webpack_exports__);
  101388. /* harmony import */ var _ckeditor_ckeditor5_paragraph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-paragraph */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/index.js");
  101389. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Paragraph", function() { return _ckeditor_ckeditor5_paragraph__WEBPACK_IMPORTED_MODULE_0__["Paragraph"]; });
  101390. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ParagraphButtonUI", function() { return _ckeditor_ckeditor5_paragraph__WEBPACK_IMPORTED_MODULE_0__["ParagraphButtonUI"]; });
  101391. /**
  101392. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  101393. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  101394. */
  101395. /**
  101396. * @module ckeditor5/paragraph
  101397. */
  101398. /***/ }),
  101399. /***/ "./node_modules/ckeditor5/src/select-all.js":
  101400. /*!**************************************************!*\
  101401. !*** ./node_modules/ckeditor5/src/select-all.js ***!
  101402. \**************************************************/
  101403. /*! exports provided: SelectAll, SelectAllEditing, SelectAllUI */
  101404. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101405. "use strict";
  101406. __webpack_require__.r(__webpack_exports__);
  101407. /* harmony import */ var _ckeditor_ckeditor5_select_all__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-select-all */ "./node_modules/@ckeditor/ckeditor5-select-all/src/index.js");
  101408. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAll", function() { return _ckeditor_ckeditor5_select_all__WEBPACK_IMPORTED_MODULE_0__["SelectAll"]; });
  101409. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAllEditing", function() { return _ckeditor_ckeditor5_select_all__WEBPACK_IMPORTED_MODULE_0__["SelectAllEditing"]; });
  101410. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectAllUI", function() { return _ckeditor_ckeditor5_select_all__WEBPACK_IMPORTED_MODULE_0__["SelectAllUI"]; });
  101411. /**
  101412. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  101413. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  101414. */
  101415. /**
  101416. * @module ckeditor5/select-all
  101417. */
  101418. /***/ }),
  101419. /***/ "./node_modules/ckeditor5/src/typing.js":
  101420. /*!**********************************************!*\
  101421. !*** ./node_modules/ckeditor5/src/typing.js ***!
  101422. \**********************************************/
  101423. /*! exports provided: Typing, Input, Delete, TextWatcher, TwoStepCaretMovement, TextTransformation, inlineHighlight, findAttributeRange, getLastTextLine, isNonTypingKeystroke */
  101424. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101425. "use strict";
  101426. __webpack_require__.r(__webpack_exports__);
  101427. /* harmony import */ var _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing */ "./node_modules/@ckeditor/ckeditor5-typing/src/index.js");
  101428. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Typing", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["Typing"]; });
  101429. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["Input"]; });
  101430. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Delete", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["Delete"]; });
  101431. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextWatcher", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["TextWatcher"]; });
  101432. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TwoStepCaretMovement", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["TwoStepCaretMovement"]; });
  101433. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextTransformation", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["TextTransformation"]; });
  101434. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "inlineHighlight", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["inlineHighlight"]; });
  101435. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findAttributeRange", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["findAttributeRange"]; });
  101436. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLastTextLine", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["getLastTextLine"]; });
  101437. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNonTypingKeystroke", function() { return _ckeditor_ckeditor5_typing__WEBPACK_IMPORTED_MODULE_0__["isNonTypingKeystroke"]; });
  101438. /**
  101439. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  101440. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  101441. */
  101442. /**
  101443. * @module ckeditor5/typing
  101444. */
  101445. /***/ }),
  101446. /***/ "./node_modules/ckeditor5/src/ui.js":
  101447. /*!******************************************!*\
  101448. !*** ./node_modules/ckeditor5/src/ui.js ***!
  101449. \******************************************/
  101450. /*! exports provided: clickOutsideHandler, injectCssTransitionDisabler, submitHandler, BodyCollection, ButtonView, SwitchButtonView, getLocalizedColorOptions, normalizeColorOptions, normalizeSingleColorDefinition, ColorGridView, ColorTileView, DropdownButtonView, SplitButtonView, createDropdown, addToolbarToDropdown, addListToDropdown, EditorUIView, BoxedEditorUIView, InlineEditableUIView, FormHeaderView, FocusCycler, IconView, InputTextView, IframeView, LabelView, LabeledFieldView, createLabeledInputText, createLabeledDropdown, ListItemView, ListView, Notification, Model, BalloonPanelView, ContextualBalloon, StickyPanelView, TooltipView, Template, ToolbarView, ToolbarSeparatorView, enableToolbarKeyboardFocus, normalizeToolbarConfig, BalloonToolbar, BlockToolbar, View, ViewCollection */
  101451. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101452. "use strict";
  101453. __webpack_require__.r(__webpack_exports__);
  101454. /* harmony import */ var _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui */ "./node_modules/@ckeditor/ckeditor5-ui/src/index.js");
  101455. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clickOutsideHandler", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["clickOutsideHandler"]; });
  101456. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "injectCssTransitionDisabler", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["injectCssTransitionDisabler"]; });
  101457. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "submitHandler", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["submitHandler"]; });
  101458. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BodyCollection", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["BodyCollection"]; });
  101459. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ButtonView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ButtonView"]; });
  101460. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SwitchButtonView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["SwitchButtonView"]; });
  101461. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLocalizedColorOptions", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["getLocalizedColorOptions"]; });
  101462. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeColorOptions", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["normalizeColorOptions"]; });
  101463. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeSingleColorDefinition", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["normalizeSingleColorDefinition"]; });
  101464. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorGridView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ColorGridView"]; });
  101465. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorTileView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ColorTileView"]; });
  101466. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropdownButtonView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["DropdownButtonView"]; });
  101467. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SplitButtonView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["SplitButtonView"]; });
  101468. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createDropdown", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["createDropdown"]; });
  101469. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addToolbarToDropdown", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["addToolbarToDropdown"]; });
  101470. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addListToDropdown", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["addListToDropdown"]; });
  101471. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EditorUIView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["EditorUIView"]; });
  101472. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BoxedEditorUIView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["BoxedEditorUIView"]; });
  101473. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InlineEditableUIView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["InlineEditableUIView"]; });
  101474. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormHeaderView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["FormHeaderView"]; });
  101475. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocusCycler", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["FocusCycler"]; });
  101476. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IconView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["IconView"]; });
  101477. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InputTextView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["InputTextView"]; });
  101478. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IframeView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["IframeView"]; });
  101479. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LabelView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["LabelView"]; });
  101480. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LabeledFieldView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["LabeledFieldView"]; });
  101481. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createLabeledInputText", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["createLabeledInputText"]; });
  101482. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createLabeledDropdown", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["createLabeledDropdown"]; });
  101483. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListItemView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ListItemView"]; });
  101484. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ListView"]; });
  101485. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["Notification"]; });
  101486. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Model", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["Model"]; });
  101487. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BalloonPanelView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["BalloonPanelView"]; });
  101488. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContextualBalloon", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ContextualBalloon"]; });
  101489. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StickyPanelView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["StickyPanelView"]; });
  101490. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TooltipView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["TooltipView"]; });
  101491. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Template", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["Template"]; });
  101492. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToolbarView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ToolbarView"]; });
  101493. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToolbarSeparatorView", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ToolbarSeparatorView"]; });
  101494. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "enableToolbarKeyboardFocus", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["enableToolbarKeyboardFocus"]; });
  101495. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "normalizeToolbarConfig", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["normalizeToolbarConfig"]; });
  101496. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BalloonToolbar", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["BalloonToolbar"]; });
  101497. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlockToolbar", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["BlockToolbar"]; });
  101498. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "View", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["View"]; });
  101499. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewCollection", function() { return _ckeditor_ckeditor5_ui__WEBPACK_IMPORTED_MODULE_0__["ViewCollection"]; });
  101500. /**
  101501. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  101502. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  101503. */
  101504. /**
  101505. * @module ckeditor5/ui
  101506. */
  101507. /***/ }),
  101508. /***/ "./node_modules/ckeditor5/src/undo.js":
  101509. /*!********************************************!*\
  101510. !*** ./node_modules/ckeditor5/src/undo.js ***!
  101511. \********************************************/
  101512. /*! exports provided: Undo, UndoEditing, UndoUi */
  101513. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101514. "use strict";
  101515. __webpack_require__.r(__webpack_exports__);
  101516. /* harmony import */ var _ckeditor_ckeditor5_undo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-undo */ "./node_modules/@ckeditor/ckeditor5-undo/src/index.js");
  101517. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Undo", function() { return _ckeditor_ckeditor5_undo__WEBPACK_IMPORTED_MODULE_0__["Undo"]; });
  101518. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UndoEditing", function() { return _ckeditor_ckeditor5_undo__WEBPACK_IMPORTED_MODULE_0__["UndoEditing"]; });
  101519. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UndoUi", function() { return _ckeditor_ckeditor5_undo__WEBPACK_IMPORTED_MODULE_0__["UndoUi"]; });
  101520. /**
  101521. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  101522. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  101523. */
  101524. /**
  101525. * @module ckeditor5/undo
  101526. */
  101527. /***/ }),
  101528. /***/ "./node_modules/ckeditor5/src/upload.js":
  101529. /*!**********************************************!*\
  101530. !*** ./node_modules/ckeditor5/src/upload.js ***!
  101531. \**********************************************/
  101532. /*! exports provided: FileRepository, FileDialogButtonView, Base64UploadAdapter, SimpleUploadAdapter */
  101533. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101534. "use strict";
  101535. __webpack_require__.r(__webpack_exports__);
  101536. /* harmony import */ var _ckeditor_ckeditor5_upload__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-upload */ "./node_modules/@ckeditor/ckeditor5-upload/src/index.js");
  101537. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FileRepository", function() { return _ckeditor_ckeditor5_upload__WEBPACK_IMPORTED_MODULE_0__["FileRepository"]; });
  101538. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FileDialogButtonView", function() { return _ckeditor_ckeditor5_upload__WEBPACK_IMPORTED_MODULE_0__["FileDialogButtonView"]; });
  101539. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Base64UploadAdapter", function() { return _ckeditor_ckeditor5_upload__WEBPACK_IMPORTED_MODULE_0__["Base64UploadAdapter"]; });
  101540. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SimpleUploadAdapter", function() { return _ckeditor_ckeditor5_upload__WEBPACK_IMPORTED_MODULE_0__["SimpleUploadAdapter"]; });
  101541. /**
  101542. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  101543. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  101544. */
  101545. /**
  101546. * @module ckeditor5/upload
  101547. */
  101548. /***/ }),
  101549. /***/ "./node_modules/ckeditor5/src/utils.js":
  101550. /*!*********************************************!*\
  101551. !*** ./node_modules/ckeditor5/src/utils.js ***!
  101552. \*********************************************/
  101553. /*! exports provided: env, diff, mix, EmitterMixin, ObservableMixin, CKEditorError, logError, logWarning, ElementReplacer, createElement, DomEmitterMixin, global, getDataFromElement, Rect, ResizeObserver, setDataInElement, toUnit, keyCodes, getCode, parseKeystroke, getEnvKeystrokeText, isArrowKeyCode, getLocalizedArrowKeyCodeDirection, isForwardArrowKeyCode, getLanguageDirection, Locale, Collection, first, FocusTracker, KeystrokeHandler, toArray, toMap, priorities, uid, version */
  101554. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101555. "use strict";
  101556. __webpack_require__.r(__webpack_exports__);
  101557. /* harmony import */ var _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils */ "./node_modules/@ckeditor/ckeditor5-utils/src/index.js");
  101558. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "env", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["env"]; });
  101559. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "diff", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["diff"]; });
  101560. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mix", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["mix"]; });
  101561. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EmitterMixin", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["EmitterMixin"]; });
  101562. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ObservableMixin", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["ObservableMixin"]; });
  101563. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CKEditorError", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["CKEditorError"]; });
  101564. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "logError", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["logError"]; });
  101565. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "logWarning", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["logWarning"]; });
  101566. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ElementReplacer", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["ElementReplacer"]; });
  101567. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createElement", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["createElement"]; });
  101568. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DomEmitterMixin", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["DomEmitterMixin"]; });
  101569. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "global", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["global"]; });
  101570. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDataFromElement", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["getDataFromElement"]; });
  101571. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Rect", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["Rect"]; });
  101572. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResizeObserver", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["ResizeObserver"]; });
  101573. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setDataInElement", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["setDataInElement"]; });
  101574. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toUnit", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["toUnit"]; });
  101575. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keyCodes", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["keyCodes"]; });
  101576. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["getCode"]; });
  101577. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseKeystroke", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["parseKeystroke"]; });
  101578. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEnvKeystrokeText", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["getEnvKeystrokeText"]; });
  101579. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrowKeyCode", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["isArrowKeyCode"]; });
  101580. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLocalizedArrowKeyCodeDirection", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["getLocalizedArrowKeyCodeDirection"]; });
  101581. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isForwardArrowKeyCode", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["isForwardArrowKeyCode"]; });
  101582. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLanguageDirection", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["getLanguageDirection"]; });
  101583. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Locale", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["Locale"]; });
  101584. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Collection", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["Collection"]; });
  101585. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["first"]; });
  101586. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocusTracker", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["FocusTracker"]; });
  101587. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "KeystrokeHandler", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["KeystrokeHandler"]; });
  101588. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["toArray"]; });
  101589. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toMap", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["toMap"]; });
  101590. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "priorities", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["priorities"]; });
  101591. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uid", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["uid"]; });
  101592. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "version", function() { return _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__["version"]; });
  101593. /**
  101594. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  101595. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  101596. */
  101597. /**
  101598. * @module ckeditor5/utils
  101599. */
  101600. /***/ }),
  101601. /***/ "./node_modules/ckeditor5/src/widget.js":
  101602. /*!**********************************************!*\
  101603. !*** ./node_modules/ckeditor5/src/widget.js ***!
  101604. \**********************************************/
  101605. /*! exports provided: Widget, WidgetToolbarRepository, WidgetResize, WidgetTypeAround, WIDGET_CLASS_NAME, WIDGET_SELECTED_CLASS_NAME, isWidget, toWidget, setHighlightHandling, setLabel, getLabel, toWidgetEditable, findOptimalInsertionRange, viewToModelPositionOutsideModelElement */
  101606. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101607. "use strict";
  101608. __webpack_require__.r(__webpack_exports__);
  101609. /* harmony import */ var _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget */ "./node_modules/@ckeditor/ckeditor5-widget/src/index.js");
  101610. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Widget", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["Widget"]; });
  101611. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetToolbarRepository", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["WidgetToolbarRepository"]; });
  101612. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetResize", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["WidgetResize"]; });
  101613. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WidgetTypeAround", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["WidgetTypeAround"]; });
  101614. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WIDGET_CLASS_NAME", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["WIDGET_CLASS_NAME"]; });
  101615. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WIDGET_SELECTED_CLASS_NAME", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["WIDGET_SELECTED_CLASS_NAME"]; });
  101616. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWidget", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["isWidget"]; });
  101617. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toWidget", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["toWidget"]; });
  101618. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setHighlightHandling", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["setHighlightHandling"]; });
  101619. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setLabel", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["setLabel"]; });
  101620. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLabel", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["getLabel"]; });
  101621. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toWidgetEditable", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["toWidgetEditable"]; });
  101622. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findOptimalInsertionRange", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["findOptimalInsertionRange"]; });
  101623. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "viewToModelPositionOutsideModelElement", function() { return _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_0__["viewToModelPositionOutsideModelElement"]; });
  101624. /**
  101625. * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
  101626. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  101627. */
  101628. /**
  101629. * @module ckeditor5/widget
  101630. */
  101631. /***/ }),
  101632. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css":
  101633. /*!*********************************************************************************************************************************************************************!*\
  101634. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css ***!
  101635. \*********************************************************************************************************************************************************************/
  101636. /*! exports provided: default */
  101637. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101638. "use strict";
  101639. __webpack_require__.r(__webpack_exports__);
  101640. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101641. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101642. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101643. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101644. // Imports
  101645. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101646. // Module
  101647. ___CSS_LOADER_EXPORT___.push([module.i, ".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css"],"names":[],"mappings":"AAKA,uBAEC,eAAgB,CAGhB,mBAAoB,CACpB,kBAAmB,CAEnB,aAAc,CACd,cAAe,CACf,iBAAkB,CAClB,0BACD,CAEA,gCACC,aAAc,CACd,2BACD","sourcesContent":["/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-content blockquote {\n\t/* See #12 */\n\toverflow: hidden;\n\n\t/* https://github.com/ckeditor/ckeditor5-block-quote/issues/15 */\n\tpadding-right: 1.5em;\n\tpadding-left: 1.5em;\n\n\tmargin-left: 0;\n\tmargin-right: 0;\n\tfont-style: italic;\n\tborder-left: solid 5px hsl(0, 0%, 80%);\n}\n\n.ck-content[dir=\"rtl\"] blockquote {\n\tborder-left: 0;\n\tborder-right: solid 5px hsl(0, 0%, 80%);\n}\n"],"sourceRoot":""}]);
  101648. // Exports
  101649. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101650. /***/ }),
  101651. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css":
  101652. /*!******************************************************************************************************************************************************************!*\
  101653. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css ***!
  101654. \******************************************************************************************************************************************************************/
  101655. /*! exports provided: default */
  101656. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101657. "use strict";
  101658. __webpack_require__.r(__webpack_exports__);
  101659. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101660. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101661. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101662. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101663. // Imports
  101664. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101665. // Module
  101666. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;position:relative;pointer-events:none}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);border:1px solid var(--ck-clipboard-drop-target-color);background:var(--ck-clipboard-drop-target-color);margin-left:-1px}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{content:\"\";width:0;height:0;display:block;position:absolute;left:50%;top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);transform:translateX(-50%);border-left:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-bottom:0 solid transparent;border-right:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-top:calc(var(--ck-clipboard-drop-target-dot-height)) solid var(--ck-clipboard-drop-target-color)}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-clipboard/clipboard.css"],"names":[],"mappings":"AASC,8DACC,cAAe,CACf,iBAAkB,CAClB,mBAMD,CAJC,mEACC,iBAAkB,CAClB,OACD,CAWA,qJACC,YACD,CCzBF,MACC,yCAA0C,CAC1C,yCAA0C,CAC1C,6DACD,CAOE,mEACC,4DAA8D,CAC9D,yDAA2D,CAC3D,sDAAuD,CACvD,gDAAiD,CACjD,gBAkBD,CAfC,yEACC,UAAW,CACX,OAAQ,CACR,QAAS,CAET,aAAc,CACd,iBAAkB,CAClB,QAAS,CACT,yDAA2D,CAE3D,0BAA2B,CAG3B,iFAAmB,CAAnB,iCAAmB,CAAnB,kFAAmB,CAAnB,uGACD,CA2DF,kEACC,gGACD,CAKA,gDACC,OAAS,CACT,sBACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor__editable {\n\t/*\n\t * Vertical drop target (in text).\n\t */\n\t& .ck.ck-clipboard-drop-target-position {\n\t\tdisplay: inline;\n\t\tposition: relative;\n\t\tpointer-events: none;\n\n\t\t& span {\n\t\t\tposition: absolute;\n\t\t\twidth: 0;\n\t\t}\n\t}\n\n\t/*\n\t * Styles of the widget being dragged (its preview).\n\t */\n\t& .ck-widget:-webkit-drag {\n\t\t& > .ck-widget__selection-handle {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t& > .ck-widget__type-around {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-clipboard-drop-target-dot-width: 12px;\n\t--ck-clipboard-drop-target-dot-height: 8px;\n\t--ck-clipboard-drop-target-color: var(--ck-color-focus-border)\n}\n\n.ck.ck-editor__editable {\n\t/*\n\t * Vertical drop target (in text).\n\t */\n\t& .ck.ck-clipboard-drop-target-position {\n\t\t& span {\n\t\t\tbottom: calc(-.5 * var(--ck-clipboard-drop-target-dot-height));\n\t\t\ttop: calc(-.5 * var(--ck-clipboard-drop-target-dot-height));\n\t\t\tborder: 1px solid var(--ck-clipboard-drop-target-color);\n\t\t\tbackground: var(--ck-clipboard-drop-target-color);\n\t\t\tmargin-left: -1px;\n\n\t\t\t/* The triangle above the marker */\n\t\t\t&::after {\n\t\t\t\tcontent: \"\";\n\t\t\t\twidth: 0;\n\t\t\t\theight: 0;\n\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: 50%;\n\t\t\t\ttop: calc(var(--ck-clipboard-drop-target-dot-height) * -.5);\n\n\t\t\t\ttransform: translateX(-50%);\n\t\t\t\tborder-color: var(--ck-clipboard-drop-target-color) transparent transparent transparent;\n\t\t\t\tborder-width: calc(var(--ck-clipboard-drop-target-dot-height)) calc(.5 * var(--ck-clipboard-drop-target-dot-width)) 0 calc(.5 * var(--ck-clipboard-drop-target-dot-width));\n\t\t\t\tborder-style: solid;\n\t\t\t}\n\t\t}\n\t}\n\n\t/*\n\t// Horizontal drop target (between blocks).\n\t& .ck.ck-clipboard-drop-target-position {\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\twidth: 100%;\n\t\theight: 0;\n\t\tmargin: 0;\n\t\ttext-align: initial;\n\n\t\t& .ck-clipboard-drop-target__line {\n\t\t\tposition: absolute;\n\t\t\twidth: 100%;\n\t\t\theight: 0;\n\t\t\tborder: 1px solid var(--ck-clipboard-drop-target-color);\n\t\t\tmargin-top: -1px;\n\n\t\t\t&::before {\n\t\t\t\tcontent: \"\";\n\t\t\t\twidth: 0;\n\t\t\t\theight: 0;\n\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: calc(-1 * var(--ck-clipboard-drop-target-dot-size));\n\t\t\t\ttop: 0;\n\n\t\t\t\ttransform: translateY(-50%);\n\t\t\t\tborder-color: transparent transparent transparent var(--ck-clipboard-drop-target-color);\n\t\t\t\tborder-width: var(--ck-clipboard-drop-target-dot-size) 0 var(--ck-clipboard-drop-target-dot-size) calc(2 * var(--ck-clipboard-drop-target-dot-size));\n\t\t\t\tborder-style: solid;\n\t\t\t}\n\n\t\t\t&::after {\n\t\t\t\tcontent: \"\";\n\t\t\t\twidth: 0;\n\t\t\t\theight: 0;\n\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\tright: calc(-1 * var(--ck-clipboard-drop-target-dot-size));\n\t\t\t\ttop: 0;\n\n\t\t\t\ttransform: translateY(-50%);\n\t\t\t\tborder-color: transparent var(--ck-clipboard-drop-target-color) transparent transparent;\n\t\t\t\tborder-width: var(--ck-clipboard-drop-target-dot-size) calc(2 * var(--ck-clipboard-drop-target-dot-size)) var(--ck-clipboard-drop-target-dot-size) 0;\n\t\t\t\tborder-style: solid;\n\t\t\t}\n\t\t}\n\t}\n\t*/\n\n\t/*\n\t * Styles of the widget that it a drop target.\n\t */\n\t& .ck-widget.ck-clipboard-drop-target-range {\n\t\toutline: var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color) !important;\n\t}\n\n\t/*\n\t * Styles of the widget being dragged (its preview).\n\t */\n\t& .ck-widget:-webkit-drag {\n\t\tzoom: 0.6;\n\t\toutline: none !important;\n\t}\n}\n"],"sourceRoot":""}]);
  101667. // Exports
  101668. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101669. /***/ }),
  101670. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css":
  101671. /*!***************************************************************************************************************************************************************************!*\
  101672. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css ***!
  101673. \***************************************************************************************************************************************************************************/
  101674. /*! exports provided: default */
  101675. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101676. "use strict";
  101677. __webpack_require__.r(__webpack_exports__);
  101678. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101679. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101680. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101681. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101682. // Imports
  101683. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101684. // Module
  101685. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-editor-classic/classiceditor.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],"names":[],"mappings":"AAKA,cAIC,iBAMD,CAJC,2DAEC,yBACD,CCLC,gDCED,eDKC,CAPA,uICMA,qCAAsC,CDJpC,2BAA4B,CAC5B,4BAIF,CAPA,gDAMC,qBACD,CAEA,iFACC,uBAAwB,CCR1B,eDaC,CANA,yMCHA,qCAAsC,CDOpC,eAEF,CAKF,yCAEC,0CAA2C,CCpB3C,eD8BD,CAZA,yHCdE,qCAAsC,CDmBtC,wBAAyB,CACzB,yBAMF,CAHC,0DACC,wCACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor {\n\t/* All the elements within `.ck-editor` are positioned relatively to it.\n\t If any element needs to be positioned with respect to the <body>, etc.,\n\t it must land outside of the `.ck-editor` in DOM. */\n\tposition: relative;\n\n\t& .ck-editor__top .ck-sticky-panel .ck-toolbar {\n\t\t/* https://github.com/ckeditor/ckeditor5-editor-classic/issues/62 */\n\t\tz-index: var(--ck-z-modal);\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../mixins/_rounded.css\";\n\n.ck.ck-editor__top {\n\t& .ck-sticky-panel {\n\t\t& .ck-toolbar {\n\t\t\t@mixin ck-rounded-corners {\n\t\t\t\tborder-bottom-left-radius: 0;\n\t\t\t\tborder-bottom-right-radius: 0;\n\t\t\t}\n\n\t\t\tborder-bottom-width: 0;\n\t\t}\n\n\t\t& .ck-sticky-panel__content_sticky .ck-toolbar {\n\t\t\tborder-bottom-width: 1px;\n\n\t\t\t@mixin ck-rounded-corners {\n\t\t\t\tborder-radius: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/* Note: Use ck-editor__main to make sure these styles don't apply to other editor types */\n.ck.ck-editor__main > .ck-editor__editable {\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/113 */\n\tbackground: var(--ck-color-base-background);\n\n\t@mixin ck-rounded-corners {\n\t\tborder-top-left-radius: 0;\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t&:not(.ck-focused) {\n\t\tborder-color: var(--ck-color-base-border);\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],"sourceRoot":""}]);
  101686. // Exports
  101687. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101688. /***/ }),
  101689. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css":
  101690. /*!*****************************************************************************************************************************************************************!*\
  101691. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css ***!
  101692. \*****************************************************************************************************************************************************************/
  101693. /*! exports provided: default */
  101694. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101695. "use strict";
  101696. __webpack_require__.r(__webpack_exports__);
  101697. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101698. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101699. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101700. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101701. // Imports
  101702. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101703. // Module
  101704. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-placeholder,.ck .ck-placeholder{position:relative}.ck.ck-placeholder:before,.ck .ck-placeholder:before{position:absolute;left:0;right:0;content:attr(data-placeholder);pointer-events:none}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-placeholder:before,.ck .ck-placeholder:before{cursor:text;color:var(--ck-color-engine-placeholder-text)}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-engine/placeholder.css"],"names":[],"mappings":"AAMA,uCAEC,iBAWD,CATC,qDACC,iBAAkB,CAClB,MAAO,CACP,OAAQ,CACR,8BAA+B,CAG/B,mBACD,CAKA,wCACC,YACD,CClBA,qDACC,WAAY,CACZ,6CACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* See ckeditor/ckeditor5#936. */\n.ck.ck-placeholder,\n.ck .ck-placeholder {\n\tposition: relative;\n\n\t&::before {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tcontent: attr(data-placeholder);\n\n\t\t/* See ckeditor/ckeditor5#469. */\n\t\tpointer-events: none;\n\t}\n}\n\n/* See ckeditor/ckeditor5#1987. */\n.ck.ck-read-only .ck-placeholder {\n\t&::before {\n\t\tdisplay: none;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* See ckeditor/ckeditor5#936. */\n.ck.ck-placeholder, .ck .ck-placeholder {\n\t&::before {\n\t\tcursor: text;\n\t\tcolor: var(--ck-color-engine-placeholder-text);\n\t}\n}\n"],"sourceRoot":""}]);
  101705. // Exports
  101706. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101707. /***/ }),
  101708. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css":
  101709. /*!**************************************************************************************************************************************************************!*\
  101710. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css ***!
  101711. \**************************************************************************************************************************************************************/
  101712. /*! exports provided: default */
  101713. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101714. "use strict";
  101715. __webpack_require__.r(__webpack_exports__);
  101716. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101717. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101718. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101719. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101720. // Imports
  101721. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101722. // Module
  101723. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-editor__editable span[data-ck-unsafe-element]{display:none}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css"],"names":[],"mappings":"AAMA,qDACC,YACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* Elements marked by the Renderer as hidden should be invisible in the editor. */\n.ck.ck-editor__editable span[data-ck-unsafe-element] {\n\tdisplay: none;\n}\n"],"sourceRoot":""}]);
  101724. // Exports
  101725. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101726. /***/ }),
  101727. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css":
  101728. /*!*************************************************************************************************************************************************************!*\
  101729. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css ***!
  101730. \*************************************************************************************************************************************************************/
  101731. /*! exports provided: default */
  101732. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101733. "use strict";
  101734. __webpack_require__.r(__webpack_exports__);
  101735. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101736. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101737. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101738. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101739. // Imports
  101740. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101741. // Module
  101742. ___CSS_LOADER_EXPORT___.push([module.i, ".ck .ck-button.ck-color-table__remove-color{display:flex;align-items:center;width:100%}label.ck.ck-color-grid__label{font-weight:unset}.ck .ck-button.ck-color-table__remove-color{padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck .ck-button.ck-color-table__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-base-border)}[dir=ltr] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard)}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-font/fontcolor.css"],"names":[],"mappings":"AAKA,4CACC,YAAa,CACb,kBAAmB,CACnB,UACD,CAEA,8BACC,iBACD,CCNA,4CACC,qEAAyE,CACzE,2BAA4B,CAC5B,4BAeD,CAbC,wDACC,mDACD,CAEA,kEAEE,uCAMF,CARA,kEAME,sCAEF","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-button.ck-color-table__remove-color {\n\tdisplay: flex;\n\talign-items: center;\n\twidth: 100%;\n}\n\nlabel.ck.ck-color-grid__label {\n\tfont-weight: unset;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\";\n\n.ck .ck-button.ck-color-table__remove-color {\n\tpadding: calc(var(--ck-spacing-standard) / 2 ) var(--ck-spacing-standard);\n\tborder-bottom-left-radius: 0;\n\tborder-bottom-right-radius: 0;\n\n\t&:not(:focus) {\n\t\tborder-bottom: 1px solid var(--ck-color-base-border);\n\t}\n\n\t& .ck.ck-icon {\n\t\t@mixin ck-dir ltr {\n\t\t\tmargin-right: var(--ck-spacing-standard);\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n}\n\n"],"sourceRoot":""}]);
  101743. // Exports
  101744. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101745. /***/ }),
  101746. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css":
  101747. /*!**************************************************************************************************************************************************************!*\
  101748. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css ***!
  101749. \**************************************************************************************************************************************************************/
  101750. /*! exports provided: default */
  101751. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101752. "use strict";
  101753. __webpack_require__.r(__webpack_exports__);
  101754. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101755. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101756. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101757. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101758. // Imports
  101759. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101760. // Module
  101761. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-heading/heading.css"],"names":[],"mappings":"AAKA,wBACC,cACD,CAEA,wBACC,cACD,CAEA,wBACC,cACD,CAEA,+BACC,eACD,CCZC,2EACC,SACD,CAEA,uEACC,cACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-heading_heading1 {\n\tfont-size: 20px;\n}\n\n.ck.ck-heading_heading2 {\n\tfont-size: 17px;\n}\n\n.ck.ck-heading_heading3 {\n\tfont-size: 14px;\n}\n\n.ck[class*=\"ck-heading_heading\"] {\n\tfont-weight: bold;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* Resize dropdown's button label. */\n.ck.ck-dropdown.ck-heading-dropdown {\n\t& .ck-dropdown__button .ck-button__label {\n\t\twidth: 8em;\n\t}\n\n\t& .ck-dropdown__panel .ck-list__item {\n\t\tmin-width: 18em;\n\t}\n}\n"],"sourceRoot":""}]);
  101762. // Exports
  101763. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101764. /***/ }),
  101765. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css":
  101766. /*!*******************************************************************************************************************************************************************!*\
  101767. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css ***!
  101768. \*******************************************************************************************************************************************************************/
  101769. /*! exports provided: default */
  101770. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101771. "use strict";
  101772. __webpack_require__.r(__webpack_exports__);
  101773. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101774. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101775. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101776. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101777. // Imports
  101778. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101779. // Module
  101780. ___CSS_LOADER_EXPORT___.push([module.i, ".ck-widget.raw-html-embed{margin:.9em auto;position:relative;display:flow-root;min-width:15em;font-style:normal}.ck-widget.raw-html-embed:before{position:absolute;z-index:1}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{position:absolute;display:flex;flex-direction:column}.ck-widget.raw-html-embed .raw-html-embed__preview{position:relative;overflow:hidden;display:flex}.ck-widget.raw-html-embed .raw-html-embed__preview-content{width:100%;position:relative;margin:auto;display:table;border-collapse:separate;border-spacing:7px}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{position:absolute;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}:root{--ck-html-embed-content-width:calc(100% - var(--ck-icon-size)*1.5);--ck-html-embed-source-height:10em;--ck-html-embed-unfocused-outline-width:1px;--ck-html-embed-content-min-height:calc(var(--ck-icon-size) + var(--ck-spacing-standard));--ck-html-embed-source-disabled-background:var(--ck-color-base-foreground);--ck-html-embed-source-disabled-color:#737373}.ck-widget.raw-html-embed{font-size:var(--ck-font-size-base);background-color:var(--ck-color-base-foreground)}.ck-widget.raw-html-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.raw-html-embed[dir=ltr]{text-align:left}.ck-widget.raw-html-embed[dir=rtl]{text-align:right}.ck-widget.raw-html-embed:before{content:attr(data-html-embed-label);top:calc(var(--ck-html-embed-unfocused-outline-width)*-1);left:var(--ck-spacing-standard);background:#999;transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);font-size:var(--ck-font-size-tiny);font-family:var(--ck-font-face)}.ck-widget.raw-html-embed[dir=rtl]:before{left:auto;right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed[dir=ltr] .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck.ck-editor__editable.ck-blurred .ck-widget.raw-html-embed.ck-widget_selected:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small)}.ck.ck-editor__editable:not(.ck-blurred) .ck-widget.raw-html-embed.ck-widget_selected:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small);background:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck-widget.raw-html-embed:not(.ck-widget_selected):hover:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small)}.ck-widget.raw-html-embed .raw-html-embed__content-wrapper{padding:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{top:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__save-button{color:var(--ck-color-button-save)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__cancel-button{color:var(--ck-color-button-cancel)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button:not(:first-child){margin-top:var(--ck-spacing-small)}.ck-widget.raw-html-embed[dir=rtl] .raw-html-embed__buttons-wrapper{left:var(--ck-spacing-standard);right:auto}.ck-widget.raw-html-embed .raw-html-embed__source{box-sizing:border-box;height:var(--ck-html-embed-source-height);width:var(--ck-html-embed-content-width);resize:none;min-width:0;padding:var(--ck-spacing-standard);font-family:monospace;tab-size:4;white-space:pre-wrap;font-size:var(--ck-font-size-base);text-align:left;direction:ltr}.ck-widget.raw-html-embed .raw-html-embed__source[disabled]{background:var(--ck-html-embed-source-disabled-background);color:var(--ck-html-embed-source-disabled-color);-webkit-text-fill-color:var(--ck-html-embed-source-disabled-color);opacity:1}.ck-widget.raw-html-embed .raw-html-embed__preview{min-height:var(--ck-html-embed-content-min-height);width:var(--ck-html-embed-content-width)}.ck-editor__editable:not(.ck-read-only) .ck-widget.raw-html-embed .raw-html-embed__preview{pointer-events:none}.ck-widget.raw-html-embed .raw-html-embed__preview-content{box-sizing:border-box;background-color:var(--ck-color-base-foreground)}.ck-widget.raw-html-embed .raw-html-embed__preview-content>*{margin-left:auto;margin-right:auto}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{color:var(--ck-html-embed-source-disabled-color)}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-html-embed/htmlembed.css"],"names":[],"mappings":"AAMA,0BAIC,gBAAkB,CAClB,iBAAkB,CAClB,iBAAkB,CAIlB,cAAe,CAGf,iBAgDD,CA5CC,iCACC,iBAAkB,CAGlB,SACD,CAKA,2DACC,iBAAkB,CAClB,YAAa,CACb,qBACD,CAEA,mDACC,iBAAkB,CAClB,eAAgB,CAChB,YACD,CAEA,2DACC,UAAW,CACX,iBAAkB,CAClB,WAAY,CAGZ,aAAc,CACd,wBAAyB,CACzB,kBACD,CAEA,+DACC,iBAAkB,CAClB,MAAO,CACP,KAAM,CACN,OAAQ,CACR,QAAS,CAET,YAAa,CACb,kBAAmB,CACnB,sBACD,CC7DD,MACC,kEAAqE,CACrE,kCAAmC,CACnC,2CAA4C,CAC5C,yFAA0F,CAE1F,0EAA2E,CAC3E,6CACD,CAGA,0BACC,kCAAmC,CACnC,gDAyID,CAvIC,+DACC,iGACD,CAGA,mCACC,eACD,CAEA,mCACC,gBACD,CAIA,iCACC,mCAAoC,CACpC,yDAA4D,CAC5D,+BAAgC,CAChC,eAA4B,CAC5B,0GAA2G,CAC3G,kIAAmI,CACnI,iEAAkE,CAClE,qCAAsC,CACtC,kCAAmC,CACnC,+BACD,CAEA,0CACC,SAAU,CACV,gCACD,CAGA,iIACC,gBACD,CAxCD,uFA2CE,KAAQ,CACR,sDA+FF,CA3IA,6FAgDE,KAAM,CACN,sDAAuD,CACvD,uCAyFF,CA3IA,wFAsDE,KAAQ,CACR,sDAoFF,CA/EC,2DACC,kCACD,CAGA,2DACC,8BAA+B,CAC/B,gCAaD,CAXC,kGACC,iCACD,CAEA,oGACC,mCACD,CAEA,wFACC,kCACD,CAGD,oEACC,+BAAgC,CAChC,UACD,CAGA,kDACC,qBAAsB,CACtB,yCAA0C,CAC1C,wCAAyC,CACzC,WAAY,CACZ,WAAY,CACZ,kCAAmC,CAEnC,qBAAsB,CACtB,UAAW,CACX,oBAAqB,CACrB,kCAAmC,CAGnC,eAAgB,CAChB,aAUD,CARC,4DACC,0DAA2D,CAC3D,gDAAiD,CAGjD,kEAAmE,CACnE,SACD,CAID,mDACC,kDAAmD,CACnD,wCAMD,CARA,2FAME,mBAEF,CAEA,2DACC,qBAAsB,CACtB,gDAMD,CAJC,6DACC,gBAAiB,CACjB,iBACD,CAGD,+DACC,gDACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* The feature container. */\n.ck-widget.raw-html-embed {\n\t/* Give the embed some air. */\n\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\n\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\n\tmargin: 0.9em auto;\n\tposition: relative;\n\tdisplay: flow-root;\n\n\t/* Give the html embed some minimal width in the content to prevent them\n\tfrom being \"squashed\" in tight spaces, e.g. in table cells (https://github.com/ckeditor/ckeditor5/issues/8331) */\n\tmin-width: 15em;\n\n\t/* Don't inherit the style, e.g. when in a block quote. */\n\tfont-style: normal;\n\n\t/* ----- Emebed label in the upper left corner ----------------------------------------------- */\n\n\t&::before {\n\t\tposition: absolute;\n\n\t\t/* Make sure the content does not cover the label. */\n\t\tz-index: 1;\n\t}\n\n\t/* ----- Emebed internals --------------------------------------------------------------------- */\n\n\t/* The switch mode button wrapper. */\n\t& .raw-html-embed__buttons-wrapper {\n\t\tposition: absolute;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\n\t& .raw-html-embed__preview {\n\t\tposition: relative;\n\t\toverflow: hidden;\n\t\tdisplay: flex;\n\t}\n\n\t& .raw-html-embed__preview-content {\n\t\twidth: 100%;\n\t\tposition: relative;\n\t\tmargin: auto;\n\n\t\t/* Gives spacing to the small renderable elements, so they always cover the placeholder. */\n\t\tdisplay: table;\n\t\tborder-collapse: separate;\n\t\tborder-spacing: 7px;\n\t}\n\n\t& .raw-html-embed__preview-placeholder {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-html-embed-content-width: calc(100% - 1.5 * var(--ck-icon-size));\n\t--ck-html-embed-source-height: 10em;\n\t--ck-html-embed-unfocused-outline-width: 1px;\n\t--ck-html-embed-content-min-height: calc(var(--ck-icon-size) + var(--ck-spacing-standard));\n\n\t--ck-html-embed-source-disabled-background: var(--ck-color-base-foreground);\n\t--ck-html-embed-source-disabled-color: hsl(0deg 0% 45%);\n}\n\n/* The feature container. */\n.ck-widget.raw-html-embed {\n\tfont-size: var(--ck-font-size-base);\n\tbackground-color: var(--ck-color-base-foreground);\n\n\t&:not(.ck-widget_selected):not(:hover) {\n\t\toutline: var(--ck-html-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border);\n\t}\n\n\t/* HTML embed widget itself should respect UI language direction */\n\t&[dir=\"ltr\"] {\n\t\ttext-align: left;\n\t}\n\n\t&[dir=\"rtl\"] {\n\t\ttext-align: right;\n\t}\n\n\t/* ----- Embed label in the upper left corner ----------------------------------------------- */\n\n\t&::before {\n\t\tcontent: attr(data-html-embed-label);\n\t\ttop: calc(-1 * var(--ck-html-embed-unfocused-outline-width));\n\t\tleft: var(--ck-spacing-standard);\n\t\tbackground: hsl(0deg 0% 60%);\n\t\ttransition: background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\n\t\tpadding: calc(var(--ck-spacing-tiny) + var(--ck-html-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);\n\t\tborder-radius: 0 0 var(--ck-border-radius) var(--ck-border-radius);\n\t\tcolor: var(--ck-color-base-background);\n\t\tfont-size: var(--ck-font-size-tiny);\n\t\tfont-family: var(--ck-font-face);\n\t}\n\n\t&[dir=\"rtl\"]::before {\n\t\tleft: auto;\n\t\tright: var(--ck-spacing-standard);\n\t}\n\n\t/* Make space for label but it only collides in LTR languages */\n\t&[dir=\"ltr\"] .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before {\n\t\tmargin-left: 50px;\n\t}\n\n\t@nest .ck.ck-editor__editable.ck-blurred &.ck-widget_selected::before {\n\t\ttop: 0px;\n\t\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-small);\n\t}\n\n\t@nest .ck.ck-editor__editable:not(.ck-blurred) &.ck-widget_selected::before {\n\t\ttop: 0;\n\t\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-small);\n\t\tbackground: var(--ck-color-focus-border);\n\t}\n\n\t@nest .ck.ck-editor__editable &:not(.ck-widget_selected):hover::before {\n\t\ttop: 0px;\n\t\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-small);\n\t}\n\n\t/* ----- Emebed internals --------------------------------------------------------------------- */\n\n\t& .raw-html-embed__content-wrapper {\n\t\tpadding: var(--ck-spacing-standard);\n\t}\n\n\t/* The switch mode button wrapper. */\n\t& .raw-html-embed__buttons-wrapper {\n\t\ttop: var(--ck-spacing-standard);\n\t\tright: var(--ck-spacing-standard);\n\n\t\t& .ck-button.raw-html-embed__save-button {\n\t\t\tcolor: var(--ck-color-button-save);\n\t\t}\n\n\t\t& .ck-button.raw-html-embed__cancel-button {\n\t\t\tcolor: var(--ck-color-button-cancel);\n\t\t}\n\n\t\t& .ck-button:not(:first-child) {\n\t\t\tmargin-top: var(--ck-spacing-small);\n\t\t}\n\t}\n\n\t&[dir=\"rtl\"] .raw-html-embed__buttons-wrapper {\n\t\tleft: var(--ck-spacing-standard);\n\t\tright: auto;\n\t}\n\n\t/* The edit source element. */\n\t& .raw-html-embed__source {\n\t\tbox-sizing: border-box;\n\t\theight: var(--ck-html-embed-source-height);\n\t\twidth: var(--ck-html-embed-content-width);\n\t\tresize: none;\n\t\tmin-width: 0;\n\t\tpadding: var(--ck-spacing-standard);\n\n\t\tfont-family: monospace;\n\t\ttab-size: 4;\n\t\twhite-space: pre-wrap;\n\t\tfont-size: var(--ck-font-size-base); /* Safari needs this. */\n\n\t\t/* HTML code is direction–agnostic. */\n\t\ttext-align: left;\n\t\tdirection: ltr;\n\n\t\t&[disabled] {\n\t\t\tbackground: var(--ck-html-embed-source-disabled-background);\n\t\t\tcolor: var(--ck-html-embed-source-disabled-color);\n\n\t\t\t/* Safari needs this for the proper text color in disabled input (https://github.com/ckeditor/ckeditor5/issues/8320). */\n\t\t\t-webkit-text-fill-color: var(--ck-html-embed-source-disabled-color);\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\t/* The preview data container. */\n\t& .raw-html-embed__preview {\n\t\tmin-height: var(--ck-html-embed-content-min-height);\n\t\twidth: var(--ck-html-embed-content-width);\n\n\t\t/* Disable all mouse interaction as long as the editor is not read–only. */\n\t\t@nest .ck-editor__editable:not(.ck-read-only) & {\n\t\t\tpointer-events: none;\n\t\t}\n\t}\n\n\t& .raw-html-embed__preview-content {\n\t\tbox-sizing: border-box;\n\t\tbackground-color: var(--ck-color-base-foreground);\n\n\t\t& > * {\n\t\t\tmargin-left: auto;\n\t\t\tmargin-right: auto;\n\t\t}\n\t}\n\n\t& .raw-html-embed__preview-placeholder {\n\t\tcolor: var(--ck-html-embed-source-disabled-color)\n\t}\n}\n"],"sourceRoot":""}]);
  101781. // Exports
  101782. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101783. /***/ }),
  101784. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-image/theme/image.css":
  101785. /*!**********************************************************************************************************************************************************!*\
  101786. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-image/theme/image.css ***!
  101787. \**********************************************************************************************************************************************************/
  101788. /*! exports provided: default */
  101789. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101790. "use strict";
  101791. __webpack_require__.r(__webpack_exports__);
  101792. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101793. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101794. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101795. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101796. // Imports
  101797. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101798. // Module
  101799. ___CSS_LOADER_EXPORT___.push([module.i, ".ck-content .image{display:table;clear:both;text-align:center;margin:.9em auto;min-width:50px}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:100%}.ck-content .image-inline{display:inline-flex;max-width:100%;align-items:flex-start}.ck-content .image-inline picture{display:flex}.ck-content .image-inline img,.ck-content .image-inline picture{flex-grow:1;flex-shrink:1;max-width:100%}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{padding-left:inherit;padding-right:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ck.ck-editor__editable .image-inline.ck-widget_selected,.ck.ck-editor__editable .image.ck-widget_selected{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{display:none}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/image.css"],"names":[],"mappings":"AAMC,mBACC,aAAc,CACd,UAAW,CACX,iBAAkB,CAKlB,gBAAkB,CAGlB,cAeD,CAbC,uBAEC,aAAc,CAGd,aAAc,CAGd,cAAe,CAGf,cACD,CAGD,0BAMC,mBAAoB,CAGpB,cAAe,CAGf,sBAiBD,CAdC,kCACC,YACD,CAGA,gEAGC,WAAY,CACZ,aAAc,CAGd,cACD,CAUD,gEACC,oBAAqB,CACrB,qBAAsB,CAMtB,kBAAmB,CACnB,eAAgB,CAChB,sBACD,CAWA,2GACC,SAUD,CAHC,qEACC,YACD,CAOA,0FACC,cACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-content {\n\t& .image {\n\t\tdisplay: table;\n\t\tclear: both;\n\t\ttext-align: center;\n\n\t\t/* Make sure there is some space between the content and the image. Center image by default. */\n\t\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\n\t \tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\n\t\tmargin: 0.9em auto;\n\n\t\t/* Make sure the caption will be displayed properly (See: https://github.com/ckeditor/ckeditor5/issues/1870). */\n\t\tmin-width: 50px;\n\n\t\t& img {\n\t\t\t/* Prevent unnecessary margins caused by line-height (see #44). */\n\t\t\tdisplay: block;\n\n\t\t\t/* Center the image if its width is smaller than the content's width. */\n\t\t\tmargin: 0 auto;\n\n\t\t\t/* Make sure the image never exceeds the size of the parent container (ckeditor/ckeditor5-ui#67). */\n\t\t\tmax-width: 100%;\n\n\t\t\t/* Make sure the image is never smaller than the parent container (See: https://github.com/ckeditor/ckeditor5/issues/9300). */\n\t\t\tmin-width: 100%\n\t\t}\n\t}\n\n\t& .image-inline {\n\t\t/*\n\t\t * Normally, the .image-inline would have \"display: inline-block\" and \"img { width: 100% }\" (to follow the wrapper while resizing).\n\t\t * Unfortunately, together with \"srcset\", it gets automatically stretched up to the width of the editing root.\n\t\t * This strange behavior does not happen with inline-flex.\n\t\t */\n\t\tdisplay: inline-flex;\n\n\t\t/* While being resized, don't allow the image to exceed the width of the editing root. */\n\t\tmax-width: 100%;\n\n\t\t/* This is required by Safari to resize images in a sensible way. Without this, the browser breaks the ratio. */\n\t\talign-items: flex-start;\n\n\t\t/* When the picture is present it must act as a flex container to let the img resize properly */\n\t\t& picture {\n\t\t\tdisplay: flex;\n\t\t}\n\n\t\t/* When the picture is present, it must act like a resizable img. */\n\t\t& picture,\n\t\t& img {\n\t\t\t/* This is necessary for the img to span the entire .image-inline wrapper and to resize properly. */\n\t\t\tflex-grow: 1;\n\t\t\tflex-shrink: 1;\n\n\t\t\t/* Prevents overflowing the editing root boundaries when an inline image is very wide. */\n\t\t\tmax-width: 100%;\n\t\t}\n\t}\n}\n\n.ck.ck-editor__editable {\n\t/*\n\t * Inhertit the content styles padding of the <figcaption> in case the integration overrides `text-align: center`\n\t * of `.image` (e.g. to the left/right). This ensures the placeholder stays at the padding just like the native\n\t * caret does, and not at the edge of <figcaption>.\n\t */\n\t& .image > figcaption.ck-placeholder::before {\n\t\tpadding-left: inherit;\n\t\tpadding-right: inherit;\n\n\t\t/*\n\t\t * Make sure the image caption placeholder doesn't overflow the placeholder area.\n\t\t * See https://github.com/ckeditor/ckeditor5/issues/9162.\n\t\t */\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\n\t/*\n\t * Make sure the selected inline image always stays on top of its siblings.\n\t * See https://github.com/ckeditor/ckeditor5/issues/9108.\n\t */\n\t& .image.ck-widget_selected {\n\t\tz-index: 1;\n\t}\n\n\t& .image-inline.ck-widget_selected {\n\t\tz-index: 1;\n\n\t\t/*\n\t\t * Make sure the native browser selection style is not displayed.\n\t\t * Inline image widgets have their own styles for the selected state and\n\t\t * leaving this up to the browser is asking for a visual collision.\n\t\t */\n\t\t& ::selection {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t/* The inline image nested in the table should have its original size if not resized.\n\tSee https://github.com/ckeditor/ckeditor5/issues/9117. */\n\t& td,\n\t& th {\n\t\t& .image-inline img {\n\t\t\tmax-width: none;\n\t\t}\n\t}\n}\n"],"sourceRoot":""}]);
  101800. // Exports
  101801. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101802. /***/ }),
  101803. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css":
  101804. /*!*****************************************************************************************************************************************************************!*\
  101805. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css ***!
  101806. \*****************************************************************************************************************************************************************/
  101807. /*! exports provided: default */
  101808. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101809. "use strict";
  101810. __webpack_require__.r(__webpack_exports__);
  101811. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101812. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101813. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101814. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101815. // Imports
  101816. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101817. // Module
  101818. ___CSS_LOADER_EXPORT___.push([module.i, ":root{--ck-color-image-caption-background:#f7f7f7;--ck-color-image-caption-text:#333;--ck-color-image-caption-highligted-background:#fd0}.ck-content .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:var(--ck-color-image-caption-text);background-color:var(--ck-color-image-caption-background);padding:.6em;font-size:.75em;outline-offset:-1px}.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:ck-image-caption-highlight .6s ease-out}@keyframes ck-image-caption-highlight{0%{background-color:var(--ck-color-image-caption-highligted-background)}to{background-color:var(--ck-color-image-caption-background)}}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css"],"names":[],"mappings":"AAKA,MACC,2CAAoD,CACpD,kCAA8C,CAC9C,mDACD,CAGA,8BACC,qBAAsB,CACtB,mBAAoB,CACpB,qBAAsB,CACtB,wCAAyC,CACzC,yDAA0D,CAC1D,YAAa,CACb,eAAgB,CAChB,mBACD,CAGA,qEACC,iDACD,CAEA,sCACC,GACC,oEACD,CAEA,GACC,yDACD,CACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-image-caption-background: hsl(0, 0%, 97%);\n\t--ck-color-image-caption-text: hsl(0, 0%, 20%);\n\t--ck-color-image-caption-highligted-background: hsl(52deg 100% 50%);\n}\n\n/* Content styles */\n.ck-content .image > figcaption {\n\tdisplay: table-caption;\n\tcaption-side: bottom;\n\tword-break: break-word;\n\tcolor: var(--ck-color-image-caption-text);\n\tbackground-color: var(--ck-color-image-caption-background);\n\tpadding: .6em;\n\tfont-size: .75em;\n\toutline-offset: -1px;\n}\n\n/* Editing styles */\n.ck.ck-editor__editable .image > figcaption.image__caption_highlighted {\n\tanimation: ck-image-caption-highlight .6s ease-out;\n}\n\n@keyframes ck-image-caption-highlight {\n\t0% {\n\t\tbackground-color: var(--ck-color-image-caption-highligted-background);\n\t}\n\n\t100% {\n\t\tbackground-color: var(--ck-color-image-caption-background);\n\t}\n}\n"],"sourceRoot":""}]);
  101819. // Exports
  101820. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101821. /***/ }),
  101822. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css":
  101823. /*!****************************************************************************************************************************************************************!*\
  101824. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css ***!
  101825. \****************************************************************************************************************************************************************/
  101826. /*! exports provided: default */
  101827. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101828. "use strict";
  101829. __webpack_require__.r(__webpack_exports__);
  101830. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101831. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101832. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101833. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101834. // Imports
  101835. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101836. // Module
  101837. ___CSS_LOADER_EXPORT___.push([module.i, ".ck-content .image.image_resized{max-width:100%;display:block;box-sizing:border-box}.ck-content .image.image_resized img{width:100%}.ck-content .image.image_resized>figcaption{display:block}.ck.ck-editor__editable td .image-inline.image_resized img,.ck.ck-editor__editable th .image-inline.image_resized img{max-width:100%}[dir=ltr] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-left:var(--ck-spacing-standard)}.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label{width:4em}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css"],"names":[],"mappings":"AAKA,iCACC,cAAe,CAMf,aAAc,CACd,qBAWD,CATC,qCAEC,UACD,CAEA,4CAEC,aACD,CAQC,sHACC,cACD,CAIF,oFACC,uCACD,CAEA,oFACC,sCACD,CAEA,oEACC,SACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-content .image.image_resized {\n\tmax-width: 100%;\n\t/*\n\tThe `<figure>` element for resized images must not use `display:table` as browsers do not support `max-width` for it well.\n\tSee https://stackoverflow.com/questions/4019604/chrome-safari-ignoring-max-width-in-table/14420691#14420691 for more.\n\tFortunately, since we control the width, there is no risk that the image will look bad.\n\t*/\n\tdisplay: block;\n\tbox-sizing: border-box;\n\n\t& img {\n\t\t/* For resized images it is the `<figure>` element that determines the image width. */\n\t\twidth: 100%;\n\t}\n\n\t& > figcaption {\n\t\t/* The `<figure>` element uses `display:block`, so `<figcaption>` also has to. */\n\t\tdisplay: block;\n\t}\n}\n\n.ck.ck-editor__editable {\n\t/* The resized inline image nested in the table should respect its parent size.\n\tSee https://github.com/ckeditor/ckeditor5/issues/9117. */\n\t& td,\n\t& th {\n\t\t& .image-inline.image_resized img {\n\t\t\tmax-width: 100%;\n\t\t}\n\t}\n}\n\n[dir=\"ltr\"] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon {\n\tmargin-right: var(--ck-spacing-standard);\n}\n\n[dir=\"rtl\"] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon {\n\tmargin-left: var(--ck-spacing-standard);\n}\n\n.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label {\n\twidth: 4em;\n}\n"],"sourceRoot":""}]);
  101838. // Exports
  101839. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101840. /***/ }),
  101841. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css":
  101842. /*!***************************************************************************************************************************************************************!*\
  101843. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css ***!
  101844. \***************************************************************************************************************************************************************/
  101845. /*! exports provided: default */
  101846. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101847. "use strict";
  101848. __webpack_require__.r(__webpack_exports__);
  101849. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101850. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101851. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101852. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101853. // Imports
  101854. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101855. // Module
  101856. ___CSS_LOADER_EXPORT___.push([module.i, ":root{--ck-image-style-spacing:1.5em;--ck-inline-image-style-spacing:calc(var(--ck-image-style-spacing)/2)}.ck-content .image-style-block-align-left,.ck-content .image-style-block-align-right{max-width:calc(100% - var(--ck-image-style-spacing))}.ck-content .image-style-align-left,.ck-content .image-style-align-right{clear:none}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content .image-style-block-align-right{margin-right:0;margin-left:auto}.ck-content .image-style-block-align-left{margin-left:0;margin-right:auto}.ck-content p+.image-style-align-left,.ck-content p+.image-style-align-right,.ck-content p+.image-style-side{margin-top:0}.ck-content .image-inline.image-style-align-left,.ck-content .image-inline.image-style-align-right{margin-top:var(--ck-inline-image-style-spacing);margin-bottom:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-left{margin-right:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-right{margin-left:var(--ck-inline-image-style-spacing)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-background)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after{display:none}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-hover-background)}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css"],"names":[],"mappings":"AAKA,MACC,8BAA+B,CAC/B,qEACD,CAMC,qFAEC,oDACD,CAIA,yEAEC,UACD,CAEA,8BACC,WAAY,CACZ,yCAA0C,CAC1C,aACD,CAEA,oCACC,UAAW,CACX,0CACD,CAEA,sCACC,gBAAiB,CACjB,iBACD,CAEA,qCACC,WAAY,CACZ,yCACD,CAEA,2CACC,cAAe,CACf,gBACD,CAEA,0CACC,aAAc,CACd,iBACD,CAGA,6GAGC,YACD,CAGC,mGAEC,+CAAgD,CAChD,kDACD,CAEA,iDACC,iDACD,CAEA,kDACC,gDACD,CAUC,0lBAGC,qDAKD,CAHC,8nBACC,YACD,CAKD,oVAGC,2DACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-image-style-spacing: 1.5em;\n\t--ck-inline-image-style-spacing: calc(var(--ck-image-style-spacing) / 2);\n}\n\n.ck-content {\n\t/* Provides a minimal side margin for the left and right aligned images, so that the user has a visual feedback\n\tconfirming successful application of the style if image width exceeds the editor's size.\n\tSee https://github.com/ckeditor/ckeditor5/issues/9342 */\n\t& .image-style-block-align-left,\n\t& .image-style-block-align-right {\n\t\tmax-width: calc(100% - var(--ck-image-style-spacing));\n\t}\n\n\t/* Allows displaying multiple floating images in the same line.\n\tSee https://github.com/ckeditor/ckeditor5/issues/9183#issuecomment-804988132 */\n\t& .image-style-align-left,\n\t& .image-style-align-right {\n\t\tclear: none;\n\t}\n\n\t& .image-style-side {\n\t\tfloat: right;\n\t\tmargin-left: var(--ck-image-style-spacing);\n\t\tmax-width: 50%;\n\t}\n\n\t& .image-style-align-left {\n\t\tfloat: left;\n\t\tmargin-right: var(--ck-image-style-spacing);\n\t}\n\n\t& .image-style-align-center {\n\t\tmargin-left: auto;\n\t\tmargin-right: auto;\n\t}\n\n\t& .image-style-align-right {\n\t\tfloat: right;\n\t\tmargin-left: var(--ck-image-style-spacing);\n\t}\n\n\t& .image-style-block-align-right {\n\t\tmargin-right: 0;\n\t\tmargin-left: auto;\n\t}\n\n\t& .image-style-block-align-left {\n\t\tmargin-left: 0;\n\t\tmargin-right: auto;\n\t}\n\n\t/* Simulates margin collapsing with the preceding paragraph, which does not work for the floating elements. */\n\t& p + .image-style-align-left,\n\t& p + .image-style-align-right,\n\t& p + .image-style-side {\n\t\tmargin-top: 0;\n\t}\n\n\t& .image-inline {\n\t\t&.image-style-align-left,\n\t\t&.image-style-align-right {\n\t\t\tmargin-top: var(--ck-inline-image-style-spacing);\n\t\t\tmargin-bottom: var(--ck-inline-image-style-spacing);\n\t\t}\n\n\t\t&.image-style-align-left {\n\t\t\tmargin-right: var(--ck-inline-image-style-spacing);\n\t\t}\n\n\t\t&.image-style-align-right {\n\t\t\tmargin-left: var(--ck-inline-image-style-spacing);\n\t\t}\n\t}\n}\n\n.ck.ck-splitbutton {\n\t/* The button should display as a regular drop-down if the action button\n\tis forced to fire the same action as the arrow button. */\n\t&.ck-splitbutton_flatten {\n\t\t&:hover,\n\t\t&.ck-splitbutton_open {\n\t\t\t& > .ck-splitbutton__action:not(.ck-disabled),\n\t\t\t& > .ck-splitbutton__arrow:not(.ck-disabled),\n\t\t\t& > .ck-splitbutton__arrow:not(.ck-disabled):not(:hover) {\n\t\t\t\tbackground-color: var(--ck-color-button-on-background);\n\n\t\t\t\t&::after {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t&.ck-splitbutton_open:hover {\n\t\t\t& > .ck-splitbutton__action:not(.ck-disabled),\n\t\t\t& > .ck-splitbutton__arrow:not(.ck-disabled),\n\t\t\t& > .ck-splitbutton__arrow:not(.ck-disabled):not(:hover) {\n\t\t\t\tbackground-color: var(--ck-color-button-on-hover-background);\n\t\t\t}\n\t\t}\n\t}\n}\n"],"sourceRoot":""}]);
  101857. // Exports
  101858. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101859. /***/ }),
  101860. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css":
  101861. /*!********************************************************************************************************************************************************************!*\
  101862. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css ***!
  101863. \********************************************************************************************************************************************************************/
  101864. /*! exports provided: default */
  101865. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101866. "use strict";
  101867. __webpack_require__.r(__webpack_exports__);
  101868. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101869. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101870. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101871. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101872. // Imports
  101873. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101874. // Module
  101875. ___CSS_LOADER_EXPORT___.push([module.i, ".ck-image-upload-complete-icon{display:block;position:absolute;top:min(var(--ck-spacing-medium),6%);right:min(var(--ck-spacing-medium),6%);border-radius:50%;z-index:1}.ck-image-upload-complete-icon:after{content:\"\";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20;--ck-image-upload-icon-width:2px;--ck-image-upload-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck-image-upload-complete-icon{opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:calc(1px*var(--ck-image-upload-icon-size));animation-delay:0ms,3s;overflow:hidden;width:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size));height:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size))}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadicon.css"],"names":[],"mappings":"AAKA,+BACC,aAAc,CACd,iBAAkB,CAMlB,oCAAsC,CACtC,sCAAwC,CACxC,iBAAkB,CAClB,SAMD,CAJC,qCACC,UAAW,CACX,iBACD,CChBD,MACC,iCAA8C,CAC9C,+CAA4D,CAG5D,8BAA+B,CAC/B,gCAAiC,CACjC,4DACD,CAEA,+BACC,SAAU,CACV,uDAAwD,CACxD,wEAA0E,CAC1E,qCAAuC,CACvC,0BAAgC,CAGhC,oDAAuD,CAGvD,sBAA4B,CAM5B,eAAgB,CAChB,mFAAsF,CACtF,oFAyBD,CAtBC,qCAEC,QAAS,CAET,OAAQ,CACR,SAAU,CACV,QAAS,CACT,OAAQ,CAER,mCAAoC,CACpC,yBAA0B,CAC1B,oFAAqF,CACrF,sFAAuF,CAEvF,4CAA6C,CAC7C,sBAAyB,CACzB,mBAAsB,CACtB,4BAA6B,CAG7B,qBACD,CAGD,wCACC,GACC,SACD,CAEA,GACC,SACD,CACD,CAEA,wCACC,GACC,SACD,CAEA,GACC,SACD,CACD,CAEA,yCACC,GACC,SAAU,CACV,OAAQ,CACR,QACD,CACA,IACC,UAAY,CACZ,QACD,CACA,GACC,SAAU,CACV,UAAY,CACZ,YACD,CACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-image-upload-complete-icon {\n\tdisplay: block;\n\tposition: absolute;\n\n\t/*\n\t * Smaller images should have the icon closer to the border.\n\t * Match the icon position with the linked image indicator brought by the link image feature.\n\t */\n\ttop: min(var(--ck-spacing-medium), 6%);\n\tright: min(var(--ck-spacing-medium), 6%);\n\tborder-radius: 50%;\n\tz-index: 1;\n\n\t&::after {\n\t\tcontent: \"\";\n\t\tposition: absolute;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-image-upload-icon: hsl(0, 0%, 100%);\n\t--ck-color-image-upload-icon-background: hsl(120, 100%, 27%);\n\n\t/* Match the icon size with the linked image indicator brought by the link image feature. */\n\t--ck-image-upload-icon-size: 20;\n\t--ck-image-upload-icon-width: 2px;\n\t--ck-image-upload-icon-is-visible: clamp(0px, 100% - 50px, 1px);\n}\n\n.ck-image-upload-complete-icon {\n\topacity: 0;\n\tbackground: var(--ck-color-image-upload-icon-background);\n\tanimation-name: ck-upload-complete-icon-show, ck-upload-complete-icon-hide;\n\tanimation-fill-mode: forwards, forwards;\n\tanimation-duration: 500ms, 500ms;\n\n\t/* To make animation scalable. */\n\tfont-size: calc(1px * var(--ck-image-upload-icon-size));\n\n\t/* Hide completed upload icon after 3 seconds. */\n\tanimation-delay: 0ms, 3000ms;\n\n\t/*\n\t * Use CSS math to simulate container queries.\n\t * https://css-tricks.com/the-raven-technique-one-step-closer-to-container-queries/#what-about-showing-and-hiding-things\n\t */\n\toverflow: hidden;\n\twidth: calc(var(--ck-image-upload-icon-is-visible) * var(--ck-image-upload-icon-size));\n\theight: calc(var(--ck-image-upload-icon-is-visible) * var(--ck-image-upload-icon-size));\n\n\t/* This is check icon element made from border-width mixed with animations. */\n\t&::after {\n\t\t/* Because of border transformation we need to \"hard code\" left position. */\n\t\tleft: 25%;\n\n\t\ttop: 50%;\n\t\topacity: 0;\n\t\theight: 0;\n\t\twidth: 0;\n\n\t\ttransform: scaleX(-1) rotate(135deg);\n\t\ttransform-origin: left top;\n\t\tborder-top: var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);\n\t\tborder-right: var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);\n\n\t\tanimation-name: ck-upload-complete-icon-check;\n\t\tanimation-duration: 500ms;\n\t\tanimation-delay: 500ms;\n\t\tanimation-fill-mode: forwards;\n\n\t\t/* #1095. While reset is not providing proper box-sizing for pseudoelements, we need to handle it. */\n\t\tbox-sizing: border-box;\n\t}\n}\n\n@keyframes ck-upload-complete-icon-show {\n\tfrom {\n\t\topacity: 0;\n\t}\n\n\tto {\n\t\topacity: 1;\n\t}\n}\n\n@keyframes ck-upload-complete-icon-hide {\n\tfrom {\n\t\topacity: 1;\n\t}\n\n\tto {\n\t\topacity: 0;\n\t}\n}\n\n@keyframes ck-upload-complete-icon-check {\n\t0% {\n\t\topacity: 1;\n\t\twidth: 0;\n\t\theight: 0;\n\t}\n\t33% {\n\t\twidth: 0.3em;\n\t\theight: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t\twidth: 0.3em;\n\t\theight: 0.45em;\n\t}\n}\n"],"sourceRoot":""}]);
  101876. // Exports
  101877. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101878. /***/ }),
  101879. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css":
  101880. /*!**********************************************************************************************************************************************************************!*\
  101881. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css ***!
  101882. \**********************************************************************************************************************************************************************/
  101883. /*! exports provided: default */
  101884. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101885. "use strict";
  101886. __webpack_require__.r(__webpack_exports__);
  101887. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101888. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101889. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101890. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101891. // Imports
  101892. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101893. // Module
  101894. ___CSS_LOADER_EXPORT___.push([module.i, ".ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:\"\";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px;--ck-upload-placeholder-image-aspect-ratio:2.8}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-image-upload-placeholder.image-inline{width:calc(var(--ck-upload-placeholder-loader-size)*2*var(--ck-upload-placeholder-image-aspect-ratio))}.ck .ck-image-upload-placeholder img{aspect-ratio:var(--ck-upload-placeholder-image-aspect-ratio)}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadloader.css"],"names":[],"mappings":"AAKA,kCACC,iBAAkB,CAClB,YAAa,CACb,kBAAmB,CACnB,sBAAuB,CACvB,KAAM,CACN,MAMD,CAJC,yCACC,UAAW,CACX,iBACD,CCXD,MACC,4CAAqD,CACrD,wCAAyC,CACzC,8CACD,CAEA,iCAEC,UAAW,CACX,QAeD,CAbC,8CACC,sGACD,CAEA,qCAOC,4DACD,CAGD,kCACC,UAAW,CACX,WAUD,CARC,yCACC,8CAA+C,CAC/C,+CAAgD,CAChD,iBAAkB,CAClB,8DAA+D,CAC/D,kCAAmC,CACnC,yDACD,CAGD,wCACC,GACC,uBACD,CACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-upload-placeholder-loader {\n\tposition: absolute;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\ttop: 0;\n\tleft: 0;\n\n\t&::before {\n\t\tcontent: '';\n\t\tposition: relative;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-upload-placeholder-loader: hsl(0, 0%, 70%);\n\t--ck-upload-placeholder-loader-size: 32px;\n\t--ck-upload-placeholder-image-aspect-ratio: 2.8;\n}\n\n.ck .ck-image-upload-placeholder {\n\t/* We need to control the full width of the SVG gray background. */\n\twidth: 100%;\n\tmargin: 0;\n\n\t&.image-inline {\n\t\twidth: calc( 2 * var(--ck-upload-placeholder-loader-size) * var(--ck-upload-placeholder-image-aspect-ratio) );\n\t}\n\n\t& img {\n\t\t/*\n\t\t * This is an arbitrary aspect for a 1x1 px GIF to display to the user. Not too tall, not too short.\n\t\t * There's nothing special about this number except that it should make the image placeholder look like\n\t\t * a real image during this short period after the upload started and before the image was read from the\n\t\t * file system (and a rich preview was loaded).\n\t\t */\n\t\taspect-ratio: var(--ck-upload-placeholder-image-aspect-ratio);\n\t}\n}\n\n.ck .ck-upload-placeholder-loader {\n\twidth: 100%;\n\theight: 100%;\n\n\t&::before {\n\t\twidth: var(--ck-upload-placeholder-loader-size);\n\t\theight: var(--ck-upload-placeholder-loader-size);\n\t\tborder-radius: 50%;\n\t\tborder-top: 3px solid var(--ck-color-upload-placeholder-loader);\n\t\tborder-right: 2px solid transparent;\n\t\tanimation: ck-upload-placeholder-loader 1s linear infinite;\n\t}\n}\n\n@keyframes ck-upload-placeholder-loader {\n\tto {\n\t\ttransform: rotate( 360deg );\n\t}\n}\n"],"sourceRoot":""}]);
  101895. // Exports
  101896. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101897. /***/ }),
  101898. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css":
  101899. /*!************************************************************************************************************************************************************************!*\
  101900. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css ***!
  101901. \************************************************************************************************************************************************************************/
  101902. /*! exports provided: default */
  101903. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101904. "use strict";
  101905. __webpack_require__.r(__webpack_exports__);
  101906. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101907. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101908. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101909. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101910. // Imports
  101911. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101912. // Module
  101913. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-editor__editable .image,.ck.ck-editor__editable .image-inline{position:relative}.ck.ck-editor__editable .image-inline .ck-progress-bar,.ck.ck-editor__editable .image .ck-progress-bar{position:absolute;top:0;left:0}.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image-inline .ck-progress-bar,.ck.ck-editor__editable .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadprogress.css"],"names":[],"mappings":"AAMC,qEAEC,iBACD,CAGA,uGAEC,iBAAkB,CAClB,KAAM,CACN,MACD,CCRC,yFACC,oBACD,CAID,uGAEC,UAAW,CACX,OAAQ,CACR,gDAAiD,CACjD,oBACD,CAGD,kBACC,GAAO,SAAY,CACnB,GAAO,SAAY,CACpB","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor__editable {\n\t& .image,\n\t& .image-inline {\n\t\tposition: relative;\n\t}\n\n\t/* Upload progress bar. */\n\t& .image .ck-progress-bar,\n\t& .image-inline .ck-progress-bar {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor__editable {\n\t& .image,\n\t& .image-inline {\n\t\t/* Showing animation. */\n\t\t&.ck-appear {\n\t\t\tanimation: fadeIn 700ms;\n\t\t}\n\t}\n\n\t/* Upload progress bar. */\n\t& .image .ck-progress-bar,\n\t& .image-inline .ck-progress-bar {\n\t\theight: 2px;\n\t\twidth: 0;\n\t\tbackground: var(--ck-color-upload-bar-background);\n\t\ttransition: width 100ms;\n\t}\n}\n\n@keyframes fadeIn {\n\tfrom { opacity: 0; }\n\tto { opacity: 1; }\n}\n"],"sourceRoot":""}]);
  101914. // Exports
  101915. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101916. /***/ }),
  101917. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css":
  101918. /*!************************************************************************************************************************************************************************!*\
  101919. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css ***!
  101920. \************************************************************************************************************************************************************************/
  101921. /*! exports provided: default */
  101922. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101923. "use strict";
  101924. __webpack_require__.r(__webpack_exports__);
  101925. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101926. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101927. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101928. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101929. // Imports
  101930. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101931. // Module
  101932. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css"],"names":[],"mappings":"AAOA,6BACC,YAAa,CACb,kBAAmB,CACnB,gBAqBD,CAnBC,oDACC,oBACD,CAEA,uCACC,YACD,CCZA,oCDCD,6BAcE,cAUF,CARE,oDACC,eACD,CAEA,wCACC,cACD,CCrBD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\";\n\n.ck.ck-text-alternative-form {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: nowrap;\n\n\t& .ck-labeled-field-view {\n\t\tdisplay: inline-block;\n\t}\n\n\t& .ck-label {\n\t\tdisplay: none;\n\t}\n\n\t@mixin ck-media-phone {\n\t\tflex-wrap: wrap;\n\n\t\t& .ck-labeled-field-view {\n\t\t\tflex-basis: 100%;\n\t\t}\n\n\t\t& .ck-button {\n\t\t\tflex-basis: 50%;\n\t\t}\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n"],"sourceRoot":""}]);
  101933. // Exports
  101934. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101935. /***/ }),
  101936. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-link/theme/link.css":
  101937. /*!********************************************************************************************************************************************************!*\
  101938. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-link/theme/link.css ***!
  101939. \********************************************************************************************************************************************************/
  101940. /*! exports provided: default */
  101941. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101942. "use strict";
  101943. __webpack_require__.r(__webpack_exports__);
  101944. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101945. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101946. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101947. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101948. // Imports
  101949. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101950. // Module
  101951. ___CSS_LOADER_EXPORT___.push([module.i, ".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-link_selected span.image-inline{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{height:100%;border-right:1px solid var(--ck-color-base-text);margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/link.css"],"names":[],"mappings":"AAMA,sBACC,mDAMD,CAHC,wCACC,yFACD,CAOD,4BACC,8CACD,CAGA,sCACC,WAAY,CACZ,gDAAiD,CACjD,iBAAkB,CAClB,oCACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* Class added to span element surrounding currently selected link. */\n.ck .ck-link_selected {\n\tbackground: var(--ck-color-link-selected-background);\n\n\t/* Give linked inline images some outline to let the user know they are also part of the link. */\n\t& span.image-inline {\n\t\toutline: var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background);\n\t}\n}\n\n/*\n * Classes used by the \"fake visual selection\" displayed in the content when an input\n * in the link UI has focus (the browser does not render the native selection in this state).\n */\n.ck .ck-fake-link-selection {\n\tbackground: var(--ck-color-link-fake-selection);\n}\n\n/* A collapsed fake visual selection. */\n.ck .ck-fake-link-selection_collapsed {\n\theight: 100%;\n\tborder-right: 1px solid var(--ck-color-base-text);\n\tmargin-right: -1px;\n\toutline: solid 1px hsla(0, 0%, 100%, .5);\n}\n"],"sourceRoot":""}]);
  101952. // Exports
  101953. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101954. /***/ }),
  101955. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css":
  101956. /*!***************************************************************************************************************************************************************!*\
  101957. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css ***!
  101958. \***************************************************************************************************************************************************************/
  101959. /*! exports provided: default */
  101960. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101961. "use strict";
  101962. __webpack_require__.r(__webpack_exports__);
  101963. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101964. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101965. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101966. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101967. // Imports
  101968. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101969. // Module
  101970. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkactions.css"],"names":[],"mappings":"AAOA,oBACC,YAAa,CACb,kBAAmB,CACnB,gBAqBD,CAnBC,8CACC,oBAKD,CAHC,gEACC,eACD,CCXD,oCDCD,oBAcE,cAUF,CARE,8CACC,eACD,CAEA,8DACC,cACD,CCrBD,CCKA,wDACC,cAAe,CACf,eAmCD,CAjCC,0EACC,kCAAmC,CACnC,kCAAmC,CACnC,sBAAuB,CACvB,cAAe,CAIf,oCAAqC,CACrC,aAAc,CACd,iBAKD,CAHC,gFACC,yBACD,CAGD,mPAIC,eACD,CAEA,+DACC,eACD,CAGC,gFACC,yBACD,CAWD,qHACC,sCACD,CDvDD,oCC2DC,wDACC,8DAMD,CAJC,0EACC,WAAY,CACZ,cACD,CAGD,gJAME,aAEF,CD1ED","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\";\n\n.ck.ck-link-actions {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: nowrap;\n\n\t& .ck-link-actions__preview {\n\t\tdisplay: inline-block;\n\n\t\t& .ck-button__label {\n\t\t\toverflow: hidden;\n\t\t}\n\t}\n\n\t@mixin ck-media-phone {\n\t\tflex-wrap: wrap;\n\n\t\t& .ck-link-actions__preview {\n\t\t\tflex-basis: 100%;\n\t\t}\n\n\t\t& .ck-button:not(.ck-link-actions__preview) {\n\t\t\tflex-basis: 50%;\n\t\t}\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"@ckeditor/ckeditor5-ui/theme/components/tooltip/mixins/_tooltip.css\";\n@import \"@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css\";\n@import \"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\";\n@import \"../mixins/_focus.css\";\n@import \"../mixins/_shadow.css\";\n@import \"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\";\n\n.ck.ck-link-actions {\n\t& .ck-button.ck-link-actions__preview {\n\t\tpadding-left: 0;\n\t\tpadding-right: 0;\n\n\t\t& .ck-button__label {\n\t\t\tpadding: 0 var(--ck-spacing-medium);\n\t\t\tcolor: var(--ck-color-link-default);\n\t\t\ttext-overflow: ellipsis;\n\t\t\tcursor: pointer;\n\n\t\t\t/* Match the box model of the link editor form's input so the balloon\n\t\t\tdoes not change width when moving between actions and the form. */\n\t\t\tmax-width: var(--ck-input-text-width);\n\t\t\tmin-width: 3em;\n\t\t\ttext-align: center;\n\n\t\t\t&:hover {\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\t\t}\n\n\t\t&,\n\t\t&:hover,\n\t\t&:focus,\n\t\t&:active {\n\t\t\tbackground: none;\n\t\t}\n\n\t\t&:active {\n\t\t\tbox-shadow: none;\n\t\t}\n\n\t\t&:focus {\n\t\t\t& .ck-button__label {\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\t\t}\n\t}\n\n\t@mixin ck-dir ltr {\n\t\t& .ck-button:not(:first-child) {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n\n\t@mixin ck-dir rtl {\n\t\t& .ck-button:not(:last-child) {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n\n\t@mixin ck-media-phone {\n\t\t& .ck-button.ck-link-actions__preview {\n\t\t\tmargin: var(--ck-spacing-standard) var(--ck-spacing-standard) 0;\n\n\t\t\t& .ck-button__label {\n\t\t\t\tmin-width: 0;\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\n\t\t& .ck-button:not(.ck-link-actions__preview) {\n\t\t\t@mixin ck-dir ltr {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\n\t\t\t@mixin ck-dir rtl {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n"],"sourceRoot":""}]);
  101971. // Exports
  101972. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101973. /***/ }),
  101974. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css":
  101975. /*!************************************************************************************************************************************************************!*\
  101976. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css ***!
  101977. \************************************************************************************************************************************************************/
  101978. /*! exports provided: default */
  101979. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101980. "use strict";
  101981. __webpack_require__.r(__webpack_exports__);
  101982. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  101983. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  101984. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  101985. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  101986. // Imports
  101987. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  101988. // Module
  101989. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkform.css"],"names":[],"mappings":"AAOA,iBACC,YAiBD,CAfC,2BACC,YACD,CCNA,oCDCD,iBAQE,cAUF,CARE,wCACC,eACD,CAEA,4BACC,cACD,CCfD,CDuBD,iCACC,aAYD,CALE,wHAEC,mCACD,CE/BF,iCACC,SAAU,CACV,oCA8CD,CA5CC,wDACC,8EAMD,CAJC,uEACC,WAAY,CACZ,UACD,CAGD,4CACC,kCAAmC,CACnC,QAAS,CACT,eAAgB,CAChB,QAAS,CACT,gDAAiD,CACjD,SAaD,CAnBA,4GAaE,aAMF,CAJE,mEACC,kDACD,CAKF,6CACC,yDAWD,CATC,wEACC,QAAS,CACT,SAAU,CACV,UAKD,CAHC,8EACC,eACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\";\n\n.ck.ck-link-form {\n\tdisplay: flex;\n\n\t& .ck-label {\n\t\tdisplay: none;\n\t}\n\n\t@mixin ck-media-phone {\n\t\tflex-wrap: wrap;\n\n\t\t& .ck-labeled-field-view {\n\t\t\tflex-basis: 100%;\n\t\t}\n\n\t\t& .ck-button {\n\t\t\tflex-basis: 50%;\n\t\t}\n\t}\n}\n\n/*\n * Style link form differently when manual decorators are available.\n * See: https://github.com/ckeditor/ckeditor5-link/issues/186.\n */\n.ck.ck-link-form_layout-vertical {\n\tdisplay: block;\n\n\t/*\n\t * Whether the form is in the responsive mode or not, if there are decorator buttons\n\t * keep the top margin of action buttons medium.\n\t */\n\t& .ck-button {\n\t\t&.ck-button-save,\n\t\t&.ck-button-cancel {\n\t\t\tmargin-top: var(--ck-spacing-medium);\n\t\t}\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\";\n\n/*\n * Style link form differently when manual decorators are available.\n * See: https://github.com/ckeditor/ckeditor5-link/issues/186.\n */\n.ck.ck-link-form_layout-vertical {\n\tpadding: 0;\n\tmin-width: var(--ck-input-text-width);\n\n\t& .ck-labeled-field-view {\n\t\tmargin: var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small);\n\n\t\t& .ck-input-text {\n\t\t\tmin-width: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t}\n\n\t& .ck-button {\n\t\tpadding: var(--ck-spacing-standard);\n\t\tmargin: 0;\n\t\tborder-radius: 0;\n\t\tborder: 0;\n\t\tborder-top: 1px solid var(--ck-color-base-border);\n\t\twidth: 50%;\n\n\t\t@mixin ck-dir ltr {\n\t\t\tmargin-left: 0;\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\tmargin-left: 0;\n\n\t\t\t&:last-of-type {\n\t\t\t\tborder-right: 1px solid var(--ck-color-base-border);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Using additional `.ck` class for stronger CSS specificity than `.ck.ck-link-form > :not(:first-child)`. */\n\t& .ck.ck-list {\n\t\tmargin: var(--ck-spacing-standard) var(--ck-spacing-large);\n\n\t\t& .ck-button.ck-switchbutton {\n\t\t\tborder: 0;\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\n\t\t\t&:hover {\n\t\t\t\tbackground: none;\n\t\t\t}\n\t\t}\n\t}\n}\n"],"sourceRoot":""}]);
  101990. // Exports
  101991. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  101992. /***/ }),
  101993. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css":
  101994. /*!*************************************************************************************************************************************************************!*\
  101995. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css ***!
  101996. \*************************************************************************************************************************************************************/
  101997. /*! exports provided: default */
  101998. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101999. "use strict";
  102000. __webpack_require__.r(__webpack_exports__);
  102001. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102002. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102003. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102004. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102005. // Imports
  102006. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102007. // Module
  102008. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{display:block;position:absolute}:root{--ck-link-image-indicator-icon-size:20;--ck-link-image-indicator-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{content:\"\";top:min(var(--ck-spacing-medium),6%);right:min(var(--ck-spacing-medium),6%);background-color:rgba(0,0,0,.4);background-image:url(\"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTExLjA3NyAxNWwuOTkxLTEuNDE2YS43NS43NSAwIDExMS4yMjkuODZsLTEuMTQ4IDEuNjRhLjc0OC43NDggMCAwMS0uMjE3LjIwNiA1LjI1MSA1LjI1MSAwIDAxLTguNTAzLTUuOTU1Ljc0MS43NDEgMCAwMS4xMi0uMjc0bDEuMTQ3LTEuNjM5YS43NS43NSAwIDExMS4yMjguODZMNC45MzMgMTAuN2wuMDA2LjAwM2EzLjc1IDMuNzUgMCAwMDYuMTMyIDQuMjk0bC4wMDYuMDA0em01LjQ5NC01LjMzNWEuNzQ4Ljc0OCAwIDAxLS4xMi4yNzRsLTEuMTQ3IDEuNjM5YS43NS43NSAwIDExLTEuMjI4LS44NmwuODYtMS4yM2EzLjc1IDMuNzUgMCAwMC02LjE0NC00LjMwMWwtLjg2IDEuMjI5YS43NS43NSAwIDAxLTEuMjI5LS44NmwxLjE0OC0xLjY0YS43NDguNzQ4IDAgMDEuMjE3LS4yMDYgNS4yNTEgNS4yNTEgMCAwMTguNTAzIDUuOTU1em0tNC41NjMtMi41MzJhLjc1Ljc1IDAgMDEuMTg0IDEuMDQ1bC0zLjE1NSA0LjUwNWEuNzUuNzUgMCAxMS0xLjIyOS0uODZsMy4xNTUtNC41MDZhLjc1Ljc1IDAgMDExLjA0NS0uMTg0eiIvPjwvc3ZnPg==\");background-size:14px;background-repeat:no-repeat;background-position:50%;border-radius:100%;overflow:hidden;width:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size));height:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size))}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkimage.css"],"names":[],"mappings":"AASE,+FACC,aAAc,CACd,iBACD,CCPF,MAEC,sCAAuC,CACvC,oEACD,CAME,+FACC,UAAW,CAMX,oCAAsC,CACtC,sCAAwC,CAExC,+BAAqC,CACrC,k2BAA+3B,CAC/3B,oBAAqB,CACrB,2BAA4B,CAC5B,uBAA2B,CAC3B,kBAAmB,CAMnB,eAAgB,CAChB,mGAAsG,CACtG,oGACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor__editable {\n\t/* Linked image indicator */\n\t& figure.image > a,\n\t& a span.image-inline {\n\t\t&::after {\n\t\t\tdisplay: block;\n\t\t\tposition: absolute;\n\t\t}\n\t}\n}\n\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t/* Match the icon size with the upload indicator brought by the image upload feature. */\n\t--ck-link-image-indicator-icon-size: 20;\n\t--ck-link-image-indicator-icon-is-visible: clamp(0px, 100% - 50px, 1px);\n}\n\n.ck.ck-editor__editable {\n\t/* Linked image indicator */\n\t& figure.image > a,\n\t& a span.image-inline {\n\t\t&::after {\n\t\t\tcontent: \"\";\n\n\t\t\t/*\n\t\t\t * Smaller images should have the icon closer to the border.\n\t\t\t * Match the icon position with the upload indicator brought by the image upload feature.\n\t\t\t */\n\t\t\ttop: min(var(--ck-spacing-medium), 6%);\n\t\t\tright: min(var(--ck-spacing-medium), 6%);\n\n\t\t\tbackground-color: hsla(0, 0%, 0%, .4);\n\t\t\tbackground-image: url(\"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2ZmZiIgZD0ibTExLjA3NyAxNSAuOTkxLTEuNDE2YS43NS43NSAwIDEgMSAxLjIyOS44NmwtMS4xNDggMS42NGEuNzQ4Ljc0OCAwIDAgMS0uMjE3LjIwNiA1LjI1MSA1LjI1MSAwIDAgMS04LjUwMy01Ljk1NS43NDEuNzQxIDAgMCAxIC4xMi0uMjc0bDEuMTQ3LTEuNjM5YS43NS43NSAwIDEgMSAxLjIyOC44Nkw0LjkzMyAxMC43bC4wMDYuMDAzYTMuNzUgMy43NSAwIDAgMCA2LjEzMiA0LjI5NGwuMDA2LjAwNHptNS40OTQtNS4zMzVhLjc0OC43NDggMCAwIDEtLjEyLjI3NGwtMS4xNDcgMS42MzlhLjc1Ljc1IDAgMSAxLTEuMjI4LS44NmwuODYtMS4yM2EzLjc1IDMuNzUgMCAwIDAtNi4xNDQtNC4zMDFsLS44NiAxLjIyOWEuNzUuNzUgMCAwIDEtMS4yMjktLjg2bDEuMTQ4LTEuNjRhLjc0OC43NDggMCAwIDEgLjIxNy0uMjA2IDUuMjUxIDUuMjUxIDAgMCAxIDguNTAzIDUuOTU1em0tNC41NjMtMi41MzJhLjc1Ljc1IDAgMCAxIC4xODQgMS4wNDVsLTMuMTU1IDQuNTA1YS43NS43NSAwIDEgMS0xLjIyOS0uODZsMy4xNTUtNC41MDZhLjc1Ljc1IDAgMCAxIDEuMDQ1LS4xODR6Ii8+PC9zdmc+\");\n\t\t\tbackground-size: 14px;\n\t\t\tbackground-repeat: no-repeat;\n\t\t\tbackground-position: center;\n\t\t\tborder-radius: 100%;\n\n\t\t\t/*\n\t\t\t* Use CSS math to simulate container queries.\n\t\t\t* https://css-tricks.com/the-raven-technique-one-step-closer-to-container-queries/#what-about-showing-and-hiding-things\n\t\t\t*/\n\t\t\toverflow: hidden;\n\t\t\twidth: calc(var(--ck-link-image-indicator-icon-is-visible) * var(--ck-link-image-indicator-icon-size));\n\t\t\theight: calc(var(--ck-link-image-indicator-icon-is-visible) * var(--ck-link-image-indicator-icon-size));\n\t\t}\n\t}\n}\n\n"],"sourceRoot":""}]);
  102009. // Exports
  102010. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102011. /***/ }),
  102012. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css":
  102013. /*!****************************************************************************************************************************************************************!*\
  102014. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css ***!
  102015. \****************************************************************************************************************************************************************/
  102016. /*! exports provided: default */
  102017. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102018. "use strict";
  102019. __webpack_require__.r(__webpack_exports__);
  102020. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102021. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102022. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102023. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102024. // Imports
  102025. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102026. // Module
  102027. ___CSS_LOADER_EXPORT___.push([module.i, ".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-color-base-border);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-color-focus-border);background:var(--ck-color-focus-outer-shadow)}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/inserttable.css"],"names":[],"mappings":"AAKA,oCACC,YAAa,CACb,kBAAmB,CACnB,cACD,CCJA,MACC,uCAAwC,CACxC,0CAA2C,CAC3C,yCAA0C,CAC1C,yCACD,CAEA,oCAEC,oJAA2J,CAC3J,yFACD,CAEA,qCACC,iBACD,CAEA,uCACC,+CAAgD,CAChD,iDAAkD,CAClD,iDAAkD,CAClD,4CAA6C,CAC7C,iBAMD,CAJC,6CACC,yCAA0C,CAC1C,6CACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-insert-table-dropdown__grid {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: wrap;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-insert-table-dropdown-padding: 10px;\n\t--ck-insert-table-dropdown-box-height: 11px;\n\t--ck-insert-table-dropdown-box-width: 12px;\n\t--ck-insert-table-dropdown-box-margin: 1px;\n}\n\n.ck .ck-insert-table-dropdown__grid {\n\t/* The width of a container should match 10 items in a row so there will be a 10x10 grid. */\n\twidth: calc(var(--ck-insert-table-dropdown-box-width) * 10 + var(--ck-insert-table-dropdown-box-margin) * 20 + var(--ck-insert-table-dropdown-padding) * 2);\n\tpadding: var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0;\n}\n\n.ck .ck-insert-table-dropdown__label {\n\ttext-align: center;\n}\n\n.ck .ck-insert-table-dropdown-grid-box {\n\twidth: var(--ck-insert-table-dropdown-box-width);\n\theight: var(--ck-insert-table-dropdown-box-height);\n\tmargin: var(--ck-insert-table-dropdown-box-margin);\n\tborder: 1px solid var(--ck-color-base-border);\n\tborder-radius: 1px;\n\n\t&.ck-on {\n\t\tborder-color: var(--ck-color-focus-border);\n\t\tbackground: var(--ck-color-focus-outer-shadow);\n\t}\n}\n\n"],"sourceRoot":""}]);
  102028. // Exports
  102029. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102030. /***/ }),
  102031. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-table/theme/table.css":
  102032. /*!**********************************************************************************************************************************************************!*\
  102033. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-table/theme/table.css ***!
  102034. \**********************************************************************************************************************************************************/
  102035. /*! exports provided: default */
  102036. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102037. "use strict";
  102038. __webpack_require__.r(__webpack_exports__);
  102039. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102040. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102041. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102042. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102043. // Imports
  102044. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102045. // Module
  102046. ___CSS_LOADER_EXPORT___.push([module.i, ".ck-content .table{margin:.9em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;width:100%;height:100%;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border:1px solid #bfbfbf}.ck-content .table table th{font-weight:700;background:hsla(0,0%,0%,5%)}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}.ck-editor__editable .ck-table-bogus-paragraph{display:inline-block;width:100%}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-table/theme/table.css"],"names":[],"mappings":"AAKA,mBAIC,gBAAkB,CAClB,aAgCD,CA9BC,yBAEC,wBAAyB,CACzB,gBAAiB,CAIjB,UAAW,CACX,WAAY,CAIZ,yBAiBD,CAfC,wDAEC,aAAc,CACd,YAAa,CAKb,wBACD,CAEA,4BACC,eAAiB,CACjB,2BACD,CAMF,+BACC,gBACD,CAEA,+BACC,eACD,CAEA,+CAKC,oBAAqB,CAMrB,UACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-content .table {\n\t/* Give the table widget some air and center it horizontally */\n\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\n\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\n\tmargin: 0.9em auto;\n\tdisplay: table;\n\n\t& table {\n\t\t/* The table cells should have slight borders */\n\t\tborder-collapse: collapse;\n\t\tborder-spacing: 0;\n\n\t\t/* Table width and height are set on the parent <figure>. Make sure the table inside stretches\n\t\tto the full dimensions of the container (https://github.com/ckeditor/ckeditor5/issues/6186). */\n\t\twidth: 100%;\n\t\theight: 100%;\n\n\t\t/* The outer border of the table should be slightly darker than the inner lines.\n\t\tAlso see https://github.com/ckeditor/ckeditor5-table/issues/50. */\n\t\tborder: 1px double hsl(0, 0%, 70%);\n\n\t\t& td,\n\t\t& th {\n\t\t\tmin-width: 2em;\n\t\t\tpadding: .4em;\n\n\t\t\t/* The border is inherited from .ck-editor__nested-editable styles, so theoretically it's not necessary here.\n\t\t\tHowever, the border is a content style, so it should use .ck-content (so it works outside the editor).\n\t\t\tHence, the duplication. See https://github.com/ckeditor/ckeditor5/issues/6314 */\n\t\t\tborder: 1px solid hsl(0, 0%, 75%);\n\t\t}\n\n\t\t& th {\n\t\t\tfont-weight: bold;\n\t\t\tbackground: hsla(0, 0%, 0%, 5%);\n\t\t}\n\t}\n}\n\n/* Text alignment of the table header should match the editor settings and override the native browser styling,\nwhen content is available outside the ediitor. See https://github.com/ckeditor/ckeditor5/issues/6638 */\n.ck-content[dir=\"rtl\"] .table th {\n\ttext-align: right;\n}\n\n.ck-content[dir=\"ltr\"] .table th {\n\ttext-align: left;\n}\n\n.ck-editor__editable .ck-table-bogus-paragraph {\n\t/*\n\t * Use display:inline-block to force Chrome/Safari to limit text mutations to this element.\n\t * See https://github.com/ckeditor/ckeditor5/issues/6062.\n\t */\n\tdisplay: inline-block;\n\n\t/*\n\t * Inline HTML elements nested in the span should always be dimensioned in relation to the whole cell width.\n\t * See https://github.com/ckeditor/ckeditor5/issues/9117.\n\t */\n\twidth: 100%;\n}\n"],"sourceRoot":""}]);
  102047. // Exports
  102048. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102049. /***/ }),
  102050. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css":
  102051. /*!*****************************************************************************************************************************************************************!*\
  102052. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css ***!
  102053. \*****************************************************************************************************************************************************************/
  102054. /*! exports provided: default */
  102055. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102056. "use strict";
  102057. __webpack_require__.r(__webpack_exports__);
  102058. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102059. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102060. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102061. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102062. // Imports
  102063. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102064. // Module
  102065. ___CSS_LOADER_EXPORT___.push([module.i, ":root{--ck-color-table-focused-cell-background:rgba(158,207,250,0.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tableediting.css"],"names":[],"mappings":"AAKA,MACC,8DACD,CAKE,8QAGC,wDAAyD,CAKzD,iBAAkB,CAClB,8CAA+C,CAC/C,mBACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-table-focused-cell-background: hsla(208, 90%, 80%, .3);\n}\n\n.ck-widget.table {\n\t& td,\n\t& th {\n\t\t&.ck-editor__nested-editable.ck-editor__nested-editable_focused,\n\t\t&.ck-editor__nested-editable:focus {\n\t\t\t/* A very slight background to highlight the focused cell */\n\t\t\tbackground: var(--ck-color-table-focused-cell-background);\n\n\t\t\t/* Fixes the problem where surrounding cells cover the focused cell's border.\n\t\t\tIt does not fix the problem in all places but the UX is improved.\n\t\t\tSee https://github.com/ckeditor/ckeditor5-table/issues/29. */\n\t\t\tborder-style: none;\n\t\t\toutline: 1px solid var(--ck-color-focus-border);\n\t\t\toutline-offset: -1px; /* progressive enhancement - no IE support */\n\t\t}\n\t}\n}\n"],"sourceRoot":""}]);
  102066. // Exports
  102067. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102068. /***/ }),
  102069. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css":
  102070. /*!*******************************************************************************************************************************************************************!*\
  102071. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css ***!
  102072. \*******************************************************************************************************************************************************************/
  102073. /*! exports provided: default */
  102074. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102075. "use strict";
  102076. __webpack_require__.r(__webpack_exports__);
  102077. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102078. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102079. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102080. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102081. // Imports
  102082. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102083. // Module
  102084. ___CSS_LOADER_EXPORT___.push([module.i, ":root{--ck-table-selected-cell-background:rgba(158,207,250,0.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{position:relative;caret-color:transparent;outline:unset;box-shadow:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{content:\"\";pointer-events:none;background-color:var(--ck-table-selected-cell-background);position:absolute;top:0;left:0;right:0;bottom:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget{outline:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle{display:none}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tableselection.css"],"names":[],"mappings":"AAKA,MACC,yDACD,CAGC,0IAEC,iBAAkB,CAClB,uBAAwB,CACxB,aAAc,CACd,gBA8BD,CA3BC,sJACC,UAAW,CACX,mBAAoB,CACpB,yDAA0D,CAC1D,iBAAkB,CAClB,KAAM,CACN,MAAO,CACP,OAAQ,CACR,QACD,CAEA,wTAEC,4BACD,CAMA,gKACC,aAKD,CAHC,0NACC,YACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-table-selected-cell-background: hsla(208, 90%, 80%, .3);\n}\n\n.ck.ck-editor__editable .table table {\n\t& td.ck-editor__editable_selected,\n\t& th.ck-editor__editable_selected {\n\t\tposition: relative;\n\t\tcaret-color: transparent;\n\t\toutline: unset;\n\t\tbox-shadow: unset;\n\n\t\t/* https://github.com/ckeditor/ckeditor5/issues/6446 */\n\t\t&:after {\n\t\t\tcontent: '';\n\t\t\tpointer-events: none;\n\t\t\tbackground-color: var(--ck-table-selected-cell-background);\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t}\n\n\t\t& ::selection,\n\t\t&:focus {\n\t\t\tbackground-color: transparent;\n\t\t}\n\n\t\t/*\n\t\t * To reduce the amount of noise, all widgets in the table selection have no outline and no selection handle.\n\t\t * See https://github.com/ckeditor/ckeditor5/issues/9491.\n\t\t */\n\t\t& .ck-widget {\n\t\t\toutline: unset;\n\n\t\t\t& > .ck-widget__selection-handle {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t}\n\t}\n}\n"],"sourceRoot":""}]);
  102085. // Exports
  102086. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102087. /***/ }),
  102088. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css":
  102089. /*!**************************************************************************************************************************************************************************!*\
  102090. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css ***!
  102091. \**************************************************************************************************************************************************************************/
  102092. /*! exports provided: default */
  102093. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102094. "use strict";
  102095. __webpack_require__.r(__webpack_exports__);
  102096. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102097. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102098. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102099. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102100. // Imports
  102101. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102102. // Module
  102103. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{visibility:visible;opacity:1}.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{white-space:nowrap;cursor:default;vertical-align:middle;padding:var(--ck-spacing-tiny);text-align:center;min-width:var(--ck-ui-component-min-height);min-height:var(--ck-ui-component-min-height);line-height:1;font-size:inherit;border:1px solid transparent;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;-webkit-appearance:none}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{font-size:inherit;font-weight:inherit;color:inherit;cursor:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-right:calc(var(--ck-spacing-small)*-1);margin-left:var(--ck-spacing-small)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/mixins/_tooltip.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/button/button.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/mixins/_button.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css"],"names":[],"mappings":"AAQA,6BCCC,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBD6BD,CE/BC,qDACC,aAqBD,CAHC,oBAnBD,qDAoBE,YAEF,CADC,CFvBF,6BAKC,iBAAkB,CAClB,mBAAoB,CACpB,kBAAmB,CACnB,oBAyBD,CAvBC,iEACC,YACD,CAGC,yGACC,oBACD,CAID,iFACC,sBACD,CEkBA,iEACC,kBAAmB,CACnB,SACD,CAbA,yFACC,YACD,CC7BD,6BCAC,oDD0ID,CCvIE,6EACC,0DACD,CAEA,+EACC,2DAA4C,CAC5C,uEACD,CAID,qDACC,6DACD,CDhBD,6BEDC,eF2ID,CA1IA,wIEGE,qCFuIF,CA1IA,6BAKC,kBAAmB,CACnB,cAAe,CACf,qBAAsB,CACtB,8BAA+B,CAC/B,iBAAkB,CAGlB,2CAA4C,CAC5C,4CAA6C,CAI7C,aAAc,CAGd,iBAAkB,CAGlB,4BAA6B,CAG7B,4DAA8D,CAG9D,uBA6GD,CA3GC,oFGjCA,YAAa,CACb,2BAA2B,CCF3B,2CJsCA,CAIC,kJAEC,aACD,CAGD,iEAEC,iBAAkB,CAClB,mBAAoB,CACpB,aAAc,CACd,cAAe,CAIf,qBASD,CAlBA,qFAYE,eAMF,CAlBA,qFAgBE,gBAEF,CAEA,yEACC,aAYD,CAbA,6FAIE,mCASF,CAbA,6FAQE,oCAKF,CAbA,yEAWC,eAAiB,CACjB,UACD,CAIC,oIIrFD,oDJyFC,CAEA,uFK3FD,kCL6FC,CAGA,yFKhGD,kCLkGC,CAEA,iGACC,UACD,CAGD,qEACC,yDAcD,CAXC,2HAEE,4CAA+C,CAC/C,oCAOF,CAVA,2HAOE,6CAAgD,CAChD,mCAEF,CAKA,mHACC,WACD,CAID,yCC/HA,+CDiIA,CC9HC,yFACC,qDACD,CAEA,2FACC,sDAA4C,CAC5C,kEACD,CAID,iEACC,wDACD,CDmHA,2DACC,iCACD,CAEA,+DACC,mCACD,CAID,2CC7IC,mDDkJD,CC/IE,2FACC,yDACD,CAEA,6FACC,0DAA4C,CAC5C,sEACD,CAID,mEACC,4DACD,CD6HD,2CAIC,wCACD,CAEA,uCAEC,eACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../../mixins/_unselectable.css\";\n@import \"../tooltip/mixins/_tooltip.css\";\n\n.ck.ck-button,\na.ck.ck-button {\n\t@mixin ck-unselectable;\n\t@mixin ck-tooltip_enabled;\n\n\tposition: relative;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: left;\n\n\t& .ck-button__label {\n\t\tdisplay: none;\n\t}\n\n\t&.ck-button_with-text {\n\t\t& .ck-button__label {\n\t\t\tdisplay: inline-block;\n\t\t}\n\t}\n\n\t/* Center the icon horizontally in a button without text. */\n\t&:not(.ck-button_with-text) {\n\t\tjustify-content: center;\n\t}\n\n\t&:hover {\n\t\t@mixin ck-tooltip_visible;\n\t}\n\n\t/* Get rid of the native focus outline around the tooltip when focused (but not :hover). */\n\t&:focus:not(:hover) {\n\t\t@mixin ck-tooltip_disabled;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Makes element unselectable.\n */\n@define-mixin ck-unselectable {\n\t-moz-user-select: none;\n\t-webkit-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Enables the tooltip, which is the tooltip is in DOM but\n * not yet displayed.\n */\n@define-mixin ck-tooltip_enabled {\n\t& .ck-tooltip {\n\t\tdisplay: block;\n\n\t\t/*\n\t\t * Don't display tooltips in devices which don't support :hover.\n\t\t * In fact, it's all about iOS, which forces user to click UI elements twice to execute\n\t\t * the primary action, when tooltips are enabled.\n\t\t *\n\t\t * Q: OK, but why not the following query?\n\t\t *\n\t\t * @media (hover) {\n\t\t * display: block;\n\t\t * }\n\t\t *\n\t\t * A: Because FF does not support it and it would completely disable tooltips\n\t\t * in that browser.\n\t\t *\n\t\t * More in https://github.com/ckeditor/ckeditor5/issues/920.\n\t\t */\n\t\t@media (hover:none) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n\n/**\n * Disables the tooltip making it disappear from DOM.\n */\n@define-mixin ck-tooltip_disabled {\n\t& .ck-tooltip {\n\t\tdisplay: none;\n\t}\n}\n\n/**\n * Shows the tooltip, which is already in DOM.\n * Requires `ck-tooltip_enabled` first.\n */\n@define-mixin ck-tooltip_visible {\n\t& .ck-tooltip {\n\t\tvisibility: visible;\n\t\topacity: 1;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../../../mixins/_focus.css\";\n@import \"../../../mixins/_shadow.css\";\n@import \"../../../mixins/_disabled.css\";\n@import \"../../../mixins/_rounded.css\";\n@import \"../../mixins/_button.css\";\n@import \"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\";\n\n.ck.ck-button,\na.ck.ck-button {\n\t@mixin ck-button-colors --ck-color-button-default;\n\t@mixin ck-rounded-corners;\n\n\twhite-space: nowrap;\n\tcursor: default;\n\tvertical-align: middle;\n\tpadding: var(--ck-spacing-tiny);\n\ttext-align: center;\n\n\t/* A very important piece of styling. Go to variable declaration to learn more. */\n\tmin-width: var(--ck-ui-component-min-height);\n\tmin-height: var(--ck-ui-component-min-height);\n\n\t/* Normalize the height of the line. Removing this will break consistent height\n\tamong text and text-less buttons (with icons). */\n\tline-height: 1;\n\n\t/* Enable font size inheritance, which allows fluid UI scaling. */\n\tfont-size: inherit;\n\n\t/* Avoid flickering when the foucs border shows up. */\n\tborder: 1px solid transparent;\n\n\t/* Apply some smooth transition to the box-shadow and border. */\n\ttransition: box-shadow .2s ease-in-out, border .2s ease-in-out;\n\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/189 */\n\t-webkit-appearance: none;\n\n\t&:active,\n\t&:focus {\n\t\t@mixin ck-focus-ring;\n\t\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\n\t}\n\n\t/* Allow icon coloring using the text \"color\" property. */\n\t& .ck-button__icon {\n\t\t& use,\n\t\t& use * {\n\t\t\tcolor: inherit;\n\t\t}\n\t}\n\n\t& .ck-button__label {\n\t\t/* Enable font size inheritance, which allows fluid UI scaling. */\n\t\tfont-size: inherit;\n\t\tfont-weight: inherit;\n\t\tcolor: inherit;\n\t\tcursor: inherit;\n\n\t\t/* Must be consistent with .ck-icon's vertical align. Otherwise, buttons with and\n\t\twithout labels (but with icons) have different sizes in Chrome */\n\t\tvertical-align: middle;\n\n\t\t@mixin ck-dir ltr {\n\t\t\ttext-align: left;\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\ttext-align: right;\n\t\t}\n\t}\n\n\t& .ck-button__keystroke {\n\t\tcolor: inherit;\n\n\t\t@mixin ck-dir ltr {\n\t\t\tmargin-left: var(--ck-spacing-large);\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\tmargin-right: var(--ck-spacing-large);\n\t\t}\n\n\t\tfont-weight: bold;\n\t\topacity: .7;\n\t}\n\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */\n\t&.ck-disabled {\n\t\t&:active,\n\t\t&:focus {\n\t\t\t/* The disabled button should have a slightly less visible shadow when focused. */\n\t\t\t@mixin ck-box-shadow var(--ck-focus-disabled-outer-shadow);\n\t\t}\n\n\t\t& .ck-button__icon {\n\t\t\t@mixin ck-disabled;\n\t\t}\n\n\t\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */\n\t\t& .ck-button__label {\n\t\t\t@mixin ck-disabled;\n\t\t}\n\n\t\t& .ck-button__keystroke {\n\t\t\topacity: .3;\n\t\t}\n\t}\n\n\t&.ck-button_with-text {\n\t\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-standard);\n\n\t\t/* stylelint-disable-next-line no-descending-specificity */\n\t\t& .ck-button__icon {\n\t\t\t@mixin ck-dir ltr {\n\t\t\t\tmargin-left: calc(-1 * var(--ck-spacing-small));\n\t\t\t\tmargin-right: var(--ck-spacing-small);\n\t\t\t}\n\n\t\t\t@mixin ck-dir rtl {\n\t\t\t\tmargin-right: calc(-1 * var(--ck-spacing-small));\n\t\t\t\tmargin-left: var(--ck-spacing-small);\n\t\t\t}\n\t\t}\n\t}\n\n\t&.ck-button_with-keystroke {\n\t\t/* stylelint-disable-next-line no-descending-specificity */\n\t\t& .ck-button__label {\n\t\t\tflex-grow: 1;\n\t\t}\n\t}\n\n\t/* A style of the button which is currently on, e.g. its feature is active. */\n\t&.ck-on {\n\t\t@mixin ck-button-colors --ck-color-button-on;\n\t}\n\n\t&.ck-button-save {\n\t\tcolor: var(--ck-color-button-save);\n\t}\n\n\t&.ck-button-cancel {\n\t\tcolor: var(--ck-color-button-cancel);\n\t}\n}\n\n/* A style of the button which handles the primary action. */\n.ck.ck-button-action,\na.ck.ck-button-action {\n\t@mixin ck-button-colors --ck-color-button-action;\n\n\tcolor: var(--ck-color-button-action-text);\n}\n\n.ck.ck-button-bold,\na.ck.ck-button-bold {\n\tfont-weight: bold;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements a button of given background color.\n *\n * @param {String} $background - Background color of the button.\n * @param {String} $border - Border color of the button.\n */\n@define-mixin ck-button-colors $prefix {\n\tbackground: var($(prefix)-background);\n\n\t&:not(.ck-disabled) {\n\t\t&:hover {\n\t\t\tbackground: var($(prefix)-hover-background);\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground: var($(prefix)-active-background);\n\t\t\tbox-shadow: inset 0 2px 2px var($(prefix)-active-shadow);\n\t\t}\n\t}\n\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */\n\t&.ck-disabled {\n\t\tbackground: var($(prefix)-disabled-background);\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A visual style of focused element's border.\n */\n@define-mixin ck-focus-ring {\n\t/* Disable native outline. */\n\toutline: none;\n\tborder: var(--ck-focus-ring)\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A class which indicates that an element holding it is disabled.\n */\n@define-mixin ck-disabled {\n\topacity: var(--ck-disabled-opacity);\n}\n"],"sourceRoot":""}]);
  102104. // Exports
  102105. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102106. /***/ }),
  102107. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css":
  102108. /*!********************************************************************************************************************************************************************************!*\
  102109. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css ***!
  102110. \********************************************************************************************************************************************************************************/
  102111. /*! exports provided: default */
  102112. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102113. "use strict";
  102114. __webpack_require__.r(__webpack_exports__);
  102115. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102116. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102117. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102118. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102119. // Imports
  102120. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102121. // Module
  102122. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - var(--ck-switch-button-toggle-spacing)*2)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{transition:background .4s ease;width:var(--ck-switch-button-toggle-width);background:var(--ck-color-switch-button-off-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(var(--ck-border-radius)*0.5)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{margin:var(--ck-switch-button-toggle-spacing);width:var(--ck-switch-button-toggle-inner-size);height:var(--ck-switch-button-toggle-inner-size);background:var(--ck-color-switch-button-inner-background);transition:all .3s ease}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var(--ck-switch-button-translation))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(var(--ck-switch-button-translation)*-1))}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/button/switchbutton.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css"],"names":[],"mappings":"AASE,4HACC,aACD,CCCF,MAEC,8CAA+C,CAE/C,mDAAoD,CACpD,qCAAsC,CACtC,gKAKD,CAGC,0DAGE,4CAOF,CAVA,0DAQE,2CAEF,CAEA,iDC3BA,eDoEA,CAzCA,yICvBC,qCDgED,CAzCA,2DAKE,gBAoCF,CAzCA,2DAUE,iBA+BF,CAzCA,iDAcC,8BAAiC,CAEjC,0CAA2C,CAC3C,uDAwBD,CAtBC,2EC9CD,eD2DC,CAbA,6LC1CA,qCAAsC,CD4CpC,+CAWF,CAbA,2EAMC,6CAA8C,CAC9C,+CAAgD,CAChD,gDAAiD,CACjD,yDAA0D,CAG1D,uBACD,CAEA,uDACC,6DAKD,CAHC,iFACC,+DACD,CAIF,6DExEA,kCF0EA,CAEA,uDACC,sDAkBD,CAhBC,6DACC,4DACD,CAEA,2FAKE,yDAMF,CAXA,2FASE,kEAEF","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-button.ck-switchbutton {\n\t& .ck-button__toggle {\n\t\tdisplay: block;\n\n\t\t& .ck-button__toggle__inner {\n\t\t\tdisplay: block;\n\t\t}\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../../../mixins/_rounded.css\";\n@import \"../../../mixins/_disabled.css\";\n@import \"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\";\n\n/* Note: To avoid rendering issues (aliasing) but to preserve the responsive nature\nof the component, floating–point numbers have been used which, for the default font size\n(see: --ck-font-size-base), will generate simple integers. */\n:root {\n\t/* 34px at 13px font-size */\n\t--ck-switch-button-toggle-width: 2.6153846154em;\n\t/* 14px at 13px font-size */\n\t--ck-switch-button-toggle-inner-size: 1.0769230769em;\n\t--ck-switch-button-toggle-spacing: 1px;\n\t--ck-switch-button-translation: calc(\n\t\tvar(--ck-switch-button-toggle-width) -\n\t\tvar(--ck-switch-button-toggle-inner-size) -\n\t\t2 * var(--ck-switch-button-toggle-spacing)\n\t);\n}\n\n.ck.ck-button.ck-switchbutton {\n\t& .ck-button__label {\n\t\t@mixin ck-dir ltr {\n\t\t\t/* Separate the label from the switch */\n\t\t\tmargin-right: calc(2 * var(--ck-spacing-large));\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\t/* Separate the label from the switch */\n\t\t\tmargin-left: calc(2 * var(--ck-spacing-large));\n\t\t}\n\t}\n\n\t& .ck-button__toggle {\n\t\t@mixin ck-rounded-corners;\n\n\t\t@mixin ck-dir ltr {\n\t\t\t/* Make sure the toggle is always to the right as far as possible. */\n\t\t\tmargin-left: auto;\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\t/* Make sure the toggle is always to the left as far as possible. */\n\t\t\tmargin-right: auto;\n\t\t}\n\n\t\t/* Gently animate the background color of the toggle switch */\n\t\ttransition: background 400ms ease;\n\n\t\twidth: var(--ck-switch-button-toggle-width);\n\t\tbackground: var(--ck-color-switch-button-off-background);\n\n\t\t& .ck-button__toggle__inner {\n\t\t\t@mixin ck-rounded-corners {\n\t\t\t\tborder-radius: calc(.5 * var(--ck-border-radius));\n\t\t\t}\n\n\t\t\t/* Leave some tiny bit of space around the inner part of the switch */\n\t\t\tmargin: var(--ck-switch-button-toggle-spacing);\n\t\t\twidth: var(--ck-switch-button-toggle-inner-size);\n\t\t\theight: var(--ck-switch-button-toggle-inner-size);\n\t\t\tbackground: var(--ck-color-switch-button-inner-background);\n\n\t\t\t/* Gently animate the inner part of the toggle switch */\n\t\t\ttransition: all 300ms ease;\n\t\t}\n\n\t\t&:hover {\n\t\t\tbackground: var(--ck-color-switch-button-off-hover-background);\n\n\t\t\t& .ck-button__toggle__inner {\n\t\t\t\tbox-shadow: 0 0 0 5px var(--ck-color-switch-button-inner-shadow);\n\t\t\t}\n\t\t}\n\t}\n\n\t&.ck-disabled .ck-button__toggle {\n\t\t@mixin ck-disabled;\n\t}\n\n\t&.ck-on .ck-button__toggle {\n\t\tbackground: var(--ck-color-switch-button-on-background);\n\n\t\t&:hover {\n\t\t\tbackground: var(--ck-color-switch-button-on-hover-background);\n\t\t}\n\n\t\t& .ck-button__toggle__inner {\n\t\t\t/*\n\t\t\t * Move the toggle switch to the right. It will be animated.\n\t\t\t */\n\t\t\t@mixin ck-dir ltr {\n\t\t\t\ttransform: translateX( var( --ck-switch-button-translation ) );\n\t\t\t}\n\n\t\t\t@mixin ck-dir rtl {\n\t\t\t\ttransform: translateX( calc( -1 * var( --ck-switch-button-translation ) ) );\n\t\t\t}\n\t\t}\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A class which indicates that an element holding it is disabled.\n */\n@define-mixin ck-disabled {\n\topacity: var(--ck-disabled-opacity);\n}\n"],"sourceRoot":""}]);
  102123. // Exports
  102124. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102125. /***/ }),
  102126. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css":
  102127. /*!********************************************************************************************************************************************************************************!*\
  102128. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css ***!
  102129. \********************************************************************************************************************************************************************************/
  102130. /*! exports provided: default */
  102131. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102132. "use strict";
  102133. __webpack_require__.r(__webpack_exports__);
  102134. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102135. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102136. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102137. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102138. // Imports
  102139. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102140. // Module
  102141. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#000}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{width:var(--ck-color-grid-tile-size);height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{display:none;color:var(--ck-color-color-grid-check-icon)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/colorgrid/colorgrid.css"],"names":[],"mappings":"AAKA,kBACC,YACD,CCAA,MACC,8BAA+B,CAK/B,qCACD,CAEA,kBACC,YAAa,CACb,WACD,CAEA,wBACC,oCAAqC,CACrC,qCAAsC,CACtC,wCAAyC,CACzC,yCAA0C,CAC1C,SAAU,CACV,8BAA+B,CAC/B,QAmCD,CAjCC,oCACC,YAAa,CACb,gBACD,CAEA,4DACC,gDACD,CAEA,oCACC,YAAa,CACb,2CACD,CAEA,8BACC,8FAKD,CAHC,0CACC,aACD,CAGD,8HAIC,QACD,CAEA,gGAEC,iGACD,CAGD,yBACC,oCACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-color-grid {\n\tdisplay: grid;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../../../mixins/_rounded.css\";\n\n:root {\n\t--ck-color-grid-tile-size: 24px;\n\n\t/* Not using global colors here because these may change but some colors in a pallette\n\t * require special treatment. For instance, this ensures no matter what the UI text color is,\n\t * the check icon will look good on the black color tile. */\n\t--ck-color-color-grid-check-icon: hsl(0, 0%, 0%);\n}\n\n.ck.ck-color-grid {\n\tgrid-gap: 5px;\n\tpadding: 8px;\n}\n\n.ck.ck-color-grid__tile {\n\twidth: var(--ck-color-grid-tile-size);\n\theight: var(--ck-color-grid-tile-size);\n\tmin-width: var(--ck-color-grid-tile-size);\n\tmin-height: var(--ck-color-grid-tile-size);\n\tpadding: 0;\n\ttransition: .2s ease box-shadow;\n\tborder: 0;\n\n\t&.ck-disabled {\n\t\tcursor: unset;\n\t\ttransition: unset;\n\t}\n\n\t&.ck-color-table__color-tile_bordered {\n\t\tbox-shadow: 0 0 0 1px var(--ck-color-base-border);\n\t}\n\n\t& .ck.ck-icon {\n\t\tdisplay: none;\n\t\tcolor: var(--ck-color-color-grid-check-icon);\n\t}\n\n\t&.ck-on {\n\t\tbox-shadow: inset 0 0 0 1px var(--ck-color-base-background), 0 0 0 2px var(--ck-color-base-text);\n\n\t\t& .ck.ck-icon {\n\t\t\tdisplay: block;\n\t\t}\n\t}\n\n\t&.ck-on,\n\t&:focus:not( .ck-disabled ),\n\t&:hover:not( .ck-disabled ) {\n\t\t/* Disable the default .ck-button's border ring. */\n\t\tborder: 0;\n\t}\n\n\t&:focus:not( .ck-disabled ),\n\t&:hover:not( .ck-disabled ) {\n\t\tbox-shadow: inset 0 0 0 1px var(--ck-color-base-background), 0 0 0 2px var(--ck-color-focus-border);\n\t}\n}\n\n.ck.ck-color-grid__label {\n\tpadding: 0 var(--ck-spacing-standard);\n}\n"],"sourceRoot":""}]);
  102142. // Exports
  102143. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102144. /***/ }),
  102145. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css":
  102146. /*!******************************************************************************************************************************************************************************!*\
  102147. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css ***!
  102148. \******************************************************************************************************************************************************************************/
  102149. /*! exports provided: default */
  102150. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102151. "use strict";
  102152. __webpack_require__.r(__webpack_exports__);
  102153. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102154. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102155. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102156. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102157. // Imports
  102158. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102159. // Module
  102160. ___CSS_LOADER_EXPORT___.push([module.i, ":root{--ck-dropdown-max-width:75vw}.ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);max-width:var(--ck-dropdown-max-width);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{top:100%;bottom:auto}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-modal) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-dropdown__panel{border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0;background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/mixins/_tooltip.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/dropdown.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],"names":[],"mappings":"AAOA,MACC,4BACD,CAEA,gBACC,oBAAqB,CACrB,iBAqFD,CAnFC,oCACC,mBAAoB,CACpB,2BACD,CAGA,+CACC,UAOD,CCUA,iEACC,YACD,CDVA,oCAGC,kCAAmC,CAEnC,YAAa,CACb,yBAA0B,CAC1B,sCAAuC,CAEvC,iBAyDD,CAvDC,+DACC,oBACD,CAEA,mSAKC,WACD,CAEA,mSASC,QAAS,CACT,WACD,CAEA,oHAEC,MACD,CAEA,oHAEC,OACD,CAEA,kHAGC,QAAS,CACT,0BACD,CAEA,sHAGC,QAAS,CACT,0BACD,CAEA,sHAGC,QAAS,CACT,0BACD,CAQF,mCACC,mCACD,CEhGA,MACC,sDACD,CAEA,gBAEC,iBA2ED,CAzEC,oCACC,mCACD,CAGC,8CACC,gCAAiC,CAGjC,sCACD,CAIA,8CACC,+BAAgC,CAGhC,oCACD,CAGD,gDC/BA,kCDiCA,CAIE,mFAEC,oCACD,CAIA,mFAEC,qCACD,CAID,iEACC,SAAU,CACV,eAAgB,CAChB,sBACD,CAGA,6EC1DD,kCD4DC,CAGA,qDACC,2BAA4B,CAC5B,4BACD,CAEA,sGACC,UACD,CAGA,yHAEC,eAKD,CAHC,qIE7EF,2CF+EE,CAKH,uBGlFC,eH8GD,CA5BA,qFG9EE,qCH0GF,CA5BA,uBEpFC,oCAA8B,CFwF9B,oDAAqD,CACrD,sDAAuD,CACvD,QAAS,CAGT,cAmBD,CAfC,6CACC,wBACD,CAEA,6CACC,yBACD,CAEA,6CACC,2BACD,CAEA,6CACC,4BACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../tooltip/mixins/_tooltip.css\";\n\n:root {\n\t--ck-dropdown-max-width: 75vw;\n}\n\n.ck.ck-dropdown {\n\tdisplay: inline-block;\n\tposition: relative;\n\n\t& .ck-dropdown__arrow {\n\t\tpointer-events: none;\n\t\tz-index: var(--ck-z-default);\n\t}\n\n\t/* Dropdown button should span horizontally, e.g. in vertical toolbars */\n\t& .ck-button.ck-dropdown__button {\n\t\twidth: 100%;\n\n\t\t/* Disable main button's tooltip when the dropdown is open. Otherwise the panel may\n\t\tpartially cover the tooltip */\n\t\t&.ck-on {\n\t\t\t@mixin ck-tooltip_disabled;\n\t\t}\n\t}\n\n\t& .ck-dropdown__panel {\n\t\t/* This is to get rid of flickering when the tooltip is shown under the panel,\n\t\twhich looks like the panel moves vertically a pixel down and up. */\n\t\t-webkit-backface-visibility: hidden;\n\n\t\tdisplay: none;\n\t\tz-index: var(--ck-z-modal);\n\t\tmax-width: var(--ck-dropdown-max-width);\n\n\t\tposition: absolute;\n\n\t\t&.ck-dropdown__panel-visible {\n\t\t\tdisplay: inline-block;\n\t\t}\n\n\t\t&.ck-dropdown__panel_ne,\n\t\t&.ck-dropdown__panel_nw,\n\t\t&.ck-dropdown__panel_n,\n\t\t&.ck-dropdown__panel_nmw,\n\t\t&.ck-dropdown__panel_nme {\n\t\t\tbottom: 100%;\n\t\t}\n\n\t\t&.ck-dropdown__panel_se,\n\t\t&.ck-dropdown__panel_sw,\n\t\t&.ck-dropdown__panel_smw,\n\t\t&.ck-dropdown__panel_sme,\n\t\t&.ck-dropdown__panel_s {\n\t\t\t/*\n\t\t\t * Using transform: translate3d( 0, 100%, 0 ) causes blurry dropdown on Chrome 67-78+ on non-retina displays.\n\t\t\t * See https://github.com/ckeditor/ckeditor5/issues/1053.\n\t\t\t */\n\t\t\ttop: 100%;\n\t\t\tbottom: auto;\n\t\t}\n\n\t\t&.ck-dropdown__panel_ne,\n\t\t&.ck-dropdown__panel_se {\n\t\t\tleft: 0px;\n\t\t}\n\n\t\t&.ck-dropdown__panel_nw,\n\t\t&.ck-dropdown__panel_sw {\n\t\t\tright: 0px;\n\t\t}\n\n\t\t&.ck-dropdown__panel_s,\n\t\t&.ck-dropdown__panel_n {\n\t\t\t/* Positioning panels relative to the center of the button */\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\n\t\t&.ck-dropdown__panel_nmw,\n\t\t&.ck-dropdown__panel_smw {\n\t\t\t/* Positioning panels relative to the middle-west of the button */\n\t\t\tleft: 75%;\n\t\t\ttransform: translateX(-75%);\n\t\t}\n\n\t\t&.ck-dropdown__panel_nme,\n\t\t&.ck-dropdown__panel_sme {\n\t\t\t/* Positioning panels relative to the middle-east of the button */\n\t\t\tleft: 25%;\n\t\t\ttransform: translateX(-25%);\n\t\t}\n\t}\n}\n\n/*\n * Toolbar dropdown panels should be always above the UI (eg. other dropdown panels) from the editor's content.\n * See https://github.com/ckeditor/ckeditor5/issues/7874\n */\n.ck.ck-toolbar .ck-dropdown__panel {\n\tz-index: calc( var(--ck-z-modal) + 1 );\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Enables the tooltip, which is the tooltip is in DOM but\n * not yet displayed.\n */\n@define-mixin ck-tooltip_enabled {\n\t& .ck-tooltip {\n\t\tdisplay: block;\n\n\t\t/*\n\t\t * Don't display tooltips in devices which don't support :hover.\n\t\t * In fact, it's all about iOS, which forces user to click UI elements twice to execute\n\t\t * the primary action, when tooltips are enabled.\n\t\t *\n\t\t * Q: OK, but why not the following query?\n\t\t *\n\t\t * @media (hover) {\n\t\t * display: block;\n\t\t * }\n\t\t *\n\t\t * A: Because FF does not support it and it would completely disable tooltips\n\t\t * in that browser.\n\t\t *\n\t\t * More in https://github.com/ckeditor/ckeditor5/issues/920.\n\t\t */\n\t\t@media (hover:none) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n\n/**\n * Disables the tooltip making it disappear from DOM.\n */\n@define-mixin ck-tooltip_disabled {\n\t& .ck-tooltip {\n\t\tdisplay: none;\n\t}\n}\n\n/**\n * Shows the tooltip, which is already in DOM.\n * Requires `ck-tooltip_enabled` first.\n */\n@define-mixin ck-tooltip_visible {\n\t& .ck-tooltip {\n\t\tvisibility: visible;\n\t\topacity: 1;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../../../mixins/_rounded.css\";\n@import \"../../../mixins/_disabled.css\";\n@import \"../../../mixins/_shadow.css\";\n@import \"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\";\n\n:root {\n\t--ck-dropdown-arrow-size: calc(0.5 * var(--ck-icon-size));\n}\n\n.ck.ck-dropdown {\n\t/* Enable font size inheritance, which allows fluid UI scaling. */\n\tfont-size: inherit;\n\n\t& .ck-dropdown__arrow {\n\t\twidth: var(--ck-dropdown-arrow-size);\n\t}\n\n\t@mixin ck-dir ltr {\n\t\t& .ck-dropdown__arrow {\n\t\t\tright: var(--ck-spacing-standard);\n\n\t\t\t/* A space to accommodate the triangle. */\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n\n\t@mixin ck-dir rtl {\n\t\t& .ck-dropdown__arrow {\n\t\t\tleft: var(--ck-spacing-standard);\n\n\t\t\t/* A space to accommodate the triangle. */\n\t\t\tmargin-right: var(--ck-spacing-small);\n\t\t}\n\t}\n\n\t&.ck-disabled .ck-dropdown__arrow {\n\t\t@mixin ck-disabled;\n\t}\n\n\t& .ck-button.ck-dropdown__button {\n\t\t@mixin ck-dir ltr {\n\t\t\t&:not(.ck-button_with-text) {\n\t\t\t\t/* Make sure dropdowns with just an icon have the right inner spacing */\n\t\t\t\tpadding-left: var(--ck-spacing-small);\n\t\t\t}\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\t&:not(.ck-button_with-text) {\n\t\t\t\t/* Make sure dropdowns with just an icon have the right inner spacing */\n\t\t\t\tpadding-right: var(--ck-spacing-small);\n\t\t\t}\n\t\t}\n\n\t\t/* #23 */\n\t\t& .ck-button__label {\n\t\t\twidth: 7em;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */\n\t\t&.ck-disabled .ck-button__label {\n\t\t\t@mixin ck-disabled;\n\t\t}\n\n\t\t/* https://github.com/ckeditor/ckeditor5/issues/816 */\n\t\t&.ck-on {\n\t\t\tborder-bottom-left-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\n\t\t&.ck-dropdown__button_label-width_auto .ck-button__label {\n\t\t\twidth: auto;\n\t\t}\n\n\t\t/* https://github.com/ckeditor/ckeditor5/issues/8699 */\n\t\t&.ck-off:active,\n\t\t&.ck-on:active {\n\t\t\tbox-shadow: none;\n\t\t\t\n\t\t\t&:focus {\n\t\t\t\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\n\t\t\t}\n\t\t}\n\t}\n}\n\n.ck.ck-dropdown__panel {\n\t@mixin ck-rounded-corners;\n\t@mixin ck-drop-shadow;\n\n\tbackground: var(--ck-color-dropdown-panel-background);\n\tborder: 1px solid var(--ck-color-dropdown-panel-border);\n\tbottom: 0;\n\n\t/* Make sure the panel is at least as wide as the drop-down's button. */\n\tmin-width: 100%;\n\n\t/* Disabled corner border radius to be consistent with the .dropdown__button\n\thttps://github.com/ckeditor/ckeditor5/issues/816 */\n\t&.ck-dropdown__panel_se {\n\t\tborder-top-left-radius: 0;\n\t}\n\n\t&.ck-dropdown__panel_sw {\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t&.ck-dropdown__panel_ne {\n\t\tborder-bottom-left-radius: 0;\n\t}\n\n\t&.ck-dropdown__panel_nw {\n\t\tborder-bottom-right-radius: 0;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A class which indicates that an element holding it is disabled.\n */\n@define-mixin ck-disabled {\n\topacity: var(--ck-disabled-opacity);\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],"sourceRoot":""}]);
  102161. // Exports
  102162. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102163. /***/ }),
  102164. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css":
  102165. /*!**********************************************************************************************************************************************************************************!*\
  102166. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css ***!
  102167. \**********************************************************************************************************************************************************************************/
  102168. /*! exports provided: default */
  102169. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102170. "use strict";
  102171. __webpack_require__.r(__webpack_exports__);
  102172. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102173. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102174. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102175. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102176. // Imports
  102177. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102178. // Module
  102179. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/listdropdown.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],"names":[],"mappings":"AAOA,6CCIC,eDqBD,CAzBA,iICQE,qCAAsC,CDJtC,wBAqBF,CAfE,mFCND,eDYC,CANA,6MCFA,qCAAsC,CDIpC,wBAAyB,CACzB,2BAA4B,CAC5B,4BAEF,CAEA,kFCdD,eDmBC,CALA,2MCVA,qCAAsC,CDYpC,wBAAyB,CACzB,yBAEF","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../../../mixins/_rounded.css\";\n\n.ck.ck-dropdown .ck-dropdown__panel .ck-list {\n\t/* Disabled radius of top-left border to be consistent with .dropdown__button\n\thttps://github.com/ckeditor/ckeditor5/issues/816 */\n\t@mixin ck-rounded-corners {\n\t\tborder-top-left-radius: 0;\n\t}\n\n\t/* Make sure the button belonging to the first/last child of the list goes well with the\n\tborder radius of the entire panel. */\n\t& .ck-list__item {\n\t\t&:first-child .ck-button {\n\t\t\t@mixin ck-rounded-corners {\n\t\t\t\tborder-top-left-radius: 0;\n\t\t\t\tborder-bottom-left-radius: 0;\n\t\t\t\tborder-bottom-right-radius: 0;\n\t\t\t}\n\t\t}\n\n\t\t&:last-child .ck-button {\n\t\t\t@mixin ck-rounded-corners {\n\t\t\t\tborder-top-left-radius: 0;\n\t\t\t\tborder-top-right-radius: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],"sourceRoot":""}]);
  102180. // Exports
  102181. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102182. /***/ }),
  102183. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css":
  102184. /*!*********************************************************************************************************************************************************************************!*\
  102185. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css ***!
  102186. \*********************************************************************************************************************************************************************************/
  102187. /*! exports provided: default */
  102188. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102189. "use strict";
  102190. __webpack_require__.r(__webpack_exports__);
  102191. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102192. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102193. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102194. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102195. // Imports
  102196. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102197. // Module
  102198. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button .ck-tooltip{display:none}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-top-right-radius:unset;border-bottom-right-radius:unset}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-top-left-radius:unset;border-bottom-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-top-left-radius:unset;border-bottom-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-top-right-radius:unset;border-bottom-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{content:\"\";position:absolute;width:1px;height:100%;background-color:var(--ck-color-split-button-hover-border)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{left:-1px}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{right:-1px}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/mixins/_tooltip.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/splitbutton.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],"names":[],"mappings":"AAOA,mBAEC,iBAUD,CARC,iDACC,qCACD,CC0BA,8DACC,YACD,CClCD,MACC,gDAAyD,CACzD,4CACD,CAMC,oIAIE,6BAA8B,CAC9B,gCAQF,CAbA,oIAUE,4BAA6B,CAC7B,+BAEF,CAEA,0CAGC,eAiBD,CApBA,oDAOE,4BAA6B,CAC7B,+BAYF,CApBA,oDAaE,6BAA8B,CAC9B,gCAMF,CAHC,8CACC,mCACD,CASA,0KACC,wDACD,CAIA,8JACC,UAAW,CACX,iBAAkB,CAClB,SAAU,CACV,WAAY,CACZ,0DACD,CAGC,kLACC,SACD,CAIA,kLACC,UACD,CAMF,uCC7EA,eDuFA,CAVA,qHCzEC,qCDmFD,CARE,qKACC,2BACD,CAEA,mKACC,4BACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../tooltip/mixins/_tooltip.css\";\n\n.ck.ck-splitbutton {\n\t/* Enable font size inheritance, which allows fluid UI scaling. */\n\tfont-size: inherit;\n\n\t& .ck-splitbutton__action:focus {\n\t\tz-index: calc(var(--ck-z-default) + 1);\n\t}\n\n\t/* Disable tooltips for the buttons when the button is \"open\" */\n\t&.ck-splitbutton_open > .ck-button {\n\t\t@mixin ck-tooltip_disabled;\n\t}\n}\n\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Enables the tooltip, which is the tooltip is in DOM but\n * not yet displayed.\n */\n@define-mixin ck-tooltip_enabled {\n\t& .ck-tooltip {\n\t\tdisplay: block;\n\n\t\t/*\n\t\t * Don't display tooltips in devices which don't support :hover.\n\t\t * In fact, it's all about iOS, which forces user to click UI elements twice to execute\n\t\t * the primary action, when tooltips are enabled.\n\t\t *\n\t\t * Q: OK, but why not the following query?\n\t\t *\n\t\t * @media (hover) {\n\t\t * display: block;\n\t\t * }\n\t\t *\n\t\t * A: Because FF does not support it and it would completely disable tooltips\n\t\t * in that browser.\n\t\t *\n\t\t * More in https://github.com/ckeditor/ckeditor5/issues/920.\n\t\t */\n\t\t@media (hover:none) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n\n/**\n * Disables the tooltip making it disappear from DOM.\n */\n@define-mixin ck-tooltip_disabled {\n\t& .ck-tooltip {\n\t\tdisplay: none;\n\t}\n}\n\n/**\n * Shows the tooltip, which is already in DOM.\n * Requires `ck-tooltip_enabled` first.\n */\n@define-mixin ck-tooltip_visible {\n\t& .ck-tooltip {\n\t\tvisibility: visible;\n\t\topacity: 1;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../../../mixins/_rounded.css\";\n\n:root {\n\t--ck-color-split-button-hover-background: hsl(0, 0%, 92%);\n\t--ck-color-split-button-hover-border: hsl(0, 0%, 70%);\n}\n\n.ck.ck-splitbutton {\n\t/*\n\t * Note: ck-rounded and ck-dir mixins don't go together (because they both use @nest).\n\t */\n\t&:hover > .ck-splitbutton__action,\n\t&.ck-splitbutton_open > .ck-splitbutton__action {\n\t\t@nest [dir=\"ltr\"] & {\n\t\t\t/* Don't round the action button on the right side */\n\t\t\tborder-top-right-radius: unset;\n\t\t\tborder-bottom-right-radius: unset;\n\t\t}\n\n\t\t@nest [dir=\"rtl\"] & {\n\t\t\t/* Don't round the action button on the left side */\n\t\t\tborder-top-left-radius: unset;\n\t\t\tborder-bottom-left-radius: unset;\n\t\t}\n\t}\n\n\t& > .ck-splitbutton__arrow {\n\t\t/* It's a text-less button and since the icon is positioned absolutely in such situation,\n\t\tit must get some arbitrary min-width. */\n\t\tmin-width: unset;\n\n\t\t@nest [dir=\"ltr\"] & {\n\t\t\t/* Don't round the arrow button on the left side */\n\t\t\tborder-top-left-radius: unset;\n\t\t\tborder-bottom-left-radius: unset;\n\t\t}\n\n\t\t@nest [dir=\"rtl\"] & {\n\t\t\t/* Don't round the arrow button on the right side */\n\t\t\tborder-top-right-radius: unset;\n\t\t\tborder-bottom-right-radius: unset;\n\t\t}\n\n\t\t& svg {\n\t\t\twidth: var(--ck-dropdown-arrow-size);\n\t\t}\n\t}\n\n\t/* When the split button is \"open\" (the arrow is on) or being hovered, it should get some styling\n\tas a whole. The background of both buttons should stand out and there should be a visual\n\tseparation between both buttons. */\n\t&.ck-splitbutton_open,\n\t&:hover {\n\t\t/* When the split button hovered as a whole, not as individual buttons. */\n\t\t& > .ck-button:not(.ck-on):not(.ck-disabled):not(:hover) {\n\t\t\tbackground: var(--ck-color-split-button-hover-background);\n\t\t}\n\n\t\t/* Splitbutton separator needs to be set with the ::after pseudoselector\n\t\tto display properly the borders on focus */\n\t\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\twidth: 1px;\n\t\t\theight: 100%;\n\t\t\tbackground-color: var(--ck-color-split-button-hover-border);\n\t\t}\n\n\t\t@nest [dir=\"ltr\"] & {\n\t\t\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\n\t\t\t\tleft: -1px;\n\t\t\t}\n\t\t}\n\n\t\t@nest [dir=\"rtl\"] & {\n\t\t\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\n\t\t\t\tright: -1px;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Don't round the bottom left and right corners of the buttons when \"open\"\n\thttps://github.com/ckeditor/ckeditor5/issues/816 */\n\t&.ck-splitbutton_open {\n\t\t@mixin ck-rounded-corners {\n\t\t\t& > .ck-splitbutton__action {\n\t\t\t\tborder-bottom-left-radius: 0;\n\t\t\t}\n\n\t\t\t& > .ck-splitbutton__arrow {\n\t\t\t\tborder-bottom-right-radius: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],"sourceRoot":""}]);
  102199. // Exports
  102200. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102201. /***/ }),
  102202. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css":
  102203. /*!*************************************************************************************************************************************************************************************!*\
  102204. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css ***!
  102205. \*************************************************************************************************************************************************************************************/
  102206. /*! exports provided: default */
  102207. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102208. "use strict";
  102209. __webpack_require__.r(__webpack_exports__);
  102210. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102211. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102212. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102213. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102214. // Imports
  102215. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102216. // Module
  102217. ___CSS_LOADER_EXPORT___.push([module.i, ":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{width:max-content;max-width:var(--ck-toolbar-dropdown-max-width)}.ck.ck-toolbar-dropdown>.ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/toolbardropdown.css"],"names":[],"mappings":"AAKA,MACC,oCACD,CAEA,4CAEC,iBAAkB,CAClB,8CAOD,CAJE,6DACC,qCACD,CCZF,oCACC,QACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-toolbar-dropdown-max-width: 60vw;\n}\n\n.ck.ck-toolbar-dropdown > .ck-dropdown__panel {\n\t/* https://github.com/ckeditor/ckeditor5/issues/5586 */\n\twidth: max-content;\n\tmax-width: var(--ck-toolbar-dropdown-max-width);\n\n\t& .ck-button {\n\t\t&:focus {\n\t\t\tz-index: calc(var(--ck-z-default) + 1);\n\t\t}\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-toolbar-dropdown .ck-toolbar {\n\tborder: 0;\n}\n"],"sourceRoot":""}]);
  102218. // Exports
  102219. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102220. /***/ }),
  102221. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css":
  102222. /*!******************************************************************************************************************************************************************************!*\
  102223. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css ***!
  102224. \******************************************************************************************************************************************************************************/
  102225. /*! exports provided: default */
  102226. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102227. "use strict";
  102228. __webpack_require__.r(__webpack_exports__);
  102229. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102230. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102231. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102232. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102233. // Imports
  102234. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102235. // Module
  102236. ___CSS_LOADER_EXPORT___.push([module.i, ":root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-focused{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0}.ck.ck-editor__editable_inline{overflow:auto;padding:0 var(--ck-spacing-standard);border:1px solid transparent}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/editorui/editorui.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],"names":[],"mappings":"AAWA,MACC,0CACD,CAEA,yDCJC,eDWD,CAPA,yJCAE,qCDOF,CAJC,oEERA,YAAa,CACb,2BAA2B,CCF3B,qCHYA,CAGD,+BACC,aAAc,CACd,oCAAqC,CACrC,4BA4BD,CA1BC,wCACC,eACD,CAEA,wCACC,gBACD,CAGA,4CACC,kCACD,CAGA,2CAKC,qCACD,CAGA,sDACC,kDACD,CAKA,gEACC,mDACD,CAIA,gEACC,gDACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../../../mixins/_rounded.css\";\n@import \"../../../mixins/_disabled.css\";\n@import \"../../../mixins/_shadow.css\";\n@import \"../../../mixins/_focus.css\";\n@import \"../../mixins/_button.css\";\n\n:root {\n\t--ck-color-editable-blur-selection: hsl(0, 0%, 85%);\n}\n\n.ck.ck-editor__editable:not(.ck-editor__nested-editable) {\n\t@mixin ck-rounded-corners;\n\n\t&.ck-focused {\n\t\t@mixin ck-focus-ring;\n\t\t@mixin ck-box-shadow var(--ck-inner-shadow);\n\t}\n}\n\n.ck.ck-editor__editable_inline {\n\toverflow: auto;\n\tpadding: 0 var(--ck-spacing-standard);\n\tborder: 1px solid transparent;\n\n\t&[dir=\"ltr\"] {\n\t\ttext-align: left;\n\t}\n\n\t&[dir=\"rtl\"] {\n\t\ttext-align: right;\n\t}\n\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/116 */\n\t& > *:first-child {\n\t\tmargin-top: var(--ck-spacing-large);\n\t}\n\n\t/* https://github.com/ckeditor/ckeditor5/issues/847 */\n\t& > *:last-child {\n\t\t/*\n\t\t * This value should match with the default margins of the block elements (like .media or .image)\n\t\t * to avoid a content jumping when the fake selection container shows up (See https://github.com/ckeditor/ckeditor5/issues/9825).\n\t\t */\n\t\tmargin-bottom: var(--ck-spacing-large);\n\t}\n\n\t/* https://github.com/ckeditor/ckeditor5/issues/6517 */\n\t&.ck-blurred ::selection {\n\t\tbackground: var(--ck-color-editable-blur-selection);\n\t}\n}\n\n/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/111 */\n.ck.ck-balloon-panel.ck-toolbar-container[class*=\"arrow_n\"] {\n\t&::after {\n\t\tborder-bottom-color: var(--ck-color-base-foreground);\n\t}\n}\n\n.ck.ck-balloon-panel.ck-toolbar-container[class*=\"arrow_s\"] {\n\t&::after {\n\t\tborder-top-color: var(--ck-color-base-foreground);\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A visual style of focused element's border.\n */\n@define-mixin ck-focus-ring {\n\t/* Disable native outline. */\n\toutline: none;\n\tborder: var(--ck-focus-ring)\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],"sourceRoot":""}]);
  102237. // Exports
  102238. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102239. /***/ }),
  102240. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css":
  102241. /*!**********************************************************************************************************************************************************************************!*\
  102242. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css ***!
  102243. \**********************************************************************************************************************************************************************************/
  102244. /*! exports provided: default */
  102245. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102246. "use strict";
  102247. __webpack_require__.r(__webpack_exports__);
  102248. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102249. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102250. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102251. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102252. // Imports
  102253. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102254. // Module
  102255. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-form__header{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{padding:var(--ck-spacing-small) var(--ck-spacing-large);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-form__header .ck-form__header__label{font-weight:700}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/formheader/formheader.css"],"names":[],"mappings":"AAKA,oBACC,YAAa,CACb,kBAAmB,CACnB,gBAAiB,CACjB,kBAAmB,CACnB,6BACD,CCNA,MACC,4BACD,CAEA,oBACC,uDAAwD,CACxD,mCAAoC,CACpC,wCAAyC,CACzC,mDAKD,CAHC,4CACC,eACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-form__header {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: nowrap;\n\talign-items: center;\n\tjustify-content: space-between;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-form-header-height: 38px;\n}\n\n.ck.ck-form__header {\n\tpadding: var(--ck-spacing-small) var(--ck-spacing-large);\n\theight: var(--ck-form-header-height);\n\tline-height: var(--ck-form-header-height);\n\tborder-bottom: 1px solid var(--ck-color-base-border);\n\n\t& .ck-form__header__label {\n\t\tfont-weight: bold;\n\t}\n}\n"],"sourceRoot":""}]);
  102256. // Exports
  102257. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102258. /***/ }),
  102259. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css":
  102260. /*!**********************************************************************************************************************************************************************!*\
  102261. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css ***!
  102262. \**********************************************************************************************************************************************************************/
  102263. /*! exports provided: default */
  102264. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102265. "use strict";
  102266. __webpack_require__.r(__webpack_exports__);
  102267. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102268. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102269. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102270. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102271. // Imports
  102272. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102273. // Module
  102274. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/icon/icon.css"],"names":[],"mappings":"AAKA,YACC,qBACD,CCFA,MACC,0EACD,CAEA,YACC,yBAA0B,CAC1B,0BAA2B,CAG3B,uBAAwB,CAQxB,qBAcD,CAZC,0BARA,aAAc,CAGd,cAgBA,CAJC,yBAEC,iBACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-icon {\n\tvertical-align: middle;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-icon-size: calc(var(--ck-line-height-base) * var(--ck-font-size-normal));\n}\n\n.ck.ck-icon {\n\twidth: var(--ck-icon-size);\n\theight: var(--ck-icon-size);\n\n\t/* Multiplied by the height of the line in \"px\" should give SVG \"viewport\" dimensions */\n\tfont-size: .8333350694em;\n\n\tcolor: inherit;\n\n\t/* Inherit cursor style (#5). */\n\tcursor: inherit;\n\n\t/* This will prevent blurry icons on Firefox. See #340. */\n\twill-change: transform;\n\n\t& * {\n\t\t/* Inherit cursor style (#5). */\n\t\tcursor: inherit;\n\n\t\t/* Allows dynamic coloring of the icons. */\n\t\tcolor: inherit;\n\n\t\t&:not([fill]) {\n\t\t\t/* Needed by FF. */\n\t\t\tfill: currentColor;\n\t\t}\n\t}\n}\n"],"sourceRoot":""}]);
  102275. // Exports
  102276. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102277. /***/ }),
  102278. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css":
  102279. /*!********************************************************************************************************************************************************************************!*\
  102280. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css ***!
  102281. \********************************************************************************************************************************************************************************/
  102282. /*! exports provided: default */
  102283. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102284. "use strict";
  102285. __webpack_require__.r(__webpack_exports__);
  102286. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102287. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102288. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102289. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102290. // Imports
  102291. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102292. // Module
  102293. ___CSS_LOADER_EXPORT___.push([module.i, ":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/inputtext/inputtext.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],"names":[],"mappings":"AASA,MACC,0BACD,CAEA,kBCFC,eDwCD,CAtCA,2ECEE,qCDoCF,CAtCA,kBAGC,2CAA4C,CAC5C,6CAA8C,CAC9C,6DAA8D,CAC9D,oCAAqC,CAGrC,4CAA6C,CAG7C,4DA0BD,CAxBC,wBEjBA,YAAa,CACb,2BAA2B,CCF3B,2CHqBA,CAEA,4BACC,sDAAuD,CACvD,oDAAqD,CACrD,yCAMD,CAJC,kCG5BD,oDH+BC,CAGD,2BACC,+CAAgD,CAChD,2CAKD,CAHC,iCGtCD,iDHwCC,CAIF,+BACC,IACC,0BACD,CAEA,IACC,yBACD,CAEA,IACC,0BACD,CAEA,IACC,yBACD,CACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../../../mixins/_rounded.css\";\n@import \"../../../mixins/_focus.css\";\n@import \"../../../mixins/_shadow.css\";\n\n:root {\n\t--ck-input-text-width: 18em;\n}\n\n.ck.ck-input-text {\n\t@mixin ck-rounded-corners;\n\n\tbackground: var(--ck-color-input-background);\n\tborder: 1px solid var(--ck-color-input-border);\n\tpadding: var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);\n\tmin-width: var(--ck-input-text-width);\n\n\t/* This is important to stay of the same height as surrounding buttons */\n\tmin-height: var(--ck-ui-component-min-height);\n\n\t/* Apply some smooth transition to the box-shadow and border. */\n\ttransition: box-shadow .1s ease-in-out, border .1s ease-in-out;\n\n\t&:focus {\n\t\t@mixin ck-focus-ring;\n\t\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\n\t}\n\n\t&[readonly] {\n\t\tborder: 1px solid var(--ck-color-input-disabled-border);\n\t\tbackground: var(--ck-color-input-disabled-background);\n\t\tcolor: var(--ck-color-input-disabled-text);\n\n\t\t&:focus {\n\t\t\t/* The read-only input should have a slightly less visible shadow when focused. */\n\t\t\t@mixin ck-box-shadow var(--ck-focus-disabled-outer-shadow);\n\t\t}\n\t}\n\n\t&.ck-error {\n\t\tborder-color: var(--ck-color-input-error-border);\n\t\tanimation: ck-text-input-shake .3s ease both;\n\n\t\t&:focus {\n\t\t\t@mixin ck-box-shadow var(--ck-focus-error-outer-shadow);\n\t\t}\n\t}\n}\n\n@keyframes ck-text-input-shake {\n\t20% {\n\t\ttransform: translateX(-2px);\n\t}\n\n\t40% {\n\t\ttransform: translateX(2px);\n\t}\n\n\t60% {\n\t\ttransform: translateX(-1px);\n\t}\n\n\t80% {\n\t\ttransform: translateX(1px);\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A visual style of focused element's border.\n */\n@define-mixin ck-focus-ring {\n\t/* Disable native outline. */\n\toutline: none;\n\tborder: var(--ck-focus-ring)\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],"sourceRoot":""}]);
  102294. // Exports
  102295. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102296. /***/ }),
  102297. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css":
  102298. /*!************************************************************************************************************************************************************************!*\
  102299. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css ***!
  102300. \************************************************************************************************************************************************************************/
  102301. /*! exports provided: default */
  102302. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102303. "use strict";
  102304. __webpack_require__.r(__webpack_exports__);
  102305. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102306. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102307. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102308. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102309. // Imports
  102310. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102311. // Module
  102312. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/label/label.css"],"names":[],"mappings":"AAKA,aACC,aACD,CAEA,mBACC,YACD,CCNA,aACC,eACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-label {\n\tdisplay: block;\n}\n\n.ck.ck-voice-label {\n\tdisplay: none;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-label {\n\tfont-weight: bold;\n}\n"],"sourceRoot":""}]);
  102313. // Exports
  102314. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102315. /***/ }),
  102316. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css":
  102317. /*!******************************************************************************************************************************************************************************************!*\
  102318. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css ***!
  102319. \******************************************************************************************************************************************************************************************/
  102320. /*! exports provided: default */
  102321. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102322. "use strict";
  102323. __webpack_require__.r(__webpack_exports__);
  102324. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102325. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102326. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102327. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102328. // Imports
  102329. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102330. // Module
  102331. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{pointer-events:none;transform-origin:0 0;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);background:var(--ck-color-labeled-field-label-background);padding:0 calc(var(--ck-font-size-tiny)*0.5);line-height:normal;font-weight:400;text-overflow:ellipsis;overflow:hidden;max-width:100%;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-spacing-medium),calc(var(--ck-font-size-base)*0.6)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-spacing-medium)*-1),calc(var(--ck-font-size-base)*0.6)) scale(1)}.ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));background:transparent;padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/labeledfield/labeledfieldview.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],"names":[],"mappings":"AAMC,mEACC,YAAa,CACb,iBACD,CAEA,uCACC,aAAc,CACd,iBACD,CCND,MACC,kEAAsE,CACtE,gFAAiF,CACjF,yEACD,CAEA,0BCHC,eD4GD,CAzGA,2FCCE,qCDwGF,CAtGC,mEACC,UAmCD,CAjCC,gFACC,KA+BD,CAhCA,0FAIE,MA4BF,CAhCA,0FAQE,OAwBF,CAhCA,gFAWC,mBAAoB,CACpB,oBAAqB,CAGrB,6DAA+D,CAE/D,yDAA0D,CAC1D,4CAA8C,CAC9C,kBAAoB,CACpB,eAAmB,CAGnB,sBAAuB,CACvB,eAAgB,CAEhB,cAAe,CAEf,+JAID,CAQA,mKACC,gCACD,CAGD,yDACC,mCAAoC,CACpC,kCAAmC,CAInC,kBAKD,CAHC,6FACC,gCACD,CAID,4OAEC,yCACD,CAIA,oUAGE,yFAYF,CAfA,oUAOE,kGAQF,CAfA,gTAWC,iEAAkE,CAElE,sBAAuB,CACvB,SACD,CAKA,8FACC,sBACD,CAGA,yIACC,SACD,CAGA,kMACC,8HACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-labeled-field-view {\n\t& > .ck.ck-labeled-field-view__input-wrapper {\n\t\tdisplay: flex;\n\t\tposition: relative;\n\t}\n\n\t& .ck.ck-label {\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\";\n@import \"../../../mixins/_rounded.css\";\n\n:root {\n\t--ck-labeled-field-view-transition: .1s cubic-bezier(0, 0, 0.24, 0.95);\n\t--ck-labeled-field-empty-unfocused-max-width: 100% - 2 * var(--ck-spacing-medium);\n\t--ck-color-labeled-field-label-background: var(--ck-color-base-background);\n}\n\n.ck.ck-labeled-field-view {\n\t@mixin ck-rounded-corners;\n\n\t& > .ck.ck-labeled-field-view__input-wrapper {\n\t\twidth: 100%;\n\n\t\t& > .ck.ck-label {\n\t\t\ttop: 0px;\n\n\t\t\t@mixin ck-dir ltr {\n\t\t\t\tleft: 0px;\n\t\t\t}\n\n\t\t\t@mixin ck-dir rtl {\n\t\t\t\tright: 0px;\n\t\t\t}\n\n\t\t\tpointer-events: none;\n\t\t\ttransform-origin: 0 0;\n\n\t\t\t/* By default, display the label scaled down above the field. */\n\t\t\ttransform: translate(var(--ck-spacing-medium), -6px) scale(.75);\n\n\t\t\tbackground: var(--ck-color-labeled-field-label-background);\n\t\t\tpadding: 0 calc(.5 * var(--ck-font-size-tiny));\n\t\t\tline-height: initial;\n\t\t\tfont-weight: normal;\n\n\t\t\t/* Prevent overflow when the label is longer than the input */\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\n\t\t\tmax-width: 100%;\n\n\t\t\ttransition:\n\t\t\t\ttransform var(--ck-labeled-field-view-transition),\n\t\t\t\tpadding var(--ck-labeled-field-view-transition),\n\t\t\t\tbackground var(--ck-labeled-field-view-transition);\n\t\t}\n\t}\n\n\t&.ck-error {\n\t\t& > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\n\t\t\tcolor: var(--ck-color-base-error);\n\t\t}\n\n\t\t& .ck-input:not([readonly]) + .ck.ck-label {\n\t\t\tcolor: var(--ck-color-base-error);\n\t\t}\n\t}\n\n\t& .ck-labeled-field-view__status {\n\t\tfont-size: var(--ck-font-size-small);\n\t\tmargin-top: var(--ck-spacing-small);\n\n\t\t/* Let the info wrap to the next line to avoid stretching the layout horizontally.\n\t\tThe status could be very long. */\n\t\twhite-space: normal;\n\n\t\t&.ck-labeled-field-view__status_error {\n\t\t\tcolor: var(--ck-color-base-error);\n\t\t}\n\t}\n\n\t/* Disabled fields and fields that have no focus should fade out. */\n\t&.ck-disabled > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label,\n\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused) > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\n\t\tcolor: var(--ck-color-input-disabled-text);\n\t}\n\n\t/* Fields that are disabled or not focused and without a placeholder should have full-sized labels. */\n\t/* stylelint-disable-next-line no-descending-specificity */\n\t&.ck-disabled.ck-labeled-field-view_empty > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label,\n\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder) > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\n\t\t@mixin ck-dir ltr {\n\t\t\ttransform: translate(var(--ck-spacing-medium), calc(0.6 * var(--ck-font-size-base))) scale(1);\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\ttransform: translate(calc(-1 * var(--ck-spacing-medium)), calc(0.6 * var(--ck-font-size-base))) scale(1);\n\t\t}\n\n\t\t/* Compensate for the default translate position. */\n\t\tmax-width: calc(var(--ck-labeled-field-empty-unfocused-max-width));\n\n\t\tbackground: transparent;\n\t\tpadding: 0;\n\t}\n\n\t/*------ DropdownView integration ----------------------------------------------------------------------------------- */\n\n\t/* Make sure dropdown' background color in any of dropdown's state does not collide with labeled field. */\n\t& > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown > .ck.ck-button {\n\t\tbackground: transparent;\n\t}\n\n\t/* When the dropdown is \"empty\", the labeled field label replaces its label. */\n\t&.ck-labeled-field-view_empty > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown > .ck-button > .ck-button__label {\n\t\topacity: 0;\n\t}\n\n\t/* Make sure the label of the empty, unfocused input does not cover the dropdown arrow. */\n\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder) > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown + .ck-label {\n\t\tmax-width: calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard));\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],"sourceRoot":""}]);
  102332. // Exports
  102333. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102334. /***/ }),
  102335. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css":
  102336. /*!**********************************************************************************************************************************************************************!*\
  102337. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css ***!
  102338. \**********************************************************************************************************************************************************************/
  102339. /*! exports provided: default */
  102340. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102341. "use strict";
  102342. __webpack_require__.r(__webpack_exports__);
  102343. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102344. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102345. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102346. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102347. // Imports
  102348. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102349. // Module
  102350. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;padding:calc(var(--ck-line-height-base)*0.2*var(--ck-font-size-base)) calc(var(--ck-line-height-base)*0.4*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(var(--ck-line-height-base)*1.2*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{height:1px;width:100%;background:var(--ck-color-base-border)}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/list/list.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],"names":[],"mappings":"AAOA,YCEC,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBAAgB,CDFhB,YAAa,CACb,qBAcD,CAZC,2DAEC,aACD,CAKA,kCACC,iBAAkB,CAClB,2BACD,CEfD,YCEC,eDGD,CALA,+DCME,qCDDF,CALA,YAGC,oBAAqB,CACrB,0CACD,CAEA,kBACC,cAAe,CACf,cA2DD,CAzDC,6BACC,gBAAiB,CACjB,UAAW,CACX,eAAgB,CAChB,eAAgB,CAKhB,mIAiCD,CA7BC,+CAEC,yEACD,CAEA,oCACC,eACD,CAEA,mCACC,oDAAqD,CACrD,yCAaD,CAXC,0CACC,eACD,CAEA,2DACC,0DACD,CAEA,2DACC,4CACD,CAGD,qDACC,uDACD,CAMA,yCACC,0CAA2C,CAC3C,aAMD,CAJC,iEACC,uDAAwD,CACxD,aACD,CAKH,uBACC,UAAW,CACX,UAAW,CACX,sCACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../../mixins/_unselectable.css\";\n\n.ck.ck-list {\n\t@mixin ck-unselectable;\n\n\tdisplay: flex;\n\tflex-direction: column;\n\n\t& .ck-list__item,\n\t& .ck-list__separator {\n\t\tdisplay: block;\n\t}\n\n\t/* Make sure that whatever child of the list item gets focus, it remains on the\n\ttop. Thanks to that, styles like box-shadow, outline, etc. are not masked by\n\tadjacent list items. */\n\t& .ck-list__item > *:focus {\n\t\tposition: relative;\n\t\tz-index: var(--ck-z-default);\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Makes element unselectable.\n */\n@define-mixin ck-unselectable {\n\t-moz-user-select: none;\n\t-webkit-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../../../mixins/_disabled.css\";\n@import \"../../../mixins/_rounded.css\";\n@import \"../../../mixins/_shadow.css\";\n\n.ck.ck-list {\n\t@mixin ck-rounded-corners;\n\n\tlist-style-type: none;\n\tbackground: var(--ck-color-list-background);\n}\n\n.ck.ck-list__item {\n\tcursor: default;\n\tmin-width: 12em;\n\n\t& .ck-button {\n\t\tmin-height: unset;\n\t\twidth: 100%;\n\t\ttext-align: left;\n\t\tborder-radius: 0;\n\n\t\t/* List items should have the same height. Use absolute units to make sure it is so\n\t\t because e.g. different heading styles may have different height\n\t\t https://github.com/ckeditor/ckeditor5-heading/issues/63 */\n\t\tpadding:\n\t\t\tcalc(.2 * var(--ck-line-height-base) * var(--ck-font-size-base))\n\t\t\tcalc(.4 * var(--ck-line-height-base) * var(--ck-font-size-base));\n\n\t\t& .ck-button__label {\n\t\t\t/* https://github.com/ckeditor/ckeditor5-heading/issues/63 */\n\t\t\tline-height: calc(1.2 * var(--ck-line-height-base) * var(--ck-font-size-base));\n\t\t}\n\n\t\t&:active {\n\t\t\tbox-shadow: none;\n\t\t}\n\n\t\t&.ck-on {\n\t\t\tbackground: var(--ck-color-list-button-on-background);\n\t\t\tcolor: var(--ck-color-list-button-on-text);\n\n\t\t\t&:active {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\n\t\t\t&:hover:not(.ck-disabled) {\n\t\t\t\tbackground: var(--ck-color-list-button-on-background-focus);\n\t\t\t}\n\n\t\t\t&:focus:not(.ck-disabled) {\n\t\t\t\tborder-color: var(--ck-color-base-background);\n\t\t\t}\n\t\t}\n\n\t\t&:hover:not(.ck-disabled) {\n\t\t\tbackground: var(--ck-color-list-button-hover-background);\n\t\t}\n\t}\n\n\t/* It's unnecessary to change the background/text of a switch toggle; it has different ways\n\tof conveying its state (like the switcher) */\n\t& .ck-switchbutton {\n\t\t&.ck-on {\n\t\t\tbackground: var(--ck-color-list-background);\n\t\t\tcolor: inherit;\n\n\t\t\t&:hover:not(.ck-disabled) {\n\t\t\t\tbackground: var(--ck-color-list-button-hover-background);\n\t\t\t\tcolor: inherit;\n\t\t\t}\n\t\t}\n\t}\n}\n\n.ck.ck-list__separator {\n\theight: 1px;\n\twidth: 100%;\n\tbackground: var(--ck-color-base-border);\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],"sourceRoot":""}]);
  102351. // Exports
  102352. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102353. /***/ }),
  102354. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css":
  102355. /*!*******************************************************************************************************************************************************************************!*\
  102356. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css ***!
  102357. \*******************************************************************************************************************************************************************************/
  102358. /*! exports provided: default */
  102359. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102360. "use strict";
  102361. __webpack_require__.r(__webpack_exports__);
  102362. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102363. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102364. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102365. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102366. // Imports
  102367. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102368. // Module
  102369. ___CSS_LOADER_EXPORT___.push([module.i, ":root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:\"\";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border);filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/balloonpanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],"names":[],"mappings":"AAKA,MAEC,8DACD,CAEA,qBACC,YAAa,CACb,iBAAkB,CAElB,yBAyCD,CAtCE,+GAEC,UAAW,CACX,iBACD,CAEA,wDACC,6CACD,CAEA,uDACC,uDACD,CAIA,4CACC,6CACD,CAEA,2CACC,uDACD,CAIA,4CACC,6CACD,CAEA,2CACC,uDACD,CAGD,8CACC,aACD,CC9CD,MACC,6BAA8B,CAC9B,8BAA+B,CAC/B,iCAAkC,CAClC,oEACD,CAEA,qBCJC,eD4ID,CAxIA,iFCAE,qCDwIF,CAxIA,qBENC,oCAA8B,CFU9B,eAAgB,CAEhB,2CAA4C,CAC5C,6CAiID,CA9HE,+GAEC,OAAQ,CACR,QAAS,CACT,kBACD,CAIA,uFAEC,oDAAoH,CAApH,kDAAoH,CAApH,qDAAoH,CAApH,kBACD,CAEA,4CACC,gDACD,CAEA,uFAHC,6BAA8E,CAA9E,8BAA8E,CAA9E,4BAMD,CAHA,2CACC,oDAAkF,CAClF,yCACD,CAIA,uFAEC,oDAAoH,CAApH,qBAAoH,CAApH,qDAAoH,CAApH,+CACD,CAEA,4CACC,6CAAkE,CAClE,uDACD,CAEA,uFAJC,6BAAkE,CAAlE,+BAAkE,CAAlE,8BAOD,CAHA,2CACC,iDAAkF,CAClF,4CACD,CAIA,yGAEC,QAAS,CACT,uDAA0D,CAC1D,2CACD,CAIA,2GAEC,+CAAkD,CAClD,2CACD,CAIA,2GAEC,gDAAmD,CACnD,2CACD,CAIA,yGAEC,QAAS,CACT,uDAA0D,CAC1D,8CACD,CAIA,2GAEC,+CAAkD,CAClD,8CACD,CAIA,2GAEC,gDAAmD,CACnD,8CACD,CAIA,6GAEC,SAAU,CACV,uDAA0D,CAC1D,8CACD,CAIA,6GAEC,QAAS,CACT,sDAAyD,CACzD,8CACD,CAIA,6GAEC,SAAU,CACV,uDAA0D,CAC1D,2CACD,CAIA,6GAEC,QAAS,CACT,sDAAyD,CACzD,2CACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t/* Make sure the balloon arrow does not float over its children. */\n\t--ck-balloon-panel-arrow-z-index: calc(var(--ck-z-default) - 3);\n}\n\n.ck.ck-balloon-panel {\n\tdisplay: none;\n\tposition: absolute;\n\n\tz-index: var(--ck-z-modal);\n\n\t&.ck-balloon-panel_with-arrow {\n\t\t&::before,\n\t\t&::after {\n\t\t\tcontent: \"\";\n\t\t\tposition: absolute;\n\t\t}\n\n\t\t&::before {\n\t\t\tz-index: var(--ck-balloon-panel-arrow-z-index);\n\t\t}\n\n\t\t&::after {\n\t\t\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\n\t\t}\n\t}\n\n\t&[class*=\"arrow_n\"] {\n\t\t&::before {\n\t\t\tz-index: var(--ck-balloon-panel-arrow-z-index);\n\t\t}\n\n\t\t&::after {\n\t\t\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\n\t\t}\n\t}\n\n\t&[class*=\"arrow_s\"] {\n\t\t&::before {\n\t\t\tz-index: var(--ck-balloon-panel-arrow-z-index);\n\t\t}\n\n\t\t&::after {\n\t\t\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_visible {\n\t\tdisplay: block;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../../../mixins/_rounded.css\";\n@import \"../../../mixins/_shadow.css\";\n\n:root {\n\t--ck-balloon-arrow-offset: 2px;\n\t--ck-balloon-arrow-height: 10px;\n\t--ck-balloon-arrow-half-width: 8px;\n\t--ck-balloon-arrow-drop-shadow: 0 2px 2px var(--ck-color-shadow-drop);\n}\n\n.ck.ck-balloon-panel {\n\t@mixin ck-rounded-corners;\n\t@mixin ck-drop-shadow;\n\n\tmin-height: 15px;\n\n\tbackground: var(--ck-color-panel-background);\n\tborder: 1px solid var(--ck-color-panel-border);\n\n\t&.ck-balloon-panel_with-arrow {\n\t\t&::before,\n\t\t&::after {\n\t\t\twidth: 0;\n\t\t\theight: 0;\n\t\t\tborder-style: solid;\n\t\t}\n\t}\n\n\t&[class*=\"arrow_n\"] {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-width: 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width);\n\t\t}\n\n\t\t&::before {\n\t\t\tborder-color: transparent transparent var(--ck-color-panel-border) transparent;\n\t\t}\n\n\t\t&::after {\n\t\t\tborder-color: transparent transparent var(--ck-color-panel-background) transparent;\n\t\t\tmargin-top: var(--ck-balloon-arrow-offset);\n\t\t}\n\t}\n\n\t&[class*=\"arrow_s\"] {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-width: var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width);\n\t\t}\n\n\t\t&::before {\n\t\t\tborder-color: var(--ck-color-panel-border) transparent transparent;\n\t\t\tfilter: drop-shadow(var(--ck-balloon-arrow-drop-shadow));\n\t\t}\n\n\t\t&::after {\n\t\t\tborder-color: var(--ck-color-panel-background) transparent transparent transparent;\n\t\t\tmargin-bottom: var(--ck-balloon-arrow-offset);\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_n {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: 50%;\n\t\t\tmargin-left: calc(-1 * var(--ck-balloon-arrow-half-width));\n\t\t\ttop: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_nw {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\ttop: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_ne {\n\t\t&::before,\n\t\t&::after {\n\t\t\tright: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\ttop: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_s {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: 50%;\n\t\t\tmargin-left: calc(-1 * var(--ck-balloon-arrow-half-width));\n\t\t\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_sw {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_se {\n\t\t&::before,\n\t\t&::after {\n\t\t\tright: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_sme {\n\t\t&::before,\n\t\t&::after {\n\t\t\tright: 25%;\n\t\t\tmargin-right: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_smw {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: 25%;\n\t\t\tmargin-left: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_nme {\n\t\t&::before,\n\t\t&::after {\n\t\t\tright: 25%;\n\t\t\tmargin-right: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\ttop: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_nmw {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: 25%;\n\t\t\tmargin-left: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\ttop: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],"sourceRoot":""}]);
  102370. // Exports
  102371. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102372. /***/ }),
  102373. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css":
  102374. /*!*********************************************************************************************************************************************************************************!*\
  102375. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css ***!
  102376. \*********************************************************************************************************************************************************************************/
  102377. /*! exports provided: default */
  102378. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102379. "use strict";
  102380. __webpack_require__.r(__webpack_exports__);
  102381. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102382. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102383. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102384. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102385. // Imports
  102386. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102387. // Module
  102388. ___CSS_LOADER_EXPORT___.push([module.i, ".ck .ck-balloon-rotator__navigation{display:flex;align-items:center;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/balloonrotator.css"],"names":[],"mappings":"AAKA,oCACC,YAAa,CACb,kBAAmB,CACnB,sBACD,CAKA,6CACC,sBACD,CCXA,oCACC,6CAA8C,CAC9C,sDAAuD,CACvD,iCAgBD,CAbC,sCACC,oCAAqC,CACrC,kCAAmC,CACnC,qCACD,CAGA,iEACC,uCAAwC,CAGxC,mCACD,CAMA,2DACC,eACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-balloon-rotator__navigation {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Buttons inside a toolbar should be centered when rotator bar is wider.\n * See: https://github.com/ckeditor/ckeditor5-ui/issues/495\n */\n.ck .ck-balloon-rotator__content .ck-toolbar {\n\tjustify-content: center;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-balloon-rotator__navigation {\n\tbackground: var(--ck-color-toolbar-background);\n\tborder-bottom: 1px solid var(--ck-color-toolbar-border);\n\tpadding: 0 var(--ck-spacing-small);\n\n\t/* Let's keep similar appearance to `ck-toolbar`. */\n\t& > * {\n\t\tmargin-right: var(--ck-spacing-small);\n\t\tmargin-top: var(--ck-spacing-small);\n\t\tmargin-bottom: var(--ck-spacing-small);\n\t}\n\n\t/* Gives counter more breath than buttons. */\n\t& .ck-balloon-rotator__counter {\n\t\tmargin-right: var(--ck-spacing-standard);\n\n\t\t/* We need to use smaller margin because of previous button's right margin. */\n\t\tmargin-left: var(--ck-spacing-small);\n\t}\n}\n\n.ck .ck-balloon-rotator__content {\n\n\t/* Disable default annotation shadow inside rotator with fake panels. */\n\t& .ck.ck-annotation-wrapper {\n\t\tbox-shadow: none;\n\t}\n}\n"],"sourceRoot":""}]);
  102389. // Exports
  102390. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102391. /***/ }),
  102392. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css":
  102393. /*!****************************************************************************************************************************************************************************!*\
  102394. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css ***!
  102395. \****************************************************************************************************************************************************************************/
  102396. /*! exports provided: default */
  102397. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102398. "use strict";
  102399. __webpack_require__.r(__webpack_exports__);
  102400. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102401. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102402. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102403. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102404. // Imports
  102405. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102406. // Module
  102407. ___CSS_LOADER_EXPORT___.push([module.i, ".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);width:100%;height:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/fakepanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],"names":[],"mappings":"AAKA,mBACC,iBAAkB,CAGlB,mCACD,CAEA,uBACC,iBACD,CAEA,mCACC,SACD,CAEA,oCACC,SACD,CCfA,MACC,6CAA8C,CAC9C,2CACD,CAGA,uBCJC,oCAA8B,CDO9B,eAAgB,CAEhB,2CAA4C,CAC5C,6CAA8C,CAC9C,qCAAsC,CAEtC,UAAW,CACX,WACD,CAEA,mCACC,0DAA2D,CAC3D,uDACD,CAEA,oCACC,kEAAqE,CACrE,+DACD,CACA,oCACC,kEAAqE,CACrE,+DACD,CAGA,yIAGC,4CACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-fake-panel {\n\tposition: absolute;\n\n\t/* Fake panels should be placed under main balloon content. */\n\tz-index: calc(var(--ck-z-modal) - 1);\n}\n\n.ck .ck-fake-panel div {\n\tposition: absolute;\n}\n\n.ck .ck-fake-panel div:nth-child( 1 ) {\n\tz-index: 2;\n}\n\n.ck .ck-fake-panel div:nth-child( 2 ) {\n\tz-index: 1;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../../../mixins/_shadow.css\";\n\n:root {\n\t--ck-balloon-fake-panel-offset-horizontal: 6px;\n\t--ck-balloon-fake-panel-offset-vertical: 6px;\n}\n\n/* Let's use `.ck-balloon-panel` appearance. See: balloonpanel.css. */\n.ck .ck-fake-panel div {\n\t@mixin ck-drop-shadow;\n\n\tmin-height: 15px;\n\n\tbackground: var(--ck-color-panel-background);\n\tborder: 1px solid var(--ck-color-panel-border);\n\tborder-radius: var(--ck-border-radius);\n\n\twidth: 100%;\n\theight: 100%;\n}\n\n.ck .ck-fake-panel div:nth-child( 1 ) {\n\tmargin-left: var(--ck-balloon-fake-panel-offset-horizontal);\n\tmargin-top: var(--ck-balloon-fake-panel-offset-vertical);\n}\n\n.ck .ck-fake-panel div:nth-child( 2 ) {\n\tmargin-left: calc(var(--ck-balloon-fake-panel-offset-horizontal) * 2);\n\tmargin-top: calc(var(--ck-balloon-fake-panel-offset-vertical) * 2);\n}\n.ck .ck-fake-panel div:nth-child( 3 ) {\n\tmargin-left: calc(var(--ck-balloon-fake-panel-offset-horizontal) * 3);\n\tmargin-top: calc(var(--ck-balloon-fake-panel-offset-vertical) * 3);\n}\n\n/* If balloon is positioned above element, we need to move fake panel to the top. */\n.ck .ck-balloon-panel_arrow_s + .ck-fake-panel,\n.ck .ck-balloon-panel_arrow_se + .ck-fake-panel,\n.ck .ck-balloon-panel_arrow_sw + .ck-fake-panel {\n\t--ck-balloon-fake-panel-offset-vertical: -6px;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],"sourceRoot":""}]);
  102408. // Exports
  102409. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102410. /***/ }),
  102411. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css":
  102412. /*!******************************************************************************************************************************************************************************!*\
  102413. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css ***!
  102414. \******************************************************************************************************************************************************************************/
  102415. /*! exports provided: default */
  102416. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102417. "use strict";
  102418. __webpack_require__.r(__webpack_exports__);
  102419. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102420. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102421. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102422. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102423. // Imports
  102424. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102425. // Module
  102426. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/stickypanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],"names":[],"mappings":"AAMC,qDACC,yBAA0B,CAC1B,cAAe,CACf,KACD,CAEA,kEACC,QAAS,CACT,iBACD,CCPA,qDCCA,oCAA8B,CDE7B,sBAAuB,CACvB,wBAAyB,CACzB,yBACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-sticky-panel {\n\t& .ck-sticky-panel__content_sticky {\n\t\tz-index: var(--ck-z-modal); /* #315 */\n\t\tposition: fixed;\n\t\ttop: 0;\n\t}\n\n\t& .ck-sticky-panel__content_sticky_bottom-limit {\n\t\ttop: auto;\n\t\tposition: absolute;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../../../mixins/_shadow.css\";\n\n.ck.ck-sticky-panel {\n\t& .ck-sticky-panel__content_sticky {\n\t\t@mixin ck-drop-shadow;\n\n\t\tborder-width: 0 1px 1px;\n\t\tborder-top-left-radius: 0;\n\t\tborder-top-right-radius: 0;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],"sourceRoot":""}]);
  102427. // Exports
  102428. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102429. /***/ }),
  102430. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css":
  102431. /*!*******************************************************************************************************************************************************************************************!*\
  102432. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css ***!
  102433. \*******************************************************************************************************************************************************************************************/
  102434. /*! exports provided: default */
  102435. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102436. "use strict";
  102437. __webpack_require__.r(__webpack_exports__);
  102438. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102439. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102440. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102441. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102442. // Imports
  102443. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102444. // Module
  102445. ___CSS_LOADER_EXPORT___.push([module.i, ".ck-vertical-form .ck-button:after{content:\"\";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{content:\"\";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-text-width)*0.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-large);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after,[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/responsive-form/responsiveform.css"],"names":[],"mappings":"AAOA,mCACC,UAAW,CACX,OAAQ,CACR,iBAAkB,CAClB,UAAW,CACX,2BAA4B,CAC5B,8BAA+B,CAC/B,SACD,CCTC,oCDaC,wCACC,UAAW,CACX,OAAQ,CACR,iBAAkB,CAClB,UAAW,CACX,2BAA4B,CAC5B,8BAA+B,CAC/B,SACD,CCnBD,CCAD,qDACC,kDACD,CAEA,uBACC,+BAkED,CAhEC,6BAEC,YACD,CASC,uGACC,sCACD,CDvBD,oCCMD,uBAqBE,SAAU,CACV,0CA6CF,CA3CE,8CACC,wDAWD,CATC,6DACC,WAAY,CACZ,UACD,CAGA,4EACC,kBACD,CAID,iGAEC,kCAAmC,CACnC,kCAAmC,CAEnC,eAAgB,CAChB,QAAS,CACT,gDAaD,CApBA,0OAcE,aAMF,CAGC,yMACC,kDACD,CDpEF","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\";\n\n.ck-vertical-form .ck-button::after {\n\tcontent: \"\";\n\twidth: 0;\n\tposition: absolute;\n\tright: -1px;\n\ttop: var(--ck-spacing-small);\n\tbottom: var(--ck-spacing-small);\n\tz-index: 1;\n}\n\n.ck.ck-responsive-form {\n\t@mixin ck-media-phone {\n\t\t& .ck-button::after {\n\t\t\tcontent: \"\";\n\t\t\twidth: 0;\n\t\t\tposition: absolute;\n\t\t\tright: -1px;\n\t\t\ttop: var(--ck-spacing-small);\n\t\t\tbottom: var(--ck-spacing-small);\n\t\t\tz-index: 1;\n\t\t}\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\";\n@import \"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\";\n\n.ck-vertical-form > .ck-button:nth-last-child(2)::after {\n\tborder-right: 1px solid var(--ck-color-base-border);\n}\n\n.ck.ck-responsive-form {\n\tpadding: var(--ck-spacing-large);\n\n\t&:focus {\n\t\t/* See: https://github.com/ckeditor/ckeditor5/issues/4773 */\n\t\toutline: none;\n\t}\n\n\t@mixin ck-dir ltr {\n\t\t& > :not(:first-child) {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n\n\t@mixin ck-dir rtl {\n\t\t& > :not(:last-child) {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n\n\t@mixin ck-media-phone {\n\t\tpadding: 0;\n\t\twidth: calc(.8 * var(--ck-input-text-width));\n\n\t\t& .ck-labeled-field-view {\n\t\t\tmargin: var(--ck-spacing-large) var(--ck-spacing-large) 0;\n\n\t\t\t& .ck-input-text {\n\t\t\t\tmin-width: 0;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\n\t\t\t/* Let the long error messages wrap in the narrow form. */\n\t\t\t& .ck-labeled-field-view__error {\n\t\t\t\twhite-space: normal;\n\t\t\t}\n\t\t}\n\n\t\t/* Styles for two last buttons in the form (save&cancel, edit&unlink, etc.). */\n\t\t& > .ck-button:nth-last-child(1),\n\t\t& > .ck-button:nth-last-child(2) {\n\t\t\tpadding: var(--ck-spacing-standard);\n\t\t\tmargin-top: var(--ck-spacing-large);\n\n\t\t\tborder-radius: 0;\n\t\t\tborder: 0;\n\t\t\tborder-top: 1px solid var(--ck-color-base-border);\n\n\t\t\t@mixin ck-dir ltr {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\n\t\t\t@mixin ck-dir rtl {\n\t\t\t\tmargin-left: 0;\n\n\t\t\t\t&:last-of-type {\n\t\t\t\t\tborder-right: 1px solid var(--ck-color-base-border);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t& > .ck-button:nth-last-child(2) {\n\t\t\t&::after {\n\t\t\t\tborder-right: 1px solid var(--ck-color-base-border);\n\t\t\t}\n\t\t}\n\t}\n}\n"],"sourceRoot":""}]);
  102446. // Exports
  102447. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102448. /***/ }),
  102449. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css":
  102450. /*!*********************************************************************************************************************************************************************************!*\
  102451. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css ***!
  102452. \*********************************************************************************************************************************************************************************/
  102453. /*! exports provided: default */
  102454. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102455. "use strict";
  102456. __webpack_require__.r(__webpack_exports__);
  102457. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102458. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102459. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102460. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102461. // Imports
  102462. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102463. // Module
  102464. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/toolbar/blocktoolbar.css"],"names":[],"mappings":"AAKA,4BACC,iBAAkB,CAClB,2BACD,CCHA,MACC,oDAAqD,CACrD,yDACD,CAEA,4BACC,0CAA2C,CAC3C,sCACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-block-toolbar-button {\n\tposition: absolute;\n\tz-index: var(--ck-z-default);\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-block-toolbar-button: var(--ck-color-text);\n\t--ck-block-toolbar-button-size: var(--ck-font-size-normal);\n}\n\n.ck.ck-block-toolbar-button {\n\tcolor: var(--ck-color-block-toolbar-button);\n\tfont-size: var(--ck-block-toolbar-size);\n}\n"],"sourceRoot":""}]);
  102465. // Exports
  102466. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102467. /***/ }),
  102468. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css":
  102469. /*!****************************************************************************************************************************************************************************!*\
  102470. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css ***!
  102471. \****************************************************************************************************************************************************************************/
  102472. /*! exports provided: default */
  102473. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102474. "use strict";
  102475. __webpack_require__.r(__webpack_exports__);
  102476. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102477. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102478. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102479. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102480. // Imports
  102481. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102482. // Module
  102483. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row nowrap;align-items:center}.ck.ck-toolbar>.ck-toolbar__items{display:flex;flex-flow:row wrap;align-items:center;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;width:1px;min-width:1px;background:var(--ck-color-toolbar-border);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-right:var(--ck-spacing-small)}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/toolbar/toolbar.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],"names":[],"mappings":"AAOA,eCEC,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBAAgB,CDFhB,YAAa,CACb,oBAAqB,CACrB,kBA6CD,CA3CC,kCACC,YAAa,CACb,kBAAmB,CACnB,kBAAmB,CACnB,WAED,CAEA,yCACC,oBAWD,CAJC,yGAEC,YACD,CAGD,uCACC,eACD,CAEA,sDACC,gBACD,CAEA,sDACC,qBACD,CAEA,sDACC,gBACD,CAGC,yFACC,YACD,CE/CF,eCGC,eD0FD,CA7FA,qECOE,qCDsFF,CA7FA,eAGC,6CAA8C,CAC9C,iCAAkC,CAClC,+CAwFD,CAtFC,yCACC,kBAAmB,CACnB,SAAU,CACV,aAAc,CACd,yCAA0C,CAM1C,kCAAmC,CACnC,qCACD,CAEA,uCACC,QACD,CAGC,gEAEC,oCACD,CAIA,kEACC,YACD,CAGD,gHAGC,kCAAmC,CACnC,qCACD,CAEA,mCAEC,SAgBD,CAbC,0DAEC,UAAW,CAGX,QAAS,CAGT,eAAgB,CAGhB,QACD,CAGD,kCAEC,SAWD,CATC,uDAEC,QAMD,CAHC,yFACC,eACD,CASD,kFACC,mCACD,CAvFF,qCA2FE,QAEF,CAYC,+FACC,cACD,CAEA,iJAEC,mCACD,CAEA,qHACC,aACD,CAIC,6JACC,wBAAyB,CACzB,2BACD,CAGA,2JACC,yBAA0B,CAC1B,4BACD,CAID,qGACC,mCACD,CAGA,yLACC,mCACD,CAWA,qHACC,cACD,CAIC,6JACC,yBAA0B,CAC1B,4BACD,CAGA,2JACC,wBAAyB,CACzB,2BACD,CAID,qGACC,oCACD,CAGA,yLACC,oCACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../../mixins/_unselectable.css\";\n\n.ck.ck-toolbar {\n\t@mixin ck-unselectable;\n\n\tdisplay: flex;\n\tflex-flow: row nowrap;\n\talign-items: center;\n\n\t& > .ck-toolbar__items {\n\t\tdisplay: flex;\n\t\tflex-flow: row wrap;\n\t\talign-items: center;\n\t\tflex-grow: 1;\n\n\t}\n\n\t& .ck.ck-toolbar__separator {\n\t\tdisplay: inline-block;\n\n\t\t/*\n\t\t * A leading or trailing separator makes no sense (separates from nothing on one side).\n\t\t * For instance, it can happen when toolbar items (also separators) are getting grouped one by one and\n\t\t * moved to another toolbar in the dropdown.\n\t\t */\n\t\t&:first-child,\n\t\t&:last-child {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t& .ck-toolbar__line-break {\n\t\tflex-basis: 100%;\n\t}\n\n\t&.ck-toolbar_grouping > .ck-toolbar__items {\n\t\tflex-wrap: nowrap;\n\t}\n\n\t&.ck-toolbar_vertical > .ck-toolbar__items {\n\t\tflex-direction: column;\n\t}\n\n\t&.ck-toolbar_floating > .ck-toolbar__items {\n\t\tflex-wrap: nowrap;\n\t}\n\n\t& > .ck.ck-toolbar__grouped-dropdown {\n\t\t& > .ck-dropdown__button .ck-dropdown__arrow {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Makes element unselectable.\n */\n@define-mixin ck-unselectable {\n\t-moz-user-select: none;\n\t-webkit-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../../../mixins/_rounded.css\";\n@import \"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\";\n\n.ck.ck-toolbar {\n\t@mixin ck-rounded-corners;\n\n\tbackground: var(--ck-color-toolbar-background);\n\tpadding: 0 var(--ck-spacing-small);\n\tborder: 1px solid var(--ck-color-toolbar-border);\n\n\t& .ck.ck-toolbar__separator {\n\t\talign-self: stretch;\n\t\twidth: 1px;\n\t\tmin-width: 1px;\n\t\tbackground: var(--ck-color-toolbar-border);\n\n\t\t/*\n\t\t * These margins make the separators look better in balloon toolbars (when aligned with the \"tip\").\n\t\t * See https://github.com/ckeditor/ckeditor5/issues/7493.\n\t\t */\n\t\tmargin-top: var(--ck-spacing-small);\n\t\tmargin-bottom: var(--ck-spacing-small);\n\t}\n\n\t& .ck-toolbar__line-break {\n\t\theight: 0;\n\t}\n\n\t& > .ck-toolbar__items {\n\t\t& > *:not(.ck-toolbar__line-break) {\n\t\t\t/* (#11) Separate toolbar items. */\n\t\t\tmargin-right: var(--ck-spacing-small);\n\t\t}\n\n\t\t/* Don't display a separator after an empty items container, for instance,\n\t\twhen all items were grouped */\n\t\t&:empty + .ck.ck-toolbar__separator {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t& > .ck-toolbar__items > *:not(.ck-toolbar__line-break),\n\t& > .ck.ck-toolbar__grouped-dropdown {\n\t\t/* Make sure items wrapped to the next line have v-spacing */\n\t\tmargin-top: var(--ck-spacing-small);\n\t\tmargin-bottom: var(--ck-spacing-small);\n\t}\n\n\t&.ck-toolbar_vertical {\n\t\t/* Items in a vertical toolbar span the entire width. */\n\t\tpadding: 0;\n\n\t\t/* Specificity matters here. See https://github.com/ckeditor/ckeditor5-theme-lark/issues/168. */\n\t\t& > .ck-toolbar__items > .ck {\n\t\t\t/* Items in a vertical toolbar should span the horizontal space. */\n\t\t\twidth: 100%;\n\n\t\t\t/* Items in a vertical toolbar should have no margin. */\n\t\t\tmargin: 0;\n\n\t\t\t/* Items in a vertical toolbar span the entire width so rounded corners are pointless. */\n\t\t\tborder-radius: 0;\n\n\t\t\t/* Items in a vertical toolbar span the entire width so any border is pointless. */\n\t\t\tborder: 0;\n\t\t}\n\t}\n\n\t&.ck-toolbar_compact {\n\t\t/* No spacing around items. */\n\t\tpadding: 0;\n\n\t\t& > .ck-toolbar__items > * {\n\t\t\t/* Compact toolbar items have no spacing between them. */\n\t\t\tmargin: 0;\n\n\t\t\t/* \"Middle\" children should have no rounded corners. */\n\t\t\t&:not(:first-child):not(:last-child) {\n\t\t\t\tborder-radius: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t& > .ck.ck-toolbar__grouped-dropdown {\n\t\t/*\n\t\t * Dropdown button has asymmetric padding to fit the arrow.\n\t\t * This button has no arrow so let's revert that padding back to normal.\n\t\t */\n\t\t& > .ck.ck-button.ck-dropdown__button {\n\t\t\tpadding-left: var(--ck-spacing-tiny);\n\t\t}\n\t}\n\n\t@nest .ck-toolbar-container & {\n\t\tborder: 0;\n\t}\n}\n\n/* stylelint-disable */\n\n/*\n * Styles for RTL toolbars.\n *\n * Note: In some cases (e.g. a decoupled editor), the toolbar has its own \"dir\"\n * because its parent is not controlled by the editor framework.\n */\n[dir=\"rtl\"] .ck.ck-toolbar,\n.ck.ck-toolbar[dir=\"rtl\"] {\n\t& > .ck-toolbar__items > .ck {\n\t\tmargin-right: 0;\n\t}\n\n\t&:not(.ck-toolbar_compact) > .ck-toolbar__items > .ck {\n\t\t/* (#11) Separate toolbar items. */\n\t\tmargin-left: var(--ck-spacing-small);\n\t}\n\n\t& > .ck-toolbar__items > .ck:last-child {\n\t\tmargin-left: 0;\n\t}\n\n\t&.ck-toolbar_compact > .ck-toolbar__items > .ck {\n\t\t/* No rounded corners on the right side of the first child. */\n\t\t&:first-child {\n\t\t\tborder-top-left-radius: 0;\n\t\t\tborder-bottom-left-radius: 0;\n\t\t}\n\n\t\t/* No rounded corners on the left side of the last child. */\n\t\t&:last-child {\n\t\t\tborder-top-right-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\t}\n\n\t/* Separate the the separator form the grouping dropdown when some items are grouped. */\n\t& > .ck.ck-toolbar__separator {\n\t\tmargin-left: var(--ck-spacing-small);\n\t}\n\n\t/* Some spacing between the items and the separator before the grouped items dropdown. */\n\t&.ck-toolbar_grouping > .ck-toolbar__items:not(:empty):not(:only-child) {\n\t\tmargin-left: var(--ck-spacing-small);\n\t}\n}\n\n/*\n * Styles for LTR toolbars.\n *\n * Note: In some cases (e.g. a decoupled editor), the toolbar has its own \"dir\"\n * because its parent is not controlled by the editor framework.\n */\n[dir=\"ltr\"] .ck.ck-toolbar,\n.ck.ck-toolbar[dir=\"ltr\"] {\n\t& > .ck-toolbar__items > .ck:last-child {\n\t\tmargin-right: 0;\n\t}\n\n\t&.ck-toolbar_compact > .ck-toolbar__items > .ck {\n\t\t/* No rounded corners on the right side of the first child. */\n\t\t&:first-child {\n\t\t\tborder-top-right-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\n\t\t/* No rounded corners on the left side of the last child. */\n\t\t&:last-child {\n\t\t\tborder-top-left-radius: 0;\n\t\t\tborder-bottom-left-radius: 0;\n\t\t}\n\t}\n\n\t/* Separate the the separator form the grouping dropdown when some items are grouped. */\n\t& > .ck.ck-toolbar__separator {\n\t\tmargin-right: var(--ck-spacing-small);\n\t}\n\n\t/* Some spacing between the items and the separator before the grouped items dropdown. */\n\t&.ck-toolbar_grouping > .ck-toolbar__items:not(:empty):not(:only-child) {\n\t\tmargin-right: var(--ck-spacing-small);\n\t}\n}\n\n/* stylelint-enable */\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],"sourceRoot":""}]);
  102484. // Exports
  102485. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102486. /***/ }),
  102487. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css":
  102488. /*!****************************************************************************************************************************************************************************!*\
  102489. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css ***!
  102490. \****************************************************************************************************************************************************************************/
  102491. /*! exports provided: default */
  102492. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102493. "use strict";
  102494. __webpack_require__.r(__webpack_exports__);
  102495. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102496. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102497. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102498. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102499. // Imports
  102500. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102501. // Module
  102502. ___CSS_LOADER_EXPORT___.push([module.i, ".ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck.ck-tooltip .ck-tooltip__text{display:inline-block}.ck.ck-tooltip .ck-tooltip__text:after{content:\"\";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s;border-style:solid;left:50%}.ck.ck-tooltip.ck-tooltip_s,.ck.ck-tooltip.ck-tooltip_se,.ck.ck-tooltip.ck-tooltip_sw{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{top:calc(var(--ck-tooltip-arrow-size)*-1 + 1px);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_sw{right:50%;left:auto}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text{left:auto;right:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{left:auto;right:0}.ck.ck-tooltip.ck-tooltip_se{left:50%;right:auto}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text{right:auto;left:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after{right:auto;left:0;transform:translateX(50%)}.ck.ck-tooltip.ck-tooltip_n{top:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_e{left:calc(100% + var(--ck-tooltip-arrow-size));top:50%}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text:after{left:calc(var(--ck-tooltip-arrow-size)*-1);top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:transparent;border-bottom-color:transparent;border-right-color:var(--ck-color-tooltip-background);border-top-color:transparent;border-left-width:0;border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_w{right:calc(100% + var(--ck-tooltip-arrow-size));left:auto;top:50%}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text:after{left:100%;top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:var(--ck-color-tooltip-background);border-bottom-color:transparent;border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:0;border-top-width:var(--ck-tooltip-arrow-size)}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/tooltip/tooltip.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],"names":[],"mappings":"AAKA,sDAEC,iBAAkB,CAGlB,mBAAoB,CAIpB,kCACD,CAEA,eAEC,iBAAkB,CAClB,SAAU,CACV,YAAa,CACb,yBAWD,CATC,iCACC,oBAOD,CALC,uCACC,UAAW,CACX,OAAQ,CACR,QACD,CCxBF,MACC,2BACD,CAEA,eACC,QAAS,CAMT,KAAM,CAON,sCAwKD,CAtKC,iCChBA,eDqCA,CArBA,yGCZC,qCDiCD,CArBA,iCAGC,cAAe,CACf,eAAgB,CAChB,kCAAmC,CACnC,wDAAyD,CACzD,6CAA8C,CAC9C,iBAAkB,CAClB,SAYD,CAVC,uCAMC,sCAAuC,CACvC,kBAAmB,CACnB,QACD,CAYD,sFAGC,4CAA+C,CAC/C,0BASD,CAPC,8JAEC,+CAAkD,CAClD,0BAA6B,CAC7B,6BAAoF,CAApF,sDAAoF,CAApF,8BAAoF,CAApF,4BAAoF,CACpF,8CAAsG,CAAtG,gDAAsG,CAAtG,+CAAsG,CAAtG,kBACD,CAaD,6BACC,SAAU,CACV,SAWD,CATC,+CACC,SAAU,CACV,2CACD,CAEA,qDACC,SAAU,CACV,OACD,CAYD,6BACC,QAAS,CACT,UAYD,CAVC,+CACC,UAAW,CACX,0CACD,CAEA,qDACC,UAAW,CACX,MAAO,CACP,yBACD,CAYD,4BACC,yCAA4C,CAC5C,2BAQD,CANC,oDACC,4CAA+C,CAC/C,0BAA6B,CAC7B,6BAAoF,CAApF,+BAAoF,CAApF,8BAAoF,CAApF,mDAAoF,CACpF,8CAAsG,CAAtG,qBAAsG,CAAtG,+CAAsG,CAAtG,6CACD,CAUD,4BACC,8CAA+C,CAC/C,OAaD,CAXC,8CACC,MAAO,CACP,0BAQD,CANC,oDACC,0CAA6C,CAC7C,8CAAiD,CACjD,6BAAoF,CAApF,+BAAoF,CAApF,qDAAoF,CAApF,4BAAoF,CACpF,mBAAsG,CAAtG,gDAAsG,CAAtG,+CAAsG,CAAtG,6CACD,CAWF,4BACC,+CAAgD,CAChD,SAAU,CACV,OAaD,CAXC,8CACC,MAAO,CACP,0BAQD,CANC,oDACC,SAAU,CACV,8CAAiD,CACjD,oDAAoF,CAApF,+BAAoF,CAApF,8BAAoF,CAApF,4BAAoF,CACpF,8CAAsG,CAAtG,gDAAsG,CAAtG,oBAAsG,CAAtG,6CACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-tooltip,\n.ck.ck-tooltip .ck-tooltip__text::after {\n\tposition: absolute;\n\n\t/* Without this, hovering the tooltip could keep it visible. */\n\tpointer-events: none;\n\n\t/* This is to get rid of flickering when transitioning opacity in Chrome.\n\tIt's weird but it works. */\n\t-webkit-backface-visibility: hidden;\n}\n\n.ck.ck-tooltip {\n\t/* Tooltip is hidden by default. */\n\tvisibility: hidden;\n\topacity: 0;\n\tdisplay: none;\n\tz-index: var(--ck-z-modal);\n\n\t& .ck-tooltip__text {\n\t\tdisplay: inline-block;\n\n\t\t&::after {\n\t\t\tcontent: \"\";\n\t\t\twidth: 0;\n\t\t\theight: 0;\n\t\t}\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../../../mixins/_rounded.css\";\n\n:root {\n\t--ck-tooltip-arrow-size: 5px;\n}\n\n.ck.ck-tooltip {\n\tleft: 50%;\n\n\t/*\n\t * Prevent blurry tooltips in LoDPI environments.\n\t * See https://github.com/ckeditor/ckeditor5/issues/1802.\n\t */\n\ttop: 0;\n\n\t/*\n\t * For the transition to work, the tooltip must be controlled\n\t * using visibility+opacity. A delay prevents a \"tooltip avalanche\"\n\t * i.e. when scanning the toolbar with mouse cursor.\n\t */\n\ttransition: opacity .2s ease-in-out .2s;\n\n\t& .ck-tooltip__text {\n\t\t@mixin ck-rounded-corners;\n\n\t\tfont-size: .9em;\n\t\tline-height: 1.5;\n\t\tcolor: var(--ck-color-tooltip-text);\n\t\tpadding: var(--ck-spacing-small) var(--ck-spacing-medium);\n\t\tbackground: var(--ck-color-tooltip-background);\n\t\tposition: relative;\n\t\tleft: -50%;\n\n\t\t&::after {\n\t\t\t/*\n\t\t\t * For the transition to work, the tooltip must be controlled\n\t\t\t * using visibility+opacity. A delay prevents a \"tooltip avalanche\"\n\t\t\t * i.e. when scanning the toolbar with mouse cursor.\n\t\t\t */\n\t\t\ttransition: opacity .2s ease-in-out .2s;\n\t\t\tborder-style: solid;\n\t\t\tleft: 50%;\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip south of the element.\n\t *\n\t * [element]\n\t * ^\n\t * +-----------+\n\t * | Tooltip |\n\t * +-----------+\n\t */\n\t&.ck-tooltip_s,\n\t&.ck-tooltip_sw,\n\t&.ck-tooltip_se {\n\t\tbottom: calc(-1 * var(--ck-tooltip-arrow-size));\n\t\ttransform: translateY( 100% );\n\n\t\t& .ck-tooltip__text::after {\n\t\t\t/* 1px addresses gliches in rendering causing gap between the triangle and the text */\n\t\t\ttop: calc(-1 * var(--ck-tooltip-arrow-size) + 1px);\n\t\t\ttransform: translateX( -50% );\n\t\t\tborder-color: transparent transparent var(--ck-color-tooltip-background) transparent;\n\t\t\tborder-width: 0 var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size);\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip south-west of the element.\n\t *\n\t * [element]\n\t * ^\n\t * +-----------+\n\t * | Tooltip |\n\t * +-----------+\n\t */\n\n\t&.ck-tooltip_sw {\n\t\tright: 50%;\n\t\tleft: auto;\n\n\t\t& .ck-tooltip__text {\n\t\t\tleft: auto;\n\t\t\tright: calc( -2 * var(--ck-tooltip-arrow-size));\n\t\t}\n\n\t\t& .ck-tooltip__text::after {\n\t\t\tleft: auto;\n\t\t\tright: 0;\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip south-east of the element.\n\t *\n\t * [element]\n\t * ^\n\t * +-----------+\n\t * | Tooltip |\n\t * +-----------+\n\t */\n\t&.ck-tooltip_se {\n\t\tleft: 50%;\n\t\tright: auto;\n\n\t\t& .ck-tooltip__text {\n\t\t\tright: auto;\n\t\t\tleft: calc( -2 * var(--ck-tooltip-arrow-size));\n\t\t}\n\n\t\t& .ck-tooltip__text::after {\n\t\t\tright: auto;\n\t\t\tleft: 0;\n\t\t\ttransform: translateX( 50% );\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip north of the element.\n\t *\n\t * +-----------+\n\t * | Tooltip |\n\t * +-----------+\n\t * V\n\t * [element]\n\t */\n\t&.ck-tooltip_n {\n\t\ttop: calc(-1 * var(--ck-tooltip-arrow-size));\n\t\ttransform: translateY( -100% );\n\n\t\t& .ck-tooltip__text::after {\n\t\t\tbottom: calc(-1 * var(--ck-tooltip-arrow-size));\n\t\t\ttransform: translateX( -50% );\n\t\t\tborder-color: var(--ck-color-tooltip-background) transparent transparent transparent;\n\t\t\tborder-width: var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) 0 var(--ck-tooltip-arrow-size);\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip east of the element.\n\t *\n\t * +----------+\n\t * [element] < | east |\n\t * +----------+\n\t */\n\t&.ck-tooltip_e {\n\t\tleft: calc(100% + var(--ck-tooltip-arrow-size));\n\t\ttop: 50%;\n\n\t\t& .ck-tooltip__text {\n\t\t\tleft: 0;\n\t\t\ttransform: translateY( -50% );\n\n\t\t\t&::after {\n\t\t\t\tleft: calc(-1 * var(--ck-tooltip-arrow-size));\n\t\t\t\ttop: calc(50% - 1 * var(--ck-tooltip-arrow-size));\n\t\t\t\tborder-color: transparent var(--ck-color-tooltip-background) transparent transparent;\n\t\t\t\tborder-width: var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip west of the element.\n\t *\n\t * +----------+\n\t * | west | > [element]\n\t * +----------+\n\t */\n\t&.ck-tooltip_w {\n\t\tright: calc(100% + var(--ck-tooltip-arrow-size));\n\t\tleft: auto;\n\t\ttop: 50%;\n\n\t\t& .ck-tooltip__text {\n\t\t\tleft: 0;\n\t\t\ttransform: translateY( -50% );\n\n\t\t\t&::after {\n\t\t\t\tleft: 100%;\n\t\t\t\ttop: calc(50% - 1 * var(--ck-tooltip-arrow-size));\n\t\t\t\tborder-color: transparent transparent transparent var(--ck-color-tooltip-background);\n\t\t\t\tborder-width: var(--ck-tooltip-arrow-size) 0 var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size);\n\t\t\t}\n\t\t}\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],"sourceRoot":""}]);
  102503. // Exports
  102504. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102505. /***/ }),
  102506. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css":
  102507. /*!*****************************************************************************************************************************************************************!*\
  102508. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css ***!
  102509. \*****************************************************************************************************************************************************************/
  102510. /*! exports provided: default */
  102511. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102512. "use strict";
  102513. __webpack_require__.r(__webpack_exports__);
  102514. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102515. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102516. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102517. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102518. // Imports
  102519. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102520. // Module
  102521. ___CSS_LOADER_EXPORT___.push([module.i, ".ck-hidden{display:none!important}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{box-sizing:border-box;width:auto;height:auto;position:static}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999)}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:208,79%,51%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#bcdefb;--ck-color-focus-disabled-shadow:rgba(119,186,248,0.3);--ck-color-focus-error-shadow:rgba(255,64,31,0.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,0.15);--ck-color-shadow-drop-active:rgba(0,0,0,0.2);--ck-color-shadow-inner:rgba(0,0,0,0.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#e6e6e6;--ck-color-button-default-active-background:#d9d9d9;--ck-color-button-default-active-shadow:#bfbfbf;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#dedede;--ck-color-button-on-hover-background:#c4c4c4;--ck-color-button-on-active-background:#bababa;--ck-color-button-on-active-shadow:#a1a1a1;--ck-color-button-on-disabled-background:#dedede;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#579e3d;--ck-color-button-action-active-background:#53973b;--ck-color-button-action-active-shadow:#498433;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#b0b0b0;--ck-color-switch-button-off-hover-background:#a3a3a3;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#579e3d;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,0.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:#c7c7c7;--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:#c7c7c7;--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-base-active);--ck-color-list-button-on-background-focus:var(--ck-color-base-active-focus);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,177,255,0.1);--ck-color-link-fake-selection:rgba(31,177,255,0.3);--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{margin:0;padding:0;border:0;background:transparent;text-decoration:none;vertical-align:middle;transition:none;word-wrap:break-word}.ck.ck-reset_all,.ck.ck-reset_all *{border-collapse:collapse;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);color:var(--ck-color-text);text-align:left;white-space:nowrap;cursor:auto;float:none}.ck.ck-reset_all .ck-rtl *{text-align:right}.ck.ck-reset_all iframe{vertical-align:inherit}.ck.ck-reset_all textarea{white-space:pre-wrap}.ck.ck-reset_all input[type=password],.ck.ck-reset_all input[type=text],.ck.ck-reset_all textarea{cursor:text}.ck.ck-reset_all input[type=password][disabled],.ck.ck-reset_all input[type=text][disabled],.ck.ck-reset_all textarea[disabled]{cursor:default}.ck.ck-reset_all fieldset{padding:10px;border:2px groove #dfdee3}.ck.ck-reset_all button::-moz-focus-inner{padding:0;border:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_hidden.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_reset.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_zindex.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_transition.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_colors.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_disabled.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_focus.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_fonts.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_reset.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_shadow.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_spacing.css"],"names":[],"mappings":"AAQA,WAGC,sBACD,CCPA,iDAGC,qBAAsB,CACtB,UAAW,CACX,WAAY,CACZ,eACD,CCPA,MACC,gBAAiB,CACjB,4CACD,CCAA,oDAEC,yBACD,CCNA,MACC,kCAAmD,CACnD,+BAAoD,CACpD,8BAAgD,CAChD,8BAAmD,CACnD,6BAAmD,CACnD,yBAA+C,CAC/C,8BAAmD,CACnD,oCAAuD,CACvD,6BAAkD,CAIlD,+CAAwD,CACxD,qEAA+E,CAC/E,qCAAwD,CACxD,sDAA8D,CAC9D,iDAAyD,CACzD,yCAAqD,CACrD,uCAAsD,CACtD,6CAA0D,CAC1D,uCAAsD,CAItD,gDAAuD,CACvD,kDAA+D,CAC/D,mDAAgE,CAChE,+CAA6D,CAC7D,yDAA8D,CAE9D,uCAAuD,CACvD,6CAA4D,CAC5D,8CAA4D,CAC5D,0CAAyD,CACzD,gDAA8D,CAE9D,+DAAsE,CACtE,iDAAkE,CAClE,kDAAkE,CAClE,8CAA+D,CAC/D,oDAAoE,CACpE,6DAAsE,CAEtE,8BAAoD,CACpD,gCAAqD,CAErD,+CAA4D,CAC5D,qDAAiE,CACjE,+EAAqF,CACrF,oDAAmE,CACnE,yEAA8E,CAC9E,qDAAgE,CAIhE,oEAA2E,CAC3E,4DAAoE,CAIpE,2DAAoE,CACpE,+BAAiD,CACjD,wDAAgE,CAChE,+CAA0D,CAC1D,4CAA2D,CAC3D,wCAAwD,CACxD,sCAAsD,CAItD,0DAAmE,CACnE,uFAA6F,CAC7F,gEAAuE,CACvE,4EAAiF,CACjF,8DAAsE,CAItE,2DAAoE,CACpE,mDAA6D,CAI7D,6DAAsE,CACtE,qDAA+D,CAI/D,uDAAgE,CAChE,uDAAiE,CAIjE,0CAAyD,CAIzD,wCAA2D,CAI3D,+BAAoD,CACpD,wDAAmE,CACnE,mDAAgE,CCpGhE,wBAAyB,CCAzB,0CAA2C,CAK3C,gGAAiG,CAKjG,4GAA6G,CAK7G,sGAAuG,CAKvG,sDAAuD,CCvBvD,wBAAyB,CACzB,6BAA8B,CAC9B,wDAA6D,CAE7D,yBAA0B,CAC1B,2BAA4B,CAC5B,yBAA0B,CAC1B,wBAAyB,CACzB,0BAA2B,CCJ3B,kCJoGD,CI9FA,iDAIC,QAAS,CACT,SAAU,CACV,QAAS,CACT,sBAAuB,CACvB,oBAAqB,CACrB,qBAAsB,CACtB,eAAgB,CAGhB,oBACD,CAKA,oCAGC,wBAAyB,CACzB,iGAAkG,CAClG,0BAA2B,CAC3B,eAAgB,CAChB,kBAAmB,CACnB,WAAY,CACZ,UACD,CAGC,2BACC,gBACD,CAEA,wBAEC,sBACD,CAEA,0BACC,oBACD,CAEA,kGAGC,WACD,CAEA,gIAGC,cACD,CAEA,0BACC,YAAa,CACb,yBACD,CAEA,0CAEC,SAAU,CACV,QACD,CAMD,8BAEC,gBACD,CCnFA,MACC,sBAAuB,CCAvB,gEAAiE,CAKjE,0DAA2D,CAK3D,wEAAyE,CCbzE,uBAA8B,CAC9B,mDAA2D,CAC3D,4CAAkD,CAClD,oDAA4D,CAC5D,mDAA2D,CAC3D,kDAA2D,CAC3D,yDFFD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A class which hides an element in DOM.\n */\n.ck-hidden {\n\t/* Override selector specificity. Otherwise, all elements with some display\n\tstyle defined will override this one, which is not a desired result. */\n\tdisplay: none !important;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-reset,\n.ck.ck-reset_all,\n.ck.ck-reset_all * {\n\tbox-sizing: border-box;\n\twidth: auto;\n\theight: auto;\n\tposition: static;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-z-default: 1;\n\t--ck-z-modal: calc( var(--ck-z-default) + 999 );\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A class that disables all transitions of the element and its children.\n */\n.ck-transitions-disabled,\n.ck-transitions-disabled * {\n\ttransition: none !important;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-base-foreground: \t\t\t\t\t\t\t\thsl(0, 0%, 98%);\n\t--ck-color-base-background: \t\t\t\t\t\t\t\thsl(0, 0%, 100%);\n\t--ck-color-base-border: \t\t\t\t\t\t\t\t\thsl(0, 0%, 77%);\n\t--ck-color-base-action: \t\t\t\t\t\t\t\t\thsl(104, 44%, 48%);\n\t--ck-color-base-focus: \t\t\t\t\t\t\t\t\t\thsl(209, 92%, 70%);\n\t--ck-color-base-text: \t\t\t\t\t\t\t\t\t\thsl(0, 0%, 20%);\n\t--ck-color-base-active: \t\t\t\t\t\t\t\t\thsl(208, 88%, 52%);\n\t--ck-color-base-active-focus:\t\t\t\t\t\t\t\thsl(208, 88%, 47%);\n\t--ck-color-base-error:\t\t\t\t\t\t\t\t\t\thsl(15, 100%, 43%);\n\n\t/* -- Generic colors ------------------------------------------------------------------------ */\n\n\t--ck-color-focus-border-coordinates: \t\t\t\t\t\t208, 79%, 51%;\n\t--ck-color-focus-border: \t\t\t\t\t\t\t\t\thsl(var(--ck-color-focus-border-coordinates));\n\t--ck-color-focus-outer-shadow:\t\t\t\t\t\t\t\thsl(207, 89%, 86%);\n\t--ck-color-focus-disabled-shadow:\t\t\t\t\t\t\thsla(209, 90%, 72%,.3);\n\t--ck-color-focus-error-shadow:\t\t\t\t\t\t\t\thsla(9,100%,56%,.3);\n\t--ck-color-text: \t\t\t\t\t\t\t\t\t\t\tvar(--ck-color-base-text);\n\t--ck-color-shadow-drop: \t\t\t\t\t\t\t\t\thsla(0, 0%, 0%, 0.15);\n\t--ck-color-shadow-drop-active:\t\t\t\t\t\t\t\thsla(0, 0%, 0%, 0.2);\n\t--ck-color-shadow-inner: \t\t\t\t\t\t\t\t\thsla(0, 0%, 0%, 0.1);\n\n\t/* -- Buttons ------------------------------------------------------------------------------- */\n\n\t--ck-color-button-default-background: \t\t\t\t\t\ttransparent;\n\t--ck-color-button-default-hover-background: \t\t\t\thsl(0, 0%, 90%);\n\t--ck-color-button-default-active-background: \t\t\t\thsl(0, 0%, 85%);\n\t--ck-color-button-default-active-shadow: \t\t\t\t\thsl(0, 0%, 75%);\n\t--ck-color-button-default-disabled-background: \t\t\t\ttransparent;\n\n\t--ck-color-button-on-background: \t\t\t\t\t\t\thsl(0, 0%, 87%);\n\t--ck-color-button-on-hover-background: \t\t\t\t\t\thsl(0, 0%, 77%);\n\t--ck-color-button-on-active-background: \t\t\t\t\thsl(0, 0%, 73%);\n\t--ck-color-button-on-active-shadow: \t\t\t\t\t\thsl(0, 0%, 63%);\n\t--ck-color-button-on-disabled-background: \t\t\t\t\thsl(0, 0%, 87%);\n\n\t--ck-color-button-action-background: \t\t\t\t\t\tvar(--ck-color-base-action);\n\t--ck-color-button-action-hover-background: \t\t\t\t\thsl(104, 44%, 43%);\n\t--ck-color-button-action-active-background: \t\t\t\thsl(104, 44%, 41%);\n\t--ck-color-button-action-active-shadow: \t\t\t\t\thsl(104, 44%, 36%);\n\t--ck-color-button-action-disabled-background: \t\t\t\thsl(104, 44%, 58%);\n\t--ck-color-button-action-text: \t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\n\t--ck-color-button-save: \t\t\t\t\t\t\t\t\thsl(120, 100%, 27%);\n\t--ck-color-button-cancel: \t\t\t\t\t\t\t\t\thsl(15, 100%, 43%);\n\n\t--ck-color-switch-button-off-background:\t\t\t\t\thsl(0, 0%, 69%);\n\t--ck-color-switch-button-off-hover-background:\t\t\t\thsl(0, 0%, 64%);\n\t--ck-color-switch-button-on-background:\t\t\t\t\t\tvar(--ck-color-button-action-background);\n\t--ck-color-switch-button-on-hover-background:\t\t\t\thsl(104, 44%, 43%);\n\t--ck-color-switch-button-inner-background:\t\t\t\t\tvar(--ck-color-base-background);\n\t--ck-color-switch-button-inner-shadow:\t\t\t\t\t\thsla(0, 0%, 0%, 0.1);\n\n\t/* -- Dropdown ------------------------------------------------------------------------------ */\n\n\t--ck-color-dropdown-panel-background: \t\t\t\t\t\tvar(--ck-color-base-background);\n\t--ck-color-dropdown-panel-border: \t\t\t\t\t\t\tvar(--ck-color-base-border);\n\n\t/* -- Input --------------------------------------------------------------------------------- */\n\n\t--ck-color-input-background: \t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\t--ck-color-input-border: \t\t\t\t\t\t\t\t\thsl(0, 0%, 78%);\n\t--ck-color-input-error-border:\t\t\t\t\t\t\t\tvar(--ck-color-base-error);\n\t--ck-color-input-text: \t\t\t\t\t\t\t\t\t\tvar(--ck-color-base-text);\n\t--ck-color-input-disabled-background: \t\t\t\t\t\thsl(0, 0%, 95%);\n\t--ck-color-input-disabled-border: \t\t\t\t\t\t\thsl(0, 0%, 78%);\n\t--ck-color-input-disabled-text: \t\t\t\t\t\t\thsl(0, 0%, 46%);\n\n\t/* -- List ---------------------------------------------------------------------------------- */\n\n\t--ck-color-list-background: \t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\t--ck-color-list-button-hover-background: \t\t\t\t\tvar(--ck-color-button-default-hover-background);\n\t--ck-color-list-button-on-background: \t\t\t\t\t\tvar(--ck-color-base-active);\n\t--ck-color-list-button-on-background-focus: \t\t\t\tvar(--ck-color-base-active-focus);\n\t--ck-color-list-button-on-text:\t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\n\t/* -- Panel --------------------------------------------------------------------------------- */\n\n\t--ck-color-panel-background: \t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\t--ck-color-panel-border: \t\t\t\t\t\t\t\t\tvar(--ck-color-base-border);\n\n\t/* -- Toolbar ------------------------------------------------------------------------------- */\n\n\t--ck-color-toolbar-background: \t\t\t\t\t\t\t\tvar(--ck-color-base-foreground);\n\t--ck-color-toolbar-border: \t\t\t\t\t\t\t\t\tvar(--ck-color-base-border);\n\n\t/* -- Tooltip ------------------------------------------------------------------------------- */\n\n\t--ck-color-tooltip-background: \t\t\t\t\t\t\t\tvar(--ck-color-base-text);\n\t--ck-color-tooltip-text: \t\t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\n\t/* -- Engine -------------------------------------------------------------------------------- */\n\n\t--ck-color-engine-placeholder-text: \t\t\t\t\t\thsl(0, 0%, 44%);\n\n\t/* -- Upload -------------------------------------------------------------------------------- */\n\n\t--ck-color-upload-bar-background:\t\t \t\t\t\t\thsl(209, 92%, 70%);\n\n\t/* -- Link -------------------------------------------------------------------------------- */\n\n\t--ck-color-link-default:\t\t\t\t\t\t\t\t\thsl(240, 100%, 47%);\n\t--ck-color-link-selected-background:\t\t\t\t\t\thsla(201, 100%, 56%, 0.1);\n\t--ck-color-link-fake-selection:\t\t\t\t\t\t\t\thsla(201, 100%, 56%, 0.3);\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t/**\n\t * An opacity value of disabled UI item.\n\t */\n\t--ck-disabled-opacity: .5;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t/**\n\t * The geometry of the of focused element's outer shadow.\n\t */\n\t--ck-focus-outer-shadow-geometry: 0 0 0 3px;\n\n\t/**\n\t * A visual style of focused element's outer shadow.\n\t */\n\t--ck-focus-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);\n\n\t/**\n\t * A visual style of focused element's outer shadow (when disabled).\n\t */\n\t--ck-focus-disabled-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);\n\n\t/**\n\t * A visual style of focused element's outer shadow (when has errors).\n\t */\n\t--ck-focus-error-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);\n\n\t/**\n\t * A visual style of focused element's border or outline.\n\t */\n\t--ck-focus-ring: 1px solid var(--ck-color-focus-border);\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-font-size-base: 13px;\n\t--ck-line-height-base: 1.84615;\n\t--ck-font-face: Helvetica, Arial, Tahoma, Verdana, Sans-Serif;\n\n\t--ck-font-size-tiny: 0.7em;\n\t--ck-font-size-small: 0.75em;\n\t--ck-font-size-normal: 1em;\n\t--ck-font-size-big: 1.4em;\n\t--ck-font-size-large: 1.8em;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t/* This is super-important. This is **manually** adjusted so a button without an icon\n\tis never smaller than a button with icon, additionally making sure that text-less buttons\n\tare perfect squares. The value is also shared by other components which should stay \"in-line\"\n\twith buttons. */\n\t--ck-ui-component-min-height: 2.3em;\n}\n\n/**\n * Resets an element, ignoring its children.\n */\n.ck.ck-reset,\n.ck.ck-reset_all,\n.ck.ck-reset_all * {\n\t/* Do not include inheritable rules here. */\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tbackground: transparent;\n\ttext-decoration: none;\n\tvertical-align: middle;\n\ttransition: none;\n\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/105 */\n\tword-wrap: break-word;\n}\n\n/**\n * Resets an element AND its children.\n */\n.ck.ck-reset_all,\n.ck.ck-reset_all * {\n\t/* These are rule inherited by all children elements. */\n\tborder-collapse: collapse;\n\tfont: normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);\n\tcolor: var(--ck-color-text);\n\ttext-align: left;\n\twhite-space: nowrap;\n\tcursor: auto;\n\tfloat: none;\n}\n\n.ck.ck-reset_all {\n\t& .ck-rtl * {\n\t\ttext-align: right;\n\t}\n\n\t& iframe {\n\t\t/* For IE */\n\t\tvertical-align: inherit;\n\t}\n\n\t& textarea {\n\t\twhite-space: pre-wrap;\n\t}\n\n\t& textarea,\n\t& input[type=\"text\"],\n\t& input[type=\"password\"] {\n\t\tcursor: text;\n\t}\n\n\t& textarea[disabled],\n\t& input[type=\"text\"][disabled],\n\t& input[type=\"password\"][disabled] {\n\t\tcursor: default;\n\t}\n\n\t& fieldset {\n\t\tpadding: 10px;\n\t\tborder: 2px groove hsl(255, 7%, 88%);\n\t}\n\n\t& button::-moz-focus-inner {\n\t\t/* See http://stackoverflow.com/questions/5517744/remove-extra-button-spacing-padding-in-firefox */\n\t\tpadding: 0;\n\t\tborder: 0\n\t}\n}\n\n/**\n * Default UI rules for RTL languages.\n */\n.ck[dir=\"rtl\"],\n.ck[dir=\"rtl\"] .ck {\n\ttext-align: right;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Default border-radius value.\n */\n:root{\n\t--ck-border-radius: 2px;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t/**\n\t * A visual style of element's inner shadow (i.e. input).\n\t */\n\t--ck-inner-shadow: 2px 2px 3px var(--ck-color-shadow-inner) inset;\n\n\t/**\n\t * A visual style of element's drop shadow (i.e. panel).\n\t */\n\t--ck-drop-shadow: 0 1px 2px 1px var(--ck-color-shadow-drop);\n\n\t/**\n\t * A visual style of element's active shadow (i.e. comment or suggestion).\n\t */\n\t--ck-drop-shadow-active: 0 3px 6px 1px var(--ck-color-shadow-drop-active);\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-spacing-unit: \t\t\t\t\t\t0.6em;\n\t--ck-spacing-large: \t\t\t\t\tcalc(var(--ck-spacing-unit) * 1.5);\n\t--ck-spacing-standard: \t\t\t\t\tvar(--ck-spacing-unit);\n\t--ck-spacing-medium: \t\t\t\t\tcalc(var(--ck-spacing-unit) * 0.8);\n\t--ck-spacing-small: \t\t\t\t\tcalc(var(--ck-spacing-unit) * 0.5);\n\t--ck-spacing-tiny: \t\t\t\t\t\tcalc(var(--ck-spacing-unit) * 0.3);\n\t--ck-spacing-extra-tiny: \t\t\t\tcalc(var(--ck-spacing-unit) * 0.16);\n}\n"],"sourceRoot":""}]);
  102522. // Exports
  102523. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102524. /***/ }),
  102525. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css":
  102526. /*!************************************************************************************************************************************************************!*\
  102527. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css ***!
  102528. \************************************************************************************************************************************************************/
  102529. /*! exports provided: default */
  102530. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102531. "use strict";
  102532. __webpack_require__.r(__webpack_exports__);
  102533. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102534. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102535. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102536. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102537. // Imports
  102538. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102539. // Module
  102540. ___CSS_LOADER_EXPORT___.push([module.i, ":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px;--ck-resizer-tooltip-height:calc(var(--ck-spacing-small)*2 + 10px)}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);color:var(--ck-color-resizer-tooltip-text);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);font-size:var(--ck-font-size-tiny);display:block;padding:0 var(--ck-spacing-small);height:var(--ck-resizer-tooltip-height);line-height:var(--ck-resizer-tooltip-height)}.ck .ck-size-view.ck-orientation-above-center,.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{top:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{top:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-above-center{top:calc(var(--ck-resizer-tooltip-height)*-1);left:50%;transform:translate(-50%)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-width:var(--ck-widget-outline-thickness);outline-style:solid;outline-color:transparent;transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;background-color:var(--ck-color-widget-editable-focus-background)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{padding:4px;box-sizing:border-box;background-color:transparent;opacity:0;transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;transform:translateY(-100%);left:calc(0px - var(--ck-widget-outline-thickness));top:0}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{width:var(--ck-widget-handler-icon-size);height:var(--ck-widget-handler-icon-size);color:var(--ck-color-widget-drag-handler-icon-color)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widget.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],"names":[],"mappings":"AAKA,MACC,+CAAgD,CAChD,6CAAsD,CACtD,uCAAgD,CAEhD,kDAAmD,CACnD,gCAAiC,CACjC,kEACD,CAOA,8DAEC,iBAqBD,CAnBC,4EACC,iBAOD,CALC,qFAGC,aACD,CASD,iLACC,kBACD,CAGD,kBACC,qDAAsD,CACtD,0CAA2C,CAC3C,qDAAsD,CACtD,6CAA8C,CAC9C,kCAAmC,CACnC,aAAc,CACd,iCAAkC,CAClC,uCAAwC,CACxC,4CAoCD,CAlCC,8NAKC,iBACD,CAEA,0CACC,oCAAqC,CACrC,qCACD,CAEA,2CACC,oCAAqC,CACrC,sCACD,CAEA,8CACC,uCAAwC,CACxC,sCACD,CAEA,6CACC,uCAAwC,CACxC,qCACD,CAGA,8CACC,6CAAgD,CAChD,QAAS,CACT,yBACD,CCjFD,MACC,iCAAkC,CAClC,kCAAmC,CACnC,4CAA6C,CAC7C,wCAAyC,CAEzC,wCAAiD,CACjD,sCAAkD,CAClD,2EAA4E,CAC5E,yEACD,CAEA,eACC,gDAAiD,CACjD,mBAAoB,CACpB,yBAA0B,CAC1B,6GAUD,CARC,0EAEC,6EACD,CAEA,qBACC,iDACD,CAGD,gCACC,4BAWD,CAPC,yGC/BA,YAAa,CACb,2BAA2B,CCF3B,qCAA8B,CFqC7B,iEACD,CAIA,4EACC,WAAY,CACZ,qBAAsB,CAGtB,4BAA6B,CAC7B,SAAU,CAMV,6SAG6F,CAG7F,iEAAkE,CAGlE,2BAA4B,CAC5B,mDAAoD,CACpD,KAqBD,CAnBC,qFAEC,wCAAyC,CACzC,yCAA0C,CAC1C,oDASD,CANC,kHACC,SAAU,CAGV,+DACD,CAID,wHACC,SACD,CAID,kFACC,SAAU,CACV,oDACD,CAKC,oMACC,SAAU,CACV,6CAMD,CAHC,gRACC,SACD,CAOH,qFACC,SAAU,CACV,oDACD,CAGA,gDAEC,eAkBD,CAhBC,yEAOC,iCACD,CAGC,gOAEC,gDACD,CAOD,wIAEC,mDAQD,CALE,ghBAEC,gDACD,CAKH,yKAOC,yDACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-resizer: var(--ck-color-focus-border);\n\t--ck-color-resizer-tooltip-background: hsl(0, 0%, 15%);\n\t--ck-color-resizer-tooltip-text: hsl(0, 0%, 95%);\n\n\t--ck-resizer-border-radius: var(--ck-border-radius);\n\t--ck-resizer-tooltip-offset: 10px;\n\t--ck-resizer-tooltip-height: calc(var(--ck-spacing-small) * 2 + 10px);\n}\n\n.ck .ck-widget {\n\t/* This is neccessary for type around UI to be positioned properly. */\n\tposition: relative;\n}\n\n.ck .ck-widget.ck-widget_with-selection-handle {\n\t/* Make the widget wrapper a relative positioning container for the drag handle. */\n\tposition: relative;\n\n\t& .ck-widget__selection-handle {\n\t\tposition: absolute;\n\n\t\t& .ck-icon {\n\t\t\t/* Make sure the icon in not a subject to font-size or line-height to avoid\n\t\t\tunnecessary spacing around it. */\n\t\t\tdisplay: block;\n\t\t}\n\t}\n\n\t/* Show the selection handle on mouse hover over the widget, but not for nested widgets. */\n\t&:hover > .ck-widget__selection-handle {\n\t\tvisibility: visible;\n\t}\n\n\t/* Show the selection handle when the widget is selected, but not for nested widgets. */\n\t&.ck-widget_selected > .ck-widget__selection-handle {\n\t\tvisibility: visible;\n\t}\n}\n\n.ck .ck-size-view {\n\tbackground: var(--ck-color-resizer-tooltip-background);\n\tcolor: var(--ck-color-resizer-tooltip-text);\n\tborder: 1px solid var(--ck-color-resizer-tooltip-text);\n\tborder-radius: var(--ck-resizer-border-radius);\n\tfont-size: var(--ck-font-size-tiny);\n\tdisplay: block;\n\tpadding: 0 var(--ck-spacing-small);\n\theight: var(--ck-resizer-tooltip-height);\n\tline-height: var(--ck-resizer-tooltip-height);\n\n\t&.ck-orientation-top-left,\n\t&.ck-orientation-top-right,\n\t&.ck-orientation-bottom-right,\n\t&.ck-orientation-bottom-left,\n\t&.ck-orientation-above-center {\n\t\tposition: absolute;\n\t}\n\n\t&.ck-orientation-top-left {\n\t\ttop: var(--ck-resizer-tooltip-offset);\n\t\tleft: var(--ck-resizer-tooltip-offset);\n\t}\n\n\t&.ck-orientation-top-right {\n\t\ttop: var(--ck-resizer-tooltip-offset);\n\t\tright: var(--ck-resizer-tooltip-offset);\n\t}\n\n\t&.ck-orientation-bottom-right {\n\t\tbottom: var(--ck-resizer-tooltip-offset);\n\t\tright: var(--ck-resizer-tooltip-offset);\n\t}\n\n\t&.ck-orientation-bottom-left {\n\t\tbottom: var(--ck-resizer-tooltip-offset);\n\t\tleft: var(--ck-resizer-tooltip-offset);\n\t}\n\n\t/* Class applied if the widget is too small to contain the size label */\n\t&.ck-orientation-above-center {\n\t\ttop: calc(var(--ck-resizer-tooltip-height) * -1);\n\t\tleft: 50%;\n\t\ttransform: translate(-50%);\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../mixins/_focus.css\";\n@import \"../mixins/_shadow.css\";\n\n:root {\n\t--ck-widget-outline-thickness: 3px;\n\t--ck-widget-handler-icon-size: 16px;\n\t--ck-widget-handler-animation-duration: 200ms;\n\t--ck-widget-handler-animation-curve: ease;\n\n\t--ck-color-widget-blurred-border: hsl(0, 0%, 87%);\n\t--ck-color-widget-hover-border: hsl(43, 100%, 62%);\n\t--ck-color-widget-editable-focus-background: var(--ck-color-base-background);\n\t--ck-color-widget-drag-handler-icon-color: var(--ck-color-base-background);\n}\n\n.ck .ck-widget {\n\toutline-width: var(--ck-widget-outline-thickness);\n\toutline-style: solid;\n\toutline-color: transparent;\n\ttransition: outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\n\n\t&.ck-widget_selected,\n\t&.ck-widget_selected:hover {\n\t\toutline: var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border);\n\t}\n\n\t&:hover {\n\t\toutline-color: var(--ck-color-widget-hover-border);\n\t}\n}\n\n.ck .ck-editor__nested-editable {\n\tborder: 1px solid transparent;\n\n\t/* The :focus style is applied before .ck-editor__nested-editable_focused class is rendered in the view.\n\tThese styles show a different border for a blink of an eye, so `:focus` need to have same styles applied. */\n\t&.ck-editor__nested-editable_focused,\n\t&:focus {\n\t\t@mixin ck-focus-ring;\n\t\t@mixin ck-box-shadow var(--ck-inner-shadow);\n\n\t\tbackground-color: var(--ck-color-widget-editable-focus-background);\n\t}\n}\n\n.ck .ck-widget.ck-widget_with-selection-handle {\n\t& .ck-widget__selection-handle {\n\t\tpadding: 4px;\n\t\tbox-sizing: border-box;\n\n\t\t/* Background and opacity will be animated as the handler shows up or the widget gets selected. */\n\t\tbackground-color: transparent;\n\t\topacity: 0;\n\n\t\t/* Transition:\n\t\t * background-color for the .ck-widget_selected state change,\n\t\t * visibility for hiding the handler,\n\t\t * opacity for the proper look of the icon when the handler disappears. */\n\t\ttransition:\n\t\t\tbackground-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),\n\t\t\tvisibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),\n\t\t\topacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\n\n\t\t/* Make only top corners round. */\n\t\tborder-radius: var(--ck-border-radius) var(--ck-border-radius) 0 0;\n\n\t\t/* Place the drag handler outside the widget wrapper. */\n\t\ttransform: translateY(-100%);\n\t\tleft: calc(0px - var(--ck-widget-outline-thickness));\n\t\ttop: 0;\n\n\t\t& .ck-icon {\n\t\t\t/* Make sure the dimensions of the icon are independent of the fon-size of the content. */\n\t\t\twidth: var(--ck-widget-handler-icon-size);\n\t\t\theight: var(--ck-widget-handler-icon-size);\n\t\t\tcolor: var(--ck-color-widget-drag-handler-icon-color);\n\n\t\t\t/* The \"selected\" part of the icon is invisible by default */\n\t\t\t& .ck-icon__selected-indicator {\n\t\t\t\topacity: 0;\n\n\t\t\t\t/* Note: The animation is longer on purpose. Simply feels better. */\n\t\t\t\ttransition: opacity 300ms var(--ck-widget-handler-animation-curve);\n\t\t\t}\n\t\t}\n\n\t\t/* Advertise using the look of the icon that once clicked the handler, the widget will be selected. */\n\t\t&:hover .ck-icon .ck-icon__selected-indicator {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\t/* Show the selection handler on mouse hover over the widget, but not for nested widgets. */\n\t&:hover > .ck-widget__selection-handle {\n\t\topacity: 1;\n\t\tbackground-color: var(--ck-color-widget-hover-border);\n\t}\n\n\t/* Show the selection handler when the widget is selected, but not for nested widgets. */\n\t&.ck-widget_selected,\n\t&.ck-widget_selected:hover {\n\t\t& > .ck-widget__selection-handle {\n\t\t\topacity: 1;\n\t\t\tbackground-color: var(--ck-color-focus-border);\n\n\t\t\t/* When the widget is selected, notify the user using the proper look of the icon. */\n\t\t\t& .ck-icon .ck-icon__selected-indicator {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/* In a RTL environment, align the selection handler to the right side of the widget */\n/* stylelint-disable-next-line no-descending-specificity */\n.ck[dir=\"rtl\"] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle {\n\tleft: auto;\n\tright: calc(0px - var(--ck-widget-outline-thickness));\n}\n\n/* https://github.com/ckeditor/ckeditor5/issues/6415 */\n.ck.ck-editor__editable.ck-read-only .ck-widget {\n\t/* Prevent the :hover outline from showing up because of the used outline-color transition. */\n\ttransition: none;\n\n\t&:not(.ck-widget_selected) {\n\t\t/* Disable visual effects of hover/active widget when CKEditor is in readOnly mode.\n\t\t * See: https://github.com/ckeditor/ckeditor5/issues/1261\n\t\t *\n\t\t * Leave the unit because this custom property is used in calc() by other features.\n\t\t * See: https://github.com/ckeditor/ckeditor5/issues/6775\n\t\t */\n\t\t--ck-widget-outline-thickness: 0px;\n\t}\n\n\t&.ck-widget_with-selection-handle {\n\t\t& .ck-widget__selection-handle,\n\t\t& .ck-widget__selection-handle:hover {\n\t\t\tbackground: var(--ck-color-widget-blurred-border);\n\t\t}\n\t}\n}\n\n/* Style the widget when it's selected but the editable it belongs to lost focus. */\n/* stylelint-disable-next-line no-descending-specificity */\n.ck.ck-editor__editable.ck-blurred .ck-widget {\n\t&.ck-widget_selected,\n\t&.ck-widget_selected:hover {\n\t\toutline-color: var(--ck-color-widget-blurred-border);\n\n\t\t&.ck-widget_with-selection-handle {\n\t\t\t& > .ck-widget__selection-handle,\n\t\t\t& > .ck-widget__selection-handle:hover {\n\t\t\t\tbackground: var(--ck-color-widget-blurred-border);\n\t\t\t}\n\t\t}\n\t}\n}\n\n.ck.ck-editor__editable > .ck-widget.ck-widget_with-selection-handle:first-child,\n.ck.ck-editor__editable blockquote > .ck-widget.ck-widget_with-selection-handle:first-child {\n\t/* Do not crop selection handler if a widget is a first-child in the blockquote or in the root editable.\n\tIn fact, anything with overflow: hidden.\n\thttps://github.com/ckeditor/ckeditor5-block-quote/issues/28\n\thttps://github.com/ckeditor/ckeditor5-widget/issues/44\n\thttps://github.com/ckeditor/ckeditor5-widget/issues/66 */\n\tmargin-top: calc(1em + var(--ck-widget-handler-icon-size));\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A visual style of focused element's border.\n */\n@define-mixin ck-focus-ring {\n\t/* Disable native outline. */\n\toutline: none;\n\tborder: var(--ck-focus-ring)\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],"sourceRoot":""}]);
  102541. // Exports
  102542. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102543. /***/ }),
  102544. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css":
  102545. /*!******************************************************************************************************************************************************************!*\
  102546. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css ***!
  102547. \******************************************************************************************************************************************************************/
  102548. /*! exports provided: default */
  102549. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102550. "use strict";
  102551. __webpack_require__.r(__webpack_exports__);
  102552. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102553. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102554. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102555. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102556. // Imports
  102557. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102558. // Module
  102559. ___CSS_LOADER_EXPORT___.push([module.i, ".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;position:absolute;pointer-events:none;left:0;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{position:absolute;pointer-events:all}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{width:var(--ck-resizer-size);height:var(--ck-resizer-size);background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{top:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{top:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widgetresize.css"],"names":[],"mappings":"AAKA,4BAEC,iBACD,CAEA,wBACC,YAAa,CACb,iBAAkB,CAGlB,mBAAoB,CAEpB,MAAO,CACP,KACD,CAGC,2EACC,aACD,CAGD,gCACC,iBAAkB,CAGlB,kBAWD,CATC,4IAEC,kBACD,CAEA,4IAEC,kBACD,CCpCD,MACC,sBAAuB,CAGvB,yDAAiE,CACjE,6BACD,CAEA,wBACC,yCACD,CAEA,gCACC,4BAA6B,CAC7B,6BAA8B,CAC9B,uCAAwC,CACxC,gDAA6D,CAC7D,6CAqBD,CAnBC,oEACC,4BAA6B,CAC7B,6BACD,CAEA,qEACC,4BAA6B,CAC7B,8BACD,CAEA,wEACC,+BAAgC,CAChC,8BACD,CAEA,uEACC,+BAAgC,CAChC,6BACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-widget_with-resizer {\n\t/* Make the widget wrapper a relative positioning container for the drag handle. */\n\tposition: relative;\n}\n\n.ck .ck-widget__resizer {\n\tdisplay: none;\n\tposition: absolute;\n\n\t/* The wrapper itself should not interfere with the pointer device, only the handles should. */\n\tpointer-events: none;\n\n\tleft: 0;\n\ttop: 0;\n}\n\n.ck-focused .ck-widget_with-resizer.ck-widget_selected {\n\t& > .ck-widget__resizer {\n\t\tdisplay: block;\n\t}\n}\n\n.ck .ck-widget__resizer__handle {\n\tposition: absolute;\n\n\t/* Resizers are the only UI elements that should interfere with a pointer device. */\n\tpointer-events: all;\n\n\t&.ck-widget__resizer__handle-top-left,\n\t&.ck-widget__resizer__handle-bottom-right {\n\t\tcursor: nwse-resize;\n\t}\n\n\t&.ck-widget__resizer__handle-top-right,\n\t&.ck-widget__resizer__handle-bottom-left {\n\t\tcursor: nesw-resize;\n\t}\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-resizer-size: 10px;\n\n\t/* Set the resizer with a 50% offset. */\n\t--ck-resizer-offset: calc( ( var(--ck-resizer-size) / -2 ) - 2px);\n\t--ck-resizer-border-width: 1px;\n}\n\n.ck .ck-widget__resizer {\n\toutline: 1px solid var(--ck-color-resizer);\n}\n\n.ck .ck-widget__resizer__handle {\n\twidth: var(--ck-resizer-size);\n\theight: var(--ck-resizer-size);\n\tbackground: var(--ck-color-focus-border);\n\tborder: var(--ck-resizer-border-width) solid hsl(0, 0%, 100%);\n\tborder-radius: var(--ck-resizer-border-radius);\n\n\t&.ck-widget__resizer__handle-top-left {\n\t\ttop: var(--ck-resizer-offset);\n\t\tleft: var(--ck-resizer-offset);\n\t}\n\n\t&.ck-widget__resizer__handle-top-right {\n\t\ttop: var(--ck-resizer-offset);\n\t\tright: var(--ck-resizer-offset);\n\t}\n\n\t&.ck-widget__resizer__handle-bottom-right {\n\t\tbottom: var(--ck-resizer-offset);\n\t\tright: var(--ck-resizer-offset);\n\t}\n\n\t&.ck-widget__resizer__handle-bottom-left {\n\t\tbottom: var(--ck-resizer-offset);\n\t\tleft: var(--ck-resizer-offset);\n\t}\n}\n"],"sourceRoot":""}]);
  102560. // Exports
  102561. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102562. /***/ }),
  102563. /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css":
  102564. /*!**********************************************************************************************************************************************************************!*\
  102565. !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css ***!
  102566. \**********************************************************************************************************************************************************************/
  102567. /*! exports provided: default */
  102568. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102569. "use strict";
  102570. __webpack_require__.r(__webpack_exports__);
  102571. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/cssWithMappingToString.js */ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js");
  102572. /* harmony import */ var _css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
  102573. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  102574. /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  102575. // Imports
  102576. var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a);
  102577. // Module
  102578. ___CSS_LOADER_EXPORT___.push([module.i, ".ck .ck-widget .ck-widget__type-around__button{display:block;position:absolute;overflow:hidden;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{position:absolute;top:50%;left:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{top:calc(var(--ck-widget-outline-thickness)*-0.5);left:min(10%,30px);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-0.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:\"\";display:block;position:absolute;top:1px;left:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;position:absolute;left:0;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{width:var(--ck-widget-type-around-button-size);height:var(--ck-widget-type-around-button-size);background:var(--ck-color-widget-type-around-button);border-radius:100px;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);opacity:0;pointer-events:none}.ck .ck-widget .ck-widget__type-around__button svg{width:10px;height:8px;transform:translate(-50%,-50%);transition:transform .5s ease;margin-top:1px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{width:calc(var(--ck-widget-type-around-button-size) - 2px);height:calc(var(--ck-widget-type-around-button-size) - 2px);border-radius:100px;background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3))}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{pointer-events:none;height:1px;animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;outline:1px solid hsla(0,0%,100%,.5);background:var(--ck-color-base-text)}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}", "",{"version":3,"sources":["webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widgettypearound.css"],"names":[],"mappings":"AASC,+CACC,aAAc,CACd,iBAAkB,CAClB,eAAgB,CAChB,2BAwBD,CAtBC,mDACC,iBAAkB,CAClB,OAAQ,CACR,QAAS,CACT,qCACD,CAEA,qFAEC,iDAAoD,CACpD,kBAAoB,CAEpB,0BACD,CAEA,oFAEC,oDAAuD,CACvD,mBAAqB,CAErB,yBACD,CAUA,mLACC,UAAW,CACX,aAAc,CACd,iBAAkB,CAClB,OAAQ,CACR,QAAS,CACT,qCACD,CAMD,2EACC,YAAa,CACb,iBAAkB,CAClB,MAAO,CACP,OACD,CAOA,iFACC,gDAAqD,CACrD,iDACD,CAKA,wHACC,qDAA0D,CAC1D,aACD,CAKA,uHACC,wDAA6D,CAC7D,aACD,CAoBD,mOACC,YACD,CC3GA,MACC,wCAAyC,CACzC,wEAAyE,CACzE,8EAA+E,CAC/E,2FAA4F,CAC5F,wDAAyD,CACzD,uDAAwD,CACxD,yEACD,CAgBC,+CACC,8CAA+C,CAC/C,+CAAgD,CAChD,oDAAqD,CACrD,mBAAoB,CACpB,uMAAyM,CAb1M,SAAU,CACV,mBA0DA,CA1CC,mDACC,UAAW,CACX,UAAW,CACX,8BAA+B,CAC/B,6BAA8B,CAC9B,cAgBD,CAdC,qDACC,mBAAoB,CACpB,mBAAoB,CAEpB,SAAU,CACV,qDAAsD,CACtD,kBAAmB,CACnB,oBAAqB,CACrB,qBACD,CAEA,wDACC,kBACD,CAGD,qDAIC,6DAcD,CARE,kEACC,oDACD,CAEA,8DACC,wDACD,CAUF,uKAvED,SAAU,CACV,mBAwEC,CAOD,gGACC,0DACD,CAOA,uKAEC,2DAQD,CANC,mLACC,0DAA2D,CAC3D,2DAA4D,CAC5D,mBAAoB,CACpB,uEACD,CAOD,8GACC,gBACD,CAKA,mDACC,mBAAoB,CACpB,UAAW,CACX,mFAAoF,CAMpF,oCAAwC,CACxC,oCACD,CAOC,6JAEC,yBACD,CAUA,yKACC,iDACD,CAMA,uOAlJD,SAAU,CACV,mBAmJC,CASE,0jBACC,SACD,CASF,mPACC,SACD,CASF,uHACC,aAAc,CACd,iBACD,CAYG,iRAlMF,SAAU,CACV,mBAmME,CAQH,kIACC,qEAKD,CAHC,wIACC,WACD,CAGD,4CACC,GACC,oBACD,CACA,OACC,mBACD,CACD,CAEA,gDACC,OACC,mBACD,CACA,OACC,mBACD,CACD,CAEA,8CACC,GACC,6HACD,CACA,IACC,6HACD,CACA,GACC,+HACD,CACD,CAEA,kDACC,GACC,SACD,CACA,IACC,SACD,CACA,IACC,SACD,CACA,IACC,SACD,CACA,GACC,SACD,CACD","sourcesContent":["/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-widget {\n\t/*\n\t * Styles of the type around buttons\n\t */\n\t& .ck-widget__type-around__button {\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\toverflow: hidden;\n\t\tz-index: var(--ck-z-default);\n\n\t\t& svg {\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: 50%;\n\t\t\tz-index: calc(var(--ck-z-default) + 2);\n\t\t}\n\n\t\t&.ck-widget__type-around__button_before {\n\t\t\t/* Place it in the middle of the outline */\n\t\t\ttop: calc(-0.5 * var(--ck-widget-outline-thickness));\n\t\t\tleft: min(10%, 30px);\n\n\t\t\ttransform: translateY(-50%);\n\t\t}\n\n\t\t&.ck-widget__type-around__button_after {\n\t\t\t/* Place it in the middle of the outline */\n\t\t\tbottom: calc(-0.5 * var(--ck-widget-outline-thickness));\n\t\t\tright: min(10%, 30px);\n\n\t\t\ttransform: translateY(50%);\n\t\t}\n\t}\n\n\t/*\n\t * Styles for the buttons when:\n\t * - the widget is selected,\n\t * - or the button is being hovered (regardless of the widget state).\n\t */\n\t&.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button,\n\t& > .ck-widget__type-around > .ck-widget__type-around__button:hover {\n\t\t&::after {\n\t\t\tcontent: \"\";\n\t\t\tdisplay: block;\n\t\t\tposition: absolute;\n\t\t\ttop: 1px;\n\t\t\tleft: 1px;\n\t\t\tz-index: calc(var(--ck-z-default) + 1);\n\t\t}\n\t}\n\n\t/*\n\t * Styles for the horizontal \"fake caret\" which is displayed when the user navigates using the keyboard.\n\t */\n\t& > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\n\t\tdisplay: none;\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tright: 0;\n\t}\n\n\t/*\n\t * When the widget is hovered the \"fake caret\" would normally be narrower than the\n\t * extra outline displayed around the widget. Let's extend the \"fake caret\" to match\n\t * the full width of the widget.\n\t */\n\t&:hover > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\n\t\tleft: calc( -1 * var(--ck-widget-outline-thickness) );\n\t\tright: calc( -1 * var(--ck-widget-outline-thickness) );\n\t}\n\n\t/*\n\t * Styles for the horizontal \"fake caret\" when it should be displayed before the widget (backward keyboard navigation).\n\t */\n\t&.ck-widget_type-around_show-fake-caret_before > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\n\t\ttop: calc( -1 * var(--ck-widget-outline-thickness) - 1px );\n\t\tdisplay: block;\n\t}\n\n\t/*\n\t * Styles for the horizontal \"fake caret\" when it should be displayed after the widget (forward keyboard navigation).\n\t */\n\t&.ck-widget_type-around_show-fake-caret_after > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\n\t\tbottom: calc( -1 * var(--ck-widget-outline-thickness) - 1px );\n\t\tdisplay: block;\n\t}\n}\n\n/*\n * Integration with the read-only mode of the editor.\n */\n.ck.ck-editor__editable.ck-read-only .ck-widget__type-around {\n\tdisplay: none;\n}\n\n/*\n * Integration with the restricted editing mode (feature) of the editor.\n */\n.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around {\n\tdisplay: none;\n}\n\n/*\n * Integration with the #isEnabled property of the WidgetTypeAround plugin.\n */\n.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around {\n\tdisplay: none;\n}\n","/*\n * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-widget-type-around-button-size: 20px;\n\t--ck-color-widget-type-around-button-active: var(--ck-color-focus-border);\n\t--ck-color-widget-type-around-button-hover: var(--ck-color-widget-hover-border);\n\t--ck-color-widget-type-around-button-blurred-editable: var(--ck-color-widget-blurred-border);\n\t--ck-color-widget-type-around-button-radar-start-alpha: 0;\n\t--ck-color-widget-type-around-button-radar-end-alpha: .3;\n\t--ck-color-widget-type-around-button-icon: var(--ck-color-base-background);\n}\n\n@define-mixin ck-widget-type-around-button-visible {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n@define-mixin ck-widget-type-around-button-hidden {\n\topacity: 0;\n\tpointer-events: none;\n}\n\n.ck .ck-widget {\n\t/*\n\t * Styles of the type around buttons\n\t */\n\t& .ck-widget__type-around__button {\n\t\twidth: var(--ck-widget-type-around-button-size);\n\t\theight: var(--ck-widget-type-around-button-size);\n\t\tbackground: var(--ck-color-widget-type-around-button);\n\t\tborder-radius: 100px;\n\t\ttransition: opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve), background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\n\n\t\t@mixin ck-widget-type-around-button-hidden;\n\n\t\t& svg {\n\t\t\twidth: 10px;\n\t\t\theight: 8px;\n\t\t\ttransform: translate(-50%,-50%);\n\t\t\ttransition: transform .5s ease;\n\t\t\tmargin-top: 1px;\n\n\t\t\t& * {\n\t\t\t\tstroke-dasharray: 10;\n\t\t\t\tstroke-dashoffset: 0;\n\n\t\t\t\tfill: none;\n\t\t\t\tstroke: var(--ck-color-widget-type-around-button-icon);\n\t\t\t\tstroke-width: 1.5px;\n\t\t\t\tstroke-linecap: round;\n\t\t\t\tstroke-linejoin: round;\n\t\t\t}\n\n\t\t\t& line {\n\t\t\t\tstroke-dasharray: 7;\n\t\t\t}\n\t\t}\n\n\t\t&:hover {\n\t\t\t/*\n\t\t\t * Display the \"sonar\" around the button when hovered.\n\t\t\t */\n\t\t\tanimation: ck-widget-type-around-button-sonar 1s ease infinite;\n\n\t\t\t/*\n\t\t\t * Animate active button's icon.\n\t\t\t */\n\t\t\t& svg {\n\t\t\t\t& polyline {\n\t\t\t\t\tanimation: ck-widget-type-around-arrow-dash 2s linear;\n\t\t\t\t}\n\n\t\t\t\t& line {\n\t\t\t\t\tanimation: ck-widget-type-around-arrow-tip-dash 2s linear;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/*\n\t * Show type around buttons when the widget gets selected or being hovered.\n\t */\n\t&.ck-widget_selected,\n\t&:hover {\n\t\t& > .ck-widget__type-around > .ck-widget__type-around__button {\n\t\t\t@mixin ck-widget-type-around-button-visible;\n\t\t}\n\t}\n\n\t/*\n\t * Styles for the buttons when the widget is NOT selected (but the buttons are visible\n\t * and still can be hovered).\n\t */\n\t&:not(.ck-widget_selected) > .ck-widget__type-around > .ck-widget__type-around__button {\n\t\tbackground: var(--ck-color-widget-type-around-button-hover);\n\t}\n\n\t/*\n\t * Styles for the buttons when:\n\t * - the widget is selected,\n\t * - or the button is being hovered (regardless of the widget state).\n\t */\n\t&.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button,\n\t& > .ck-widget__type-around > .ck-widget__type-around__button:hover {\n\t\tbackground: var(--ck-color-widget-type-around-button-active);\n\n\t\t&::after {\n\t\t\twidth: calc(var(--ck-widget-type-around-button-size) - 2px);\n\t\t\theight: calc(var(--ck-widget-type-around-button-size) - 2px);\n\t\t\tborder-radius: 100px;\n\t\t\tbackground: linear-gradient(135deg, hsla(0,0%,100%,0) 0%, hsla(0,0%,100%,.3) 100%);\n\t\t}\n\t}\n\n\t/*\n\t * Styles for the \"before\" button when the widget has a selection handle. Because some space\n\t * is consumed by the handle, the button must be moved slightly to the right to let it breathe.\n\t */\n\t&.ck-widget_with-selection-handle > .ck-widget__type-around > .ck-widget__type-around__button_before {\n\t\tmargin-left: 20px;\n\t}\n\n\t/*\n\t * Styles for the horizontal \"fake caret\" which is displayed when the user navigates using the keyboard.\n\t */\n\t& .ck-widget__type-around__fake-caret {\n\t\tpointer-events: none;\n\t\theight: 1px;\n\t\tanimation: ck-widget-type-around-fake-caret-pulse linear 1s infinite normal forwards;\n\n\t\t/*\n\t\t * The semi-transparent-outline+background combo improves the contrast\n\t\t * when the background underneath the fake caret is dark.\n\t\t */\n\t\toutline: solid 1px hsla(0, 0%, 100%, .5);\n\t\tbackground: var(--ck-color-base-text);\n\t}\n\n\t/*\n\t * Styles of the widget when the \"fake caret\" is blinking (e.g. upon keyboard navigation).\n\t * Despite the widget being physically selected in the model, its outline should disappear.\n\t */\n\t&.ck-widget_selected {\n\t\t&.ck-widget_type-around_show-fake-caret_before,\n\t\t&.ck-widget_type-around_show-fake-caret_after {\n\t\t\toutline-color: transparent;\n\t\t}\n\t}\n\n\t&.ck-widget_type-around_show-fake-caret_before,\n\t&.ck-widget_type-around_show-fake-caret_after {\n\t\t/*\n\t\t * When the \"fake caret\" is visible we simulate that the widget is not selected\n\t\t * (despite being physically selected), so the outline color should be for the\n\t\t * unselected widget.\n\t\t */\n\t\t&.ck-widget_selected:hover {\n\t\t\toutline-color: var(--ck-color-widget-hover-border);\n\t\t}\n\n\t\t/*\n\t\t * Styles of the type around buttons when the \"fake caret\" is blinking (e.g. upon keyboard navigation).\n\t\t * In this state, the type around buttons would collide with the fake carets so they should disappear.\n\t\t */\n\t\t& > .ck-widget__type-around > .ck-widget__type-around__button {\n\t\t\t@mixin ck-widget-type-around-button-hidden;\n\t\t}\n\n\t\t/*\n\t\t * Fake horizontal caret integration with the selection handle. When the caret is visible, simply\n\t\t * hide the handle because it intersects with the caret (and does not make much sense anyway).\n\t\t */\n\t\t&.ck-widget_with-selection-handle {\n\t\t\t&.ck-widget_selected,\n\t\t\t&.ck-widget_selected:hover {\n\t\t\t\t& > .ck-widget__selection-handle {\n\t\t\t\t\topacity: 0\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Fake horizontal caret integration with the resize UI. When the caret is visible, simply\n\t\t * hide the resize UI because it creates too much noise. It can be visible when the user\n\t\t * hovers the widget, though.\n\t\t */\n\t\t&.ck-widget_selected.ck-widget_with-resizer > .ck-widget__resizer {\n\t\t\topacity: 0\n\t\t}\n\t}\n}\n\n/*\n * Styles for the \"before\" button when the widget has a selection handle in an RTL environment.\n * The selection handler is aligned to the right side of the widget so there is no need to create\n * additional space for it next to the \"before\" button.\n */\n.ck[dir=\"rtl\"] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around > .ck-widget__type-around__button_before {\n\tmargin-left: 0;\n\tmargin-right: 20px;\n}\n\n/*\n * Hide type around buttons when the widget is selected as a child of a selected\n * nested editable (e.g. mulit-cell table selection).\n *\n * See https://github.com/ckeditor/ckeditor5/issues/7263.\n */\n.ck-editor__nested-editable.ck-editor__editable_selected {\n\t& .ck-widget {\n\t\t&.ck-widget_selected,\n\t\t&:hover {\n\t\t\t& > .ck-widget__type-around > .ck-widget__type-around__button {\n\t\t\t\t@mixin ck-widget-type-around-button-hidden;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/*\n * Styles for the buttons when the widget is selected but the user clicked outside of the editor (blurred the editor).\n */\n.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button:not(:hover) {\n\tbackground: var(--ck-color-widget-type-around-button-blurred-editable);\n\n\t& svg * {\n\t\tstroke: hsl(0,0%,60%);\n\t}\n}\n\n@keyframes ck-widget-type-around-arrow-dash {\n\t0% {\n\t\tstroke-dashoffset: 10;\n\t}\n\t20%, 100% {\n\t\tstroke-dashoffset: 0;\n\t}\n}\n\n@keyframes ck-widget-type-around-arrow-tip-dash {\n\t0%, 20% {\n\t\tstroke-dashoffset: 7;\n\t}\n\t40%, 100% {\n\t\tstroke-dashoffset: 0;\n\t}\n}\n\n@keyframes ck-widget-type-around-button-sonar {\n\t0% {\n\t\tbox-shadow: 0 0 0 0 hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-start-alpha));\n\t}\n\t50% {\n\t\tbox-shadow: 0 0 0 5px hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-end-alpha));\n\t}\n\t100% {\n\t\tbox-shadow: 0 0 0 5px hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-start-alpha));\n\t}\n}\n\n@keyframes ck-widget-type-around-fake-caret-pulse {\n\t0% {\n\t\topacity: 1;\n\t}\n\t49% {\n\t\topacity: 1;\n\t}\n\t50% {\n\t\topacity: 0;\n\t}\n\t99% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n"],"sourceRoot":""}]);
  102579. // Exports
  102580. /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
  102581. /***/ }),
  102582. /***/ "./node_modules/css-loader/dist/runtime/api.js":
  102583. /*!*****************************************************!*\
  102584. !*** ./node_modules/css-loader/dist/runtime/api.js ***!
  102585. \*****************************************************/
  102586. /*! no static exports found */
  102587. /***/ (function(module, exports, __webpack_require__) {
  102588. "use strict";
  102589. /*
  102590. MIT License http://www.opensource.org/licenses/mit-license.php
  102591. Author Tobias Koppers @sokra
  102592. */
  102593. // css base code, injected by the css-loader
  102594. // eslint-disable-next-line func-names
  102595. module.exports = function (cssWithMappingToString) {
  102596. var list = []; // return the list of modules as css string
  102597. list.toString = function toString() {
  102598. return this.map(function (item) {
  102599. var content = cssWithMappingToString(item);
  102600. if (item[2]) {
  102601. return "@media ".concat(item[2], " {").concat(content, "}");
  102602. }
  102603. return content;
  102604. }).join("");
  102605. }; // import a list of modules into the list
  102606. // eslint-disable-next-line func-names
  102607. list.i = function (modules, mediaQuery, dedupe) {
  102608. if (typeof modules === "string") {
  102609. // eslint-disable-next-line no-param-reassign
  102610. modules = [[null, modules, ""]];
  102611. }
  102612. var alreadyImportedModules = {};
  102613. if (dedupe) {
  102614. for (var i = 0; i < this.length; i++) {
  102615. // eslint-disable-next-line prefer-destructuring
  102616. var id = this[i][0];
  102617. if (id != null) {
  102618. alreadyImportedModules[id] = true;
  102619. }
  102620. }
  102621. }
  102622. for (var _i = 0; _i < modules.length; _i++) {
  102623. var item = [].concat(modules[_i]);
  102624. if (dedupe && alreadyImportedModules[item[0]]) {
  102625. // eslint-disable-next-line no-continue
  102626. continue;
  102627. }
  102628. if (mediaQuery) {
  102629. if (!item[2]) {
  102630. item[2] = mediaQuery;
  102631. } else {
  102632. item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
  102633. }
  102634. }
  102635. list.push(item);
  102636. }
  102637. };
  102638. return list;
  102639. };
  102640. /***/ }),
  102641. /***/ "./node_modules/css-loader/dist/runtime/cssWithMappingToString.js":
  102642. /*!************************************************************************!*\
  102643. !*** ./node_modules/css-loader/dist/runtime/cssWithMappingToString.js ***!
  102644. \************************************************************************/
  102645. /*! no static exports found */
  102646. /***/ (function(module, exports, __webpack_require__) {
  102647. "use strict";
  102648. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
  102649. function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  102650. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  102651. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  102652. function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; 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; }
  102653. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  102654. module.exports = function cssWithMappingToString(item) {
  102655. var _item = _slicedToArray(item, 4),
  102656. content = _item[1],
  102657. cssMapping = _item[3];
  102658. if (typeof btoa === "function") {
  102659. // eslint-disable-next-line no-undef
  102660. var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
  102661. var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
  102662. var sourceMapping = "/*# ".concat(data, " */");
  102663. var sourceURLs = cssMapping.sources.map(function (source) {
  102664. return "/*# sourceURL=".concat(cssMapping.sourceRoot || "").concat(source, " */");
  102665. });
  102666. return [content].concat(sourceURLs).concat([sourceMapping]).join("\n");
  102667. }
  102668. return [content].join("\n");
  102669. };
  102670. /***/ }),
  102671. /***/ "./node_modules/lodash-es/_DataView.js":
  102672. /*!*********************************************!*\
  102673. !*** ./node_modules/lodash-es/_DataView.js ***!
  102674. \*********************************************/
  102675. /*! exports provided: default */
  102676. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102677. "use strict";
  102678. __webpack_require__.r(__webpack_exports__);
  102679. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  102680. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  102681. /* Built-in method references that are verified to be native. */
  102682. var DataView = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'DataView');
  102683. /* harmony default export */ __webpack_exports__["default"] = (DataView);
  102684. /***/ }),
  102685. /***/ "./node_modules/lodash-es/_Hash.js":
  102686. /*!*****************************************!*\
  102687. !*** ./node_modules/lodash-es/_Hash.js ***!
  102688. \*****************************************/
  102689. /*! exports provided: default */
  102690. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102691. "use strict";
  102692. __webpack_require__.r(__webpack_exports__);
  102693. /* harmony import */ var _hashClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_hashClear.js */ "./node_modules/lodash-es/_hashClear.js");
  102694. /* harmony import */ var _hashDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hashDelete.js */ "./node_modules/lodash-es/_hashDelete.js");
  102695. /* harmony import */ var _hashGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_hashGet.js */ "./node_modules/lodash-es/_hashGet.js");
  102696. /* harmony import */ var _hashHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_hashHas.js */ "./node_modules/lodash-es/_hashHas.js");
  102697. /* harmony import */ var _hashSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_hashSet.js */ "./node_modules/lodash-es/_hashSet.js");
  102698. /**
  102699. * Creates a hash object.
  102700. *
  102701. * @private
  102702. * @constructor
  102703. * @param {Array} [entries] The key-value pairs to cache.
  102704. */
  102705. function Hash(entries) {
  102706. var index = -1,
  102707. length = entries == null ? 0 : entries.length;
  102708. this.clear();
  102709. while (++index < length) {
  102710. var entry = entries[index];
  102711. this.set(entry[0], entry[1]);
  102712. }
  102713. }
  102714. // Add methods to `Hash`.
  102715. Hash.prototype.clear = _hashClear_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  102716. Hash.prototype['delete'] = _hashDelete_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  102717. Hash.prototype.get = _hashGet_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  102718. Hash.prototype.has = _hashHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
  102719. Hash.prototype.set = _hashSet_js__WEBPACK_IMPORTED_MODULE_4__["default"];
  102720. /* harmony default export */ __webpack_exports__["default"] = (Hash);
  102721. /***/ }),
  102722. /***/ "./node_modules/lodash-es/_LazyWrapper.js":
  102723. /*!************************************************!*\
  102724. !*** ./node_modules/lodash-es/_LazyWrapper.js ***!
  102725. \************************************************/
  102726. /*! exports provided: default */
  102727. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102728. "use strict";
  102729. __webpack_require__.r(__webpack_exports__);
  102730. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  102731. /* harmony import */ var _baseLodash_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseLodash.js */ "./node_modules/lodash-es/_baseLodash.js");
  102732. /** Used as references for the maximum length and index of an array. */
  102733. var MAX_ARRAY_LENGTH = 4294967295;
  102734. /**
  102735. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  102736. *
  102737. * @private
  102738. * @constructor
  102739. * @param {*} value The value to wrap.
  102740. */
  102741. function LazyWrapper(value) {
  102742. this.__wrapped__ = value;
  102743. this.__actions__ = [];
  102744. this.__dir__ = 1;
  102745. this.__filtered__ = false;
  102746. this.__iteratees__ = [];
  102747. this.__takeCount__ = MAX_ARRAY_LENGTH;
  102748. this.__views__ = [];
  102749. }
  102750. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  102751. LazyWrapper.prototype = Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_baseLodash_js__WEBPACK_IMPORTED_MODULE_1__["default"].prototype);
  102752. LazyWrapper.prototype.constructor = LazyWrapper;
  102753. /* harmony default export */ __webpack_exports__["default"] = (LazyWrapper);
  102754. /***/ }),
  102755. /***/ "./node_modules/lodash-es/_ListCache.js":
  102756. /*!**********************************************!*\
  102757. !*** ./node_modules/lodash-es/_ListCache.js ***!
  102758. \**********************************************/
  102759. /*! exports provided: default */
  102760. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102761. "use strict";
  102762. __webpack_require__.r(__webpack_exports__);
  102763. /* harmony import */ var _listCacheClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_listCacheClear.js */ "./node_modules/lodash-es/_listCacheClear.js");
  102764. /* harmony import */ var _listCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_listCacheDelete.js */ "./node_modules/lodash-es/_listCacheDelete.js");
  102765. /* harmony import */ var _listCacheGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_listCacheGet.js */ "./node_modules/lodash-es/_listCacheGet.js");
  102766. /* harmony import */ var _listCacheHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_listCacheHas.js */ "./node_modules/lodash-es/_listCacheHas.js");
  102767. /* harmony import */ var _listCacheSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_listCacheSet.js */ "./node_modules/lodash-es/_listCacheSet.js");
  102768. /**
  102769. * Creates an list cache object.
  102770. *
  102771. * @private
  102772. * @constructor
  102773. * @param {Array} [entries] The key-value pairs to cache.
  102774. */
  102775. function ListCache(entries) {
  102776. var index = -1,
  102777. length = entries == null ? 0 : entries.length;
  102778. this.clear();
  102779. while (++index < length) {
  102780. var entry = entries[index];
  102781. this.set(entry[0], entry[1]);
  102782. }
  102783. }
  102784. // Add methods to `ListCache`.
  102785. ListCache.prototype.clear = _listCacheClear_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  102786. ListCache.prototype['delete'] = _listCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  102787. ListCache.prototype.get = _listCacheGet_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  102788. ListCache.prototype.has = _listCacheHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
  102789. ListCache.prototype.set = _listCacheSet_js__WEBPACK_IMPORTED_MODULE_4__["default"];
  102790. /* harmony default export */ __webpack_exports__["default"] = (ListCache);
  102791. /***/ }),
  102792. /***/ "./node_modules/lodash-es/_LodashWrapper.js":
  102793. /*!**************************************************!*\
  102794. !*** ./node_modules/lodash-es/_LodashWrapper.js ***!
  102795. \**************************************************/
  102796. /*! exports provided: default */
  102797. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102798. "use strict";
  102799. __webpack_require__.r(__webpack_exports__);
  102800. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  102801. /* harmony import */ var _baseLodash_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseLodash.js */ "./node_modules/lodash-es/_baseLodash.js");
  102802. /**
  102803. * The base constructor for creating `lodash` wrapper objects.
  102804. *
  102805. * @private
  102806. * @param {*} value The value to wrap.
  102807. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  102808. */
  102809. function LodashWrapper(value, chainAll) {
  102810. this.__wrapped__ = value;
  102811. this.__actions__ = [];
  102812. this.__chain__ = !!chainAll;
  102813. this.__index__ = 0;
  102814. this.__values__ = undefined;
  102815. }
  102816. LodashWrapper.prototype = Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_baseLodash_js__WEBPACK_IMPORTED_MODULE_1__["default"].prototype);
  102817. LodashWrapper.prototype.constructor = LodashWrapper;
  102818. /* harmony default export */ __webpack_exports__["default"] = (LodashWrapper);
  102819. /***/ }),
  102820. /***/ "./node_modules/lodash-es/_Map.js":
  102821. /*!****************************************!*\
  102822. !*** ./node_modules/lodash-es/_Map.js ***!
  102823. \****************************************/
  102824. /*! exports provided: default */
  102825. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102826. "use strict";
  102827. __webpack_require__.r(__webpack_exports__);
  102828. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  102829. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  102830. /* Built-in method references that are verified to be native. */
  102831. var Map = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'Map');
  102832. /* harmony default export */ __webpack_exports__["default"] = (Map);
  102833. /***/ }),
  102834. /***/ "./node_modules/lodash-es/_MapCache.js":
  102835. /*!*********************************************!*\
  102836. !*** ./node_modules/lodash-es/_MapCache.js ***!
  102837. \*********************************************/
  102838. /*! exports provided: default */
  102839. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102840. "use strict";
  102841. __webpack_require__.r(__webpack_exports__);
  102842. /* harmony import */ var _mapCacheClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_mapCacheClear.js */ "./node_modules/lodash-es/_mapCacheClear.js");
  102843. /* harmony import */ var _mapCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_mapCacheDelete.js */ "./node_modules/lodash-es/_mapCacheDelete.js");
  102844. /* harmony import */ var _mapCacheGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_mapCacheGet.js */ "./node_modules/lodash-es/_mapCacheGet.js");
  102845. /* harmony import */ var _mapCacheHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_mapCacheHas.js */ "./node_modules/lodash-es/_mapCacheHas.js");
  102846. /* harmony import */ var _mapCacheSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_mapCacheSet.js */ "./node_modules/lodash-es/_mapCacheSet.js");
  102847. /**
  102848. * Creates a map cache object to store key-value pairs.
  102849. *
  102850. * @private
  102851. * @constructor
  102852. * @param {Array} [entries] The key-value pairs to cache.
  102853. */
  102854. function MapCache(entries) {
  102855. var index = -1,
  102856. length = entries == null ? 0 : entries.length;
  102857. this.clear();
  102858. while (++index < length) {
  102859. var entry = entries[index];
  102860. this.set(entry[0], entry[1]);
  102861. }
  102862. }
  102863. // Add methods to `MapCache`.
  102864. MapCache.prototype.clear = _mapCacheClear_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  102865. MapCache.prototype['delete'] = _mapCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  102866. MapCache.prototype.get = _mapCacheGet_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  102867. MapCache.prototype.has = _mapCacheHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
  102868. MapCache.prototype.set = _mapCacheSet_js__WEBPACK_IMPORTED_MODULE_4__["default"];
  102869. /* harmony default export */ __webpack_exports__["default"] = (MapCache);
  102870. /***/ }),
  102871. /***/ "./node_modules/lodash-es/_Promise.js":
  102872. /*!********************************************!*\
  102873. !*** ./node_modules/lodash-es/_Promise.js ***!
  102874. \********************************************/
  102875. /*! exports provided: default */
  102876. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102877. "use strict";
  102878. __webpack_require__.r(__webpack_exports__);
  102879. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  102880. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  102881. /* Built-in method references that are verified to be native. */
  102882. var Promise = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'Promise');
  102883. /* harmony default export */ __webpack_exports__["default"] = (Promise);
  102884. /***/ }),
  102885. /***/ "./node_modules/lodash-es/_Set.js":
  102886. /*!****************************************!*\
  102887. !*** ./node_modules/lodash-es/_Set.js ***!
  102888. \****************************************/
  102889. /*! exports provided: default */
  102890. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102891. "use strict";
  102892. __webpack_require__.r(__webpack_exports__);
  102893. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  102894. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  102895. /* Built-in method references that are verified to be native. */
  102896. var Set = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'Set');
  102897. /* harmony default export */ __webpack_exports__["default"] = (Set);
  102898. /***/ }),
  102899. /***/ "./node_modules/lodash-es/_SetCache.js":
  102900. /*!*********************************************!*\
  102901. !*** ./node_modules/lodash-es/_SetCache.js ***!
  102902. \*********************************************/
  102903. /*! exports provided: default */
  102904. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102905. "use strict";
  102906. __webpack_require__.r(__webpack_exports__);
  102907. /* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_MapCache.js */ "./node_modules/lodash-es/_MapCache.js");
  102908. /* harmony import */ var _setCacheAdd_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_setCacheAdd.js */ "./node_modules/lodash-es/_setCacheAdd.js");
  102909. /* harmony import */ var _setCacheHas_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setCacheHas.js */ "./node_modules/lodash-es/_setCacheHas.js");
  102910. /**
  102911. *
  102912. * Creates an array cache object to store unique values.
  102913. *
  102914. * @private
  102915. * @constructor
  102916. * @param {Array} [values] The values to cache.
  102917. */
  102918. function SetCache(values) {
  102919. var index = -1,
  102920. length = values == null ? 0 : values.length;
  102921. this.__data__ = new _MapCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  102922. while (++index < length) {
  102923. this.add(values[index]);
  102924. }
  102925. }
  102926. // Add methods to `SetCache`.
  102927. SetCache.prototype.add = SetCache.prototype.push = _setCacheAdd_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  102928. SetCache.prototype.has = _setCacheHas_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  102929. /* harmony default export */ __webpack_exports__["default"] = (SetCache);
  102930. /***/ }),
  102931. /***/ "./node_modules/lodash-es/_Stack.js":
  102932. /*!******************************************!*\
  102933. !*** ./node_modules/lodash-es/_Stack.js ***!
  102934. \******************************************/
  102935. /*! exports provided: default */
  102936. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102937. "use strict";
  102938. __webpack_require__.r(__webpack_exports__);
  102939. /* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
  102940. /* harmony import */ var _stackClear_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stackClear.js */ "./node_modules/lodash-es/_stackClear.js");
  102941. /* harmony import */ var _stackDelete_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_stackDelete.js */ "./node_modules/lodash-es/_stackDelete.js");
  102942. /* harmony import */ var _stackGet_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_stackGet.js */ "./node_modules/lodash-es/_stackGet.js");
  102943. /* harmony import */ var _stackHas_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_stackHas.js */ "./node_modules/lodash-es/_stackHas.js");
  102944. /* harmony import */ var _stackSet_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stackSet.js */ "./node_modules/lodash-es/_stackSet.js");
  102945. /**
  102946. * Creates a stack cache object to store key-value pairs.
  102947. *
  102948. * @private
  102949. * @constructor
  102950. * @param {Array} [entries] The key-value pairs to cache.
  102951. */
  102952. function Stack(entries) {
  102953. var data = this.__data__ = new _ListCache_js__WEBPACK_IMPORTED_MODULE_0__["default"](entries);
  102954. this.size = data.size;
  102955. }
  102956. // Add methods to `Stack`.
  102957. Stack.prototype.clear = _stackClear_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  102958. Stack.prototype['delete'] = _stackDelete_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  102959. Stack.prototype.get = _stackGet_js__WEBPACK_IMPORTED_MODULE_3__["default"];
  102960. Stack.prototype.has = _stackHas_js__WEBPACK_IMPORTED_MODULE_4__["default"];
  102961. Stack.prototype.set = _stackSet_js__WEBPACK_IMPORTED_MODULE_5__["default"];
  102962. /* harmony default export */ __webpack_exports__["default"] = (Stack);
  102963. /***/ }),
  102964. /***/ "./node_modules/lodash-es/_Symbol.js":
  102965. /*!*******************************************!*\
  102966. !*** ./node_modules/lodash-es/_Symbol.js ***!
  102967. \*******************************************/
  102968. /*! exports provided: default */
  102969. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102970. "use strict";
  102971. __webpack_require__.r(__webpack_exports__);
  102972. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  102973. /** Built-in value references. */
  102974. var Symbol = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Symbol;
  102975. /* harmony default export */ __webpack_exports__["default"] = (Symbol);
  102976. /***/ }),
  102977. /***/ "./node_modules/lodash-es/_Uint8Array.js":
  102978. /*!***********************************************!*\
  102979. !*** ./node_modules/lodash-es/_Uint8Array.js ***!
  102980. \***********************************************/
  102981. /*! exports provided: default */
  102982. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102983. "use strict";
  102984. __webpack_require__.r(__webpack_exports__);
  102985. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  102986. /** Built-in value references. */
  102987. var Uint8Array = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Uint8Array;
  102988. /* harmony default export */ __webpack_exports__["default"] = (Uint8Array);
  102989. /***/ }),
  102990. /***/ "./node_modules/lodash-es/_WeakMap.js":
  102991. /*!********************************************!*\
  102992. !*** ./node_modules/lodash-es/_WeakMap.js ***!
  102993. \********************************************/
  102994. /*! exports provided: default */
  102995. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102996. "use strict";
  102997. __webpack_require__.r(__webpack_exports__);
  102998. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  102999. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  103000. /* Built-in method references that are verified to be native. */
  103001. var WeakMap = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'WeakMap');
  103002. /* harmony default export */ __webpack_exports__["default"] = (WeakMap);
  103003. /***/ }),
  103004. /***/ "./node_modules/lodash-es/_apply.js":
  103005. /*!******************************************!*\
  103006. !*** ./node_modules/lodash-es/_apply.js ***!
  103007. \******************************************/
  103008. /*! exports provided: default */
  103009. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103010. "use strict";
  103011. __webpack_require__.r(__webpack_exports__);
  103012. /**
  103013. * A faster alternative to `Function#apply`, this function invokes `func`
  103014. * with the `this` binding of `thisArg` and the arguments of `args`.
  103015. *
  103016. * @private
  103017. * @param {Function} func The function to invoke.
  103018. * @param {*} thisArg The `this` binding of `func`.
  103019. * @param {Array} args The arguments to invoke `func` with.
  103020. * @returns {*} Returns the result of `func`.
  103021. */
  103022. function apply(func, thisArg, args) {
  103023. switch (args.length) {
  103024. case 0: return func.call(thisArg);
  103025. case 1: return func.call(thisArg, args[0]);
  103026. case 2: return func.call(thisArg, args[0], args[1]);
  103027. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  103028. }
  103029. return func.apply(thisArg, args);
  103030. }
  103031. /* harmony default export */ __webpack_exports__["default"] = (apply);
  103032. /***/ }),
  103033. /***/ "./node_modules/lodash-es/_arrayAggregator.js":
  103034. /*!****************************************************!*\
  103035. !*** ./node_modules/lodash-es/_arrayAggregator.js ***!
  103036. \****************************************************/
  103037. /*! exports provided: default */
  103038. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103039. "use strict";
  103040. __webpack_require__.r(__webpack_exports__);
  103041. /**
  103042. * A specialized version of `baseAggregator` for arrays.
  103043. *
  103044. * @private
  103045. * @param {Array} [array] The array to iterate over.
  103046. * @param {Function} setter The function to set `accumulator` values.
  103047. * @param {Function} iteratee The iteratee to transform keys.
  103048. * @param {Object} accumulator The initial aggregated object.
  103049. * @returns {Function} Returns `accumulator`.
  103050. */
  103051. function arrayAggregator(array, setter, iteratee, accumulator) {
  103052. var index = -1,
  103053. length = array == null ? 0 : array.length;
  103054. while (++index < length) {
  103055. var value = array[index];
  103056. setter(accumulator, value, iteratee(value), array);
  103057. }
  103058. return accumulator;
  103059. }
  103060. /* harmony default export */ __webpack_exports__["default"] = (arrayAggregator);
  103061. /***/ }),
  103062. /***/ "./node_modules/lodash-es/_arrayEach.js":
  103063. /*!**********************************************!*\
  103064. !*** ./node_modules/lodash-es/_arrayEach.js ***!
  103065. \**********************************************/
  103066. /*! exports provided: default */
  103067. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103068. "use strict";
  103069. __webpack_require__.r(__webpack_exports__);
  103070. /**
  103071. * A specialized version of `_.forEach` for arrays without support for
  103072. * iteratee shorthands.
  103073. *
  103074. * @private
  103075. * @param {Array} [array] The array to iterate over.
  103076. * @param {Function} iteratee The function invoked per iteration.
  103077. * @returns {Array} Returns `array`.
  103078. */
  103079. function arrayEach(array, iteratee) {
  103080. var index = -1,
  103081. length = array == null ? 0 : array.length;
  103082. while (++index < length) {
  103083. if (iteratee(array[index], index, array) === false) {
  103084. break;
  103085. }
  103086. }
  103087. return array;
  103088. }
  103089. /* harmony default export */ __webpack_exports__["default"] = (arrayEach);
  103090. /***/ }),
  103091. /***/ "./node_modules/lodash-es/_arrayEachRight.js":
  103092. /*!***************************************************!*\
  103093. !*** ./node_modules/lodash-es/_arrayEachRight.js ***!
  103094. \***************************************************/
  103095. /*! exports provided: default */
  103096. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103097. "use strict";
  103098. __webpack_require__.r(__webpack_exports__);
  103099. /**
  103100. * A specialized version of `_.forEachRight` for arrays without support for
  103101. * iteratee shorthands.
  103102. *
  103103. * @private
  103104. * @param {Array} [array] The array to iterate over.
  103105. * @param {Function} iteratee The function invoked per iteration.
  103106. * @returns {Array} Returns `array`.
  103107. */
  103108. function arrayEachRight(array, iteratee) {
  103109. var length = array == null ? 0 : array.length;
  103110. while (length--) {
  103111. if (iteratee(array[length], length, array) === false) {
  103112. break;
  103113. }
  103114. }
  103115. return array;
  103116. }
  103117. /* harmony default export */ __webpack_exports__["default"] = (arrayEachRight);
  103118. /***/ }),
  103119. /***/ "./node_modules/lodash-es/_arrayEvery.js":
  103120. /*!***********************************************!*\
  103121. !*** ./node_modules/lodash-es/_arrayEvery.js ***!
  103122. \***********************************************/
  103123. /*! exports provided: default */
  103124. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103125. "use strict";
  103126. __webpack_require__.r(__webpack_exports__);
  103127. /**
  103128. * A specialized version of `_.every` for arrays without support for
  103129. * iteratee shorthands.
  103130. *
  103131. * @private
  103132. * @param {Array} [array] The array to iterate over.
  103133. * @param {Function} predicate The function invoked per iteration.
  103134. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  103135. * else `false`.
  103136. */
  103137. function arrayEvery(array, predicate) {
  103138. var index = -1,
  103139. length = array == null ? 0 : array.length;
  103140. while (++index < length) {
  103141. if (!predicate(array[index], index, array)) {
  103142. return false;
  103143. }
  103144. }
  103145. return true;
  103146. }
  103147. /* harmony default export */ __webpack_exports__["default"] = (arrayEvery);
  103148. /***/ }),
  103149. /***/ "./node_modules/lodash-es/_arrayFilter.js":
  103150. /*!************************************************!*\
  103151. !*** ./node_modules/lodash-es/_arrayFilter.js ***!
  103152. \************************************************/
  103153. /*! exports provided: default */
  103154. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103155. "use strict";
  103156. __webpack_require__.r(__webpack_exports__);
  103157. /**
  103158. * A specialized version of `_.filter` for arrays without support for
  103159. * iteratee shorthands.
  103160. *
  103161. * @private
  103162. * @param {Array} [array] The array to iterate over.
  103163. * @param {Function} predicate The function invoked per iteration.
  103164. * @returns {Array} Returns the new filtered array.
  103165. */
  103166. function arrayFilter(array, predicate) {
  103167. var index = -1,
  103168. length = array == null ? 0 : array.length,
  103169. resIndex = 0,
  103170. result = [];
  103171. while (++index < length) {
  103172. var value = array[index];
  103173. if (predicate(value, index, array)) {
  103174. result[resIndex++] = value;
  103175. }
  103176. }
  103177. return result;
  103178. }
  103179. /* harmony default export */ __webpack_exports__["default"] = (arrayFilter);
  103180. /***/ }),
  103181. /***/ "./node_modules/lodash-es/_arrayIncludes.js":
  103182. /*!**************************************************!*\
  103183. !*** ./node_modules/lodash-es/_arrayIncludes.js ***!
  103184. \**************************************************/
  103185. /*! exports provided: default */
  103186. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103187. "use strict";
  103188. __webpack_require__.r(__webpack_exports__);
  103189. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  103190. /**
  103191. * A specialized version of `_.includes` for arrays without support for
  103192. * specifying an index to search from.
  103193. *
  103194. * @private
  103195. * @param {Array} [array] The array to inspect.
  103196. * @param {*} target The value to search for.
  103197. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  103198. */
  103199. function arrayIncludes(array, value) {
  103200. var length = array == null ? 0 : array.length;
  103201. return !!length && Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, 0) > -1;
  103202. }
  103203. /* harmony default export */ __webpack_exports__["default"] = (arrayIncludes);
  103204. /***/ }),
  103205. /***/ "./node_modules/lodash-es/_arrayIncludesWith.js":
  103206. /*!******************************************************!*\
  103207. !*** ./node_modules/lodash-es/_arrayIncludesWith.js ***!
  103208. \******************************************************/
  103209. /*! exports provided: default */
  103210. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103211. "use strict";
  103212. __webpack_require__.r(__webpack_exports__);
  103213. /**
  103214. * This function is like `arrayIncludes` except that it accepts a comparator.
  103215. *
  103216. * @private
  103217. * @param {Array} [array] The array to inspect.
  103218. * @param {*} target The value to search for.
  103219. * @param {Function} comparator The comparator invoked per element.
  103220. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  103221. */
  103222. function arrayIncludesWith(array, value, comparator) {
  103223. var index = -1,
  103224. length = array == null ? 0 : array.length;
  103225. while (++index < length) {
  103226. if (comparator(value, array[index])) {
  103227. return true;
  103228. }
  103229. }
  103230. return false;
  103231. }
  103232. /* harmony default export */ __webpack_exports__["default"] = (arrayIncludesWith);
  103233. /***/ }),
  103234. /***/ "./node_modules/lodash-es/_arrayLikeKeys.js":
  103235. /*!**************************************************!*\
  103236. !*** ./node_modules/lodash-es/_arrayLikeKeys.js ***!
  103237. \**************************************************/
  103238. /*! exports provided: default */
  103239. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103240. "use strict";
  103241. __webpack_require__.r(__webpack_exports__);
  103242. /* harmony import */ var _baseTimes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseTimes.js */ "./node_modules/lodash-es/_baseTimes.js");
  103243. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  103244. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  103245. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  103246. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  103247. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  103248. /** Used for built-in method references. */
  103249. var objectProto = Object.prototype;
  103250. /** Used to check objects for own properties. */
  103251. var hasOwnProperty = objectProto.hasOwnProperty;
  103252. /**
  103253. * Creates an array of the enumerable property names of the array-like `value`.
  103254. *
  103255. * @private
  103256. * @param {*} value The value to query.
  103257. * @param {boolean} inherited Specify returning inherited property names.
  103258. * @returns {Array} Returns the array of property names.
  103259. */
  103260. function arrayLikeKeys(value, inherited) {
  103261. var isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value),
  103262. isArg = !isArr && Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value),
  103263. isBuff = !isArr && !isArg && Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value),
  103264. isType = !isArr && !isArg && !isBuff && Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value),
  103265. skipIndexes = isArr || isArg || isBuff || isType,
  103266. result = skipIndexes ? Object(_baseTimes_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value.length, String) : [],
  103267. length = result.length;
  103268. for (var key in value) {
  103269. if ((inherited || hasOwnProperty.call(value, key)) &&
  103270. !(skipIndexes && (
  103271. // Safari 9 has enumerable `arguments.length` in strict mode.
  103272. key == 'length' ||
  103273. // Node.js 0.10 has enumerable non-index properties on buffers.
  103274. (isBuff && (key == 'offset' || key == 'parent')) ||
  103275. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  103276. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  103277. // Skip index properties.
  103278. Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_4__["default"])(key, length)
  103279. ))) {
  103280. result.push(key);
  103281. }
  103282. }
  103283. return result;
  103284. }
  103285. /* harmony default export */ __webpack_exports__["default"] = (arrayLikeKeys);
  103286. /***/ }),
  103287. /***/ "./node_modules/lodash-es/_arrayMap.js":
  103288. /*!*********************************************!*\
  103289. !*** ./node_modules/lodash-es/_arrayMap.js ***!
  103290. \*********************************************/
  103291. /*! exports provided: default */
  103292. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103293. "use strict";
  103294. __webpack_require__.r(__webpack_exports__);
  103295. /**
  103296. * A specialized version of `_.map` for arrays without support for iteratee
  103297. * shorthands.
  103298. *
  103299. * @private
  103300. * @param {Array} [array] The array to iterate over.
  103301. * @param {Function} iteratee The function invoked per iteration.
  103302. * @returns {Array} Returns the new mapped array.
  103303. */
  103304. function arrayMap(array, iteratee) {
  103305. var index = -1,
  103306. length = array == null ? 0 : array.length,
  103307. result = Array(length);
  103308. while (++index < length) {
  103309. result[index] = iteratee(array[index], index, array);
  103310. }
  103311. return result;
  103312. }
  103313. /* harmony default export */ __webpack_exports__["default"] = (arrayMap);
  103314. /***/ }),
  103315. /***/ "./node_modules/lodash-es/_arrayPush.js":
  103316. /*!**********************************************!*\
  103317. !*** ./node_modules/lodash-es/_arrayPush.js ***!
  103318. \**********************************************/
  103319. /*! exports provided: default */
  103320. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103321. "use strict";
  103322. __webpack_require__.r(__webpack_exports__);
  103323. /**
  103324. * Appends the elements of `values` to `array`.
  103325. *
  103326. * @private
  103327. * @param {Array} array The array to modify.
  103328. * @param {Array} values The values to append.
  103329. * @returns {Array} Returns `array`.
  103330. */
  103331. function arrayPush(array, values) {
  103332. var index = -1,
  103333. length = values.length,
  103334. offset = array.length;
  103335. while (++index < length) {
  103336. array[offset + index] = values[index];
  103337. }
  103338. return array;
  103339. }
  103340. /* harmony default export */ __webpack_exports__["default"] = (arrayPush);
  103341. /***/ }),
  103342. /***/ "./node_modules/lodash-es/_arrayReduce.js":
  103343. /*!************************************************!*\
  103344. !*** ./node_modules/lodash-es/_arrayReduce.js ***!
  103345. \************************************************/
  103346. /*! exports provided: default */
  103347. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103348. "use strict";
  103349. __webpack_require__.r(__webpack_exports__);
  103350. /**
  103351. * A specialized version of `_.reduce` for arrays without support for
  103352. * iteratee shorthands.
  103353. *
  103354. * @private
  103355. * @param {Array} [array] The array to iterate over.
  103356. * @param {Function} iteratee The function invoked per iteration.
  103357. * @param {*} [accumulator] The initial value.
  103358. * @param {boolean} [initAccum] Specify using the first element of `array` as
  103359. * the initial value.
  103360. * @returns {*} Returns the accumulated value.
  103361. */
  103362. function arrayReduce(array, iteratee, accumulator, initAccum) {
  103363. var index = -1,
  103364. length = array == null ? 0 : array.length;
  103365. if (initAccum && length) {
  103366. accumulator = array[++index];
  103367. }
  103368. while (++index < length) {
  103369. accumulator = iteratee(accumulator, array[index], index, array);
  103370. }
  103371. return accumulator;
  103372. }
  103373. /* harmony default export */ __webpack_exports__["default"] = (arrayReduce);
  103374. /***/ }),
  103375. /***/ "./node_modules/lodash-es/_arrayReduceRight.js":
  103376. /*!*****************************************************!*\
  103377. !*** ./node_modules/lodash-es/_arrayReduceRight.js ***!
  103378. \*****************************************************/
  103379. /*! exports provided: default */
  103380. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103381. "use strict";
  103382. __webpack_require__.r(__webpack_exports__);
  103383. /**
  103384. * A specialized version of `_.reduceRight` for arrays without support for
  103385. * iteratee shorthands.
  103386. *
  103387. * @private
  103388. * @param {Array} [array] The array to iterate over.
  103389. * @param {Function} iteratee The function invoked per iteration.
  103390. * @param {*} [accumulator] The initial value.
  103391. * @param {boolean} [initAccum] Specify using the last element of `array` as
  103392. * the initial value.
  103393. * @returns {*} Returns the accumulated value.
  103394. */
  103395. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  103396. var length = array == null ? 0 : array.length;
  103397. if (initAccum && length) {
  103398. accumulator = array[--length];
  103399. }
  103400. while (length--) {
  103401. accumulator = iteratee(accumulator, array[length], length, array);
  103402. }
  103403. return accumulator;
  103404. }
  103405. /* harmony default export */ __webpack_exports__["default"] = (arrayReduceRight);
  103406. /***/ }),
  103407. /***/ "./node_modules/lodash-es/_arraySample.js":
  103408. /*!************************************************!*\
  103409. !*** ./node_modules/lodash-es/_arraySample.js ***!
  103410. \************************************************/
  103411. /*! exports provided: default */
  103412. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103413. "use strict";
  103414. __webpack_require__.r(__webpack_exports__);
  103415. /* harmony import */ var _baseRandom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRandom.js */ "./node_modules/lodash-es/_baseRandom.js");
  103416. /**
  103417. * A specialized version of `_.sample` for arrays.
  103418. *
  103419. * @private
  103420. * @param {Array} array The array to sample.
  103421. * @returns {*} Returns the random element.
  103422. */
  103423. function arraySample(array) {
  103424. var length = array.length;
  103425. return length ? array[Object(_baseRandom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(0, length - 1)] : undefined;
  103426. }
  103427. /* harmony default export */ __webpack_exports__["default"] = (arraySample);
  103428. /***/ }),
  103429. /***/ "./node_modules/lodash-es/_arraySampleSize.js":
  103430. /*!****************************************************!*\
  103431. !*** ./node_modules/lodash-es/_arraySampleSize.js ***!
  103432. \****************************************************/
  103433. /*! exports provided: default */
  103434. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103435. "use strict";
  103436. __webpack_require__.r(__webpack_exports__);
  103437. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  103438. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  103439. /* harmony import */ var _shuffleSelf_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_shuffleSelf.js */ "./node_modules/lodash-es/_shuffleSelf.js");
  103440. /**
  103441. * A specialized version of `_.sampleSize` for arrays.
  103442. *
  103443. * @private
  103444. * @param {Array} array The array to sample.
  103445. * @param {number} n The number of elements to sample.
  103446. * @returns {Array} Returns the random elements.
  103447. */
  103448. function arraySampleSize(array, n) {
  103449. return Object(_shuffleSelf_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array), Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n, 0, array.length));
  103450. }
  103451. /* harmony default export */ __webpack_exports__["default"] = (arraySampleSize);
  103452. /***/ }),
  103453. /***/ "./node_modules/lodash-es/_arrayShuffle.js":
  103454. /*!*************************************************!*\
  103455. !*** ./node_modules/lodash-es/_arrayShuffle.js ***!
  103456. \*************************************************/
  103457. /*! exports provided: default */
  103458. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103459. "use strict";
  103460. __webpack_require__.r(__webpack_exports__);
  103461. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  103462. /* harmony import */ var _shuffleSelf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_shuffleSelf.js */ "./node_modules/lodash-es/_shuffleSelf.js");
  103463. /**
  103464. * A specialized version of `_.shuffle` for arrays.
  103465. *
  103466. * @private
  103467. * @param {Array} array The array to shuffle.
  103468. * @returns {Array} Returns the new shuffled array.
  103469. */
  103470. function arrayShuffle(array) {
  103471. return Object(_shuffleSelf_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array));
  103472. }
  103473. /* harmony default export */ __webpack_exports__["default"] = (arrayShuffle);
  103474. /***/ }),
  103475. /***/ "./node_modules/lodash-es/_arraySome.js":
  103476. /*!**********************************************!*\
  103477. !*** ./node_modules/lodash-es/_arraySome.js ***!
  103478. \**********************************************/
  103479. /*! exports provided: default */
  103480. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103481. "use strict";
  103482. __webpack_require__.r(__webpack_exports__);
  103483. /**
  103484. * A specialized version of `_.some` for arrays without support for iteratee
  103485. * shorthands.
  103486. *
  103487. * @private
  103488. * @param {Array} [array] The array to iterate over.
  103489. * @param {Function} predicate The function invoked per iteration.
  103490. * @returns {boolean} Returns `true` if any element passes the predicate check,
  103491. * else `false`.
  103492. */
  103493. function arraySome(array, predicate) {
  103494. var index = -1,
  103495. length = array == null ? 0 : array.length;
  103496. while (++index < length) {
  103497. if (predicate(array[index], index, array)) {
  103498. return true;
  103499. }
  103500. }
  103501. return false;
  103502. }
  103503. /* harmony default export */ __webpack_exports__["default"] = (arraySome);
  103504. /***/ }),
  103505. /***/ "./node_modules/lodash-es/_asciiSize.js":
  103506. /*!**********************************************!*\
  103507. !*** ./node_modules/lodash-es/_asciiSize.js ***!
  103508. \**********************************************/
  103509. /*! exports provided: default */
  103510. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103511. "use strict";
  103512. __webpack_require__.r(__webpack_exports__);
  103513. /* harmony import */ var _baseProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseProperty.js */ "./node_modules/lodash-es/_baseProperty.js");
  103514. /**
  103515. * Gets the size of an ASCII `string`.
  103516. *
  103517. * @private
  103518. * @param {string} string The string inspect.
  103519. * @returns {number} Returns the string size.
  103520. */
  103521. var asciiSize = Object(_baseProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])('length');
  103522. /* harmony default export */ __webpack_exports__["default"] = (asciiSize);
  103523. /***/ }),
  103524. /***/ "./node_modules/lodash-es/_asciiToArray.js":
  103525. /*!*************************************************!*\
  103526. !*** ./node_modules/lodash-es/_asciiToArray.js ***!
  103527. \*************************************************/
  103528. /*! exports provided: default */
  103529. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103530. "use strict";
  103531. __webpack_require__.r(__webpack_exports__);
  103532. /**
  103533. * Converts an ASCII `string` to an array.
  103534. *
  103535. * @private
  103536. * @param {string} string The string to convert.
  103537. * @returns {Array} Returns the converted array.
  103538. */
  103539. function asciiToArray(string) {
  103540. return string.split('');
  103541. }
  103542. /* harmony default export */ __webpack_exports__["default"] = (asciiToArray);
  103543. /***/ }),
  103544. /***/ "./node_modules/lodash-es/_asciiWords.js":
  103545. /*!***********************************************!*\
  103546. !*** ./node_modules/lodash-es/_asciiWords.js ***!
  103547. \***********************************************/
  103548. /*! exports provided: default */
  103549. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103550. "use strict";
  103551. __webpack_require__.r(__webpack_exports__);
  103552. /** Used to match words composed of alphanumeric characters. */
  103553. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  103554. /**
  103555. * Splits an ASCII `string` into an array of its words.
  103556. *
  103557. * @private
  103558. * @param {string} The string to inspect.
  103559. * @returns {Array} Returns the words of `string`.
  103560. */
  103561. function asciiWords(string) {
  103562. return string.match(reAsciiWord) || [];
  103563. }
  103564. /* harmony default export */ __webpack_exports__["default"] = (asciiWords);
  103565. /***/ }),
  103566. /***/ "./node_modules/lodash-es/_assignMergeValue.js":
  103567. /*!*****************************************************!*\
  103568. !*** ./node_modules/lodash-es/_assignMergeValue.js ***!
  103569. \*****************************************************/
  103570. /*! exports provided: default */
  103571. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103572. "use strict";
  103573. __webpack_require__.r(__webpack_exports__);
  103574. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  103575. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  103576. /**
  103577. * This function is like `assignValue` except that it doesn't assign
  103578. * `undefined` values.
  103579. *
  103580. * @private
  103581. * @param {Object} object The object to modify.
  103582. * @param {string} key The key of the property to assign.
  103583. * @param {*} value The value to assign.
  103584. */
  103585. function assignMergeValue(object, key, value) {
  103586. if ((value !== undefined && !Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object[key], value)) ||
  103587. (value === undefined && !(key in object))) {
  103588. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, value);
  103589. }
  103590. }
  103591. /* harmony default export */ __webpack_exports__["default"] = (assignMergeValue);
  103592. /***/ }),
  103593. /***/ "./node_modules/lodash-es/_assignValue.js":
  103594. /*!************************************************!*\
  103595. !*** ./node_modules/lodash-es/_assignValue.js ***!
  103596. \************************************************/
  103597. /*! exports provided: default */
  103598. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103599. "use strict";
  103600. __webpack_require__.r(__webpack_exports__);
  103601. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  103602. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  103603. /** Used for built-in method references. */
  103604. var objectProto = Object.prototype;
  103605. /** Used to check objects for own properties. */
  103606. var hasOwnProperty = objectProto.hasOwnProperty;
  103607. /**
  103608. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  103609. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  103610. * for equality comparisons.
  103611. *
  103612. * @private
  103613. * @param {Object} object The object to modify.
  103614. * @param {string} key The key of the property to assign.
  103615. * @param {*} value The value to assign.
  103616. */
  103617. function assignValue(object, key, value) {
  103618. var objValue = object[key];
  103619. if (!(hasOwnProperty.call(object, key) && Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(objValue, value)) ||
  103620. (value === undefined && !(key in object))) {
  103621. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, value);
  103622. }
  103623. }
  103624. /* harmony default export */ __webpack_exports__["default"] = (assignValue);
  103625. /***/ }),
  103626. /***/ "./node_modules/lodash-es/_assocIndexOf.js":
  103627. /*!*************************************************!*\
  103628. !*** ./node_modules/lodash-es/_assocIndexOf.js ***!
  103629. \*************************************************/
  103630. /*! exports provided: default */
  103631. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103632. "use strict";
  103633. __webpack_require__.r(__webpack_exports__);
  103634. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  103635. /**
  103636. * Gets the index at which the `key` is found in `array` of key-value pairs.
  103637. *
  103638. * @private
  103639. * @param {Array} array The array to inspect.
  103640. * @param {*} key The key to search for.
  103641. * @returns {number} Returns the index of the matched value, else `-1`.
  103642. */
  103643. function assocIndexOf(array, key) {
  103644. var length = array.length;
  103645. while (length--) {
  103646. if (Object(_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array[length][0], key)) {
  103647. return length;
  103648. }
  103649. }
  103650. return -1;
  103651. }
  103652. /* harmony default export */ __webpack_exports__["default"] = (assocIndexOf);
  103653. /***/ }),
  103654. /***/ "./node_modules/lodash-es/_baseAggregator.js":
  103655. /*!***************************************************!*\
  103656. !*** ./node_modules/lodash-es/_baseAggregator.js ***!
  103657. \***************************************************/
  103658. /*! exports provided: default */
  103659. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103660. "use strict";
  103661. __webpack_require__.r(__webpack_exports__);
  103662. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  103663. /**
  103664. * Aggregates elements of `collection` on `accumulator` with keys transformed
  103665. * by `iteratee` and values set by `setter`.
  103666. *
  103667. * @private
  103668. * @param {Array|Object} collection The collection to iterate over.
  103669. * @param {Function} setter The function to set `accumulator` values.
  103670. * @param {Function} iteratee The iteratee to transform keys.
  103671. * @param {Object} accumulator The initial aggregated object.
  103672. * @returns {Function} Returns `accumulator`.
  103673. */
  103674. function baseAggregator(collection, setter, iteratee, accumulator) {
  103675. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, key, collection) {
  103676. setter(accumulator, value, iteratee(value), collection);
  103677. });
  103678. return accumulator;
  103679. }
  103680. /* harmony default export */ __webpack_exports__["default"] = (baseAggregator);
  103681. /***/ }),
  103682. /***/ "./node_modules/lodash-es/_baseAssign.js":
  103683. /*!***********************************************!*\
  103684. !*** ./node_modules/lodash-es/_baseAssign.js ***!
  103685. \***********************************************/
  103686. /*! exports provided: default */
  103687. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103688. "use strict";
  103689. __webpack_require__.r(__webpack_exports__);
  103690. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  103691. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  103692. /**
  103693. * The base implementation of `_.assign` without support for multiple sources
  103694. * or `customizer` functions.
  103695. *
  103696. * @private
  103697. * @param {Object} object The destination object.
  103698. * @param {Object} source The source object.
  103699. * @returns {Object} Returns `object`.
  103700. */
  103701. function baseAssign(object, source) {
  103702. return object && Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
  103703. }
  103704. /* harmony default export */ __webpack_exports__["default"] = (baseAssign);
  103705. /***/ }),
  103706. /***/ "./node_modules/lodash-es/_baseAssignIn.js":
  103707. /*!*************************************************!*\
  103708. !*** ./node_modules/lodash-es/_baseAssignIn.js ***!
  103709. \*************************************************/
  103710. /*! exports provided: default */
  103711. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103712. "use strict";
  103713. __webpack_require__.r(__webpack_exports__);
  103714. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  103715. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  103716. /**
  103717. * The base implementation of `_.assignIn` without support for multiple sources
  103718. * or `customizer` functions.
  103719. *
  103720. * @private
  103721. * @param {Object} object The destination object.
  103722. * @param {Object} source The source object.
  103723. * @returns {Object} Returns `object`.
  103724. */
  103725. function baseAssignIn(object, source) {
  103726. return object && Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
  103727. }
  103728. /* harmony default export */ __webpack_exports__["default"] = (baseAssignIn);
  103729. /***/ }),
  103730. /***/ "./node_modules/lodash-es/_baseAssignValue.js":
  103731. /*!****************************************************!*\
  103732. !*** ./node_modules/lodash-es/_baseAssignValue.js ***!
  103733. \****************************************************/
  103734. /*! exports provided: default */
  103735. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103736. "use strict";
  103737. __webpack_require__.r(__webpack_exports__);
  103738. /* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_defineProperty.js */ "./node_modules/lodash-es/_defineProperty.js");
  103739. /**
  103740. * The base implementation of `assignValue` and `assignMergeValue` without
  103741. * value checks.
  103742. *
  103743. * @private
  103744. * @param {Object} object The object to modify.
  103745. * @param {string} key The key of the property to assign.
  103746. * @param {*} value The value to assign.
  103747. */
  103748. function baseAssignValue(object, key, value) {
  103749. if (key == '__proto__' && _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  103750. Object(_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, {
  103751. 'configurable': true,
  103752. 'enumerable': true,
  103753. 'value': value,
  103754. 'writable': true
  103755. });
  103756. } else {
  103757. object[key] = value;
  103758. }
  103759. }
  103760. /* harmony default export */ __webpack_exports__["default"] = (baseAssignValue);
  103761. /***/ }),
  103762. /***/ "./node_modules/lodash-es/_baseAt.js":
  103763. /*!*******************************************!*\
  103764. !*** ./node_modules/lodash-es/_baseAt.js ***!
  103765. \*******************************************/
  103766. /*! exports provided: default */
  103767. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103768. "use strict";
  103769. __webpack_require__.r(__webpack_exports__);
  103770. /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
  103771. /**
  103772. * The base implementation of `_.at` without support for individual paths.
  103773. *
  103774. * @private
  103775. * @param {Object} object The object to iterate over.
  103776. * @param {string[]} paths The property paths to pick.
  103777. * @returns {Array} Returns the picked elements.
  103778. */
  103779. function baseAt(object, paths) {
  103780. var index = -1,
  103781. length = paths.length,
  103782. result = Array(length),
  103783. skip = object == null;
  103784. while (++index < length) {
  103785. result[index] = skip ? undefined : Object(_get_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, paths[index]);
  103786. }
  103787. return result;
  103788. }
  103789. /* harmony default export */ __webpack_exports__["default"] = (baseAt);
  103790. /***/ }),
  103791. /***/ "./node_modules/lodash-es/_baseClamp.js":
  103792. /*!**********************************************!*\
  103793. !*** ./node_modules/lodash-es/_baseClamp.js ***!
  103794. \**********************************************/
  103795. /*! exports provided: default */
  103796. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103797. "use strict";
  103798. __webpack_require__.r(__webpack_exports__);
  103799. /**
  103800. * The base implementation of `_.clamp` which doesn't coerce arguments.
  103801. *
  103802. * @private
  103803. * @param {number} number The number to clamp.
  103804. * @param {number} [lower] The lower bound.
  103805. * @param {number} upper The upper bound.
  103806. * @returns {number} Returns the clamped number.
  103807. */
  103808. function baseClamp(number, lower, upper) {
  103809. if (number === number) {
  103810. if (upper !== undefined) {
  103811. number = number <= upper ? number : upper;
  103812. }
  103813. if (lower !== undefined) {
  103814. number = number >= lower ? number : lower;
  103815. }
  103816. }
  103817. return number;
  103818. }
  103819. /* harmony default export */ __webpack_exports__["default"] = (baseClamp);
  103820. /***/ }),
  103821. /***/ "./node_modules/lodash-es/_baseClone.js":
  103822. /*!**********************************************!*\
  103823. !*** ./node_modules/lodash-es/_baseClone.js ***!
  103824. \**********************************************/
  103825. /*! exports provided: default */
  103826. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103827. "use strict";
  103828. __webpack_require__.r(__webpack_exports__);
  103829. /* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
  103830. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  103831. /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
  103832. /* harmony import */ var _baseAssign_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseAssign.js */ "./node_modules/lodash-es/_baseAssign.js");
  103833. /* harmony import */ var _baseAssignIn_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseAssignIn.js */ "./node_modules/lodash-es/_baseAssignIn.js");
  103834. /* harmony import */ var _cloneBuffer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_cloneBuffer.js */ "./node_modules/lodash-es/_cloneBuffer.js");
  103835. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  103836. /* harmony import */ var _copySymbols_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_copySymbols.js */ "./node_modules/lodash-es/_copySymbols.js");
  103837. /* harmony import */ var _copySymbolsIn_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_copySymbolsIn.js */ "./node_modules/lodash-es/_copySymbolsIn.js");
  103838. /* harmony import */ var _getAllKeys_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./_getAllKeys.js */ "./node_modules/lodash-es/_getAllKeys.js");
  103839. /* harmony import */ var _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./_getAllKeysIn.js */ "./node_modules/lodash-es/_getAllKeysIn.js");
  103840. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  103841. /* harmony import */ var _initCloneArray_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./_initCloneArray.js */ "./node_modules/lodash-es/_initCloneArray.js");
  103842. /* harmony import */ var _initCloneByTag_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./_initCloneByTag.js */ "./node_modules/lodash-es/_initCloneByTag.js");
  103843. /* harmony import */ var _initCloneObject_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./_initCloneObject.js */ "./node_modules/lodash-es/_initCloneObject.js");
  103844. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  103845. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  103846. /* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/lodash-es/isMap.js");
  103847. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  103848. /* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/lodash-es/isSet.js");
  103849. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  103850. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  103851. /** Used to compose bitmasks for cloning. */
  103852. var CLONE_DEEP_FLAG = 1,
  103853. CLONE_FLAT_FLAG = 2,
  103854. CLONE_SYMBOLS_FLAG = 4;
  103855. /** `Object#toString` result references. */
  103856. var argsTag = '[object Arguments]',
  103857. arrayTag = '[object Array]',
  103858. boolTag = '[object Boolean]',
  103859. dateTag = '[object Date]',
  103860. errorTag = '[object Error]',
  103861. funcTag = '[object Function]',
  103862. genTag = '[object GeneratorFunction]',
  103863. mapTag = '[object Map]',
  103864. numberTag = '[object Number]',
  103865. objectTag = '[object Object]',
  103866. regexpTag = '[object RegExp]',
  103867. setTag = '[object Set]',
  103868. stringTag = '[object String]',
  103869. symbolTag = '[object Symbol]',
  103870. weakMapTag = '[object WeakMap]';
  103871. var arrayBufferTag = '[object ArrayBuffer]',
  103872. dataViewTag = '[object DataView]',
  103873. float32Tag = '[object Float32Array]',
  103874. float64Tag = '[object Float64Array]',
  103875. int8Tag = '[object Int8Array]',
  103876. int16Tag = '[object Int16Array]',
  103877. int32Tag = '[object Int32Array]',
  103878. uint8Tag = '[object Uint8Array]',
  103879. uint8ClampedTag = '[object Uint8ClampedArray]',
  103880. uint16Tag = '[object Uint16Array]',
  103881. uint32Tag = '[object Uint32Array]';
  103882. /** Used to identify `toStringTag` values supported by `_.clone`. */
  103883. var cloneableTags = {};
  103884. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  103885. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  103886. cloneableTags[boolTag] = cloneableTags[dateTag] =
  103887. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  103888. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  103889. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  103890. cloneableTags[numberTag] = cloneableTags[objectTag] =
  103891. cloneableTags[regexpTag] = cloneableTags[setTag] =
  103892. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  103893. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  103894. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  103895. cloneableTags[errorTag] = cloneableTags[funcTag] =
  103896. cloneableTags[weakMapTag] = false;
  103897. /**
  103898. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  103899. * traversed objects.
  103900. *
  103901. * @private
  103902. * @param {*} value The value to clone.
  103903. * @param {boolean} bitmask The bitmask flags.
  103904. * 1 - Deep clone
  103905. * 2 - Flatten inherited properties
  103906. * 4 - Clone symbols
  103907. * @param {Function} [customizer] The function to customize cloning.
  103908. * @param {string} [key] The key of `value`.
  103909. * @param {Object} [object] The parent object of `value`.
  103910. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  103911. * @returns {*} Returns the cloned value.
  103912. */
  103913. function baseClone(value, bitmask, customizer, key, object, stack) {
  103914. var result,
  103915. isDeep = bitmask & CLONE_DEEP_FLAG,
  103916. isFlat = bitmask & CLONE_FLAT_FLAG,
  103917. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  103918. if (customizer) {
  103919. result = object ? customizer(value, key, object, stack) : customizer(value);
  103920. }
  103921. if (result !== undefined) {
  103922. return result;
  103923. }
  103924. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_18__["default"])(value)) {
  103925. return value;
  103926. }
  103927. var isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_15__["default"])(value);
  103928. if (isArr) {
  103929. result = Object(_initCloneArray_js__WEBPACK_IMPORTED_MODULE_12__["default"])(value);
  103930. if (!isDeep) {
  103931. return Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(value, result);
  103932. }
  103933. } else {
  103934. var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_11__["default"])(value),
  103935. isFunc = tag == funcTag || tag == genTag;
  103936. if (Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_16__["default"])(value)) {
  103937. return Object(_cloneBuffer_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value, isDeep);
  103938. }
  103939. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  103940. result = (isFlat || isFunc) ? {} : Object(_initCloneObject_js__WEBPACK_IMPORTED_MODULE_14__["default"])(value);
  103941. if (!isDeep) {
  103942. return isFlat
  103943. ? Object(_copySymbolsIn_js__WEBPACK_IMPORTED_MODULE_8__["default"])(value, Object(_baseAssignIn_js__WEBPACK_IMPORTED_MODULE_4__["default"])(result, value))
  103944. : Object(_copySymbols_js__WEBPACK_IMPORTED_MODULE_7__["default"])(value, Object(_baseAssign_js__WEBPACK_IMPORTED_MODULE_3__["default"])(result, value));
  103945. }
  103946. } else {
  103947. if (!cloneableTags[tag]) {
  103948. return object ? value : {};
  103949. }
  103950. result = Object(_initCloneByTag_js__WEBPACK_IMPORTED_MODULE_13__["default"])(value, tag, isDeep);
  103951. }
  103952. }
  103953. // Check for circular references and return its corresponding clone.
  103954. stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  103955. var stacked = stack.get(value);
  103956. if (stacked) {
  103957. return stacked;
  103958. }
  103959. stack.set(value, result);
  103960. if (Object(_isSet_js__WEBPACK_IMPORTED_MODULE_19__["default"])(value)) {
  103961. value.forEach(function(subValue) {
  103962. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  103963. });
  103964. } else if (Object(_isMap_js__WEBPACK_IMPORTED_MODULE_17__["default"])(value)) {
  103965. value.forEach(function(subValue, key) {
  103966. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  103967. });
  103968. }
  103969. var keysFunc = isFull
  103970. ? (isFlat ? _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_10__["default"] : _getAllKeys_js__WEBPACK_IMPORTED_MODULE_9__["default"])
  103971. : (isFlat ? _keysIn_js__WEBPACK_IMPORTED_MODULE_21__["default"] : _keys_js__WEBPACK_IMPORTED_MODULE_20__["default"]);
  103972. var props = isArr ? undefined : keysFunc(value);
  103973. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_1__["default"])(props || value, function(subValue, key) {
  103974. if (props) {
  103975. key = subValue;
  103976. subValue = value[key];
  103977. }
  103978. // Recursively populate clone (susceptible to call stack limits).
  103979. Object(_assignValue_js__WEBPACK_IMPORTED_MODULE_2__["default"])(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  103980. });
  103981. return result;
  103982. }
  103983. /* harmony default export */ __webpack_exports__["default"] = (baseClone);
  103984. /***/ }),
  103985. /***/ "./node_modules/lodash-es/_baseConforms.js":
  103986. /*!*************************************************!*\
  103987. !*** ./node_modules/lodash-es/_baseConforms.js ***!
  103988. \*************************************************/
  103989. /*! exports provided: default */
  103990. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103991. "use strict";
  103992. __webpack_require__.r(__webpack_exports__);
  103993. /* harmony import */ var _baseConformsTo_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseConformsTo.js */ "./node_modules/lodash-es/_baseConformsTo.js");
  103994. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  103995. /**
  103996. * The base implementation of `_.conforms` which doesn't clone `source`.
  103997. *
  103998. * @private
  103999. * @param {Object} source The object of property predicates to conform to.
  104000. * @returns {Function} Returns the new spec function.
  104001. */
  104002. function baseConforms(source) {
  104003. var props = Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source);
  104004. return function(object) {
  104005. return Object(_baseConformsTo_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, props);
  104006. };
  104007. }
  104008. /* harmony default export */ __webpack_exports__["default"] = (baseConforms);
  104009. /***/ }),
  104010. /***/ "./node_modules/lodash-es/_baseConformsTo.js":
  104011. /*!***************************************************!*\
  104012. !*** ./node_modules/lodash-es/_baseConformsTo.js ***!
  104013. \***************************************************/
  104014. /*! exports provided: default */
  104015. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104016. "use strict";
  104017. __webpack_require__.r(__webpack_exports__);
  104018. /**
  104019. * The base implementation of `_.conformsTo` which accepts `props` to check.
  104020. *
  104021. * @private
  104022. * @param {Object} object The object to inspect.
  104023. * @param {Object} source The object of property predicates to conform to.
  104024. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  104025. */
  104026. function baseConformsTo(object, source, props) {
  104027. var length = props.length;
  104028. if (object == null) {
  104029. return !length;
  104030. }
  104031. object = Object(object);
  104032. while (length--) {
  104033. var key = props[length],
  104034. predicate = source[key],
  104035. value = object[key];
  104036. if ((value === undefined && !(key in object)) || !predicate(value)) {
  104037. return false;
  104038. }
  104039. }
  104040. return true;
  104041. }
  104042. /* harmony default export */ __webpack_exports__["default"] = (baseConformsTo);
  104043. /***/ }),
  104044. /***/ "./node_modules/lodash-es/_baseCreate.js":
  104045. /*!***********************************************!*\
  104046. !*** ./node_modules/lodash-es/_baseCreate.js ***!
  104047. \***********************************************/
  104048. /*! exports provided: default */
  104049. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104050. "use strict";
  104051. __webpack_require__.r(__webpack_exports__);
  104052. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  104053. /** Built-in value references. */
  104054. var objectCreate = Object.create;
  104055. /**
  104056. * The base implementation of `_.create` without support for assigning
  104057. * properties to the created object.
  104058. *
  104059. * @private
  104060. * @param {Object} proto The object to inherit from.
  104061. * @returns {Object} Returns the new object.
  104062. */
  104063. var baseCreate = (function() {
  104064. function object() {}
  104065. return function(proto) {
  104066. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(proto)) {
  104067. return {};
  104068. }
  104069. if (objectCreate) {
  104070. return objectCreate(proto);
  104071. }
  104072. object.prototype = proto;
  104073. var result = new object;
  104074. object.prototype = undefined;
  104075. return result;
  104076. };
  104077. }());
  104078. /* harmony default export */ __webpack_exports__["default"] = (baseCreate);
  104079. /***/ }),
  104080. /***/ "./node_modules/lodash-es/_baseDelay.js":
  104081. /*!**********************************************!*\
  104082. !*** ./node_modules/lodash-es/_baseDelay.js ***!
  104083. \**********************************************/
  104084. /*! exports provided: default */
  104085. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104086. "use strict";
  104087. __webpack_require__.r(__webpack_exports__);
  104088. /** Error message constants. */
  104089. var FUNC_ERROR_TEXT = 'Expected a function';
  104090. /**
  104091. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  104092. * to provide to `func`.
  104093. *
  104094. * @private
  104095. * @param {Function} func The function to delay.
  104096. * @param {number} wait The number of milliseconds to delay invocation.
  104097. * @param {Array} args The arguments to provide to `func`.
  104098. * @returns {number|Object} Returns the timer id or timeout object.
  104099. */
  104100. function baseDelay(func, wait, args) {
  104101. if (typeof func != 'function') {
  104102. throw new TypeError(FUNC_ERROR_TEXT);
  104103. }
  104104. return setTimeout(function() { func.apply(undefined, args); }, wait);
  104105. }
  104106. /* harmony default export */ __webpack_exports__["default"] = (baseDelay);
  104107. /***/ }),
  104108. /***/ "./node_modules/lodash-es/_baseDifference.js":
  104109. /*!***************************************************!*\
  104110. !*** ./node_modules/lodash-es/_baseDifference.js ***!
  104111. \***************************************************/
  104112. /*! exports provided: default */
  104113. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104114. "use strict";
  104115. __webpack_require__.r(__webpack_exports__);
  104116. /* harmony import */ var _SetCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_SetCache.js */ "./node_modules/lodash-es/_SetCache.js");
  104117. /* harmony import */ var _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayIncludes.js */ "./node_modules/lodash-es/_arrayIncludes.js");
  104118. /* harmony import */ var _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arrayIncludesWith.js */ "./node_modules/lodash-es/_arrayIncludesWith.js");
  104119. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  104120. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  104121. /* harmony import */ var _cacheHas_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_cacheHas.js */ "./node_modules/lodash-es/_cacheHas.js");
  104122. /** Used as the size to enable large array optimizations. */
  104123. var LARGE_ARRAY_SIZE = 200;
  104124. /**
  104125. * The base implementation of methods like `_.difference` without support
  104126. * for excluding multiple arrays or iteratee shorthands.
  104127. *
  104128. * @private
  104129. * @param {Array} array The array to inspect.
  104130. * @param {Array} values The values to exclude.
  104131. * @param {Function} [iteratee] The iteratee invoked per element.
  104132. * @param {Function} [comparator] The comparator invoked per element.
  104133. * @returns {Array} Returns the new array of filtered values.
  104134. */
  104135. function baseDifference(array, values, iteratee, comparator) {
  104136. var index = -1,
  104137. includes = _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  104138. isCommon = true,
  104139. length = array.length,
  104140. result = [],
  104141. valuesLength = values.length;
  104142. if (!length) {
  104143. return result;
  104144. }
  104145. if (iteratee) {
  104146. values = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_3__["default"])(values, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee));
  104147. }
  104148. if (comparator) {
  104149. includes = _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  104150. isCommon = false;
  104151. }
  104152. else if (values.length >= LARGE_ARRAY_SIZE) {
  104153. includes = _cacheHas_js__WEBPACK_IMPORTED_MODULE_5__["default"];
  104154. isCommon = false;
  104155. values = new _SetCache_js__WEBPACK_IMPORTED_MODULE_0__["default"](values);
  104156. }
  104157. outer:
  104158. while (++index < length) {
  104159. var value = array[index],
  104160. computed = iteratee == null ? value : iteratee(value);
  104161. value = (comparator || value !== 0) ? value : 0;
  104162. if (isCommon && computed === computed) {
  104163. var valuesIndex = valuesLength;
  104164. while (valuesIndex--) {
  104165. if (values[valuesIndex] === computed) {
  104166. continue outer;
  104167. }
  104168. }
  104169. result.push(value);
  104170. }
  104171. else if (!includes(values, computed, comparator)) {
  104172. result.push(value);
  104173. }
  104174. }
  104175. return result;
  104176. }
  104177. /* harmony default export */ __webpack_exports__["default"] = (baseDifference);
  104178. /***/ }),
  104179. /***/ "./node_modules/lodash-es/_baseEach.js":
  104180. /*!*********************************************!*\
  104181. !*** ./node_modules/lodash-es/_baseEach.js ***!
  104182. \*********************************************/
  104183. /*! exports provided: default */
  104184. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104185. "use strict";
  104186. __webpack_require__.r(__webpack_exports__);
  104187. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  104188. /* harmony import */ var _createBaseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createBaseEach.js */ "./node_modules/lodash-es/_createBaseEach.js");
  104189. /**
  104190. * The base implementation of `_.forEach` without support for iteratee shorthands.
  104191. *
  104192. * @private
  104193. * @param {Array|Object} collection The collection to iterate over.
  104194. * @param {Function} iteratee The function invoked per iteration.
  104195. * @returns {Array|Object} Returns `collection`.
  104196. */
  104197. var baseEach = Object(_createBaseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  104198. /* harmony default export */ __webpack_exports__["default"] = (baseEach);
  104199. /***/ }),
  104200. /***/ "./node_modules/lodash-es/_baseEachRight.js":
  104201. /*!**************************************************!*\
  104202. !*** ./node_modules/lodash-es/_baseEachRight.js ***!
  104203. \**************************************************/
  104204. /*! exports provided: default */
  104205. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104206. "use strict";
  104207. __webpack_require__.r(__webpack_exports__);
  104208. /* harmony import */ var _baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwnRight.js */ "./node_modules/lodash-es/_baseForOwnRight.js");
  104209. /* harmony import */ var _createBaseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createBaseEach.js */ "./node_modules/lodash-es/_createBaseEach.js");
  104210. /**
  104211. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  104212. *
  104213. * @private
  104214. * @param {Array|Object} collection The collection to iterate over.
  104215. * @param {Function} iteratee The function invoked per iteration.
  104216. * @returns {Array|Object} Returns `collection`.
  104217. */
  104218. var baseEachRight = Object(_createBaseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_0__["default"], true);
  104219. /* harmony default export */ __webpack_exports__["default"] = (baseEachRight);
  104220. /***/ }),
  104221. /***/ "./node_modules/lodash-es/_baseEvery.js":
  104222. /*!**********************************************!*\
  104223. !*** ./node_modules/lodash-es/_baseEvery.js ***!
  104224. \**********************************************/
  104225. /*! exports provided: default */
  104226. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104227. "use strict";
  104228. __webpack_require__.r(__webpack_exports__);
  104229. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  104230. /**
  104231. * The base implementation of `_.every` without support for iteratee shorthands.
  104232. *
  104233. * @private
  104234. * @param {Array|Object} collection The collection to iterate over.
  104235. * @param {Function} predicate The function invoked per iteration.
  104236. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  104237. * else `false`
  104238. */
  104239. function baseEvery(collection, predicate) {
  104240. var result = true;
  104241. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, index, collection) {
  104242. result = !!predicate(value, index, collection);
  104243. return result;
  104244. });
  104245. return result;
  104246. }
  104247. /* harmony default export */ __webpack_exports__["default"] = (baseEvery);
  104248. /***/ }),
  104249. /***/ "./node_modules/lodash-es/_baseExtremum.js":
  104250. /*!*************************************************!*\
  104251. !*** ./node_modules/lodash-es/_baseExtremum.js ***!
  104252. \*************************************************/
  104253. /*! exports provided: default */
  104254. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104255. "use strict";
  104256. __webpack_require__.r(__webpack_exports__);
  104257. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  104258. /**
  104259. * The base implementation of methods like `_.max` and `_.min` which accepts a
  104260. * `comparator` to determine the extremum value.
  104261. *
  104262. * @private
  104263. * @param {Array} array The array to iterate over.
  104264. * @param {Function} iteratee The iteratee invoked per iteration.
  104265. * @param {Function} comparator The comparator used to compare values.
  104266. * @returns {*} Returns the extremum value.
  104267. */
  104268. function baseExtremum(array, iteratee, comparator) {
  104269. var index = -1,
  104270. length = array.length;
  104271. while (++index < length) {
  104272. var value = array[index],
  104273. current = iteratee(value);
  104274. if (current != null && (computed === undefined
  104275. ? (current === current && !Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(current))
  104276. : comparator(current, computed)
  104277. )) {
  104278. var computed = current,
  104279. result = value;
  104280. }
  104281. }
  104282. return result;
  104283. }
  104284. /* harmony default export */ __webpack_exports__["default"] = (baseExtremum);
  104285. /***/ }),
  104286. /***/ "./node_modules/lodash-es/_baseFill.js":
  104287. /*!*********************************************!*\
  104288. !*** ./node_modules/lodash-es/_baseFill.js ***!
  104289. \*********************************************/
  104290. /*! exports provided: default */
  104291. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104292. "use strict";
  104293. __webpack_require__.r(__webpack_exports__);
  104294. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  104295. /* harmony import */ var _toLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toLength.js */ "./node_modules/lodash-es/toLength.js");
  104296. /**
  104297. * The base implementation of `_.fill` without an iteratee call guard.
  104298. *
  104299. * @private
  104300. * @param {Array} array The array to fill.
  104301. * @param {*} value The value to fill `array` with.
  104302. * @param {number} [start=0] The start position.
  104303. * @param {number} [end=array.length] The end position.
  104304. * @returns {Array} Returns `array`.
  104305. */
  104306. function baseFill(array, value, start, end) {
  104307. var length = array.length;
  104308. start = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(start);
  104309. if (start < 0) {
  104310. start = -start > length ? 0 : (length + start);
  104311. }
  104312. end = (end === undefined || end > length) ? length : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(end);
  104313. if (end < 0) {
  104314. end += length;
  104315. }
  104316. end = start > end ? 0 : Object(_toLength_js__WEBPACK_IMPORTED_MODULE_1__["default"])(end);
  104317. while (start < end) {
  104318. array[start++] = value;
  104319. }
  104320. return array;
  104321. }
  104322. /* harmony default export */ __webpack_exports__["default"] = (baseFill);
  104323. /***/ }),
  104324. /***/ "./node_modules/lodash-es/_baseFilter.js":
  104325. /*!***********************************************!*\
  104326. !*** ./node_modules/lodash-es/_baseFilter.js ***!
  104327. \***********************************************/
  104328. /*! exports provided: default */
  104329. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104330. "use strict";
  104331. __webpack_require__.r(__webpack_exports__);
  104332. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  104333. /**
  104334. * The base implementation of `_.filter` without support for iteratee shorthands.
  104335. *
  104336. * @private
  104337. * @param {Array|Object} collection The collection to iterate over.
  104338. * @param {Function} predicate The function invoked per iteration.
  104339. * @returns {Array} Returns the new filtered array.
  104340. */
  104341. function baseFilter(collection, predicate) {
  104342. var result = [];
  104343. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, index, collection) {
  104344. if (predicate(value, index, collection)) {
  104345. result.push(value);
  104346. }
  104347. });
  104348. return result;
  104349. }
  104350. /* harmony default export */ __webpack_exports__["default"] = (baseFilter);
  104351. /***/ }),
  104352. /***/ "./node_modules/lodash-es/_baseFindIndex.js":
  104353. /*!**************************************************!*\
  104354. !*** ./node_modules/lodash-es/_baseFindIndex.js ***!
  104355. \**************************************************/
  104356. /*! exports provided: default */
  104357. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104358. "use strict";
  104359. __webpack_require__.r(__webpack_exports__);
  104360. /**
  104361. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  104362. * support for iteratee shorthands.
  104363. *
  104364. * @private
  104365. * @param {Array} array The array to inspect.
  104366. * @param {Function} predicate The function invoked per iteration.
  104367. * @param {number} fromIndex The index to search from.
  104368. * @param {boolean} [fromRight] Specify iterating from right to left.
  104369. * @returns {number} Returns the index of the matched value, else `-1`.
  104370. */
  104371. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  104372. var length = array.length,
  104373. index = fromIndex + (fromRight ? 1 : -1);
  104374. while ((fromRight ? index-- : ++index < length)) {
  104375. if (predicate(array[index], index, array)) {
  104376. return index;
  104377. }
  104378. }
  104379. return -1;
  104380. }
  104381. /* harmony default export */ __webpack_exports__["default"] = (baseFindIndex);
  104382. /***/ }),
  104383. /***/ "./node_modules/lodash-es/_baseFindKey.js":
  104384. /*!************************************************!*\
  104385. !*** ./node_modules/lodash-es/_baseFindKey.js ***!
  104386. \************************************************/
  104387. /*! exports provided: default */
  104388. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104389. "use strict";
  104390. __webpack_require__.r(__webpack_exports__);
  104391. /**
  104392. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  104393. * without support for iteratee shorthands, which iterates over `collection`
  104394. * using `eachFunc`.
  104395. *
  104396. * @private
  104397. * @param {Array|Object} collection The collection to inspect.
  104398. * @param {Function} predicate The function invoked per iteration.
  104399. * @param {Function} eachFunc The function to iterate over `collection`.
  104400. * @returns {*} Returns the found element or its key, else `undefined`.
  104401. */
  104402. function baseFindKey(collection, predicate, eachFunc) {
  104403. var result;
  104404. eachFunc(collection, function(value, key, collection) {
  104405. if (predicate(value, key, collection)) {
  104406. result = key;
  104407. return false;
  104408. }
  104409. });
  104410. return result;
  104411. }
  104412. /* harmony default export */ __webpack_exports__["default"] = (baseFindKey);
  104413. /***/ }),
  104414. /***/ "./node_modules/lodash-es/_baseFlatten.js":
  104415. /*!************************************************!*\
  104416. !*** ./node_modules/lodash-es/_baseFlatten.js ***!
  104417. \************************************************/
  104418. /*! exports provided: default */
  104419. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104420. "use strict";
  104421. __webpack_require__.r(__webpack_exports__);
  104422. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  104423. /* harmony import */ var _isFlattenable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isFlattenable.js */ "./node_modules/lodash-es/_isFlattenable.js");
  104424. /**
  104425. * The base implementation of `_.flatten` with support for restricting flattening.
  104426. *
  104427. * @private
  104428. * @param {Array} array The array to flatten.
  104429. * @param {number} depth The maximum recursion depth.
  104430. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  104431. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  104432. * @param {Array} [result=[]] The initial result value.
  104433. * @returns {Array} Returns the new flattened array.
  104434. */
  104435. function baseFlatten(array, depth, predicate, isStrict, result) {
  104436. var index = -1,
  104437. length = array.length;
  104438. predicate || (predicate = _isFlattenable_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  104439. result || (result = []);
  104440. while (++index < length) {
  104441. var value = array[index];
  104442. if (depth > 0 && predicate(value)) {
  104443. if (depth > 1) {
  104444. // Recursively flatten arrays (susceptible to call stack limits).
  104445. baseFlatten(value, depth - 1, predicate, isStrict, result);
  104446. } else {
  104447. Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, value);
  104448. }
  104449. } else if (!isStrict) {
  104450. result[result.length] = value;
  104451. }
  104452. }
  104453. return result;
  104454. }
  104455. /* harmony default export */ __webpack_exports__["default"] = (baseFlatten);
  104456. /***/ }),
  104457. /***/ "./node_modules/lodash-es/_baseFor.js":
  104458. /*!********************************************!*\
  104459. !*** ./node_modules/lodash-es/_baseFor.js ***!
  104460. \********************************************/
  104461. /*! exports provided: default */
  104462. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104463. "use strict";
  104464. __webpack_require__.r(__webpack_exports__);
  104465. /* harmony import */ var _createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createBaseFor.js */ "./node_modules/lodash-es/_createBaseFor.js");
  104466. /**
  104467. * The base implementation of `baseForOwn` which iterates over `object`
  104468. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  104469. * Iteratee functions may exit iteration early by explicitly returning `false`.
  104470. *
  104471. * @private
  104472. * @param {Object} object The object to iterate over.
  104473. * @param {Function} iteratee The function invoked per iteration.
  104474. * @param {Function} keysFunc The function to get the keys of `object`.
  104475. * @returns {Object} Returns `object`.
  104476. */
  104477. var baseFor = Object(_createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__["default"])();
  104478. /* harmony default export */ __webpack_exports__["default"] = (baseFor);
  104479. /***/ }),
  104480. /***/ "./node_modules/lodash-es/_baseForOwn.js":
  104481. /*!***********************************************!*\
  104482. !*** ./node_modules/lodash-es/_baseForOwn.js ***!
  104483. \***********************************************/
  104484. /*! exports provided: default */
  104485. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104486. "use strict";
  104487. __webpack_require__.r(__webpack_exports__);
  104488. /* harmony import */ var _baseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFor.js */ "./node_modules/lodash-es/_baseFor.js");
  104489. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  104490. /**
  104491. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  104492. *
  104493. * @private
  104494. * @param {Object} object The object to iterate over.
  104495. * @param {Function} iteratee The function invoked per iteration.
  104496. * @returns {Object} Returns `object`.
  104497. */
  104498. function baseForOwn(object, iteratee) {
  104499. return object && Object(_baseFor_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, iteratee, _keys_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  104500. }
  104501. /* harmony default export */ __webpack_exports__["default"] = (baseForOwn);
  104502. /***/ }),
  104503. /***/ "./node_modules/lodash-es/_baseForOwnRight.js":
  104504. /*!****************************************************!*\
  104505. !*** ./node_modules/lodash-es/_baseForOwnRight.js ***!
  104506. \****************************************************/
  104507. /*! exports provided: default */
  104508. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104509. "use strict";
  104510. __webpack_require__.r(__webpack_exports__);
  104511. /* harmony import */ var _baseForRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForRight.js */ "./node_modules/lodash-es/_baseForRight.js");
  104512. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  104513. /**
  104514. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  104515. *
  104516. * @private
  104517. * @param {Object} object The object to iterate over.
  104518. * @param {Function} iteratee The function invoked per iteration.
  104519. * @returns {Object} Returns `object`.
  104520. */
  104521. function baseForOwnRight(object, iteratee) {
  104522. return object && Object(_baseForRight_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, iteratee, _keys_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  104523. }
  104524. /* harmony default export */ __webpack_exports__["default"] = (baseForOwnRight);
  104525. /***/ }),
  104526. /***/ "./node_modules/lodash-es/_baseForRight.js":
  104527. /*!*************************************************!*\
  104528. !*** ./node_modules/lodash-es/_baseForRight.js ***!
  104529. \*************************************************/
  104530. /*! exports provided: default */
  104531. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104532. "use strict";
  104533. __webpack_require__.r(__webpack_exports__);
  104534. /* harmony import */ var _createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createBaseFor.js */ "./node_modules/lodash-es/_createBaseFor.js");
  104535. /**
  104536. * This function is like `baseFor` except that it iterates over properties
  104537. * in the opposite order.
  104538. *
  104539. * @private
  104540. * @param {Object} object The object to iterate over.
  104541. * @param {Function} iteratee The function invoked per iteration.
  104542. * @param {Function} keysFunc The function to get the keys of `object`.
  104543. * @returns {Object} Returns `object`.
  104544. */
  104545. var baseForRight = Object(_createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__["default"])(true);
  104546. /* harmony default export */ __webpack_exports__["default"] = (baseForRight);
  104547. /***/ }),
  104548. /***/ "./node_modules/lodash-es/_baseFunctions.js":
  104549. /*!**************************************************!*\
  104550. !*** ./node_modules/lodash-es/_baseFunctions.js ***!
  104551. \**************************************************/
  104552. /*! exports provided: default */
  104553. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104554. "use strict";
  104555. __webpack_require__.r(__webpack_exports__);
  104556. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  104557. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  104558. /**
  104559. * The base implementation of `_.functions` which creates an array of
  104560. * `object` function property names filtered from `props`.
  104561. *
  104562. * @private
  104563. * @param {Object} object The object to inspect.
  104564. * @param {Array} props The property names to filter.
  104565. * @returns {Array} Returns the function names.
  104566. */
  104567. function baseFunctions(object, props) {
  104568. return Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(props, function(key) {
  104569. return Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object[key]);
  104570. });
  104571. }
  104572. /* harmony default export */ __webpack_exports__["default"] = (baseFunctions);
  104573. /***/ }),
  104574. /***/ "./node_modules/lodash-es/_baseGet.js":
  104575. /*!********************************************!*\
  104576. !*** ./node_modules/lodash-es/_baseGet.js ***!
  104577. \********************************************/
  104578. /*! exports provided: default */
  104579. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104580. "use strict";
  104581. __webpack_require__.r(__webpack_exports__);
  104582. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  104583. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  104584. /**
  104585. * The base implementation of `_.get` without support for default values.
  104586. *
  104587. * @private
  104588. * @param {Object} object The object to query.
  104589. * @param {Array|string} path The path of the property to get.
  104590. * @returns {*} Returns the resolved value.
  104591. */
  104592. function baseGet(object, path) {
  104593. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);
  104594. var index = 0,
  104595. length = path.length;
  104596. while (object != null && index < length) {
  104597. object = object[Object(_toKey_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path[index++])];
  104598. }
  104599. return (index && index == length) ? object : undefined;
  104600. }
  104601. /* harmony default export */ __webpack_exports__["default"] = (baseGet);
  104602. /***/ }),
  104603. /***/ "./node_modules/lodash-es/_baseGetAllKeys.js":
  104604. /*!***************************************************!*\
  104605. !*** ./node_modules/lodash-es/_baseGetAllKeys.js ***!
  104606. \***************************************************/
  104607. /*! exports provided: default */
  104608. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104609. "use strict";
  104610. __webpack_require__.r(__webpack_exports__);
  104611. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  104612. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  104613. /**
  104614. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  104615. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  104616. * symbols of `object`.
  104617. *
  104618. * @private
  104619. * @param {Object} object The object to query.
  104620. * @param {Function} keysFunc The function to get the keys of `object`.
  104621. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  104622. * @returns {Array} Returns the array of property names and symbols.
  104623. */
  104624. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  104625. var result = keysFunc(object);
  104626. return Object(_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object) ? result : Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, symbolsFunc(object));
  104627. }
  104628. /* harmony default export */ __webpack_exports__["default"] = (baseGetAllKeys);
  104629. /***/ }),
  104630. /***/ "./node_modules/lodash-es/_baseGetTag.js":
  104631. /*!***********************************************!*\
  104632. !*** ./node_modules/lodash-es/_baseGetTag.js ***!
  104633. \***********************************************/
  104634. /*! exports provided: default */
  104635. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104636. "use strict";
  104637. __webpack_require__.r(__webpack_exports__);
  104638. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  104639. /* harmony import */ var _getRawTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getRawTag.js */ "./node_modules/lodash-es/_getRawTag.js");
  104640. /* harmony import */ var _objectToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_objectToString.js */ "./node_modules/lodash-es/_objectToString.js");
  104641. /** `Object#toString` result references. */
  104642. var nullTag = '[object Null]',
  104643. undefinedTag = '[object Undefined]';
  104644. /** Built-in value references. */
  104645. var symToStringTag = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].toStringTag : undefined;
  104646. /**
  104647. * The base implementation of `getTag` without fallbacks for buggy environments.
  104648. *
  104649. * @private
  104650. * @param {*} value The value to query.
  104651. * @returns {string} Returns the `toStringTag`.
  104652. */
  104653. function baseGetTag(value) {
  104654. if (value == null) {
  104655. return value === undefined ? undefinedTag : nullTag;
  104656. }
  104657. return (symToStringTag && symToStringTag in Object(value))
  104658. ? Object(_getRawTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)
  104659. : Object(_objectToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value);
  104660. }
  104661. /* harmony default export */ __webpack_exports__["default"] = (baseGetTag);
  104662. /***/ }),
  104663. /***/ "./node_modules/lodash-es/_baseGt.js":
  104664. /*!*******************************************!*\
  104665. !*** ./node_modules/lodash-es/_baseGt.js ***!
  104666. \*******************************************/
  104667. /*! exports provided: default */
  104668. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104669. "use strict";
  104670. __webpack_require__.r(__webpack_exports__);
  104671. /**
  104672. * The base implementation of `_.gt` which doesn't coerce arguments.
  104673. *
  104674. * @private
  104675. * @param {*} value The value to compare.
  104676. * @param {*} other The other value to compare.
  104677. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  104678. * else `false`.
  104679. */
  104680. function baseGt(value, other) {
  104681. return value > other;
  104682. }
  104683. /* harmony default export */ __webpack_exports__["default"] = (baseGt);
  104684. /***/ }),
  104685. /***/ "./node_modules/lodash-es/_baseHas.js":
  104686. /*!********************************************!*\
  104687. !*** ./node_modules/lodash-es/_baseHas.js ***!
  104688. \********************************************/
  104689. /*! exports provided: default */
  104690. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104691. "use strict";
  104692. __webpack_require__.r(__webpack_exports__);
  104693. /** Used for built-in method references. */
  104694. var objectProto = Object.prototype;
  104695. /** Used to check objects for own properties. */
  104696. var hasOwnProperty = objectProto.hasOwnProperty;
  104697. /**
  104698. * The base implementation of `_.has` without support for deep paths.
  104699. *
  104700. * @private
  104701. * @param {Object} [object] The object to query.
  104702. * @param {Array|string} key The key to check.
  104703. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  104704. */
  104705. function baseHas(object, key) {
  104706. return object != null && hasOwnProperty.call(object, key);
  104707. }
  104708. /* harmony default export */ __webpack_exports__["default"] = (baseHas);
  104709. /***/ }),
  104710. /***/ "./node_modules/lodash-es/_baseHasIn.js":
  104711. /*!**********************************************!*\
  104712. !*** ./node_modules/lodash-es/_baseHasIn.js ***!
  104713. \**********************************************/
  104714. /*! exports provided: default */
  104715. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104716. "use strict";
  104717. __webpack_require__.r(__webpack_exports__);
  104718. /**
  104719. * The base implementation of `_.hasIn` without support for deep paths.
  104720. *
  104721. * @private
  104722. * @param {Object} [object] The object to query.
  104723. * @param {Array|string} key The key to check.
  104724. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  104725. */
  104726. function baseHasIn(object, key) {
  104727. return object != null && key in Object(object);
  104728. }
  104729. /* harmony default export */ __webpack_exports__["default"] = (baseHasIn);
  104730. /***/ }),
  104731. /***/ "./node_modules/lodash-es/_baseInRange.js":
  104732. /*!************************************************!*\
  104733. !*** ./node_modules/lodash-es/_baseInRange.js ***!
  104734. \************************************************/
  104735. /*! exports provided: default */
  104736. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104737. "use strict";
  104738. __webpack_require__.r(__webpack_exports__);
  104739. /* Built-in method references for those with the same name as other `lodash` methods. */
  104740. var nativeMax = Math.max,
  104741. nativeMin = Math.min;
  104742. /**
  104743. * The base implementation of `_.inRange` which doesn't coerce arguments.
  104744. *
  104745. * @private
  104746. * @param {number} number The number to check.
  104747. * @param {number} start The start of the range.
  104748. * @param {number} end The end of the range.
  104749. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  104750. */
  104751. function baseInRange(number, start, end) {
  104752. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  104753. }
  104754. /* harmony default export */ __webpack_exports__["default"] = (baseInRange);
  104755. /***/ }),
  104756. /***/ "./node_modules/lodash-es/_baseIndexOf.js":
  104757. /*!************************************************!*\
  104758. !*** ./node_modules/lodash-es/_baseIndexOf.js ***!
  104759. \************************************************/
  104760. /*! exports provided: default */
  104761. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104762. "use strict";
  104763. __webpack_require__.r(__webpack_exports__);
  104764. /* harmony import */ var _baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindIndex.js */ "./node_modules/lodash-es/_baseFindIndex.js");
  104765. /* harmony import */ var _baseIsNaN_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIsNaN.js */ "./node_modules/lodash-es/_baseIsNaN.js");
  104766. /* harmony import */ var _strictIndexOf_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_strictIndexOf.js */ "./node_modules/lodash-es/_strictIndexOf.js");
  104767. /**
  104768. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  104769. *
  104770. * @private
  104771. * @param {Array} array The array to inspect.
  104772. * @param {*} value The value to search for.
  104773. * @param {number} fromIndex The index to search from.
  104774. * @returns {number} Returns the index of the matched value, else `-1`.
  104775. */
  104776. function baseIndexOf(array, value, fromIndex) {
  104777. return value === value
  104778. ? Object(_strictIndexOf_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array, value, fromIndex)
  104779. : Object(_baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _baseIsNaN_js__WEBPACK_IMPORTED_MODULE_1__["default"], fromIndex);
  104780. }
  104781. /* harmony default export */ __webpack_exports__["default"] = (baseIndexOf);
  104782. /***/ }),
  104783. /***/ "./node_modules/lodash-es/_baseIndexOfWith.js":
  104784. /*!****************************************************!*\
  104785. !*** ./node_modules/lodash-es/_baseIndexOfWith.js ***!
  104786. \****************************************************/
  104787. /*! exports provided: default */
  104788. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104789. "use strict";
  104790. __webpack_require__.r(__webpack_exports__);
  104791. /**
  104792. * This function is like `baseIndexOf` except that it accepts a comparator.
  104793. *
  104794. * @private
  104795. * @param {Array} array The array to inspect.
  104796. * @param {*} value The value to search for.
  104797. * @param {number} fromIndex The index to search from.
  104798. * @param {Function} comparator The comparator invoked per element.
  104799. * @returns {number} Returns the index of the matched value, else `-1`.
  104800. */
  104801. function baseIndexOfWith(array, value, fromIndex, comparator) {
  104802. var index = fromIndex - 1,
  104803. length = array.length;
  104804. while (++index < length) {
  104805. if (comparator(array[index], value)) {
  104806. return index;
  104807. }
  104808. }
  104809. return -1;
  104810. }
  104811. /* harmony default export */ __webpack_exports__["default"] = (baseIndexOfWith);
  104812. /***/ }),
  104813. /***/ "./node_modules/lodash-es/_baseIntersection.js":
  104814. /*!*****************************************************!*\
  104815. !*** ./node_modules/lodash-es/_baseIntersection.js ***!
  104816. \*****************************************************/
  104817. /*! exports provided: default */
  104818. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104819. "use strict";
  104820. __webpack_require__.r(__webpack_exports__);
  104821. /* harmony import */ var _SetCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_SetCache.js */ "./node_modules/lodash-es/_SetCache.js");
  104822. /* harmony import */ var _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayIncludes.js */ "./node_modules/lodash-es/_arrayIncludes.js");
  104823. /* harmony import */ var _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arrayIncludesWith.js */ "./node_modules/lodash-es/_arrayIncludesWith.js");
  104824. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  104825. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  104826. /* harmony import */ var _cacheHas_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_cacheHas.js */ "./node_modules/lodash-es/_cacheHas.js");
  104827. /* Built-in method references for those with the same name as other `lodash` methods. */
  104828. var nativeMin = Math.min;
  104829. /**
  104830. * The base implementation of methods like `_.intersection`, without support
  104831. * for iteratee shorthands, that accepts an array of arrays to inspect.
  104832. *
  104833. * @private
  104834. * @param {Array} arrays The arrays to inspect.
  104835. * @param {Function} [iteratee] The iteratee invoked per element.
  104836. * @param {Function} [comparator] The comparator invoked per element.
  104837. * @returns {Array} Returns the new array of shared values.
  104838. */
  104839. function baseIntersection(arrays, iteratee, comparator) {
  104840. var includes = comparator ? _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__["default"] : _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  104841. length = arrays[0].length,
  104842. othLength = arrays.length,
  104843. othIndex = othLength,
  104844. caches = Array(othLength),
  104845. maxLength = Infinity,
  104846. result = [];
  104847. while (othIndex--) {
  104848. var array = arrays[othIndex];
  104849. if (othIndex && iteratee) {
  104850. array = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_3__["default"])(array, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee));
  104851. }
  104852. maxLength = nativeMin(array.length, maxLength);
  104853. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  104854. ? new _SetCache_js__WEBPACK_IMPORTED_MODULE_0__["default"](othIndex && array)
  104855. : undefined;
  104856. }
  104857. array = arrays[0];
  104858. var index = -1,
  104859. seen = caches[0];
  104860. outer:
  104861. while (++index < length && result.length < maxLength) {
  104862. var value = array[index],
  104863. computed = iteratee ? iteratee(value) : value;
  104864. value = (comparator || value !== 0) ? value : 0;
  104865. if (!(seen
  104866. ? Object(_cacheHas_js__WEBPACK_IMPORTED_MODULE_5__["default"])(seen, computed)
  104867. : includes(result, computed, comparator)
  104868. )) {
  104869. othIndex = othLength;
  104870. while (--othIndex) {
  104871. var cache = caches[othIndex];
  104872. if (!(cache
  104873. ? Object(_cacheHas_js__WEBPACK_IMPORTED_MODULE_5__["default"])(cache, computed)
  104874. : includes(arrays[othIndex], computed, comparator))
  104875. ) {
  104876. continue outer;
  104877. }
  104878. }
  104879. if (seen) {
  104880. seen.push(computed);
  104881. }
  104882. result.push(value);
  104883. }
  104884. }
  104885. return result;
  104886. }
  104887. /* harmony default export */ __webpack_exports__["default"] = (baseIntersection);
  104888. /***/ }),
  104889. /***/ "./node_modules/lodash-es/_baseInverter.js":
  104890. /*!*************************************************!*\
  104891. !*** ./node_modules/lodash-es/_baseInverter.js ***!
  104892. \*************************************************/
  104893. /*! exports provided: default */
  104894. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104895. "use strict";
  104896. __webpack_require__.r(__webpack_exports__);
  104897. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  104898. /**
  104899. * The base implementation of `_.invert` and `_.invertBy` which inverts
  104900. * `object` with values transformed by `iteratee` and set by `setter`.
  104901. *
  104902. * @private
  104903. * @param {Object} object The object to iterate over.
  104904. * @param {Function} setter The function to set `accumulator` values.
  104905. * @param {Function} iteratee The iteratee to transform values.
  104906. * @param {Object} accumulator The initial inverted object.
  104907. * @returns {Function} Returns `accumulator`.
  104908. */
  104909. function baseInverter(object, setter, iteratee, accumulator) {
  104910. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, function(value, key, object) {
  104911. setter(accumulator, iteratee(value), key, object);
  104912. });
  104913. return accumulator;
  104914. }
  104915. /* harmony default export */ __webpack_exports__["default"] = (baseInverter);
  104916. /***/ }),
  104917. /***/ "./node_modules/lodash-es/_baseInvoke.js":
  104918. /*!***********************************************!*\
  104919. !*** ./node_modules/lodash-es/_baseInvoke.js ***!
  104920. \***********************************************/
  104921. /*! exports provided: default */
  104922. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104923. "use strict";
  104924. __webpack_require__.r(__webpack_exports__);
  104925. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  104926. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  104927. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  104928. /* harmony import */ var _parent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_parent.js */ "./node_modules/lodash-es/_parent.js");
  104929. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  104930. /**
  104931. * The base implementation of `_.invoke` without support for individual
  104932. * method arguments.
  104933. *
  104934. * @private
  104935. * @param {Object} object The object to query.
  104936. * @param {Array|string} path The path of the method to invoke.
  104937. * @param {Array} args The arguments to invoke the method with.
  104938. * @returns {*} Returns the result of the invoked method.
  104939. */
  104940. function baseInvoke(object, path, args) {
  104941. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path, object);
  104942. object = Object(_parent_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object, path);
  104943. var func = object == null ? object : object[Object(_toKey_js__WEBPACK_IMPORTED_MODULE_4__["default"])(Object(_last_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path))];
  104944. return func == null ? undefined : Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, object, args);
  104945. }
  104946. /* harmony default export */ __webpack_exports__["default"] = (baseInvoke);
  104947. /***/ }),
  104948. /***/ "./node_modules/lodash-es/_baseIsArguments.js":
  104949. /*!****************************************************!*\
  104950. !*** ./node_modules/lodash-es/_baseIsArguments.js ***!
  104951. \****************************************************/
  104952. /*! exports provided: default */
  104953. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104954. "use strict";
  104955. __webpack_require__.r(__webpack_exports__);
  104956. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  104957. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  104958. /** `Object#toString` result references. */
  104959. var argsTag = '[object Arguments]';
  104960. /**
  104961. * The base implementation of `_.isArguments`.
  104962. *
  104963. * @private
  104964. * @param {*} value The value to check.
  104965. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  104966. */
  104967. function baseIsArguments(value) {
  104968. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == argsTag;
  104969. }
  104970. /* harmony default export */ __webpack_exports__["default"] = (baseIsArguments);
  104971. /***/ }),
  104972. /***/ "./node_modules/lodash-es/_baseIsArrayBuffer.js":
  104973. /*!******************************************************!*\
  104974. !*** ./node_modules/lodash-es/_baseIsArrayBuffer.js ***!
  104975. \******************************************************/
  104976. /*! exports provided: default */
  104977. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104978. "use strict";
  104979. __webpack_require__.r(__webpack_exports__);
  104980. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  104981. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  104982. var arrayBufferTag = '[object ArrayBuffer]';
  104983. /**
  104984. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  104985. *
  104986. * @private
  104987. * @param {*} value The value to check.
  104988. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  104989. */
  104990. function baseIsArrayBuffer(value) {
  104991. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == arrayBufferTag;
  104992. }
  104993. /* harmony default export */ __webpack_exports__["default"] = (baseIsArrayBuffer);
  104994. /***/ }),
  104995. /***/ "./node_modules/lodash-es/_baseIsDate.js":
  104996. /*!***********************************************!*\
  104997. !*** ./node_modules/lodash-es/_baseIsDate.js ***!
  104998. \***********************************************/
  104999. /*! exports provided: default */
  105000. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105001. "use strict";
  105002. __webpack_require__.r(__webpack_exports__);
  105003. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  105004. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  105005. /** `Object#toString` result references. */
  105006. var dateTag = '[object Date]';
  105007. /**
  105008. * The base implementation of `_.isDate` without Node.js optimizations.
  105009. *
  105010. * @private
  105011. * @param {*} value The value to check.
  105012. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  105013. */
  105014. function baseIsDate(value) {
  105015. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == dateTag;
  105016. }
  105017. /* harmony default export */ __webpack_exports__["default"] = (baseIsDate);
  105018. /***/ }),
  105019. /***/ "./node_modules/lodash-es/_baseIsEqual.js":
  105020. /*!************************************************!*\
  105021. !*** ./node_modules/lodash-es/_baseIsEqual.js ***!
  105022. \************************************************/
  105023. /*! exports provided: default */
  105024. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105025. "use strict";
  105026. __webpack_require__.r(__webpack_exports__);
  105027. /* harmony import */ var _baseIsEqualDeep_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsEqualDeep.js */ "./node_modules/lodash-es/_baseIsEqualDeep.js");
  105028. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  105029. /**
  105030. * The base implementation of `_.isEqual` which supports partial comparisons
  105031. * and tracks traversed objects.
  105032. *
  105033. * @private
  105034. * @param {*} value The value to compare.
  105035. * @param {*} other The other value to compare.
  105036. * @param {boolean} bitmask The bitmask flags.
  105037. * 1 - Unordered comparison
  105038. * 2 - Partial comparison
  105039. * @param {Function} [customizer] The function to customize comparisons.
  105040. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  105041. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  105042. */
  105043. function baseIsEqual(value, other, bitmask, customizer, stack) {
  105044. if (value === other) {
  105045. return true;
  105046. }
  105047. if (value == null || other == null || (!Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && !Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other))) {
  105048. return value !== value && other !== other;
  105049. }
  105050. return Object(_baseIsEqualDeep_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, other, bitmask, customizer, baseIsEqual, stack);
  105051. }
  105052. /* harmony default export */ __webpack_exports__["default"] = (baseIsEqual);
  105053. /***/ }),
  105054. /***/ "./node_modules/lodash-es/_baseIsEqualDeep.js":
  105055. /*!****************************************************!*\
  105056. !*** ./node_modules/lodash-es/_baseIsEqualDeep.js ***!
  105057. \****************************************************/
  105058. /*! exports provided: default */
  105059. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105060. "use strict";
  105061. __webpack_require__.r(__webpack_exports__);
  105062. /* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
  105063. /* harmony import */ var _equalArrays_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_equalArrays.js */ "./node_modules/lodash-es/_equalArrays.js");
  105064. /* harmony import */ var _equalByTag_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_equalByTag.js */ "./node_modules/lodash-es/_equalByTag.js");
  105065. /* harmony import */ var _equalObjects_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_equalObjects.js */ "./node_modules/lodash-es/_equalObjects.js");
  105066. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  105067. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  105068. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  105069. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  105070. /** Used to compose bitmasks for value comparisons. */
  105071. var COMPARE_PARTIAL_FLAG = 1;
  105072. /** `Object#toString` result references. */
  105073. var argsTag = '[object Arguments]',
  105074. arrayTag = '[object Array]',
  105075. objectTag = '[object Object]';
  105076. /** Used for built-in method references. */
  105077. var objectProto = Object.prototype;
  105078. /** Used to check objects for own properties. */
  105079. var hasOwnProperty = objectProto.hasOwnProperty;
  105080. /**
  105081. * A specialized version of `baseIsEqual` for arrays and objects which performs
  105082. * deep comparisons and tracks traversed objects enabling objects with circular
  105083. * references to be compared.
  105084. *
  105085. * @private
  105086. * @param {Object} object The object to compare.
  105087. * @param {Object} other The other object to compare.
  105088. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  105089. * @param {Function} customizer The function to customize comparisons.
  105090. * @param {Function} equalFunc The function to determine equivalents of values.
  105091. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  105092. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  105093. */
  105094. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  105095. var objIsArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(object),
  105096. othIsArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(other),
  105097. objTag = objIsArr ? arrayTag : Object(_getTag_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object),
  105098. othTag = othIsArr ? arrayTag : Object(_getTag_js__WEBPACK_IMPORTED_MODULE_4__["default"])(other);
  105099. objTag = objTag == argsTag ? objectTag : objTag;
  105100. othTag = othTag == argsTag ? objectTag : othTag;
  105101. var objIsObj = objTag == objectTag,
  105102. othIsObj = othTag == objectTag,
  105103. isSameTag = objTag == othTag;
  105104. if (isSameTag && Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_6__["default"])(object)) {
  105105. if (!Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_6__["default"])(other)) {
  105106. return false;
  105107. }
  105108. objIsArr = true;
  105109. objIsObj = false;
  105110. }
  105111. if (isSameTag && !objIsObj) {
  105112. stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  105113. return (objIsArr || Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_7__["default"])(object))
  105114. ? Object(_equalArrays_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, other, bitmask, customizer, equalFunc, stack)
  105115. : Object(_equalByTag_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, other, objTag, bitmask, customizer, equalFunc, stack);
  105116. }
  105117. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  105118. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  105119. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  105120. if (objIsWrapped || othIsWrapped) {
  105121. var objUnwrapped = objIsWrapped ? object.value() : object,
  105122. othUnwrapped = othIsWrapped ? other.value() : other;
  105123. stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  105124. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  105125. }
  105126. }
  105127. if (!isSameTag) {
  105128. return false;
  105129. }
  105130. stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  105131. return Object(_equalObjects_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object, other, bitmask, customizer, equalFunc, stack);
  105132. }
  105133. /* harmony default export */ __webpack_exports__["default"] = (baseIsEqualDeep);
  105134. /***/ }),
  105135. /***/ "./node_modules/lodash-es/_baseIsMap.js":
  105136. /*!**********************************************!*\
  105137. !*** ./node_modules/lodash-es/_baseIsMap.js ***!
  105138. \**********************************************/
  105139. /*! exports provided: default */
  105140. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105141. "use strict";
  105142. __webpack_require__.r(__webpack_exports__);
  105143. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  105144. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  105145. /** `Object#toString` result references. */
  105146. var mapTag = '[object Map]';
  105147. /**
  105148. * The base implementation of `_.isMap` without Node.js optimizations.
  105149. *
  105150. * @private
  105151. * @param {*} value The value to check.
  105152. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  105153. */
  105154. function baseIsMap(value) {
  105155. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_getTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == mapTag;
  105156. }
  105157. /* harmony default export */ __webpack_exports__["default"] = (baseIsMap);
  105158. /***/ }),
  105159. /***/ "./node_modules/lodash-es/_baseIsMatch.js":
  105160. /*!************************************************!*\
  105161. !*** ./node_modules/lodash-es/_baseIsMatch.js ***!
  105162. \************************************************/
  105163. /*! exports provided: default */
  105164. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105165. "use strict";
  105166. __webpack_require__.r(__webpack_exports__);
  105167. /* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
  105168. /* harmony import */ var _baseIsEqual_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIsEqual.js */ "./node_modules/lodash-es/_baseIsEqual.js");
  105169. /** Used to compose bitmasks for value comparisons. */
  105170. var COMPARE_PARTIAL_FLAG = 1,
  105171. COMPARE_UNORDERED_FLAG = 2;
  105172. /**
  105173. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  105174. *
  105175. * @private
  105176. * @param {Object} object The object to inspect.
  105177. * @param {Object} source The object of property values to match.
  105178. * @param {Array} matchData The property names, values, and compare flags to match.
  105179. * @param {Function} [customizer] The function to customize comparisons.
  105180. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  105181. */
  105182. function baseIsMatch(object, source, matchData, customizer) {
  105183. var index = matchData.length,
  105184. length = index,
  105185. noCustomizer = !customizer;
  105186. if (object == null) {
  105187. return !length;
  105188. }
  105189. object = Object(object);
  105190. while (index--) {
  105191. var data = matchData[index];
  105192. if ((noCustomizer && data[2])
  105193. ? data[1] !== object[data[0]]
  105194. : !(data[0] in object)
  105195. ) {
  105196. return false;
  105197. }
  105198. }
  105199. while (++index < length) {
  105200. data = matchData[index];
  105201. var key = data[0],
  105202. objValue = object[key],
  105203. srcValue = data[1];
  105204. if (noCustomizer && data[2]) {
  105205. if (objValue === undefined && !(key in object)) {
  105206. return false;
  105207. }
  105208. } else {
  105209. var stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  105210. if (customizer) {
  105211. var result = customizer(objValue, srcValue, key, object, source, stack);
  105212. }
  105213. if (!(result === undefined
  105214. ? Object(_baseIsEqual_js__WEBPACK_IMPORTED_MODULE_1__["default"])(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  105215. : result
  105216. )) {
  105217. return false;
  105218. }
  105219. }
  105220. }
  105221. return true;
  105222. }
  105223. /* harmony default export */ __webpack_exports__["default"] = (baseIsMatch);
  105224. /***/ }),
  105225. /***/ "./node_modules/lodash-es/_baseIsNaN.js":
  105226. /*!**********************************************!*\
  105227. !*** ./node_modules/lodash-es/_baseIsNaN.js ***!
  105228. \**********************************************/
  105229. /*! exports provided: default */
  105230. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105231. "use strict";
  105232. __webpack_require__.r(__webpack_exports__);
  105233. /**
  105234. * The base implementation of `_.isNaN` without support for number objects.
  105235. *
  105236. * @private
  105237. * @param {*} value The value to check.
  105238. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  105239. */
  105240. function baseIsNaN(value) {
  105241. return value !== value;
  105242. }
  105243. /* harmony default export */ __webpack_exports__["default"] = (baseIsNaN);
  105244. /***/ }),
  105245. /***/ "./node_modules/lodash-es/_baseIsNative.js":
  105246. /*!*************************************************!*\
  105247. !*** ./node_modules/lodash-es/_baseIsNative.js ***!
  105248. \*************************************************/
  105249. /*! exports provided: default */
  105250. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105251. "use strict";
  105252. __webpack_require__.r(__webpack_exports__);
  105253. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  105254. /* harmony import */ var _isMasked_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isMasked.js */ "./node_modules/lodash-es/_isMasked.js");
  105255. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  105256. /* harmony import */ var _toSource_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_toSource.js */ "./node_modules/lodash-es/_toSource.js");
  105257. /**
  105258. * Used to match `RegExp`
  105259. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  105260. */
  105261. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  105262. /** Used to detect host constructors (Safari). */
  105263. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  105264. /** Used for built-in method references. */
  105265. var funcProto = Function.prototype,
  105266. objectProto = Object.prototype;
  105267. /** Used to resolve the decompiled source of functions. */
  105268. var funcToString = funcProto.toString;
  105269. /** Used to check objects for own properties. */
  105270. var hasOwnProperty = objectProto.hasOwnProperty;
  105271. /** Used to detect if a method is native. */
  105272. var reIsNative = RegExp('^' +
  105273. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  105274. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  105275. );
  105276. /**
  105277. * The base implementation of `_.isNative` without bad shim checks.
  105278. *
  105279. * @private
  105280. * @param {*} value The value to check.
  105281. * @returns {boolean} Returns `true` if `value` is a native function,
  105282. * else `false`.
  105283. */
  105284. function baseIsNative(value) {
  105285. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) || Object(_isMasked_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  105286. return false;
  105287. }
  105288. var pattern = Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? reIsNative : reIsHostCtor;
  105289. return pattern.test(Object(_toSource_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value));
  105290. }
  105291. /* harmony default export */ __webpack_exports__["default"] = (baseIsNative);
  105292. /***/ }),
  105293. /***/ "./node_modules/lodash-es/_baseIsRegExp.js":
  105294. /*!*************************************************!*\
  105295. !*** ./node_modules/lodash-es/_baseIsRegExp.js ***!
  105296. \*************************************************/
  105297. /*! exports provided: default */
  105298. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105299. "use strict";
  105300. __webpack_require__.r(__webpack_exports__);
  105301. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  105302. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  105303. /** `Object#toString` result references. */
  105304. var regexpTag = '[object RegExp]';
  105305. /**
  105306. * The base implementation of `_.isRegExp` without Node.js optimizations.
  105307. *
  105308. * @private
  105309. * @param {*} value The value to check.
  105310. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  105311. */
  105312. function baseIsRegExp(value) {
  105313. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == regexpTag;
  105314. }
  105315. /* harmony default export */ __webpack_exports__["default"] = (baseIsRegExp);
  105316. /***/ }),
  105317. /***/ "./node_modules/lodash-es/_baseIsSet.js":
  105318. /*!**********************************************!*\
  105319. !*** ./node_modules/lodash-es/_baseIsSet.js ***!
  105320. \**********************************************/
  105321. /*! exports provided: default */
  105322. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105323. "use strict";
  105324. __webpack_require__.r(__webpack_exports__);
  105325. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  105326. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  105327. /** `Object#toString` result references. */
  105328. var setTag = '[object Set]';
  105329. /**
  105330. * The base implementation of `_.isSet` without Node.js optimizations.
  105331. *
  105332. * @private
  105333. * @param {*} value The value to check.
  105334. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  105335. */
  105336. function baseIsSet(value) {
  105337. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_getTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == setTag;
  105338. }
  105339. /* harmony default export */ __webpack_exports__["default"] = (baseIsSet);
  105340. /***/ }),
  105341. /***/ "./node_modules/lodash-es/_baseIsTypedArray.js":
  105342. /*!*****************************************************!*\
  105343. !*** ./node_modules/lodash-es/_baseIsTypedArray.js ***!
  105344. \*****************************************************/
  105345. /*! exports provided: default */
  105346. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105347. "use strict";
  105348. __webpack_require__.r(__webpack_exports__);
  105349. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  105350. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  105351. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  105352. /** `Object#toString` result references. */
  105353. var argsTag = '[object Arguments]',
  105354. arrayTag = '[object Array]',
  105355. boolTag = '[object Boolean]',
  105356. dateTag = '[object Date]',
  105357. errorTag = '[object Error]',
  105358. funcTag = '[object Function]',
  105359. mapTag = '[object Map]',
  105360. numberTag = '[object Number]',
  105361. objectTag = '[object Object]',
  105362. regexpTag = '[object RegExp]',
  105363. setTag = '[object Set]',
  105364. stringTag = '[object String]',
  105365. weakMapTag = '[object WeakMap]';
  105366. var arrayBufferTag = '[object ArrayBuffer]',
  105367. dataViewTag = '[object DataView]',
  105368. float32Tag = '[object Float32Array]',
  105369. float64Tag = '[object Float64Array]',
  105370. int8Tag = '[object Int8Array]',
  105371. int16Tag = '[object Int16Array]',
  105372. int32Tag = '[object Int32Array]',
  105373. uint8Tag = '[object Uint8Array]',
  105374. uint8ClampedTag = '[object Uint8ClampedArray]',
  105375. uint16Tag = '[object Uint16Array]',
  105376. uint32Tag = '[object Uint32Array]';
  105377. /** Used to identify `toStringTag` values of typed arrays. */
  105378. var typedArrayTags = {};
  105379. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  105380. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  105381. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  105382. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  105383. typedArrayTags[uint32Tag] = true;
  105384. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  105385. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  105386. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  105387. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  105388. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  105389. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  105390. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  105391. typedArrayTags[weakMapTag] = false;
  105392. /**
  105393. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  105394. *
  105395. * @private
  105396. * @param {*} value The value to check.
  105397. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  105398. */
  105399. function baseIsTypedArray(value) {
  105400. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) &&
  105401. Object(_isLength_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value.length) && !!typedArrayTags[Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)];
  105402. }
  105403. /* harmony default export */ __webpack_exports__["default"] = (baseIsTypedArray);
  105404. /***/ }),
  105405. /***/ "./node_modules/lodash-es/_baseIteratee.js":
  105406. /*!*************************************************!*\
  105407. !*** ./node_modules/lodash-es/_baseIteratee.js ***!
  105408. \*************************************************/
  105409. /*! exports provided: default */
  105410. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105411. "use strict";
  105412. __webpack_require__.r(__webpack_exports__);
  105413. /* harmony import */ var _baseMatches_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMatches.js */ "./node_modules/lodash-es/_baseMatches.js");
  105414. /* harmony import */ var _baseMatchesProperty_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMatchesProperty.js */ "./node_modules/lodash-es/_baseMatchesProperty.js");
  105415. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  105416. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  105417. /* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./property.js */ "./node_modules/lodash-es/property.js");
  105418. /**
  105419. * The base implementation of `_.iteratee`.
  105420. *
  105421. * @private
  105422. * @param {*} [value=_.identity] The value to convert to an iteratee.
  105423. * @returns {Function} Returns the iteratee.
  105424. */
  105425. function baseIteratee(value) {
  105426. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  105427. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  105428. if (typeof value == 'function') {
  105429. return value;
  105430. }
  105431. if (value == null) {
  105432. return _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  105433. }
  105434. if (typeof value == 'object') {
  105435. return Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value)
  105436. ? Object(_baseMatchesProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value[0], value[1])
  105437. : Object(_baseMatches_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  105438. }
  105439. return Object(_property_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value);
  105440. }
  105441. /* harmony default export */ __webpack_exports__["default"] = (baseIteratee);
  105442. /***/ }),
  105443. /***/ "./node_modules/lodash-es/_baseKeys.js":
  105444. /*!*********************************************!*\
  105445. !*** ./node_modules/lodash-es/_baseKeys.js ***!
  105446. \*********************************************/
  105447. /*! exports provided: default */
  105448. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105449. "use strict";
  105450. __webpack_require__.r(__webpack_exports__);
  105451. /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
  105452. /* harmony import */ var _nativeKeys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_nativeKeys.js */ "./node_modules/lodash-es/_nativeKeys.js");
  105453. /** Used for built-in method references. */
  105454. var objectProto = Object.prototype;
  105455. /** Used to check objects for own properties. */
  105456. var hasOwnProperty = objectProto.hasOwnProperty;
  105457. /**
  105458. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  105459. *
  105460. * @private
  105461. * @param {Object} object The object to query.
  105462. * @returns {Array} Returns the array of property names.
  105463. */
  105464. function baseKeys(object) {
  105465. if (!Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object)) {
  105466. return Object(_nativeKeys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
  105467. }
  105468. var result = [];
  105469. for (var key in Object(object)) {
  105470. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  105471. result.push(key);
  105472. }
  105473. }
  105474. return result;
  105475. }
  105476. /* harmony default export */ __webpack_exports__["default"] = (baseKeys);
  105477. /***/ }),
  105478. /***/ "./node_modules/lodash-es/_baseKeysIn.js":
  105479. /*!***********************************************!*\
  105480. !*** ./node_modules/lodash-es/_baseKeysIn.js ***!
  105481. \***********************************************/
  105482. /*! exports provided: default */
  105483. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105484. "use strict";
  105485. __webpack_require__.r(__webpack_exports__);
  105486. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  105487. /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
  105488. /* harmony import */ var _nativeKeysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nativeKeysIn.js */ "./node_modules/lodash-es/_nativeKeysIn.js");
  105489. /** Used for built-in method references. */
  105490. var objectProto = Object.prototype;
  105491. /** Used to check objects for own properties. */
  105492. var hasOwnProperty = objectProto.hasOwnProperty;
  105493. /**
  105494. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  105495. *
  105496. * @private
  105497. * @param {Object} object The object to query.
  105498. * @returns {Array} Returns the array of property names.
  105499. */
  105500. function baseKeysIn(object) {
  105501. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object)) {
  105502. return Object(_nativeKeysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object);
  105503. }
  105504. var isProto = Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object),
  105505. result = [];
  105506. for (var key in object) {
  105507. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  105508. result.push(key);
  105509. }
  105510. }
  105511. return result;
  105512. }
  105513. /* harmony default export */ __webpack_exports__["default"] = (baseKeysIn);
  105514. /***/ }),
  105515. /***/ "./node_modules/lodash-es/_baseLodash.js":
  105516. /*!***********************************************!*\
  105517. !*** ./node_modules/lodash-es/_baseLodash.js ***!
  105518. \***********************************************/
  105519. /*! exports provided: default */
  105520. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105521. "use strict";
  105522. __webpack_require__.r(__webpack_exports__);
  105523. /**
  105524. * The function whose prototype chain sequence wrappers inherit from.
  105525. *
  105526. * @private
  105527. */
  105528. function baseLodash() {
  105529. // No operation performed.
  105530. }
  105531. /* harmony default export */ __webpack_exports__["default"] = (baseLodash);
  105532. /***/ }),
  105533. /***/ "./node_modules/lodash-es/_baseLt.js":
  105534. /*!*******************************************!*\
  105535. !*** ./node_modules/lodash-es/_baseLt.js ***!
  105536. \*******************************************/
  105537. /*! exports provided: default */
  105538. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105539. "use strict";
  105540. __webpack_require__.r(__webpack_exports__);
  105541. /**
  105542. * The base implementation of `_.lt` which doesn't coerce arguments.
  105543. *
  105544. * @private
  105545. * @param {*} value The value to compare.
  105546. * @param {*} other The other value to compare.
  105547. * @returns {boolean} Returns `true` if `value` is less than `other`,
  105548. * else `false`.
  105549. */
  105550. function baseLt(value, other) {
  105551. return value < other;
  105552. }
  105553. /* harmony default export */ __webpack_exports__["default"] = (baseLt);
  105554. /***/ }),
  105555. /***/ "./node_modules/lodash-es/_baseMap.js":
  105556. /*!********************************************!*\
  105557. !*** ./node_modules/lodash-es/_baseMap.js ***!
  105558. \********************************************/
  105559. /*! exports provided: default */
  105560. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105561. "use strict";
  105562. __webpack_require__.r(__webpack_exports__);
  105563. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  105564. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  105565. /**
  105566. * The base implementation of `_.map` without support for iteratee shorthands.
  105567. *
  105568. * @private
  105569. * @param {Array|Object} collection The collection to iterate over.
  105570. * @param {Function} iteratee The function invoked per iteration.
  105571. * @returns {Array} Returns the new mapped array.
  105572. */
  105573. function baseMap(collection, iteratee) {
  105574. var index = -1,
  105575. result = Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection) ? Array(collection.length) : [];
  105576. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, key, collection) {
  105577. result[++index] = iteratee(value, key, collection);
  105578. });
  105579. return result;
  105580. }
  105581. /* harmony default export */ __webpack_exports__["default"] = (baseMap);
  105582. /***/ }),
  105583. /***/ "./node_modules/lodash-es/_baseMatches.js":
  105584. /*!************************************************!*\
  105585. !*** ./node_modules/lodash-es/_baseMatches.js ***!
  105586. \************************************************/
  105587. /*! exports provided: default */
  105588. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105589. "use strict";
  105590. __webpack_require__.r(__webpack_exports__);
  105591. /* harmony import */ var _baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsMatch.js */ "./node_modules/lodash-es/_baseIsMatch.js");
  105592. /* harmony import */ var _getMatchData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getMatchData.js */ "./node_modules/lodash-es/_getMatchData.js");
  105593. /* harmony import */ var _matchesStrictComparable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_matchesStrictComparable.js */ "./node_modules/lodash-es/_matchesStrictComparable.js");
  105594. /**
  105595. * The base implementation of `_.matches` which doesn't clone `source`.
  105596. *
  105597. * @private
  105598. * @param {Object} source The object of property values to match.
  105599. * @returns {Function} Returns the new spec function.
  105600. */
  105601. function baseMatches(source) {
  105602. var matchData = Object(_getMatchData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source);
  105603. if (matchData.length == 1 && matchData[0][2]) {
  105604. return Object(_matchesStrictComparable_js__WEBPACK_IMPORTED_MODULE_2__["default"])(matchData[0][0], matchData[0][1]);
  105605. }
  105606. return function(object) {
  105607. return object === source || Object(_baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, matchData);
  105608. };
  105609. }
  105610. /* harmony default export */ __webpack_exports__["default"] = (baseMatches);
  105611. /***/ }),
  105612. /***/ "./node_modules/lodash-es/_baseMatchesProperty.js":
  105613. /*!********************************************************!*\
  105614. !*** ./node_modules/lodash-es/_baseMatchesProperty.js ***!
  105615. \********************************************************/
  105616. /*! exports provided: default */
  105617. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105618. "use strict";
  105619. __webpack_require__.r(__webpack_exports__);
  105620. /* harmony import */ var _baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsEqual.js */ "./node_modules/lodash-es/_baseIsEqual.js");
  105621. /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
  105622. /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
  105623. /* harmony import */ var _isKey_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isKey.js */ "./node_modules/lodash-es/_isKey.js");
  105624. /* harmony import */ var _isStrictComparable_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isStrictComparable.js */ "./node_modules/lodash-es/_isStrictComparable.js");
  105625. /* harmony import */ var _matchesStrictComparable_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_matchesStrictComparable.js */ "./node_modules/lodash-es/_matchesStrictComparable.js");
  105626. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  105627. /** Used to compose bitmasks for value comparisons. */
  105628. var COMPARE_PARTIAL_FLAG = 1,
  105629. COMPARE_UNORDERED_FLAG = 2;
  105630. /**
  105631. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  105632. *
  105633. * @private
  105634. * @param {string} path The path of the property to get.
  105635. * @param {*} srcValue The value to match.
  105636. * @returns {Function} Returns the new spec function.
  105637. */
  105638. function baseMatchesProperty(path, srcValue) {
  105639. if (Object(_isKey_js__WEBPACK_IMPORTED_MODULE_3__["default"])(path) && Object(_isStrictComparable_js__WEBPACK_IMPORTED_MODULE_4__["default"])(srcValue)) {
  105640. return Object(_matchesStrictComparable_js__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_toKey_js__WEBPACK_IMPORTED_MODULE_6__["default"])(path), srcValue);
  105641. }
  105642. return function(object) {
  105643. var objValue = Object(_get_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path);
  105644. return (objValue === undefined && objValue === srcValue)
  105645. ? Object(_hasIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, path)
  105646. : Object(_baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__["default"])(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  105647. };
  105648. }
  105649. /* harmony default export */ __webpack_exports__["default"] = (baseMatchesProperty);
  105650. /***/ }),
  105651. /***/ "./node_modules/lodash-es/_baseMean.js":
  105652. /*!*********************************************!*\
  105653. !*** ./node_modules/lodash-es/_baseMean.js ***!
  105654. \*********************************************/
  105655. /*! exports provided: default */
  105656. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105657. "use strict";
  105658. __webpack_require__.r(__webpack_exports__);
  105659. /* harmony import */ var _baseSum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSum.js */ "./node_modules/lodash-es/_baseSum.js");
  105660. /** Used as references for various `Number` constants. */
  105661. var NAN = 0 / 0;
  105662. /**
  105663. * The base implementation of `_.mean` and `_.meanBy` without support for
  105664. * iteratee shorthands.
  105665. *
  105666. * @private
  105667. * @param {Array} array The array to iterate over.
  105668. * @param {Function} iteratee The function invoked per iteration.
  105669. * @returns {number} Returns the mean.
  105670. */
  105671. function baseMean(array, iteratee) {
  105672. var length = array == null ? 0 : array.length;
  105673. return length ? (Object(_baseSum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, iteratee) / length) : NAN;
  105674. }
  105675. /* harmony default export */ __webpack_exports__["default"] = (baseMean);
  105676. /***/ }),
  105677. /***/ "./node_modules/lodash-es/_baseMerge.js":
  105678. /*!**********************************************!*\
  105679. !*** ./node_modules/lodash-es/_baseMerge.js ***!
  105680. \**********************************************/
  105681. /*! exports provided: default */
  105682. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105683. "use strict";
  105684. __webpack_require__.r(__webpack_exports__);
  105685. /* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
  105686. /* harmony import */ var _assignMergeValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_assignMergeValue.js */ "./node_modules/lodash-es/_assignMergeValue.js");
  105687. /* harmony import */ var _baseFor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseFor.js */ "./node_modules/lodash-es/_baseFor.js");
  105688. /* harmony import */ var _baseMergeDeep_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseMergeDeep.js */ "./node_modules/lodash-es/_baseMergeDeep.js");
  105689. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  105690. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  105691. /* harmony import */ var _safeGet_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_safeGet.js */ "./node_modules/lodash-es/_safeGet.js");
  105692. /**
  105693. * The base implementation of `_.merge` without support for multiple sources.
  105694. *
  105695. * @private
  105696. * @param {Object} object The destination object.
  105697. * @param {Object} source The source object.
  105698. * @param {number} srcIndex The index of `source`.
  105699. * @param {Function} [customizer] The function to customize merged values.
  105700. * @param {Object} [stack] Tracks traversed source values and their merged
  105701. * counterparts.
  105702. */
  105703. function baseMerge(object, source, srcIndex, customizer, stack) {
  105704. if (object === source) {
  105705. return;
  105706. }
  105707. Object(_baseFor_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source, function(srcValue, key) {
  105708. stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  105709. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(srcValue)) {
  105710. Object(_baseMergeDeep_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object, source, key, srcIndex, baseMerge, customizer, stack);
  105711. }
  105712. else {
  105713. var newValue = customizer
  105714. ? customizer(Object(_safeGet_js__WEBPACK_IMPORTED_MODULE_6__["default"])(object, key), srcValue, (key + ''), object, source, stack)
  105715. : undefined;
  105716. if (newValue === undefined) {
  105717. newValue = srcValue;
  105718. }
  105719. Object(_assignMergeValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key, newValue);
  105720. }
  105721. }, _keysIn_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
  105722. }
  105723. /* harmony default export */ __webpack_exports__["default"] = (baseMerge);
  105724. /***/ }),
  105725. /***/ "./node_modules/lodash-es/_baseMergeDeep.js":
  105726. /*!**************************************************!*\
  105727. !*** ./node_modules/lodash-es/_baseMergeDeep.js ***!
  105728. \**************************************************/
  105729. /*! exports provided: default */
  105730. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105731. "use strict";
  105732. __webpack_require__.r(__webpack_exports__);
  105733. /* harmony import */ var _assignMergeValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignMergeValue.js */ "./node_modules/lodash-es/_assignMergeValue.js");
  105734. /* harmony import */ var _cloneBuffer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_cloneBuffer.js */ "./node_modules/lodash-es/_cloneBuffer.js");
  105735. /* harmony import */ var _cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_cloneTypedArray.js */ "./node_modules/lodash-es/_cloneTypedArray.js");
  105736. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  105737. /* harmony import */ var _initCloneObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_initCloneObject.js */ "./node_modules/lodash-es/_initCloneObject.js");
  105738. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  105739. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  105740. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  105741. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  105742. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  105743. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  105744. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  105745. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  105746. /* harmony import */ var _safeGet_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./_safeGet.js */ "./node_modules/lodash-es/_safeGet.js");
  105747. /* harmony import */ var _toPlainObject_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./toPlainObject.js */ "./node_modules/lodash-es/toPlainObject.js");
  105748. /**
  105749. * A specialized version of `baseMerge` for arrays and objects which performs
  105750. * deep merges and tracks traversed objects enabling objects with circular
  105751. * references to be merged.
  105752. *
  105753. * @private
  105754. * @param {Object} object The destination object.
  105755. * @param {Object} source The source object.
  105756. * @param {string} key The key of the value to merge.
  105757. * @param {number} srcIndex The index of `source`.
  105758. * @param {Function} mergeFunc The function to merge values.
  105759. * @param {Function} [customizer] The function to customize assigned values.
  105760. * @param {Object} [stack] Tracks traversed source values and their merged
  105761. * counterparts.
  105762. */
  105763. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  105764. var objValue = Object(_safeGet_js__WEBPACK_IMPORTED_MODULE_13__["default"])(object, key),
  105765. srcValue = Object(_safeGet_js__WEBPACK_IMPORTED_MODULE_13__["default"])(source, key),
  105766. stacked = stack.get(srcValue);
  105767. if (stacked) {
  105768. Object(_assignMergeValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, stacked);
  105769. return;
  105770. }
  105771. var newValue = customizer
  105772. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  105773. : undefined;
  105774. var isCommon = newValue === undefined;
  105775. if (isCommon) {
  105776. var isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(srcValue),
  105777. isBuff = !isArr && Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_8__["default"])(srcValue),
  105778. isTyped = !isArr && !isBuff && Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_12__["default"])(srcValue);
  105779. newValue = srcValue;
  105780. if (isArr || isBuff || isTyped) {
  105781. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(objValue)) {
  105782. newValue = objValue;
  105783. }
  105784. else if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_7__["default"])(objValue)) {
  105785. newValue = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(objValue);
  105786. }
  105787. else if (isBuff) {
  105788. isCommon = false;
  105789. newValue = Object(_cloneBuffer_js__WEBPACK_IMPORTED_MODULE_1__["default"])(srcValue, true);
  105790. }
  105791. else if (isTyped) {
  105792. isCommon = false;
  105793. newValue = Object(_cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(srcValue, true);
  105794. }
  105795. else {
  105796. newValue = [];
  105797. }
  105798. }
  105799. else if (Object(_isPlainObject_js__WEBPACK_IMPORTED_MODULE_11__["default"])(srcValue) || Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_5__["default"])(srcValue)) {
  105800. newValue = objValue;
  105801. if (Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_5__["default"])(objValue)) {
  105802. newValue = Object(_toPlainObject_js__WEBPACK_IMPORTED_MODULE_14__["default"])(objValue);
  105803. }
  105804. else if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_10__["default"])(objValue) || Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_9__["default"])(objValue)) {
  105805. newValue = Object(_initCloneObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(srcValue);
  105806. }
  105807. }
  105808. else {
  105809. isCommon = false;
  105810. }
  105811. }
  105812. if (isCommon) {
  105813. // Recursively merge objects and arrays (susceptible to call stack limits).
  105814. stack.set(srcValue, newValue);
  105815. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  105816. stack['delete'](srcValue);
  105817. }
  105818. Object(_assignMergeValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, newValue);
  105819. }
  105820. /* harmony default export */ __webpack_exports__["default"] = (baseMergeDeep);
  105821. /***/ }),
  105822. /***/ "./node_modules/lodash-es/_baseNth.js":
  105823. /*!********************************************!*\
  105824. !*** ./node_modules/lodash-es/_baseNth.js ***!
  105825. \********************************************/
  105826. /*! exports provided: default */
  105827. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105828. "use strict";
  105829. __webpack_require__.r(__webpack_exports__);
  105830. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  105831. /**
  105832. * The base implementation of `_.nth` which doesn't coerce arguments.
  105833. *
  105834. * @private
  105835. * @param {Array} array The array to query.
  105836. * @param {number} n The index of the element to return.
  105837. * @returns {*} Returns the nth element of `array`.
  105838. */
  105839. function baseNth(array, n) {
  105840. var length = array.length;
  105841. if (!length) {
  105842. return;
  105843. }
  105844. n += n < 0 ? length : 0;
  105845. return Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n, length) ? array[n] : undefined;
  105846. }
  105847. /* harmony default export */ __webpack_exports__["default"] = (baseNth);
  105848. /***/ }),
  105849. /***/ "./node_modules/lodash-es/_baseOrderBy.js":
  105850. /*!************************************************!*\
  105851. !*** ./node_modules/lodash-es/_baseOrderBy.js ***!
  105852. \************************************************/
  105853. /*! exports provided: default */
  105854. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105855. "use strict";
  105856. __webpack_require__.r(__webpack_exports__);
  105857. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  105858. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  105859. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  105860. /* harmony import */ var _baseMap_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseMap.js */ "./node_modules/lodash-es/_baseMap.js");
  105861. /* harmony import */ var _baseSortBy_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseSortBy.js */ "./node_modules/lodash-es/_baseSortBy.js");
  105862. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  105863. /* harmony import */ var _compareMultiple_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_compareMultiple.js */ "./node_modules/lodash-es/_compareMultiple.js");
  105864. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  105865. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  105866. /**
  105867. * The base implementation of `_.orderBy` without param guards.
  105868. *
  105869. * @private
  105870. * @param {Array|Object} collection The collection to iterate over.
  105871. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  105872. * @param {string[]} orders The sort orders of `iteratees`.
  105873. * @returns {Array} Returns the new sorted array.
  105874. */
  105875. function baseOrderBy(collection, iteratees, orders) {
  105876. if (iteratees.length) {
  105877. iteratees = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratees, function(iteratee) {
  105878. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_8__["default"])(iteratee)) {
  105879. return function(value) {
  105880. return Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  105881. }
  105882. }
  105883. return iteratee;
  105884. });
  105885. } else {
  105886. iteratees = [_identity_js__WEBPACK_IMPORTED_MODULE_7__["default"]];
  105887. }
  105888. var index = -1;
  105889. iteratees = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratees, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"]));
  105890. var result = Object(_baseMap_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection, function(value, key, collection) {
  105891. var criteria = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratees, function(iteratee) {
  105892. return iteratee(value);
  105893. });
  105894. return { 'criteria': criteria, 'index': ++index, 'value': value };
  105895. });
  105896. return Object(_baseSortBy_js__WEBPACK_IMPORTED_MODULE_4__["default"])(result, function(object, other) {
  105897. return Object(_compareMultiple_js__WEBPACK_IMPORTED_MODULE_6__["default"])(object, other, orders);
  105898. });
  105899. }
  105900. /* harmony default export */ __webpack_exports__["default"] = (baseOrderBy);
  105901. /***/ }),
  105902. /***/ "./node_modules/lodash-es/_basePick.js":
  105903. /*!*********************************************!*\
  105904. !*** ./node_modules/lodash-es/_basePick.js ***!
  105905. \*********************************************/
  105906. /*! exports provided: default */
  105907. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105908. "use strict";
  105909. __webpack_require__.r(__webpack_exports__);
  105910. /* harmony import */ var _basePickBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePickBy.js */ "./node_modules/lodash-es/_basePickBy.js");
  105911. /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
  105912. /**
  105913. * The base implementation of `_.pick` without support for individual
  105914. * property identifiers.
  105915. *
  105916. * @private
  105917. * @param {Object} object The source object.
  105918. * @param {string[]} paths The property paths to pick.
  105919. * @returns {Object} Returns the new object.
  105920. */
  105921. function basePick(object, paths) {
  105922. return Object(_basePickBy_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, paths, function(value, path) {
  105923. return Object(_hasIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path);
  105924. });
  105925. }
  105926. /* harmony default export */ __webpack_exports__["default"] = (basePick);
  105927. /***/ }),
  105928. /***/ "./node_modules/lodash-es/_basePickBy.js":
  105929. /*!***********************************************!*\
  105930. !*** ./node_modules/lodash-es/_basePickBy.js ***!
  105931. \***********************************************/
  105932. /*! exports provided: default */
  105933. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105934. "use strict";
  105935. __webpack_require__.r(__webpack_exports__);
  105936. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  105937. /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
  105938. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  105939. /**
  105940. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  105941. *
  105942. * @private
  105943. * @param {Object} object The source object.
  105944. * @param {string[]} paths The property paths to pick.
  105945. * @param {Function} predicate The function invoked per property.
  105946. * @returns {Object} Returns the new object.
  105947. */
  105948. function basePickBy(object, paths, predicate) {
  105949. var index = -1,
  105950. length = paths.length,
  105951. result = {};
  105952. while (++index < length) {
  105953. var path = paths[index],
  105954. value = Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
  105955. if (predicate(value, path)) {
  105956. Object(_baseSet_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, Object(_castPath_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path, object), value);
  105957. }
  105958. }
  105959. return result;
  105960. }
  105961. /* harmony default export */ __webpack_exports__["default"] = (basePickBy);
  105962. /***/ }),
  105963. /***/ "./node_modules/lodash-es/_baseProperty.js":
  105964. /*!*************************************************!*\
  105965. !*** ./node_modules/lodash-es/_baseProperty.js ***!
  105966. \*************************************************/
  105967. /*! exports provided: default */
  105968. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105969. "use strict";
  105970. __webpack_require__.r(__webpack_exports__);
  105971. /**
  105972. * The base implementation of `_.property` without support for deep paths.
  105973. *
  105974. * @private
  105975. * @param {string} key The key of the property to get.
  105976. * @returns {Function} Returns the new accessor function.
  105977. */
  105978. function baseProperty(key) {
  105979. return function(object) {
  105980. return object == null ? undefined : object[key];
  105981. };
  105982. }
  105983. /* harmony default export */ __webpack_exports__["default"] = (baseProperty);
  105984. /***/ }),
  105985. /***/ "./node_modules/lodash-es/_basePropertyDeep.js":
  105986. /*!*****************************************************!*\
  105987. !*** ./node_modules/lodash-es/_basePropertyDeep.js ***!
  105988. \*****************************************************/
  105989. /*! exports provided: default */
  105990. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105991. "use strict";
  105992. __webpack_require__.r(__webpack_exports__);
  105993. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  105994. /**
  105995. * A specialized version of `baseProperty` which supports deep paths.
  105996. *
  105997. * @private
  105998. * @param {Array|string} path The path of the property to get.
  105999. * @returns {Function} Returns the new accessor function.
  106000. */
  106001. function basePropertyDeep(path) {
  106002. return function(object) {
  106003. return Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
  106004. };
  106005. }
  106006. /* harmony default export */ __webpack_exports__["default"] = (basePropertyDeep);
  106007. /***/ }),
  106008. /***/ "./node_modules/lodash-es/_basePropertyOf.js":
  106009. /*!***************************************************!*\
  106010. !*** ./node_modules/lodash-es/_basePropertyOf.js ***!
  106011. \***************************************************/
  106012. /*! exports provided: default */
  106013. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106014. "use strict";
  106015. __webpack_require__.r(__webpack_exports__);
  106016. /**
  106017. * The base implementation of `_.propertyOf` without support for deep paths.
  106018. *
  106019. * @private
  106020. * @param {Object} object The object to query.
  106021. * @returns {Function} Returns the new accessor function.
  106022. */
  106023. function basePropertyOf(object) {
  106024. return function(key) {
  106025. return object == null ? undefined : object[key];
  106026. };
  106027. }
  106028. /* harmony default export */ __webpack_exports__["default"] = (basePropertyOf);
  106029. /***/ }),
  106030. /***/ "./node_modules/lodash-es/_basePullAll.js":
  106031. /*!************************************************!*\
  106032. !*** ./node_modules/lodash-es/_basePullAll.js ***!
  106033. \************************************************/
  106034. /*! exports provided: default */
  106035. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106036. "use strict";
  106037. __webpack_require__.r(__webpack_exports__);
  106038. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  106039. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  106040. /* harmony import */ var _baseIndexOfWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIndexOfWith.js */ "./node_modules/lodash-es/_baseIndexOfWith.js");
  106041. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  106042. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  106043. /** Used for built-in method references. */
  106044. var arrayProto = Array.prototype;
  106045. /** Built-in value references. */
  106046. var splice = arrayProto.splice;
  106047. /**
  106048. * The base implementation of `_.pullAllBy` without support for iteratee
  106049. * shorthands.
  106050. *
  106051. * @private
  106052. * @param {Array} array The array to modify.
  106053. * @param {Array} values The values to remove.
  106054. * @param {Function} [iteratee] The iteratee invoked per element.
  106055. * @param {Function} [comparator] The comparator invoked per element.
  106056. * @returns {Array} Returns `array`.
  106057. */
  106058. function basePullAll(array, values, iteratee, comparator) {
  106059. var indexOf = comparator ? _baseIndexOfWith_js__WEBPACK_IMPORTED_MODULE_2__["default"] : _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  106060. index = -1,
  106061. length = values.length,
  106062. seen = array;
  106063. if (array === values) {
  106064. values = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(values);
  106065. }
  106066. if (iteratee) {
  106067. seen = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_3__["default"])(iteratee));
  106068. }
  106069. while (++index < length) {
  106070. var fromIndex = 0,
  106071. value = values[index],
  106072. computed = iteratee ? iteratee(value) : value;
  106073. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  106074. if (seen !== array) {
  106075. splice.call(seen, fromIndex, 1);
  106076. }
  106077. splice.call(array, fromIndex, 1);
  106078. }
  106079. }
  106080. return array;
  106081. }
  106082. /* harmony default export */ __webpack_exports__["default"] = (basePullAll);
  106083. /***/ }),
  106084. /***/ "./node_modules/lodash-es/_basePullAt.js":
  106085. /*!***********************************************!*\
  106086. !*** ./node_modules/lodash-es/_basePullAt.js ***!
  106087. \***********************************************/
  106088. /*! exports provided: default */
  106089. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106090. "use strict";
  106091. __webpack_require__.r(__webpack_exports__);
  106092. /* harmony import */ var _baseUnset_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUnset.js */ "./node_modules/lodash-es/_baseUnset.js");
  106093. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  106094. /** Used for built-in method references. */
  106095. var arrayProto = Array.prototype;
  106096. /** Built-in value references. */
  106097. var splice = arrayProto.splice;
  106098. /**
  106099. * The base implementation of `_.pullAt` without support for individual
  106100. * indexes or capturing the removed elements.
  106101. *
  106102. * @private
  106103. * @param {Array} array The array to modify.
  106104. * @param {number[]} indexes The indexes of elements to remove.
  106105. * @returns {Array} Returns `array`.
  106106. */
  106107. function basePullAt(array, indexes) {
  106108. var length = array ? indexes.length : 0,
  106109. lastIndex = length - 1;
  106110. while (length--) {
  106111. var index = indexes[length];
  106112. if (length == lastIndex || index !== previous) {
  106113. var previous = index;
  106114. if (Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"])(index)) {
  106115. splice.call(array, index, 1);
  106116. } else {
  106117. Object(_baseUnset_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, index);
  106118. }
  106119. }
  106120. }
  106121. return array;
  106122. }
  106123. /* harmony default export */ __webpack_exports__["default"] = (basePullAt);
  106124. /***/ }),
  106125. /***/ "./node_modules/lodash-es/_baseRandom.js":
  106126. /*!***********************************************!*\
  106127. !*** ./node_modules/lodash-es/_baseRandom.js ***!
  106128. \***********************************************/
  106129. /*! exports provided: default */
  106130. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106131. "use strict";
  106132. __webpack_require__.r(__webpack_exports__);
  106133. /* Built-in method references for those with the same name as other `lodash` methods. */
  106134. var nativeFloor = Math.floor,
  106135. nativeRandom = Math.random;
  106136. /**
  106137. * The base implementation of `_.random` without support for returning
  106138. * floating-point numbers.
  106139. *
  106140. * @private
  106141. * @param {number} lower The lower bound.
  106142. * @param {number} upper The upper bound.
  106143. * @returns {number} Returns the random number.
  106144. */
  106145. function baseRandom(lower, upper) {
  106146. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  106147. }
  106148. /* harmony default export */ __webpack_exports__["default"] = (baseRandom);
  106149. /***/ }),
  106150. /***/ "./node_modules/lodash-es/_baseRange.js":
  106151. /*!**********************************************!*\
  106152. !*** ./node_modules/lodash-es/_baseRange.js ***!
  106153. \**********************************************/
  106154. /*! exports provided: default */
  106155. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106156. "use strict";
  106157. __webpack_require__.r(__webpack_exports__);
  106158. /* Built-in method references for those with the same name as other `lodash` methods. */
  106159. var nativeCeil = Math.ceil,
  106160. nativeMax = Math.max;
  106161. /**
  106162. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  106163. * coerce arguments.
  106164. *
  106165. * @private
  106166. * @param {number} start The start of the range.
  106167. * @param {number} end The end of the range.
  106168. * @param {number} step The value to increment or decrement by.
  106169. * @param {boolean} [fromRight] Specify iterating from right to left.
  106170. * @returns {Array} Returns the range of numbers.
  106171. */
  106172. function baseRange(start, end, step, fromRight) {
  106173. var index = -1,
  106174. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  106175. result = Array(length);
  106176. while (length--) {
  106177. result[fromRight ? length : ++index] = start;
  106178. start += step;
  106179. }
  106180. return result;
  106181. }
  106182. /* harmony default export */ __webpack_exports__["default"] = (baseRange);
  106183. /***/ }),
  106184. /***/ "./node_modules/lodash-es/_baseReduce.js":
  106185. /*!***********************************************!*\
  106186. !*** ./node_modules/lodash-es/_baseReduce.js ***!
  106187. \***********************************************/
  106188. /*! exports provided: default */
  106189. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106190. "use strict";
  106191. __webpack_require__.r(__webpack_exports__);
  106192. /**
  106193. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  106194. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  106195. *
  106196. * @private
  106197. * @param {Array|Object} collection The collection to iterate over.
  106198. * @param {Function} iteratee The function invoked per iteration.
  106199. * @param {*} accumulator The initial value.
  106200. * @param {boolean} initAccum Specify using the first or last element of
  106201. * `collection` as the initial value.
  106202. * @param {Function} eachFunc The function to iterate over `collection`.
  106203. * @returns {*} Returns the accumulated value.
  106204. */
  106205. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  106206. eachFunc(collection, function(value, index, collection) {
  106207. accumulator = initAccum
  106208. ? (initAccum = false, value)
  106209. : iteratee(accumulator, value, index, collection);
  106210. });
  106211. return accumulator;
  106212. }
  106213. /* harmony default export */ __webpack_exports__["default"] = (baseReduce);
  106214. /***/ }),
  106215. /***/ "./node_modules/lodash-es/_baseRepeat.js":
  106216. /*!***********************************************!*\
  106217. !*** ./node_modules/lodash-es/_baseRepeat.js ***!
  106218. \***********************************************/
  106219. /*! exports provided: default */
  106220. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106221. "use strict";
  106222. __webpack_require__.r(__webpack_exports__);
  106223. /** Used as references for various `Number` constants. */
  106224. var MAX_SAFE_INTEGER = 9007199254740991;
  106225. /* Built-in method references for those with the same name as other `lodash` methods. */
  106226. var nativeFloor = Math.floor;
  106227. /**
  106228. * The base implementation of `_.repeat` which doesn't coerce arguments.
  106229. *
  106230. * @private
  106231. * @param {string} string The string to repeat.
  106232. * @param {number} n The number of times to repeat the string.
  106233. * @returns {string} Returns the repeated string.
  106234. */
  106235. function baseRepeat(string, n) {
  106236. var result = '';
  106237. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  106238. return result;
  106239. }
  106240. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  106241. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  106242. do {
  106243. if (n % 2) {
  106244. result += string;
  106245. }
  106246. n = nativeFloor(n / 2);
  106247. if (n) {
  106248. string += string;
  106249. }
  106250. } while (n);
  106251. return result;
  106252. }
  106253. /* harmony default export */ __webpack_exports__["default"] = (baseRepeat);
  106254. /***/ }),
  106255. /***/ "./node_modules/lodash-es/_baseRest.js":
  106256. /*!*********************************************!*\
  106257. !*** ./node_modules/lodash-es/_baseRest.js ***!
  106258. \*********************************************/
  106259. /*! exports provided: default */
  106260. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106261. "use strict";
  106262. __webpack_require__.r(__webpack_exports__);
  106263. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  106264. /* harmony import */ var _overRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_overRest.js */ "./node_modules/lodash-es/_overRest.js");
  106265. /* harmony import */ var _setToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setToString.js */ "./node_modules/lodash-es/_setToString.js");
  106266. /**
  106267. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  106268. *
  106269. * @private
  106270. * @param {Function} func The function to apply a rest parameter to.
  106271. * @param {number} [start=func.length-1] The start position of the rest parameter.
  106272. * @returns {Function} Returns the new function.
  106273. */
  106274. function baseRest(func, start) {
  106275. return Object(_setToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_overRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, start, _identity_js__WEBPACK_IMPORTED_MODULE_0__["default"]), func + '');
  106276. }
  106277. /* harmony default export */ __webpack_exports__["default"] = (baseRest);
  106278. /***/ }),
  106279. /***/ "./node_modules/lodash-es/_baseSample.js":
  106280. /*!***********************************************!*\
  106281. !*** ./node_modules/lodash-es/_baseSample.js ***!
  106282. \***********************************************/
  106283. /*! exports provided: default */
  106284. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106285. "use strict";
  106286. __webpack_require__.r(__webpack_exports__);
  106287. /* harmony import */ var _arraySample_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySample.js */ "./node_modules/lodash-es/_arraySample.js");
  106288. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  106289. /**
  106290. * The base implementation of `_.sample`.
  106291. *
  106292. * @private
  106293. * @param {Array|Object} collection The collection to sample.
  106294. * @returns {*} Returns the random element.
  106295. */
  106296. function baseSample(collection) {
  106297. return Object(_arraySample_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_values_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection));
  106298. }
  106299. /* harmony default export */ __webpack_exports__["default"] = (baseSample);
  106300. /***/ }),
  106301. /***/ "./node_modules/lodash-es/_baseSampleSize.js":
  106302. /*!***************************************************!*\
  106303. !*** ./node_modules/lodash-es/_baseSampleSize.js ***!
  106304. \***************************************************/
  106305. /*! exports provided: default */
  106306. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106307. "use strict";
  106308. __webpack_require__.r(__webpack_exports__);
  106309. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  106310. /* harmony import */ var _shuffleSelf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_shuffleSelf.js */ "./node_modules/lodash-es/_shuffleSelf.js");
  106311. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  106312. /**
  106313. * The base implementation of `_.sampleSize` without param guards.
  106314. *
  106315. * @private
  106316. * @param {Array|Object} collection The collection to sample.
  106317. * @param {number} n The number of elements to sample.
  106318. * @returns {Array} Returns the random elements.
  106319. */
  106320. function baseSampleSize(collection, n) {
  106321. var array = Object(_values_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection);
  106322. return Object(_shuffleSelf_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n, 0, array.length));
  106323. }
  106324. /* harmony default export */ __webpack_exports__["default"] = (baseSampleSize);
  106325. /***/ }),
  106326. /***/ "./node_modules/lodash-es/_baseSet.js":
  106327. /*!********************************************!*\
  106328. !*** ./node_modules/lodash-es/_baseSet.js ***!
  106329. \********************************************/
  106330. /*! exports provided: default */
  106331. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106332. "use strict";
  106333. __webpack_require__.r(__webpack_exports__);
  106334. /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
  106335. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  106336. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  106337. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  106338. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  106339. /**
  106340. * The base implementation of `_.set`.
  106341. *
  106342. * @private
  106343. * @param {Object} object The object to modify.
  106344. * @param {Array|string} path The path of the property to set.
  106345. * @param {*} value The value to set.
  106346. * @param {Function} [customizer] The function to customize path creation.
  106347. * @returns {Object} Returns `object`.
  106348. */
  106349. function baseSet(object, path, value, customizer) {
  106350. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object)) {
  106351. return object;
  106352. }
  106353. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path, object);
  106354. var index = -1,
  106355. length = path.length,
  106356. lastIndex = length - 1,
  106357. nested = object;
  106358. while (nested != null && ++index < length) {
  106359. var key = Object(_toKey_js__WEBPACK_IMPORTED_MODULE_4__["default"])(path[index]),
  106360. newValue = value;
  106361. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  106362. return object;
  106363. }
  106364. if (index != lastIndex) {
  106365. var objValue = nested[key];
  106366. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  106367. if (newValue === undefined) {
  106368. newValue = Object(_isObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(objValue)
  106369. ? objValue
  106370. : (Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path[index + 1]) ? [] : {});
  106371. }
  106372. }
  106373. Object(_assignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nested, key, newValue);
  106374. nested = nested[key];
  106375. }
  106376. return object;
  106377. }
  106378. /* harmony default export */ __webpack_exports__["default"] = (baseSet);
  106379. /***/ }),
  106380. /***/ "./node_modules/lodash-es/_baseSetData.js":
  106381. /*!************************************************!*\
  106382. !*** ./node_modules/lodash-es/_baseSetData.js ***!
  106383. \************************************************/
  106384. /*! exports provided: default */
  106385. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106386. "use strict";
  106387. __webpack_require__.r(__webpack_exports__);
  106388. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  106389. /* harmony import */ var _metaMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_metaMap.js */ "./node_modules/lodash-es/_metaMap.js");
  106390. /**
  106391. * The base implementation of `setData` without support for hot loop shorting.
  106392. *
  106393. * @private
  106394. * @param {Function} func The function to associate metadata with.
  106395. * @param {*} data The metadata.
  106396. * @returns {Function} Returns `func`.
  106397. */
  106398. var baseSetData = !_metaMap_js__WEBPACK_IMPORTED_MODULE_1__["default"] ? _identity_js__WEBPACK_IMPORTED_MODULE_0__["default"] : function(func, data) {
  106399. _metaMap_js__WEBPACK_IMPORTED_MODULE_1__["default"].set(func, data);
  106400. return func;
  106401. };
  106402. /* harmony default export */ __webpack_exports__["default"] = (baseSetData);
  106403. /***/ }),
  106404. /***/ "./node_modules/lodash-es/_baseSetToString.js":
  106405. /*!****************************************************!*\
  106406. !*** ./node_modules/lodash-es/_baseSetToString.js ***!
  106407. \****************************************************/
  106408. /*! exports provided: default */
  106409. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106410. "use strict";
  106411. __webpack_require__.r(__webpack_exports__);
  106412. /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
  106413. /* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_defineProperty.js */ "./node_modules/lodash-es/_defineProperty.js");
  106414. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  106415. /**
  106416. * The base implementation of `setToString` without support for hot loop shorting.
  106417. *
  106418. * @private
  106419. * @param {Function} func The function to modify.
  106420. * @param {Function} string The `toString` result.
  106421. * @returns {Function} Returns `func`.
  106422. */
  106423. var baseSetToString = !_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"] ? _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"] : function(func, string) {
  106424. return Object(_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, 'toString', {
  106425. 'configurable': true,
  106426. 'enumerable': false,
  106427. 'value': Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string),
  106428. 'writable': true
  106429. });
  106430. };
  106431. /* harmony default export */ __webpack_exports__["default"] = (baseSetToString);
  106432. /***/ }),
  106433. /***/ "./node_modules/lodash-es/_baseShuffle.js":
  106434. /*!************************************************!*\
  106435. !*** ./node_modules/lodash-es/_baseShuffle.js ***!
  106436. \************************************************/
  106437. /*! exports provided: default */
  106438. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106439. "use strict";
  106440. __webpack_require__.r(__webpack_exports__);
  106441. /* harmony import */ var _shuffleSelf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_shuffleSelf.js */ "./node_modules/lodash-es/_shuffleSelf.js");
  106442. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  106443. /**
  106444. * The base implementation of `_.shuffle`.
  106445. *
  106446. * @private
  106447. * @param {Array|Object} collection The collection to shuffle.
  106448. * @returns {Array} Returns the new shuffled array.
  106449. */
  106450. function baseShuffle(collection) {
  106451. return Object(_shuffleSelf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_values_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection));
  106452. }
  106453. /* harmony default export */ __webpack_exports__["default"] = (baseShuffle);
  106454. /***/ }),
  106455. /***/ "./node_modules/lodash-es/_baseSlice.js":
  106456. /*!**********************************************!*\
  106457. !*** ./node_modules/lodash-es/_baseSlice.js ***!
  106458. \**********************************************/
  106459. /*! exports provided: default */
  106460. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106461. "use strict";
  106462. __webpack_require__.r(__webpack_exports__);
  106463. /**
  106464. * The base implementation of `_.slice` without an iteratee call guard.
  106465. *
  106466. * @private
  106467. * @param {Array} array The array to slice.
  106468. * @param {number} [start=0] The start position.
  106469. * @param {number} [end=array.length] The end position.
  106470. * @returns {Array} Returns the slice of `array`.
  106471. */
  106472. function baseSlice(array, start, end) {
  106473. var index = -1,
  106474. length = array.length;
  106475. if (start < 0) {
  106476. start = -start > length ? 0 : (length + start);
  106477. }
  106478. end = end > length ? length : end;
  106479. if (end < 0) {
  106480. end += length;
  106481. }
  106482. length = start > end ? 0 : ((end - start) >>> 0);
  106483. start >>>= 0;
  106484. var result = Array(length);
  106485. while (++index < length) {
  106486. result[index] = array[index + start];
  106487. }
  106488. return result;
  106489. }
  106490. /* harmony default export */ __webpack_exports__["default"] = (baseSlice);
  106491. /***/ }),
  106492. /***/ "./node_modules/lodash-es/_baseSome.js":
  106493. /*!*********************************************!*\
  106494. !*** ./node_modules/lodash-es/_baseSome.js ***!
  106495. \*********************************************/
  106496. /*! exports provided: default */
  106497. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106498. "use strict";
  106499. __webpack_require__.r(__webpack_exports__);
  106500. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  106501. /**
  106502. * The base implementation of `_.some` without support for iteratee shorthands.
  106503. *
  106504. * @private
  106505. * @param {Array|Object} collection The collection to iterate over.
  106506. * @param {Function} predicate The function invoked per iteration.
  106507. * @returns {boolean} Returns `true` if any element passes the predicate check,
  106508. * else `false`.
  106509. */
  106510. function baseSome(collection, predicate) {
  106511. var result;
  106512. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, index, collection) {
  106513. result = predicate(value, index, collection);
  106514. return !result;
  106515. });
  106516. return !!result;
  106517. }
  106518. /* harmony default export */ __webpack_exports__["default"] = (baseSome);
  106519. /***/ }),
  106520. /***/ "./node_modules/lodash-es/_baseSortBy.js":
  106521. /*!***********************************************!*\
  106522. !*** ./node_modules/lodash-es/_baseSortBy.js ***!
  106523. \***********************************************/
  106524. /*! exports provided: default */
  106525. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106526. "use strict";
  106527. __webpack_require__.r(__webpack_exports__);
  106528. /**
  106529. * The base implementation of `_.sortBy` which uses `comparer` to define the
  106530. * sort order of `array` and replaces criteria objects with their corresponding
  106531. * values.
  106532. *
  106533. * @private
  106534. * @param {Array} array The array to sort.
  106535. * @param {Function} comparer The function to define sort order.
  106536. * @returns {Array} Returns `array`.
  106537. */
  106538. function baseSortBy(array, comparer) {
  106539. var length = array.length;
  106540. array.sort(comparer);
  106541. while (length--) {
  106542. array[length] = array[length].value;
  106543. }
  106544. return array;
  106545. }
  106546. /* harmony default export */ __webpack_exports__["default"] = (baseSortBy);
  106547. /***/ }),
  106548. /***/ "./node_modules/lodash-es/_baseSortedIndex.js":
  106549. /*!****************************************************!*\
  106550. !*** ./node_modules/lodash-es/_baseSortedIndex.js ***!
  106551. \****************************************************/
  106552. /*! exports provided: default */
  106553. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106554. "use strict";
  106555. __webpack_require__.r(__webpack_exports__);
  106556. /* harmony import */ var _baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndexBy.js */ "./node_modules/lodash-es/_baseSortedIndexBy.js");
  106557. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  106558. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  106559. /** Used as references for the maximum length and index of an array. */
  106560. var MAX_ARRAY_LENGTH = 4294967295,
  106561. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  106562. /**
  106563. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  106564. * performs a binary search of `array` to determine the index at which `value`
  106565. * should be inserted into `array` in order to maintain its sort order.
  106566. *
  106567. * @private
  106568. * @param {Array} array The sorted array to inspect.
  106569. * @param {*} value The value to evaluate.
  106570. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  106571. * @returns {number} Returns the index at which `value` should be inserted
  106572. * into `array`.
  106573. */
  106574. function baseSortedIndex(array, value, retHighest) {
  106575. var low = 0,
  106576. high = array == null ? low : array.length;
  106577. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  106578. while (low < high) {
  106579. var mid = (low + high) >>> 1,
  106580. computed = array[mid];
  106581. if (computed !== null && !Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_2__["default"])(computed) &&
  106582. (retHighest ? (computed <= value) : (computed < value))) {
  106583. low = mid + 1;
  106584. } else {
  106585. high = mid;
  106586. }
  106587. }
  106588. return high;
  106589. }
  106590. return Object(_baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, _identity_js__WEBPACK_IMPORTED_MODULE_1__["default"], retHighest);
  106591. }
  106592. /* harmony default export */ __webpack_exports__["default"] = (baseSortedIndex);
  106593. /***/ }),
  106594. /***/ "./node_modules/lodash-es/_baseSortedIndexBy.js":
  106595. /*!******************************************************!*\
  106596. !*** ./node_modules/lodash-es/_baseSortedIndexBy.js ***!
  106597. \******************************************************/
  106598. /*! exports provided: default */
  106599. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106600. "use strict";
  106601. __webpack_require__.r(__webpack_exports__);
  106602. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  106603. /** Used as references for the maximum length and index of an array. */
  106604. var MAX_ARRAY_LENGTH = 4294967295,
  106605. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;
  106606. /* Built-in method references for those with the same name as other `lodash` methods. */
  106607. var nativeFloor = Math.floor,
  106608. nativeMin = Math.min;
  106609. /**
  106610. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  106611. * which invokes `iteratee` for `value` and each element of `array` to compute
  106612. * their sort ranking. The iteratee is invoked with one argument; (value).
  106613. *
  106614. * @private
  106615. * @param {Array} array The sorted array to inspect.
  106616. * @param {*} value The value to evaluate.
  106617. * @param {Function} iteratee The iteratee invoked per element.
  106618. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  106619. * @returns {number} Returns the index at which `value` should be inserted
  106620. * into `array`.
  106621. */
  106622. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  106623. var low = 0,
  106624. high = array == null ? 0 : array.length;
  106625. if (high === 0) {
  106626. return 0;
  106627. }
  106628. value = iteratee(value);
  106629. var valIsNaN = value !== value,
  106630. valIsNull = value === null,
  106631. valIsSymbol = Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value),
  106632. valIsUndefined = value === undefined;
  106633. while (low < high) {
  106634. var mid = nativeFloor((low + high) / 2),
  106635. computed = iteratee(array[mid]),
  106636. othIsDefined = computed !== undefined,
  106637. othIsNull = computed === null,
  106638. othIsReflexive = computed === computed,
  106639. othIsSymbol = Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(computed);
  106640. if (valIsNaN) {
  106641. var setLow = retHighest || othIsReflexive;
  106642. } else if (valIsUndefined) {
  106643. setLow = othIsReflexive && (retHighest || othIsDefined);
  106644. } else if (valIsNull) {
  106645. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  106646. } else if (valIsSymbol) {
  106647. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  106648. } else if (othIsNull || othIsSymbol) {
  106649. setLow = false;
  106650. } else {
  106651. setLow = retHighest ? (computed <= value) : (computed < value);
  106652. }
  106653. if (setLow) {
  106654. low = mid + 1;
  106655. } else {
  106656. high = mid;
  106657. }
  106658. }
  106659. return nativeMin(high, MAX_ARRAY_INDEX);
  106660. }
  106661. /* harmony default export */ __webpack_exports__["default"] = (baseSortedIndexBy);
  106662. /***/ }),
  106663. /***/ "./node_modules/lodash-es/_baseSortedUniq.js":
  106664. /*!***************************************************!*\
  106665. !*** ./node_modules/lodash-es/_baseSortedUniq.js ***!
  106666. \***************************************************/
  106667. /*! exports provided: default */
  106668. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106669. "use strict";
  106670. __webpack_require__.r(__webpack_exports__);
  106671. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  106672. /**
  106673. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  106674. * support for iteratee shorthands.
  106675. *
  106676. * @private
  106677. * @param {Array} array The array to inspect.
  106678. * @param {Function} [iteratee] The iteratee invoked per element.
  106679. * @returns {Array} Returns the new duplicate free array.
  106680. */
  106681. function baseSortedUniq(array, iteratee) {
  106682. var index = -1,
  106683. length = array.length,
  106684. resIndex = 0,
  106685. result = [];
  106686. while (++index < length) {
  106687. var value = array[index],
  106688. computed = iteratee ? iteratee(value) : value;
  106689. if (!index || !Object(_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(computed, seen)) {
  106690. var seen = computed;
  106691. result[resIndex++] = value === 0 ? 0 : value;
  106692. }
  106693. }
  106694. return result;
  106695. }
  106696. /* harmony default export */ __webpack_exports__["default"] = (baseSortedUniq);
  106697. /***/ }),
  106698. /***/ "./node_modules/lodash-es/_baseSum.js":
  106699. /*!********************************************!*\
  106700. !*** ./node_modules/lodash-es/_baseSum.js ***!
  106701. \********************************************/
  106702. /*! exports provided: default */
  106703. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106704. "use strict";
  106705. __webpack_require__.r(__webpack_exports__);
  106706. /**
  106707. * The base implementation of `_.sum` and `_.sumBy` without support for
  106708. * iteratee shorthands.
  106709. *
  106710. * @private
  106711. * @param {Array} array The array to iterate over.
  106712. * @param {Function} iteratee The function invoked per iteration.
  106713. * @returns {number} Returns the sum.
  106714. */
  106715. function baseSum(array, iteratee) {
  106716. var result,
  106717. index = -1,
  106718. length = array.length;
  106719. while (++index < length) {
  106720. var current = iteratee(array[index]);
  106721. if (current !== undefined) {
  106722. result = result === undefined ? current : (result + current);
  106723. }
  106724. }
  106725. return result;
  106726. }
  106727. /* harmony default export */ __webpack_exports__["default"] = (baseSum);
  106728. /***/ }),
  106729. /***/ "./node_modules/lodash-es/_baseTimes.js":
  106730. /*!**********************************************!*\
  106731. !*** ./node_modules/lodash-es/_baseTimes.js ***!
  106732. \**********************************************/
  106733. /*! exports provided: default */
  106734. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106735. "use strict";
  106736. __webpack_require__.r(__webpack_exports__);
  106737. /**
  106738. * The base implementation of `_.times` without support for iteratee shorthands
  106739. * or max array length checks.
  106740. *
  106741. * @private
  106742. * @param {number} n The number of times to invoke `iteratee`.
  106743. * @param {Function} iteratee The function invoked per iteration.
  106744. * @returns {Array} Returns the array of results.
  106745. */
  106746. function baseTimes(n, iteratee) {
  106747. var index = -1,
  106748. result = Array(n);
  106749. while (++index < n) {
  106750. result[index] = iteratee(index);
  106751. }
  106752. return result;
  106753. }
  106754. /* harmony default export */ __webpack_exports__["default"] = (baseTimes);
  106755. /***/ }),
  106756. /***/ "./node_modules/lodash-es/_baseToNumber.js":
  106757. /*!*************************************************!*\
  106758. !*** ./node_modules/lodash-es/_baseToNumber.js ***!
  106759. \*************************************************/
  106760. /*! exports provided: default */
  106761. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106762. "use strict";
  106763. __webpack_require__.r(__webpack_exports__);
  106764. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  106765. /** Used as references for various `Number` constants. */
  106766. var NAN = 0 / 0;
  106767. /**
  106768. * The base implementation of `_.toNumber` which doesn't ensure correct
  106769. * conversions of binary, hexadecimal, or octal string values.
  106770. *
  106771. * @private
  106772. * @param {*} value The value to process.
  106773. * @returns {number} Returns the number.
  106774. */
  106775. function baseToNumber(value) {
  106776. if (typeof value == 'number') {
  106777. return value;
  106778. }
  106779. if (Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
  106780. return NAN;
  106781. }
  106782. return +value;
  106783. }
  106784. /* harmony default export */ __webpack_exports__["default"] = (baseToNumber);
  106785. /***/ }),
  106786. /***/ "./node_modules/lodash-es/_baseToPairs.js":
  106787. /*!************************************************!*\
  106788. !*** ./node_modules/lodash-es/_baseToPairs.js ***!
  106789. \************************************************/
  106790. /*! exports provided: default */
  106791. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106792. "use strict";
  106793. __webpack_require__.r(__webpack_exports__);
  106794. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  106795. /**
  106796. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  106797. * of key-value pairs for `object` corresponding to the property names of `props`.
  106798. *
  106799. * @private
  106800. * @param {Object} object The object to query.
  106801. * @param {Array} props The property names to get values for.
  106802. * @returns {Object} Returns the key-value pairs.
  106803. */
  106804. function baseToPairs(object, props) {
  106805. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(props, function(key) {
  106806. return [key, object[key]];
  106807. });
  106808. }
  106809. /* harmony default export */ __webpack_exports__["default"] = (baseToPairs);
  106810. /***/ }),
  106811. /***/ "./node_modules/lodash-es/_baseToString.js":
  106812. /*!*************************************************!*\
  106813. !*** ./node_modules/lodash-es/_baseToString.js ***!
  106814. \*************************************************/
  106815. /*! exports provided: default */
  106816. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106817. "use strict";
  106818. __webpack_require__.r(__webpack_exports__);
  106819. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  106820. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  106821. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  106822. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  106823. /** Used as references for various `Number` constants. */
  106824. var INFINITY = 1 / 0;
  106825. /** Used to convert symbols to primitives and strings. */
  106826. var symbolProto = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype : undefined,
  106827. symbolToString = symbolProto ? symbolProto.toString : undefined;
  106828. /**
  106829. * The base implementation of `_.toString` which doesn't convert nullish
  106830. * values to empty strings.
  106831. *
  106832. * @private
  106833. * @param {*} value The value to process.
  106834. * @returns {string} Returns the string.
  106835. */
  106836. function baseToString(value) {
  106837. // Exit early for strings to avoid a performance hit in some environments.
  106838. if (typeof value == 'string') {
  106839. return value;
  106840. }
  106841. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value)) {
  106842. // Recursively convert values (susceptible to call stack limits).
  106843. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, baseToString) + '';
  106844. }
  106845. if (Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value)) {
  106846. return symbolToString ? symbolToString.call(value) : '';
  106847. }
  106848. var result = (value + '');
  106849. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  106850. }
  106851. /* harmony default export */ __webpack_exports__["default"] = (baseToString);
  106852. /***/ }),
  106853. /***/ "./node_modules/lodash-es/_baseTrim.js":
  106854. /*!*********************************************!*\
  106855. !*** ./node_modules/lodash-es/_baseTrim.js ***!
  106856. \*********************************************/
  106857. /*! exports provided: default */
  106858. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106859. "use strict";
  106860. __webpack_require__.r(__webpack_exports__);
  106861. /* harmony import */ var _trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_trimmedEndIndex.js */ "./node_modules/lodash-es/_trimmedEndIndex.js");
  106862. /** Used to match leading whitespace. */
  106863. var reTrimStart = /^\s+/;
  106864. /**
  106865. * The base implementation of `_.trim`.
  106866. *
  106867. * @private
  106868. * @param {string} string The string to trim.
  106869. * @returns {string} Returns the trimmed string.
  106870. */
  106871. function baseTrim(string) {
  106872. return string
  106873. ? string.slice(0, Object(_trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string) + 1).replace(reTrimStart, '')
  106874. : string;
  106875. }
  106876. /* harmony default export */ __webpack_exports__["default"] = (baseTrim);
  106877. /***/ }),
  106878. /***/ "./node_modules/lodash-es/_baseUnary.js":
  106879. /*!**********************************************!*\
  106880. !*** ./node_modules/lodash-es/_baseUnary.js ***!
  106881. \**********************************************/
  106882. /*! exports provided: default */
  106883. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106884. "use strict";
  106885. __webpack_require__.r(__webpack_exports__);
  106886. /**
  106887. * The base implementation of `_.unary` without support for storing metadata.
  106888. *
  106889. * @private
  106890. * @param {Function} func The function to cap arguments for.
  106891. * @returns {Function} Returns the new capped function.
  106892. */
  106893. function baseUnary(func) {
  106894. return function(value) {
  106895. return func(value);
  106896. };
  106897. }
  106898. /* harmony default export */ __webpack_exports__["default"] = (baseUnary);
  106899. /***/ }),
  106900. /***/ "./node_modules/lodash-es/_baseUniq.js":
  106901. /*!*********************************************!*\
  106902. !*** ./node_modules/lodash-es/_baseUniq.js ***!
  106903. \*********************************************/
  106904. /*! exports provided: default */
  106905. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106906. "use strict";
  106907. __webpack_require__.r(__webpack_exports__);
  106908. /* harmony import */ var _SetCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_SetCache.js */ "./node_modules/lodash-es/_SetCache.js");
  106909. /* harmony import */ var _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayIncludes.js */ "./node_modules/lodash-es/_arrayIncludes.js");
  106910. /* harmony import */ var _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arrayIncludesWith.js */ "./node_modules/lodash-es/_arrayIncludesWith.js");
  106911. /* harmony import */ var _cacheHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_cacheHas.js */ "./node_modules/lodash-es/_cacheHas.js");
  106912. /* harmony import */ var _createSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_createSet.js */ "./node_modules/lodash-es/_createSet.js");
  106913. /* harmony import */ var _setToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_setToArray.js */ "./node_modules/lodash-es/_setToArray.js");
  106914. /** Used as the size to enable large array optimizations. */
  106915. var LARGE_ARRAY_SIZE = 200;
  106916. /**
  106917. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  106918. *
  106919. * @private
  106920. * @param {Array} array The array to inspect.
  106921. * @param {Function} [iteratee] The iteratee invoked per element.
  106922. * @param {Function} [comparator] The comparator invoked per element.
  106923. * @returns {Array} Returns the new duplicate free array.
  106924. */
  106925. function baseUniq(array, iteratee, comparator) {
  106926. var index = -1,
  106927. includes = _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  106928. length = array.length,
  106929. isCommon = true,
  106930. result = [],
  106931. seen = result;
  106932. if (comparator) {
  106933. isCommon = false;
  106934. includes = _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  106935. }
  106936. else if (length >= LARGE_ARRAY_SIZE) {
  106937. var set = iteratee ? null : Object(_createSet_js__WEBPACK_IMPORTED_MODULE_4__["default"])(array);
  106938. if (set) {
  106939. return Object(_setToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(set);
  106940. }
  106941. isCommon = false;
  106942. includes = _cacheHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
  106943. seen = new _SetCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  106944. }
  106945. else {
  106946. seen = iteratee ? [] : result;
  106947. }
  106948. outer:
  106949. while (++index < length) {
  106950. var value = array[index],
  106951. computed = iteratee ? iteratee(value) : value;
  106952. value = (comparator || value !== 0) ? value : 0;
  106953. if (isCommon && computed === computed) {
  106954. var seenIndex = seen.length;
  106955. while (seenIndex--) {
  106956. if (seen[seenIndex] === computed) {
  106957. continue outer;
  106958. }
  106959. }
  106960. if (iteratee) {
  106961. seen.push(computed);
  106962. }
  106963. result.push(value);
  106964. }
  106965. else if (!includes(seen, computed, comparator)) {
  106966. if (seen !== result) {
  106967. seen.push(computed);
  106968. }
  106969. result.push(value);
  106970. }
  106971. }
  106972. return result;
  106973. }
  106974. /* harmony default export */ __webpack_exports__["default"] = (baseUniq);
  106975. /***/ }),
  106976. /***/ "./node_modules/lodash-es/_baseUnset.js":
  106977. /*!**********************************************!*\
  106978. !*** ./node_modules/lodash-es/_baseUnset.js ***!
  106979. \**********************************************/
  106980. /*! exports provided: default */
  106981. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106982. "use strict";
  106983. __webpack_require__.r(__webpack_exports__);
  106984. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  106985. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  106986. /* harmony import */ var _parent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_parent.js */ "./node_modules/lodash-es/_parent.js");
  106987. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  106988. /**
  106989. * The base implementation of `_.unset`.
  106990. *
  106991. * @private
  106992. * @param {Object} object The object to modify.
  106993. * @param {Array|string} path The property path to unset.
  106994. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  106995. */
  106996. function baseUnset(object, path) {
  106997. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);
  106998. object = Object(_parent_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, path);
  106999. return object == null || delete object[Object(_toKey_js__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_last_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path))];
  107000. }
  107001. /* harmony default export */ __webpack_exports__["default"] = (baseUnset);
  107002. /***/ }),
  107003. /***/ "./node_modules/lodash-es/_baseUpdate.js":
  107004. /*!***********************************************!*\
  107005. !*** ./node_modules/lodash-es/_baseUpdate.js ***!
  107006. \***********************************************/
  107007. /*! exports provided: default */
  107008. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107009. "use strict";
  107010. __webpack_require__.r(__webpack_exports__);
  107011. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  107012. /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
  107013. /**
  107014. * The base implementation of `_.update`.
  107015. *
  107016. * @private
  107017. * @param {Object} object The object to modify.
  107018. * @param {Array|string} path The path of the property to update.
  107019. * @param {Function} updater The function to produce the updated value.
  107020. * @param {Function} [customizer] The function to customize path creation.
  107021. * @returns {Object} Returns `object`.
  107022. */
  107023. function baseUpdate(object, path, updater, customizer) {
  107024. return Object(_baseSet_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path, updater(Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path)), customizer);
  107025. }
  107026. /* harmony default export */ __webpack_exports__["default"] = (baseUpdate);
  107027. /***/ }),
  107028. /***/ "./node_modules/lodash-es/_baseValues.js":
  107029. /*!***********************************************!*\
  107030. !*** ./node_modules/lodash-es/_baseValues.js ***!
  107031. \***********************************************/
  107032. /*! exports provided: default */
  107033. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107034. "use strict";
  107035. __webpack_require__.r(__webpack_exports__);
  107036. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  107037. /**
  107038. * The base implementation of `_.values` and `_.valuesIn` which creates an
  107039. * array of `object` property values corresponding to the property names
  107040. * of `props`.
  107041. *
  107042. * @private
  107043. * @param {Object} object The object to query.
  107044. * @param {Array} props The property names to get values for.
  107045. * @returns {Object} Returns the array of property values.
  107046. */
  107047. function baseValues(object, props) {
  107048. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(props, function(key) {
  107049. return object[key];
  107050. });
  107051. }
  107052. /* harmony default export */ __webpack_exports__["default"] = (baseValues);
  107053. /***/ }),
  107054. /***/ "./node_modules/lodash-es/_baseWhile.js":
  107055. /*!**********************************************!*\
  107056. !*** ./node_modules/lodash-es/_baseWhile.js ***!
  107057. \**********************************************/
  107058. /*! exports provided: default */
  107059. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107060. "use strict";
  107061. __webpack_require__.r(__webpack_exports__);
  107062. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  107063. /**
  107064. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  107065. * without support for iteratee shorthands.
  107066. *
  107067. * @private
  107068. * @param {Array} array The array to query.
  107069. * @param {Function} predicate The function invoked per iteration.
  107070. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  107071. * @param {boolean} [fromRight] Specify iterating from right to left.
  107072. * @returns {Array} Returns the slice of `array`.
  107073. */
  107074. function baseWhile(array, predicate, isDrop, fromRight) {
  107075. var length = array.length,
  107076. index = fromRight ? length : -1;
  107077. while ((fromRight ? index-- : ++index < length) &&
  107078. predicate(array[index], index, array)) {}
  107079. return isDrop
  107080. ? Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  107081. : Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  107082. }
  107083. /* harmony default export */ __webpack_exports__["default"] = (baseWhile);
  107084. /***/ }),
  107085. /***/ "./node_modules/lodash-es/_baseWrapperValue.js":
  107086. /*!*****************************************************!*\
  107087. !*** ./node_modules/lodash-es/_baseWrapperValue.js ***!
  107088. \*****************************************************/
  107089. /*! exports provided: default */
  107090. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107091. "use strict";
  107092. __webpack_require__.r(__webpack_exports__);
  107093. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  107094. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  107095. /* harmony import */ var _arrayReduce_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arrayReduce.js */ "./node_modules/lodash-es/_arrayReduce.js");
  107096. /**
  107097. * The base implementation of `wrapperValue` which returns the result of
  107098. * performing a sequence of actions on the unwrapped `value`, where each
  107099. * successive action is supplied the return value of the previous.
  107100. *
  107101. * @private
  107102. * @param {*} value The unwrapped value.
  107103. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  107104. * @returns {*} Returns the resolved value.
  107105. */
  107106. function baseWrapperValue(value, actions) {
  107107. var result = value;
  107108. if (result instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  107109. result = result.value();
  107110. }
  107111. return Object(_arrayReduce_js__WEBPACK_IMPORTED_MODULE_2__["default"])(actions, function(result, action) {
  107112. return action.func.apply(action.thisArg, Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_1__["default"])([result], action.args));
  107113. }, result);
  107114. }
  107115. /* harmony default export */ __webpack_exports__["default"] = (baseWrapperValue);
  107116. /***/ }),
  107117. /***/ "./node_modules/lodash-es/_baseXor.js":
  107118. /*!********************************************!*\
  107119. !*** ./node_modules/lodash-es/_baseXor.js ***!
  107120. \********************************************/
  107121. /*! exports provided: default */
  107122. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107123. "use strict";
  107124. __webpack_require__.r(__webpack_exports__);
  107125. /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
  107126. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  107127. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  107128. /**
  107129. * The base implementation of methods like `_.xor`, without support for
  107130. * iteratee shorthands, that accepts an array of arrays to inspect.
  107131. *
  107132. * @private
  107133. * @param {Array} arrays The arrays to inspect.
  107134. * @param {Function} [iteratee] The iteratee invoked per element.
  107135. * @param {Function} [comparator] The comparator invoked per element.
  107136. * @returns {Array} Returns the new array of values.
  107137. */
  107138. function baseXor(arrays, iteratee, comparator) {
  107139. var length = arrays.length;
  107140. if (length < 2) {
  107141. return length ? Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(arrays[0]) : [];
  107142. }
  107143. var index = -1,
  107144. result = Array(length);
  107145. while (++index < length) {
  107146. var array = arrays[index],
  107147. othIndex = -1;
  107148. while (++othIndex < length) {
  107149. if (othIndex != index) {
  107150. result[index] = Object(_baseDifference_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result[index] || array, arrays[othIndex], iteratee, comparator);
  107151. }
  107152. }
  107153. }
  107154. return Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, 1), iteratee, comparator);
  107155. }
  107156. /* harmony default export */ __webpack_exports__["default"] = (baseXor);
  107157. /***/ }),
  107158. /***/ "./node_modules/lodash-es/_baseZipObject.js":
  107159. /*!**************************************************!*\
  107160. !*** ./node_modules/lodash-es/_baseZipObject.js ***!
  107161. \**************************************************/
  107162. /*! exports provided: default */
  107163. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107164. "use strict";
  107165. __webpack_require__.r(__webpack_exports__);
  107166. /**
  107167. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  107168. *
  107169. * @private
  107170. * @param {Array} props The property identifiers.
  107171. * @param {Array} values The property values.
  107172. * @param {Function} assignFunc The function to assign values.
  107173. * @returns {Object} Returns the new object.
  107174. */
  107175. function baseZipObject(props, values, assignFunc) {
  107176. var index = -1,
  107177. length = props.length,
  107178. valsLength = values.length,
  107179. result = {};
  107180. while (++index < length) {
  107181. var value = index < valsLength ? values[index] : undefined;
  107182. assignFunc(result, props[index], value);
  107183. }
  107184. return result;
  107185. }
  107186. /* harmony default export */ __webpack_exports__["default"] = (baseZipObject);
  107187. /***/ }),
  107188. /***/ "./node_modules/lodash-es/_cacheHas.js":
  107189. /*!*********************************************!*\
  107190. !*** ./node_modules/lodash-es/_cacheHas.js ***!
  107191. \*********************************************/
  107192. /*! exports provided: default */
  107193. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107194. "use strict";
  107195. __webpack_require__.r(__webpack_exports__);
  107196. /**
  107197. * Checks if a `cache` value for `key` exists.
  107198. *
  107199. * @private
  107200. * @param {Object} cache The cache to query.
  107201. * @param {string} key The key of the entry to check.
  107202. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  107203. */
  107204. function cacheHas(cache, key) {
  107205. return cache.has(key);
  107206. }
  107207. /* harmony default export */ __webpack_exports__["default"] = (cacheHas);
  107208. /***/ }),
  107209. /***/ "./node_modules/lodash-es/_castArrayLikeObject.js":
  107210. /*!********************************************************!*\
  107211. !*** ./node_modules/lodash-es/_castArrayLikeObject.js ***!
  107212. \********************************************************/
  107213. /*! exports provided: default */
  107214. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107215. "use strict";
  107216. __webpack_require__.r(__webpack_exports__);
  107217. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  107218. /**
  107219. * Casts `value` to an empty array if it's not an array like object.
  107220. *
  107221. * @private
  107222. * @param {*} value The value to inspect.
  107223. * @returns {Array|Object} Returns the cast array-like object.
  107224. */
  107225. function castArrayLikeObject(value) {
  107226. return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? value : [];
  107227. }
  107228. /* harmony default export */ __webpack_exports__["default"] = (castArrayLikeObject);
  107229. /***/ }),
  107230. /***/ "./node_modules/lodash-es/_castFunction.js":
  107231. /*!*************************************************!*\
  107232. !*** ./node_modules/lodash-es/_castFunction.js ***!
  107233. \*************************************************/
  107234. /*! exports provided: default */
  107235. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107236. "use strict";
  107237. __webpack_require__.r(__webpack_exports__);
  107238. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  107239. /**
  107240. * Casts `value` to `identity` if it's not a function.
  107241. *
  107242. * @private
  107243. * @param {*} value The value to inspect.
  107244. * @returns {Function} Returns cast function.
  107245. */
  107246. function castFunction(value) {
  107247. return typeof value == 'function' ? value : _identity_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  107248. }
  107249. /* harmony default export */ __webpack_exports__["default"] = (castFunction);
  107250. /***/ }),
  107251. /***/ "./node_modules/lodash-es/_castPath.js":
  107252. /*!*********************************************!*\
  107253. !*** ./node_modules/lodash-es/_castPath.js ***!
  107254. \*********************************************/
  107255. /*! exports provided: default */
  107256. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107257. "use strict";
  107258. __webpack_require__.r(__webpack_exports__);
  107259. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  107260. /* harmony import */ var _isKey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isKey.js */ "./node_modules/lodash-es/_isKey.js");
  107261. /* harmony import */ var _stringToPath_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_stringToPath.js */ "./node_modules/lodash-es/_stringToPath.js");
  107262. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  107263. /**
  107264. * Casts `value` to a path array if it's not one.
  107265. *
  107266. * @private
  107267. * @param {*} value The value to inspect.
  107268. * @param {Object} [object] The object to query keys on.
  107269. * @returns {Array} Returns the cast property path array.
  107270. */
  107271. function castPath(value, object) {
  107272. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
  107273. return value;
  107274. }
  107275. return Object(_isKey_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, object) ? [value] : Object(_stringToPath_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value));
  107276. }
  107277. /* harmony default export */ __webpack_exports__["default"] = (castPath);
  107278. /***/ }),
  107279. /***/ "./node_modules/lodash-es/_castRest.js":
  107280. /*!*********************************************!*\
  107281. !*** ./node_modules/lodash-es/_castRest.js ***!
  107282. \*********************************************/
  107283. /*! exports provided: default */
  107284. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107285. "use strict";
  107286. __webpack_require__.r(__webpack_exports__);
  107287. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  107288. /**
  107289. * A `baseRest` alias which can be replaced with `identity` by module
  107290. * replacement plugins.
  107291. *
  107292. * @private
  107293. * @type {Function}
  107294. * @param {Function} func The function to apply a rest parameter to.
  107295. * @returns {Function} Returns the new function.
  107296. */
  107297. var castRest = _baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  107298. /* harmony default export */ __webpack_exports__["default"] = (castRest);
  107299. /***/ }),
  107300. /***/ "./node_modules/lodash-es/_castSlice.js":
  107301. /*!**********************************************!*\
  107302. !*** ./node_modules/lodash-es/_castSlice.js ***!
  107303. \**********************************************/
  107304. /*! exports provided: default */
  107305. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107306. "use strict";
  107307. __webpack_require__.r(__webpack_exports__);
  107308. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  107309. /**
  107310. * Casts `array` to a slice if it's needed.
  107311. *
  107312. * @private
  107313. * @param {Array} array The array to inspect.
  107314. * @param {number} start The start position.
  107315. * @param {number} [end=array.length] The end position.
  107316. * @returns {Array} Returns the cast slice.
  107317. */
  107318. function castSlice(array, start, end) {
  107319. var length = array.length;
  107320. end = end === undefined ? length : end;
  107321. return (!start && end >= length) ? array : Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, start, end);
  107322. }
  107323. /* harmony default export */ __webpack_exports__["default"] = (castSlice);
  107324. /***/ }),
  107325. /***/ "./node_modules/lodash-es/_charsEndIndex.js":
  107326. /*!**************************************************!*\
  107327. !*** ./node_modules/lodash-es/_charsEndIndex.js ***!
  107328. \**************************************************/
  107329. /*! exports provided: default */
  107330. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107331. "use strict";
  107332. __webpack_require__.r(__webpack_exports__);
  107333. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  107334. /**
  107335. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  107336. * that is not found in the character symbols.
  107337. *
  107338. * @private
  107339. * @param {Array} strSymbols The string symbols to inspect.
  107340. * @param {Array} chrSymbols The character symbols to find.
  107341. * @returns {number} Returns the index of the last unmatched string symbol.
  107342. */
  107343. function charsEndIndex(strSymbols, chrSymbols) {
  107344. var index = strSymbols.length;
  107345. while (index-- && Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chrSymbols, strSymbols[index], 0) > -1) {}
  107346. return index;
  107347. }
  107348. /* harmony default export */ __webpack_exports__["default"] = (charsEndIndex);
  107349. /***/ }),
  107350. /***/ "./node_modules/lodash-es/_charsStartIndex.js":
  107351. /*!****************************************************!*\
  107352. !*** ./node_modules/lodash-es/_charsStartIndex.js ***!
  107353. \****************************************************/
  107354. /*! exports provided: default */
  107355. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107356. "use strict";
  107357. __webpack_require__.r(__webpack_exports__);
  107358. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  107359. /**
  107360. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  107361. * that is not found in the character symbols.
  107362. *
  107363. * @private
  107364. * @param {Array} strSymbols The string symbols to inspect.
  107365. * @param {Array} chrSymbols The character symbols to find.
  107366. * @returns {number} Returns the index of the first unmatched string symbol.
  107367. */
  107368. function charsStartIndex(strSymbols, chrSymbols) {
  107369. var index = -1,
  107370. length = strSymbols.length;
  107371. while (++index < length && Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chrSymbols, strSymbols[index], 0) > -1) {}
  107372. return index;
  107373. }
  107374. /* harmony default export */ __webpack_exports__["default"] = (charsStartIndex);
  107375. /***/ }),
  107376. /***/ "./node_modules/lodash-es/_cloneArrayBuffer.js":
  107377. /*!*****************************************************!*\
  107378. !*** ./node_modules/lodash-es/_cloneArrayBuffer.js ***!
  107379. \*****************************************************/
  107380. /*! exports provided: default */
  107381. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107382. "use strict";
  107383. __webpack_require__.r(__webpack_exports__);
  107384. /* harmony import */ var _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Uint8Array.js */ "./node_modules/lodash-es/_Uint8Array.js");
  107385. /**
  107386. * Creates a clone of `arrayBuffer`.
  107387. *
  107388. * @private
  107389. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  107390. * @returns {ArrayBuffer} Returns the cloned array buffer.
  107391. */
  107392. function cloneArrayBuffer(arrayBuffer) {
  107393. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  107394. new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__["default"](result).set(new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__["default"](arrayBuffer));
  107395. return result;
  107396. }
  107397. /* harmony default export */ __webpack_exports__["default"] = (cloneArrayBuffer);
  107398. /***/ }),
  107399. /***/ "./node_modules/lodash-es/_cloneBuffer.js":
  107400. /*!************************************************!*\
  107401. !*** ./node_modules/lodash-es/_cloneBuffer.js ***!
  107402. \************************************************/
  107403. /*! exports provided: default */
  107404. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107405. "use strict";
  107406. __webpack_require__.r(__webpack_exports__);
  107407. /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  107408. /** Detect free variable `exports`. */
  107409. var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
  107410. /** Detect free variable `module`. */
  107411. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  107412. /** Detect the popular CommonJS extension `module.exports`. */
  107413. var moduleExports = freeModule && freeModule.exports === freeExports;
  107414. /** Built-in value references. */
  107415. var Buffer = moduleExports ? _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Buffer : undefined,
  107416. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
  107417. /**
  107418. * Creates a clone of `buffer`.
  107419. *
  107420. * @private
  107421. * @param {Buffer} buffer The buffer to clone.
  107422. * @param {boolean} [isDeep] Specify a deep clone.
  107423. * @returns {Buffer} Returns the cloned buffer.
  107424. */
  107425. function cloneBuffer(buffer, isDeep) {
  107426. if (isDeep) {
  107427. return buffer.slice();
  107428. }
  107429. var length = buffer.length,
  107430. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  107431. buffer.copy(result);
  107432. return result;
  107433. }
  107434. /* harmony default export */ __webpack_exports__["default"] = (cloneBuffer);
  107435. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/harmony-module.js */ "./node_modules/webpack/buildin/harmony-module.js")(module)))
  107436. /***/ }),
  107437. /***/ "./node_modules/lodash-es/_cloneDataView.js":
  107438. /*!**************************************************!*\
  107439. !*** ./node_modules/lodash-es/_cloneDataView.js ***!
  107440. \**************************************************/
  107441. /*! exports provided: default */
  107442. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107443. "use strict";
  107444. __webpack_require__.r(__webpack_exports__);
  107445. /* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cloneArrayBuffer.js */ "./node_modules/lodash-es/_cloneArrayBuffer.js");
  107446. /**
  107447. * Creates a clone of `dataView`.
  107448. *
  107449. * @private
  107450. * @param {Object} dataView The data view to clone.
  107451. * @param {boolean} [isDeep] Specify a deep clone.
  107452. * @returns {Object} Returns the cloned data view.
  107453. */
  107454. function cloneDataView(dataView, isDeep) {
  107455. var buffer = isDeep ? Object(_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dataView.buffer) : dataView.buffer;
  107456. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  107457. }
  107458. /* harmony default export */ __webpack_exports__["default"] = (cloneDataView);
  107459. /***/ }),
  107460. /***/ "./node_modules/lodash-es/_cloneRegExp.js":
  107461. /*!************************************************!*\
  107462. !*** ./node_modules/lodash-es/_cloneRegExp.js ***!
  107463. \************************************************/
  107464. /*! exports provided: default */
  107465. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107466. "use strict";
  107467. __webpack_require__.r(__webpack_exports__);
  107468. /** Used to match `RegExp` flags from their coerced string values. */
  107469. var reFlags = /\w*$/;
  107470. /**
  107471. * Creates a clone of `regexp`.
  107472. *
  107473. * @private
  107474. * @param {Object} regexp The regexp to clone.
  107475. * @returns {Object} Returns the cloned regexp.
  107476. */
  107477. function cloneRegExp(regexp) {
  107478. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  107479. result.lastIndex = regexp.lastIndex;
  107480. return result;
  107481. }
  107482. /* harmony default export */ __webpack_exports__["default"] = (cloneRegExp);
  107483. /***/ }),
  107484. /***/ "./node_modules/lodash-es/_cloneSymbol.js":
  107485. /*!************************************************!*\
  107486. !*** ./node_modules/lodash-es/_cloneSymbol.js ***!
  107487. \************************************************/
  107488. /*! exports provided: default */
  107489. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107490. "use strict";
  107491. __webpack_require__.r(__webpack_exports__);
  107492. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  107493. /** Used to convert symbols to primitives and strings. */
  107494. var symbolProto = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype : undefined,
  107495. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  107496. /**
  107497. * Creates a clone of the `symbol` object.
  107498. *
  107499. * @private
  107500. * @param {Object} symbol The symbol object to clone.
  107501. * @returns {Object} Returns the cloned symbol object.
  107502. */
  107503. function cloneSymbol(symbol) {
  107504. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  107505. }
  107506. /* harmony default export */ __webpack_exports__["default"] = (cloneSymbol);
  107507. /***/ }),
  107508. /***/ "./node_modules/lodash-es/_cloneTypedArray.js":
  107509. /*!****************************************************!*\
  107510. !*** ./node_modules/lodash-es/_cloneTypedArray.js ***!
  107511. \****************************************************/
  107512. /*! exports provided: default */
  107513. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107514. "use strict";
  107515. __webpack_require__.r(__webpack_exports__);
  107516. /* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cloneArrayBuffer.js */ "./node_modules/lodash-es/_cloneArrayBuffer.js");
  107517. /**
  107518. * Creates a clone of `typedArray`.
  107519. *
  107520. * @private
  107521. * @param {Object} typedArray The typed array to clone.
  107522. * @param {boolean} [isDeep] Specify a deep clone.
  107523. * @returns {Object} Returns the cloned typed array.
  107524. */
  107525. function cloneTypedArray(typedArray, isDeep) {
  107526. var buffer = isDeep ? Object(_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(typedArray.buffer) : typedArray.buffer;
  107527. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  107528. }
  107529. /* harmony default export */ __webpack_exports__["default"] = (cloneTypedArray);
  107530. /***/ }),
  107531. /***/ "./node_modules/lodash-es/_compareAscending.js":
  107532. /*!*****************************************************!*\
  107533. !*** ./node_modules/lodash-es/_compareAscending.js ***!
  107534. \*****************************************************/
  107535. /*! exports provided: default */
  107536. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107537. "use strict";
  107538. __webpack_require__.r(__webpack_exports__);
  107539. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  107540. /**
  107541. * Compares values to sort them in ascending order.
  107542. *
  107543. * @private
  107544. * @param {*} value The value to compare.
  107545. * @param {*} other The other value to compare.
  107546. * @returns {number} Returns the sort order indicator for `value`.
  107547. */
  107548. function compareAscending(value, other) {
  107549. if (value !== other) {
  107550. var valIsDefined = value !== undefined,
  107551. valIsNull = value === null,
  107552. valIsReflexive = value === value,
  107553. valIsSymbol = Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  107554. var othIsDefined = other !== undefined,
  107555. othIsNull = other === null,
  107556. othIsReflexive = other === other,
  107557. othIsSymbol = Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other);
  107558. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  107559. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  107560. (valIsNull && othIsDefined && othIsReflexive) ||
  107561. (!valIsDefined && othIsReflexive) ||
  107562. !valIsReflexive) {
  107563. return 1;
  107564. }
  107565. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  107566. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  107567. (othIsNull && valIsDefined && valIsReflexive) ||
  107568. (!othIsDefined && valIsReflexive) ||
  107569. !othIsReflexive) {
  107570. return -1;
  107571. }
  107572. }
  107573. return 0;
  107574. }
  107575. /* harmony default export */ __webpack_exports__["default"] = (compareAscending);
  107576. /***/ }),
  107577. /***/ "./node_modules/lodash-es/_compareMultiple.js":
  107578. /*!****************************************************!*\
  107579. !*** ./node_modules/lodash-es/_compareMultiple.js ***!
  107580. \****************************************************/
  107581. /*! exports provided: default */
  107582. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107583. "use strict";
  107584. __webpack_require__.r(__webpack_exports__);
  107585. /* harmony import */ var _compareAscending_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_compareAscending.js */ "./node_modules/lodash-es/_compareAscending.js");
  107586. /**
  107587. * Used by `_.orderBy` to compare multiple properties of a value to another
  107588. * and stable sort them.
  107589. *
  107590. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  107591. * specify an order of "desc" for descending or "asc" for ascending sort order
  107592. * of corresponding values.
  107593. *
  107594. * @private
  107595. * @param {Object} object The object to compare.
  107596. * @param {Object} other The other object to compare.
  107597. * @param {boolean[]|string[]} orders The order to sort by for each property.
  107598. * @returns {number} Returns the sort order indicator for `object`.
  107599. */
  107600. function compareMultiple(object, other, orders) {
  107601. var index = -1,
  107602. objCriteria = object.criteria,
  107603. othCriteria = other.criteria,
  107604. length = objCriteria.length,
  107605. ordersLength = orders.length;
  107606. while (++index < length) {
  107607. var result = Object(_compareAscending_js__WEBPACK_IMPORTED_MODULE_0__["default"])(objCriteria[index], othCriteria[index]);
  107608. if (result) {
  107609. if (index >= ordersLength) {
  107610. return result;
  107611. }
  107612. var order = orders[index];
  107613. return result * (order == 'desc' ? -1 : 1);
  107614. }
  107615. }
  107616. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  107617. // that causes it, under certain circumstances, to provide the same value for
  107618. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  107619. // for more details.
  107620. //
  107621. // This also ensures a stable sort in V8 and other engines.
  107622. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  107623. return object.index - other.index;
  107624. }
  107625. /* harmony default export */ __webpack_exports__["default"] = (compareMultiple);
  107626. /***/ }),
  107627. /***/ "./node_modules/lodash-es/_composeArgs.js":
  107628. /*!************************************************!*\
  107629. !*** ./node_modules/lodash-es/_composeArgs.js ***!
  107630. \************************************************/
  107631. /*! exports provided: default */
  107632. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107633. "use strict";
  107634. __webpack_require__.r(__webpack_exports__);
  107635. /* Built-in method references for those with the same name as other `lodash` methods. */
  107636. var nativeMax = Math.max;
  107637. /**
  107638. * Creates an array that is the composition of partially applied arguments,
  107639. * placeholders, and provided arguments into a single array of arguments.
  107640. *
  107641. * @private
  107642. * @param {Array} args The provided arguments.
  107643. * @param {Array} partials The arguments to prepend to those provided.
  107644. * @param {Array} holders The `partials` placeholder indexes.
  107645. * @params {boolean} [isCurried] Specify composing for a curried function.
  107646. * @returns {Array} Returns the new array of composed arguments.
  107647. */
  107648. function composeArgs(args, partials, holders, isCurried) {
  107649. var argsIndex = -1,
  107650. argsLength = args.length,
  107651. holdersLength = holders.length,
  107652. leftIndex = -1,
  107653. leftLength = partials.length,
  107654. rangeLength = nativeMax(argsLength - holdersLength, 0),
  107655. result = Array(leftLength + rangeLength),
  107656. isUncurried = !isCurried;
  107657. while (++leftIndex < leftLength) {
  107658. result[leftIndex] = partials[leftIndex];
  107659. }
  107660. while (++argsIndex < holdersLength) {
  107661. if (isUncurried || argsIndex < argsLength) {
  107662. result[holders[argsIndex]] = args[argsIndex];
  107663. }
  107664. }
  107665. while (rangeLength--) {
  107666. result[leftIndex++] = args[argsIndex++];
  107667. }
  107668. return result;
  107669. }
  107670. /* harmony default export */ __webpack_exports__["default"] = (composeArgs);
  107671. /***/ }),
  107672. /***/ "./node_modules/lodash-es/_composeArgsRight.js":
  107673. /*!*****************************************************!*\
  107674. !*** ./node_modules/lodash-es/_composeArgsRight.js ***!
  107675. \*****************************************************/
  107676. /*! exports provided: default */
  107677. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107678. "use strict";
  107679. __webpack_require__.r(__webpack_exports__);
  107680. /* Built-in method references for those with the same name as other `lodash` methods. */
  107681. var nativeMax = Math.max;
  107682. /**
  107683. * This function is like `composeArgs` except that the arguments composition
  107684. * is tailored for `_.partialRight`.
  107685. *
  107686. * @private
  107687. * @param {Array} args The provided arguments.
  107688. * @param {Array} partials The arguments to append to those provided.
  107689. * @param {Array} holders The `partials` placeholder indexes.
  107690. * @params {boolean} [isCurried] Specify composing for a curried function.
  107691. * @returns {Array} Returns the new array of composed arguments.
  107692. */
  107693. function composeArgsRight(args, partials, holders, isCurried) {
  107694. var argsIndex = -1,
  107695. argsLength = args.length,
  107696. holdersIndex = -1,
  107697. holdersLength = holders.length,
  107698. rightIndex = -1,
  107699. rightLength = partials.length,
  107700. rangeLength = nativeMax(argsLength - holdersLength, 0),
  107701. result = Array(rangeLength + rightLength),
  107702. isUncurried = !isCurried;
  107703. while (++argsIndex < rangeLength) {
  107704. result[argsIndex] = args[argsIndex];
  107705. }
  107706. var offset = argsIndex;
  107707. while (++rightIndex < rightLength) {
  107708. result[offset + rightIndex] = partials[rightIndex];
  107709. }
  107710. while (++holdersIndex < holdersLength) {
  107711. if (isUncurried || argsIndex < argsLength) {
  107712. result[offset + holders[holdersIndex]] = args[argsIndex++];
  107713. }
  107714. }
  107715. return result;
  107716. }
  107717. /* harmony default export */ __webpack_exports__["default"] = (composeArgsRight);
  107718. /***/ }),
  107719. /***/ "./node_modules/lodash-es/_copyArray.js":
  107720. /*!**********************************************!*\
  107721. !*** ./node_modules/lodash-es/_copyArray.js ***!
  107722. \**********************************************/
  107723. /*! exports provided: default */
  107724. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107725. "use strict";
  107726. __webpack_require__.r(__webpack_exports__);
  107727. /**
  107728. * Copies the values of `source` to `array`.
  107729. *
  107730. * @private
  107731. * @param {Array} source The array to copy values from.
  107732. * @param {Array} [array=[]] The array to copy values to.
  107733. * @returns {Array} Returns `array`.
  107734. */
  107735. function copyArray(source, array) {
  107736. var index = -1,
  107737. length = source.length;
  107738. array || (array = Array(length));
  107739. while (++index < length) {
  107740. array[index] = source[index];
  107741. }
  107742. return array;
  107743. }
  107744. /* harmony default export */ __webpack_exports__["default"] = (copyArray);
  107745. /***/ }),
  107746. /***/ "./node_modules/lodash-es/_copyObject.js":
  107747. /*!***********************************************!*\
  107748. !*** ./node_modules/lodash-es/_copyObject.js ***!
  107749. \***********************************************/
  107750. /*! exports provided: default */
  107751. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107752. "use strict";
  107753. __webpack_require__.r(__webpack_exports__);
  107754. /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
  107755. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  107756. /**
  107757. * Copies properties of `source` to `object`.
  107758. *
  107759. * @private
  107760. * @param {Object} source The object to copy properties from.
  107761. * @param {Array} props The property identifiers to copy.
  107762. * @param {Object} [object={}] The object to copy properties to.
  107763. * @param {Function} [customizer] The function to customize copied values.
  107764. * @returns {Object} Returns `object`.
  107765. */
  107766. function copyObject(source, props, object, customizer) {
  107767. var isNew = !object;
  107768. object || (object = {});
  107769. var index = -1,
  107770. length = props.length;
  107771. while (++index < length) {
  107772. var key = props[index];
  107773. var newValue = customizer
  107774. ? customizer(object[key], source[key], key, object, source)
  107775. : undefined;
  107776. if (newValue === undefined) {
  107777. newValue = source[key];
  107778. }
  107779. if (isNew) {
  107780. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key, newValue);
  107781. } else {
  107782. Object(_assignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, newValue);
  107783. }
  107784. }
  107785. return object;
  107786. }
  107787. /* harmony default export */ __webpack_exports__["default"] = (copyObject);
  107788. /***/ }),
  107789. /***/ "./node_modules/lodash-es/_copySymbols.js":
  107790. /*!************************************************!*\
  107791. !*** ./node_modules/lodash-es/_copySymbols.js ***!
  107792. \************************************************/
  107793. /*! exports provided: default */
  107794. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107795. "use strict";
  107796. __webpack_require__.r(__webpack_exports__);
  107797. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  107798. /* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbols.js */ "./node_modules/lodash-es/_getSymbols.js");
  107799. /**
  107800. * Copies own symbols of `source` to `object`.
  107801. *
  107802. * @private
  107803. * @param {Object} source The object to copy symbols from.
  107804. * @param {Object} [object={}] The object to copy symbols to.
  107805. * @returns {Object} Returns `object`.
  107806. */
  107807. function copySymbols(source, object) {
  107808. return Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_getSymbols_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
  107809. }
  107810. /* harmony default export */ __webpack_exports__["default"] = (copySymbols);
  107811. /***/ }),
  107812. /***/ "./node_modules/lodash-es/_copySymbolsIn.js":
  107813. /*!**************************************************!*\
  107814. !*** ./node_modules/lodash-es/_copySymbolsIn.js ***!
  107815. \**************************************************/
  107816. /*! exports provided: default */
  107817. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107818. "use strict";
  107819. __webpack_require__.r(__webpack_exports__);
  107820. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  107821. /* harmony import */ var _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbolsIn.js */ "./node_modules/lodash-es/_getSymbolsIn.js");
  107822. /**
  107823. * Copies own and inherited symbols of `source` to `object`.
  107824. *
  107825. * @private
  107826. * @param {Object} source The object to copy symbols from.
  107827. * @param {Object} [object={}] The object to copy symbols to.
  107828. * @returns {Object} Returns `object`.
  107829. */
  107830. function copySymbolsIn(source, object) {
  107831. return Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
  107832. }
  107833. /* harmony default export */ __webpack_exports__["default"] = (copySymbolsIn);
  107834. /***/ }),
  107835. /***/ "./node_modules/lodash-es/_coreJsData.js":
  107836. /*!***********************************************!*\
  107837. !*** ./node_modules/lodash-es/_coreJsData.js ***!
  107838. \***********************************************/
  107839. /*! exports provided: default */
  107840. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107841. "use strict";
  107842. __webpack_require__.r(__webpack_exports__);
  107843. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  107844. /** Used to detect overreaching core-js shims. */
  107845. var coreJsData = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"]['__core-js_shared__'];
  107846. /* harmony default export */ __webpack_exports__["default"] = (coreJsData);
  107847. /***/ }),
  107848. /***/ "./node_modules/lodash-es/_countHolders.js":
  107849. /*!*************************************************!*\
  107850. !*** ./node_modules/lodash-es/_countHolders.js ***!
  107851. \*************************************************/
  107852. /*! exports provided: default */
  107853. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107854. "use strict";
  107855. __webpack_require__.r(__webpack_exports__);
  107856. /**
  107857. * Gets the number of `placeholder` occurrences in `array`.
  107858. *
  107859. * @private
  107860. * @param {Array} array The array to inspect.
  107861. * @param {*} placeholder The placeholder to search for.
  107862. * @returns {number} Returns the placeholder count.
  107863. */
  107864. function countHolders(array, placeholder) {
  107865. var length = array.length,
  107866. result = 0;
  107867. while (length--) {
  107868. if (array[length] === placeholder) {
  107869. ++result;
  107870. }
  107871. }
  107872. return result;
  107873. }
  107874. /* harmony default export */ __webpack_exports__["default"] = (countHolders);
  107875. /***/ }),
  107876. /***/ "./node_modules/lodash-es/_createAggregator.js":
  107877. /*!*****************************************************!*\
  107878. !*** ./node_modules/lodash-es/_createAggregator.js ***!
  107879. \*****************************************************/
  107880. /*! exports provided: default */
  107881. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107882. "use strict";
  107883. __webpack_require__.r(__webpack_exports__);
  107884. /* harmony import */ var _arrayAggregator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayAggregator.js */ "./node_modules/lodash-es/_arrayAggregator.js");
  107885. /* harmony import */ var _baseAggregator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAggregator.js */ "./node_modules/lodash-es/_baseAggregator.js");
  107886. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  107887. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  107888. /**
  107889. * Creates a function like `_.groupBy`.
  107890. *
  107891. * @private
  107892. * @param {Function} setter The function to set accumulator values.
  107893. * @param {Function} [initializer] The accumulator object initializer.
  107894. * @returns {Function} Returns the new aggregator function.
  107895. */
  107896. function createAggregator(setter, initializer) {
  107897. return function(collection, iteratee) {
  107898. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayAggregator_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseAggregator_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  107899. accumulator = initializer ? initializer() : {};
  107900. return func(collection, setter, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 2), accumulator);
  107901. };
  107902. }
  107903. /* harmony default export */ __webpack_exports__["default"] = (createAggregator);
  107904. /***/ }),
  107905. /***/ "./node_modules/lodash-es/_createAssigner.js":
  107906. /*!***************************************************!*\
  107907. !*** ./node_modules/lodash-es/_createAssigner.js ***!
  107908. \***************************************************/
  107909. /*! exports provided: default */
  107910. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107911. "use strict";
  107912. __webpack_require__.r(__webpack_exports__);
  107913. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  107914. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  107915. /**
  107916. * Creates a function like `_.assign`.
  107917. *
  107918. * @private
  107919. * @param {Function} assigner The function to assign values.
  107920. * @returns {Function} Returns the new assigner function.
  107921. */
  107922. function createAssigner(assigner) {
  107923. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(object, sources) {
  107924. var index = -1,
  107925. length = sources.length,
  107926. customizer = length > 1 ? sources[length - 1] : undefined,
  107927. guard = length > 2 ? sources[2] : undefined;
  107928. customizer = (assigner.length > 3 && typeof customizer == 'function')
  107929. ? (length--, customizer)
  107930. : undefined;
  107931. if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(sources[0], sources[1], guard)) {
  107932. customizer = length < 3 ? undefined : customizer;
  107933. length = 1;
  107934. }
  107935. object = Object(object);
  107936. while (++index < length) {
  107937. var source = sources[index];
  107938. if (source) {
  107939. assigner(object, source, index, customizer);
  107940. }
  107941. }
  107942. return object;
  107943. });
  107944. }
  107945. /* harmony default export */ __webpack_exports__["default"] = (createAssigner);
  107946. /***/ }),
  107947. /***/ "./node_modules/lodash-es/_createBaseEach.js":
  107948. /*!***************************************************!*\
  107949. !*** ./node_modules/lodash-es/_createBaseEach.js ***!
  107950. \***************************************************/
  107951. /*! exports provided: default */
  107952. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107953. "use strict";
  107954. __webpack_require__.r(__webpack_exports__);
  107955. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  107956. /**
  107957. * Creates a `baseEach` or `baseEachRight` function.
  107958. *
  107959. * @private
  107960. * @param {Function} eachFunc The function to iterate over a collection.
  107961. * @param {boolean} [fromRight] Specify iterating from right to left.
  107962. * @returns {Function} Returns the new base function.
  107963. */
  107964. function createBaseEach(eachFunc, fromRight) {
  107965. return function(collection, iteratee) {
  107966. if (collection == null) {
  107967. return collection;
  107968. }
  107969. if (!Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection)) {
  107970. return eachFunc(collection, iteratee);
  107971. }
  107972. var length = collection.length,
  107973. index = fromRight ? length : -1,
  107974. iterable = Object(collection);
  107975. while ((fromRight ? index-- : ++index < length)) {
  107976. if (iteratee(iterable[index], index, iterable) === false) {
  107977. break;
  107978. }
  107979. }
  107980. return collection;
  107981. };
  107982. }
  107983. /* harmony default export */ __webpack_exports__["default"] = (createBaseEach);
  107984. /***/ }),
  107985. /***/ "./node_modules/lodash-es/_createBaseFor.js":
  107986. /*!**************************************************!*\
  107987. !*** ./node_modules/lodash-es/_createBaseFor.js ***!
  107988. \**************************************************/
  107989. /*! exports provided: default */
  107990. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107991. "use strict";
  107992. __webpack_require__.r(__webpack_exports__);
  107993. /**
  107994. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  107995. *
  107996. * @private
  107997. * @param {boolean} [fromRight] Specify iterating from right to left.
  107998. * @returns {Function} Returns the new base function.
  107999. */
  108000. function createBaseFor(fromRight) {
  108001. return function(object, iteratee, keysFunc) {
  108002. var index = -1,
  108003. iterable = Object(object),
  108004. props = keysFunc(object),
  108005. length = props.length;
  108006. while (length--) {
  108007. var key = props[fromRight ? length : ++index];
  108008. if (iteratee(iterable[key], key, iterable) === false) {
  108009. break;
  108010. }
  108011. }
  108012. return object;
  108013. };
  108014. }
  108015. /* harmony default export */ __webpack_exports__["default"] = (createBaseFor);
  108016. /***/ }),
  108017. /***/ "./node_modules/lodash-es/_createBind.js":
  108018. /*!***********************************************!*\
  108019. !*** ./node_modules/lodash-es/_createBind.js ***!
  108020. \***********************************************/
  108021. /*! exports provided: default */
  108022. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108023. "use strict";
  108024. __webpack_require__.r(__webpack_exports__);
  108025. /* harmony import */ var _createCtor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCtor.js */ "./node_modules/lodash-es/_createCtor.js");
  108026. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  108027. /** Used to compose bitmasks for function metadata. */
  108028. var WRAP_BIND_FLAG = 1;
  108029. /**
  108030. * Creates a function that wraps `func` to invoke it with the optional `this`
  108031. * binding of `thisArg`.
  108032. *
  108033. * @private
  108034. * @param {Function} func The function to wrap.
  108035. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  108036. * @param {*} [thisArg] The `this` binding of `func`.
  108037. * @returns {Function} Returns the new wrapped function.
  108038. */
  108039. function createBind(func, bitmask, thisArg) {
  108040. var isBind = bitmask & WRAP_BIND_FLAG,
  108041. Ctor = Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func);
  108042. function wrapper() {
  108043. var fn = (this && this !== _root_js__WEBPACK_IMPORTED_MODULE_1__["default"] && this instanceof wrapper) ? Ctor : func;
  108044. return fn.apply(isBind ? thisArg : this, arguments);
  108045. }
  108046. return wrapper;
  108047. }
  108048. /* harmony default export */ __webpack_exports__["default"] = (createBind);
  108049. /***/ }),
  108050. /***/ "./node_modules/lodash-es/_createCaseFirst.js":
  108051. /*!****************************************************!*\
  108052. !*** ./node_modules/lodash-es/_createCaseFirst.js ***!
  108053. \****************************************************/
  108054. /*! exports provided: default */
  108055. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108056. "use strict";
  108057. __webpack_require__.r(__webpack_exports__);
  108058. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  108059. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  108060. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  108061. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  108062. /**
  108063. * Creates a function like `_.lowerFirst`.
  108064. *
  108065. * @private
  108066. * @param {string} methodName The name of the `String` case method to use.
  108067. * @returns {Function} Returns the new case function.
  108068. */
  108069. function createCaseFirst(methodName) {
  108070. return function(string) {
  108071. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  108072. var strSymbols = Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string)
  108073. ? Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)
  108074. : undefined;
  108075. var chr = strSymbols
  108076. ? strSymbols[0]
  108077. : string.charAt(0);
  108078. var trailing = strSymbols
  108079. ? Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(strSymbols, 1).join('')
  108080. : string.slice(1);
  108081. return chr[methodName]() + trailing;
  108082. };
  108083. }
  108084. /* harmony default export */ __webpack_exports__["default"] = (createCaseFirst);
  108085. /***/ }),
  108086. /***/ "./node_modules/lodash-es/_createCompounder.js":
  108087. /*!*****************************************************!*\
  108088. !*** ./node_modules/lodash-es/_createCompounder.js ***!
  108089. \*****************************************************/
  108090. /*! exports provided: default */
  108091. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108092. "use strict";
  108093. __webpack_require__.r(__webpack_exports__);
  108094. /* harmony import */ var _arrayReduce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayReduce.js */ "./node_modules/lodash-es/_arrayReduce.js");
  108095. /* harmony import */ var _deburr_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./deburr.js */ "./node_modules/lodash-es/deburr.js");
  108096. /* harmony import */ var _words_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./words.js */ "./node_modules/lodash-es/words.js");
  108097. /** Used to compose unicode capture groups. */
  108098. var rsApos = "['\u2019]";
  108099. /** Used to match apostrophes. */
  108100. var reApos = RegExp(rsApos, 'g');
  108101. /**
  108102. * Creates a function like `_.camelCase`.
  108103. *
  108104. * @private
  108105. * @param {Function} callback The function to combine each word.
  108106. * @returns {Function} Returns the new compounder function.
  108107. */
  108108. function createCompounder(callback) {
  108109. return function(string) {
  108110. return Object(_arrayReduce_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_words_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_deburr_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string).replace(reApos, '')), callback, '');
  108111. };
  108112. }
  108113. /* harmony default export */ __webpack_exports__["default"] = (createCompounder);
  108114. /***/ }),
  108115. /***/ "./node_modules/lodash-es/_createCtor.js":
  108116. /*!***********************************************!*\
  108117. !*** ./node_modules/lodash-es/_createCtor.js ***!
  108118. \***********************************************/
  108119. /*! exports provided: default */
  108120. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108121. "use strict";
  108122. __webpack_require__.r(__webpack_exports__);
  108123. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  108124. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  108125. /**
  108126. * Creates a function that produces an instance of `Ctor` regardless of
  108127. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  108128. *
  108129. * @private
  108130. * @param {Function} Ctor The constructor to wrap.
  108131. * @returns {Function} Returns the new wrapped function.
  108132. */
  108133. function createCtor(Ctor) {
  108134. return function() {
  108135. // Use a `switch` statement to work with class constructors. See
  108136. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  108137. // for more details.
  108138. var args = arguments;
  108139. switch (args.length) {
  108140. case 0: return new Ctor;
  108141. case 1: return new Ctor(args[0]);
  108142. case 2: return new Ctor(args[0], args[1]);
  108143. case 3: return new Ctor(args[0], args[1], args[2]);
  108144. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  108145. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  108146. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  108147. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  108148. }
  108149. var thisBinding = Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Ctor.prototype),
  108150. result = Ctor.apply(thisBinding, args);
  108151. // Mimic the constructor's `return` behavior.
  108152. // See https://es5.github.io/#x13.2.2 for more details.
  108153. return Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result) ? result : thisBinding;
  108154. };
  108155. }
  108156. /* harmony default export */ __webpack_exports__["default"] = (createCtor);
  108157. /***/ }),
  108158. /***/ "./node_modules/lodash-es/_createCurry.js":
  108159. /*!************************************************!*\
  108160. !*** ./node_modules/lodash-es/_createCurry.js ***!
  108161. \************************************************/
  108162. /*! exports provided: default */
  108163. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108164. "use strict";
  108165. __webpack_require__.r(__webpack_exports__);
  108166. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  108167. /* harmony import */ var _createCtor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createCtor.js */ "./node_modules/lodash-es/_createCtor.js");
  108168. /* harmony import */ var _createHybrid_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_createHybrid.js */ "./node_modules/lodash-es/_createHybrid.js");
  108169. /* harmony import */ var _createRecurry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_createRecurry.js */ "./node_modules/lodash-es/_createRecurry.js");
  108170. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  108171. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  108172. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  108173. /**
  108174. * Creates a function that wraps `func` to enable currying.
  108175. *
  108176. * @private
  108177. * @param {Function} func The function to wrap.
  108178. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  108179. * @param {number} arity The arity of `func`.
  108180. * @returns {Function} Returns the new wrapped function.
  108181. */
  108182. function createCurry(func, bitmask, arity) {
  108183. var Ctor = Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func);
  108184. function wrapper() {
  108185. var length = arguments.length,
  108186. args = Array(length),
  108187. index = length,
  108188. placeholder = Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_4__["default"])(wrapper);
  108189. while (index--) {
  108190. args[index] = arguments[index];
  108191. }
  108192. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  108193. ? []
  108194. : Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_5__["default"])(args, placeholder);
  108195. length -= holders.length;
  108196. if (length < arity) {
  108197. return Object(_createRecurry_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
  108198. func, bitmask, _createHybrid_js__WEBPACK_IMPORTED_MODULE_2__["default"], wrapper.placeholder, undefined,
  108199. args, holders, undefined, undefined, arity - length);
  108200. }
  108201. var fn = (this && this !== _root_js__WEBPACK_IMPORTED_MODULE_6__["default"] && this instanceof wrapper) ? Ctor : func;
  108202. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(fn, this, args);
  108203. }
  108204. return wrapper;
  108205. }
  108206. /* harmony default export */ __webpack_exports__["default"] = (createCurry);
  108207. /***/ }),
  108208. /***/ "./node_modules/lodash-es/_createFind.js":
  108209. /*!***********************************************!*\
  108210. !*** ./node_modules/lodash-es/_createFind.js ***!
  108211. \***********************************************/
  108212. /*! exports provided: default */
  108213. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108214. "use strict";
  108215. __webpack_require__.r(__webpack_exports__);
  108216. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  108217. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  108218. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  108219. /**
  108220. * Creates a `_.find` or `_.findLast` function.
  108221. *
  108222. * @private
  108223. * @param {Function} findIndexFunc The function to find the collection index.
  108224. * @returns {Function} Returns the new find function.
  108225. */
  108226. function createFind(findIndexFunc) {
  108227. return function(collection, predicate, fromIndex) {
  108228. var iterable = Object(collection);
  108229. if (!Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection)) {
  108230. var iteratee = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3);
  108231. collection = Object(_keys_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection);
  108232. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  108233. }
  108234. var index = findIndexFunc(collection, predicate, fromIndex);
  108235. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  108236. };
  108237. }
  108238. /* harmony default export */ __webpack_exports__["default"] = (createFind);
  108239. /***/ }),
  108240. /***/ "./node_modules/lodash-es/_createFlow.js":
  108241. /*!***********************************************!*\
  108242. !*** ./node_modules/lodash-es/_createFlow.js ***!
  108243. \***********************************************/
  108244. /*! exports provided: default */
  108245. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108246. "use strict";
  108247. __webpack_require__.r(__webpack_exports__);
  108248. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  108249. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  108250. /* harmony import */ var _getData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getData.js */ "./node_modules/lodash-es/_getData.js");
  108251. /* harmony import */ var _getFuncName_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_getFuncName.js */ "./node_modules/lodash-es/_getFuncName.js");
  108252. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  108253. /* harmony import */ var _isLaziable_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_isLaziable.js */ "./node_modules/lodash-es/_isLaziable.js");
  108254. /** Error message constants. */
  108255. var FUNC_ERROR_TEXT = 'Expected a function';
  108256. /** Used to compose bitmasks for function metadata. */
  108257. var WRAP_CURRY_FLAG = 8,
  108258. WRAP_PARTIAL_FLAG = 32,
  108259. WRAP_ARY_FLAG = 128,
  108260. WRAP_REARG_FLAG = 256;
  108261. /**
  108262. * Creates a `_.flow` or `_.flowRight` function.
  108263. *
  108264. * @private
  108265. * @param {boolean} [fromRight] Specify iterating from right to left.
  108266. * @returns {Function} Returns the new flow function.
  108267. */
  108268. function createFlow(fromRight) {
  108269. return Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(funcs) {
  108270. var length = funcs.length,
  108271. index = length,
  108272. prereq = _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.thru;
  108273. if (fromRight) {
  108274. funcs.reverse();
  108275. }
  108276. while (index--) {
  108277. var func = funcs[index];
  108278. if (typeof func != 'function') {
  108279. throw new TypeError(FUNC_ERROR_TEXT);
  108280. }
  108281. if (prereq && !wrapper && Object(_getFuncName_js__WEBPACK_IMPORTED_MODULE_3__["default"])(func) == 'wrapper') {
  108282. var wrapper = new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]([], true);
  108283. }
  108284. }
  108285. index = wrapper ? index : length;
  108286. while (++index < length) {
  108287. func = funcs[index];
  108288. var funcName = Object(_getFuncName_js__WEBPACK_IMPORTED_MODULE_3__["default"])(func),
  108289. data = funcName == 'wrapper' ? Object(_getData_js__WEBPACK_IMPORTED_MODULE_2__["default"])(func) : undefined;
  108290. if (data && Object(_isLaziable_js__WEBPACK_IMPORTED_MODULE_5__["default"])(data[0]) &&
  108291. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  108292. !data[4].length && data[9] == 1
  108293. ) {
  108294. wrapper = wrapper[Object(_getFuncName_js__WEBPACK_IMPORTED_MODULE_3__["default"])(data[0])].apply(wrapper, data[3]);
  108295. } else {
  108296. wrapper = (func.length == 1 && Object(_isLaziable_js__WEBPACK_IMPORTED_MODULE_5__["default"])(func))
  108297. ? wrapper[funcName]()
  108298. : wrapper.thru(func);
  108299. }
  108300. }
  108301. return function() {
  108302. var args = arguments,
  108303. value = args[0];
  108304. if (wrapper && args.length == 1 && Object(_isArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value)) {
  108305. return wrapper.plant(value).value();
  108306. }
  108307. var index = 0,
  108308. result = length ? funcs[index].apply(this, args) : value;
  108309. while (++index < length) {
  108310. result = funcs[index].call(this, result);
  108311. }
  108312. return result;
  108313. };
  108314. });
  108315. }
  108316. /* harmony default export */ __webpack_exports__["default"] = (createFlow);
  108317. /***/ }),
  108318. /***/ "./node_modules/lodash-es/_createHybrid.js":
  108319. /*!*************************************************!*\
  108320. !*** ./node_modules/lodash-es/_createHybrid.js ***!
  108321. \*************************************************/
  108322. /*! exports provided: default */
  108323. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108324. "use strict";
  108325. __webpack_require__.r(__webpack_exports__);
  108326. /* harmony import */ var _composeArgs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_composeArgs.js */ "./node_modules/lodash-es/_composeArgs.js");
  108327. /* harmony import */ var _composeArgsRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_composeArgsRight.js */ "./node_modules/lodash-es/_composeArgsRight.js");
  108328. /* harmony import */ var _countHolders_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_countHolders.js */ "./node_modules/lodash-es/_countHolders.js");
  108329. /* harmony import */ var _createCtor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_createCtor.js */ "./node_modules/lodash-es/_createCtor.js");
  108330. /* harmony import */ var _createRecurry_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_createRecurry.js */ "./node_modules/lodash-es/_createRecurry.js");
  108331. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  108332. /* harmony import */ var _reorder_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_reorder.js */ "./node_modules/lodash-es/_reorder.js");
  108333. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  108334. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  108335. /** Used to compose bitmasks for function metadata. */
  108336. var WRAP_BIND_FLAG = 1,
  108337. WRAP_BIND_KEY_FLAG = 2,
  108338. WRAP_CURRY_FLAG = 8,
  108339. WRAP_CURRY_RIGHT_FLAG = 16,
  108340. WRAP_ARY_FLAG = 128,
  108341. WRAP_FLIP_FLAG = 512;
  108342. /**
  108343. * Creates a function that wraps `func` to invoke it with optional `this`
  108344. * binding of `thisArg`, partial application, and currying.
  108345. *
  108346. * @private
  108347. * @param {Function|string} func The function or method name to wrap.
  108348. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  108349. * @param {*} [thisArg] The `this` binding of `func`.
  108350. * @param {Array} [partials] The arguments to prepend to those provided to
  108351. * the new function.
  108352. * @param {Array} [holders] The `partials` placeholder indexes.
  108353. * @param {Array} [partialsRight] The arguments to append to those provided
  108354. * to the new function.
  108355. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  108356. * @param {Array} [argPos] The argument positions of the new function.
  108357. * @param {number} [ary] The arity cap of `func`.
  108358. * @param {number} [arity] The arity of `func`.
  108359. * @returns {Function} Returns the new wrapped function.
  108360. */
  108361. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  108362. var isAry = bitmask & WRAP_ARY_FLAG,
  108363. isBind = bitmask & WRAP_BIND_FLAG,
  108364. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  108365. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  108366. isFlip = bitmask & WRAP_FLIP_FLAG,
  108367. Ctor = isBindKey ? undefined : Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_3__["default"])(func);
  108368. function wrapper() {
  108369. var length = arguments.length,
  108370. args = Array(length),
  108371. index = length;
  108372. while (index--) {
  108373. args[index] = arguments[index];
  108374. }
  108375. if (isCurried) {
  108376. var placeholder = Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_5__["default"])(wrapper),
  108377. holdersCount = Object(_countHolders_js__WEBPACK_IMPORTED_MODULE_2__["default"])(args, placeholder);
  108378. }
  108379. if (partials) {
  108380. args = Object(_composeArgs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(args, partials, holders, isCurried);
  108381. }
  108382. if (partialsRight) {
  108383. args = Object(_composeArgsRight_js__WEBPACK_IMPORTED_MODULE_1__["default"])(args, partialsRight, holdersRight, isCurried);
  108384. }
  108385. length -= holdersCount;
  108386. if (isCurried && length < arity) {
  108387. var newHolders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_7__["default"])(args, placeholder);
  108388. return Object(_createRecurry_js__WEBPACK_IMPORTED_MODULE_4__["default"])(
  108389. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  108390. args, newHolders, argPos, ary, arity - length
  108391. );
  108392. }
  108393. var thisBinding = isBind ? thisArg : this,
  108394. fn = isBindKey ? thisBinding[func] : func;
  108395. length = args.length;
  108396. if (argPos) {
  108397. args = Object(_reorder_js__WEBPACK_IMPORTED_MODULE_6__["default"])(args, argPos);
  108398. } else if (isFlip && length > 1) {
  108399. args.reverse();
  108400. }
  108401. if (isAry && ary < length) {
  108402. args.length = ary;
  108403. }
  108404. if (this && this !== _root_js__WEBPACK_IMPORTED_MODULE_8__["default"] && this instanceof wrapper) {
  108405. fn = Ctor || Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_3__["default"])(fn);
  108406. }
  108407. return fn.apply(thisBinding, args);
  108408. }
  108409. return wrapper;
  108410. }
  108411. /* harmony default export */ __webpack_exports__["default"] = (createHybrid);
  108412. /***/ }),
  108413. /***/ "./node_modules/lodash-es/_createInverter.js":
  108414. /*!***************************************************!*\
  108415. !*** ./node_modules/lodash-es/_createInverter.js ***!
  108416. \***************************************************/
  108417. /*! exports provided: default */
  108418. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108419. "use strict";
  108420. __webpack_require__.r(__webpack_exports__);
  108421. /* harmony import */ var _baseInverter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInverter.js */ "./node_modules/lodash-es/_baseInverter.js");
  108422. /**
  108423. * Creates a function like `_.invertBy`.
  108424. *
  108425. * @private
  108426. * @param {Function} setter The function to set accumulator values.
  108427. * @param {Function} toIteratee The function to resolve iteratees.
  108428. * @returns {Function} Returns the new inverter function.
  108429. */
  108430. function createInverter(setter, toIteratee) {
  108431. return function(object, iteratee) {
  108432. return Object(_baseInverter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, setter, toIteratee(iteratee), {});
  108433. };
  108434. }
  108435. /* harmony default export */ __webpack_exports__["default"] = (createInverter);
  108436. /***/ }),
  108437. /***/ "./node_modules/lodash-es/_createMathOperation.js":
  108438. /*!********************************************************!*\
  108439. !*** ./node_modules/lodash-es/_createMathOperation.js ***!
  108440. \********************************************************/
  108441. /*! exports provided: default */
  108442. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108443. "use strict";
  108444. __webpack_require__.r(__webpack_exports__);
  108445. /* harmony import */ var _baseToNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToNumber.js */ "./node_modules/lodash-es/_baseToNumber.js");
  108446. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  108447. /**
  108448. * Creates a function that performs a mathematical operation on two values.
  108449. *
  108450. * @private
  108451. * @param {Function} operator The function to perform the operation.
  108452. * @param {number} [defaultValue] The value used for `undefined` arguments.
  108453. * @returns {Function} Returns the new mathematical operation function.
  108454. */
  108455. function createMathOperation(operator, defaultValue) {
  108456. return function(value, other) {
  108457. var result;
  108458. if (value === undefined && other === undefined) {
  108459. return defaultValue;
  108460. }
  108461. if (value !== undefined) {
  108462. result = value;
  108463. }
  108464. if (other !== undefined) {
  108465. if (result === undefined) {
  108466. return other;
  108467. }
  108468. if (typeof value == 'string' || typeof other == 'string') {
  108469. value = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
  108470. other = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other);
  108471. } else {
  108472. value = Object(_baseToNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  108473. other = Object(_baseToNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other);
  108474. }
  108475. result = operator(value, other);
  108476. }
  108477. return result;
  108478. };
  108479. }
  108480. /* harmony default export */ __webpack_exports__["default"] = (createMathOperation);
  108481. /***/ }),
  108482. /***/ "./node_modules/lodash-es/_createOver.js":
  108483. /*!***********************************************!*\
  108484. !*** ./node_modules/lodash-es/_createOver.js ***!
  108485. \***********************************************/
  108486. /*! exports provided: default */
  108487. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108488. "use strict";
  108489. __webpack_require__.r(__webpack_exports__);
  108490. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  108491. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  108492. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  108493. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  108494. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  108495. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  108496. /**
  108497. * Creates a function like `_.over`.
  108498. *
  108499. * @private
  108500. * @param {Function} arrayFunc The function to iterate over iteratees.
  108501. * @returns {Function} Returns the new over function.
  108502. */
  108503. function createOver(arrayFunc) {
  108504. return Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_5__["default"])(function(iteratees) {
  108505. iteratees = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratees, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_4__["default"])(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"]));
  108506. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(args) {
  108507. var thisArg = this;
  108508. return arrayFunc(iteratees, function(iteratee) {
  108509. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, thisArg, args);
  108510. });
  108511. });
  108512. });
  108513. }
  108514. /* harmony default export */ __webpack_exports__["default"] = (createOver);
  108515. /***/ }),
  108516. /***/ "./node_modules/lodash-es/_createPadding.js":
  108517. /*!**************************************************!*\
  108518. !*** ./node_modules/lodash-es/_createPadding.js ***!
  108519. \**************************************************/
  108520. /*! exports provided: default */
  108521. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108522. "use strict";
  108523. __webpack_require__.r(__webpack_exports__);
  108524. /* harmony import */ var _baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRepeat.js */ "./node_modules/lodash-es/_baseRepeat.js");
  108525. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  108526. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  108527. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  108528. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  108529. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  108530. /* Built-in method references for those with the same name as other `lodash` methods. */
  108531. var nativeCeil = Math.ceil;
  108532. /**
  108533. * Creates the padding for `string` based on `length`. The `chars` string
  108534. * is truncated if the number of characters exceeds `length`.
  108535. *
  108536. * @private
  108537. * @param {number} length The padding length.
  108538. * @param {string} [chars=' '] The string used as padding.
  108539. * @returns {string} Returns the padding for `string`.
  108540. */
  108541. function createPadding(length, chars) {
  108542. chars = chars === undefined ? ' ' : Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(chars);
  108543. var charsLength = chars.length;
  108544. if (charsLength < 2) {
  108545. return charsLength ? Object(_baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars, length) : chars;
  108546. }
  108547. var result = Object(_baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars, nativeCeil(length / Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_4__["default"])(chars)));
  108548. return Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_3__["default"])(chars)
  108549. ? Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(result), 0, length).join('')
  108550. : result.slice(0, length);
  108551. }
  108552. /* harmony default export */ __webpack_exports__["default"] = (createPadding);
  108553. /***/ }),
  108554. /***/ "./node_modules/lodash-es/_createPartial.js":
  108555. /*!**************************************************!*\
  108556. !*** ./node_modules/lodash-es/_createPartial.js ***!
  108557. \**************************************************/
  108558. /*! exports provided: default */
  108559. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108560. "use strict";
  108561. __webpack_require__.r(__webpack_exports__);
  108562. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  108563. /* harmony import */ var _createCtor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createCtor.js */ "./node_modules/lodash-es/_createCtor.js");
  108564. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  108565. /** Used to compose bitmasks for function metadata. */
  108566. var WRAP_BIND_FLAG = 1;
  108567. /**
  108568. * Creates a function that wraps `func` to invoke it with the `this` binding
  108569. * of `thisArg` and `partials` prepended to the arguments it receives.
  108570. *
  108571. * @private
  108572. * @param {Function} func The function to wrap.
  108573. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  108574. * @param {*} thisArg The `this` binding of `func`.
  108575. * @param {Array} partials The arguments to prepend to those provided to
  108576. * the new function.
  108577. * @returns {Function} Returns the new wrapped function.
  108578. */
  108579. function createPartial(func, bitmask, thisArg, partials) {
  108580. var isBind = bitmask & WRAP_BIND_FLAG,
  108581. Ctor = Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func);
  108582. function wrapper() {
  108583. var argsIndex = -1,
  108584. argsLength = arguments.length,
  108585. leftIndex = -1,
  108586. leftLength = partials.length,
  108587. args = Array(leftLength + argsLength),
  108588. fn = (this && this !== _root_js__WEBPACK_IMPORTED_MODULE_2__["default"] && this instanceof wrapper) ? Ctor : func;
  108589. while (++leftIndex < leftLength) {
  108590. args[leftIndex] = partials[leftIndex];
  108591. }
  108592. while (argsLength--) {
  108593. args[leftIndex++] = arguments[++argsIndex];
  108594. }
  108595. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(fn, isBind ? thisArg : this, args);
  108596. }
  108597. return wrapper;
  108598. }
  108599. /* harmony default export */ __webpack_exports__["default"] = (createPartial);
  108600. /***/ }),
  108601. /***/ "./node_modules/lodash-es/_createRange.js":
  108602. /*!************************************************!*\
  108603. !*** ./node_modules/lodash-es/_createRange.js ***!
  108604. \************************************************/
  108605. /*! exports provided: default */
  108606. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108607. "use strict";
  108608. __webpack_require__.r(__webpack_exports__);
  108609. /* harmony import */ var _baseRange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRange.js */ "./node_modules/lodash-es/_baseRange.js");
  108610. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  108611. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  108612. /**
  108613. * Creates a `_.range` or `_.rangeRight` function.
  108614. *
  108615. * @private
  108616. * @param {boolean} [fromRight] Specify iterating from right to left.
  108617. * @returns {Function} Returns the new range function.
  108618. */
  108619. function createRange(fromRight) {
  108620. return function(start, end, step) {
  108621. if (step && typeof step != 'number' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start, end, step)) {
  108622. end = step = undefined;
  108623. }
  108624. // Ensure the sign of `-0` is preserved.
  108625. start = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(start);
  108626. if (end === undefined) {
  108627. end = start;
  108628. start = 0;
  108629. } else {
  108630. end = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(end);
  108631. }
  108632. step = step === undefined ? (start < end ? 1 : -1) : Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(step);
  108633. return Object(_baseRange_js__WEBPACK_IMPORTED_MODULE_0__["default"])(start, end, step, fromRight);
  108634. };
  108635. }
  108636. /* harmony default export */ __webpack_exports__["default"] = (createRange);
  108637. /***/ }),
  108638. /***/ "./node_modules/lodash-es/_createRecurry.js":
  108639. /*!**************************************************!*\
  108640. !*** ./node_modules/lodash-es/_createRecurry.js ***!
  108641. \**************************************************/
  108642. /*! exports provided: default */
  108643. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108644. "use strict";
  108645. __webpack_require__.r(__webpack_exports__);
  108646. /* harmony import */ var _isLaziable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isLaziable.js */ "./node_modules/lodash-es/_isLaziable.js");
  108647. /* harmony import */ var _setData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_setData.js */ "./node_modules/lodash-es/_setData.js");
  108648. /* harmony import */ var _setWrapToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setWrapToString.js */ "./node_modules/lodash-es/_setWrapToString.js");
  108649. /** Used to compose bitmasks for function metadata. */
  108650. var WRAP_BIND_FLAG = 1,
  108651. WRAP_BIND_KEY_FLAG = 2,
  108652. WRAP_CURRY_BOUND_FLAG = 4,
  108653. WRAP_CURRY_FLAG = 8,
  108654. WRAP_PARTIAL_FLAG = 32,
  108655. WRAP_PARTIAL_RIGHT_FLAG = 64;
  108656. /**
  108657. * Creates a function that wraps `func` to continue currying.
  108658. *
  108659. * @private
  108660. * @param {Function} func The function to wrap.
  108661. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  108662. * @param {Function} wrapFunc The function to create the `func` wrapper.
  108663. * @param {*} placeholder The placeholder value.
  108664. * @param {*} [thisArg] The `this` binding of `func`.
  108665. * @param {Array} [partials] The arguments to prepend to those provided to
  108666. * the new function.
  108667. * @param {Array} [holders] The `partials` placeholder indexes.
  108668. * @param {Array} [argPos] The argument positions of the new function.
  108669. * @param {number} [ary] The arity cap of `func`.
  108670. * @param {number} [arity] The arity of `func`.
  108671. * @returns {Function} Returns the new wrapped function.
  108672. */
  108673. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  108674. var isCurry = bitmask & WRAP_CURRY_FLAG,
  108675. newHolders = isCurry ? holders : undefined,
  108676. newHoldersRight = isCurry ? undefined : holders,
  108677. newPartials = isCurry ? partials : undefined,
  108678. newPartialsRight = isCurry ? undefined : partials;
  108679. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  108680. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  108681. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  108682. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  108683. }
  108684. var newData = [
  108685. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  108686. newHoldersRight, argPos, ary, arity
  108687. ];
  108688. var result = wrapFunc.apply(undefined, newData);
  108689. if (Object(_isLaziable_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func)) {
  108690. Object(_setData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, newData);
  108691. }
  108692. result.placeholder = placeholder;
  108693. return Object(_setWrapToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(result, func, bitmask);
  108694. }
  108695. /* harmony default export */ __webpack_exports__["default"] = (createRecurry);
  108696. /***/ }),
  108697. /***/ "./node_modules/lodash-es/_createRelationalOperation.js":
  108698. /*!**************************************************************!*\
  108699. !*** ./node_modules/lodash-es/_createRelationalOperation.js ***!
  108700. \**************************************************************/
  108701. /*! exports provided: default */
  108702. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108703. "use strict";
  108704. __webpack_require__.r(__webpack_exports__);
  108705. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  108706. /**
  108707. * Creates a function that performs a relational operation on two values.
  108708. *
  108709. * @private
  108710. * @param {Function} operator The function to perform the operation.
  108711. * @returns {Function} Returns the new relational operation function.
  108712. */
  108713. function createRelationalOperation(operator) {
  108714. return function(value, other) {
  108715. if (!(typeof value == 'string' && typeof other == 'string')) {
  108716. value = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  108717. other = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other);
  108718. }
  108719. return operator(value, other);
  108720. };
  108721. }
  108722. /* harmony default export */ __webpack_exports__["default"] = (createRelationalOperation);
  108723. /***/ }),
  108724. /***/ "./node_modules/lodash-es/_createRound.js":
  108725. /*!************************************************!*\
  108726. !*** ./node_modules/lodash-es/_createRound.js ***!
  108727. \************************************************/
  108728. /*! exports provided: default */
  108729. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108730. "use strict";
  108731. __webpack_require__.r(__webpack_exports__);
  108732. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  108733. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  108734. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  108735. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  108736. /* Built-in method references for those with the same name as other `lodash` methods. */
  108737. var nativeIsFinite = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFinite,
  108738. nativeMin = Math.min;
  108739. /**
  108740. * Creates a function like `_.round`.
  108741. *
  108742. * @private
  108743. * @param {string} methodName The name of the `Math` method to use when rounding.
  108744. * @returns {Function} Returns the new round function.
  108745. */
  108746. function createRound(methodName) {
  108747. var func = Math[methodName];
  108748. return function(number, precision) {
  108749. number = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(number);
  108750. precision = precision == null ? 0 : nativeMin(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(precision), 292);
  108751. if (precision && nativeIsFinite(number)) {
  108752. // Shift with exponential notation to avoid floating-point issues.
  108753. // See [MDN](https://mdn.io/round#Examples) for more details.
  108754. var pair = (Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(number) + 'e').split('e'),
  108755. value = func(pair[0] + 'e' + (+pair[1] + precision));
  108756. pair = (Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value) + 'e').split('e');
  108757. return +(pair[0] + 'e' + (+pair[1] - precision));
  108758. }
  108759. return func(number);
  108760. };
  108761. }
  108762. /* harmony default export */ __webpack_exports__["default"] = (createRound);
  108763. /***/ }),
  108764. /***/ "./node_modules/lodash-es/_createSet.js":
  108765. /*!**********************************************!*\
  108766. !*** ./node_modules/lodash-es/_createSet.js ***!
  108767. \**********************************************/
  108768. /*! exports provided: default */
  108769. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108770. "use strict";
  108771. __webpack_require__.r(__webpack_exports__);
  108772. /* harmony import */ var _Set_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Set.js */ "./node_modules/lodash-es/_Set.js");
  108773. /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
  108774. /* harmony import */ var _setToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setToArray.js */ "./node_modules/lodash-es/_setToArray.js");
  108775. /** Used as references for various `Number` constants. */
  108776. var INFINITY = 1 / 0;
  108777. /**
  108778. * Creates a set object of `values`.
  108779. *
  108780. * @private
  108781. * @param {Array} values The values to add to the set.
  108782. * @returns {Object} Returns the new set.
  108783. */
  108784. var createSet = !(_Set_js__WEBPACK_IMPORTED_MODULE_0__["default"] && (1 / Object(_setToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(new _Set_js__WEBPACK_IMPORTED_MODULE_0__["default"]([,-0]))[1]) == INFINITY) ? _noop_js__WEBPACK_IMPORTED_MODULE_1__["default"] : function(values) {
  108785. return new _Set_js__WEBPACK_IMPORTED_MODULE_0__["default"](values);
  108786. };
  108787. /* harmony default export */ __webpack_exports__["default"] = (createSet);
  108788. /***/ }),
  108789. /***/ "./node_modules/lodash-es/_createToPairs.js":
  108790. /*!**************************************************!*\
  108791. !*** ./node_modules/lodash-es/_createToPairs.js ***!
  108792. \**************************************************/
  108793. /*! exports provided: default */
  108794. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108795. "use strict";
  108796. __webpack_require__.r(__webpack_exports__);
  108797. /* harmony import */ var _baseToPairs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToPairs.js */ "./node_modules/lodash-es/_baseToPairs.js");
  108798. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  108799. /* harmony import */ var _mapToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_mapToArray.js */ "./node_modules/lodash-es/_mapToArray.js");
  108800. /* harmony import */ var _setToPairs_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_setToPairs.js */ "./node_modules/lodash-es/_setToPairs.js");
  108801. /** `Object#toString` result references. */
  108802. var mapTag = '[object Map]',
  108803. setTag = '[object Set]';
  108804. /**
  108805. * Creates a `_.toPairs` or `_.toPairsIn` function.
  108806. *
  108807. * @private
  108808. * @param {Function} keysFunc The function to get the keys of a given object.
  108809. * @returns {Function} Returns the new pairs function.
  108810. */
  108811. function createToPairs(keysFunc) {
  108812. return function(object) {
  108813. var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
  108814. if (tag == mapTag) {
  108815. return Object(_mapToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object);
  108816. }
  108817. if (tag == setTag) {
  108818. return Object(_setToPairs_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object);
  108819. }
  108820. return Object(_baseToPairs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, keysFunc(object));
  108821. };
  108822. }
  108823. /* harmony default export */ __webpack_exports__["default"] = (createToPairs);
  108824. /***/ }),
  108825. /***/ "./node_modules/lodash-es/_createWrap.js":
  108826. /*!***********************************************!*\
  108827. !*** ./node_modules/lodash-es/_createWrap.js ***!
  108828. \***********************************************/
  108829. /*! exports provided: default */
  108830. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108831. "use strict";
  108832. __webpack_require__.r(__webpack_exports__);
  108833. /* harmony import */ var _baseSetData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSetData.js */ "./node_modules/lodash-es/_baseSetData.js");
  108834. /* harmony import */ var _createBind_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createBind.js */ "./node_modules/lodash-es/_createBind.js");
  108835. /* harmony import */ var _createCurry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_createCurry.js */ "./node_modules/lodash-es/_createCurry.js");
  108836. /* harmony import */ var _createHybrid_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_createHybrid.js */ "./node_modules/lodash-es/_createHybrid.js");
  108837. /* harmony import */ var _createPartial_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_createPartial.js */ "./node_modules/lodash-es/_createPartial.js");
  108838. /* harmony import */ var _getData_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_getData.js */ "./node_modules/lodash-es/_getData.js");
  108839. /* harmony import */ var _mergeData_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_mergeData.js */ "./node_modules/lodash-es/_mergeData.js");
  108840. /* harmony import */ var _setData_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_setData.js */ "./node_modules/lodash-es/_setData.js");
  108841. /* harmony import */ var _setWrapToString_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_setWrapToString.js */ "./node_modules/lodash-es/_setWrapToString.js");
  108842. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  108843. /** Error message constants. */
  108844. var FUNC_ERROR_TEXT = 'Expected a function';
  108845. /** Used to compose bitmasks for function metadata. */
  108846. var WRAP_BIND_FLAG = 1,
  108847. WRAP_BIND_KEY_FLAG = 2,
  108848. WRAP_CURRY_FLAG = 8,
  108849. WRAP_CURRY_RIGHT_FLAG = 16,
  108850. WRAP_PARTIAL_FLAG = 32,
  108851. WRAP_PARTIAL_RIGHT_FLAG = 64;
  108852. /* Built-in method references for those with the same name as other `lodash` methods. */
  108853. var nativeMax = Math.max;
  108854. /**
  108855. * Creates a function that either curries or invokes `func` with optional
  108856. * `this` binding and partially applied arguments.
  108857. *
  108858. * @private
  108859. * @param {Function|string} func The function or method name to wrap.
  108860. * @param {number} bitmask The bitmask flags.
  108861. * 1 - `_.bind`
  108862. * 2 - `_.bindKey`
  108863. * 4 - `_.curry` or `_.curryRight` of a bound function
  108864. * 8 - `_.curry`
  108865. * 16 - `_.curryRight`
  108866. * 32 - `_.partial`
  108867. * 64 - `_.partialRight`
  108868. * 128 - `_.rearg`
  108869. * 256 - `_.ary`
  108870. * 512 - `_.flip`
  108871. * @param {*} [thisArg] The `this` binding of `func`.
  108872. * @param {Array} [partials] The arguments to be partially applied.
  108873. * @param {Array} [holders] The `partials` placeholder indexes.
  108874. * @param {Array} [argPos] The argument positions of the new function.
  108875. * @param {number} [ary] The arity cap of `func`.
  108876. * @param {number} [arity] The arity of `func`.
  108877. * @returns {Function} Returns the new wrapped function.
  108878. */
  108879. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  108880. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  108881. if (!isBindKey && typeof func != 'function') {
  108882. throw new TypeError(FUNC_ERROR_TEXT);
  108883. }
  108884. var length = partials ? partials.length : 0;
  108885. if (!length) {
  108886. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  108887. partials = holders = undefined;
  108888. }
  108889. ary = ary === undefined ? ary : nativeMax(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_9__["default"])(ary), 0);
  108890. arity = arity === undefined ? arity : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_9__["default"])(arity);
  108891. length -= holders ? holders.length : 0;
  108892. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  108893. var partialsRight = partials,
  108894. holdersRight = holders;
  108895. partials = holders = undefined;
  108896. }
  108897. var data = isBindKey ? undefined : Object(_getData_js__WEBPACK_IMPORTED_MODULE_5__["default"])(func);
  108898. var newData = [
  108899. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  108900. argPos, ary, arity
  108901. ];
  108902. if (data) {
  108903. Object(_mergeData_js__WEBPACK_IMPORTED_MODULE_6__["default"])(newData, data);
  108904. }
  108905. func = newData[0];
  108906. bitmask = newData[1];
  108907. thisArg = newData[2];
  108908. partials = newData[3];
  108909. holders = newData[4];
  108910. arity = newData[9] = newData[9] === undefined
  108911. ? (isBindKey ? 0 : func.length)
  108912. : nativeMax(newData[9] - length, 0);
  108913. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  108914. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  108915. }
  108916. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  108917. var result = Object(_createBind_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, bitmask, thisArg);
  108918. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  108919. result = Object(_createCurry_js__WEBPACK_IMPORTED_MODULE_2__["default"])(func, bitmask, arity);
  108920. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  108921. result = Object(_createPartial_js__WEBPACK_IMPORTED_MODULE_4__["default"])(func, bitmask, thisArg, partials);
  108922. } else {
  108923. result = _createHybrid_js__WEBPACK_IMPORTED_MODULE_3__["default"].apply(undefined, newData);
  108924. }
  108925. var setter = data ? _baseSetData_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _setData_js__WEBPACK_IMPORTED_MODULE_7__["default"];
  108926. return Object(_setWrapToString_js__WEBPACK_IMPORTED_MODULE_8__["default"])(setter(result, newData), func, bitmask);
  108927. }
  108928. /* harmony default export */ __webpack_exports__["default"] = (createWrap);
  108929. /***/ }),
  108930. /***/ "./node_modules/lodash-es/_customDefaultsAssignIn.js":
  108931. /*!***********************************************************!*\
  108932. !*** ./node_modules/lodash-es/_customDefaultsAssignIn.js ***!
  108933. \***********************************************************/
  108934. /*! exports provided: default */
  108935. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108936. "use strict";
  108937. __webpack_require__.r(__webpack_exports__);
  108938. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  108939. /** Used for built-in method references. */
  108940. var objectProto = Object.prototype;
  108941. /** Used to check objects for own properties. */
  108942. var hasOwnProperty = objectProto.hasOwnProperty;
  108943. /**
  108944. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  108945. * of source objects to the destination object for all destination properties
  108946. * that resolve to `undefined`.
  108947. *
  108948. * @private
  108949. * @param {*} objValue The destination value.
  108950. * @param {*} srcValue The source value.
  108951. * @param {string} key The key of the property to assign.
  108952. * @param {Object} object The parent object of `objValue`.
  108953. * @returns {*} Returns the value to assign.
  108954. */
  108955. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  108956. if (objValue === undefined ||
  108957. (Object(_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  108958. return srcValue;
  108959. }
  108960. return objValue;
  108961. }
  108962. /* harmony default export */ __webpack_exports__["default"] = (customDefaultsAssignIn);
  108963. /***/ }),
  108964. /***/ "./node_modules/lodash-es/_customDefaultsMerge.js":
  108965. /*!********************************************************!*\
  108966. !*** ./node_modules/lodash-es/_customDefaultsMerge.js ***!
  108967. \********************************************************/
  108968. /*! exports provided: default */
  108969. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108970. "use strict";
  108971. __webpack_require__.r(__webpack_exports__);
  108972. /* harmony import */ var _baseMerge_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMerge.js */ "./node_modules/lodash-es/_baseMerge.js");
  108973. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  108974. /**
  108975. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  108976. * objects into destination objects that are passed thru.
  108977. *
  108978. * @private
  108979. * @param {*} objValue The destination value.
  108980. * @param {*} srcValue The source value.
  108981. * @param {string} key The key of the property to merge.
  108982. * @param {Object} object The parent object of `objValue`.
  108983. * @param {Object} source The parent object of `srcValue`.
  108984. * @param {Object} [stack] Tracks traversed source values and their merged
  108985. * counterparts.
  108986. * @returns {*} Returns the value to assign.
  108987. */
  108988. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  108989. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(objValue) && Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(srcValue)) {
  108990. // Recursively merge objects and arrays (susceptible to call stack limits).
  108991. stack.set(srcValue, objValue);
  108992. Object(_baseMerge_js__WEBPACK_IMPORTED_MODULE_0__["default"])(objValue, srcValue, undefined, customDefaultsMerge, stack);
  108993. stack['delete'](srcValue);
  108994. }
  108995. return objValue;
  108996. }
  108997. /* harmony default export */ __webpack_exports__["default"] = (customDefaultsMerge);
  108998. /***/ }),
  108999. /***/ "./node_modules/lodash-es/_customOmitClone.js":
  109000. /*!****************************************************!*\
  109001. !*** ./node_modules/lodash-es/_customOmitClone.js ***!
  109002. \****************************************************/
  109003. /*! exports provided: default */
  109004. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109005. "use strict";
  109006. __webpack_require__.r(__webpack_exports__);
  109007. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  109008. /**
  109009. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  109010. * objects.
  109011. *
  109012. * @private
  109013. * @param {*} value The value to inspect.
  109014. * @param {string} key The key of the property to inspect.
  109015. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  109016. */
  109017. function customOmitClone(value) {
  109018. return Object(_isPlainObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? undefined : value;
  109019. }
  109020. /* harmony default export */ __webpack_exports__["default"] = (customOmitClone);
  109021. /***/ }),
  109022. /***/ "./node_modules/lodash-es/_deburrLetter.js":
  109023. /*!*************************************************!*\
  109024. !*** ./node_modules/lodash-es/_deburrLetter.js ***!
  109025. \*************************************************/
  109026. /*! exports provided: default */
  109027. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109028. "use strict";
  109029. __webpack_require__.r(__webpack_exports__);
  109030. /* harmony import */ var _basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePropertyOf.js */ "./node_modules/lodash-es/_basePropertyOf.js");
  109031. /** Used to map Latin Unicode letters to basic Latin letters. */
  109032. var deburredLetters = {
  109033. // Latin-1 Supplement block.
  109034. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  109035. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  109036. '\xc7': 'C', '\xe7': 'c',
  109037. '\xd0': 'D', '\xf0': 'd',
  109038. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  109039. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  109040. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  109041. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  109042. '\xd1': 'N', '\xf1': 'n',
  109043. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  109044. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  109045. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  109046. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  109047. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  109048. '\xc6': 'Ae', '\xe6': 'ae',
  109049. '\xde': 'Th', '\xfe': 'th',
  109050. '\xdf': 'ss',
  109051. // Latin Extended-A block.
  109052. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  109053. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  109054. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  109055. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  109056. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  109057. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  109058. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  109059. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  109060. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  109061. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  109062. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  109063. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  109064. '\u0134': 'J', '\u0135': 'j',
  109065. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  109066. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  109067. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  109068. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  109069. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  109070. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  109071. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  109072. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  109073. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  109074. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  109075. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  109076. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  109077. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  109078. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  109079. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  109080. '\u0174': 'W', '\u0175': 'w',
  109081. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  109082. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  109083. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  109084. '\u0132': 'IJ', '\u0133': 'ij',
  109085. '\u0152': 'Oe', '\u0153': 'oe',
  109086. '\u0149': "'n", '\u017f': 's'
  109087. };
  109088. /**
  109089. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  109090. * letters to basic Latin letters.
  109091. *
  109092. * @private
  109093. * @param {string} letter The matched letter to deburr.
  109094. * @returns {string} Returns the deburred letter.
  109095. */
  109096. var deburrLetter = Object(_basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(deburredLetters);
  109097. /* harmony default export */ __webpack_exports__["default"] = (deburrLetter);
  109098. /***/ }),
  109099. /***/ "./node_modules/lodash-es/_defineProperty.js":
  109100. /*!***************************************************!*\
  109101. !*** ./node_modules/lodash-es/_defineProperty.js ***!
  109102. \***************************************************/
  109103. /*! exports provided: default */
  109104. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109105. "use strict";
  109106. __webpack_require__.r(__webpack_exports__);
  109107. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  109108. var defineProperty = (function() {
  109109. try {
  109110. var func = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object, 'defineProperty');
  109111. func({}, '', {});
  109112. return func;
  109113. } catch (e) {}
  109114. }());
  109115. /* harmony default export */ __webpack_exports__["default"] = (defineProperty);
  109116. /***/ }),
  109117. /***/ "./node_modules/lodash-es/_equalArrays.js":
  109118. /*!************************************************!*\
  109119. !*** ./node_modules/lodash-es/_equalArrays.js ***!
  109120. \************************************************/
  109121. /*! exports provided: default */
  109122. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109123. "use strict";
  109124. __webpack_require__.r(__webpack_exports__);
  109125. /* harmony import */ var _SetCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_SetCache.js */ "./node_modules/lodash-es/_SetCache.js");
  109126. /* harmony import */ var _arraySome_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arraySome.js */ "./node_modules/lodash-es/_arraySome.js");
  109127. /* harmony import */ var _cacheHas_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_cacheHas.js */ "./node_modules/lodash-es/_cacheHas.js");
  109128. /** Used to compose bitmasks for value comparisons. */
  109129. var COMPARE_PARTIAL_FLAG = 1,
  109130. COMPARE_UNORDERED_FLAG = 2;
  109131. /**
  109132. * A specialized version of `baseIsEqualDeep` for arrays with support for
  109133. * partial deep comparisons.
  109134. *
  109135. * @private
  109136. * @param {Array} array The array to compare.
  109137. * @param {Array} other The other array to compare.
  109138. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  109139. * @param {Function} customizer The function to customize comparisons.
  109140. * @param {Function} equalFunc The function to determine equivalents of values.
  109141. * @param {Object} stack Tracks traversed `array` and `other` objects.
  109142. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  109143. */
  109144. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  109145. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  109146. arrLength = array.length,
  109147. othLength = other.length;
  109148. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  109149. return false;
  109150. }
  109151. // Check that cyclic values are equal.
  109152. var arrStacked = stack.get(array);
  109153. var othStacked = stack.get(other);
  109154. if (arrStacked && othStacked) {
  109155. return arrStacked == other && othStacked == array;
  109156. }
  109157. var index = -1,
  109158. result = true,
  109159. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new _SetCache_js__WEBPACK_IMPORTED_MODULE_0__["default"] : undefined;
  109160. stack.set(array, other);
  109161. stack.set(other, array);
  109162. // Ignore non-index properties.
  109163. while (++index < arrLength) {
  109164. var arrValue = array[index],
  109165. othValue = other[index];
  109166. if (customizer) {
  109167. var compared = isPartial
  109168. ? customizer(othValue, arrValue, index, other, array, stack)
  109169. : customizer(arrValue, othValue, index, array, other, stack);
  109170. }
  109171. if (compared !== undefined) {
  109172. if (compared) {
  109173. continue;
  109174. }
  109175. result = false;
  109176. break;
  109177. }
  109178. // Recursively compare arrays (susceptible to call stack limits).
  109179. if (seen) {
  109180. if (!Object(_arraySome_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other, function(othValue, othIndex) {
  109181. if (!Object(_cacheHas_js__WEBPACK_IMPORTED_MODULE_2__["default"])(seen, othIndex) &&
  109182. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  109183. return seen.push(othIndex);
  109184. }
  109185. })) {
  109186. result = false;
  109187. break;
  109188. }
  109189. } else if (!(
  109190. arrValue === othValue ||
  109191. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  109192. )) {
  109193. result = false;
  109194. break;
  109195. }
  109196. }
  109197. stack['delete'](array);
  109198. stack['delete'](other);
  109199. return result;
  109200. }
  109201. /* harmony default export */ __webpack_exports__["default"] = (equalArrays);
  109202. /***/ }),
  109203. /***/ "./node_modules/lodash-es/_equalByTag.js":
  109204. /*!***********************************************!*\
  109205. !*** ./node_modules/lodash-es/_equalByTag.js ***!
  109206. \***********************************************/
  109207. /*! exports provided: default */
  109208. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109209. "use strict";
  109210. __webpack_require__.r(__webpack_exports__);
  109211. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  109212. /* harmony import */ var _Uint8Array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_Uint8Array.js */ "./node_modules/lodash-es/_Uint8Array.js");
  109213. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  109214. /* harmony import */ var _equalArrays_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_equalArrays.js */ "./node_modules/lodash-es/_equalArrays.js");
  109215. /* harmony import */ var _mapToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_mapToArray.js */ "./node_modules/lodash-es/_mapToArray.js");
  109216. /* harmony import */ var _setToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_setToArray.js */ "./node_modules/lodash-es/_setToArray.js");
  109217. /** Used to compose bitmasks for value comparisons. */
  109218. var COMPARE_PARTIAL_FLAG = 1,
  109219. COMPARE_UNORDERED_FLAG = 2;
  109220. /** `Object#toString` result references. */
  109221. var boolTag = '[object Boolean]',
  109222. dateTag = '[object Date]',
  109223. errorTag = '[object Error]',
  109224. mapTag = '[object Map]',
  109225. numberTag = '[object Number]',
  109226. regexpTag = '[object RegExp]',
  109227. setTag = '[object Set]',
  109228. stringTag = '[object String]',
  109229. symbolTag = '[object Symbol]';
  109230. var arrayBufferTag = '[object ArrayBuffer]',
  109231. dataViewTag = '[object DataView]';
  109232. /** Used to convert symbols to primitives and strings. */
  109233. var symbolProto = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype : undefined,
  109234. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  109235. /**
  109236. * A specialized version of `baseIsEqualDeep` for comparing objects of
  109237. * the same `toStringTag`.
  109238. *
  109239. * **Note:** This function only supports comparing values with tags of
  109240. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  109241. *
  109242. * @private
  109243. * @param {Object} object The object to compare.
  109244. * @param {Object} other The other object to compare.
  109245. * @param {string} tag The `toStringTag` of the objects to compare.
  109246. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  109247. * @param {Function} customizer The function to customize comparisons.
  109248. * @param {Function} equalFunc The function to determine equivalents of values.
  109249. * @param {Object} stack Tracks traversed `object` and `other` objects.
  109250. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  109251. */
  109252. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  109253. switch (tag) {
  109254. case dataViewTag:
  109255. if ((object.byteLength != other.byteLength) ||
  109256. (object.byteOffset != other.byteOffset)) {
  109257. return false;
  109258. }
  109259. object = object.buffer;
  109260. other = other.buffer;
  109261. case arrayBufferTag:
  109262. if ((object.byteLength != other.byteLength) ||
  109263. !equalFunc(new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_1__["default"](object), new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_1__["default"](other))) {
  109264. return false;
  109265. }
  109266. return true;
  109267. case boolTag:
  109268. case dateTag:
  109269. case numberTag:
  109270. // Coerce booleans to `1` or `0` and dates to milliseconds.
  109271. // Invalid dates are coerced to `NaN`.
  109272. return Object(_eq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(+object, +other);
  109273. case errorTag:
  109274. return object.name == other.name && object.message == other.message;
  109275. case regexpTag:
  109276. case stringTag:
  109277. // Coerce regexes to strings and treat strings, primitives and objects,
  109278. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  109279. // for more details.
  109280. return object == (other + '');
  109281. case mapTag:
  109282. var convert = _mapToArray_js__WEBPACK_IMPORTED_MODULE_4__["default"];
  109283. case setTag:
  109284. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  109285. convert || (convert = _setToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
  109286. if (object.size != other.size && !isPartial) {
  109287. return false;
  109288. }
  109289. // Assume cyclic values are equal.
  109290. var stacked = stack.get(object);
  109291. if (stacked) {
  109292. return stacked == other;
  109293. }
  109294. bitmask |= COMPARE_UNORDERED_FLAG;
  109295. // Recursively compare objects (susceptible to call stack limits).
  109296. stack.set(object, other);
  109297. var result = Object(_equalArrays_js__WEBPACK_IMPORTED_MODULE_3__["default"])(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  109298. stack['delete'](object);
  109299. return result;
  109300. case symbolTag:
  109301. if (symbolValueOf) {
  109302. return symbolValueOf.call(object) == symbolValueOf.call(other);
  109303. }
  109304. }
  109305. return false;
  109306. }
  109307. /* harmony default export */ __webpack_exports__["default"] = (equalByTag);
  109308. /***/ }),
  109309. /***/ "./node_modules/lodash-es/_equalObjects.js":
  109310. /*!*************************************************!*\
  109311. !*** ./node_modules/lodash-es/_equalObjects.js ***!
  109312. \*************************************************/
  109313. /*! exports provided: default */
  109314. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109315. "use strict";
  109316. __webpack_require__.r(__webpack_exports__);
  109317. /* harmony import */ var _getAllKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getAllKeys.js */ "./node_modules/lodash-es/_getAllKeys.js");
  109318. /** Used to compose bitmasks for value comparisons. */
  109319. var COMPARE_PARTIAL_FLAG = 1;
  109320. /** Used for built-in method references. */
  109321. var objectProto = Object.prototype;
  109322. /** Used to check objects for own properties. */
  109323. var hasOwnProperty = objectProto.hasOwnProperty;
  109324. /**
  109325. * A specialized version of `baseIsEqualDeep` for objects with support for
  109326. * partial deep comparisons.
  109327. *
  109328. * @private
  109329. * @param {Object} object The object to compare.
  109330. * @param {Object} other The other object to compare.
  109331. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  109332. * @param {Function} customizer The function to customize comparisons.
  109333. * @param {Function} equalFunc The function to determine equivalents of values.
  109334. * @param {Object} stack Tracks traversed `object` and `other` objects.
  109335. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  109336. */
  109337. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  109338. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  109339. objProps = Object(_getAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object),
  109340. objLength = objProps.length,
  109341. othProps = Object(_getAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other),
  109342. othLength = othProps.length;
  109343. if (objLength != othLength && !isPartial) {
  109344. return false;
  109345. }
  109346. var index = objLength;
  109347. while (index--) {
  109348. var key = objProps[index];
  109349. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  109350. return false;
  109351. }
  109352. }
  109353. // Check that cyclic values are equal.
  109354. var objStacked = stack.get(object);
  109355. var othStacked = stack.get(other);
  109356. if (objStacked && othStacked) {
  109357. return objStacked == other && othStacked == object;
  109358. }
  109359. var result = true;
  109360. stack.set(object, other);
  109361. stack.set(other, object);
  109362. var skipCtor = isPartial;
  109363. while (++index < objLength) {
  109364. key = objProps[index];
  109365. var objValue = object[key],
  109366. othValue = other[key];
  109367. if (customizer) {
  109368. var compared = isPartial
  109369. ? customizer(othValue, objValue, key, other, object, stack)
  109370. : customizer(objValue, othValue, key, object, other, stack);
  109371. }
  109372. // Recursively compare objects (susceptible to call stack limits).
  109373. if (!(compared === undefined
  109374. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  109375. : compared
  109376. )) {
  109377. result = false;
  109378. break;
  109379. }
  109380. skipCtor || (skipCtor = key == 'constructor');
  109381. }
  109382. if (result && !skipCtor) {
  109383. var objCtor = object.constructor,
  109384. othCtor = other.constructor;
  109385. // Non `Object` object instances with different constructors are not equal.
  109386. if (objCtor != othCtor &&
  109387. ('constructor' in object && 'constructor' in other) &&
  109388. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  109389. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  109390. result = false;
  109391. }
  109392. }
  109393. stack['delete'](object);
  109394. stack['delete'](other);
  109395. return result;
  109396. }
  109397. /* harmony default export */ __webpack_exports__["default"] = (equalObjects);
  109398. /***/ }),
  109399. /***/ "./node_modules/lodash-es/_escapeHtmlChar.js":
  109400. /*!***************************************************!*\
  109401. !*** ./node_modules/lodash-es/_escapeHtmlChar.js ***!
  109402. \***************************************************/
  109403. /*! exports provided: default */
  109404. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109405. "use strict";
  109406. __webpack_require__.r(__webpack_exports__);
  109407. /* harmony import */ var _basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePropertyOf.js */ "./node_modules/lodash-es/_basePropertyOf.js");
  109408. /** Used to map characters to HTML entities. */
  109409. var htmlEscapes = {
  109410. '&': '&amp;',
  109411. '<': '&lt;',
  109412. '>': '&gt;',
  109413. '"': '&quot;',
  109414. "'": '&#39;'
  109415. };
  109416. /**
  109417. * Used by `_.escape` to convert characters to HTML entities.
  109418. *
  109419. * @private
  109420. * @param {string} chr The matched character to escape.
  109421. * @returns {string} Returns the escaped character.
  109422. */
  109423. var escapeHtmlChar = Object(_basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(htmlEscapes);
  109424. /* harmony default export */ __webpack_exports__["default"] = (escapeHtmlChar);
  109425. /***/ }),
  109426. /***/ "./node_modules/lodash-es/_escapeStringChar.js":
  109427. /*!*****************************************************!*\
  109428. !*** ./node_modules/lodash-es/_escapeStringChar.js ***!
  109429. \*****************************************************/
  109430. /*! exports provided: default */
  109431. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109432. "use strict";
  109433. __webpack_require__.r(__webpack_exports__);
  109434. /** Used to escape characters for inclusion in compiled string literals. */
  109435. var stringEscapes = {
  109436. '\\': '\\',
  109437. "'": "'",
  109438. '\n': 'n',
  109439. '\r': 'r',
  109440. '\u2028': 'u2028',
  109441. '\u2029': 'u2029'
  109442. };
  109443. /**
  109444. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  109445. *
  109446. * @private
  109447. * @param {string} chr The matched character to escape.
  109448. * @returns {string} Returns the escaped character.
  109449. */
  109450. function escapeStringChar(chr) {
  109451. return '\\' + stringEscapes[chr];
  109452. }
  109453. /* harmony default export */ __webpack_exports__["default"] = (escapeStringChar);
  109454. /***/ }),
  109455. /***/ "./node_modules/lodash-es/_flatRest.js":
  109456. /*!*********************************************!*\
  109457. !*** ./node_modules/lodash-es/_flatRest.js ***!
  109458. \*********************************************/
  109459. /*! exports provided: default */
  109460. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109461. "use strict";
  109462. __webpack_require__.r(__webpack_exports__);
  109463. /* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/lodash-es/flatten.js");
  109464. /* harmony import */ var _overRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_overRest.js */ "./node_modules/lodash-es/_overRest.js");
  109465. /* harmony import */ var _setToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setToString.js */ "./node_modules/lodash-es/_setToString.js");
  109466. /**
  109467. * A specialized version of `baseRest` which flattens the rest array.
  109468. *
  109469. * @private
  109470. * @param {Function} func The function to apply a rest parameter to.
  109471. * @returns {Function} Returns the new function.
  109472. */
  109473. function flatRest(func) {
  109474. return Object(_setToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_overRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, undefined, _flatten_js__WEBPACK_IMPORTED_MODULE_0__["default"]), func + '');
  109475. }
  109476. /* harmony default export */ __webpack_exports__["default"] = (flatRest);
  109477. /***/ }),
  109478. /***/ "./node_modules/lodash-es/_freeGlobal.js":
  109479. /*!***********************************************!*\
  109480. !*** ./node_modules/lodash-es/_freeGlobal.js ***!
  109481. \***********************************************/
  109482. /*! exports provided: default */
  109483. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109484. "use strict";
  109485. __webpack_require__.r(__webpack_exports__);
  109486. /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
  109487. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  109488. /* harmony default export */ __webpack_exports__["default"] = (freeGlobal);
  109489. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  109490. /***/ }),
  109491. /***/ "./node_modules/lodash-es/_getAllKeys.js":
  109492. /*!***********************************************!*\
  109493. !*** ./node_modules/lodash-es/_getAllKeys.js ***!
  109494. \***********************************************/
  109495. /*! exports provided: default */
  109496. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109497. "use strict";
  109498. __webpack_require__.r(__webpack_exports__);
  109499. /* harmony import */ var _baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetAllKeys.js */ "./node_modules/lodash-es/_baseGetAllKeys.js");
  109500. /* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbols.js */ "./node_modules/lodash-es/_getSymbols.js");
  109501. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  109502. /**
  109503. * Creates an array of own enumerable property names and symbols of `object`.
  109504. *
  109505. * @private
  109506. * @param {Object} object The object to query.
  109507. * @returns {Array} Returns the array of property names and symbols.
  109508. */
  109509. function getAllKeys(object) {
  109510. return Object(_baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, _keys_js__WEBPACK_IMPORTED_MODULE_2__["default"], _getSymbols_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  109511. }
  109512. /* harmony default export */ __webpack_exports__["default"] = (getAllKeys);
  109513. /***/ }),
  109514. /***/ "./node_modules/lodash-es/_getAllKeysIn.js":
  109515. /*!*************************************************!*\
  109516. !*** ./node_modules/lodash-es/_getAllKeysIn.js ***!
  109517. \*************************************************/
  109518. /*! exports provided: default */
  109519. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109520. "use strict";
  109521. __webpack_require__.r(__webpack_exports__);
  109522. /* harmony import */ var _baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetAllKeys.js */ "./node_modules/lodash-es/_baseGetAllKeys.js");
  109523. /* harmony import */ var _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbolsIn.js */ "./node_modules/lodash-es/_getSymbolsIn.js");
  109524. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  109525. /**
  109526. * Creates an array of own and inherited enumerable property names and
  109527. * symbols of `object`.
  109528. *
  109529. * @private
  109530. * @param {Object} object The object to query.
  109531. * @returns {Array} Returns the array of property names and symbols.
  109532. */
  109533. function getAllKeysIn(object) {
  109534. return Object(_baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, _keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"], _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  109535. }
  109536. /* harmony default export */ __webpack_exports__["default"] = (getAllKeysIn);
  109537. /***/ }),
  109538. /***/ "./node_modules/lodash-es/_getData.js":
  109539. /*!********************************************!*\
  109540. !*** ./node_modules/lodash-es/_getData.js ***!
  109541. \********************************************/
  109542. /*! exports provided: default */
  109543. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109544. "use strict";
  109545. __webpack_require__.r(__webpack_exports__);
  109546. /* harmony import */ var _metaMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_metaMap.js */ "./node_modules/lodash-es/_metaMap.js");
  109547. /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
  109548. /**
  109549. * Gets metadata for `func`.
  109550. *
  109551. * @private
  109552. * @param {Function} func The function to query.
  109553. * @returns {*} Returns the metadata for `func`.
  109554. */
  109555. var getData = !_metaMap_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _noop_js__WEBPACK_IMPORTED_MODULE_1__["default"] : function(func) {
  109556. return _metaMap_js__WEBPACK_IMPORTED_MODULE_0__["default"].get(func);
  109557. };
  109558. /* harmony default export */ __webpack_exports__["default"] = (getData);
  109559. /***/ }),
  109560. /***/ "./node_modules/lodash-es/_getFuncName.js":
  109561. /*!************************************************!*\
  109562. !*** ./node_modules/lodash-es/_getFuncName.js ***!
  109563. \************************************************/
  109564. /*! exports provided: default */
  109565. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109566. "use strict";
  109567. __webpack_require__.r(__webpack_exports__);
  109568. /* harmony import */ var _realNames_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_realNames.js */ "./node_modules/lodash-es/_realNames.js");
  109569. /** Used for built-in method references. */
  109570. var objectProto = Object.prototype;
  109571. /** Used to check objects for own properties. */
  109572. var hasOwnProperty = objectProto.hasOwnProperty;
  109573. /**
  109574. * Gets the name of `func`.
  109575. *
  109576. * @private
  109577. * @param {Function} func The function to query.
  109578. * @returns {string} Returns the function name.
  109579. */
  109580. function getFuncName(func) {
  109581. var result = (func.name + ''),
  109582. array = _realNames_js__WEBPACK_IMPORTED_MODULE_0__["default"][result],
  109583. length = hasOwnProperty.call(_realNames_js__WEBPACK_IMPORTED_MODULE_0__["default"], result) ? array.length : 0;
  109584. while (length--) {
  109585. var data = array[length],
  109586. otherFunc = data.func;
  109587. if (otherFunc == null || otherFunc == func) {
  109588. return data.name;
  109589. }
  109590. }
  109591. return result;
  109592. }
  109593. /* harmony default export */ __webpack_exports__["default"] = (getFuncName);
  109594. /***/ }),
  109595. /***/ "./node_modules/lodash-es/_getHolder.js":
  109596. /*!**********************************************!*\
  109597. !*** ./node_modules/lodash-es/_getHolder.js ***!
  109598. \**********************************************/
  109599. /*! exports provided: default */
  109600. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109601. "use strict";
  109602. __webpack_require__.r(__webpack_exports__);
  109603. /**
  109604. * Gets the argument placeholder value for `func`.
  109605. *
  109606. * @private
  109607. * @param {Function} func The function to inspect.
  109608. * @returns {*} Returns the placeholder value.
  109609. */
  109610. function getHolder(func) {
  109611. var object = func;
  109612. return object.placeholder;
  109613. }
  109614. /* harmony default export */ __webpack_exports__["default"] = (getHolder);
  109615. /***/ }),
  109616. /***/ "./node_modules/lodash-es/_getMapData.js":
  109617. /*!***********************************************!*\
  109618. !*** ./node_modules/lodash-es/_getMapData.js ***!
  109619. \***********************************************/
  109620. /*! exports provided: default */
  109621. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109622. "use strict";
  109623. __webpack_require__.r(__webpack_exports__);
  109624. /* harmony import */ var _isKeyable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isKeyable.js */ "./node_modules/lodash-es/_isKeyable.js");
  109625. /**
  109626. * Gets the data for `map`.
  109627. *
  109628. * @private
  109629. * @param {Object} map The map to query.
  109630. * @param {string} key The reference key.
  109631. * @returns {*} Returns the map data.
  109632. */
  109633. function getMapData(map, key) {
  109634. var data = map.__data__;
  109635. return Object(_isKeyable_js__WEBPACK_IMPORTED_MODULE_0__["default"])(key)
  109636. ? data[typeof key == 'string' ? 'string' : 'hash']
  109637. : data.map;
  109638. }
  109639. /* harmony default export */ __webpack_exports__["default"] = (getMapData);
  109640. /***/ }),
  109641. /***/ "./node_modules/lodash-es/_getMatchData.js":
  109642. /*!*************************************************!*\
  109643. !*** ./node_modules/lodash-es/_getMatchData.js ***!
  109644. \*************************************************/
  109645. /*! exports provided: default */
  109646. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109647. "use strict";
  109648. __webpack_require__.r(__webpack_exports__);
  109649. /* harmony import */ var _isStrictComparable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isStrictComparable.js */ "./node_modules/lodash-es/_isStrictComparable.js");
  109650. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  109651. /**
  109652. * Gets the property names, values, and compare flags of `object`.
  109653. *
  109654. * @private
  109655. * @param {Object} object The object to query.
  109656. * @returns {Array} Returns the match data of `object`.
  109657. */
  109658. function getMatchData(object) {
  109659. var result = Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object),
  109660. length = result.length;
  109661. while (length--) {
  109662. var key = result[length],
  109663. value = object[key];
  109664. result[length] = [key, value, Object(_isStrictComparable_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)];
  109665. }
  109666. return result;
  109667. }
  109668. /* harmony default export */ __webpack_exports__["default"] = (getMatchData);
  109669. /***/ }),
  109670. /***/ "./node_modules/lodash-es/_getNative.js":
  109671. /*!**********************************************!*\
  109672. !*** ./node_modules/lodash-es/_getNative.js ***!
  109673. \**********************************************/
  109674. /*! exports provided: default */
  109675. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109676. "use strict";
  109677. __webpack_require__.r(__webpack_exports__);
  109678. /* harmony import */ var _baseIsNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsNative.js */ "./node_modules/lodash-es/_baseIsNative.js");
  109679. /* harmony import */ var _getValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getValue.js */ "./node_modules/lodash-es/_getValue.js");
  109680. /**
  109681. * Gets the native function at `key` of `object`.
  109682. *
  109683. * @private
  109684. * @param {Object} object The object to query.
  109685. * @param {string} key The key of the method to get.
  109686. * @returns {*} Returns the function if it's native, else `undefined`.
  109687. */
  109688. function getNative(object, key) {
  109689. var value = Object(_getValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key);
  109690. return Object(_baseIsNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? value : undefined;
  109691. }
  109692. /* harmony default export */ __webpack_exports__["default"] = (getNative);
  109693. /***/ }),
  109694. /***/ "./node_modules/lodash-es/_getPrototype.js":
  109695. /*!*************************************************!*\
  109696. !*** ./node_modules/lodash-es/_getPrototype.js ***!
  109697. \*************************************************/
  109698. /*! exports provided: default */
  109699. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109700. "use strict";
  109701. __webpack_require__.r(__webpack_exports__);
  109702. /* harmony import */ var _overArg_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_overArg.js */ "./node_modules/lodash-es/_overArg.js");
  109703. /** Built-in value references. */
  109704. var getPrototype = Object(_overArg_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object.getPrototypeOf, Object);
  109705. /* harmony default export */ __webpack_exports__["default"] = (getPrototype);
  109706. /***/ }),
  109707. /***/ "./node_modules/lodash-es/_getRawTag.js":
  109708. /*!**********************************************!*\
  109709. !*** ./node_modules/lodash-es/_getRawTag.js ***!
  109710. \**********************************************/
  109711. /*! exports provided: default */
  109712. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109713. "use strict";
  109714. __webpack_require__.r(__webpack_exports__);
  109715. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  109716. /** Used for built-in method references. */
  109717. var objectProto = Object.prototype;
  109718. /** Used to check objects for own properties. */
  109719. var hasOwnProperty = objectProto.hasOwnProperty;
  109720. /**
  109721. * Used to resolve the
  109722. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  109723. * of values.
  109724. */
  109725. var nativeObjectToString = objectProto.toString;
  109726. /** Built-in value references. */
  109727. var symToStringTag = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].toStringTag : undefined;
  109728. /**
  109729. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  109730. *
  109731. * @private
  109732. * @param {*} value The value to query.
  109733. * @returns {string} Returns the raw `toStringTag`.
  109734. */
  109735. function getRawTag(value) {
  109736. var isOwn = hasOwnProperty.call(value, symToStringTag),
  109737. tag = value[symToStringTag];
  109738. try {
  109739. value[symToStringTag] = undefined;
  109740. var unmasked = true;
  109741. } catch (e) {}
  109742. var result = nativeObjectToString.call(value);
  109743. if (unmasked) {
  109744. if (isOwn) {
  109745. value[symToStringTag] = tag;
  109746. } else {
  109747. delete value[symToStringTag];
  109748. }
  109749. }
  109750. return result;
  109751. }
  109752. /* harmony default export */ __webpack_exports__["default"] = (getRawTag);
  109753. /***/ }),
  109754. /***/ "./node_modules/lodash-es/_getSymbols.js":
  109755. /*!***********************************************!*\
  109756. !*** ./node_modules/lodash-es/_getSymbols.js ***!
  109757. \***********************************************/
  109758. /*! exports provided: default */
  109759. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109760. "use strict";
  109761. __webpack_require__.r(__webpack_exports__);
  109762. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  109763. /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
  109764. /** Used for built-in method references. */
  109765. var objectProto = Object.prototype;
  109766. /** Built-in value references. */
  109767. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  109768. /* Built-in method references for those with the same name as other `lodash` methods. */
  109769. var nativeGetSymbols = Object.getOwnPropertySymbols;
  109770. /**
  109771. * Creates an array of the own enumerable symbols of `object`.
  109772. *
  109773. * @private
  109774. * @param {Object} object The object to query.
  109775. * @returns {Array} Returns the array of symbols.
  109776. */
  109777. var getSymbols = !nativeGetSymbols ? _stubArray_js__WEBPACK_IMPORTED_MODULE_1__["default"] : function(object) {
  109778. if (object == null) {
  109779. return [];
  109780. }
  109781. object = Object(object);
  109782. return Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nativeGetSymbols(object), function(symbol) {
  109783. return propertyIsEnumerable.call(object, symbol);
  109784. });
  109785. };
  109786. /* harmony default export */ __webpack_exports__["default"] = (getSymbols);
  109787. /***/ }),
  109788. /***/ "./node_modules/lodash-es/_getSymbolsIn.js":
  109789. /*!*************************************************!*\
  109790. !*** ./node_modules/lodash-es/_getSymbolsIn.js ***!
  109791. \*************************************************/
  109792. /*! exports provided: default */
  109793. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109794. "use strict";
  109795. __webpack_require__.r(__webpack_exports__);
  109796. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  109797. /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
  109798. /* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getSymbols.js */ "./node_modules/lodash-es/_getSymbols.js");
  109799. /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
  109800. /* Built-in method references for those with the same name as other `lodash` methods. */
  109801. var nativeGetSymbols = Object.getOwnPropertySymbols;
  109802. /**
  109803. * Creates an array of the own and inherited enumerable symbols of `object`.
  109804. *
  109805. * @private
  109806. * @param {Object} object The object to query.
  109807. * @returns {Array} Returns the array of symbols.
  109808. */
  109809. var getSymbolsIn = !nativeGetSymbols ? _stubArray_js__WEBPACK_IMPORTED_MODULE_3__["default"] : function(object) {
  109810. var result = [];
  109811. while (object) {
  109812. Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, Object(_getSymbols_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object));
  109813. object = Object(_getPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
  109814. }
  109815. return result;
  109816. };
  109817. /* harmony default export */ __webpack_exports__["default"] = (getSymbolsIn);
  109818. /***/ }),
  109819. /***/ "./node_modules/lodash-es/_getTag.js":
  109820. /*!*******************************************!*\
  109821. !*** ./node_modules/lodash-es/_getTag.js ***!
  109822. \*******************************************/
  109823. /*! exports provided: default */
  109824. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109825. "use strict";
  109826. __webpack_require__.r(__webpack_exports__);
  109827. /* harmony import */ var _DataView_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_DataView.js */ "./node_modules/lodash-es/_DataView.js");
  109828. /* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_Map.js */ "./node_modules/lodash-es/_Map.js");
  109829. /* harmony import */ var _Promise_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_Promise.js */ "./node_modules/lodash-es/_Promise.js");
  109830. /* harmony import */ var _Set_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_Set.js */ "./node_modules/lodash-es/_Set.js");
  109831. /* harmony import */ var _WeakMap_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_WeakMap.js */ "./node_modules/lodash-es/_WeakMap.js");
  109832. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  109833. /* harmony import */ var _toSource_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_toSource.js */ "./node_modules/lodash-es/_toSource.js");
  109834. /** `Object#toString` result references. */
  109835. var mapTag = '[object Map]',
  109836. objectTag = '[object Object]',
  109837. promiseTag = '[object Promise]',
  109838. setTag = '[object Set]',
  109839. weakMapTag = '[object WeakMap]';
  109840. var dataViewTag = '[object DataView]';
  109841. /** Used to detect maps, sets, and weakmaps. */
  109842. var dataViewCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_DataView_js__WEBPACK_IMPORTED_MODULE_0__["default"]),
  109843. mapCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_Map_js__WEBPACK_IMPORTED_MODULE_1__["default"]),
  109844. promiseCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_Promise_js__WEBPACK_IMPORTED_MODULE_2__["default"]),
  109845. setCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_Set_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
  109846. weakMapCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_WeakMap_js__WEBPACK_IMPORTED_MODULE_4__["default"]);
  109847. /**
  109848. * Gets the `toStringTag` of `value`.
  109849. *
  109850. * @private
  109851. * @param {*} value The value to query.
  109852. * @returns {string} Returns the `toStringTag`.
  109853. */
  109854. var getTag = _baseGetTag_js__WEBPACK_IMPORTED_MODULE_5__["default"];
  109855. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  109856. if ((_DataView_js__WEBPACK_IMPORTED_MODULE_0__["default"] && getTag(new _DataView_js__WEBPACK_IMPORTED_MODULE_0__["default"](new ArrayBuffer(1))) != dataViewTag) ||
  109857. (_Map_js__WEBPACK_IMPORTED_MODULE_1__["default"] && getTag(new _Map_js__WEBPACK_IMPORTED_MODULE_1__["default"]) != mapTag) ||
  109858. (_Promise_js__WEBPACK_IMPORTED_MODULE_2__["default"] && getTag(_Promise_js__WEBPACK_IMPORTED_MODULE_2__["default"].resolve()) != promiseTag) ||
  109859. (_Set_js__WEBPACK_IMPORTED_MODULE_3__["default"] && getTag(new _Set_js__WEBPACK_IMPORTED_MODULE_3__["default"]) != setTag) ||
  109860. (_WeakMap_js__WEBPACK_IMPORTED_MODULE_4__["default"] && getTag(new _WeakMap_js__WEBPACK_IMPORTED_MODULE_4__["default"]) != weakMapTag)) {
  109861. getTag = function(value) {
  109862. var result = Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value),
  109863. Ctor = result == objectTag ? value.constructor : undefined,
  109864. ctorString = Ctor ? Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(Ctor) : '';
  109865. if (ctorString) {
  109866. switch (ctorString) {
  109867. case dataViewCtorString: return dataViewTag;
  109868. case mapCtorString: return mapTag;
  109869. case promiseCtorString: return promiseTag;
  109870. case setCtorString: return setTag;
  109871. case weakMapCtorString: return weakMapTag;
  109872. }
  109873. }
  109874. return result;
  109875. };
  109876. }
  109877. /* harmony default export */ __webpack_exports__["default"] = (getTag);
  109878. /***/ }),
  109879. /***/ "./node_modules/lodash-es/_getValue.js":
  109880. /*!*********************************************!*\
  109881. !*** ./node_modules/lodash-es/_getValue.js ***!
  109882. \*********************************************/
  109883. /*! exports provided: default */
  109884. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109885. "use strict";
  109886. __webpack_require__.r(__webpack_exports__);
  109887. /**
  109888. * Gets the value at `key` of `object`.
  109889. *
  109890. * @private
  109891. * @param {Object} [object] The object to query.
  109892. * @param {string} key The key of the property to get.
  109893. * @returns {*} Returns the property value.
  109894. */
  109895. function getValue(object, key) {
  109896. return object == null ? undefined : object[key];
  109897. }
  109898. /* harmony default export */ __webpack_exports__["default"] = (getValue);
  109899. /***/ }),
  109900. /***/ "./node_modules/lodash-es/_getView.js":
  109901. /*!********************************************!*\
  109902. !*** ./node_modules/lodash-es/_getView.js ***!
  109903. \********************************************/
  109904. /*! exports provided: default */
  109905. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109906. "use strict";
  109907. __webpack_require__.r(__webpack_exports__);
  109908. /* Built-in method references for those with the same name as other `lodash` methods. */
  109909. var nativeMax = Math.max,
  109910. nativeMin = Math.min;
  109911. /**
  109912. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  109913. *
  109914. * @private
  109915. * @param {number} start The start of the view.
  109916. * @param {number} end The end of the view.
  109917. * @param {Array} transforms The transformations to apply to the view.
  109918. * @returns {Object} Returns an object containing the `start` and `end`
  109919. * positions of the view.
  109920. */
  109921. function getView(start, end, transforms) {
  109922. var index = -1,
  109923. length = transforms.length;
  109924. while (++index < length) {
  109925. var data = transforms[index],
  109926. size = data.size;
  109927. switch (data.type) {
  109928. case 'drop': start += size; break;
  109929. case 'dropRight': end -= size; break;
  109930. case 'take': end = nativeMin(end, start + size); break;
  109931. case 'takeRight': start = nativeMax(start, end - size); break;
  109932. }
  109933. }
  109934. return { 'start': start, 'end': end };
  109935. }
  109936. /* harmony default export */ __webpack_exports__["default"] = (getView);
  109937. /***/ }),
  109938. /***/ "./node_modules/lodash-es/_getWrapDetails.js":
  109939. /*!***************************************************!*\
  109940. !*** ./node_modules/lodash-es/_getWrapDetails.js ***!
  109941. \***************************************************/
  109942. /*! exports provided: default */
  109943. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109944. "use strict";
  109945. __webpack_require__.r(__webpack_exports__);
  109946. /** Used to match wrap detail comments. */
  109947. var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  109948. reSplitDetails = /,? & /;
  109949. /**
  109950. * Extracts wrapper details from the `source` body comment.
  109951. *
  109952. * @private
  109953. * @param {string} source The source to inspect.
  109954. * @returns {Array} Returns the wrapper details.
  109955. */
  109956. function getWrapDetails(source) {
  109957. var match = source.match(reWrapDetails);
  109958. return match ? match[1].split(reSplitDetails) : [];
  109959. }
  109960. /* harmony default export */ __webpack_exports__["default"] = (getWrapDetails);
  109961. /***/ }),
  109962. /***/ "./node_modules/lodash-es/_hasPath.js":
  109963. /*!********************************************!*\
  109964. !*** ./node_modules/lodash-es/_hasPath.js ***!
  109965. \********************************************/
  109966. /*! exports provided: default */
  109967. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109968. "use strict";
  109969. __webpack_require__.r(__webpack_exports__);
  109970. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  109971. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  109972. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  109973. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  109974. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  109975. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  109976. /**
  109977. * Checks if `path` exists on `object`.
  109978. *
  109979. * @private
  109980. * @param {Object} object The object to query.
  109981. * @param {Array|string} path The path to check.
  109982. * @param {Function} hasFunc The function to check properties.
  109983. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  109984. */
  109985. function hasPath(object, path, hasFunc) {
  109986. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);
  109987. var index = -1,
  109988. length = path.length,
  109989. result = false;
  109990. while (++index < length) {
  109991. var key = Object(_toKey_js__WEBPACK_IMPORTED_MODULE_5__["default"])(path[index]);
  109992. if (!(result = object != null && hasFunc(object, key))) {
  109993. break;
  109994. }
  109995. object = object[key];
  109996. }
  109997. if (result || ++index != length) {
  109998. return result;
  109999. }
  110000. length = object == null ? 0 : object.length;
  110001. return !!length && Object(_isLength_js__WEBPACK_IMPORTED_MODULE_4__["default"])(length) && Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_3__["default"])(key, length) &&
  110002. (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object) || Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
  110003. }
  110004. /* harmony default export */ __webpack_exports__["default"] = (hasPath);
  110005. /***/ }),
  110006. /***/ "./node_modules/lodash-es/_hasUnicode.js":
  110007. /*!***********************************************!*\
  110008. !*** ./node_modules/lodash-es/_hasUnicode.js ***!
  110009. \***********************************************/
  110010. /*! exports provided: default */
  110011. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110012. "use strict";
  110013. __webpack_require__.r(__webpack_exports__);
  110014. /** Used to compose unicode character classes. */
  110015. var rsAstralRange = '\\ud800-\\udfff',
  110016. rsComboMarksRange = '\\u0300-\\u036f',
  110017. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  110018. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  110019. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  110020. rsVarRange = '\\ufe0e\\ufe0f';
  110021. /** Used to compose unicode capture groups. */
  110022. var rsZWJ = '\\u200d';
  110023. /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
  110024. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  110025. /**
  110026. * Checks if `string` contains Unicode symbols.
  110027. *
  110028. * @private
  110029. * @param {string} string The string to inspect.
  110030. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  110031. */
  110032. function hasUnicode(string) {
  110033. return reHasUnicode.test(string);
  110034. }
  110035. /* harmony default export */ __webpack_exports__["default"] = (hasUnicode);
  110036. /***/ }),
  110037. /***/ "./node_modules/lodash-es/_hasUnicodeWord.js":
  110038. /*!***************************************************!*\
  110039. !*** ./node_modules/lodash-es/_hasUnicodeWord.js ***!
  110040. \***************************************************/
  110041. /*! exports provided: default */
  110042. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110043. "use strict";
  110044. __webpack_require__.r(__webpack_exports__);
  110045. /** Used to detect strings that need a more robust regexp to match words. */
  110046. var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
  110047. /**
  110048. * Checks if `string` contains a word composed of Unicode symbols.
  110049. *
  110050. * @private
  110051. * @param {string} string The string to inspect.
  110052. * @returns {boolean} Returns `true` if a word is found, else `false`.
  110053. */
  110054. function hasUnicodeWord(string) {
  110055. return reHasUnicodeWord.test(string);
  110056. }
  110057. /* harmony default export */ __webpack_exports__["default"] = (hasUnicodeWord);
  110058. /***/ }),
  110059. /***/ "./node_modules/lodash-es/_hashClear.js":
  110060. /*!**********************************************!*\
  110061. !*** ./node_modules/lodash-es/_hashClear.js ***!
  110062. \**********************************************/
  110063. /*! exports provided: default */
  110064. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110065. "use strict";
  110066. __webpack_require__.r(__webpack_exports__);
  110067. /* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");
  110068. /**
  110069. * Removes all key-value entries from the hash.
  110070. *
  110071. * @private
  110072. * @name clear
  110073. * @memberOf Hash
  110074. */
  110075. function hashClear() {
  110076. this.__data__ = _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? Object(_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(null) : {};
  110077. this.size = 0;
  110078. }
  110079. /* harmony default export */ __webpack_exports__["default"] = (hashClear);
  110080. /***/ }),
  110081. /***/ "./node_modules/lodash-es/_hashDelete.js":
  110082. /*!***********************************************!*\
  110083. !*** ./node_modules/lodash-es/_hashDelete.js ***!
  110084. \***********************************************/
  110085. /*! exports provided: default */
  110086. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110087. "use strict";
  110088. __webpack_require__.r(__webpack_exports__);
  110089. /**
  110090. * Removes `key` and its value from the hash.
  110091. *
  110092. * @private
  110093. * @name delete
  110094. * @memberOf Hash
  110095. * @param {Object} hash The hash to modify.
  110096. * @param {string} key The key of the value to remove.
  110097. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  110098. */
  110099. function hashDelete(key) {
  110100. var result = this.has(key) && delete this.__data__[key];
  110101. this.size -= result ? 1 : 0;
  110102. return result;
  110103. }
  110104. /* harmony default export */ __webpack_exports__["default"] = (hashDelete);
  110105. /***/ }),
  110106. /***/ "./node_modules/lodash-es/_hashGet.js":
  110107. /*!********************************************!*\
  110108. !*** ./node_modules/lodash-es/_hashGet.js ***!
  110109. \********************************************/
  110110. /*! exports provided: default */
  110111. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110112. "use strict";
  110113. __webpack_require__.r(__webpack_exports__);
  110114. /* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");
  110115. /** Used to stand-in for `undefined` hash values. */
  110116. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  110117. /** Used for built-in method references. */
  110118. var objectProto = Object.prototype;
  110119. /** Used to check objects for own properties. */
  110120. var hasOwnProperty = objectProto.hasOwnProperty;
  110121. /**
  110122. * Gets the hash value for `key`.
  110123. *
  110124. * @private
  110125. * @name get
  110126. * @memberOf Hash
  110127. * @param {string} key The key of the value to get.
  110128. * @returns {*} Returns the entry value.
  110129. */
  110130. function hashGet(key) {
  110131. var data = this.__data__;
  110132. if (_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  110133. var result = data[key];
  110134. return result === HASH_UNDEFINED ? undefined : result;
  110135. }
  110136. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  110137. }
  110138. /* harmony default export */ __webpack_exports__["default"] = (hashGet);
  110139. /***/ }),
  110140. /***/ "./node_modules/lodash-es/_hashHas.js":
  110141. /*!********************************************!*\
  110142. !*** ./node_modules/lodash-es/_hashHas.js ***!
  110143. \********************************************/
  110144. /*! exports provided: default */
  110145. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110146. "use strict";
  110147. __webpack_require__.r(__webpack_exports__);
  110148. /* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");
  110149. /** Used for built-in method references. */
  110150. var objectProto = Object.prototype;
  110151. /** Used to check objects for own properties. */
  110152. var hasOwnProperty = objectProto.hasOwnProperty;
  110153. /**
  110154. * Checks if a hash value for `key` exists.
  110155. *
  110156. * @private
  110157. * @name has
  110158. * @memberOf Hash
  110159. * @param {string} key The key of the entry to check.
  110160. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  110161. */
  110162. function hashHas(key) {
  110163. var data = this.__data__;
  110164. return _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  110165. }
  110166. /* harmony default export */ __webpack_exports__["default"] = (hashHas);
  110167. /***/ }),
  110168. /***/ "./node_modules/lodash-es/_hashSet.js":
  110169. /*!********************************************!*\
  110170. !*** ./node_modules/lodash-es/_hashSet.js ***!
  110171. \********************************************/
  110172. /*! exports provided: default */
  110173. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110174. "use strict";
  110175. __webpack_require__.r(__webpack_exports__);
  110176. /* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");
  110177. /** Used to stand-in for `undefined` hash values. */
  110178. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  110179. /**
  110180. * Sets the hash `key` to `value`.
  110181. *
  110182. * @private
  110183. * @name set
  110184. * @memberOf Hash
  110185. * @param {string} key The key of the value to set.
  110186. * @param {*} value The value to set.
  110187. * @returns {Object} Returns the hash instance.
  110188. */
  110189. function hashSet(key, value) {
  110190. var data = this.__data__;
  110191. this.size += this.has(key) ? 0 : 1;
  110192. data[key] = (_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"] && value === undefined) ? HASH_UNDEFINED : value;
  110193. return this;
  110194. }
  110195. /* harmony default export */ __webpack_exports__["default"] = (hashSet);
  110196. /***/ }),
  110197. /***/ "./node_modules/lodash-es/_initCloneArray.js":
  110198. /*!***************************************************!*\
  110199. !*** ./node_modules/lodash-es/_initCloneArray.js ***!
  110200. \***************************************************/
  110201. /*! exports provided: default */
  110202. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110203. "use strict";
  110204. __webpack_require__.r(__webpack_exports__);
  110205. /** Used for built-in method references. */
  110206. var objectProto = Object.prototype;
  110207. /** Used to check objects for own properties. */
  110208. var hasOwnProperty = objectProto.hasOwnProperty;
  110209. /**
  110210. * Initializes an array clone.
  110211. *
  110212. * @private
  110213. * @param {Array} array The array to clone.
  110214. * @returns {Array} Returns the initialized clone.
  110215. */
  110216. function initCloneArray(array) {
  110217. var length = array.length,
  110218. result = new array.constructor(length);
  110219. // Add properties assigned by `RegExp#exec`.
  110220. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  110221. result.index = array.index;
  110222. result.input = array.input;
  110223. }
  110224. return result;
  110225. }
  110226. /* harmony default export */ __webpack_exports__["default"] = (initCloneArray);
  110227. /***/ }),
  110228. /***/ "./node_modules/lodash-es/_initCloneByTag.js":
  110229. /*!***************************************************!*\
  110230. !*** ./node_modules/lodash-es/_initCloneByTag.js ***!
  110231. \***************************************************/
  110232. /*! exports provided: default */
  110233. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110234. "use strict";
  110235. __webpack_require__.r(__webpack_exports__);
  110236. /* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cloneArrayBuffer.js */ "./node_modules/lodash-es/_cloneArrayBuffer.js");
  110237. /* harmony import */ var _cloneDataView_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_cloneDataView.js */ "./node_modules/lodash-es/_cloneDataView.js");
  110238. /* harmony import */ var _cloneRegExp_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_cloneRegExp.js */ "./node_modules/lodash-es/_cloneRegExp.js");
  110239. /* harmony import */ var _cloneSymbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_cloneSymbol.js */ "./node_modules/lodash-es/_cloneSymbol.js");
  110240. /* harmony import */ var _cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_cloneTypedArray.js */ "./node_modules/lodash-es/_cloneTypedArray.js");
  110241. /** `Object#toString` result references. */
  110242. var boolTag = '[object Boolean]',
  110243. dateTag = '[object Date]',
  110244. mapTag = '[object Map]',
  110245. numberTag = '[object Number]',
  110246. regexpTag = '[object RegExp]',
  110247. setTag = '[object Set]',
  110248. stringTag = '[object String]',
  110249. symbolTag = '[object Symbol]';
  110250. var arrayBufferTag = '[object ArrayBuffer]',
  110251. dataViewTag = '[object DataView]',
  110252. float32Tag = '[object Float32Array]',
  110253. float64Tag = '[object Float64Array]',
  110254. int8Tag = '[object Int8Array]',
  110255. int16Tag = '[object Int16Array]',
  110256. int32Tag = '[object Int32Array]',
  110257. uint8Tag = '[object Uint8Array]',
  110258. uint8ClampedTag = '[object Uint8ClampedArray]',
  110259. uint16Tag = '[object Uint16Array]',
  110260. uint32Tag = '[object Uint32Array]';
  110261. /**
  110262. * Initializes an object clone based on its `toStringTag`.
  110263. *
  110264. * **Note:** This function only supports cloning values with tags of
  110265. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  110266. *
  110267. * @private
  110268. * @param {Object} object The object to clone.
  110269. * @param {string} tag The `toStringTag` of the object to clone.
  110270. * @param {boolean} [isDeep] Specify a deep clone.
  110271. * @returns {Object} Returns the initialized clone.
  110272. */
  110273. function initCloneByTag(object, tag, isDeep) {
  110274. var Ctor = object.constructor;
  110275. switch (tag) {
  110276. case arrayBufferTag:
  110277. return Object(_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object);
  110278. case boolTag:
  110279. case dateTag:
  110280. return new Ctor(+object);
  110281. case dataViewTag:
  110282. return Object(_cloneDataView_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, isDeep);
  110283. case float32Tag: case float64Tag:
  110284. case int8Tag: case int16Tag: case int32Tag:
  110285. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  110286. return Object(_cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object, isDeep);
  110287. case mapTag:
  110288. return new Ctor;
  110289. case numberTag:
  110290. case stringTag:
  110291. return new Ctor(object);
  110292. case regexpTag:
  110293. return Object(_cloneRegExp_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object);
  110294. case setTag:
  110295. return new Ctor;
  110296. case symbolTag:
  110297. return Object(_cloneSymbol_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object);
  110298. }
  110299. }
  110300. /* harmony default export */ __webpack_exports__["default"] = (initCloneByTag);
  110301. /***/ }),
  110302. /***/ "./node_modules/lodash-es/_initCloneObject.js":
  110303. /*!****************************************************!*\
  110304. !*** ./node_modules/lodash-es/_initCloneObject.js ***!
  110305. \****************************************************/
  110306. /*! exports provided: default */
  110307. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110308. "use strict";
  110309. __webpack_require__.r(__webpack_exports__);
  110310. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  110311. /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
  110312. /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
  110313. /**
  110314. * Initializes an object clone.
  110315. *
  110316. * @private
  110317. * @param {Object} object The object to clone.
  110318. * @returns {Object} Returns the initialized clone.
  110319. */
  110320. function initCloneObject(object) {
  110321. return (typeof object.constructor == 'function' && !Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object))
  110322. ? Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_getPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object))
  110323. : {};
  110324. }
  110325. /* harmony default export */ __webpack_exports__["default"] = (initCloneObject);
  110326. /***/ }),
  110327. /***/ "./node_modules/lodash-es/_insertWrapDetails.js":
  110328. /*!******************************************************!*\
  110329. !*** ./node_modules/lodash-es/_insertWrapDetails.js ***!
  110330. \******************************************************/
  110331. /*! exports provided: default */
  110332. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110333. "use strict";
  110334. __webpack_require__.r(__webpack_exports__);
  110335. /** Used to match wrap detail comments. */
  110336. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;
  110337. /**
  110338. * Inserts wrapper `details` in a comment at the top of the `source` body.
  110339. *
  110340. * @private
  110341. * @param {string} source The source to modify.
  110342. * @returns {Array} details The details to insert.
  110343. * @returns {string} Returns the modified source.
  110344. */
  110345. function insertWrapDetails(source, details) {
  110346. var length = details.length;
  110347. if (!length) {
  110348. return source;
  110349. }
  110350. var lastIndex = length - 1;
  110351. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  110352. details = details.join(length > 2 ? ', ' : ' ');
  110353. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  110354. }
  110355. /* harmony default export */ __webpack_exports__["default"] = (insertWrapDetails);
  110356. /***/ }),
  110357. /***/ "./node_modules/lodash-es/_isFlattenable.js":
  110358. /*!**************************************************!*\
  110359. !*** ./node_modules/lodash-es/_isFlattenable.js ***!
  110360. \**************************************************/
  110361. /*! exports provided: default */
  110362. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110363. "use strict";
  110364. __webpack_require__.r(__webpack_exports__);
  110365. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  110366. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  110367. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  110368. /** Built-in value references. */
  110369. var spreadableSymbol = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].isConcatSpreadable : undefined;
  110370. /**
  110371. * Checks if `value` is a flattenable `arguments` object or array.
  110372. *
  110373. * @private
  110374. * @param {*} value The value to check.
  110375. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  110376. */
  110377. function isFlattenable(value) {
  110378. return Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) || Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) ||
  110379. !!(spreadableSymbol && value && value[spreadableSymbol]);
  110380. }
  110381. /* harmony default export */ __webpack_exports__["default"] = (isFlattenable);
  110382. /***/ }),
  110383. /***/ "./node_modules/lodash-es/_isIndex.js":
  110384. /*!********************************************!*\
  110385. !*** ./node_modules/lodash-es/_isIndex.js ***!
  110386. \********************************************/
  110387. /*! exports provided: default */
  110388. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110389. "use strict";
  110390. __webpack_require__.r(__webpack_exports__);
  110391. /** Used as references for various `Number` constants. */
  110392. var MAX_SAFE_INTEGER = 9007199254740991;
  110393. /** Used to detect unsigned integer values. */
  110394. var reIsUint = /^(?:0|[1-9]\d*)$/;
  110395. /**
  110396. * Checks if `value` is a valid array-like index.
  110397. *
  110398. * @private
  110399. * @param {*} value The value to check.
  110400. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  110401. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  110402. */
  110403. function isIndex(value, length) {
  110404. var type = typeof value;
  110405. length = length == null ? MAX_SAFE_INTEGER : length;
  110406. return !!length &&
  110407. (type == 'number' ||
  110408. (type != 'symbol' && reIsUint.test(value))) &&
  110409. (value > -1 && value % 1 == 0 && value < length);
  110410. }
  110411. /* harmony default export */ __webpack_exports__["default"] = (isIndex);
  110412. /***/ }),
  110413. /***/ "./node_modules/lodash-es/_isIterateeCall.js":
  110414. /*!***************************************************!*\
  110415. !*** ./node_modules/lodash-es/_isIterateeCall.js ***!
  110416. \***************************************************/
  110417. /*! exports provided: default */
  110418. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110419. "use strict";
  110420. __webpack_require__.r(__webpack_exports__);
  110421. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  110422. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  110423. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  110424. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  110425. /**
  110426. * Checks if the given arguments are from an iteratee call.
  110427. *
  110428. * @private
  110429. * @param {*} value The potential iteratee value argument.
  110430. * @param {*} index The potential iteratee index or key argument.
  110431. * @param {*} object The potential iteratee object argument.
  110432. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  110433. * else `false`.
  110434. */
  110435. function isIterateeCall(value, index, object) {
  110436. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object)) {
  110437. return false;
  110438. }
  110439. var type = typeof index;
  110440. if (type == 'number'
  110441. ? (Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object) && Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_2__["default"])(index, object.length))
  110442. : (type == 'string' && index in object)
  110443. ) {
  110444. return Object(_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object[index], value);
  110445. }
  110446. return false;
  110447. }
  110448. /* harmony default export */ __webpack_exports__["default"] = (isIterateeCall);
  110449. /***/ }),
  110450. /***/ "./node_modules/lodash-es/_isKey.js":
  110451. /*!******************************************!*\
  110452. !*** ./node_modules/lodash-es/_isKey.js ***!
  110453. \******************************************/
  110454. /*! exports provided: default */
  110455. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110456. "use strict";
  110457. __webpack_require__.r(__webpack_exports__);
  110458. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  110459. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  110460. /** Used to match property names within property paths. */
  110461. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  110462. reIsPlainProp = /^\w*$/;
  110463. /**
  110464. * Checks if `value` is a property name and not a property path.
  110465. *
  110466. * @private
  110467. * @param {*} value The value to check.
  110468. * @param {Object} [object] The object to query keys on.
  110469. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  110470. */
  110471. function isKey(value, object) {
  110472. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
  110473. return false;
  110474. }
  110475. var type = typeof value;
  110476. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  110477. value == null || Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  110478. return true;
  110479. }
  110480. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  110481. (object != null && value in Object(object));
  110482. }
  110483. /* harmony default export */ __webpack_exports__["default"] = (isKey);
  110484. /***/ }),
  110485. /***/ "./node_modules/lodash-es/_isKeyable.js":
  110486. /*!**********************************************!*\
  110487. !*** ./node_modules/lodash-es/_isKeyable.js ***!
  110488. \**********************************************/
  110489. /*! exports provided: default */
  110490. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110491. "use strict";
  110492. __webpack_require__.r(__webpack_exports__);
  110493. /**
  110494. * Checks if `value` is suitable for use as unique object key.
  110495. *
  110496. * @private
  110497. * @param {*} value The value to check.
  110498. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  110499. */
  110500. function isKeyable(value) {
  110501. var type = typeof value;
  110502. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  110503. ? (value !== '__proto__')
  110504. : (value === null);
  110505. }
  110506. /* harmony default export */ __webpack_exports__["default"] = (isKeyable);
  110507. /***/ }),
  110508. /***/ "./node_modules/lodash-es/_isLaziable.js":
  110509. /*!***********************************************!*\
  110510. !*** ./node_modules/lodash-es/_isLaziable.js ***!
  110511. \***********************************************/
  110512. /*! exports provided: default */
  110513. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110514. "use strict";
  110515. __webpack_require__.r(__webpack_exports__);
  110516. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  110517. /* harmony import */ var _getData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getData.js */ "./node_modules/lodash-es/_getData.js");
  110518. /* harmony import */ var _getFuncName_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getFuncName.js */ "./node_modules/lodash-es/_getFuncName.js");
  110519. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  110520. /**
  110521. * Checks if `func` has a lazy counterpart.
  110522. *
  110523. * @private
  110524. * @param {Function} func The function to check.
  110525. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  110526. * else `false`.
  110527. */
  110528. function isLaziable(func) {
  110529. var funcName = Object(_getFuncName_js__WEBPACK_IMPORTED_MODULE_2__["default"])(func),
  110530. other = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__["default"][funcName];
  110531. if (typeof other != 'function' || !(funcName in _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype)) {
  110532. return false;
  110533. }
  110534. if (func === other) {
  110535. return true;
  110536. }
  110537. var data = Object(_getData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other);
  110538. return !!data && func === data[0];
  110539. }
  110540. /* harmony default export */ __webpack_exports__["default"] = (isLaziable);
  110541. /***/ }),
  110542. /***/ "./node_modules/lodash-es/_isMaskable.js":
  110543. /*!***********************************************!*\
  110544. !*** ./node_modules/lodash-es/_isMaskable.js ***!
  110545. \***********************************************/
  110546. /*! exports provided: default */
  110547. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110548. "use strict";
  110549. __webpack_require__.r(__webpack_exports__);
  110550. /* harmony import */ var _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_coreJsData.js */ "./node_modules/lodash-es/_coreJsData.js");
  110551. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  110552. /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
  110553. /**
  110554. * Checks if `func` is capable of being masked.
  110555. *
  110556. * @private
  110557. * @param {*} value The value to check.
  110558. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  110559. */
  110560. var isMaskable = _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"] : _stubFalse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  110561. /* harmony default export */ __webpack_exports__["default"] = (isMaskable);
  110562. /***/ }),
  110563. /***/ "./node_modules/lodash-es/_isMasked.js":
  110564. /*!*********************************************!*\
  110565. !*** ./node_modules/lodash-es/_isMasked.js ***!
  110566. \*********************************************/
  110567. /*! exports provided: default */
  110568. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110569. "use strict";
  110570. __webpack_require__.r(__webpack_exports__);
  110571. /* harmony import */ var _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_coreJsData.js */ "./node_modules/lodash-es/_coreJsData.js");
  110572. /** Used to detect methods masquerading as native. */
  110573. var maskSrcKey = (function() {
  110574. var uid = /[^.]+$/.exec(_coreJsData_js__WEBPACK_IMPORTED_MODULE_0__["default"] && _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__["default"].keys && _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__["default"].keys.IE_PROTO || '');
  110575. return uid ? ('Symbol(src)_1.' + uid) : '';
  110576. }());
  110577. /**
  110578. * Checks if `func` has its source masked.
  110579. *
  110580. * @private
  110581. * @param {Function} func The function to check.
  110582. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  110583. */
  110584. function isMasked(func) {
  110585. return !!maskSrcKey && (maskSrcKey in func);
  110586. }
  110587. /* harmony default export */ __webpack_exports__["default"] = (isMasked);
  110588. /***/ }),
  110589. /***/ "./node_modules/lodash-es/_isPrototype.js":
  110590. /*!************************************************!*\
  110591. !*** ./node_modules/lodash-es/_isPrototype.js ***!
  110592. \************************************************/
  110593. /*! exports provided: default */
  110594. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110595. "use strict";
  110596. __webpack_require__.r(__webpack_exports__);
  110597. /** Used for built-in method references. */
  110598. var objectProto = Object.prototype;
  110599. /**
  110600. * Checks if `value` is likely a prototype object.
  110601. *
  110602. * @private
  110603. * @param {*} value The value to check.
  110604. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  110605. */
  110606. function isPrototype(value) {
  110607. var Ctor = value && value.constructor,
  110608. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  110609. return value === proto;
  110610. }
  110611. /* harmony default export */ __webpack_exports__["default"] = (isPrototype);
  110612. /***/ }),
  110613. /***/ "./node_modules/lodash-es/_isStrictComparable.js":
  110614. /*!*******************************************************!*\
  110615. !*** ./node_modules/lodash-es/_isStrictComparable.js ***!
  110616. \*******************************************************/
  110617. /*! exports provided: default */
  110618. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110619. "use strict";
  110620. __webpack_require__.r(__webpack_exports__);
  110621. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  110622. /**
  110623. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  110624. *
  110625. * @private
  110626. * @param {*} value The value to check.
  110627. * @returns {boolean} Returns `true` if `value` if suitable for strict
  110628. * equality comparisons, else `false`.
  110629. */
  110630. function isStrictComparable(value) {
  110631. return value === value && !Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  110632. }
  110633. /* harmony default export */ __webpack_exports__["default"] = (isStrictComparable);
  110634. /***/ }),
  110635. /***/ "./node_modules/lodash-es/_iteratorToArray.js":
  110636. /*!****************************************************!*\
  110637. !*** ./node_modules/lodash-es/_iteratorToArray.js ***!
  110638. \****************************************************/
  110639. /*! exports provided: default */
  110640. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110641. "use strict";
  110642. __webpack_require__.r(__webpack_exports__);
  110643. /**
  110644. * Converts `iterator` to an array.
  110645. *
  110646. * @private
  110647. * @param {Object} iterator The iterator to convert.
  110648. * @returns {Array} Returns the converted array.
  110649. */
  110650. function iteratorToArray(iterator) {
  110651. var data,
  110652. result = [];
  110653. while (!(data = iterator.next()).done) {
  110654. result.push(data.value);
  110655. }
  110656. return result;
  110657. }
  110658. /* harmony default export */ __webpack_exports__["default"] = (iteratorToArray);
  110659. /***/ }),
  110660. /***/ "./node_modules/lodash-es/_lazyClone.js":
  110661. /*!**********************************************!*\
  110662. !*** ./node_modules/lodash-es/_lazyClone.js ***!
  110663. \**********************************************/
  110664. /*! exports provided: default */
  110665. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110666. "use strict";
  110667. __webpack_require__.r(__webpack_exports__);
  110668. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  110669. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  110670. /**
  110671. * Creates a clone of the lazy wrapper object.
  110672. *
  110673. * @private
  110674. * @name clone
  110675. * @memberOf LazyWrapper
  110676. * @returns {Object} Returns the cloned `LazyWrapper` object.
  110677. */
  110678. function lazyClone() {
  110679. var result = new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"](this.__wrapped__);
  110680. result.__actions__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this.__actions__);
  110681. result.__dir__ = this.__dir__;
  110682. result.__filtered__ = this.__filtered__;
  110683. result.__iteratees__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this.__iteratees__);
  110684. result.__takeCount__ = this.__takeCount__;
  110685. result.__views__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this.__views__);
  110686. return result;
  110687. }
  110688. /* harmony default export */ __webpack_exports__["default"] = (lazyClone);
  110689. /***/ }),
  110690. /***/ "./node_modules/lodash-es/_lazyReverse.js":
  110691. /*!************************************************!*\
  110692. !*** ./node_modules/lodash-es/_lazyReverse.js ***!
  110693. \************************************************/
  110694. /*! exports provided: default */
  110695. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110696. "use strict";
  110697. __webpack_require__.r(__webpack_exports__);
  110698. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  110699. /**
  110700. * Reverses the direction of lazy iteration.
  110701. *
  110702. * @private
  110703. * @name reverse
  110704. * @memberOf LazyWrapper
  110705. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  110706. */
  110707. function lazyReverse() {
  110708. if (this.__filtered__) {
  110709. var result = new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"](this);
  110710. result.__dir__ = -1;
  110711. result.__filtered__ = true;
  110712. } else {
  110713. result = this.clone();
  110714. result.__dir__ *= -1;
  110715. }
  110716. return result;
  110717. }
  110718. /* harmony default export */ __webpack_exports__["default"] = (lazyReverse);
  110719. /***/ }),
  110720. /***/ "./node_modules/lodash-es/_lazyValue.js":
  110721. /*!**********************************************!*\
  110722. !*** ./node_modules/lodash-es/_lazyValue.js ***!
  110723. \**********************************************/
  110724. /*! exports provided: default */
  110725. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110726. "use strict";
  110727. __webpack_require__.r(__webpack_exports__);
  110728. /* harmony import */ var _baseWrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseWrapperValue.js */ "./node_modules/lodash-es/_baseWrapperValue.js");
  110729. /* harmony import */ var _getView_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getView.js */ "./node_modules/lodash-es/_getView.js");
  110730. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  110731. /** Used to indicate the type of lazy iteratees. */
  110732. var LAZY_FILTER_FLAG = 1,
  110733. LAZY_MAP_FLAG = 2;
  110734. /* Built-in method references for those with the same name as other `lodash` methods. */
  110735. var nativeMin = Math.min;
  110736. /**
  110737. * Extracts the unwrapped value from its lazy wrapper.
  110738. *
  110739. * @private
  110740. * @name value
  110741. * @memberOf LazyWrapper
  110742. * @returns {*} Returns the unwrapped value.
  110743. */
  110744. function lazyValue() {
  110745. var array = this.__wrapped__.value(),
  110746. dir = this.__dir__,
  110747. isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array),
  110748. isRight = dir < 0,
  110749. arrLength = isArr ? array.length : 0,
  110750. view = Object(_getView_js__WEBPACK_IMPORTED_MODULE_1__["default"])(0, arrLength, this.__views__),
  110751. start = view.start,
  110752. end = view.end,
  110753. length = end - start,
  110754. index = isRight ? end : (start - 1),
  110755. iteratees = this.__iteratees__,
  110756. iterLength = iteratees.length,
  110757. resIndex = 0,
  110758. takeCount = nativeMin(length, this.__takeCount__);
  110759. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  110760. return Object(_baseWrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, this.__actions__);
  110761. }
  110762. var result = [];
  110763. outer:
  110764. while (length-- && resIndex < takeCount) {
  110765. index += dir;
  110766. var iterIndex = -1,
  110767. value = array[index];
  110768. while (++iterIndex < iterLength) {
  110769. var data = iteratees[iterIndex],
  110770. iteratee = data.iteratee,
  110771. type = data.type,
  110772. computed = iteratee(value);
  110773. if (type == LAZY_MAP_FLAG) {
  110774. value = computed;
  110775. } else if (!computed) {
  110776. if (type == LAZY_FILTER_FLAG) {
  110777. continue outer;
  110778. } else {
  110779. break outer;
  110780. }
  110781. }
  110782. }
  110783. result[resIndex++] = value;
  110784. }
  110785. return result;
  110786. }
  110787. /* harmony default export */ __webpack_exports__["default"] = (lazyValue);
  110788. /***/ }),
  110789. /***/ "./node_modules/lodash-es/_listCacheClear.js":
  110790. /*!***************************************************!*\
  110791. !*** ./node_modules/lodash-es/_listCacheClear.js ***!
  110792. \***************************************************/
  110793. /*! exports provided: default */
  110794. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110795. "use strict";
  110796. __webpack_require__.r(__webpack_exports__);
  110797. /**
  110798. * Removes all key-value entries from the list cache.
  110799. *
  110800. * @private
  110801. * @name clear
  110802. * @memberOf ListCache
  110803. */
  110804. function listCacheClear() {
  110805. this.__data__ = [];
  110806. this.size = 0;
  110807. }
  110808. /* harmony default export */ __webpack_exports__["default"] = (listCacheClear);
  110809. /***/ }),
  110810. /***/ "./node_modules/lodash-es/_listCacheDelete.js":
  110811. /*!****************************************************!*\
  110812. !*** ./node_modules/lodash-es/_listCacheDelete.js ***!
  110813. \****************************************************/
  110814. /*! exports provided: default */
  110815. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110816. "use strict";
  110817. __webpack_require__.r(__webpack_exports__);
  110818. /* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");
  110819. /** Used for built-in method references. */
  110820. var arrayProto = Array.prototype;
  110821. /** Built-in value references. */
  110822. var splice = arrayProto.splice;
  110823. /**
  110824. * Removes `key` and its value from the list cache.
  110825. *
  110826. * @private
  110827. * @name delete
  110828. * @memberOf ListCache
  110829. * @param {string} key The key of the value to remove.
  110830. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  110831. */
  110832. function listCacheDelete(key) {
  110833. var data = this.__data__,
  110834. index = Object(_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, key);
  110835. if (index < 0) {
  110836. return false;
  110837. }
  110838. var lastIndex = data.length - 1;
  110839. if (index == lastIndex) {
  110840. data.pop();
  110841. } else {
  110842. splice.call(data, index, 1);
  110843. }
  110844. --this.size;
  110845. return true;
  110846. }
  110847. /* harmony default export */ __webpack_exports__["default"] = (listCacheDelete);
  110848. /***/ }),
  110849. /***/ "./node_modules/lodash-es/_listCacheGet.js":
  110850. /*!*************************************************!*\
  110851. !*** ./node_modules/lodash-es/_listCacheGet.js ***!
  110852. \*************************************************/
  110853. /*! exports provided: default */
  110854. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110855. "use strict";
  110856. __webpack_require__.r(__webpack_exports__);
  110857. /* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");
  110858. /**
  110859. * Gets the list cache value for `key`.
  110860. *
  110861. * @private
  110862. * @name get
  110863. * @memberOf ListCache
  110864. * @param {string} key The key of the value to get.
  110865. * @returns {*} Returns the entry value.
  110866. */
  110867. function listCacheGet(key) {
  110868. var data = this.__data__,
  110869. index = Object(_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, key);
  110870. return index < 0 ? undefined : data[index][1];
  110871. }
  110872. /* harmony default export */ __webpack_exports__["default"] = (listCacheGet);
  110873. /***/ }),
  110874. /***/ "./node_modules/lodash-es/_listCacheHas.js":
  110875. /*!*************************************************!*\
  110876. !*** ./node_modules/lodash-es/_listCacheHas.js ***!
  110877. \*************************************************/
  110878. /*! exports provided: default */
  110879. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110880. "use strict";
  110881. __webpack_require__.r(__webpack_exports__);
  110882. /* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");
  110883. /**
  110884. * Checks if a list cache value for `key` exists.
  110885. *
  110886. * @private
  110887. * @name has
  110888. * @memberOf ListCache
  110889. * @param {string} key The key of the entry to check.
  110890. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  110891. */
  110892. function listCacheHas(key) {
  110893. return Object(_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.__data__, key) > -1;
  110894. }
  110895. /* harmony default export */ __webpack_exports__["default"] = (listCacheHas);
  110896. /***/ }),
  110897. /***/ "./node_modules/lodash-es/_listCacheSet.js":
  110898. /*!*************************************************!*\
  110899. !*** ./node_modules/lodash-es/_listCacheSet.js ***!
  110900. \*************************************************/
  110901. /*! exports provided: default */
  110902. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110903. "use strict";
  110904. __webpack_require__.r(__webpack_exports__);
  110905. /* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");
  110906. /**
  110907. * Sets the list cache `key` to `value`.
  110908. *
  110909. * @private
  110910. * @name set
  110911. * @memberOf ListCache
  110912. * @param {string} key The key of the value to set.
  110913. * @param {*} value The value to set.
  110914. * @returns {Object} Returns the list cache instance.
  110915. */
  110916. function listCacheSet(key, value) {
  110917. var data = this.__data__,
  110918. index = Object(_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, key);
  110919. if (index < 0) {
  110920. ++this.size;
  110921. data.push([key, value]);
  110922. } else {
  110923. data[index][1] = value;
  110924. }
  110925. return this;
  110926. }
  110927. /* harmony default export */ __webpack_exports__["default"] = (listCacheSet);
  110928. /***/ }),
  110929. /***/ "./node_modules/lodash-es/_mapCacheClear.js":
  110930. /*!**************************************************!*\
  110931. !*** ./node_modules/lodash-es/_mapCacheClear.js ***!
  110932. \**************************************************/
  110933. /*! exports provided: default */
  110934. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110935. "use strict";
  110936. __webpack_require__.r(__webpack_exports__);
  110937. /* harmony import */ var _Hash_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Hash.js */ "./node_modules/lodash-es/_Hash.js");
  110938. /* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
  110939. /* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_Map.js */ "./node_modules/lodash-es/_Map.js");
  110940. /**
  110941. * Removes all key-value entries from the map.
  110942. *
  110943. * @private
  110944. * @name clear
  110945. * @memberOf MapCache
  110946. */
  110947. function mapCacheClear() {
  110948. this.size = 0;
  110949. this.__data__ = {
  110950. 'hash': new _Hash_js__WEBPACK_IMPORTED_MODULE_0__["default"],
  110951. 'map': new (_Map_js__WEBPACK_IMPORTED_MODULE_2__["default"] || _ListCache_js__WEBPACK_IMPORTED_MODULE_1__["default"]),
  110952. 'string': new _Hash_js__WEBPACK_IMPORTED_MODULE_0__["default"]
  110953. };
  110954. }
  110955. /* harmony default export */ __webpack_exports__["default"] = (mapCacheClear);
  110956. /***/ }),
  110957. /***/ "./node_modules/lodash-es/_mapCacheDelete.js":
  110958. /*!***************************************************!*\
  110959. !*** ./node_modules/lodash-es/_mapCacheDelete.js ***!
  110960. \***************************************************/
  110961. /*! exports provided: default */
  110962. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110963. "use strict";
  110964. __webpack_require__.r(__webpack_exports__);
  110965. /* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");
  110966. /**
  110967. * Removes `key` and its value from the map.
  110968. *
  110969. * @private
  110970. * @name delete
  110971. * @memberOf MapCache
  110972. * @param {string} key The key of the value to remove.
  110973. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  110974. */
  110975. function mapCacheDelete(key) {
  110976. var result = Object(_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key)['delete'](key);
  110977. this.size -= result ? 1 : 0;
  110978. return result;
  110979. }
  110980. /* harmony default export */ __webpack_exports__["default"] = (mapCacheDelete);
  110981. /***/ }),
  110982. /***/ "./node_modules/lodash-es/_mapCacheGet.js":
  110983. /*!************************************************!*\
  110984. !*** ./node_modules/lodash-es/_mapCacheGet.js ***!
  110985. \************************************************/
  110986. /*! exports provided: default */
  110987. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110988. "use strict";
  110989. __webpack_require__.r(__webpack_exports__);
  110990. /* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");
  110991. /**
  110992. * Gets the map value for `key`.
  110993. *
  110994. * @private
  110995. * @name get
  110996. * @memberOf MapCache
  110997. * @param {string} key The key of the value to get.
  110998. * @returns {*} Returns the entry value.
  110999. */
  111000. function mapCacheGet(key) {
  111001. return Object(_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key).get(key);
  111002. }
  111003. /* harmony default export */ __webpack_exports__["default"] = (mapCacheGet);
  111004. /***/ }),
  111005. /***/ "./node_modules/lodash-es/_mapCacheHas.js":
  111006. /*!************************************************!*\
  111007. !*** ./node_modules/lodash-es/_mapCacheHas.js ***!
  111008. \************************************************/
  111009. /*! exports provided: default */
  111010. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111011. "use strict";
  111012. __webpack_require__.r(__webpack_exports__);
  111013. /* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");
  111014. /**
  111015. * Checks if a map value for `key` exists.
  111016. *
  111017. * @private
  111018. * @name has
  111019. * @memberOf MapCache
  111020. * @param {string} key The key of the entry to check.
  111021. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  111022. */
  111023. function mapCacheHas(key) {
  111024. return Object(_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key).has(key);
  111025. }
  111026. /* harmony default export */ __webpack_exports__["default"] = (mapCacheHas);
  111027. /***/ }),
  111028. /***/ "./node_modules/lodash-es/_mapCacheSet.js":
  111029. /*!************************************************!*\
  111030. !*** ./node_modules/lodash-es/_mapCacheSet.js ***!
  111031. \************************************************/
  111032. /*! exports provided: default */
  111033. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111034. "use strict";
  111035. __webpack_require__.r(__webpack_exports__);
  111036. /* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");
  111037. /**
  111038. * Sets the map `key` to `value`.
  111039. *
  111040. * @private
  111041. * @name set
  111042. * @memberOf MapCache
  111043. * @param {string} key The key of the value to set.
  111044. * @param {*} value The value to set.
  111045. * @returns {Object} Returns the map cache instance.
  111046. */
  111047. function mapCacheSet(key, value) {
  111048. var data = Object(_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key),
  111049. size = data.size;
  111050. data.set(key, value);
  111051. this.size += data.size == size ? 0 : 1;
  111052. return this;
  111053. }
  111054. /* harmony default export */ __webpack_exports__["default"] = (mapCacheSet);
  111055. /***/ }),
  111056. /***/ "./node_modules/lodash-es/_mapToArray.js":
  111057. /*!***********************************************!*\
  111058. !*** ./node_modules/lodash-es/_mapToArray.js ***!
  111059. \***********************************************/
  111060. /*! exports provided: default */
  111061. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111062. "use strict";
  111063. __webpack_require__.r(__webpack_exports__);
  111064. /**
  111065. * Converts `map` to its key-value pairs.
  111066. *
  111067. * @private
  111068. * @param {Object} map The map to convert.
  111069. * @returns {Array} Returns the key-value pairs.
  111070. */
  111071. function mapToArray(map) {
  111072. var index = -1,
  111073. result = Array(map.size);
  111074. map.forEach(function(value, key) {
  111075. result[++index] = [key, value];
  111076. });
  111077. return result;
  111078. }
  111079. /* harmony default export */ __webpack_exports__["default"] = (mapToArray);
  111080. /***/ }),
  111081. /***/ "./node_modules/lodash-es/_matchesStrictComparable.js":
  111082. /*!************************************************************!*\
  111083. !*** ./node_modules/lodash-es/_matchesStrictComparable.js ***!
  111084. \************************************************************/
  111085. /*! exports provided: default */
  111086. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111087. "use strict";
  111088. __webpack_require__.r(__webpack_exports__);
  111089. /**
  111090. * A specialized version of `matchesProperty` for source values suitable
  111091. * for strict equality comparisons, i.e. `===`.
  111092. *
  111093. * @private
  111094. * @param {string} key The key of the property to get.
  111095. * @param {*} srcValue The value to match.
  111096. * @returns {Function} Returns the new spec function.
  111097. */
  111098. function matchesStrictComparable(key, srcValue) {
  111099. return function(object) {
  111100. if (object == null) {
  111101. return false;
  111102. }
  111103. return object[key] === srcValue &&
  111104. (srcValue !== undefined || (key in Object(object)));
  111105. };
  111106. }
  111107. /* harmony default export */ __webpack_exports__["default"] = (matchesStrictComparable);
  111108. /***/ }),
  111109. /***/ "./node_modules/lodash-es/_memoizeCapped.js":
  111110. /*!**************************************************!*\
  111111. !*** ./node_modules/lodash-es/_memoizeCapped.js ***!
  111112. \**************************************************/
  111113. /*! exports provided: default */
  111114. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111115. "use strict";
  111116. __webpack_require__.r(__webpack_exports__);
  111117. /* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/lodash-es/memoize.js");
  111118. /** Used as the maximum memoize cache size. */
  111119. var MAX_MEMOIZE_SIZE = 500;
  111120. /**
  111121. * A specialized version of `_.memoize` which clears the memoized function's
  111122. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  111123. *
  111124. * @private
  111125. * @param {Function} func The function to have its output memoized.
  111126. * @returns {Function} Returns the new memoized function.
  111127. */
  111128. function memoizeCapped(func) {
  111129. var result = Object(_memoize_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, function(key) {
  111130. if (cache.size === MAX_MEMOIZE_SIZE) {
  111131. cache.clear();
  111132. }
  111133. return key;
  111134. });
  111135. var cache = result.cache;
  111136. return result;
  111137. }
  111138. /* harmony default export */ __webpack_exports__["default"] = (memoizeCapped);
  111139. /***/ }),
  111140. /***/ "./node_modules/lodash-es/_mergeData.js":
  111141. /*!**********************************************!*\
  111142. !*** ./node_modules/lodash-es/_mergeData.js ***!
  111143. \**********************************************/
  111144. /*! exports provided: default */
  111145. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111146. "use strict";
  111147. __webpack_require__.r(__webpack_exports__);
  111148. /* harmony import */ var _composeArgs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_composeArgs.js */ "./node_modules/lodash-es/_composeArgs.js");
  111149. /* harmony import */ var _composeArgsRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_composeArgsRight.js */ "./node_modules/lodash-es/_composeArgsRight.js");
  111150. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  111151. /** Used as the internal argument placeholder. */
  111152. var PLACEHOLDER = '__lodash_placeholder__';
  111153. /** Used to compose bitmasks for function metadata. */
  111154. var WRAP_BIND_FLAG = 1,
  111155. WRAP_BIND_KEY_FLAG = 2,
  111156. WRAP_CURRY_BOUND_FLAG = 4,
  111157. WRAP_CURRY_FLAG = 8,
  111158. WRAP_ARY_FLAG = 128,
  111159. WRAP_REARG_FLAG = 256;
  111160. /* Built-in method references for those with the same name as other `lodash` methods. */
  111161. var nativeMin = Math.min;
  111162. /**
  111163. * Merges the function metadata of `source` into `data`.
  111164. *
  111165. * Merging metadata reduces the number of wrappers used to invoke a function.
  111166. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  111167. * may be applied regardless of execution order. Methods like `_.ary` and
  111168. * `_.rearg` modify function arguments, making the order in which they are
  111169. * executed important, preventing the merging of metadata. However, we make
  111170. * an exception for a safe combined case where curried functions have `_.ary`
  111171. * and or `_.rearg` applied.
  111172. *
  111173. * @private
  111174. * @param {Array} data The destination metadata.
  111175. * @param {Array} source The source metadata.
  111176. * @returns {Array} Returns `data`.
  111177. */
  111178. function mergeData(data, source) {
  111179. var bitmask = data[1],
  111180. srcBitmask = source[1],
  111181. newBitmask = bitmask | srcBitmask,
  111182. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  111183. var isCombo =
  111184. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  111185. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  111186. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  111187. // Exit early if metadata can't be merged.
  111188. if (!(isCommon || isCombo)) {
  111189. return data;
  111190. }
  111191. // Use source `thisArg` if available.
  111192. if (srcBitmask & WRAP_BIND_FLAG) {
  111193. data[2] = source[2];
  111194. // Set when currying a bound function.
  111195. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  111196. }
  111197. // Compose partial arguments.
  111198. var value = source[3];
  111199. if (value) {
  111200. var partials = data[3];
  111201. data[3] = partials ? Object(_composeArgs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(partials, value, source[4]) : value;
  111202. data[4] = partials ? Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_2__["default"])(data[3], PLACEHOLDER) : source[4];
  111203. }
  111204. // Compose partial right arguments.
  111205. value = source[5];
  111206. if (value) {
  111207. partials = data[5];
  111208. data[5] = partials ? Object(_composeArgsRight_js__WEBPACK_IMPORTED_MODULE_1__["default"])(partials, value, source[6]) : value;
  111209. data[6] = partials ? Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_2__["default"])(data[5], PLACEHOLDER) : source[6];
  111210. }
  111211. // Use source `argPos` if available.
  111212. value = source[7];
  111213. if (value) {
  111214. data[7] = value;
  111215. }
  111216. // Use source `ary` if it's smaller.
  111217. if (srcBitmask & WRAP_ARY_FLAG) {
  111218. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  111219. }
  111220. // Use source `arity` if one is not provided.
  111221. if (data[9] == null) {
  111222. data[9] = source[9];
  111223. }
  111224. // Use source `func` and merge bitmasks.
  111225. data[0] = source[0];
  111226. data[1] = newBitmask;
  111227. return data;
  111228. }
  111229. /* harmony default export */ __webpack_exports__["default"] = (mergeData);
  111230. /***/ }),
  111231. /***/ "./node_modules/lodash-es/_metaMap.js":
  111232. /*!********************************************!*\
  111233. !*** ./node_modules/lodash-es/_metaMap.js ***!
  111234. \********************************************/
  111235. /*! exports provided: default */
  111236. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111237. "use strict";
  111238. __webpack_require__.r(__webpack_exports__);
  111239. /* harmony import */ var _WeakMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_WeakMap.js */ "./node_modules/lodash-es/_WeakMap.js");
  111240. /** Used to store function metadata. */
  111241. var metaMap = _WeakMap_js__WEBPACK_IMPORTED_MODULE_0__["default"] && new _WeakMap_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  111242. /* harmony default export */ __webpack_exports__["default"] = (metaMap);
  111243. /***/ }),
  111244. /***/ "./node_modules/lodash-es/_nativeCreate.js":
  111245. /*!*************************************************!*\
  111246. !*** ./node_modules/lodash-es/_nativeCreate.js ***!
  111247. \*************************************************/
  111248. /*! exports provided: default */
  111249. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111250. "use strict";
  111251. __webpack_require__.r(__webpack_exports__);
  111252. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  111253. /* Built-in method references that are verified to be native. */
  111254. var nativeCreate = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object, 'create');
  111255. /* harmony default export */ __webpack_exports__["default"] = (nativeCreate);
  111256. /***/ }),
  111257. /***/ "./node_modules/lodash-es/_nativeKeys.js":
  111258. /*!***********************************************!*\
  111259. !*** ./node_modules/lodash-es/_nativeKeys.js ***!
  111260. \***********************************************/
  111261. /*! exports provided: default */
  111262. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111263. "use strict";
  111264. __webpack_require__.r(__webpack_exports__);
  111265. /* harmony import */ var _overArg_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_overArg.js */ "./node_modules/lodash-es/_overArg.js");
  111266. /* Built-in method references for those with the same name as other `lodash` methods. */
  111267. var nativeKeys = Object(_overArg_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object.keys, Object);
  111268. /* harmony default export */ __webpack_exports__["default"] = (nativeKeys);
  111269. /***/ }),
  111270. /***/ "./node_modules/lodash-es/_nativeKeysIn.js":
  111271. /*!*************************************************!*\
  111272. !*** ./node_modules/lodash-es/_nativeKeysIn.js ***!
  111273. \*************************************************/
  111274. /*! exports provided: default */
  111275. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111276. "use strict";
  111277. __webpack_require__.r(__webpack_exports__);
  111278. /**
  111279. * This function is like
  111280. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  111281. * except that it includes inherited enumerable properties.
  111282. *
  111283. * @private
  111284. * @param {Object} object The object to query.
  111285. * @returns {Array} Returns the array of property names.
  111286. */
  111287. function nativeKeysIn(object) {
  111288. var result = [];
  111289. if (object != null) {
  111290. for (var key in Object(object)) {
  111291. result.push(key);
  111292. }
  111293. }
  111294. return result;
  111295. }
  111296. /* harmony default export */ __webpack_exports__["default"] = (nativeKeysIn);
  111297. /***/ }),
  111298. /***/ "./node_modules/lodash-es/_nodeUtil.js":
  111299. /*!*********************************************!*\
  111300. !*** ./node_modules/lodash-es/_nodeUtil.js ***!
  111301. \*********************************************/
  111302. /*! exports provided: default */
  111303. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111304. "use strict";
  111305. __webpack_require__.r(__webpack_exports__);
  111306. /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_freeGlobal.js */ "./node_modules/lodash-es/_freeGlobal.js");
  111307. /** Detect free variable `exports`. */
  111308. var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
  111309. /** Detect free variable `module`. */
  111310. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  111311. /** Detect the popular CommonJS extension `module.exports`. */
  111312. var moduleExports = freeModule && freeModule.exports === freeExports;
  111313. /** Detect free variable `process` from Node.js. */
  111314. var freeProcess = moduleExports && _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__["default"].process;
  111315. /** Used to access faster Node.js helpers. */
  111316. var nodeUtil = (function() {
  111317. try {
  111318. // Use `util.types` for Node.js 10+.
  111319. var types = freeModule && freeModule.require && freeModule.require('util').types;
  111320. if (types) {
  111321. return types;
  111322. }
  111323. // Legacy `process.binding('util')` for Node.js < 10.
  111324. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  111325. } catch (e) {}
  111326. }());
  111327. /* harmony default export */ __webpack_exports__["default"] = (nodeUtil);
  111328. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/harmony-module.js */ "./node_modules/webpack/buildin/harmony-module.js")(module)))
  111329. /***/ }),
  111330. /***/ "./node_modules/lodash-es/_objectToString.js":
  111331. /*!***************************************************!*\
  111332. !*** ./node_modules/lodash-es/_objectToString.js ***!
  111333. \***************************************************/
  111334. /*! exports provided: default */
  111335. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111336. "use strict";
  111337. __webpack_require__.r(__webpack_exports__);
  111338. /** Used for built-in method references. */
  111339. var objectProto = Object.prototype;
  111340. /**
  111341. * Used to resolve the
  111342. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  111343. * of values.
  111344. */
  111345. var nativeObjectToString = objectProto.toString;
  111346. /**
  111347. * Converts `value` to a string using `Object.prototype.toString`.
  111348. *
  111349. * @private
  111350. * @param {*} value The value to convert.
  111351. * @returns {string} Returns the converted string.
  111352. */
  111353. function objectToString(value) {
  111354. return nativeObjectToString.call(value);
  111355. }
  111356. /* harmony default export */ __webpack_exports__["default"] = (objectToString);
  111357. /***/ }),
  111358. /***/ "./node_modules/lodash-es/_overArg.js":
  111359. /*!********************************************!*\
  111360. !*** ./node_modules/lodash-es/_overArg.js ***!
  111361. \********************************************/
  111362. /*! exports provided: default */
  111363. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111364. "use strict";
  111365. __webpack_require__.r(__webpack_exports__);
  111366. /**
  111367. * Creates a unary function that invokes `func` with its argument transformed.
  111368. *
  111369. * @private
  111370. * @param {Function} func The function to wrap.
  111371. * @param {Function} transform The argument transform.
  111372. * @returns {Function} Returns the new function.
  111373. */
  111374. function overArg(func, transform) {
  111375. return function(arg) {
  111376. return func(transform(arg));
  111377. };
  111378. }
  111379. /* harmony default export */ __webpack_exports__["default"] = (overArg);
  111380. /***/ }),
  111381. /***/ "./node_modules/lodash-es/_overRest.js":
  111382. /*!*********************************************!*\
  111383. !*** ./node_modules/lodash-es/_overRest.js ***!
  111384. \*********************************************/
  111385. /*! exports provided: default */
  111386. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111387. "use strict";
  111388. __webpack_require__.r(__webpack_exports__);
  111389. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  111390. /* Built-in method references for those with the same name as other `lodash` methods. */
  111391. var nativeMax = Math.max;
  111392. /**
  111393. * A specialized version of `baseRest` which transforms the rest array.
  111394. *
  111395. * @private
  111396. * @param {Function} func The function to apply a rest parameter to.
  111397. * @param {number} [start=func.length-1] The start position of the rest parameter.
  111398. * @param {Function} transform The rest array transform.
  111399. * @returns {Function} Returns the new function.
  111400. */
  111401. function overRest(func, start, transform) {
  111402. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  111403. return function() {
  111404. var args = arguments,
  111405. index = -1,
  111406. length = nativeMax(args.length - start, 0),
  111407. array = Array(length);
  111408. while (++index < length) {
  111409. array[index] = args[start + index];
  111410. }
  111411. index = -1;
  111412. var otherArgs = Array(start + 1);
  111413. while (++index < start) {
  111414. otherArgs[index] = args[index];
  111415. }
  111416. otherArgs[start] = transform(array);
  111417. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, this, otherArgs);
  111418. };
  111419. }
  111420. /* harmony default export */ __webpack_exports__["default"] = (overRest);
  111421. /***/ }),
  111422. /***/ "./node_modules/lodash-es/_parent.js":
  111423. /*!*******************************************!*\
  111424. !*** ./node_modules/lodash-es/_parent.js ***!
  111425. \*******************************************/
  111426. /*! exports provided: default */
  111427. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111428. "use strict";
  111429. __webpack_require__.r(__webpack_exports__);
  111430. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  111431. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  111432. /**
  111433. * Gets the parent value at `path` of `object`.
  111434. *
  111435. * @private
  111436. * @param {Object} object The object to query.
  111437. * @param {Array} path The path to get the parent value of.
  111438. * @returns {*} Returns the parent value.
  111439. */
  111440. function parent(object, path) {
  111441. return path.length < 2 ? object : Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path, 0, -1));
  111442. }
  111443. /* harmony default export */ __webpack_exports__["default"] = (parent);
  111444. /***/ }),
  111445. /***/ "./node_modules/lodash-es/_reEscape.js":
  111446. /*!*********************************************!*\
  111447. !*** ./node_modules/lodash-es/_reEscape.js ***!
  111448. \*********************************************/
  111449. /*! exports provided: default */
  111450. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111451. "use strict";
  111452. __webpack_require__.r(__webpack_exports__);
  111453. /** Used to match template delimiters. */
  111454. var reEscape = /<%-([\s\S]+?)%>/g;
  111455. /* harmony default export */ __webpack_exports__["default"] = (reEscape);
  111456. /***/ }),
  111457. /***/ "./node_modules/lodash-es/_reEvaluate.js":
  111458. /*!***********************************************!*\
  111459. !*** ./node_modules/lodash-es/_reEvaluate.js ***!
  111460. \***********************************************/
  111461. /*! exports provided: default */
  111462. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111463. "use strict";
  111464. __webpack_require__.r(__webpack_exports__);
  111465. /** Used to match template delimiters. */
  111466. var reEvaluate = /<%([\s\S]+?)%>/g;
  111467. /* harmony default export */ __webpack_exports__["default"] = (reEvaluate);
  111468. /***/ }),
  111469. /***/ "./node_modules/lodash-es/_reInterpolate.js":
  111470. /*!**************************************************!*\
  111471. !*** ./node_modules/lodash-es/_reInterpolate.js ***!
  111472. \**************************************************/
  111473. /*! exports provided: default */
  111474. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111475. "use strict";
  111476. __webpack_require__.r(__webpack_exports__);
  111477. /** Used to match template delimiters. */
  111478. var reInterpolate = /<%=([\s\S]+?)%>/g;
  111479. /* harmony default export */ __webpack_exports__["default"] = (reInterpolate);
  111480. /***/ }),
  111481. /***/ "./node_modules/lodash-es/_realNames.js":
  111482. /*!**********************************************!*\
  111483. !*** ./node_modules/lodash-es/_realNames.js ***!
  111484. \**********************************************/
  111485. /*! exports provided: default */
  111486. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111487. "use strict";
  111488. __webpack_require__.r(__webpack_exports__);
  111489. /** Used to lookup unminified function names. */
  111490. var realNames = {};
  111491. /* harmony default export */ __webpack_exports__["default"] = (realNames);
  111492. /***/ }),
  111493. /***/ "./node_modules/lodash-es/_reorder.js":
  111494. /*!********************************************!*\
  111495. !*** ./node_modules/lodash-es/_reorder.js ***!
  111496. \********************************************/
  111497. /*! exports provided: default */
  111498. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111499. "use strict";
  111500. __webpack_require__.r(__webpack_exports__);
  111501. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  111502. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  111503. /* Built-in method references for those with the same name as other `lodash` methods. */
  111504. var nativeMin = Math.min;
  111505. /**
  111506. * Reorder `array` according to the specified indexes where the element at
  111507. * the first index is assigned as the first element, the element at
  111508. * the second index is assigned as the second element, and so on.
  111509. *
  111510. * @private
  111511. * @param {Array} array The array to reorder.
  111512. * @param {Array} indexes The arranged array indexes.
  111513. * @returns {Array} Returns `array`.
  111514. */
  111515. function reorder(array, indexes) {
  111516. var arrLength = array.length,
  111517. length = nativeMin(indexes.length, arrLength),
  111518. oldArray = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array);
  111519. while (length--) {
  111520. var index = indexes[length];
  111521. array[length] = Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"])(index, arrLength) ? oldArray[index] : undefined;
  111522. }
  111523. return array;
  111524. }
  111525. /* harmony default export */ __webpack_exports__["default"] = (reorder);
  111526. /***/ }),
  111527. /***/ "./node_modules/lodash-es/_replaceHolders.js":
  111528. /*!***************************************************!*\
  111529. !*** ./node_modules/lodash-es/_replaceHolders.js ***!
  111530. \***************************************************/
  111531. /*! exports provided: default */
  111532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111533. "use strict";
  111534. __webpack_require__.r(__webpack_exports__);
  111535. /** Used as the internal argument placeholder. */
  111536. var PLACEHOLDER = '__lodash_placeholder__';
  111537. /**
  111538. * Replaces all `placeholder` elements in `array` with an internal placeholder
  111539. * and returns an array of their indexes.
  111540. *
  111541. * @private
  111542. * @param {Array} array The array to modify.
  111543. * @param {*} placeholder The placeholder to replace.
  111544. * @returns {Array} Returns the new array of placeholder indexes.
  111545. */
  111546. function replaceHolders(array, placeholder) {
  111547. var index = -1,
  111548. length = array.length,
  111549. resIndex = 0,
  111550. result = [];
  111551. while (++index < length) {
  111552. var value = array[index];
  111553. if (value === placeholder || value === PLACEHOLDER) {
  111554. array[index] = PLACEHOLDER;
  111555. result[resIndex++] = index;
  111556. }
  111557. }
  111558. return result;
  111559. }
  111560. /* harmony default export */ __webpack_exports__["default"] = (replaceHolders);
  111561. /***/ }),
  111562. /***/ "./node_modules/lodash-es/_root.js":
  111563. /*!*****************************************!*\
  111564. !*** ./node_modules/lodash-es/_root.js ***!
  111565. \*****************************************/
  111566. /*! exports provided: default */
  111567. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111568. "use strict";
  111569. __webpack_require__.r(__webpack_exports__);
  111570. /* harmony import */ var _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_freeGlobal.js */ "./node_modules/lodash-es/_freeGlobal.js");
  111571. /** Detect free variable `self`. */
  111572. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  111573. /** Used as a reference to the global object. */
  111574. var root = _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__["default"] || freeSelf || Function('return this')();
  111575. /* harmony default export */ __webpack_exports__["default"] = (root);
  111576. /***/ }),
  111577. /***/ "./node_modules/lodash-es/_safeGet.js":
  111578. /*!********************************************!*\
  111579. !*** ./node_modules/lodash-es/_safeGet.js ***!
  111580. \********************************************/
  111581. /*! exports provided: default */
  111582. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111583. "use strict";
  111584. __webpack_require__.r(__webpack_exports__);
  111585. /**
  111586. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  111587. *
  111588. * @private
  111589. * @param {Object} object The object to query.
  111590. * @param {string} key The key of the property to get.
  111591. * @returns {*} Returns the property value.
  111592. */
  111593. function safeGet(object, key) {
  111594. if (key === 'constructor' && typeof object[key] === 'function') {
  111595. return;
  111596. }
  111597. if (key == '__proto__') {
  111598. return;
  111599. }
  111600. return object[key];
  111601. }
  111602. /* harmony default export */ __webpack_exports__["default"] = (safeGet);
  111603. /***/ }),
  111604. /***/ "./node_modules/lodash-es/_setCacheAdd.js":
  111605. /*!************************************************!*\
  111606. !*** ./node_modules/lodash-es/_setCacheAdd.js ***!
  111607. \************************************************/
  111608. /*! exports provided: default */
  111609. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111610. "use strict";
  111611. __webpack_require__.r(__webpack_exports__);
  111612. /** Used to stand-in for `undefined` hash values. */
  111613. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  111614. /**
  111615. * Adds `value` to the array cache.
  111616. *
  111617. * @private
  111618. * @name add
  111619. * @memberOf SetCache
  111620. * @alias push
  111621. * @param {*} value The value to cache.
  111622. * @returns {Object} Returns the cache instance.
  111623. */
  111624. function setCacheAdd(value) {
  111625. this.__data__.set(value, HASH_UNDEFINED);
  111626. return this;
  111627. }
  111628. /* harmony default export */ __webpack_exports__["default"] = (setCacheAdd);
  111629. /***/ }),
  111630. /***/ "./node_modules/lodash-es/_setCacheHas.js":
  111631. /*!************************************************!*\
  111632. !*** ./node_modules/lodash-es/_setCacheHas.js ***!
  111633. \************************************************/
  111634. /*! exports provided: default */
  111635. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111636. "use strict";
  111637. __webpack_require__.r(__webpack_exports__);
  111638. /**
  111639. * Checks if `value` is in the array cache.
  111640. *
  111641. * @private
  111642. * @name has
  111643. * @memberOf SetCache
  111644. * @param {*} value The value to search for.
  111645. * @returns {number} Returns `true` if `value` is found, else `false`.
  111646. */
  111647. function setCacheHas(value) {
  111648. return this.__data__.has(value);
  111649. }
  111650. /* harmony default export */ __webpack_exports__["default"] = (setCacheHas);
  111651. /***/ }),
  111652. /***/ "./node_modules/lodash-es/_setData.js":
  111653. /*!********************************************!*\
  111654. !*** ./node_modules/lodash-es/_setData.js ***!
  111655. \********************************************/
  111656. /*! exports provided: default */
  111657. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111658. "use strict";
  111659. __webpack_require__.r(__webpack_exports__);
  111660. /* harmony import */ var _baseSetData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSetData.js */ "./node_modules/lodash-es/_baseSetData.js");
  111661. /* harmony import */ var _shortOut_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_shortOut.js */ "./node_modules/lodash-es/_shortOut.js");
  111662. /**
  111663. * Sets metadata for `func`.
  111664. *
  111665. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  111666. * period of time, it will trip its breaker and transition to an identity
  111667. * function to avoid garbage collection pauses in V8. See
  111668. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  111669. * for more details.
  111670. *
  111671. * @private
  111672. * @param {Function} func The function to associate metadata with.
  111673. * @param {*} data The metadata.
  111674. * @returns {Function} Returns `func`.
  111675. */
  111676. var setData = Object(_shortOut_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseSetData_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  111677. /* harmony default export */ __webpack_exports__["default"] = (setData);
  111678. /***/ }),
  111679. /***/ "./node_modules/lodash-es/_setToArray.js":
  111680. /*!***********************************************!*\
  111681. !*** ./node_modules/lodash-es/_setToArray.js ***!
  111682. \***********************************************/
  111683. /*! exports provided: default */
  111684. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111685. "use strict";
  111686. __webpack_require__.r(__webpack_exports__);
  111687. /**
  111688. * Converts `set` to an array of its values.
  111689. *
  111690. * @private
  111691. * @param {Object} set The set to convert.
  111692. * @returns {Array} Returns the values.
  111693. */
  111694. function setToArray(set) {
  111695. var index = -1,
  111696. result = Array(set.size);
  111697. set.forEach(function(value) {
  111698. result[++index] = value;
  111699. });
  111700. return result;
  111701. }
  111702. /* harmony default export */ __webpack_exports__["default"] = (setToArray);
  111703. /***/ }),
  111704. /***/ "./node_modules/lodash-es/_setToPairs.js":
  111705. /*!***********************************************!*\
  111706. !*** ./node_modules/lodash-es/_setToPairs.js ***!
  111707. \***********************************************/
  111708. /*! exports provided: default */
  111709. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111710. "use strict";
  111711. __webpack_require__.r(__webpack_exports__);
  111712. /**
  111713. * Converts `set` to its value-value pairs.
  111714. *
  111715. * @private
  111716. * @param {Object} set The set to convert.
  111717. * @returns {Array} Returns the value-value pairs.
  111718. */
  111719. function setToPairs(set) {
  111720. var index = -1,
  111721. result = Array(set.size);
  111722. set.forEach(function(value) {
  111723. result[++index] = [value, value];
  111724. });
  111725. return result;
  111726. }
  111727. /* harmony default export */ __webpack_exports__["default"] = (setToPairs);
  111728. /***/ }),
  111729. /***/ "./node_modules/lodash-es/_setToString.js":
  111730. /*!************************************************!*\
  111731. !*** ./node_modules/lodash-es/_setToString.js ***!
  111732. \************************************************/
  111733. /*! exports provided: default */
  111734. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111735. "use strict";
  111736. __webpack_require__.r(__webpack_exports__);
  111737. /* harmony import */ var _baseSetToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSetToString.js */ "./node_modules/lodash-es/_baseSetToString.js");
  111738. /* harmony import */ var _shortOut_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_shortOut.js */ "./node_modules/lodash-es/_shortOut.js");
  111739. /**
  111740. * Sets the `toString` method of `func` to return `string`.
  111741. *
  111742. * @private
  111743. * @param {Function} func The function to modify.
  111744. * @param {Function} string The `toString` result.
  111745. * @returns {Function} Returns `func`.
  111746. */
  111747. var setToString = Object(_shortOut_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseSetToString_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  111748. /* harmony default export */ __webpack_exports__["default"] = (setToString);
  111749. /***/ }),
  111750. /***/ "./node_modules/lodash-es/_setWrapToString.js":
  111751. /*!****************************************************!*\
  111752. !*** ./node_modules/lodash-es/_setWrapToString.js ***!
  111753. \****************************************************/
  111754. /*! exports provided: default */
  111755. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111756. "use strict";
  111757. __webpack_require__.r(__webpack_exports__);
  111758. /* harmony import */ var _getWrapDetails_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getWrapDetails.js */ "./node_modules/lodash-es/_getWrapDetails.js");
  111759. /* harmony import */ var _insertWrapDetails_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_insertWrapDetails.js */ "./node_modules/lodash-es/_insertWrapDetails.js");
  111760. /* harmony import */ var _setToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setToString.js */ "./node_modules/lodash-es/_setToString.js");
  111761. /* harmony import */ var _updateWrapDetails_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_updateWrapDetails.js */ "./node_modules/lodash-es/_updateWrapDetails.js");
  111762. /**
  111763. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  111764. * with wrapper details in a comment at the top of the source body.
  111765. *
  111766. * @private
  111767. * @param {Function} wrapper The function to modify.
  111768. * @param {Function} reference The reference function.
  111769. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  111770. * @returns {Function} Returns `wrapper`.
  111771. */
  111772. function setWrapToString(wrapper, reference, bitmask) {
  111773. var source = (reference + '');
  111774. return Object(_setToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(wrapper, Object(_insertWrapDetails_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source, Object(_updateWrapDetails_js__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_getWrapDetails_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source), bitmask)));
  111775. }
  111776. /* harmony default export */ __webpack_exports__["default"] = (setWrapToString);
  111777. /***/ }),
  111778. /***/ "./node_modules/lodash-es/_shortOut.js":
  111779. /*!*********************************************!*\
  111780. !*** ./node_modules/lodash-es/_shortOut.js ***!
  111781. \*********************************************/
  111782. /*! exports provided: default */
  111783. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111784. "use strict";
  111785. __webpack_require__.r(__webpack_exports__);
  111786. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  111787. var HOT_COUNT = 800,
  111788. HOT_SPAN = 16;
  111789. /* Built-in method references for those with the same name as other `lodash` methods. */
  111790. var nativeNow = Date.now;
  111791. /**
  111792. * Creates a function that'll short out and invoke `identity` instead
  111793. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  111794. * milliseconds.
  111795. *
  111796. * @private
  111797. * @param {Function} func The function to restrict.
  111798. * @returns {Function} Returns the new shortable function.
  111799. */
  111800. function shortOut(func) {
  111801. var count = 0,
  111802. lastCalled = 0;
  111803. return function() {
  111804. var stamp = nativeNow(),
  111805. remaining = HOT_SPAN - (stamp - lastCalled);
  111806. lastCalled = stamp;
  111807. if (remaining > 0) {
  111808. if (++count >= HOT_COUNT) {
  111809. return arguments[0];
  111810. }
  111811. } else {
  111812. count = 0;
  111813. }
  111814. return func.apply(undefined, arguments);
  111815. };
  111816. }
  111817. /* harmony default export */ __webpack_exports__["default"] = (shortOut);
  111818. /***/ }),
  111819. /***/ "./node_modules/lodash-es/_shuffleSelf.js":
  111820. /*!************************************************!*\
  111821. !*** ./node_modules/lodash-es/_shuffleSelf.js ***!
  111822. \************************************************/
  111823. /*! exports provided: default */
  111824. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111825. "use strict";
  111826. __webpack_require__.r(__webpack_exports__);
  111827. /* harmony import */ var _baseRandom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRandom.js */ "./node_modules/lodash-es/_baseRandom.js");
  111828. /**
  111829. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  111830. *
  111831. * @private
  111832. * @param {Array} array The array to shuffle.
  111833. * @param {number} [size=array.length] The size of `array`.
  111834. * @returns {Array} Returns `array`.
  111835. */
  111836. function shuffleSelf(array, size) {
  111837. var index = -1,
  111838. length = array.length,
  111839. lastIndex = length - 1;
  111840. size = size === undefined ? length : size;
  111841. while (++index < size) {
  111842. var rand = Object(_baseRandom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(index, lastIndex),
  111843. value = array[rand];
  111844. array[rand] = array[index];
  111845. array[index] = value;
  111846. }
  111847. array.length = size;
  111848. return array;
  111849. }
  111850. /* harmony default export */ __webpack_exports__["default"] = (shuffleSelf);
  111851. /***/ }),
  111852. /***/ "./node_modules/lodash-es/_stackClear.js":
  111853. /*!***********************************************!*\
  111854. !*** ./node_modules/lodash-es/_stackClear.js ***!
  111855. \***********************************************/
  111856. /*! exports provided: default */
  111857. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111858. "use strict";
  111859. __webpack_require__.r(__webpack_exports__);
  111860. /* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
  111861. /**
  111862. * Removes all key-value entries from the stack.
  111863. *
  111864. * @private
  111865. * @name clear
  111866. * @memberOf Stack
  111867. */
  111868. function stackClear() {
  111869. this.__data__ = new _ListCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  111870. this.size = 0;
  111871. }
  111872. /* harmony default export */ __webpack_exports__["default"] = (stackClear);
  111873. /***/ }),
  111874. /***/ "./node_modules/lodash-es/_stackDelete.js":
  111875. /*!************************************************!*\
  111876. !*** ./node_modules/lodash-es/_stackDelete.js ***!
  111877. \************************************************/
  111878. /*! exports provided: default */
  111879. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111880. "use strict";
  111881. __webpack_require__.r(__webpack_exports__);
  111882. /**
  111883. * Removes `key` and its value from the stack.
  111884. *
  111885. * @private
  111886. * @name delete
  111887. * @memberOf Stack
  111888. * @param {string} key The key of the value to remove.
  111889. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  111890. */
  111891. function stackDelete(key) {
  111892. var data = this.__data__,
  111893. result = data['delete'](key);
  111894. this.size = data.size;
  111895. return result;
  111896. }
  111897. /* harmony default export */ __webpack_exports__["default"] = (stackDelete);
  111898. /***/ }),
  111899. /***/ "./node_modules/lodash-es/_stackGet.js":
  111900. /*!*********************************************!*\
  111901. !*** ./node_modules/lodash-es/_stackGet.js ***!
  111902. \*********************************************/
  111903. /*! exports provided: default */
  111904. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111905. "use strict";
  111906. __webpack_require__.r(__webpack_exports__);
  111907. /**
  111908. * Gets the stack value for `key`.
  111909. *
  111910. * @private
  111911. * @name get
  111912. * @memberOf Stack
  111913. * @param {string} key The key of the value to get.
  111914. * @returns {*} Returns the entry value.
  111915. */
  111916. function stackGet(key) {
  111917. return this.__data__.get(key);
  111918. }
  111919. /* harmony default export */ __webpack_exports__["default"] = (stackGet);
  111920. /***/ }),
  111921. /***/ "./node_modules/lodash-es/_stackHas.js":
  111922. /*!*********************************************!*\
  111923. !*** ./node_modules/lodash-es/_stackHas.js ***!
  111924. \*********************************************/
  111925. /*! exports provided: default */
  111926. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111927. "use strict";
  111928. __webpack_require__.r(__webpack_exports__);
  111929. /**
  111930. * Checks if a stack value for `key` exists.
  111931. *
  111932. * @private
  111933. * @name has
  111934. * @memberOf Stack
  111935. * @param {string} key The key of the entry to check.
  111936. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  111937. */
  111938. function stackHas(key) {
  111939. return this.__data__.has(key);
  111940. }
  111941. /* harmony default export */ __webpack_exports__["default"] = (stackHas);
  111942. /***/ }),
  111943. /***/ "./node_modules/lodash-es/_stackSet.js":
  111944. /*!*********************************************!*\
  111945. !*** ./node_modules/lodash-es/_stackSet.js ***!
  111946. \*********************************************/
  111947. /*! exports provided: default */
  111948. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111949. "use strict";
  111950. __webpack_require__.r(__webpack_exports__);
  111951. /* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
  111952. /* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_Map.js */ "./node_modules/lodash-es/_Map.js");
  111953. /* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_MapCache.js */ "./node_modules/lodash-es/_MapCache.js");
  111954. /** Used as the size to enable large array optimizations. */
  111955. var LARGE_ARRAY_SIZE = 200;
  111956. /**
  111957. * Sets the stack `key` to `value`.
  111958. *
  111959. * @private
  111960. * @name set
  111961. * @memberOf Stack
  111962. * @param {string} key The key of the value to set.
  111963. * @param {*} value The value to set.
  111964. * @returns {Object} Returns the stack cache instance.
  111965. */
  111966. function stackSet(key, value) {
  111967. var data = this.__data__;
  111968. if (data instanceof _ListCache_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  111969. var pairs = data.__data__;
  111970. if (!_Map_js__WEBPACK_IMPORTED_MODULE_1__["default"] || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  111971. pairs.push([key, value]);
  111972. this.size = ++data.size;
  111973. return this;
  111974. }
  111975. data = this.__data__ = new _MapCache_js__WEBPACK_IMPORTED_MODULE_2__["default"](pairs);
  111976. }
  111977. data.set(key, value);
  111978. this.size = data.size;
  111979. return this;
  111980. }
  111981. /* harmony default export */ __webpack_exports__["default"] = (stackSet);
  111982. /***/ }),
  111983. /***/ "./node_modules/lodash-es/_strictIndexOf.js":
  111984. /*!**************************************************!*\
  111985. !*** ./node_modules/lodash-es/_strictIndexOf.js ***!
  111986. \**************************************************/
  111987. /*! exports provided: default */
  111988. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111989. "use strict";
  111990. __webpack_require__.r(__webpack_exports__);
  111991. /**
  111992. * A specialized version of `_.indexOf` which performs strict equality
  111993. * comparisons of values, i.e. `===`.
  111994. *
  111995. * @private
  111996. * @param {Array} array The array to inspect.
  111997. * @param {*} value The value to search for.
  111998. * @param {number} fromIndex The index to search from.
  111999. * @returns {number} Returns the index of the matched value, else `-1`.
  112000. */
  112001. function strictIndexOf(array, value, fromIndex) {
  112002. var index = fromIndex - 1,
  112003. length = array.length;
  112004. while (++index < length) {
  112005. if (array[index] === value) {
  112006. return index;
  112007. }
  112008. }
  112009. return -1;
  112010. }
  112011. /* harmony default export */ __webpack_exports__["default"] = (strictIndexOf);
  112012. /***/ }),
  112013. /***/ "./node_modules/lodash-es/_strictLastIndexOf.js":
  112014. /*!******************************************************!*\
  112015. !*** ./node_modules/lodash-es/_strictLastIndexOf.js ***!
  112016. \******************************************************/
  112017. /*! exports provided: default */
  112018. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112019. "use strict";
  112020. __webpack_require__.r(__webpack_exports__);
  112021. /**
  112022. * A specialized version of `_.lastIndexOf` which performs strict equality
  112023. * comparisons of values, i.e. `===`.
  112024. *
  112025. * @private
  112026. * @param {Array} array The array to inspect.
  112027. * @param {*} value The value to search for.
  112028. * @param {number} fromIndex The index to search from.
  112029. * @returns {number} Returns the index of the matched value, else `-1`.
  112030. */
  112031. function strictLastIndexOf(array, value, fromIndex) {
  112032. var index = fromIndex + 1;
  112033. while (index--) {
  112034. if (array[index] === value) {
  112035. return index;
  112036. }
  112037. }
  112038. return index;
  112039. }
  112040. /* harmony default export */ __webpack_exports__["default"] = (strictLastIndexOf);
  112041. /***/ }),
  112042. /***/ "./node_modules/lodash-es/_stringSize.js":
  112043. /*!***********************************************!*\
  112044. !*** ./node_modules/lodash-es/_stringSize.js ***!
  112045. \***********************************************/
  112046. /*! exports provided: default */
  112047. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112048. "use strict";
  112049. __webpack_require__.r(__webpack_exports__);
  112050. /* harmony import */ var _asciiSize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_asciiSize.js */ "./node_modules/lodash-es/_asciiSize.js");
  112051. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  112052. /* harmony import */ var _unicodeSize_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_unicodeSize.js */ "./node_modules/lodash-es/_unicodeSize.js");
  112053. /**
  112054. * Gets the number of symbols in `string`.
  112055. *
  112056. * @private
  112057. * @param {string} string The string to inspect.
  112058. * @returns {number} Returns the string size.
  112059. */
  112060. function stringSize(string) {
  112061. return Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string)
  112062. ? Object(_unicodeSize_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)
  112063. : Object(_asciiSize_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
  112064. }
  112065. /* harmony default export */ __webpack_exports__["default"] = (stringSize);
  112066. /***/ }),
  112067. /***/ "./node_modules/lodash-es/_stringToArray.js":
  112068. /*!**************************************************!*\
  112069. !*** ./node_modules/lodash-es/_stringToArray.js ***!
  112070. \**************************************************/
  112071. /*! exports provided: default */
  112072. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112073. "use strict";
  112074. __webpack_require__.r(__webpack_exports__);
  112075. /* harmony import */ var _asciiToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_asciiToArray.js */ "./node_modules/lodash-es/_asciiToArray.js");
  112076. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  112077. /* harmony import */ var _unicodeToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_unicodeToArray.js */ "./node_modules/lodash-es/_unicodeToArray.js");
  112078. /**
  112079. * Converts `string` to an array.
  112080. *
  112081. * @private
  112082. * @param {string} string The string to convert.
  112083. * @returns {Array} Returns the converted array.
  112084. */
  112085. function stringToArray(string) {
  112086. return Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string)
  112087. ? Object(_unicodeToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)
  112088. : Object(_asciiToArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
  112089. }
  112090. /* harmony default export */ __webpack_exports__["default"] = (stringToArray);
  112091. /***/ }),
  112092. /***/ "./node_modules/lodash-es/_stringToPath.js":
  112093. /*!*************************************************!*\
  112094. !*** ./node_modules/lodash-es/_stringToPath.js ***!
  112095. \*************************************************/
  112096. /*! exports provided: default */
  112097. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112098. "use strict";
  112099. __webpack_require__.r(__webpack_exports__);
  112100. /* harmony import */ var _memoizeCapped_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_memoizeCapped.js */ "./node_modules/lodash-es/_memoizeCapped.js");
  112101. /** Used to match property names within property paths. */
  112102. var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  112103. /** Used to match backslashes in property paths. */
  112104. var reEscapeChar = /\\(\\)?/g;
  112105. /**
  112106. * Converts `string` to a property path array.
  112107. *
  112108. * @private
  112109. * @param {string} string The string to convert.
  112110. * @returns {Array} Returns the property path array.
  112111. */
  112112. var stringToPath = Object(_memoizeCapped_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(string) {
  112113. var result = [];
  112114. if (string.charCodeAt(0) === 46 /* . */) {
  112115. result.push('');
  112116. }
  112117. string.replace(rePropName, function(match, number, quote, subString) {
  112118. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  112119. });
  112120. return result;
  112121. });
  112122. /* harmony default export */ __webpack_exports__["default"] = (stringToPath);
  112123. /***/ }),
  112124. /***/ "./node_modules/lodash-es/_toKey.js":
  112125. /*!******************************************!*\
  112126. !*** ./node_modules/lodash-es/_toKey.js ***!
  112127. \******************************************/
  112128. /*! exports provided: default */
  112129. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112130. "use strict";
  112131. __webpack_require__.r(__webpack_exports__);
  112132. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  112133. /** Used as references for various `Number` constants. */
  112134. var INFINITY = 1 / 0;
  112135. /**
  112136. * Converts `value` to a string key if it's not a string or symbol.
  112137. *
  112138. * @private
  112139. * @param {*} value The value to inspect.
  112140. * @returns {string|symbol} Returns the key.
  112141. */
  112142. function toKey(value) {
  112143. if (typeof value == 'string' || Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
  112144. return value;
  112145. }
  112146. var result = (value + '');
  112147. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  112148. }
  112149. /* harmony default export */ __webpack_exports__["default"] = (toKey);
  112150. /***/ }),
  112151. /***/ "./node_modules/lodash-es/_toSource.js":
  112152. /*!*********************************************!*\
  112153. !*** ./node_modules/lodash-es/_toSource.js ***!
  112154. \*********************************************/
  112155. /*! exports provided: default */
  112156. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112157. "use strict";
  112158. __webpack_require__.r(__webpack_exports__);
  112159. /** Used for built-in method references. */
  112160. var funcProto = Function.prototype;
  112161. /** Used to resolve the decompiled source of functions. */
  112162. var funcToString = funcProto.toString;
  112163. /**
  112164. * Converts `func` to its source code.
  112165. *
  112166. * @private
  112167. * @param {Function} func The function to convert.
  112168. * @returns {string} Returns the source code.
  112169. */
  112170. function toSource(func) {
  112171. if (func != null) {
  112172. try {
  112173. return funcToString.call(func);
  112174. } catch (e) {}
  112175. try {
  112176. return (func + '');
  112177. } catch (e) {}
  112178. }
  112179. return '';
  112180. }
  112181. /* harmony default export */ __webpack_exports__["default"] = (toSource);
  112182. /***/ }),
  112183. /***/ "./node_modules/lodash-es/_trimmedEndIndex.js":
  112184. /*!****************************************************!*\
  112185. !*** ./node_modules/lodash-es/_trimmedEndIndex.js ***!
  112186. \****************************************************/
  112187. /*! exports provided: default */
  112188. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112189. "use strict";
  112190. __webpack_require__.r(__webpack_exports__);
  112191. /** Used to match a single whitespace character. */
  112192. var reWhitespace = /\s/;
  112193. /**
  112194. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  112195. * character of `string`.
  112196. *
  112197. * @private
  112198. * @param {string} string The string to inspect.
  112199. * @returns {number} Returns the index of the last non-whitespace character.
  112200. */
  112201. function trimmedEndIndex(string) {
  112202. var index = string.length;
  112203. while (index-- && reWhitespace.test(string.charAt(index))) {}
  112204. return index;
  112205. }
  112206. /* harmony default export */ __webpack_exports__["default"] = (trimmedEndIndex);
  112207. /***/ }),
  112208. /***/ "./node_modules/lodash-es/_unescapeHtmlChar.js":
  112209. /*!*****************************************************!*\
  112210. !*** ./node_modules/lodash-es/_unescapeHtmlChar.js ***!
  112211. \*****************************************************/
  112212. /*! exports provided: default */
  112213. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112214. "use strict";
  112215. __webpack_require__.r(__webpack_exports__);
  112216. /* harmony import */ var _basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePropertyOf.js */ "./node_modules/lodash-es/_basePropertyOf.js");
  112217. /** Used to map HTML entities to characters. */
  112218. var htmlUnescapes = {
  112219. '&amp;': '&',
  112220. '&lt;': '<',
  112221. '&gt;': '>',
  112222. '&quot;': '"',
  112223. '&#39;': "'"
  112224. };
  112225. /**
  112226. * Used by `_.unescape` to convert HTML entities to characters.
  112227. *
  112228. * @private
  112229. * @param {string} chr The matched character to unescape.
  112230. * @returns {string} Returns the unescaped character.
  112231. */
  112232. var unescapeHtmlChar = Object(_basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(htmlUnescapes);
  112233. /* harmony default export */ __webpack_exports__["default"] = (unescapeHtmlChar);
  112234. /***/ }),
  112235. /***/ "./node_modules/lodash-es/_unicodeSize.js":
  112236. /*!************************************************!*\
  112237. !*** ./node_modules/lodash-es/_unicodeSize.js ***!
  112238. \************************************************/
  112239. /*! exports provided: default */
  112240. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112241. "use strict";
  112242. __webpack_require__.r(__webpack_exports__);
  112243. /** Used to compose unicode character classes. */
  112244. var rsAstralRange = '\\ud800-\\udfff',
  112245. rsComboMarksRange = '\\u0300-\\u036f',
  112246. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  112247. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  112248. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  112249. rsVarRange = '\\ufe0e\\ufe0f';
  112250. /** Used to compose unicode capture groups. */
  112251. var rsAstral = '[' + rsAstralRange + ']',
  112252. rsCombo = '[' + rsComboRange + ']',
  112253. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  112254. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  112255. rsNonAstral = '[^' + rsAstralRange + ']',
  112256. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  112257. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  112258. rsZWJ = '\\u200d';
  112259. /** Used to compose unicode regexes. */
  112260. var reOptMod = rsModifier + '?',
  112261. rsOptVar = '[' + rsVarRange + ']?',
  112262. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  112263. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  112264. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  112265. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  112266. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  112267. /**
  112268. * Gets the size of a Unicode `string`.
  112269. *
  112270. * @private
  112271. * @param {string} string The string inspect.
  112272. * @returns {number} Returns the string size.
  112273. */
  112274. function unicodeSize(string) {
  112275. var result = reUnicode.lastIndex = 0;
  112276. while (reUnicode.test(string)) {
  112277. ++result;
  112278. }
  112279. return result;
  112280. }
  112281. /* harmony default export */ __webpack_exports__["default"] = (unicodeSize);
  112282. /***/ }),
  112283. /***/ "./node_modules/lodash-es/_unicodeToArray.js":
  112284. /*!***************************************************!*\
  112285. !*** ./node_modules/lodash-es/_unicodeToArray.js ***!
  112286. \***************************************************/
  112287. /*! exports provided: default */
  112288. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112289. "use strict";
  112290. __webpack_require__.r(__webpack_exports__);
  112291. /** Used to compose unicode character classes. */
  112292. var rsAstralRange = '\\ud800-\\udfff',
  112293. rsComboMarksRange = '\\u0300-\\u036f',
  112294. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  112295. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  112296. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  112297. rsVarRange = '\\ufe0e\\ufe0f';
  112298. /** Used to compose unicode capture groups. */
  112299. var rsAstral = '[' + rsAstralRange + ']',
  112300. rsCombo = '[' + rsComboRange + ']',
  112301. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  112302. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  112303. rsNonAstral = '[^' + rsAstralRange + ']',
  112304. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  112305. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  112306. rsZWJ = '\\u200d';
  112307. /** Used to compose unicode regexes. */
  112308. var reOptMod = rsModifier + '?',
  112309. rsOptVar = '[' + rsVarRange + ']?',
  112310. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  112311. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  112312. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  112313. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  112314. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  112315. /**
  112316. * Converts a Unicode `string` to an array.
  112317. *
  112318. * @private
  112319. * @param {string} string The string to convert.
  112320. * @returns {Array} Returns the converted array.
  112321. */
  112322. function unicodeToArray(string) {
  112323. return string.match(reUnicode) || [];
  112324. }
  112325. /* harmony default export */ __webpack_exports__["default"] = (unicodeToArray);
  112326. /***/ }),
  112327. /***/ "./node_modules/lodash-es/_unicodeWords.js":
  112328. /*!*************************************************!*\
  112329. !*** ./node_modules/lodash-es/_unicodeWords.js ***!
  112330. \*************************************************/
  112331. /*! exports provided: default */
  112332. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112333. "use strict";
  112334. __webpack_require__.r(__webpack_exports__);
  112335. /** Used to compose unicode character classes. */
  112336. var rsAstralRange = '\\ud800-\\udfff',
  112337. rsComboMarksRange = '\\u0300-\\u036f',
  112338. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  112339. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  112340. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  112341. rsDingbatRange = '\\u2700-\\u27bf',
  112342. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  112343. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  112344. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  112345. rsPunctuationRange = '\\u2000-\\u206f',
  112346. rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
  112347. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  112348. rsVarRange = '\\ufe0e\\ufe0f',
  112349. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  112350. /** Used to compose unicode capture groups. */
  112351. var rsApos = "['\u2019]",
  112352. rsBreak = '[' + rsBreakRange + ']',
  112353. rsCombo = '[' + rsComboRange + ']',
  112354. rsDigits = '\\d+',
  112355. rsDingbat = '[' + rsDingbatRange + ']',
  112356. rsLower = '[' + rsLowerRange + ']',
  112357. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  112358. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  112359. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  112360. rsNonAstral = '[^' + rsAstralRange + ']',
  112361. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  112362. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  112363. rsUpper = '[' + rsUpperRange + ']',
  112364. rsZWJ = '\\u200d';
  112365. /** Used to compose unicode regexes. */
  112366. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  112367. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  112368. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  112369. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  112370. reOptMod = rsModifier + '?',
  112371. rsOptVar = '[' + rsVarRange + ']?',
  112372. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  112373. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  112374. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  112375. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  112376. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;
  112377. /** Used to match complex or compound words. */
  112378. var reUnicodeWord = RegExp([
  112379. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  112380. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  112381. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  112382. rsUpper + '+' + rsOptContrUpper,
  112383. rsOrdUpper,
  112384. rsOrdLower,
  112385. rsDigits,
  112386. rsEmoji
  112387. ].join('|'), 'g');
  112388. /**
  112389. * Splits a Unicode `string` into an array of its words.
  112390. *
  112391. * @private
  112392. * @param {string} The string to inspect.
  112393. * @returns {Array} Returns the words of `string`.
  112394. */
  112395. function unicodeWords(string) {
  112396. return string.match(reUnicodeWord) || [];
  112397. }
  112398. /* harmony default export */ __webpack_exports__["default"] = (unicodeWords);
  112399. /***/ }),
  112400. /***/ "./node_modules/lodash-es/_updateWrapDetails.js":
  112401. /*!******************************************************!*\
  112402. !*** ./node_modules/lodash-es/_updateWrapDetails.js ***!
  112403. \******************************************************/
  112404. /*! exports provided: default */
  112405. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112406. "use strict";
  112407. __webpack_require__.r(__webpack_exports__);
  112408. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  112409. /* harmony import */ var _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayIncludes.js */ "./node_modules/lodash-es/_arrayIncludes.js");
  112410. /** Used to compose bitmasks for function metadata. */
  112411. var WRAP_BIND_FLAG = 1,
  112412. WRAP_BIND_KEY_FLAG = 2,
  112413. WRAP_CURRY_FLAG = 8,
  112414. WRAP_CURRY_RIGHT_FLAG = 16,
  112415. WRAP_PARTIAL_FLAG = 32,
  112416. WRAP_PARTIAL_RIGHT_FLAG = 64,
  112417. WRAP_ARY_FLAG = 128,
  112418. WRAP_REARG_FLAG = 256,
  112419. WRAP_FLIP_FLAG = 512;
  112420. /** Used to associate wrap methods with their bit flags. */
  112421. var wrapFlags = [
  112422. ['ary', WRAP_ARY_FLAG],
  112423. ['bind', WRAP_BIND_FLAG],
  112424. ['bindKey', WRAP_BIND_KEY_FLAG],
  112425. ['curry', WRAP_CURRY_FLAG],
  112426. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  112427. ['flip', WRAP_FLIP_FLAG],
  112428. ['partial', WRAP_PARTIAL_FLAG],
  112429. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  112430. ['rearg', WRAP_REARG_FLAG]
  112431. ];
  112432. /**
  112433. * Updates wrapper `details` based on `bitmask` flags.
  112434. *
  112435. * @private
  112436. * @returns {Array} details The details to modify.
  112437. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  112438. * @returns {Array} Returns `details`.
  112439. */
  112440. function updateWrapDetails(details, bitmask) {
  112441. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(wrapFlags, function(pair) {
  112442. var value = '_.' + pair[0];
  112443. if ((bitmask & pair[1]) && !Object(_arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__["default"])(details, value)) {
  112444. details.push(value);
  112445. }
  112446. });
  112447. return details.sort();
  112448. }
  112449. /* harmony default export */ __webpack_exports__["default"] = (updateWrapDetails);
  112450. /***/ }),
  112451. /***/ "./node_modules/lodash-es/_wrapperClone.js":
  112452. /*!*************************************************!*\
  112453. !*** ./node_modules/lodash-es/_wrapperClone.js ***!
  112454. \*************************************************/
  112455. /*! exports provided: default */
  112456. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112457. "use strict";
  112458. __webpack_require__.r(__webpack_exports__);
  112459. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  112460. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  112461. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  112462. /**
  112463. * Creates a clone of `wrapper`.
  112464. *
  112465. * @private
  112466. * @param {Object} wrapper The wrapper to clone.
  112467. * @returns {Object} Returns the cloned wrapper.
  112468. */
  112469. function wrapperClone(wrapper) {
  112470. if (wrapper instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  112471. return wrapper.clone();
  112472. }
  112473. var result = new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"](wrapper.__wrapped__, wrapper.__chain__);
  112474. result.__actions__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(wrapper.__actions__);
  112475. result.__index__ = wrapper.__index__;
  112476. result.__values__ = wrapper.__values__;
  112477. return result;
  112478. }
  112479. /* harmony default export */ __webpack_exports__["default"] = (wrapperClone);
  112480. /***/ }),
  112481. /***/ "./node_modules/lodash-es/add.js":
  112482. /*!***************************************!*\
  112483. !*** ./node_modules/lodash-es/add.js ***!
  112484. \***************************************/
  112485. /*! exports provided: default */
  112486. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112487. "use strict";
  112488. __webpack_require__.r(__webpack_exports__);
  112489. /* harmony import */ var _createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createMathOperation.js */ "./node_modules/lodash-es/_createMathOperation.js");
  112490. /**
  112491. * Adds two numbers.
  112492. *
  112493. * @static
  112494. * @memberOf _
  112495. * @since 3.4.0
  112496. * @category Math
  112497. * @param {number} augend The first number in an addition.
  112498. * @param {number} addend The second number in an addition.
  112499. * @returns {number} Returns the total.
  112500. * @example
  112501. *
  112502. * _.add(6, 4);
  112503. * // => 10
  112504. */
  112505. var add = Object(_createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(augend, addend) {
  112506. return augend + addend;
  112507. }, 0);
  112508. /* harmony default export */ __webpack_exports__["default"] = (add);
  112509. /***/ }),
  112510. /***/ "./node_modules/lodash-es/after.js":
  112511. /*!*****************************************!*\
  112512. !*** ./node_modules/lodash-es/after.js ***!
  112513. \*****************************************/
  112514. /*! exports provided: default */
  112515. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112516. "use strict";
  112517. __webpack_require__.r(__webpack_exports__);
  112518. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  112519. /** Error message constants. */
  112520. var FUNC_ERROR_TEXT = 'Expected a function';
  112521. /**
  112522. * The opposite of `_.before`; this method creates a function that invokes
  112523. * `func` once it's called `n` or more times.
  112524. *
  112525. * @static
  112526. * @memberOf _
  112527. * @since 0.1.0
  112528. * @category Function
  112529. * @param {number} n The number of calls before `func` is invoked.
  112530. * @param {Function} func The function to restrict.
  112531. * @returns {Function} Returns the new restricted function.
  112532. * @example
  112533. *
  112534. * var saves = ['profile', 'settings'];
  112535. *
  112536. * var done = _.after(saves.length, function() {
  112537. * console.log('done saving!');
  112538. * });
  112539. *
  112540. * _.forEach(saves, function(type) {
  112541. * asyncSave({ 'type': type, 'complete': done });
  112542. * });
  112543. * // => Logs 'done saving!' after the two async saves have completed.
  112544. */
  112545. function after(n, func) {
  112546. if (typeof func != 'function') {
  112547. throw new TypeError(FUNC_ERROR_TEXT);
  112548. }
  112549. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n);
  112550. return function() {
  112551. if (--n < 1) {
  112552. return func.apply(this, arguments);
  112553. }
  112554. };
  112555. }
  112556. /* harmony default export */ __webpack_exports__["default"] = (after);
  112557. /***/ }),
  112558. /***/ "./node_modules/lodash-es/array.default.js":
  112559. /*!*************************************************!*\
  112560. !*** ./node_modules/lodash-es/array.default.js ***!
  112561. \*************************************************/
  112562. /*! exports provided: default */
  112563. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112564. "use strict";
  112565. __webpack_require__.r(__webpack_exports__);
  112566. /* harmony import */ var _chunk_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk.js */ "./node_modules/lodash-es/chunk.js");
  112567. /* harmony import */ var _compact_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./compact.js */ "./node_modules/lodash-es/compact.js");
  112568. /* harmony import */ var _concat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./concat.js */ "./node_modules/lodash-es/concat.js");
  112569. /* harmony import */ var _difference_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./difference.js */ "./node_modules/lodash-es/difference.js");
  112570. /* harmony import */ var _differenceBy_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./differenceBy.js */ "./node_modules/lodash-es/differenceBy.js");
  112571. /* harmony import */ var _differenceWith_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./differenceWith.js */ "./node_modules/lodash-es/differenceWith.js");
  112572. /* harmony import */ var _drop_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./drop.js */ "./node_modules/lodash-es/drop.js");
  112573. /* harmony import */ var _dropRight_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./dropRight.js */ "./node_modules/lodash-es/dropRight.js");
  112574. /* harmony import */ var _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dropRightWhile.js */ "./node_modules/lodash-es/dropRightWhile.js");
  112575. /* harmony import */ var _dropWhile_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dropWhile.js */ "./node_modules/lodash-es/dropWhile.js");
  112576. /* harmony import */ var _fill_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./fill.js */ "./node_modules/lodash-es/fill.js");
  112577. /* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/lodash-es/findIndex.js");
  112578. /* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/lodash-es/findLastIndex.js");
  112579. /* harmony import */ var _first_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./first.js */ "./node_modules/lodash-es/first.js");
  112580. /* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/lodash-es/flatten.js");
  112581. /* harmony import */ var _flattenDeep_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./flattenDeep.js */ "./node_modules/lodash-es/flattenDeep.js");
  112582. /* harmony import */ var _flattenDepth_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./flattenDepth.js */ "./node_modules/lodash-es/flattenDepth.js");
  112583. /* harmony import */ var _fromPairs_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./fromPairs.js */ "./node_modules/lodash-es/fromPairs.js");
  112584. /* harmony import */ var _head_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./head.js */ "./node_modules/lodash-es/head.js");
  112585. /* harmony import */ var _indexOf_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./indexOf.js */ "./node_modules/lodash-es/indexOf.js");
  112586. /* harmony import */ var _initial_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./initial.js */ "./node_modules/lodash-es/initial.js");
  112587. /* harmony import */ var _intersection_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./intersection.js */ "./node_modules/lodash-es/intersection.js");
  112588. /* harmony import */ var _intersectionBy_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./intersectionBy.js */ "./node_modules/lodash-es/intersectionBy.js");
  112589. /* harmony import */ var _intersectionWith_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./intersectionWith.js */ "./node_modules/lodash-es/intersectionWith.js");
  112590. /* harmony import */ var _join_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./join.js */ "./node_modules/lodash-es/join.js");
  112591. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  112592. /* harmony import */ var _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./lastIndexOf.js */ "./node_modules/lodash-es/lastIndexOf.js");
  112593. /* harmony import */ var _nth_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./nth.js */ "./node_modules/lodash-es/nth.js");
  112594. /* harmony import */ var _pull_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./pull.js */ "./node_modules/lodash-es/pull.js");
  112595. /* harmony import */ var _pullAll_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./pullAll.js */ "./node_modules/lodash-es/pullAll.js");
  112596. /* harmony import */ var _pullAllBy_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./pullAllBy.js */ "./node_modules/lodash-es/pullAllBy.js");
  112597. /* harmony import */ var _pullAllWith_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./pullAllWith.js */ "./node_modules/lodash-es/pullAllWith.js");
  112598. /* harmony import */ var _pullAt_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./pullAt.js */ "./node_modules/lodash-es/pullAt.js");
  112599. /* harmony import */ var _remove_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./remove.js */ "./node_modules/lodash-es/remove.js");
  112600. /* harmony import */ var _reverse_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./reverse.js */ "./node_modules/lodash-es/reverse.js");
  112601. /* harmony import */ var _slice_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./slice.js */ "./node_modules/lodash-es/slice.js");
  112602. /* harmony import */ var _sortedIndex_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./sortedIndex.js */ "./node_modules/lodash-es/sortedIndex.js");
  112603. /* harmony import */ var _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./sortedIndexBy.js */ "./node_modules/lodash-es/sortedIndexBy.js");
  112604. /* harmony import */ var _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./sortedIndexOf.js */ "./node_modules/lodash-es/sortedIndexOf.js");
  112605. /* harmony import */ var _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./sortedLastIndex.js */ "./node_modules/lodash-es/sortedLastIndex.js");
  112606. /* harmony import */ var _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./sortedLastIndexBy.js */ "./node_modules/lodash-es/sortedLastIndexBy.js");
  112607. /* harmony import */ var _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./sortedLastIndexOf.js */ "./node_modules/lodash-es/sortedLastIndexOf.js");
  112608. /* harmony import */ var _sortedUniq_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./sortedUniq.js */ "./node_modules/lodash-es/sortedUniq.js");
  112609. /* harmony import */ var _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./sortedUniqBy.js */ "./node_modules/lodash-es/sortedUniqBy.js");
  112610. /* harmony import */ var _tail_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./tail.js */ "./node_modules/lodash-es/tail.js");
  112611. /* harmony import */ var _take_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./take.js */ "./node_modules/lodash-es/take.js");
  112612. /* harmony import */ var _takeRight_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./takeRight.js */ "./node_modules/lodash-es/takeRight.js");
  112613. /* harmony import */ var _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./takeRightWhile.js */ "./node_modules/lodash-es/takeRightWhile.js");
  112614. /* harmony import */ var _takeWhile_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./takeWhile.js */ "./node_modules/lodash-es/takeWhile.js");
  112615. /* harmony import */ var _union_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./union.js */ "./node_modules/lodash-es/union.js");
  112616. /* harmony import */ var _unionBy_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./unionBy.js */ "./node_modules/lodash-es/unionBy.js");
  112617. /* harmony import */ var _unionWith_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./unionWith.js */ "./node_modules/lodash-es/unionWith.js");
  112618. /* harmony import */ var _uniq_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./uniq.js */ "./node_modules/lodash-es/uniq.js");
  112619. /* harmony import */ var _uniqBy_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./uniqBy.js */ "./node_modules/lodash-es/uniqBy.js");
  112620. /* harmony import */ var _uniqWith_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./uniqWith.js */ "./node_modules/lodash-es/uniqWith.js");
  112621. /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
  112622. /* harmony import */ var _unzipWith_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./unzipWith.js */ "./node_modules/lodash-es/unzipWith.js");
  112623. /* harmony import */ var _without_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./without.js */ "./node_modules/lodash-es/without.js");
  112624. /* harmony import */ var _xor_js__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./xor.js */ "./node_modules/lodash-es/xor.js");
  112625. /* harmony import */ var _xorBy_js__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./xorBy.js */ "./node_modules/lodash-es/xorBy.js");
  112626. /* harmony import */ var _xorWith_js__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./xorWith.js */ "./node_modules/lodash-es/xorWith.js");
  112627. /* harmony import */ var _zip_js__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./zip.js */ "./node_modules/lodash-es/zip.js");
  112628. /* harmony import */ var _zipObject_js__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./zipObject.js */ "./node_modules/lodash-es/zipObject.js");
  112629. /* harmony import */ var _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./zipObjectDeep.js */ "./node_modules/lodash-es/zipObjectDeep.js");
  112630. /* harmony import */ var _zipWith_js__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./zipWith.js */ "./node_modules/lodash-es/zipWith.js");
  112631. /* harmony default export */ __webpack_exports__["default"] = ({
  112632. chunk: _chunk_js__WEBPACK_IMPORTED_MODULE_0__["default"], compact: _compact_js__WEBPACK_IMPORTED_MODULE_1__["default"], concat: _concat_js__WEBPACK_IMPORTED_MODULE_2__["default"], difference: _difference_js__WEBPACK_IMPORTED_MODULE_3__["default"], differenceBy: _differenceBy_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  112633. differenceWith: _differenceWith_js__WEBPACK_IMPORTED_MODULE_5__["default"], drop: _drop_js__WEBPACK_IMPORTED_MODULE_6__["default"], dropRight: _dropRight_js__WEBPACK_IMPORTED_MODULE_7__["default"], dropRightWhile: _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_8__["default"], dropWhile: _dropWhile_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  112634. fill: _fill_js__WEBPACK_IMPORTED_MODULE_10__["default"], findIndex: _findIndex_js__WEBPACK_IMPORTED_MODULE_11__["default"], findLastIndex: _findLastIndex_js__WEBPACK_IMPORTED_MODULE_12__["default"], first: _first_js__WEBPACK_IMPORTED_MODULE_13__["default"], flatten: _flatten_js__WEBPACK_IMPORTED_MODULE_14__["default"],
  112635. flattenDeep: _flattenDeep_js__WEBPACK_IMPORTED_MODULE_15__["default"], flattenDepth: _flattenDepth_js__WEBPACK_IMPORTED_MODULE_16__["default"], fromPairs: _fromPairs_js__WEBPACK_IMPORTED_MODULE_17__["default"], head: _head_js__WEBPACK_IMPORTED_MODULE_18__["default"], indexOf: _indexOf_js__WEBPACK_IMPORTED_MODULE_19__["default"],
  112636. initial: _initial_js__WEBPACK_IMPORTED_MODULE_20__["default"], intersection: _intersection_js__WEBPACK_IMPORTED_MODULE_21__["default"], intersectionBy: _intersectionBy_js__WEBPACK_IMPORTED_MODULE_22__["default"], intersectionWith: _intersectionWith_js__WEBPACK_IMPORTED_MODULE_23__["default"], join: _join_js__WEBPACK_IMPORTED_MODULE_24__["default"],
  112637. last: _last_js__WEBPACK_IMPORTED_MODULE_25__["default"], lastIndexOf: _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_26__["default"], nth: _nth_js__WEBPACK_IMPORTED_MODULE_27__["default"], pull: _pull_js__WEBPACK_IMPORTED_MODULE_28__["default"], pullAll: _pullAll_js__WEBPACK_IMPORTED_MODULE_29__["default"],
  112638. pullAllBy: _pullAllBy_js__WEBPACK_IMPORTED_MODULE_30__["default"], pullAllWith: _pullAllWith_js__WEBPACK_IMPORTED_MODULE_31__["default"], pullAt: _pullAt_js__WEBPACK_IMPORTED_MODULE_32__["default"], remove: _remove_js__WEBPACK_IMPORTED_MODULE_33__["default"], reverse: _reverse_js__WEBPACK_IMPORTED_MODULE_34__["default"],
  112639. slice: _slice_js__WEBPACK_IMPORTED_MODULE_35__["default"], sortedIndex: _sortedIndex_js__WEBPACK_IMPORTED_MODULE_36__["default"], sortedIndexBy: _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_37__["default"], sortedIndexOf: _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_38__["default"], sortedLastIndex: _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_39__["default"],
  112640. sortedLastIndexBy: _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_40__["default"], sortedLastIndexOf: _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_41__["default"], sortedUniq: _sortedUniq_js__WEBPACK_IMPORTED_MODULE_42__["default"], sortedUniqBy: _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_43__["default"], tail: _tail_js__WEBPACK_IMPORTED_MODULE_44__["default"],
  112641. take: _take_js__WEBPACK_IMPORTED_MODULE_45__["default"], takeRight: _takeRight_js__WEBPACK_IMPORTED_MODULE_46__["default"], takeRightWhile: _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_47__["default"], takeWhile: _takeWhile_js__WEBPACK_IMPORTED_MODULE_48__["default"], union: _union_js__WEBPACK_IMPORTED_MODULE_49__["default"],
  112642. unionBy: _unionBy_js__WEBPACK_IMPORTED_MODULE_50__["default"], unionWith: _unionWith_js__WEBPACK_IMPORTED_MODULE_51__["default"], uniq: _uniq_js__WEBPACK_IMPORTED_MODULE_52__["default"], uniqBy: _uniqBy_js__WEBPACK_IMPORTED_MODULE_53__["default"], uniqWith: _uniqWith_js__WEBPACK_IMPORTED_MODULE_54__["default"],
  112643. unzip: _unzip_js__WEBPACK_IMPORTED_MODULE_55__["default"], unzipWith: _unzipWith_js__WEBPACK_IMPORTED_MODULE_56__["default"], without: _without_js__WEBPACK_IMPORTED_MODULE_57__["default"], xor: _xor_js__WEBPACK_IMPORTED_MODULE_58__["default"], xorBy: _xorBy_js__WEBPACK_IMPORTED_MODULE_59__["default"],
  112644. xorWith: _xorWith_js__WEBPACK_IMPORTED_MODULE_60__["default"], zip: _zip_js__WEBPACK_IMPORTED_MODULE_61__["default"], zipObject: _zipObject_js__WEBPACK_IMPORTED_MODULE_62__["default"], zipObjectDeep: _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_63__["default"], zipWith: _zipWith_js__WEBPACK_IMPORTED_MODULE_64__["default"]
  112645. });
  112646. /***/ }),
  112647. /***/ "./node_modules/lodash-es/array.js":
  112648. /*!*****************************************!*\
  112649. !*** ./node_modules/lodash-es/array.js ***!
  112650. \*****************************************/
  112651. /*! exports provided: chunk, compact, concat, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, findIndex, findLastIndex, first, flatten, flattenDeep, flattenDepth, fromPairs, head, indexOf, initial, intersection, intersectionBy, intersectionWith, join, last, lastIndexOf, nth, pull, pullAll, pullAllBy, pullAllWith, pullAt, remove, reverse, slice, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, sortedUniq, sortedUniqBy, tail, take, takeRight, takeRightWhile, takeWhile, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, without, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, zipWith, default */
  112652. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112653. "use strict";
  112654. __webpack_require__.r(__webpack_exports__);
  112655. /* harmony import */ var _chunk_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk.js */ "./node_modules/lodash-es/chunk.js");
  112656. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return _chunk_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  112657. /* harmony import */ var _compact_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./compact.js */ "./node_modules/lodash-es/compact.js");
  112658. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return _compact_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  112659. /* harmony import */ var _concat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./concat.js */ "./node_modules/lodash-es/concat.js");
  112660. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _concat_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  112661. /* harmony import */ var _difference_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./difference.js */ "./node_modules/lodash-es/difference.js");
  112662. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return _difference_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  112663. /* harmony import */ var _differenceBy_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./differenceBy.js */ "./node_modules/lodash-es/differenceBy.js");
  112664. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceBy", function() { return _differenceBy_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  112665. /* harmony import */ var _differenceWith_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./differenceWith.js */ "./node_modules/lodash-es/differenceWith.js");
  112666. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceWith", function() { return _differenceWith_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  112667. /* harmony import */ var _drop_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./drop.js */ "./node_modules/lodash-es/drop.js");
  112668. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return _drop_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  112669. /* harmony import */ var _dropRight_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./dropRight.js */ "./node_modules/lodash-es/dropRight.js");
  112670. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropRight", function() { return _dropRight_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  112671. /* harmony import */ var _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dropRightWhile.js */ "./node_modules/lodash-es/dropRightWhile.js");
  112672. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropRightWhile", function() { return _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  112673. /* harmony import */ var _dropWhile_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dropWhile.js */ "./node_modules/lodash-es/dropWhile.js");
  112674. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropWhile", function() { return _dropWhile_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  112675. /* harmony import */ var _fill_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./fill.js */ "./node_modules/lodash-es/fill.js");
  112676. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return _fill_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  112677. /* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/lodash-es/findIndex.js");
  112678. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _findIndex_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  112679. /* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/lodash-es/findLastIndex.js");
  112680. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return _findLastIndex_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  112681. /* harmony import */ var _first_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./first.js */ "./node_modules/lodash-es/first.js");
  112682. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _first_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  112683. /* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/lodash-es/flatten.js");
  112684. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return _flatten_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  112685. /* harmony import */ var _flattenDeep_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./flattenDeep.js */ "./node_modules/lodash-es/flattenDeep.js");
  112686. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDeep", function() { return _flattenDeep_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  112687. /* harmony import */ var _flattenDepth_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./flattenDepth.js */ "./node_modules/lodash-es/flattenDepth.js");
  112688. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDepth", function() { return _flattenDepth_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  112689. /* harmony import */ var _fromPairs_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./fromPairs.js */ "./node_modules/lodash-es/fromPairs.js");
  112690. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromPairs", function() { return _fromPairs_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  112691. /* harmony import */ var _head_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./head.js */ "./node_modules/lodash-es/head.js");
  112692. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "head", function() { return _head_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  112693. /* harmony import */ var _indexOf_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./indexOf.js */ "./node_modules/lodash-es/indexOf.js");
  112694. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return _indexOf_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  112695. /* harmony import */ var _initial_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./initial.js */ "./node_modules/lodash-es/initial.js");
  112696. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return _initial_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  112697. /* harmony import */ var _intersection_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./intersection.js */ "./node_modules/lodash-es/intersection.js");
  112698. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return _intersection_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  112699. /* harmony import */ var _intersectionBy_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./intersectionBy.js */ "./node_modules/lodash-es/intersectionBy.js");
  112700. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersectionBy", function() { return _intersectionBy_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  112701. /* harmony import */ var _intersectionWith_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./intersectionWith.js */ "./node_modules/lodash-es/intersectionWith.js");
  112702. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersectionWith", function() { return _intersectionWith_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  112703. /* harmony import */ var _join_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./join.js */ "./node_modules/lodash-es/join.js");
  112704. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "join", function() { return _join_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  112705. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  112706. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "last", function() { return _last_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  112707. /* harmony import */ var _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./lastIndexOf.js */ "./node_modules/lodash-es/lastIndexOf.js");
  112708. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  112709. /* harmony import */ var _nth_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./nth.js */ "./node_modules/lodash-es/nth.js");
  112710. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nth", function() { return _nth_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  112711. /* harmony import */ var _pull_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./pull.js */ "./node_modules/lodash-es/pull.js");
  112712. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pull", function() { return _pull_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  112713. /* harmony import */ var _pullAll_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./pullAll.js */ "./node_modules/lodash-es/pullAll.js");
  112714. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAll", function() { return _pullAll_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  112715. /* harmony import */ var _pullAllBy_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./pullAllBy.js */ "./node_modules/lodash-es/pullAllBy.js");
  112716. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAllBy", function() { return _pullAllBy_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  112717. /* harmony import */ var _pullAllWith_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./pullAllWith.js */ "./node_modules/lodash-es/pullAllWith.js");
  112718. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAllWith", function() { return _pullAllWith_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  112719. /* harmony import */ var _pullAt_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./pullAt.js */ "./node_modules/lodash-es/pullAt.js");
  112720. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAt", function() { return _pullAt_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  112721. /* harmony import */ var _remove_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./remove.js */ "./node_modules/lodash-es/remove.js");
  112722. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return _remove_js__WEBPACK_IMPORTED_MODULE_33__["default"]; });
  112723. /* harmony import */ var _reverse_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./reverse.js */ "./node_modules/lodash-es/reverse.js");
  112724. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reverse", function() { return _reverse_js__WEBPACK_IMPORTED_MODULE_34__["default"]; });
  112725. /* harmony import */ var _slice_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./slice.js */ "./node_modules/lodash-es/slice.js");
  112726. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return _slice_js__WEBPACK_IMPORTED_MODULE_35__["default"]; });
  112727. /* harmony import */ var _sortedIndex_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./sortedIndex.js */ "./node_modules/lodash-es/sortedIndex.js");
  112728. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return _sortedIndex_js__WEBPACK_IMPORTED_MODULE_36__["default"]; });
  112729. /* harmony import */ var _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./sortedIndexBy.js */ "./node_modules/lodash-es/sortedIndexBy.js");
  112730. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndexBy", function() { return _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_37__["default"]; });
  112731. /* harmony import */ var _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./sortedIndexOf.js */ "./node_modules/lodash-es/sortedIndexOf.js");
  112732. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndexOf", function() { return _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_38__["default"]; });
  112733. /* harmony import */ var _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./sortedLastIndex.js */ "./node_modules/lodash-es/sortedLastIndex.js");
  112734. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndex", function() { return _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_39__["default"]; });
  112735. /* harmony import */ var _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./sortedLastIndexBy.js */ "./node_modules/lodash-es/sortedLastIndexBy.js");
  112736. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndexBy", function() { return _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_40__["default"]; });
  112737. /* harmony import */ var _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./sortedLastIndexOf.js */ "./node_modules/lodash-es/sortedLastIndexOf.js");
  112738. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndexOf", function() { return _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_41__["default"]; });
  112739. /* harmony import */ var _sortedUniq_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./sortedUniq.js */ "./node_modules/lodash-es/sortedUniq.js");
  112740. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedUniq", function() { return _sortedUniq_js__WEBPACK_IMPORTED_MODULE_42__["default"]; });
  112741. /* harmony import */ var _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./sortedUniqBy.js */ "./node_modules/lodash-es/sortedUniqBy.js");
  112742. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedUniqBy", function() { return _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_43__["default"]; });
  112743. /* harmony import */ var _tail_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./tail.js */ "./node_modules/lodash-es/tail.js");
  112744. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return _tail_js__WEBPACK_IMPORTED_MODULE_44__["default"]; });
  112745. /* harmony import */ var _take_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./take.js */ "./node_modules/lodash-es/take.js");
  112746. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "take", function() { return _take_js__WEBPACK_IMPORTED_MODULE_45__["default"]; });
  112747. /* harmony import */ var _takeRight_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./takeRight.js */ "./node_modules/lodash-es/takeRight.js");
  112748. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeRight", function() { return _takeRight_js__WEBPACK_IMPORTED_MODULE_46__["default"]; });
  112749. /* harmony import */ var _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./takeRightWhile.js */ "./node_modules/lodash-es/takeRightWhile.js");
  112750. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeRightWhile", function() { return _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_47__["default"]; });
  112751. /* harmony import */ var _takeWhile_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./takeWhile.js */ "./node_modules/lodash-es/takeWhile.js");
  112752. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return _takeWhile_js__WEBPACK_IMPORTED_MODULE_48__["default"]; });
  112753. /* harmony import */ var _union_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./union.js */ "./node_modules/lodash-es/union.js");
  112754. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "union", function() { return _union_js__WEBPACK_IMPORTED_MODULE_49__["default"]; });
  112755. /* harmony import */ var _unionBy_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./unionBy.js */ "./node_modules/lodash-es/unionBy.js");
  112756. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unionBy", function() { return _unionBy_js__WEBPACK_IMPORTED_MODULE_50__["default"]; });
  112757. /* harmony import */ var _unionWith_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./unionWith.js */ "./node_modules/lodash-es/unionWith.js");
  112758. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unionWith", function() { return _unionWith_js__WEBPACK_IMPORTED_MODULE_51__["default"]; });
  112759. /* harmony import */ var _uniq_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./uniq.js */ "./node_modules/lodash-es/uniq.js");
  112760. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return _uniq_js__WEBPACK_IMPORTED_MODULE_52__["default"]; });
  112761. /* harmony import */ var _uniqBy_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./uniqBy.js */ "./node_modules/lodash-es/uniqBy.js");
  112762. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqBy", function() { return _uniqBy_js__WEBPACK_IMPORTED_MODULE_53__["default"]; });
  112763. /* harmony import */ var _uniqWith_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./uniqWith.js */ "./node_modules/lodash-es/uniqWith.js");
  112764. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqWith", function() { return _uniqWith_js__WEBPACK_IMPORTED_MODULE_54__["default"]; });
  112765. /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
  112766. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return _unzip_js__WEBPACK_IMPORTED_MODULE_55__["default"]; });
  112767. /* harmony import */ var _unzipWith_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./unzipWith.js */ "./node_modules/lodash-es/unzipWith.js");
  112768. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unzipWith", function() { return _unzipWith_js__WEBPACK_IMPORTED_MODULE_56__["default"]; });
  112769. /* harmony import */ var _without_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./without.js */ "./node_modules/lodash-es/without.js");
  112770. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "without", function() { return _without_js__WEBPACK_IMPORTED_MODULE_57__["default"]; });
  112771. /* harmony import */ var _xor_js__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./xor.js */ "./node_modules/lodash-es/xor.js");
  112772. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xor", function() { return _xor_js__WEBPACK_IMPORTED_MODULE_58__["default"]; });
  112773. /* harmony import */ var _xorBy_js__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./xorBy.js */ "./node_modules/lodash-es/xorBy.js");
  112774. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xorBy", function() { return _xorBy_js__WEBPACK_IMPORTED_MODULE_59__["default"]; });
  112775. /* harmony import */ var _xorWith_js__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./xorWith.js */ "./node_modules/lodash-es/xorWith.js");
  112776. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xorWith", function() { return _xorWith_js__WEBPACK_IMPORTED_MODULE_60__["default"]; });
  112777. /* harmony import */ var _zip_js__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./zip.js */ "./node_modules/lodash-es/zip.js");
  112778. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _zip_js__WEBPACK_IMPORTED_MODULE_61__["default"]; });
  112779. /* harmony import */ var _zipObject_js__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./zipObject.js */ "./node_modules/lodash-es/zipObject.js");
  112780. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipObject", function() { return _zipObject_js__WEBPACK_IMPORTED_MODULE_62__["default"]; });
  112781. /* harmony import */ var _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./zipObjectDeep.js */ "./node_modules/lodash-es/zipObjectDeep.js");
  112782. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipObjectDeep", function() { return _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_63__["default"]; });
  112783. /* harmony import */ var _zipWith_js__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./zipWith.js */ "./node_modules/lodash-es/zipWith.js");
  112784. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipWith", function() { return _zipWith_js__WEBPACK_IMPORTED_MODULE_64__["default"]; });
  112785. /* harmony import */ var _array_default_js__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./array.default.js */ "./node_modules/lodash-es/array.default.js");
  112786. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _array_default_js__WEBPACK_IMPORTED_MODULE_65__["default"]; });
  112787. /***/ }),
  112788. /***/ "./node_modules/lodash-es/ary.js":
  112789. /*!***************************************!*\
  112790. !*** ./node_modules/lodash-es/ary.js ***!
  112791. \***************************************/
  112792. /*! exports provided: default */
  112793. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112794. "use strict";
  112795. __webpack_require__.r(__webpack_exports__);
  112796. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  112797. /** Used to compose bitmasks for function metadata. */
  112798. var WRAP_ARY_FLAG = 128;
  112799. /**
  112800. * Creates a function that invokes `func`, with up to `n` arguments,
  112801. * ignoring any additional arguments.
  112802. *
  112803. * @static
  112804. * @memberOf _
  112805. * @since 3.0.0
  112806. * @category Function
  112807. * @param {Function} func The function to cap arguments for.
  112808. * @param {number} [n=func.length] The arity cap.
  112809. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  112810. * @returns {Function} Returns the new capped function.
  112811. * @example
  112812. *
  112813. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  112814. * // => [6, 8, 10]
  112815. */
  112816. function ary(func, n, guard) {
  112817. n = guard ? undefined : n;
  112818. n = (func && n == null) ? func.length : n;
  112819. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  112820. }
  112821. /* harmony default export */ __webpack_exports__["default"] = (ary);
  112822. /***/ }),
  112823. /***/ "./node_modules/lodash-es/assign.js":
  112824. /*!******************************************!*\
  112825. !*** ./node_modules/lodash-es/assign.js ***!
  112826. \******************************************/
  112827. /*! exports provided: default */
  112828. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112829. "use strict";
  112830. __webpack_require__.r(__webpack_exports__);
  112831. /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
  112832. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  112833. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  112834. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  112835. /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
  112836. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  112837. /** Used for built-in method references. */
  112838. var objectProto = Object.prototype;
  112839. /** Used to check objects for own properties. */
  112840. var hasOwnProperty = objectProto.hasOwnProperty;
  112841. /**
  112842. * Assigns own enumerable string keyed properties of source objects to the
  112843. * destination object. Source objects are applied from left to right.
  112844. * Subsequent sources overwrite property assignments of previous sources.
  112845. *
  112846. * **Note:** This method mutates `object` and is loosely based on
  112847. * [`Object.assign`](https://mdn.io/Object/assign).
  112848. *
  112849. * @static
  112850. * @memberOf _
  112851. * @since 0.10.0
  112852. * @category Object
  112853. * @param {Object} object The destination object.
  112854. * @param {...Object} [sources] The source objects.
  112855. * @returns {Object} Returns `object`.
  112856. * @see _.assignIn
  112857. * @example
  112858. *
  112859. * function Foo() {
  112860. * this.a = 1;
  112861. * }
  112862. *
  112863. * function Bar() {
  112864. * this.c = 3;
  112865. * }
  112866. *
  112867. * Foo.prototype.b = 2;
  112868. * Bar.prototype.d = 4;
  112869. *
  112870. * _.assign({ 'a': 0 }, new Foo, new Bar);
  112871. * // => { 'a': 1, 'c': 3 }
  112872. */
  112873. var assign = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(object, source) {
  112874. if (Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_4__["default"])(source) || Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__["default"])(source)) {
  112875. Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source, Object(_keys_js__WEBPACK_IMPORTED_MODULE_5__["default"])(source), object);
  112876. return;
  112877. }
  112878. for (var key in source) {
  112879. if (hasOwnProperty.call(source, key)) {
  112880. Object(_assignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, source[key]);
  112881. }
  112882. }
  112883. });
  112884. /* harmony default export */ __webpack_exports__["default"] = (assign);
  112885. /***/ }),
  112886. /***/ "./node_modules/lodash-es/assignIn.js":
  112887. /*!********************************************!*\
  112888. !*** ./node_modules/lodash-es/assignIn.js ***!
  112889. \********************************************/
  112890. /*! exports provided: default */
  112891. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112892. "use strict";
  112893. __webpack_require__.r(__webpack_exports__);
  112894. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  112895. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  112896. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  112897. /**
  112898. * This method is like `_.assign` except that it iterates over own and
  112899. * inherited source properties.
  112900. *
  112901. * **Note:** This method mutates `object`.
  112902. *
  112903. * @static
  112904. * @memberOf _
  112905. * @since 4.0.0
  112906. * @alias extend
  112907. * @category Object
  112908. * @param {Object} object The destination object.
  112909. * @param {...Object} [sources] The source objects.
  112910. * @returns {Object} Returns `object`.
  112911. * @see _.assign
  112912. * @example
  112913. *
  112914. * function Foo() {
  112915. * this.a = 1;
  112916. * }
  112917. *
  112918. * function Bar() {
  112919. * this.c = 3;
  112920. * }
  112921. *
  112922. * Foo.prototype.b = 2;
  112923. * Bar.prototype.d = 4;
  112924. *
  112925. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  112926. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  112927. */
  112928. var assignIn = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source) {
  112929. Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source), object);
  112930. });
  112931. /* harmony default export */ __webpack_exports__["default"] = (assignIn);
  112932. /***/ }),
  112933. /***/ "./node_modules/lodash-es/assignInWith.js":
  112934. /*!************************************************!*\
  112935. !*** ./node_modules/lodash-es/assignInWith.js ***!
  112936. \************************************************/
  112937. /*! exports provided: default */
  112938. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112939. "use strict";
  112940. __webpack_require__.r(__webpack_exports__);
  112941. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  112942. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  112943. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  112944. /**
  112945. * This method is like `_.assignIn` except that it accepts `customizer`
  112946. * which is invoked to produce the assigned values. If `customizer` returns
  112947. * `undefined`, assignment is handled by the method instead. The `customizer`
  112948. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  112949. *
  112950. * **Note:** This method mutates `object`.
  112951. *
  112952. * @static
  112953. * @memberOf _
  112954. * @since 4.0.0
  112955. * @alias extendWith
  112956. * @category Object
  112957. * @param {Object} object The destination object.
  112958. * @param {...Object} sources The source objects.
  112959. * @param {Function} [customizer] The function to customize assigned values.
  112960. * @returns {Object} Returns `object`.
  112961. * @see _.assignWith
  112962. * @example
  112963. *
  112964. * function customizer(objValue, srcValue) {
  112965. * return _.isUndefined(objValue) ? srcValue : objValue;
  112966. * }
  112967. *
  112968. * var defaults = _.partialRight(_.assignInWith, customizer);
  112969. *
  112970. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  112971. * // => { 'a': 1, 'b': 2 }
  112972. */
  112973. var assignInWith = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source, srcIndex, customizer) {
  112974. Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source), object, customizer);
  112975. });
  112976. /* harmony default export */ __webpack_exports__["default"] = (assignInWith);
  112977. /***/ }),
  112978. /***/ "./node_modules/lodash-es/assignWith.js":
  112979. /*!**********************************************!*\
  112980. !*** ./node_modules/lodash-es/assignWith.js ***!
  112981. \**********************************************/
  112982. /*! exports provided: default */
  112983. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112984. "use strict";
  112985. __webpack_require__.r(__webpack_exports__);
  112986. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  112987. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  112988. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  112989. /**
  112990. * This method is like `_.assign` except that it accepts `customizer`
  112991. * which is invoked to produce the assigned values. If `customizer` returns
  112992. * `undefined`, assignment is handled by the method instead. The `customizer`
  112993. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  112994. *
  112995. * **Note:** This method mutates `object`.
  112996. *
  112997. * @static
  112998. * @memberOf _
  112999. * @since 4.0.0
  113000. * @category Object
  113001. * @param {Object} object The destination object.
  113002. * @param {...Object} sources The source objects.
  113003. * @param {Function} [customizer] The function to customize assigned values.
  113004. * @returns {Object} Returns `object`.
  113005. * @see _.assignInWith
  113006. * @example
  113007. *
  113008. * function customizer(objValue, srcValue) {
  113009. * return _.isUndefined(objValue) ? srcValue : objValue;
  113010. * }
  113011. *
  113012. * var defaults = _.partialRight(_.assignWith, customizer);
  113013. *
  113014. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  113015. * // => { 'a': 1, 'b': 2 }
  113016. */
  113017. var assignWith = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source, srcIndex, customizer) {
  113018. Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keys_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source), object, customizer);
  113019. });
  113020. /* harmony default export */ __webpack_exports__["default"] = (assignWith);
  113021. /***/ }),
  113022. /***/ "./node_modules/lodash-es/at.js":
  113023. /*!**************************************!*\
  113024. !*** ./node_modules/lodash-es/at.js ***!
  113025. \**************************************/
  113026. /*! exports provided: default */
  113027. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113028. "use strict";
  113029. __webpack_require__.r(__webpack_exports__);
  113030. /* harmony import */ var _baseAt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAt.js */ "./node_modules/lodash-es/_baseAt.js");
  113031. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  113032. /**
  113033. * Creates an array of values corresponding to `paths` of `object`.
  113034. *
  113035. * @static
  113036. * @memberOf _
  113037. * @since 1.0.0
  113038. * @category Object
  113039. * @param {Object} object The object to iterate over.
  113040. * @param {...(string|string[])} [paths] The property paths to pick.
  113041. * @returns {Array} Returns the picked values.
  113042. * @example
  113043. *
  113044. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  113045. *
  113046. * _.at(object, ['a[0].b.c', 'a[1]']);
  113047. * // => [3, 4]
  113048. */
  113049. var at = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseAt_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  113050. /* harmony default export */ __webpack_exports__["default"] = (at);
  113051. /***/ }),
  113052. /***/ "./node_modules/lodash-es/attempt.js":
  113053. /*!*******************************************!*\
  113054. !*** ./node_modules/lodash-es/attempt.js ***!
  113055. \*******************************************/
  113056. /*! exports provided: default */
  113057. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113058. "use strict";
  113059. __webpack_require__.r(__webpack_exports__);
  113060. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  113061. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  113062. /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
  113063. /**
  113064. * Attempts to invoke `func`, returning either the result or the caught error
  113065. * object. Any additional arguments are provided to `func` when it's invoked.
  113066. *
  113067. * @static
  113068. * @memberOf _
  113069. * @since 3.0.0
  113070. * @category Util
  113071. * @param {Function} func The function to attempt.
  113072. * @param {...*} [args] The arguments to invoke `func` with.
  113073. * @returns {*} Returns the `func` result or error object.
  113074. * @example
  113075. *
  113076. * // Avoid throwing errors for invalid selectors.
  113077. * var elements = _.attempt(function(selector) {
  113078. * return document.querySelectorAll(selector);
  113079. * }, '>_>');
  113080. *
  113081. * if (_.isError(elements)) {
  113082. * elements = [];
  113083. * }
  113084. */
  113085. var attempt = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(func, args) {
  113086. try {
  113087. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, undefined, args);
  113088. } catch (e) {
  113089. return Object(_isError_js__WEBPACK_IMPORTED_MODULE_2__["default"])(e) ? e : new Error(e);
  113090. }
  113091. });
  113092. /* harmony default export */ __webpack_exports__["default"] = (attempt);
  113093. /***/ }),
  113094. /***/ "./node_modules/lodash-es/before.js":
  113095. /*!******************************************!*\
  113096. !*** ./node_modules/lodash-es/before.js ***!
  113097. \******************************************/
  113098. /*! exports provided: default */
  113099. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113100. "use strict";
  113101. __webpack_require__.r(__webpack_exports__);
  113102. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  113103. /** Error message constants. */
  113104. var FUNC_ERROR_TEXT = 'Expected a function';
  113105. /**
  113106. * Creates a function that invokes `func`, with the `this` binding and arguments
  113107. * of the created function, while it's called less than `n` times. Subsequent
  113108. * calls to the created function return the result of the last `func` invocation.
  113109. *
  113110. * @static
  113111. * @memberOf _
  113112. * @since 3.0.0
  113113. * @category Function
  113114. * @param {number} n The number of calls at which `func` is no longer invoked.
  113115. * @param {Function} func The function to restrict.
  113116. * @returns {Function} Returns the new restricted function.
  113117. * @example
  113118. *
  113119. * jQuery(element).on('click', _.before(5, addContactToList));
  113120. * // => Allows adding up to 4 contacts to the list.
  113121. */
  113122. function before(n, func) {
  113123. var result;
  113124. if (typeof func != 'function') {
  113125. throw new TypeError(FUNC_ERROR_TEXT);
  113126. }
  113127. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n);
  113128. return function() {
  113129. if (--n > 0) {
  113130. result = func.apply(this, arguments);
  113131. }
  113132. if (n <= 1) {
  113133. func = undefined;
  113134. }
  113135. return result;
  113136. };
  113137. }
  113138. /* harmony default export */ __webpack_exports__["default"] = (before);
  113139. /***/ }),
  113140. /***/ "./node_modules/lodash-es/bind.js":
  113141. /*!****************************************!*\
  113142. !*** ./node_modules/lodash-es/bind.js ***!
  113143. \****************************************/
  113144. /*! exports provided: default */
  113145. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113146. "use strict";
  113147. __webpack_require__.r(__webpack_exports__);
  113148. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  113149. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  113150. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  113151. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  113152. /** Used to compose bitmasks for function metadata. */
  113153. var WRAP_BIND_FLAG = 1,
  113154. WRAP_PARTIAL_FLAG = 32;
  113155. /**
  113156. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  113157. * and `partials` prepended to the arguments it receives.
  113158. *
  113159. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  113160. * may be used as a placeholder for partially applied arguments.
  113161. *
  113162. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  113163. * property of bound functions.
  113164. *
  113165. * @static
  113166. * @memberOf _
  113167. * @since 0.1.0
  113168. * @category Function
  113169. * @param {Function} func The function to bind.
  113170. * @param {*} thisArg The `this` binding of `func`.
  113171. * @param {...*} [partials] The arguments to be partially applied.
  113172. * @returns {Function} Returns the new bound function.
  113173. * @example
  113174. *
  113175. * function greet(greeting, punctuation) {
  113176. * return greeting + ' ' + this.user + punctuation;
  113177. * }
  113178. *
  113179. * var object = { 'user': 'fred' };
  113180. *
  113181. * var bound = _.bind(greet, object, 'hi');
  113182. * bound('!');
  113183. * // => 'hi fred!'
  113184. *
  113185. * // Bound with placeholders.
  113186. * var bound = _.bind(greet, object, _, '!');
  113187. * bound('hi');
  113188. * // => 'hi fred!'
  113189. */
  113190. var bind = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(func, thisArg, partials) {
  113191. var bitmask = WRAP_BIND_FLAG;
  113192. if (partials.length) {
  113193. var holders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__["default"])(partials, Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(bind));
  113194. bitmask |= WRAP_PARTIAL_FLAG;
  113195. }
  113196. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, bitmask, thisArg, partials, holders);
  113197. });
  113198. // Assign default placeholders.
  113199. bind.placeholder = {};
  113200. /* harmony default export */ __webpack_exports__["default"] = (bind);
  113201. /***/ }),
  113202. /***/ "./node_modules/lodash-es/bindAll.js":
  113203. /*!*******************************************!*\
  113204. !*** ./node_modules/lodash-es/bindAll.js ***!
  113205. \*******************************************/
  113206. /*! exports provided: default */
  113207. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113208. "use strict";
  113209. __webpack_require__.r(__webpack_exports__);
  113210. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  113211. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  113212. /* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bind.js */ "./node_modules/lodash-es/bind.js");
  113213. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  113214. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  113215. /**
  113216. * Binds methods of an object to the object itself, overwriting the existing
  113217. * method.
  113218. *
  113219. * **Note:** This method doesn't set the "length" property of bound functions.
  113220. *
  113221. * @static
  113222. * @since 0.1.0
  113223. * @memberOf _
  113224. * @category Util
  113225. * @param {Object} object The object to bind and assign the bound methods to.
  113226. * @param {...(string|string[])} methodNames The object method names to bind.
  113227. * @returns {Object} Returns `object`.
  113228. * @example
  113229. *
  113230. * var view = {
  113231. * 'label': 'docs',
  113232. * 'click': function() {
  113233. * console.log('clicked ' + this.label);
  113234. * }
  113235. * };
  113236. *
  113237. * _.bindAll(view, ['click']);
  113238. * jQuery(element).on('click', view.click);
  113239. * // => Logs 'clicked docs' when clicked.
  113240. */
  113241. var bindAll = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(object, methodNames) {
  113242. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(methodNames, function(key) {
  113243. key = Object(_toKey_js__WEBPACK_IMPORTED_MODULE_4__["default"])(key);
  113244. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key, Object(_bind_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object[key], object));
  113245. });
  113246. return object;
  113247. });
  113248. /* harmony default export */ __webpack_exports__["default"] = (bindAll);
  113249. /***/ }),
  113250. /***/ "./node_modules/lodash-es/bindKey.js":
  113251. /*!*******************************************!*\
  113252. !*** ./node_modules/lodash-es/bindKey.js ***!
  113253. \*******************************************/
  113254. /*! exports provided: default */
  113255. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113256. "use strict";
  113257. __webpack_require__.r(__webpack_exports__);
  113258. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  113259. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  113260. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  113261. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  113262. /** Used to compose bitmasks for function metadata. */
  113263. var WRAP_BIND_FLAG = 1,
  113264. WRAP_BIND_KEY_FLAG = 2,
  113265. WRAP_PARTIAL_FLAG = 32;
  113266. /**
  113267. * Creates a function that invokes the method at `object[key]` with `partials`
  113268. * prepended to the arguments it receives.
  113269. *
  113270. * This method differs from `_.bind` by allowing bound functions to reference
  113271. * methods that may be redefined or don't yet exist. See
  113272. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  113273. * for more details.
  113274. *
  113275. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  113276. * builds, may be used as a placeholder for partially applied arguments.
  113277. *
  113278. * @static
  113279. * @memberOf _
  113280. * @since 0.10.0
  113281. * @category Function
  113282. * @param {Object} object The object to invoke the method on.
  113283. * @param {string} key The key of the method.
  113284. * @param {...*} [partials] The arguments to be partially applied.
  113285. * @returns {Function} Returns the new bound function.
  113286. * @example
  113287. *
  113288. * var object = {
  113289. * 'user': 'fred',
  113290. * 'greet': function(greeting, punctuation) {
  113291. * return greeting + ' ' + this.user + punctuation;
  113292. * }
  113293. * };
  113294. *
  113295. * var bound = _.bindKey(object, 'greet', 'hi');
  113296. * bound('!');
  113297. * // => 'hi fred!'
  113298. *
  113299. * object.greet = function(greeting, punctuation) {
  113300. * return greeting + 'ya ' + this.user + punctuation;
  113301. * };
  113302. *
  113303. * bound('!');
  113304. * // => 'hiya fred!'
  113305. *
  113306. * // Bound with placeholders.
  113307. * var bound = _.bindKey(object, 'greet', _, '!');
  113308. * bound('hi');
  113309. * // => 'hiya fred!'
  113310. */
  113311. var bindKey = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(object, key, partials) {
  113312. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  113313. if (partials.length) {
  113314. var holders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__["default"])(partials, Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(bindKey));
  113315. bitmask |= WRAP_PARTIAL_FLAG;
  113316. }
  113317. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(key, bitmask, object, partials, holders);
  113318. });
  113319. // Assign default placeholders.
  113320. bindKey.placeholder = {};
  113321. /* harmony default export */ __webpack_exports__["default"] = (bindKey);
  113322. /***/ }),
  113323. /***/ "./node_modules/lodash-es/camelCase.js":
  113324. /*!*********************************************!*\
  113325. !*** ./node_modules/lodash-es/camelCase.js ***!
  113326. \*********************************************/
  113327. /*! exports provided: default */
  113328. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113329. "use strict";
  113330. __webpack_require__.r(__webpack_exports__);
  113331. /* harmony import */ var _capitalize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./capitalize.js */ "./node_modules/lodash-es/capitalize.js");
  113332. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  113333. /**
  113334. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  113335. *
  113336. * @static
  113337. * @memberOf _
  113338. * @since 3.0.0
  113339. * @category String
  113340. * @param {string} [string=''] The string to convert.
  113341. * @returns {string} Returns the camel cased string.
  113342. * @example
  113343. *
  113344. * _.camelCase('Foo Bar');
  113345. * // => 'fooBar'
  113346. *
  113347. * _.camelCase('--foo-bar--');
  113348. * // => 'fooBar'
  113349. *
  113350. * _.camelCase('__FOO_BAR__');
  113351. * // => 'fooBar'
  113352. */
  113353. var camelCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, word, index) {
  113354. word = word.toLowerCase();
  113355. return result + (index ? Object(_capitalize_js__WEBPACK_IMPORTED_MODULE_0__["default"])(word) : word);
  113356. });
  113357. /* harmony default export */ __webpack_exports__["default"] = (camelCase);
  113358. /***/ }),
  113359. /***/ "./node_modules/lodash-es/capitalize.js":
  113360. /*!**********************************************!*\
  113361. !*** ./node_modules/lodash-es/capitalize.js ***!
  113362. \**********************************************/
  113363. /*! exports provided: default */
  113364. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113365. "use strict";
  113366. __webpack_require__.r(__webpack_exports__);
  113367. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  113368. /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
  113369. /**
  113370. * Converts the first character of `string` to upper case and the remaining
  113371. * to lower case.
  113372. *
  113373. * @static
  113374. * @memberOf _
  113375. * @since 3.0.0
  113376. * @category String
  113377. * @param {string} [string=''] The string to capitalize.
  113378. * @returns {string} Returns the capitalized string.
  113379. * @example
  113380. *
  113381. * _.capitalize('FRED');
  113382. * // => 'Fred'
  113383. */
  113384. function capitalize(string) {
  113385. return Object(_upperFirst_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string).toLowerCase());
  113386. }
  113387. /* harmony default export */ __webpack_exports__["default"] = (capitalize);
  113388. /***/ }),
  113389. /***/ "./node_modules/lodash-es/castArray.js":
  113390. /*!*********************************************!*\
  113391. !*** ./node_modules/lodash-es/castArray.js ***!
  113392. \*********************************************/
  113393. /*! exports provided: default */
  113394. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113395. "use strict";
  113396. __webpack_require__.r(__webpack_exports__);
  113397. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  113398. /**
  113399. * Casts `value` as an array if it's not one.
  113400. *
  113401. * @static
  113402. * @memberOf _
  113403. * @since 4.4.0
  113404. * @category Lang
  113405. * @param {*} value The value to inspect.
  113406. * @returns {Array} Returns the cast array.
  113407. * @example
  113408. *
  113409. * _.castArray(1);
  113410. * // => [1]
  113411. *
  113412. * _.castArray({ 'a': 1 });
  113413. * // => [{ 'a': 1 }]
  113414. *
  113415. * _.castArray('abc');
  113416. * // => ['abc']
  113417. *
  113418. * _.castArray(null);
  113419. * // => [null]
  113420. *
  113421. * _.castArray(undefined);
  113422. * // => [undefined]
  113423. *
  113424. * _.castArray();
  113425. * // => []
  113426. *
  113427. * var array = [1, 2, 3];
  113428. * console.log(_.castArray(array) === array);
  113429. * // => true
  113430. */
  113431. function castArray() {
  113432. if (!arguments.length) {
  113433. return [];
  113434. }
  113435. var value = arguments[0];
  113436. return Object(_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? value : [value];
  113437. }
  113438. /* harmony default export */ __webpack_exports__["default"] = (castArray);
  113439. /***/ }),
  113440. /***/ "./node_modules/lodash-es/ceil.js":
  113441. /*!****************************************!*\
  113442. !*** ./node_modules/lodash-es/ceil.js ***!
  113443. \****************************************/
  113444. /*! exports provided: default */
  113445. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113446. "use strict";
  113447. __webpack_require__.r(__webpack_exports__);
  113448. /* harmony import */ var _createRound_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRound.js */ "./node_modules/lodash-es/_createRound.js");
  113449. /**
  113450. * Computes `number` rounded up to `precision`.
  113451. *
  113452. * @static
  113453. * @memberOf _
  113454. * @since 3.10.0
  113455. * @category Math
  113456. * @param {number} number The number to round up.
  113457. * @param {number} [precision=0] The precision to round up to.
  113458. * @returns {number} Returns the rounded up number.
  113459. * @example
  113460. *
  113461. * _.ceil(4.006);
  113462. * // => 5
  113463. *
  113464. * _.ceil(6.004, 2);
  113465. * // => 6.01
  113466. *
  113467. * _.ceil(6040, -2);
  113468. * // => 6100
  113469. */
  113470. var ceil = Object(_createRound_js__WEBPACK_IMPORTED_MODULE_0__["default"])('ceil');
  113471. /* harmony default export */ __webpack_exports__["default"] = (ceil);
  113472. /***/ }),
  113473. /***/ "./node_modules/lodash-es/chain.js":
  113474. /*!*****************************************!*\
  113475. !*** ./node_modules/lodash-es/chain.js ***!
  113476. \*****************************************/
  113477. /*! exports provided: default */
  113478. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113479. "use strict";
  113480. __webpack_require__.r(__webpack_exports__);
  113481. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  113482. /**
  113483. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  113484. * chain sequences enabled. The result of such sequences must be unwrapped
  113485. * with `_#value`.
  113486. *
  113487. * @static
  113488. * @memberOf _
  113489. * @since 1.3.0
  113490. * @category Seq
  113491. * @param {*} value The value to wrap.
  113492. * @returns {Object} Returns the new `lodash` wrapper instance.
  113493. * @example
  113494. *
  113495. * var users = [
  113496. * { 'user': 'barney', 'age': 36 },
  113497. * { 'user': 'fred', 'age': 40 },
  113498. * { 'user': 'pebbles', 'age': 1 }
  113499. * ];
  113500. *
  113501. * var youngest = _
  113502. * .chain(users)
  113503. * .sortBy('age')
  113504. * .map(function(o) {
  113505. * return o.user + ' is ' + o.age;
  113506. * })
  113507. * .head()
  113508. * .value();
  113509. * // => 'pebbles is 1'
  113510. */
  113511. function chain(value) {
  113512. var result = Object(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  113513. result.__chain__ = true;
  113514. return result;
  113515. }
  113516. /* harmony default export */ __webpack_exports__["default"] = (chain);
  113517. /***/ }),
  113518. /***/ "./node_modules/lodash-es/chunk.js":
  113519. /*!*****************************************!*\
  113520. !*** ./node_modules/lodash-es/chunk.js ***!
  113521. \*****************************************/
  113522. /*! exports provided: default */
  113523. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113524. "use strict";
  113525. __webpack_require__.r(__webpack_exports__);
  113526. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  113527. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  113528. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  113529. /* Built-in method references for those with the same name as other `lodash` methods. */
  113530. var nativeCeil = Math.ceil,
  113531. nativeMax = Math.max;
  113532. /**
  113533. * Creates an array of elements split into groups the length of `size`.
  113534. * If `array` can't be split evenly, the final chunk will be the remaining
  113535. * elements.
  113536. *
  113537. * @static
  113538. * @memberOf _
  113539. * @since 3.0.0
  113540. * @category Array
  113541. * @param {Array} array The array to process.
  113542. * @param {number} [size=1] The length of each chunk
  113543. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  113544. * @returns {Array} Returns the new array of chunks.
  113545. * @example
  113546. *
  113547. * _.chunk(['a', 'b', 'c', 'd'], 2);
  113548. * // => [['a', 'b'], ['c', 'd']]
  113549. *
  113550. * _.chunk(['a', 'b', 'c', 'd'], 3);
  113551. * // => [['a', 'b', 'c'], ['d']]
  113552. */
  113553. function chunk(array, size, guard) {
  113554. if ((guard ? Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, size, guard) : size === undefined)) {
  113555. size = 1;
  113556. } else {
  113557. size = nativeMax(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(size), 0);
  113558. }
  113559. var length = array == null ? 0 : array.length;
  113560. if (!length || size < 1) {
  113561. return [];
  113562. }
  113563. var index = 0,
  113564. resIndex = 0,
  113565. result = Array(nativeCeil(length / size));
  113566. while (index < length) {
  113567. result[resIndex++] = Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, index, (index += size));
  113568. }
  113569. return result;
  113570. }
  113571. /* harmony default export */ __webpack_exports__["default"] = (chunk);
  113572. /***/ }),
  113573. /***/ "./node_modules/lodash-es/clamp.js":
  113574. /*!*****************************************!*\
  113575. !*** ./node_modules/lodash-es/clamp.js ***!
  113576. \*****************************************/
  113577. /*! exports provided: default */
  113578. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113579. "use strict";
  113580. __webpack_require__.r(__webpack_exports__);
  113581. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  113582. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  113583. /**
  113584. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  113585. *
  113586. * @static
  113587. * @memberOf _
  113588. * @since 4.0.0
  113589. * @category Number
  113590. * @param {number} number The number to clamp.
  113591. * @param {number} [lower] The lower bound.
  113592. * @param {number} upper The upper bound.
  113593. * @returns {number} Returns the clamped number.
  113594. * @example
  113595. *
  113596. * _.clamp(-10, -5, 5);
  113597. * // => -5
  113598. *
  113599. * _.clamp(10, -5, 5);
  113600. * // => 5
  113601. */
  113602. function clamp(number, lower, upper) {
  113603. if (upper === undefined) {
  113604. upper = lower;
  113605. lower = undefined;
  113606. }
  113607. if (upper !== undefined) {
  113608. upper = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_1__["default"])(upper);
  113609. upper = upper === upper ? upper : 0;
  113610. }
  113611. if (lower !== undefined) {
  113612. lower = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_1__["default"])(lower);
  113613. lower = lower === lower ? lower : 0;
  113614. }
  113615. return Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_1__["default"])(number), lower, upper);
  113616. }
  113617. /* harmony default export */ __webpack_exports__["default"] = (clamp);
  113618. /***/ }),
  113619. /***/ "./node_modules/lodash-es/clone.js":
  113620. /*!*****************************************!*\
  113621. !*** ./node_modules/lodash-es/clone.js ***!
  113622. \*****************************************/
  113623. /*! exports provided: default */
  113624. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113625. "use strict";
  113626. __webpack_require__.r(__webpack_exports__);
  113627. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  113628. /** Used to compose bitmasks for cloning. */
  113629. var CLONE_SYMBOLS_FLAG = 4;
  113630. /**
  113631. * Creates a shallow clone of `value`.
  113632. *
  113633. * **Note:** This method is loosely based on the
  113634. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  113635. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  113636. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  113637. * arrays. The own enumerable properties of `arguments` objects are cloned
  113638. * as plain objects. An empty object is returned for uncloneable values such
  113639. * as error objects, functions, DOM nodes, and WeakMaps.
  113640. *
  113641. * @static
  113642. * @memberOf _
  113643. * @since 0.1.0
  113644. * @category Lang
  113645. * @param {*} value The value to clone.
  113646. * @returns {*} Returns the cloned value.
  113647. * @see _.cloneDeep
  113648. * @example
  113649. *
  113650. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  113651. *
  113652. * var shallow = _.clone(objects);
  113653. * console.log(shallow[0] === objects[0]);
  113654. * // => true
  113655. */
  113656. function clone(value) {
  113657. return Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_SYMBOLS_FLAG);
  113658. }
  113659. /* harmony default export */ __webpack_exports__["default"] = (clone);
  113660. /***/ }),
  113661. /***/ "./node_modules/lodash-es/cloneDeep.js":
  113662. /*!*********************************************!*\
  113663. !*** ./node_modules/lodash-es/cloneDeep.js ***!
  113664. \*********************************************/
  113665. /*! exports provided: default */
  113666. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113667. "use strict";
  113668. __webpack_require__.r(__webpack_exports__);
  113669. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  113670. /** Used to compose bitmasks for cloning. */
  113671. var CLONE_DEEP_FLAG = 1,
  113672. CLONE_SYMBOLS_FLAG = 4;
  113673. /**
  113674. * This method is like `_.clone` except that it recursively clones `value`.
  113675. *
  113676. * @static
  113677. * @memberOf _
  113678. * @since 1.0.0
  113679. * @category Lang
  113680. * @param {*} value The value to recursively clone.
  113681. * @returns {*} Returns the deep cloned value.
  113682. * @see _.clone
  113683. * @example
  113684. *
  113685. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  113686. *
  113687. * var deep = _.cloneDeep(objects);
  113688. * console.log(deep[0] === objects[0]);
  113689. * // => false
  113690. */
  113691. function cloneDeep(value) {
  113692. return Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  113693. }
  113694. /* harmony default export */ __webpack_exports__["default"] = (cloneDeep);
  113695. /***/ }),
  113696. /***/ "./node_modules/lodash-es/cloneDeepWith.js":
  113697. /*!*************************************************!*\
  113698. !*** ./node_modules/lodash-es/cloneDeepWith.js ***!
  113699. \*************************************************/
  113700. /*! exports provided: default */
  113701. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113702. "use strict";
  113703. __webpack_require__.r(__webpack_exports__);
  113704. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  113705. /** Used to compose bitmasks for cloning. */
  113706. var CLONE_DEEP_FLAG = 1,
  113707. CLONE_SYMBOLS_FLAG = 4;
  113708. /**
  113709. * This method is like `_.cloneWith` except that it recursively clones `value`.
  113710. *
  113711. * @static
  113712. * @memberOf _
  113713. * @since 4.0.0
  113714. * @category Lang
  113715. * @param {*} value The value to recursively clone.
  113716. * @param {Function} [customizer] The function to customize cloning.
  113717. * @returns {*} Returns the deep cloned value.
  113718. * @see _.cloneWith
  113719. * @example
  113720. *
  113721. * function customizer(value) {
  113722. * if (_.isElement(value)) {
  113723. * return value.cloneNode(true);
  113724. * }
  113725. * }
  113726. *
  113727. * var el = _.cloneDeepWith(document.body, customizer);
  113728. *
  113729. * console.log(el === document.body);
  113730. * // => false
  113731. * console.log(el.nodeName);
  113732. * // => 'BODY'
  113733. * console.log(el.childNodes.length);
  113734. * // => 20
  113735. */
  113736. function cloneDeepWith(value, customizer) {
  113737. customizer = typeof customizer == 'function' ? customizer : undefined;
  113738. return Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  113739. }
  113740. /* harmony default export */ __webpack_exports__["default"] = (cloneDeepWith);
  113741. /***/ }),
  113742. /***/ "./node_modules/lodash-es/cloneWith.js":
  113743. /*!*********************************************!*\
  113744. !*** ./node_modules/lodash-es/cloneWith.js ***!
  113745. \*********************************************/
  113746. /*! exports provided: default */
  113747. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113748. "use strict";
  113749. __webpack_require__.r(__webpack_exports__);
  113750. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  113751. /** Used to compose bitmasks for cloning. */
  113752. var CLONE_SYMBOLS_FLAG = 4;
  113753. /**
  113754. * This method is like `_.clone` except that it accepts `customizer` which
  113755. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  113756. * cloning is handled by the method instead. The `customizer` is invoked with
  113757. * up to four arguments; (value [, index|key, object, stack]).
  113758. *
  113759. * @static
  113760. * @memberOf _
  113761. * @since 4.0.0
  113762. * @category Lang
  113763. * @param {*} value The value to clone.
  113764. * @param {Function} [customizer] The function to customize cloning.
  113765. * @returns {*} Returns the cloned value.
  113766. * @see _.cloneDeepWith
  113767. * @example
  113768. *
  113769. * function customizer(value) {
  113770. * if (_.isElement(value)) {
  113771. * return value.cloneNode(false);
  113772. * }
  113773. * }
  113774. *
  113775. * var el = _.cloneWith(document.body, customizer);
  113776. *
  113777. * console.log(el === document.body);
  113778. * // => false
  113779. * console.log(el.nodeName);
  113780. * // => 'BODY'
  113781. * console.log(el.childNodes.length);
  113782. * // => 0
  113783. */
  113784. function cloneWith(value, customizer) {
  113785. customizer = typeof customizer == 'function' ? customizer : undefined;
  113786. return Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_SYMBOLS_FLAG, customizer);
  113787. }
  113788. /* harmony default export */ __webpack_exports__["default"] = (cloneWith);
  113789. /***/ }),
  113790. /***/ "./node_modules/lodash-es/collection.default.js":
  113791. /*!******************************************************!*\
  113792. !*** ./node_modules/lodash-es/collection.default.js ***!
  113793. \******************************************************/
  113794. /*! exports provided: default */
  113795. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113796. "use strict";
  113797. __webpack_require__.r(__webpack_exports__);
  113798. /* harmony import */ var _countBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./countBy.js */ "./node_modules/lodash-es/countBy.js");
  113799. /* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./each.js */ "./node_modules/lodash-es/each.js");
  113800. /* harmony import */ var _eachRight_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./eachRight.js */ "./node_modules/lodash-es/eachRight.js");
  113801. /* harmony import */ var _every_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./every.js */ "./node_modules/lodash-es/every.js");
  113802. /* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./filter.js */ "./node_modules/lodash-es/filter.js");
  113803. /* harmony import */ var _find_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./find.js */ "./node_modules/lodash-es/find.js");
  113804. /* harmony import */ var _findLast_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./findLast.js */ "./node_modules/lodash-es/findLast.js");
  113805. /* harmony import */ var _flatMap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flatMap.js */ "./node_modules/lodash-es/flatMap.js");
  113806. /* harmony import */ var _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./flatMapDeep.js */ "./node_modules/lodash-es/flatMapDeep.js");
  113807. /* harmony import */ var _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./flatMapDepth.js */ "./node_modules/lodash-es/flatMapDepth.js");
  113808. /* harmony import */ var _forEach_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./forEach.js */ "./node_modules/lodash-es/forEach.js");
  113809. /* harmony import */ var _forEachRight_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./forEachRight.js */ "./node_modules/lodash-es/forEachRight.js");
  113810. /* harmony import */ var _groupBy_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./groupBy.js */ "./node_modules/lodash-es/groupBy.js");
  113811. /* harmony import */ var _includes_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./includes.js */ "./node_modules/lodash-es/includes.js");
  113812. /* harmony import */ var _invokeMap_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./invokeMap.js */ "./node_modules/lodash-es/invokeMap.js");
  113813. /* harmony import */ var _keyBy_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./keyBy.js */ "./node_modules/lodash-es/keyBy.js");
  113814. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  113815. /* harmony import */ var _orderBy_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./orderBy.js */ "./node_modules/lodash-es/orderBy.js");
  113816. /* harmony import */ var _partition_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./partition.js */ "./node_modules/lodash-es/partition.js");
  113817. /* harmony import */ var _reduce_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./reduce.js */ "./node_modules/lodash-es/reduce.js");
  113818. /* harmony import */ var _reduceRight_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./reduceRight.js */ "./node_modules/lodash-es/reduceRight.js");
  113819. /* harmony import */ var _reject_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./reject.js */ "./node_modules/lodash-es/reject.js");
  113820. /* harmony import */ var _sample_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./sample.js */ "./node_modules/lodash-es/sample.js");
  113821. /* harmony import */ var _sampleSize_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./sampleSize.js */ "./node_modules/lodash-es/sampleSize.js");
  113822. /* harmony import */ var _shuffle_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./shuffle.js */ "./node_modules/lodash-es/shuffle.js");
  113823. /* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./size.js */ "./node_modules/lodash-es/size.js");
  113824. /* harmony import */ var _some_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./some.js */ "./node_modules/lodash-es/some.js");
  113825. /* harmony import */ var _sortBy_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./sortBy.js */ "./node_modules/lodash-es/sortBy.js");
  113826. /* harmony default export */ __webpack_exports__["default"] = ({
  113827. countBy: _countBy_js__WEBPACK_IMPORTED_MODULE_0__["default"], each: _each_js__WEBPACK_IMPORTED_MODULE_1__["default"], eachRight: _eachRight_js__WEBPACK_IMPORTED_MODULE_2__["default"], every: _every_js__WEBPACK_IMPORTED_MODULE_3__["default"], filter: _filter_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  113828. find: _find_js__WEBPACK_IMPORTED_MODULE_5__["default"], findLast: _findLast_js__WEBPACK_IMPORTED_MODULE_6__["default"], flatMap: _flatMap_js__WEBPACK_IMPORTED_MODULE_7__["default"], flatMapDeep: _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_8__["default"], flatMapDepth: _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  113829. forEach: _forEach_js__WEBPACK_IMPORTED_MODULE_10__["default"], forEachRight: _forEachRight_js__WEBPACK_IMPORTED_MODULE_11__["default"], groupBy: _groupBy_js__WEBPACK_IMPORTED_MODULE_12__["default"], includes: _includes_js__WEBPACK_IMPORTED_MODULE_13__["default"], invokeMap: _invokeMap_js__WEBPACK_IMPORTED_MODULE_14__["default"],
  113830. keyBy: _keyBy_js__WEBPACK_IMPORTED_MODULE_15__["default"], map: _map_js__WEBPACK_IMPORTED_MODULE_16__["default"], orderBy: _orderBy_js__WEBPACK_IMPORTED_MODULE_17__["default"], partition: _partition_js__WEBPACK_IMPORTED_MODULE_18__["default"], reduce: _reduce_js__WEBPACK_IMPORTED_MODULE_19__["default"],
  113831. reduceRight: _reduceRight_js__WEBPACK_IMPORTED_MODULE_20__["default"], reject: _reject_js__WEBPACK_IMPORTED_MODULE_21__["default"], sample: _sample_js__WEBPACK_IMPORTED_MODULE_22__["default"], sampleSize: _sampleSize_js__WEBPACK_IMPORTED_MODULE_23__["default"], shuffle: _shuffle_js__WEBPACK_IMPORTED_MODULE_24__["default"],
  113832. size: _size_js__WEBPACK_IMPORTED_MODULE_25__["default"], some: _some_js__WEBPACK_IMPORTED_MODULE_26__["default"], sortBy: _sortBy_js__WEBPACK_IMPORTED_MODULE_27__["default"]
  113833. });
  113834. /***/ }),
  113835. /***/ "./node_modules/lodash-es/collection.js":
  113836. /*!**********************************************!*\
  113837. !*** ./node_modules/lodash-es/collection.js ***!
  113838. \**********************************************/
  113839. /*! exports provided: countBy, each, eachRight, every, filter, find, findLast, flatMap, flatMapDeep, flatMapDepth, forEach, forEachRight, groupBy, includes, invokeMap, keyBy, map, orderBy, partition, reduce, reduceRight, reject, sample, sampleSize, shuffle, size, some, sortBy, default */
  113840. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113841. "use strict";
  113842. __webpack_require__.r(__webpack_exports__);
  113843. /* harmony import */ var _countBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./countBy.js */ "./node_modules/lodash-es/countBy.js");
  113844. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return _countBy_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  113845. /* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./each.js */ "./node_modules/lodash-es/each.js");
  113846. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "each", function() { return _each_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  113847. /* harmony import */ var _eachRight_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./eachRight.js */ "./node_modules/lodash-es/eachRight.js");
  113848. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eachRight", function() { return _eachRight_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  113849. /* harmony import */ var _every_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./every.js */ "./node_modules/lodash-es/every.js");
  113850. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "every", function() { return _every_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  113851. /* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./filter.js */ "./node_modules/lodash-es/filter.js");
  113852. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return _filter_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  113853. /* harmony import */ var _find_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./find.js */ "./node_modules/lodash-es/find.js");
  113854. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "find", function() { return _find_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  113855. /* harmony import */ var _findLast_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./findLast.js */ "./node_modules/lodash-es/findLast.js");
  113856. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLast", function() { return _findLast_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  113857. /* harmony import */ var _flatMap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flatMap.js */ "./node_modules/lodash-es/flatMap.js");
  113858. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return _flatMap_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  113859. /* harmony import */ var _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./flatMapDeep.js */ "./node_modules/lodash-es/flatMapDeep.js");
  113860. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMapDeep", function() { return _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  113861. /* harmony import */ var _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./flatMapDepth.js */ "./node_modules/lodash-es/flatMapDepth.js");
  113862. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMapDepth", function() { return _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  113863. /* harmony import */ var _forEach_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./forEach.js */ "./node_modules/lodash-es/forEach.js");
  113864. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return _forEach_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  113865. /* harmony import */ var _forEachRight_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./forEachRight.js */ "./node_modules/lodash-es/forEachRight.js");
  113866. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEachRight", function() { return _forEachRight_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  113867. /* harmony import */ var _groupBy_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./groupBy.js */ "./node_modules/lodash-es/groupBy.js");
  113868. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _groupBy_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  113869. /* harmony import */ var _includes_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./includes.js */ "./node_modules/lodash-es/includes.js");
  113870. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return _includes_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  113871. /* harmony import */ var _invokeMap_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./invokeMap.js */ "./node_modules/lodash-es/invokeMap.js");
  113872. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invokeMap", function() { return _invokeMap_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  113873. /* harmony import */ var _keyBy_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./keyBy.js */ "./node_modules/lodash-es/keyBy.js");
  113874. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keyBy", function() { return _keyBy_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  113875. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  113876. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _map_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  113877. /* harmony import */ var _orderBy_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./orderBy.js */ "./node_modules/lodash-es/orderBy.js");
  113878. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "orderBy", function() { return _orderBy_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  113879. /* harmony import */ var _partition_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./partition.js */ "./node_modules/lodash-es/partition.js");
  113880. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _partition_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  113881. /* harmony import */ var _reduce_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./reduce.js */ "./node_modules/lodash-es/reduce.js");
  113882. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return _reduce_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  113883. /* harmony import */ var _reduceRight_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./reduceRight.js */ "./node_modules/lodash-es/reduceRight.js");
  113884. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return _reduceRight_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  113885. /* harmony import */ var _reject_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./reject.js */ "./node_modules/lodash-es/reject.js");
  113886. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return _reject_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  113887. /* harmony import */ var _sample_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./sample.js */ "./node_modules/lodash-es/sample.js");
  113888. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return _sample_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  113889. /* harmony import */ var _sampleSize_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./sampleSize.js */ "./node_modules/lodash-es/sampleSize.js");
  113890. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sampleSize", function() { return _sampleSize_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  113891. /* harmony import */ var _shuffle_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./shuffle.js */ "./node_modules/lodash-es/shuffle.js");
  113892. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return _shuffle_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  113893. /* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./size.js */ "./node_modules/lodash-es/size.js");
  113894. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "size", function() { return _size_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  113895. /* harmony import */ var _some_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./some.js */ "./node_modules/lodash-es/some.js");
  113896. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "some", function() { return _some_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  113897. /* harmony import */ var _sortBy_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./sortBy.js */ "./node_modules/lodash-es/sortBy.js");
  113898. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return _sortBy_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  113899. /* harmony import */ var _collection_default_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./collection.default.js */ "./node_modules/lodash-es/collection.default.js");
  113900. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _collection_default_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  113901. /***/ }),
  113902. /***/ "./node_modules/lodash-es/commit.js":
  113903. /*!******************************************!*\
  113904. !*** ./node_modules/lodash-es/commit.js ***!
  113905. \******************************************/
  113906. /*! exports provided: default */
  113907. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113908. "use strict";
  113909. __webpack_require__.r(__webpack_exports__);
  113910. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  113911. /**
  113912. * Executes the chain sequence and returns the wrapped result.
  113913. *
  113914. * @name commit
  113915. * @memberOf _
  113916. * @since 3.2.0
  113917. * @category Seq
  113918. * @returns {Object} Returns the new `lodash` wrapper instance.
  113919. * @example
  113920. *
  113921. * var array = [1, 2];
  113922. * var wrapped = _(array).push(3);
  113923. *
  113924. * console.log(array);
  113925. * // => [1, 2]
  113926. *
  113927. * wrapped = wrapped.commit();
  113928. * console.log(array);
  113929. * // => [1, 2, 3]
  113930. *
  113931. * wrapped.last();
  113932. * // => 3
  113933. *
  113934. * console.log(array);
  113935. * // => [1, 2, 3]
  113936. */
  113937. function wrapperCommit() {
  113938. return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"](this.value(), this.__chain__);
  113939. }
  113940. /* harmony default export */ __webpack_exports__["default"] = (wrapperCommit);
  113941. /***/ }),
  113942. /***/ "./node_modules/lodash-es/compact.js":
  113943. /*!*******************************************!*\
  113944. !*** ./node_modules/lodash-es/compact.js ***!
  113945. \*******************************************/
  113946. /*! exports provided: default */
  113947. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113948. "use strict";
  113949. __webpack_require__.r(__webpack_exports__);
  113950. /**
  113951. * Creates an array with all falsey values removed. The values `false`, `null`,
  113952. * `0`, `""`, `undefined`, and `NaN` are falsey.
  113953. *
  113954. * @static
  113955. * @memberOf _
  113956. * @since 0.1.0
  113957. * @category Array
  113958. * @param {Array} array The array to compact.
  113959. * @returns {Array} Returns the new array of filtered values.
  113960. * @example
  113961. *
  113962. * _.compact([0, 1, false, 2, '', 3]);
  113963. * // => [1, 2, 3]
  113964. */
  113965. function compact(array) {
  113966. var index = -1,
  113967. length = array == null ? 0 : array.length,
  113968. resIndex = 0,
  113969. result = [];
  113970. while (++index < length) {
  113971. var value = array[index];
  113972. if (value) {
  113973. result[resIndex++] = value;
  113974. }
  113975. }
  113976. return result;
  113977. }
  113978. /* harmony default export */ __webpack_exports__["default"] = (compact);
  113979. /***/ }),
  113980. /***/ "./node_modules/lodash-es/concat.js":
  113981. /*!******************************************!*\
  113982. !*** ./node_modules/lodash-es/concat.js ***!
  113983. \******************************************/
  113984. /*! exports provided: default */
  113985. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113986. "use strict";
  113987. __webpack_require__.r(__webpack_exports__);
  113988. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  113989. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  113990. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  113991. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  113992. /**
  113993. * Creates a new array concatenating `array` with any additional arrays
  113994. * and/or values.
  113995. *
  113996. * @static
  113997. * @memberOf _
  113998. * @since 4.0.0
  113999. * @category Array
  114000. * @param {Array} array The array to concatenate.
  114001. * @param {...*} [values] The values to concatenate.
  114002. * @returns {Array} Returns the new concatenated array.
  114003. * @example
  114004. *
  114005. * var array = [1];
  114006. * var other = _.concat(array, 2, [3], [[4]]);
  114007. *
  114008. * console.log(other);
  114009. * // => [1, 2, 3, [4]]
  114010. *
  114011. * console.log(array);
  114012. * // => [1]
  114013. */
  114014. function concat() {
  114015. var length = arguments.length;
  114016. if (!length) {
  114017. return [];
  114018. }
  114019. var args = Array(length - 1),
  114020. array = arguments[0],
  114021. index = length;
  114022. while (index--) {
  114023. args[index - 1] = arguments[index];
  114024. }
  114025. return Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(array) ? Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array) : [array], Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(args, 1));
  114026. }
  114027. /* harmony default export */ __webpack_exports__["default"] = (concat);
  114028. /***/ }),
  114029. /***/ "./node_modules/lodash-es/cond.js":
  114030. /*!****************************************!*\
  114031. !*** ./node_modules/lodash-es/cond.js ***!
  114032. \****************************************/
  114033. /*! exports provided: default */
  114034. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114035. "use strict";
  114036. __webpack_require__.r(__webpack_exports__);
  114037. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  114038. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  114039. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  114040. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  114041. /** Error message constants. */
  114042. var FUNC_ERROR_TEXT = 'Expected a function';
  114043. /**
  114044. * Creates a function that iterates over `pairs` and invokes the corresponding
  114045. * function of the first predicate to return truthy. The predicate-function
  114046. * pairs are invoked with the `this` binding and arguments of the created
  114047. * function.
  114048. *
  114049. * @static
  114050. * @memberOf _
  114051. * @since 4.0.0
  114052. * @category Util
  114053. * @param {Array} pairs The predicate-function pairs.
  114054. * @returns {Function} Returns the new composite function.
  114055. * @example
  114056. *
  114057. * var func = _.cond([
  114058. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  114059. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  114060. * [_.stubTrue, _.constant('no match')]
  114061. * ]);
  114062. *
  114063. * func({ 'a': 1, 'b': 2 });
  114064. * // => 'matches A'
  114065. *
  114066. * func({ 'a': 0, 'b': 1 });
  114067. * // => 'matches B'
  114068. *
  114069. * func({ 'a': '1', 'b': '2' });
  114070. * // => 'no match'
  114071. */
  114072. function cond(pairs) {
  114073. var length = pairs == null ? 0 : pairs.length,
  114074. toIteratee = _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  114075. pairs = !length ? [] : Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(pairs, function(pair) {
  114076. if (typeof pair[1] != 'function') {
  114077. throw new TypeError(FUNC_ERROR_TEXT);
  114078. }
  114079. return [toIteratee(pair[0]), pair[1]];
  114080. });
  114081. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(args) {
  114082. var index = -1;
  114083. while (++index < length) {
  114084. var pair = pairs[index];
  114085. if (Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(pair[0], this, args)) {
  114086. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(pair[1], this, args);
  114087. }
  114088. }
  114089. });
  114090. }
  114091. /* harmony default export */ __webpack_exports__["default"] = (cond);
  114092. /***/ }),
  114093. /***/ "./node_modules/lodash-es/conforms.js":
  114094. /*!********************************************!*\
  114095. !*** ./node_modules/lodash-es/conforms.js ***!
  114096. \********************************************/
  114097. /*! exports provided: default */
  114098. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114099. "use strict";
  114100. __webpack_require__.r(__webpack_exports__);
  114101. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  114102. /* harmony import */ var _baseConforms_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseConforms.js */ "./node_modules/lodash-es/_baseConforms.js");
  114103. /** Used to compose bitmasks for cloning. */
  114104. var CLONE_DEEP_FLAG = 1;
  114105. /**
  114106. * Creates a function that invokes the predicate properties of `source` with
  114107. * the corresponding property values of a given object, returning `true` if
  114108. * all predicates return truthy, else `false`.
  114109. *
  114110. * **Note:** The created function is equivalent to `_.conformsTo` with
  114111. * `source` partially applied.
  114112. *
  114113. * @static
  114114. * @memberOf _
  114115. * @since 4.0.0
  114116. * @category Util
  114117. * @param {Object} source The object of property predicates to conform to.
  114118. * @returns {Function} Returns the new spec function.
  114119. * @example
  114120. *
  114121. * var objects = [
  114122. * { 'a': 2, 'b': 1 },
  114123. * { 'a': 1, 'b': 2 }
  114124. * ];
  114125. *
  114126. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  114127. * // => [{ 'a': 1, 'b': 2 }]
  114128. */
  114129. function conforms(source) {
  114130. return Object(_baseConforms_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, CLONE_DEEP_FLAG));
  114131. }
  114132. /* harmony default export */ __webpack_exports__["default"] = (conforms);
  114133. /***/ }),
  114134. /***/ "./node_modules/lodash-es/conformsTo.js":
  114135. /*!**********************************************!*\
  114136. !*** ./node_modules/lodash-es/conformsTo.js ***!
  114137. \**********************************************/
  114138. /*! exports provided: default */
  114139. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114140. "use strict";
  114141. __webpack_require__.r(__webpack_exports__);
  114142. /* harmony import */ var _baseConformsTo_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseConformsTo.js */ "./node_modules/lodash-es/_baseConformsTo.js");
  114143. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  114144. /**
  114145. * Checks if `object` conforms to `source` by invoking the predicate
  114146. * properties of `source` with the corresponding property values of `object`.
  114147. *
  114148. * **Note:** This method is equivalent to `_.conforms` when `source` is
  114149. * partially applied.
  114150. *
  114151. * @static
  114152. * @memberOf _
  114153. * @since 4.14.0
  114154. * @category Lang
  114155. * @param {Object} object The object to inspect.
  114156. * @param {Object} source The object of property predicates to conform to.
  114157. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  114158. * @example
  114159. *
  114160. * var object = { 'a': 1, 'b': 2 };
  114161. *
  114162. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  114163. * // => true
  114164. *
  114165. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  114166. * // => false
  114167. */
  114168. function conformsTo(object, source) {
  114169. return source == null || Object(_baseConformsTo_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source));
  114170. }
  114171. /* harmony default export */ __webpack_exports__["default"] = (conformsTo);
  114172. /***/ }),
  114173. /***/ "./node_modules/lodash-es/constant.js":
  114174. /*!********************************************!*\
  114175. !*** ./node_modules/lodash-es/constant.js ***!
  114176. \********************************************/
  114177. /*! exports provided: default */
  114178. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114179. "use strict";
  114180. __webpack_require__.r(__webpack_exports__);
  114181. /**
  114182. * Creates a function that returns `value`.
  114183. *
  114184. * @static
  114185. * @memberOf _
  114186. * @since 2.4.0
  114187. * @category Util
  114188. * @param {*} value The value to return from the new function.
  114189. * @returns {Function} Returns the new constant function.
  114190. * @example
  114191. *
  114192. * var objects = _.times(2, _.constant({ 'a': 1 }));
  114193. *
  114194. * console.log(objects);
  114195. * // => [{ 'a': 1 }, { 'a': 1 }]
  114196. *
  114197. * console.log(objects[0] === objects[1]);
  114198. * // => true
  114199. */
  114200. function constant(value) {
  114201. return function() {
  114202. return value;
  114203. };
  114204. }
  114205. /* harmony default export */ __webpack_exports__["default"] = (constant);
  114206. /***/ }),
  114207. /***/ "./node_modules/lodash-es/countBy.js":
  114208. /*!*******************************************!*\
  114209. !*** ./node_modules/lodash-es/countBy.js ***!
  114210. \*******************************************/
  114211. /*! exports provided: default */
  114212. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114213. "use strict";
  114214. __webpack_require__.r(__webpack_exports__);
  114215. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  114216. /* harmony import */ var _createAggregator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAggregator.js */ "./node_modules/lodash-es/_createAggregator.js");
  114217. /** Used for built-in method references. */
  114218. var objectProto = Object.prototype;
  114219. /** Used to check objects for own properties. */
  114220. var hasOwnProperty = objectProto.hasOwnProperty;
  114221. /**
  114222. * Creates an object composed of keys generated from the results of running
  114223. * each element of `collection` thru `iteratee`. The corresponding value of
  114224. * each key is the number of times the key was returned by `iteratee`. The
  114225. * iteratee is invoked with one argument: (value).
  114226. *
  114227. * @static
  114228. * @memberOf _
  114229. * @since 0.5.0
  114230. * @category Collection
  114231. * @param {Array|Object} collection The collection to iterate over.
  114232. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  114233. * @returns {Object} Returns the composed aggregate object.
  114234. * @example
  114235. *
  114236. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  114237. * // => { '4': 1, '6': 2 }
  114238. *
  114239. * // The `_.property` iteratee shorthand.
  114240. * _.countBy(['one', 'two', 'three'], 'length');
  114241. * // => { '3': 2, '5': 1 }
  114242. */
  114243. var countBy = Object(_createAggregator_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
  114244. if (hasOwnProperty.call(result, key)) {
  114245. ++result[key];
  114246. } else {
  114247. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, key, 1);
  114248. }
  114249. });
  114250. /* harmony default export */ __webpack_exports__["default"] = (countBy);
  114251. /***/ }),
  114252. /***/ "./node_modules/lodash-es/create.js":
  114253. /*!******************************************!*\
  114254. !*** ./node_modules/lodash-es/create.js ***!
  114255. \******************************************/
  114256. /*! exports provided: default */
  114257. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114258. "use strict";
  114259. __webpack_require__.r(__webpack_exports__);
  114260. /* harmony import */ var _baseAssign_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssign.js */ "./node_modules/lodash-es/_baseAssign.js");
  114261. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  114262. /**
  114263. * Creates an object that inherits from the `prototype` object. If a
  114264. * `properties` object is given, its own enumerable string keyed properties
  114265. * are assigned to the created object.
  114266. *
  114267. * @static
  114268. * @memberOf _
  114269. * @since 2.3.0
  114270. * @category Object
  114271. * @param {Object} prototype The object to inherit from.
  114272. * @param {Object} [properties] The properties to assign to the object.
  114273. * @returns {Object} Returns the new object.
  114274. * @example
  114275. *
  114276. * function Shape() {
  114277. * this.x = 0;
  114278. * this.y = 0;
  114279. * }
  114280. *
  114281. * function Circle() {
  114282. * Shape.call(this);
  114283. * }
  114284. *
  114285. * Circle.prototype = _.create(Shape.prototype, {
  114286. * 'constructor': Circle
  114287. * });
  114288. *
  114289. * var circle = new Circle;
  114290. * circle instanceof Circle;
  114291. * // => true
  114292. *
  114293. * circle instanceof Shape;
  114294. * // => true
  114295. */
  114296. function create(prototype, properties) {
  114297. var result = Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_1__["default"])(prototype);
  114298. return properties == null ? result : Object(_baseAssign_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, properties);
  114299. }
  114300. /* harmony default export */ __webpack_exports__["default"] = (create);
  114301. /***/ }),
  114302. /***/ "./node_modules/lodash-es/curry.js":
  114303. /*!*****************************************!*\
  114304. !*** ./node_modules/lodash-es/curry.js ***!
  114305. \*****************************************/
  114306. /*! exports provided: default */
  114307. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114308. "use strict";
  114309. __webpack_require__.r(__webpack_exports__);
  114310. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  114311. /** Used to compose bitmasks for function metadata. */
  114312. var WRAP_CURRY_FLAG = 8;
  114313. /**
  114314. * Creates a function that accepts arguments of `func` and either invokes
  114315. * `func` returning its result, if at least `arity` number of arguments have
  114316. * been provided, or returns a function that accepts the remaining `func`
  114317. * arguments, and so on. The arity of `func` may be specified if `func.length`
  114318. * is not sufficient.
  114319. *
  114320. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  114321. * may be used as a placeholder for provided arguments.
  114322. *
  114323. * **Note:** This method doesn't set the "length" property of curried functions.
  114324. *
  114325. * @static
  114326. * @memberOf _
  114327. * @since 2.0.0
  114328. * @category Function
  114329. * @param {Function} func The function to curry.
  114330. * @param {number} [arity=func.length] The arity of `func`.
  114331. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  114332. * @returns {Function} Returns the new curried function.
  114333. * @example
  114334. *
  114335. * var abc = function(a, b, c) {
  114336. * return [a, b, c];
  114337. * };
  114338. *
  114339. * var curried = _.curry(abc);
  114340. *
  114341. * curried(1)(2)(3);
  114342. * // => [1, 2, 3]
  114343. *
  114344. * curried(1, 2)(3);
  114345. * // => [1, 2, 3]
  114346. *
  114347. * curried(1, 2, 3);
  114348. * // => [1, 2, 3]
  114349. *
  114350. * // Curried with placeholders.
  114351. * curried(1)(_, 3)(2);
  114352. * // => [1, 2, 3]
  114353. */
  114354. function curry(func, arity, guard) {
  114355. arity = guard ? undefined : arity;
  114356. var result = Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  114357. result.placeholder = curry.placeholder;
  114358. return result;
  114359. }
  114360. // Assign default placeholders.
  114361. curry.placeholder = {};
  114362. /* harmony default export */ __webpack_exports__["default"] = (curry);
  114363. /***/ }),
  114364. /***/ "./node_modules/lodash-es/curryRight.js":
  114365. /*!**********************************************!*\
  114366. !*** ./node_modules/lodash-es/curryRight.js ***!
  114367. \**********************************************/
  114368. /*! exports provided: default */
  114369. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114370. "use strict";
  114371. __webpack_require__.r(__webpack_exports__);
  114372. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  114373. /** Used to compose bitmasks for function metadata. */
  114374. var WRAP_CURRY_RIGHT_FLAG = 16;
  114375. /**
  114376. * This method is like `_.curry` except that arguments are applied to `func`
  114377. * in the manner of `_.partialRight` instead of `_.partial`.
  114378. *
  114379. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  114380. * builds, may be used as a placeholder for provided arguments.
  114381. *
  114382. * **Note:** This method doesn't set the "length" property of curried functions.
  114383. *
  114384. * @static
  114385. * @memberOf _
  114386. * @since 3.0.0
  114387. * @category Function
  114388. * @param {Function} func The function to curry.
  114389. * @param {number} [arity=func.length] The arity of `func`.
  114390. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  114391. * @returns {Function} Returns the new curried function.
  114392. * @example
  114393. *
  114394. * var abc = function(a, b, c) {
  114395. * return [a, b, c];
  114396. * };
  114397. *
  114398. * var curried = _.curryRight(abc);
  114399. *
  114400. * curried(3)(2)(1);
  114401. * // => [1, 2, 3]
  114402. *
  114403. * curried(2, 3)(1);
  114404. * // => [1, 2, 3]
  114405. *
  114406. * curried(1, 2, 3);
  114407. * // => [1, 2, 3]
  114408. *
  114409. * // Curried with placeholders.
  114410. * curried(3)(1, _)(2);
  114411. * // => [1, 2, 3]
  114412. */
  114413. function curryRight(func, arity, guard) {
  114414. arity = guard ? undefined : arity;
  114415. var result = Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  114416. result.placeholder = curryRight.placeholder;
  114417. return result;
  114418. }
  114419. // Assign default placeholders.
  114420. curryRight.placeholder = {};
  114421. /* harmony default export */ __webpack_exports__["default"] = (curryRight);
  114422. /***/ }),
  114423. /***/ "./node_modules/lodash-es/date.default.js":
  114424. /*!************************************************!*\
  114425. !*** ./node_modules/lodash-es/date.default.js ***!
  114426. \************************************************/
  114427. /*! exports provided: default */
  114428. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114429. "use strict";
  114430. __webpack_require__.r(__webpack_exports__);
  114431. /* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./now.js */ "./node_modules/lodash-es/now.js");
  114432. /* harmony default export */ __webpack_exports__["default"] = ({
  114433. now: _now_js__WEBPACK_IMPORTED_MODULE_0__["default"]
  114434. });
  114435. /***/ }),
  114436. /***/ "./node_modules/lodash-es/date.js":
  114437. /*!****************************************!*\
  114438. !*** ./node_modules/lodash-es/date.js ***!
  114439. \****************************************/
  114440. /*! exports provided: now, default */
  114441. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114442. "use strict";
  114443. __webpack_require__.r(__webpack_exports__);
  114444. /* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./now.js */ "./node_modules/lodash-es/now.js");
  114445. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "now", function() { return _now_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  114446. /* harmony import */ var _date_default_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./date.default.js */ "./node_modules/lodash-es/date.default.js");
  114447. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _date_default_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  114448. /***/ }),
  114449. /***/ "./node_modules/lodash-es/debounce.js":
  114450. /*!********************************************!*\
  114451. !*** ./node_modules/lodash-es/debounce.js ***!
  114452. \********************************************/
  114453. /*! exports provided: default */
  114454. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114455. "use strict";
  114456. __webpack_require__.r(__webpack_exports__);
  114457. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  114458. /* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./now.js */ "./node_modules/lodash-es/now.js");
  114459. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  114460. /** Error message constants. */
  114461. var FUNC_ERROR_TEXT = 'Expected a function';
  114462. /* Built-in method references for those with the same name as other `lodash` methods. */
  114463. var nativeMax = Math.max,
  114464. nativeMin = Math.min;
  114465. /**
  114466. * Creates a debounced function that delays invoking `func` until after `wait`
  114467. * milliseconds have elapsed since the last time the debounced function was
  114468. * invoked. The debounced function comes with a `cancel` method to cancel
  114469. * delayed `func` invocations and a `flush` method to immediately invoke them.
  114470. * Provide `options` to indicate whether `func` should be invoked on the
  114471. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  114472. * with the last arguments provided to the debounced function. Subsequent
  114473. * calls to the debounced function return the result of the last `func`
  114474. * invocation.
  114475. *
  114476. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  114477. * invoked on the trailing edge of the timeout only if the debounced function
  114478. * is invoked more than once during the `wait` timeout.
  114479. *
  114480. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  114481. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  114482. *
  114483. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  114484. * for details over the differences between `_.debounce` and `_.throttle`.
  114485. *
  114486. * @static
  114487. * @memberOf _
  114488. * @since 0.1.0
  114489. * @category Function
  114490. * @param {Function} func The function to debounce.
  114491. * @param {number} [wait=0] The number of milliseconds to delay.
  114492. * @param {Object} [options={}] The options object.
  114493. * @param {boolean} [options.leading=false]
  114494. * Specify invoking on the leading edge of the timeout.
  114495. * @param {number} [options.maxWait]
  114496. * The maximum time `func` is allowed to be delayed before it's invoked.
  114497. * @param {boolean} [options.trailing=true]
  114498. * Specify invoking on the trailing edge of the timeout.
  114499. * @returns {Function} Returns the new debounced function.
  114500. * @example
  114501. *
  114502. * // Avoid costly calculations while the window size is in flux.
  114503. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  114504. *
  114505. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  114506. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  114507. * 'leading': true,
  114508. * 'trailing': false
  114509. * }));
  114510. *
  114511. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  114512. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  114513. * var source = new EventSource('/stream');
  114514. * jQuery(source).on('message', debounced);
  114515. *
  114516. * // Cancel the trailing debounced invocation.
  114517. * jQuery(window).on('popstate', debounced.cancel);
  114518. */
  114519. function debounce(func, wait, options) {
  114520. var lastArgs,
  114521. lastThis,
  114522. maxWait,
  114523. result,
  114524. timerId,
  114525. lastCallTime,
  114526. lastInvokeTime = 0,
  114527. leading = false,
  114528. maxing = false,
  114529. trailing = true;
  114530. if (typeof func != 'function') {
  114531. throw new TypeError(FUNC_ERROR_TEXT);
  114532. }
  114533. wait = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(wait) || 0;
  114534. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options)) {
  114535. leading = !!options.leading;
  114536. maxing = 'maxWait' in options;
  114537. maxWait = maxing ? nativeMax(Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(options.maxWait) || 0, wait) : maxWait;
  114538. trailing = 'trailing' in options ? !!options.trailing : trailing;
  114539. }
  114540. function invokeFunc(time) {
  114541. var args = lastArgs,
  114542. thisArg = lastThis;
  114543. lastArgs = lastThis = undefined;
  114544. lastInvokeTime = time;
  114545. result = func.apply(thisArg, args);
  114546. return result;
  114547. }
  114548. function leadingEdge(time) {
  114549. // Reset any `maxWait` timer.
  114550. lastInvokeTime = time;
  114551. // Start the timer for the trailing edge.
  114552. timerId = setTimeout(timerExpired, wait);
  114553. // Invoke the leading edge.
  114554. return leading ? invokeFunc(time) : result;
  114555. }
  114556. function remainingWait(time) {
  114557. var timeSinceLastCall = time - lastCallTime,
  114558. timeSinceLastInvoke = time - lastInvokeTime,
  114559. timeWaiting = wait - timeSinceLastCall;
  114560. return maxing
  114561. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  114562. : timeWaiting;
  114563. }
  114564. function shouldInvoke(time) {
  114565. var timeSinceLastCall = time - lastCallTime,
  114566. timeSinceLastInvoke = time - lastInvokeTime;
  114567. // Either this is the first call, activity has stopped and we're at the
  114568. // trailing edge, the system time has gone backwards and we're treating
  114569. // it as the trailing edge, or we've hit the `maxWait` limit.
  114570. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  114571. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  114572. }
  114573. function timerExpired() {
  114574. var time = Object(_now_js__WEBPACK_IMPORTED_MODULE_1__["default"])();
  114575. if (shouldInvoke(time)) {
  114576. return trailingEdge(time);
  114577. }
  114578. // Restart the timer.
  114579. timerId = setTimeout(timerExpired, remainingWait(time));
  114580. }
  114581. function trailingEdge(time) {
  114582. timerId = undefined;
  114583. // Only invoke if we have `lastArgs` which means `func` has been
  114584. // debounced at least once.
  114585. if (trailing && lastArgs) {
  114586. return invokeFunc(time);
  114587. }
  114588. lastArgs = lastThis = undefined;
  114589. return result;
  114590. }
  114591. function cancel() {
  114592. if (timerId !== undefined) {
  114593. clearTimeout(timerId);
  114594. }
  114595. lastInvokeTime = 0;
  114596. lastArgs = lastCallTime = lastThis = timerId = undefined;
  114597. }
  114598. function flush() {
  114599. return timerId === undefined ? result : trailingEdge(Object(_now_js__WEBPACK_IMPORTED_MODULE_1__["default"])());
  114600. }
  114601. function debounced() {
  114602. var time = Object(_now_js__WEBPACK_IMPORTED_MODULE_1__["default"])(),
  114603. isInvoking = shouldInvoke(time);
  114604. lastArgs = arguments;
  114605. lastThis = this;
  114606. lastCallTime = time;
  114607. if (isInvoking) {
  114608. if (timerId === undefined) {
  114609. return leadingEdge(lastCallTime);
  114610. }
  114611. if (maxing) {
  114612. // Handle invocations in a tight loop.
  114613. clearTimeout(timerId);
  114614. timerId = setTimeout(timerExpired, wait);
  114615. return invokeFunc(lastCallTime);
  114616. }
  114617. }
  114618. if (timerId === undefined) {
  114619. timerId = setTimeout(timerExpired, wait);
  114620. }
  114621. return result;
  114622. }
  114623. debounced.cancel = cancel;
  114624. debounced.flush = flush;
  114625. return debounced;
  114626. }
  114627. /* harmony default export */ __webpack_exports__["default"] = (debounce);
  114628. /***/ }),
  114629. /***/ "./node_modules/lodash-es/deburr.js":
  114630. /*!******************************************!*\
  114631. !*** ./node_modules/lodash-es/deburr.js ***!
  114632. \******************************************/
  114633. /*! exports provided: default */
  114634. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114635. "use strict";
  114636. __webpack_require__.r(__webpack_exports__);
  114637. /* harmony import */ var _deburrLetter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_deburrLetter.js */ "./node_modules/lodash-es/_deburrLetter.js");
  114638. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  114639. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  114640. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  114641. /** Used to compose unicode character classes. */
  114642. var rsComboMarksRange = '\\u0300-\\u036f',
  114643. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  114644. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  114645. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
  114646. /** Used to compose unicode capture groups. */
  114647. var rsCombo = '[' + rsComboRange + ']';
  114648. /**
  114649. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  114650. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  114651. */
  114652. var reComboMark = RegExp(rsCombo, 'g');
  114653. /**
  114654. * Deburrs `string` by converting
  114655. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  114656. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  114657. * letters to basic Latin letters and removing
  114658. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  114659. *
  114660. * @static
  114661. * @memberOf _
  114662. * @since 3.0.0
  114663. * @category String
  114664. * @param {string} [string=''] The string to deburr.
  114665. * @returns {string} Returns the deburred string.
  114666. * @example
  114667. *
  114668. * _.deburr('déjà vu');
  114669. * // => 'deja vu'
  114670. */
  114671. function deburr(string) {
  114672. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string);
  114673. return string && string.replace(reLatin, _deburrLetter_js__WEBPACK_IMPORTED_MODULE_0__["default"]).replace(reComboMark, '');
  114674. }
  114675. /* harmony default export */ __webpack_exports__["default"] = (deburr);
  114676. /***/ }),
  114677. /***/ "./node_modules/lodash-es/defaultTo.js":
  114678. /*!*********************************************!*\
  114679. !*** ./node_modules/lodash-es/defaultTo.js ***!
  114680. \*********************************************/
  114681. /*! exports provided: default */
  114682. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114683. "use strict";
  114684. __webpack_require__.r(__webpack_exports__);
  114685. /**
  114686. * Checks `value` to determine whether a default value should be returned in
  114687. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  114688. * or `undefined`.
  114689. *
  114690. * @static
  114691. * @memberOf _
  114692. * @since 4.14.0
  114693. * @category Util
  114694. * @param {*} value The value to check.
  114695. * @param {*} defaultValue The default value.
  114696. * @returns {*} Returns the resolved value.
  114697. * @example
  114698. *
  114699. * _.defaultTo(1, 10);
  114700. * // => 1
  114701. *
  114702. * _.defaultTo(undefined, 10);
  114703. * // => 10
  114704. */
  114705. function defaultTo(value, defaultValue) {
  114706. return (value == null || value !== value) ? defaultValue : value;
  114707. }
  114708. /* harmony default export */ __webpack_exports__["default"] = (defaultTo);
  114709. /***/ }),
  114710. /***/ "./node_modules/lodash-es/defaults.js":
  114711. /*!********************************************!*\
  114712. !*** ./node_modules/lodash-es/defaults.js ***!
  114713. \********************************************/
  114714. /*! exports provided: default */
  114715. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114716. "use strict";
  114717. __webpack_require__.r(__webpack_exports__);
  114718. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  114719. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  114720. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  114721. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  114722. /** Used for built-in method references. */
  114723. var objectProto = Object.prototype;
  114724. /** Used to check objects for own properties. */
  114725. var hasOwnProperty = objectProto.hasOwnProperty;
  114726. /**
  114727. * Assigns own and inherited enumerable string keyed properties of source
  114728. * objects to the destination object for all destination properties that
  114729. * resolve to `undefined`. Source objects are applied from left to right.
  114730. * Once a property is set, additional values of the same property are ignored.
  114731. *
  114732. * **Note:** This method mutates `object`.
  114733. *
  114734. * @static
  114735. * @since 0.1.0
  114736. * @memberOf _
  114737. * @category Object
  114738. * @param {Object} object The destination object.
  114739. * @param {...Object} [sources] The source objects.
  114740. * @returns {Object} Returns `object`.
  114741. * @see _.defaultsDeep
  114742. * @example
  114743. *
  114744. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  114745. * // => { 'a': 1, 'b': 2 }
  114746. */
  114747. var defaults = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(object, sources) {
  114748. object = Object(object);
  114749. var index = -1;
  114750. var length = sources.length;
  114751. var guard = length > 2 ? sources[2] : undefined;
  114752. if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_2__["default"])(sources[0], sources[1], guard)) {
  114753. length = 1;
  114754. }
  114755. while (++index < length) {
  114756. var source = sources[index];
  114757. var props = Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_3__["default"])(source);
  114758. var propsIndex = -1;
  114759. var propsLength = props.length;
  114760. while (++propsIndex < propsLength) {
  114761. var key = props[propsIndex];
  114762. var value = object[key];
  114763. if (value === undefined ||
  114764. (Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  114765. object[key] = source[key];
  114766. }
  114767. }
  114768. }
  114769. return object;
  114770. });
  114771. /* harmony default export */ __webpack_exports__["default"] = (defaults);
  114772. /***/ }),
  114773. /***/ "./node_modules/lodash-es/defaultsDeep.js":
  114774. /*!************************************************!*\
  114775. !*** ./node_modules/lodash-es/defaultsDeep.js ***!
  114776. \************************************************/
  114777. /*! exports provided: default */
  114778. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114779. "use strict";
  114780. __webpack_require__.r(__webpack_exports__);
  114781. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  114782. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  114783. /* harmony import */ var _customDefaultsMerge_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_customDefaultsMerge.js */ "./node_modules/lodash-es/_customDefaultsMerge.js");
  114784. /* harmony import */ var _mergeWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mergeWith.js */ "./node_modules/lodash-es/mergeWith.js");
  114785. /**
  114786. * This method is like `_.defaults` except that it recursively assigns
  114787. * default properties.
  114788. *
  114789. * **Note:** This method mutates `object`.
  114790. *
  114791. * @static
  114792. * @memberOf _
  114793. * @since 3.10.0
  114794. * @category Object
  114795. * @param {Object} object The destination object.
  114796. * @param {...Object} [sources] The source objects.
  114797. * @returns {Object} Returns `object`.
  114798. * @see _.defaults
  114799. * @example
  114800. *
  114801. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  114802. * // => { 'a': { 'b': 2, 'c': 3 } }
  114803. */
  114804. var defaultsDeep = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(args) {
  114805. args.push(undefined, _customDefaultsMerge_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
  114806. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_mergeWith_js__WEBPACK_IMPORTED_MODULE_3__["default"], undefined, args);
  114807. });
  114808. /* harmony default export */ __webpack_exports__["default"] = (defaultsDeep);
  114809. /***/ }),
  114810. /***/ "./node_modules/lodash-es/defer.js":
  114811. /*!*****************************************!*\
  114812. !*** ./node_modules/lodash-es/defer.js ***!
  114813. \*****************************************/
  114814. /*! exports provided: default */
  114815. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114816. "use strict";
  114817. __webpack_require__.r(__webpack_exports__);
  114818. /* harmony import */ var _baseDelay_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDelay.js */ "./node_modules/lodash-es/_baseDelay.js");
  114819. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  114820. /**
  114821. * Defers invoking the `func` until the current call stack has cleared. Any
  114822. * additional arguments are provided to `func` when it's invoked.
  114823. *
  114824. * @static
  114825. * @memberOf _
  114826. * @since 0.1.0
  114827. * @category Function
  114828. * @param {Function} func The function to defer.
  114829. * @param {...*} [args] The arguments to invoke `func` with.
  114830. * @returns {number} Returns the timer id.
  114831. * @example
  114832. *
  114833. * _.defer(function(text) {
  114834. * console.log(text);
  114835. * }, 'deferred');
  114836. * // => Logs 'deferred' after one millisecond.
  114837. */
  114838. var defer = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(func, args) {
  114839. return Object(_baseDelay_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, 1, args);
  114840. });
  114841. /* harmony default export */ __webpack_exports__["default"] = (defer);
  114842. /***/ }),
  114843. /***/ "./node_modules/lodash-es/delay.js":
  114844. /*!*****************************************!*\
  114845. !*** ./node_modules/lodash-es/delay.js ***!
  114846. \*****************************************/
  114847. /*! exports provided: default */
  114848. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114849. "use strict";
  114850. __webpack_require__.r(__webpack_exports__);
  114851. /* harmony import */ var _baseDelay_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDelay.js */ "./node_modules/lodash-es/_baseDelay.js");
  114852. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  114853. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  114854. /**
  114855. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  114856. * provided to `func` when it's invoked.
  114857. *
  114858. * @static
  114859. * @memberOf _
  114860. * @since 0.1.0
  114861. * @category Function
  114862. * @param {Function} func The function to delay.
  114863. * @param {number} wait The number of milliseconds to delay invocation.
  114864. * @param {...*} [args] The arguments to invoke `func` with.
  114865. * @returns {number} Returns the timer id.
  114866. * @example
  114867. *
  114868. * _.delay(function(text) {
  114869. * console.log(text);
  114870. * }, 1000, 'later');
  114871. * // => Logs 'later' after one second.
  114872. */
  114873. var delay = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(func, wait, args) {
  114874. return Object(_baseDelay_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(wait) || 0, args);
  114875. });
  114876. /* harmony default export */ __webpack_exports__["default"] = (delay);
  114877. /***/ }),
  114878. /***/ "./node_modules/lodash-es/difference.js":
  114879. /*!**********************************************!*\
  114880. !*** ./node_modules/lodash-es/difference.js ***!
  114881. \**********************************************/
  114882. /*! exports provided: default */
  114883. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114884. "use strict";
  114885. __webpack_require__.r(__webpack_exports__);
  114886. /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
  114887. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  114888. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  114889. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  114890. /**
  114891. * Creates an array of `array` values not included in the other given arrays
  114892. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  114893. * for equality comparisons. The order and references of result values are
  114894. * determined by the first array.
  114895. *
  114896. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  114897. *
  114898. * @static
  114899. * @memberOf _
  114900. * @since 0.1.0
  114901. * @category Array
  114902. * @param {Array} array The array to inspect.
  114903. * @param {...Array} [values] The values to exclude.
  114904. * @returns {Array} Returns the new array of filtered values.
  114905. * @see _.without, _.xor
  114906. * @example
  114907. *
  114908. * _.difference([2, 1], [2, 3]);
  114909. * // => [1]
  114910. */
  114911. var difference = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(array, values) {
  114912. return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(array)
  114913. ? Object(_baseDifference_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(values, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"], true))
  114914. : [];
  114915. });
  114916. /* harmony default export */ __webpack_exports__["default"] = (difference);
  114917. /***/ }),
  114918. /***/ "./node_modules/lodash-es/differenceBy.js":
  114919. /*!************************************************!*\
  114920. !*** ./node_modules/lodash-es/differenceBy.js ***!
  114921. \************************************************/
  114922. /*! exports provided: default */
  114923. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114924. "use strict";
  114925. __webpack_require__.r(__webpack_exports__);
  114926. /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
  114927. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  114928. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  114929. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  114930. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  114931. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  114932. /**
  114933. * This method is like `_.difference` except that it accepts `iteratee` which
  114934. * is invoked for each element of `array` and `values` to generate the criterion
  114935. * by which they're compared. The order and references of result values are
  114936. * determined by the first array. The iteratee is invoked with one argument:
  114937. * (value).
  114938. *
  114939. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  114940. *
  114941. * @static
  114942. * @memberOf _
  114943. * @since 4.0.0
  114944. * @category Array
  114945. * @param {Array} array The array to inspect.
  114946. * @param {...Array} [values] The values to exclude.
  114947. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  114948. * @returns {Array} Returns the new array of filtered values.
  114949. * @example
  114950. *
  114951. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  114952. * // => [1.2]
  114953. *
  114954. * // The `_.property` iteratee shorthand.
  114955. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  114956. * // => [{ 'x': 2 }]
  114957. */
  114958. var differenceBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(array, values) {
  114959. var iteratee = Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(values);
  114960. if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee)) {
  114961. iteratee = undefined;
  114962. }
  114963. return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(array)
  114964. ? Object(_baseDifference_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(values, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"], true), Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 2))
  114965. : [];
  114966. });
  114967. /* harmony default export */ __webpack_exports__["default"] = (differenceBy);
  114968. /***/ }),
  114969. /***/ "./node_modules/lodash-es/differenceWith.js":
  114970. /*!**************************************************!*\
  114971. !*** ./node_modules/lodash-es/differenceWith.js ***!
  114972. \**************************************************/
  114973. /*! exports provided: default */
  114974. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114975. "use strict";
  114976. __webpack_require__.r(__webpack_exports__);
  114977. /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
  114978. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  114979. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  114980. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  114981. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  114982. /**
  114983. * This method is like `_.difference` except that it accepts `comparator`
  114984. * which is invoked to compare elements of `array` to `values`. The order and
  114985. * references of result values are determined by the first array. The comparator
  114986. * is invoked with two arguments: (arrVal, othVal).
  114987. *
  114988. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  114989. *
  114990. * @static
  114991. * @memberOf _
  114992. * @since 4.0.0
  114993. * @category Array
  114994. * @param {Array} array The array to inspect.
  114995. * @param {...Array} [values] The values to exclude.
  114996. * @param {Function} [comparator] The comparator invoked per element.
  114997. * @returns {Array} Returns the new array of filtered values.
  114998. * @example
  114999. *
  115000. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  115001. *
  115002. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  115003. * // => [{ 'x': 2, 'y': 1 }]
  115004. */
  115005. var differenceWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(array, values) {
  115006. var comparator = Object(_last_js__WEBPACK_IMPORTED_MODULE_4__["default"])(values);
  115007. if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(comparator)) {
  115008. comparator = undefined;
  115009. }
  115010. return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(array)
  115011. ? Object(_baseDifference_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(values, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"], true), undefined, comparator)
  115012. : [];
  115013. });
  115014. /* harmony default export */ __webpack_exports__["default"] = (differenceWith);
  115015. /***/ }),
  115016. /***/ "./node_modules/lodash-es/divide.js":
  115017. /*!******************************************!*\
  115018. !*** ./node_modules/lodash-es/divide.js ***!
  115019. \******************************************/
  115020. /*! exports provided: default */
  115021. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115022. "use strict";
  115023. __webpack_require__.r(__webpack_exports__);
  115024. /* harmony import */ var _createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createMathOperation.js */ "./node_modules/lodash-es/_createMathOperation.js");
  115025. /**
  115026. * Divide two numbers.
  115027. *
  115028. * @static
  115029. * @memberOf _
  115030. * @since 4.7.0
  115031. * @category Math
  115032. * @param {number} dividend The first number in a division.
  115033. * @param {number} divisor The second number in a division.
  115034. * @returns {number} Returns the quotient.
  115035. * @example
  115036. *
  115037. * _.divide(6, 4);
  115038. * // => 1.5
  115039. */
  115040. var divide = Object(_createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(dividend, divisor) {
  115041. return dividend / divisor;
  115042. }, 1);
  115043. /* harmony default export */ __webpack_exports__["default"] = (divide);
  115044. /***/ }),
  115045. /***/ "./node_modules/lodash-es/drop.js":
  115046. /*!****************************************!*\
  115047. !*** ./node_modules/lodash-es/drop.js ***!
  115048. \****************************************/
  115049. /*! exports provided: default */
  115050. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115051. "use strict";
  115052. __webpack_require__.r(__webpack_exports__);
  115053. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  115054. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  115055. /**
  115056. * Creates a slice of `array` with `n` elements dropped from the beginning.
  115057. *
  115058. * @static
  115059. * @memberOf _
  115060. * @since 0.5.0
  115061. * @category Array
  115062. * @param {Array} array The array to query.
  115063. * @param {number} [n=1] The number of elements to drop.
  115064. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  115065. * @returns {Array} Returns the slice of `array`.
  115066. * @example
  115067. *
  115068. * _.drop([1, 2, 3]);
  115069. * // => [2, 3]
  115070. *
  115071. * _.drop([1, 2, 3], 2);
  115072. * // => [3]
  115073. *
  115074. * _.drop([1, 2, 3], 5);
  115075. * // => []
  115076. *
  115077. * _.drop([1, 2, 3], 0);
  115078. * // => [1, 2, 3]
  115079. */
  115080. function drop(array, n, guard) {
  115081. var length = array == null ? 0 : array.length;
  115082. if (!length) {
  115083. return [];
  115084. }
  115085. n = (guard || n === undefined) ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n);
  115086. return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, n < 0 ? 0 : n, length);
  115087. }
  115088. /* harmony default export */ __webpack_exports__["default"] = (drop);
  115089. /***/ }),
  115090. /***/ "./node_modules/lodash-es/dropRight.js":
  115091. /*!*********************************************!*\
  115092. !*** ./node_modules/lodash-es/dropRight.js ***!
  115093. \*********************************************/
  115094. /*! exports provided: default */
  115095. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115096. "use strict";
  115097. __webpack_require__.r(__webpack_exports__);
  115098. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  115099. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  115100. /**
  115101. * Creates a slice of `array` with `n` elements dropped from the end.
  115102. *
  115103. * @static
  115104. * @memberOf _
  115105. * @since 3.0.0
  115106. * @category Array
  115107. * @param {Array} array The array to query.
  115108. * @param {number} [n=1] The number of elements to drop.
  115109. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  115110. * @returns {Array} Returns the slice of `array`.
  115111. * @example
  115112. *
  115113. * _.dropRight([1, 2, 3]);
  115114. * // => [1, 2]
  115115. *
  115116. * _.dropRight([1, 2, 3], 2);
  115117. * // => [1]
  115118. *
  115119. * _.dropRight([1, 2, 3], 5);
  115120. * // => []
  115121. *
  115122. * _.dropRight([1, 2, 3], 0);
  115123. * // => [1, 2, 3]
  115124. */
  115125. function dropRight(array, n, guard) {
  115126. var length = array == null ? 0 : array.length;
  115127. if (!length) {
  115128. return [];
  115129. }
  115130. n = (guard || n === undefined) ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n);
  115131. n = length - n;
  115132. return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 0, n < 0 ? 0 : n);
  115133. }
  115134. /* harmony default export */ __webpack_exports__["default"] = (dropRight);
  115135. /***/ }),
  115136. /***/ "./node_modules/lodash-es/dropRightWhile.js":
  115137. /*!**************************************************!*\
  115138. !*** ./node_modules/lodash-es/dropRightWhile.js ***!
  115139. \**************************************************/
  115140. /*! exports provided: default */
  115141. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115142. "use strict";
  115143. __webpack_require__.r(__webpack_exports__);
  115144. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  115145. /* harmony import */ var _baseWhile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseWhile.js */ "./node_modules/lodash-es/_baseWhile.js");
  115146. /**
  115147. * Creates a slice of `array` excluding elements dropped from the end.
  115148. * Elements are dropped until `predicate` returns falsey. The predicate is
  115149. * invoked with three arguments: (value, index, array).
  115150. *
  115151. * @static
  115152. * @memberOf _
  115153. * @since 3.0.0
  115154. * @category Array
  115155. * @param {Array} array The array to query.
  115156. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  115157. * @returns {Array} Returns the slice of `array`.
  115158. * @example
  115159. *
  115160. * var users = [
  115161. * { 'user': 'barney', 'active': true },
  115162. * { 'user': 'fred', 'active': false },
  115163. * { 'user': 'pebbles', 'active': false }
  115164. * ];
  115165. *
  115166. * _.dropRightWhile(users, function(o) { return !o.active; });
  115167. * // => objects for ['barney']
  115168. *
  115169. * // The `_.matches` iteratee shorthand.
  115170. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  115171. * // => objects for ['barney', 'fred']
  115172. *
  115173. * // The `_.matchesProperty` iteratee shorthand.
  115174. * _.dropRightWhile(users, ['active', false]);
  115175. * // => objects for ['barney']
  115176. *
  115177. * // The `_.property` iteratee shorthand.
  115178. * _.dropRightWhile(users, 'active');
  115179. * // => objects for ['barney', 'fred', 'pebbles']
  115180. */
  115181. function dropRightWhile(array, predicate) {
  115182. return (array && array.length)
  115183. ? Object(_baseWhile_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3), true, true)
  115184. : [];
  115185. }
  115186. /* harmony default export */ __webpack_exports__["default"] = (dropRightWhile);
  115187. /***/ }),
  115188. /***/ "./node_modules/lodash-es/dropWhile.js":
  115189. /*!*********************************************!*\
  115190. !*** ./node_modules/lodash-es/dropWhile.js ***!
  115191. \*********************************************/
  115192. /*! exports provided: default */
  115193. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115194. "use strict";
  115195. __webpack_require__.r(__webpack_exports__);
  115196. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  115197. /* harmony import */ var _baseWhile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseWhile.js */ "./node_modules/lodash-es/_baseWhile.js");
  115198. /**
  115199. * Creates a slice of `array` excluding elements dropped from the beginning.
  115200. * Elements are dropped until `predicate` returns falsey. The predicate is
  115201. * invoked with three arguments: (value, index, array).
  115202. *
  115203. * @static
  115204. * @memberOf _
  115205. * @since 3.0.0
  115206. * @category Array
  115207. * @param {Array} array The array to query.
  115208. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  115209. * @returns {Array} Returns the slice of `array`.
  115210. * @example
  115211. *
  115212. * var users = [
  115213. * { 'user': 'barney', 'active': false },
  115214. * { 'user': 'fred', 'active': false },
  115215. * { 'user': 'pebbles', 'active': true }
  115216. * ];
  115217. *
  115218. * _.dropWhile(users, function(o) { return !o.active; });
  115219. * // => objects for ['pebbles']
  115220. *
  115221. * // The `_.matches` iteratee shorthand.
  115222. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  115223. * // => objects for ['fred', 'pebbles']
  115224. *
  115225. * // The `_.matchesProperty` iteratee shorthand.
  115226. * _.dropWhile(users, ['active', false]);
  115227. * // => objects for ['pebbles']
  115228. *
  115229. * // The `_.property` iteratee shorthand.
  115230. * _.dropWhile(users, 'active');
  115231. * // => objects for ['barney', 'fred', 'pebbles']
  115232. */
  115233. function dropWhile(array, predicate) {
  115234. return (array && array.length)
  115235. ? Object(_baseWhile_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3), true)
  115236. : [];
  115237. }
  115238. /* harmony default export */ __webpack_exports__["default"] = (dropWhile);
  115239. /***/ }),
  115240. /***/ "./node_modules/lodash-es/each.js":
  115241. /*!****************************************!*\
  115242. !*** ./node_modules/lodash-es/each.js ***!
  115243. \****************************************/
  115244. /*! exports provided: default */
  115245. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115246. "use strict";
  115247. __webpack_require__.r(__webpack_exports__);
  115248. /* harmony import */ var _forEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./forEach.js */ "./node_modules/lodash-es/forEach.js");
  115249. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _forEach_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  115250. /***/ }),
  115251. /***/ "./node_modules/lodash-es/eachRight.js":
  115252. /*!*********************************************!*\
  115253. !*** ./node_modules/lodash-es/eachRight.js ***!
  115254. \*********************************************/
  115255. /*! exports provided: default */
  115256. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115257. "use strict";
  115258. __webpack_require__.r(__webpack_exports__);
  115259. /* harmony import */ var _forEachRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./forEachRight.js */ "./node_modules/lodash-es/forEachRight.js");
  115260. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _forEachRight_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  115261. /***/ }),
  115262. /***/ "./node_modules/lodash-es/endsWith.js":
  115263. /*!********************************************!*\
  115264. !*** ./node_modules/lodash-es/endsWith.js ***!
  115265. \********************************************/
  115266. /*! exports provided: default */
  115267. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115268. "use strict";
  115269. __webpack_require__.r(__webpack_exports__);
  115270. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  115271. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  115272. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  115273. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  115274. /**
  115275. * Checks if `string` ends with the given target string.
  115276. *
  115277. * @static
  115278. * @memberOf _
  115279. * @since 3.0.0
  115280. * @category String
  115281. * @param {string} [string=''] The string to inspect.
  115282. * @param {string} [target] The string to search for.
  115283. * @param {number} [position=string.length] The position to search up to.
  115284. * @returns {boolean} Returns `true` if `string` ends with `target`,
  115285. * else `false`.
  115286. * @example
  115287. *
  115288. * _.endsWith('abc', 'c');
  115289. * // => true
  115290. *
  115291. * _.endsWith('abc', 'b');
  115292. * // => false
  115293. *
  115294. * _.endsWith('abc', 'b', 2);
  115295. * // => true
  115296. */
  115297. function endsWith(string, target, position) {
  115298. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  115299. target = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(target);
  115300. var length = string.length;
  115301. position = position === undefined
  115302. ? length
  115303. : Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(position), 0, length);
  115304. var end = position;
  115305. position -= target.length;
  115306. return position >= 0 && string.slice(position, end) == target;
  115307. }
  115308. /* harmony default export */ __webpack_exports__["default"] = (endsWith);
  115309. /***/ }),
  115310. /***/ "./node_modules/lodash-es/entries.js":
  115311. /*!*******************************************!*\
  115312. !*** ./node_modules/lodash-es/entries.js ***!
  115313. \*******************************************/
  115314. /*! exports provided: default */
  115315. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115316. "use strict";
  115317. __webpack_require__.r(__webpack_exports__);
  115318. /* harmony import */ var _toPairs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPairs.js */ "./node_modules/lodash-es/toPairs.js");
  115319. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _toPairs_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  115320. /***/ }),
  115321. /***/ "./node_modules/lodash-es/entriesIn.js":
  115322. /*!*********************************************!*\
  115323. !*** ./node_modules/lodash-es/entriesIn.js ***!
  115324. \*********************************************/
  115325. /*! exports provided: default */
  115326. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115327. "use strict";
  115328. __webpack_require__.r(__webpack_exports__);
  115329. /* harmony import */ var _toPairsIn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPairsIn.js */ "./node_modules/lodash-es/toPairsIn.js");
  115330. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _toPairsIn_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  115331. /***/ }),
  115332. /***/ "./node_modules/lodash-es/eq.js":
  115333. /*!**************************************!*\
  115334. !*** ./node_modules/lodash-es/eq.js ***!
  115335. \**************************************/
  115336. /*! exports provided: default */
  115337. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115338. "use strict";
  115339. __webpack_require__.r(__webpack_exports__);
  115340. /**
  115341. * Performs a
  115342. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  115343. * comparison between two values to determine if they are equivalent.
  115344. *
  115345. * @static
  115346. * @memberOf _
  115347. * @since 4.0.0
  115348. * @category Lang
  115349. * @param {*} value The value to compare.
  115350. * @param {*} other The other value to compare.
  115351. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  115352. * @example
  115353. *
  115354. * var object = { 'a': 1 };
  115355. * var other = { 'a': 1 };
  115356. *
  115357. * _.eq(object, object);
  115358. * // => true
  115359. *
  115360. * _.eq(object, other);
  115361. * // => false
  115362. *
  115363. * _.eq('a', 'a');
  115364. * // => true
  115365. *
  115366. * _.eq('a', Object('a'));
  115367. * // => false
  115368. *
  115369. * _.eq(NaN, NaN);
  115370. * // => true
  115371. */
  115372. function eq(value, other) {
  115373. return value === other || (value !== value && other !== other);
  115374. }
  115375. /* harmony default export */ __webpack_exports__["default"] = (eq);
  115376. /***/ }),
  115377. /***/ "./node_modules/lodash-es/escape.js":
  115378. /*!******************************************!*\
  115379. !*** ./node_modules/lodash-es/escape.js ***!
  115380. \******************************************/
  115381. /*! exports provided: default */
  115382. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115383. "use strict";
  115384. __webpack_require__.r(__webpack_exports__);
  115385. /* harmony import */ var _escapeHtmlChar_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_escapeHtmlChar.js */ "./node_modules/lodash-es/_escapeHtmlChar.js");
  115386. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  115387. /** Used to match HTML entities and HTML characters. */
  115388. var reUnescapedHtml = /[&<>"']/g,
  115389. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  115390. /**
  115391. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  115392. * corresponding HTML entities.
  115393. *
  115394. * **Note:** No other characters are escaped. To escape additional
  115395. * characters use a third-party library like [_he_](https://mths.be/he).
  115396. *
  115397. * Though the ">" character is escaped for symmetry, characters like
  115398. * ">" and "/" don't need escaping in HTML and have no special meaning
  115399. * unless they're part of a tag or unquoted attribute value. See
  115400. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  115401. * (under "semi-related fun fact") for more details.
  115402. *
  115403. * When working with HTML you should always
  115404. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  115405. * XSS vectors.
  115406. *
  115407. * @static
  115408. * @since 0.1.0
  115409. * @memberOf _
  115410. * @category String
  115411. * @param {string} [string=''] The string to escape.
  115412. * @returns {string} Returns the escaped string.
  115413. * @example
  115414. *
  115415. * _.escape('fred, barney, & pebbles');
  115416. * // => 'fred, barney, &amp; pebbles'
  115417. */
  115418. function escape(string) {
  115419. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string);
  115420. return (string && reHasUnescapedHtml.test(string))
  115421. ? string.replace(reUnescapedHtml, _escapeHtmlChar_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  115422. : string;
  115423. }
  115424. /* harmony default export */ __webpack_exports__["default"] = (escape);
  115425. /***/ }),
  115426. /***/ "./node_modules/lodash-es/escapeRegExp.js":
  115427. /*!************************************************!*\
  115428. !*** ./node_modules/lodash-es/escapeRegExp.js ***!
  115429. \************************************************/
  115430. /*! exports provided: default */
  115431. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115432. "use strict";
  115433. __webpack_require__.r(__webpack_exports__);
  115434. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  115435. /**
  115436. * Used to match `RegExp`
  115437. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  115438. */
  115439. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  115440. reHasRegExpChar = RegExp(reRegExpChar.source);
  115441. /**
  115442. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  115443. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  115444. *
  115445. * @static
  115446. * @memberOf _
  115447. * @since 3.0.0
  115448. * @category String
  115449. * @param {string} [string=''] The string to escape.
  115450. * @returns {string} Returns the escaped string.
  115451. * @example
  115452. *
  115453. * _.escapeRegExp('[lodash](https://lodash.com/)');
  115454. * // => '\[lodash\]\(https://lodash\.com/\)'
  115455. */
  115456. function escapeRegExp(string) {
  115457. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
  115458. return (string && reHasRegExpChar.test(string))
  115459. ? string.replace(reRegExpChar, '\\$&')
  115460. : string;
  115461. }
  115462. /* harmony default export */ __webpack_exports__["default"] = (escapeRegExp);
  115463. /***/ }),
  115464. /***/ "./node_modules/lodash-es/every.js":
  115465. /*!*****************************************!*\
  115466. !*** ./node_modules/lodash-es/every.js ***!
  115467. \*****************************************/
  115468. /*! exports provided: default */
  115469. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115470. "use strict";
  115471. __webpack_require__.r(__webpack_exports__);
  115472. /* harmony import */ var _arrayEvery_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEvery.js */ "./node_modules/lodash-es/_arrayEvery.js");
  115473. /* harmony import */ var _baseEvery_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEvery.js */ "./node_modules/lodash-es/_baseEvery.js");
  115474. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  115475. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  115476. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  115477. /**
  115478. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  115479. * Iteration is stopped once `predicate` returns falsey. The predicate is
  115480. * invoked with three arguments: (value, index|key, collection).
  115481. *
  115482. * **Note:** This method returns `true` for
  115483. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  115484. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  115485. * elements of empty collections.
  115486. *
  115487. * @static
  115488. * @memberOf _
  115489. * @since 0.1.0
  115490. * @category Collection
  115491. * @param {Array|Object} collection The collection to iterate over.
  115492. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  115493. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  115494. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  115495. * else `false`.
  115496. * @example
  115497. *
  115498. * _.every([true, 1, null, 'yes'], Boolean);
  115499. * // => false
  115500. *
  115501. * var users = [
  115502. * { 'user': 'barney', 'age': 36, 'active': false },
  115503. * { 'user': 'fred', 'age': 40, 'active': false }
  115504. * ];
  115505. *
  115506. * // The `_.matches` iteratee shorthand.
  115507. * _.every(users, { 'user': 'barney', 'active': false });
  115508. * // => false
  115509. *
  115510. * // The `_.matchesProperty` iteratee shorthand.
  115511. * _.every(users, ['active', false]);
  115512. * // => true
  115513. *
  115514. * // The `_.property` iteratee shorthand.
  115515. * _.every(users, 'active');
  115516. * // => false
  115517. */
  115518. function every(collection, predicate, guard) {
  115519. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayEvery_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseEvery_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  115520. if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection, predicate, guard)) {
  115521. predicate = undefined;
  115522. }
  115523. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3));
  115524. }
  115525. /* harmony default export */ __webpack_exports__["default"] = (every);
  115526. /***/ }),
  115527. /***/ "./node_modules/lodash-es/extend.js":
  115528. /*!******************************************!*\
  115529. !*** ./node_modules/lodash-es/extend.js ***!
  115530. \******************************************/
  115531. /*! exports provided: default */
  115532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115533. "use strict";
  115534. __webpack_require__.r(__webpack_exports__);
  115535. /* harmony import */ var _assignIn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assignIn.js */ "./node_modules/lodash-es/assignIn.js");
  115536. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _assignIn_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  115537. /***/ }),
  115538. /***/ "./node_modules/lodash-es/extendWith.js":
  115539. /*!**********************************************!*\
  115540. !*** ./node_modules/lodash-es/extendWith.js ***!
  115541. \**********************************************/
  115542. /*! exports provided: default */
  115543. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115544. "use strict";
  115545. __webpack_require__.r(__webpack_exports__);
  115546. /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
  115547. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _assignInWith_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  115548. /***/ }),
  115549. /***/ "./node_modules/lodash-es/fill.js":
  115550. /*!****************************************!*\
  115551. !*** ./node_modules/lodash-es/fill.js ***!
  115552. \****************************************/
  115553. /*! exports provided: default */
  115554. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115555. "use strict";
  115556. __webpack_require__.r(__webpack_exports__);
  115557. /* harmony import */ var _baseFill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFill.js */ "./node_modules/lodash-es/_baseFill.js");
  115558. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  115559. /**
  115560. * Fills elements of `array` with `value` from `start` up to, but not
  115561. * including, `end`.
  115562. *
  115563. * **Note:** This method mutates `array`.
  115564. *
  115565. * @static
  115566. * @memberOf _
  115567. * @since 3.2.0
  115568. * @category Array
  115569. * @param {Array} array The array to fill.
  115570. * @param {*} value The value to fill `array` with.
  115571. * @param {number} [start=0] The start position.
  115572. * @param {number} [end=array.length] The end position.
  115573. * @returns {Array} Returns `array`.
  115574. * @example
  115575. *
  115576. * var array = [1, 2, 3];
  115577. *
  115578. * _.fill(array, 'a');
  115579. * console.log(array);
  115580. * // => ['a', 'a', 'a']
  115581. *
  115582. * _.fill(Array(3), 2);
  115583. * // => [2, 2, 2]
  115584. *
  115585. * _.fill([4, 6, 8, 10], '*', 1, 3);
  115586. * // => [4, '*', '*', 10]
  115587. */
  115588. function fill(array, value, start, end) {
  115589. var length = array == null ? 0 : array.length;
  115590. if (!length) {
  115591. return [];
  115592. }
  115593. if (start && typeof start != 'number' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, value, start)) {
  115594. start = 0;
  115595. end = length;
  115596. }
  115597. return Object(_baseFill_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, start, end);
  115598. }
  115599. /* harmony default export */ __webpack_exports__["default"] = (fill);
  115600. /***/ }),
  115601. /***/ "./node_modules/lodash-es/filter.js":
  115602. /*!******************************************!*\
  115603. !*** ./node_modules/lodash-es/filter.js ***!
  115604. \******************************************/
  115605. /*! exports provided: default */
  115606. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115607. "use strict";
  115608. __webpack_require__.r(__webpack_exports__);
  115609. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  115610. /* harmony import */ var _baseFilter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFilter.js */ "./node_modules/lodash-es/_baseFilter.js");
  115611. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  115612. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  115613. /**
  115614. * Iterates over elements of `collection`, returning an array of all elements
  115615. * `predicate` returns truthy for. The predicate is invoked with three
  115616. * arguments: (value, index|key, collection).
  115617. *
  115618. * **Note:** Unlike `_.remove`, this method returns a new array.
  115619. *
  115620. * @static
  115621. * @memberOf _
  115622. * @since 0.1.0
  115623. * @category Collection
  115624. * @param {Array|Object} collection The collection to iterate over.
  115625. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  115626. * @returns {Array} Returns the new filtered array.
  115627. * @see _.reject
  115628. * @example
  115629. *
  115630. * var users = [
  115631. * { 'user': 'barney', 'age': 36, 'active': true },
  115632. * { 'user': 'fred', 'age': 40, 'active': false }
  115633. * ];
  115634. *
  115635. * _.filter(users, function(o) { return !o.active; });
  115636. * // => objects for ['fred']
  115637. *
  115638. * // The `_.matches` iteratee shorthand.
  115639. * _.filter(users, { 'age': 36, 'active': true });
  115640. * // => objects for ['barney']
  115641. *
  115642. * // The `_.matchesProperty` iteratee shorthand.
  115643. * _.filter(users, ['active', false]);
  115644. * // => objects for ['fred']
  115645. *
  115646. * // The `_.property` iteratee shorthand.
  115647. * _.filter(users, 'active');
  115648. * // => objects for ['barney']
  115649. *
  115650. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  115651. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  115652. * // => objects for ['fred', 'barney']
  115653. */
  115654. function filter(collection, predicate) {
  115655. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseFilter_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  115656. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3));
  115657. }
  115658. /* harmony default export */ __webpack_exports__["default"] = (filter);
  115659. /***/ }),
  115660. /***/ "./node_modules/lodash-es/find.js":
  115661. /*!****************************************!*\
  115662. !*** ./node_modules/lodash-es/find.js ***!
  115663. \****************************************/
  115664. /*! exports provided: default */
  115665. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115666. "use strict";
  115667. __webpack_require__.r(__webpack_exports__);
  115668. /* harmony import */ var _createFind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createFind.js */ "./node_modules/lodash-es/_createFind.js");
  115669. /* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/lodash-es/findIndex.js");
  115670. /**
  115671. * Iterates over elements of `collection`, returning the first element
  115672. * `predicate` returns truthy for. The predicate is invoked with three
  115673. * arguments: (value, index|key, collection).
  115674. *
  115675. * @static
  115676. * @memberOf _
  115677. * @since 0.1.0
  115678. * @category Collection
  115679. * @param {Array|Object} collection The collection to inspect.
  115680. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  115681. * @param {number} [fromIndex=0] The index to search from.
  115682. * @returns {*} Returns the matched element, else `undefined`.
  115683. * @example
  115684. *
  115685. * var users = [
  115686. * { 'user': 'barney', 'age': 36, 'active': true },
  115687. * { 'user': 'fred', 'age': 40, 'active': false },
  115688. * { 'user': 'pebbles', 'age': 1, 'active': true }
  115689. * ];
  115690. *
  115691. * _.find(users, function(o) { return o.age < 40; });
  115692. * // => object for 'barney'
  115693. *
  115694. * // The `_.matches` iteratee shorthand.
  115695. * _.find(users, { 'age': 1, 'active': true });
  115696. * // => object for 'pebbles'
  115697. *
  115698. * // The `_.matchesProperty` iteratee shorthand.
  115699. * _.find(users, ['active', false]);
  115700. * // => object for 'fred'
  115701. *
  115702. * // The `_.property` iteratee shorthand.
  115703. * _.find(users, 'active');
  115704. * // => object for 'barney'
  115705. */
  115706. var find = Object(_createFind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_findIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  115707. /* harmony default export */ __webpack_exports__["default"] = (find);
  115708. /***/ }),
  115709. /***/ "./node_modules/lodash-es/findIndex.js":
  115710. /*!*********************************************!*\
  115711. !*** ./node_modules/lodash-es/findIndex.js ***!
  115712. \*********************************************/
  115713. /*! exports provided: default */
  115714. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115715. "use strict";
  115716. __webpack_require__.r(__webpack_exports__);
  115717. /* harmony import */ var _baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindIndex.js */ "./node_modules/lodash-es/_baseFindIndex.js");
  115718. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  115719. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  115720. /* Built-in method references for those with the same name as other `lodash` methods. */
  115721. var nativeMax = Math.max;
  115722. /**
  115723. * This method is like `_.find` except that it returns the index of the first
  115724. * element `predicate` returns truthy for instead of the element itself.
  115725. *
  115726. * @static
  115727. * @memberOf _
  115728. * @since 1.1.0
  115729. * @category Array
  115730. * @param {Array} array The array to inspect.
  115731. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  115732. * @param {number} [fromIndex=0] The index to search from.
  115733. * @returns {number} Returns the index of the found element, else `-1`.
  115734. * @example
  115735. *
  115736. * var users = [
  115737. * { 'user': 'barney', 'active': false },
  115738. * { 'user': 'fred', 'active': false },
  115739. * { 'user': 'pebbles', 'active': true }
  115740. * ];
  115741. *
  115742. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  115743. * // => 0
  115744. *
  115745. * // The `_.matches` iteratee shorthand.
  115746. * _.findIndex(users, { 'user': 'fred', 'active': false });
  115747. * // => 1
  115748. *
  115749. * // The `_.matchesProperty` iteratee shorthand.
  115750. * _.findIndex(users, ['active', false]);
  115751. * // => 0
  115752. *
  115753. * // The `_.property` iteratee shorthand.
  115754. * _.findIndex(users, 'active');
  115755. * // => 2
  115756. */
  115757. function findIndex(array, predicate, fromIndex) {
  115758. var length = array == null ? 0 : array.length;
  115759. if (!length) {
  115760. return -1;
  115761. }
  115762. var index = fromIndex == null ? 0 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(fromIndex);
  115763. if (index < 0) {
  115764. index = nativeMax(length + index, 0);
  115765. }
  115766. return Object(_baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(predicate, 3), index);
  115767. }
  115768. /* harmony default export */ __webpack_exports__["default"] = (findIndex);
  115769. /***/ }),
  115770. /***/ "./node_modules/lodash-es/findKey.js":
  115771. /*!*******************************************!*\
  115772. !*** ./node_modules/lodash-es/findKey.js ***!
  115773. \*******************************************/
  115774. /*! exports provided: default */
  115775. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115776. "use strict";
  115777. __webpack_require__.r(__webpack_exports__);
  115778. /* harmony import */ var _baseFindKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindKey.js */ "./node_modules/lodash-es/_baseFindKey.js");
  115779. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  115780. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  115781. /**
  115782. * This method is like `_.find` except that it returns the key of the first
  115783. * element `predicate` returns truthy for instead of the element itself.
  115784. *
  115785. * @static
  115786. * @memberOf _
  115787. * @since 1.1.0
  115788. * @category Object
  115789. * @param {Object} object The object to inspect.
  115790. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  115791. * @returns {string|undefined} Returns the key of the matched element,
  115792. * else `undefined`.
  115793. * @example
  115794. *
  115795. * var users = {
  115796. * 'barney': { 'age': 36, 'active': true },
  115797. * 'fred': { 'age': 40, 'active': false },
  115798. * 'pebbles': { 'age': 1, 'active': true }
  115799. * };
  115800. *
  115801. * _.findKey(users, function(o) { return o.age < 40; });
  115802. * // => 'barney' (iteration order is not guaranteed)
  115803. *
  115804. * // The `_.matches` iteratee shorthand.
  115805. * _.findKey(users, { 'age': 1, 'active': true });
  115806. * // => 'pebbles'
  115807. *
  115808. * // The `_.matchesProperty` iteratee shorthand.
  115809. * _.findKey(users, ['active', false]);
  115810. * // => 'fred'
  115811. *
  115812. * // The `_.property` iteratee shorthand.
  115813. * _.findKey(users, 'active');
  115814. * // => 'barney'
  115815. */
  115816. function findKey(object, predicate) {
  115817. return Object(_baseFindKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3), _baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  115818. }
  115819. /* harmony default export */ __webpack_exports__["default"] = (findKey);
  115820. /***/ }),
  115821. /***/ "./node_modules/lodash-es/findLast.js":
  115822. /*!********************************************!*\
  115823. !*** ./node_modules/lodash-es/findLast.js ***!
  115824. \********************************************/
  115825. /*! exports provided: default */
  115826. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115827. "use strict";
  115828. __webpack_require__.r(__webpack_exports__);
  115829. /* harmony import */ var _createFind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createFind.js */ "./node_modules/lodash-es/_createFind.js");
  115830. /* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/lodash-es/findLastIndex.js");
  115831. /**
  115832. * This method is like `_.find` except that it iterates over elements of
  115833. * `collection` from right to left.
  115834. *
  115835. * @static
  115836. * @memberOf _
  115837. * @since 2.0.0
  115838. * @category Collection
  115839. * @param {Array|Object} collection The collection to inspect.
  115840. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  115841. * @param {number} [fromIndex=collection.length-1] The index to search from.
  115842. * @returns {*} Returns the matched element, else `undefined`.
  115843. * @example
  115844. *
  115845. * _.findLast([1, 2, 3, 4], function(n) {
  115846. * return n % 2 == 1;
  115847. * });
  115848. * // => 3
  115849. */
  115850. var findLast = Object(_createFind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_findLastIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  115851. /* harmony default export */ __webpack_exports__["default"] = (findLast);
  115852. /***/ }),
  115853. /***/ "./node_modules/lodash-es/findLastIndex.js":
  115854. /*!*************************************************!*\
  115855. !*** ./node_modules/lodash-es/findLastIndex.js ***!
  115856. \*************************************************/
  115857. /*! exports provided: default */
  115858. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115859. "use strict";
  115860. __webpack_require__.r(__webpack_exports__);
  115861. /* harmony import */ var _baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindIndex.js */ "./node_modules/lodash-es/_baseFindIndex.js");
  115862. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  115863. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  115864. /* Built-in method references for those with the same name as other `lodash` methods. */
  115865. var nativeMax = Math.max,
  115866. nativeMin = Math.min;
  115867. /**
  115868. * This method is like `_.findIndex` except that it iterates over elements
  115869. * of `collection` from right to left.
  115870. *
  115871. * @static
  115872. * @memberOf _
  115873. * @since 2.0.0
  115874. * @category Array
  115875. * @param {Array} array The array to inspect.
  115876. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  115877. * @param {number} [fromIndex=array.length-1] The index to search from.
  115878. * @returns {number} Returns the index of the found element, else `-1`.
  115879. * @example
  115880. *
  115881. * var users = [
  115882. * { 'user': 'barney', 'active': true },
  115883. * { 'user': 'fred', 'active': false },
  115884. * { 'user': 'pebbles', 'active': false }
  115885. * ];
  115886. *
  115887. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  115888. * // => 2
  115889. *
  115890. * // The `_.matches` iteratee shorthand.
  115891. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  115892. * // => 0
  115893. *
  115894. * // The `_.matchesProperty` iteratee shorthand.
  115895. * _.findLastIndex(users, ['active', false]);
  115896. * // => 2
  115897. *
  115898. * // The `_.property` iteratee shorthand.
  115899. * _.findLastIndex(users, 'active');
  115900. * // => 0
  115901. */
  115902. function findLastIndex(array, predicate, fromIndex) {
  115903. var length = array == null ? 0 : array.length;
  115904. if (!length) {
  115905. return -1;
  115906. }
  115907. var index = length - 1;
  115908. if (fromIndex !== undefined) {
  115909. index = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(fromIndex);
  115910. index = fromIndex < 0
  115911. ? nativeMax(length + index, 0)
  115912. : nativeMin(index, length - 1);
  115913. }
  115914. return Object(_baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(predicate, 3), index, true);
  115915. }
  115916. /* harmony default export */ __webpack_exports__["default"] = (findLastIndex);
  115917. /***/ }),
  115918. /***/ "./node_modules/lodash-es/findLastKey.js":
  115919. /*!***********************************************!*\
  115920. !*** ./node_modules/lodash-es/findLastKey.js ***!
  115921. \***********************************************/
  115922. /*! exports provided: default */
  115923. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115924. "use strict";
  115925. __webpack_require__.r(__webpack_exports__);
  115926. /* harmony import */ var _baseFindKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindKey.js */ "./node_modules/lodash-es/_baseFindKey.js");
  115927. /* harmony import */ var _baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseForOwnRight.js */ "./node_modules/lodash-es/_baseForOwnRight.js");
  115928. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  115929. /**
  115930. * This method is like `_.findKey` except that it iterates over elements of
  115931. * a collection in the opposite order.
  115932. *
  115933. * @static
  115934. * @memberOf _
  115935. * @since 2.0.0
  115936. * @category Object
  115937. * @param {Object} object The object to inspect.
  115938. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  115939. * @returns {string|undefined} Returns the key of the matched element,
  115940. * else `undefined`.
  115941. * @example
  115942. *
  115943. * var users = {
  115944. * 'barney': { 'age': 36, 'active': true },
  115945. * 'fred': { 'age': 40, 'active': false },
  115946. * 'pebbles': { 'age': 1, 'active': true }
  115947. * };
  115948. *
  115949. * _.findLastKey(users, function(o) { return o.age < 40; });
  115950. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  115951. *
  115952. * // The `_.matches` iteratee shorthand.
  115953. * _.findLastKey(users, { 'age': 36, 'active': true });
  115954. * // => 'barney'
  115955. *
  115956. * // The `_.matchesProperty` iteratee shorthand.
  115957. * _.findLastKey(users, ['active', false]);
  115958. * // => 'fred'
  115959. *
  115960. * // The `_.property` iteratee shorthand.
  115961. * _.findLastKey(users, 'active');
  115962. * // => 'pebbles'
  115963. */
  115964. function findLastKey(object, predicate) {
  115965. return Object(_baseFindKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3), _baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  115966. }
  115967. /* harmony default export */ __webpack_exports__["default"] = (findLastKey);
  115968. /***/ }),
  115969. /***/ "./node_modules/lodash-es/first.js":
  115970. /*!*****************************************!*\
  115971. !*** ./node_modules/lodash-es/first.js ***!
  115972. \*****************************************/
  115973. /*! exports provided: default */
  115974. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115975. "use strict";
  115976. __webpack_require__.r(__webpack_exports__);
  115977. /* harmony import */ var _head_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./head.js */ "./node_modules/lodash-es/head.js");
  115978. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _head_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  115979. /***/ }),
  115980. /***/ "./node_modules/lodash-es/flatMap.js":
  115981. /*!*******************************************!*\
  115982. !*** ./node_modules/lodash-es/flatMap.js ***!
  115983. \*******************************************/
  115984. /*! exports provided: default */
  115985. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115986. "use strict";
  115987. __webpack_require__.r(__webpack_exports__);
  115988. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  115989. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  115990. /**
  115991. * Creates a flattened array of values by running each element in `collection`
  115992. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  115993. * with three arguments: (value, index|key, collection).
  115994. *
  115995. * @static
  115996. * @memberOf _
  115997. * @since 4.0.0
  115998. * @category Collection
  115999. * @param {Array|Object} collection The collection to iterate over.
  116000. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  116001. * @returns {Array} Returns the new flattened array.
  116002. * @example
  116003. *
  116004. * function duplicate(n) {
  116005. * return [n, n];
  116006. * }
  116007. *
  116008. * _.flatMap([1, 2], duplicate);
  116009. * // => [1, 1, 2, 2]
  116010. */
  116011. function flatMap(collection, iteratee) {
  116012. return Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_map_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, iteratee), 1);
  116013. }
  116014. /* harmony default export */ __webpack_exports__["default"] = (flatMap);
  116015. /***/ }),
  116016. /***/ "./node_modules/lodash-es/flatMapDeep.js":
  116017. /*!***********************************************!*\
  116018. !*** ./node_modules/lodash-es/flatMapDeep.js ***!
  116019. \***********************************************/
  116020. /*! exports provided: default */
  116021. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116022. "use strict";
  116023. __webpack_require__.r(__webpack_exports__);
  116024. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  116025. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  116026. /** Used as references for various `Number` constants. */
  116027. var INFINITY = 1 / 0;
  116028. /**
  116029. * This method is like `_.flatMap` except that it recursively flattens the
  116030. * mapped results.
  116031. *
  116032. * @static
  116033. * @memberOf _
  116034. * @since 4.7.0
  116035. * @category Collection
  116036. * @param {Array|Object} collection The collection to iterate over.
  116037. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  116038. * @returns {Array} Returns the new flattened array.
  116039. * @example
  116040. *
  116041. * function duplicate(n) {
  116042. * return [[[n, n]]];
  116043. * }
  116044. *
  116045. * _.flatMapDeep([1, 2], duplicate);
  116046. * // => [1, 1, 2, 2]
  116047. */
  116048. function flatMapDeep(collection, iteratee) {
  116049. return Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_map_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, iteratee), INFINITY);
  116050. }
  116051. /* harmony default export */ __webpack_exports__["default"] = (flatMapDeep);
  116052. /***/ }),
  116053. /***/ "./node_modules/lodash-es/flatMapDepth.js":
  116054. /*!************************************************!*\
  116055. !*** ./node_modules/lodash-es/flatMapDepth.js ***!
  116056. \************************************************/
  116057. /*! exports provided: default */
  116058. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116059. "use strict";
  116060. __webpack_require__.r(__webpack_exports__);
  116061. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  116062. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  116063. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  116064. /**
  116065. * This method is like `_.flatMap` except that it recursively flattens the
  116066. * mapped results up to `depth` times.
  116067. *
  116068. * @static
  116069. * @memberOf _
  116070. * @since 4.7.0
  116071. * @category Collection
  116072. * @param {Array|Object} collection The collection to iterate over.
  116073. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  116074. * @param {number} [depth=1] The maximum recursion depth.
  116075. * @returns {Array} Returns the new flattened array.
  116076. * @example
  116077. *
  116078. * function duplicate(n) {
  116079. * return [[[n, n]]];
  116080. * }
  116081. *
  116082. * _.flatMapDepth([1, 2], duplicate, 2);
  116083. * // => [[1, 1], [2, 2]]
  116084. */
  116085. function flatMapDepth(collection, iteratee, depth) {
  116086. depth = depth === undefined ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(depth);
  116087. return Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_map_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, iteratee), depth);
  116088. }
  116089. /* harmony default export */ __webpack_exports__["default"] = (flatMapDepth);
  116090. /***/ }),
  116091. /***/ "./node_modules/lodash-es/flatten.js":
  116092. /*!*******************************************!*\
  116093. !*** ./node_modules/lodash-es/flatten.js ***!
  116094. \*******************************************/
  116095. /*! exports provided: default */
  116096. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116097. "use strict";
  116098. __webpack_require__.r(__webpack_exports__);
  116099. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  116100. /**
  116101. * Flattens `array` a single level deep.
  116102. *
  116103. * @static
  116104. * @memberOf _
  116105. * @since 0.1.0
  116106. * @category Array
  116107. * @param {Array} array The array to flatten.
  116108. * @returns {Array} Returns the new flattened array.
  116109. * @example
  116110. *
  116111. * _.flatten([1, [2, [3, [4]], 5]]);
  116112. * // => [1, 2, [3, [4]], 5]
  116113. */
  116114. function flatten(array) {
  116115. var length = array == null ? 0 : array.length;
  116116. return length ? Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 1) : [];
  116117. }
  116118. /* harmony default export */ __webpack_exports__["default"] = (flatten);
  116119. /***/ }),
  116120. /***/ "./node_modules/lodash-es/flattenDeep.js":
  116121. /*!***********************************************!*\
  116122. !*** ./node_modules/lodash-es/flattenDeep.js ***!
  116123. \***********************************************/
  116124. /*! exports provided: default */
  116125. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116126. "use strict";
  116127. __webpack_require__.r(__webpack_exports__);
  116128. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  116129. /** Used as references for various `Number` constants. */
  116130. var INFINITY = 1 / 0;
  116131. /**
  116132. * Recursively flattens `array`.
  116133. *
  116134. * @static
  116135. * @memberOf _
  116136. * @since 3.0.0
  116137. * @category Array
  116138. * @param {Array} array The array to flatten.
  116139. * @returns {Array} Returns the new flattened array.
  116140. * @example
  116141. *
  116142. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  116143. * // => [1, 2, 3, 4, 5]
  116144. */
  116145. function flattenDeep(array) {
  116146. var length = array == null ? 0 : array.length;
  116147. return length ? Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, INFINITY) : [];
  116148. }
  116149. /* harmony default export */ __webpack_exports__["default"] = (flattenDeep);
  116150. /***/ }),
  116151. /***/ "./node_modules/lodash-es/flattenDepth.js":
  116152. /*!************************************************!*\
  116153. !*** ./node_modules/lodash-es/flattenDepth.js ***!
  116154. \************************************************/
  116155. /*! exports provided: default */
  116156. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116157. "use strict";
  116158. __webpack_require__.r(__webpack_exports__);
  116159. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  116160. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  116161. /**
  116162. * Recursively flatten `array` up to `depth` times.
  116163. *
  116164. * @static
  116165. * @memberOf _
  116166. * @since 4.4.0
  116167. * @category Array
  116168. * @param {Array} array The array to flatten.
  116169. * @param {number} [depth=1] The maximum recursion depth.
  116170. * @returns {Array} Returns the new flattened array.
  116171. * @example
  116172. *
  116173. * var array = [1, [2, [3, [4]], 5]];
  116174. *
  116175. * _.flattenDepth(array, 1);
  116176. * // => [1, 2, [3, [4]], 5]
  116177. *
  116178. * _.flattenDepth(array, 2);
  116179. * // => [1, 2, 3, [4], 5]
  116180. */
  116181. function flattenDepth(array, depth) {
  116182. var length = array == null ? 0 : array.length;
  116183. if (!length) {
  116184. return [];
  116185. }
  116186. depth = depth === undefined ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(depth);
  116187. return Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, depth);
  116188. }
  116189. /* harmony default export */ __webpack_exports__["default"] = (flattenDepth);
  116190. /***/ }),
  116191. /***/ "./node_modules/lodash-es/flip.js":
  116192. /*!****************************************!*\
  116193. !*** ./node_modules/lodash-es/flip.js ***!
  116194. \****************************************/
  116195. /*! exports provided: default */
  116196. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116197. "use strict";
  116198. __webpack_require__.r(__webpack_exports__);
  116199. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  116200. /** Used to compose bitmasks for function metadata. */
  116201. var WRAP_FLIP_FLAG = 512;
  116202. /**
  116203. * Creates a function that invokes `func` with arguments reversed.
  116204. *
  116205. * @static
  116206. * @memberOf _
  116207. * @since 4.0.0
  116208. * @category Function
  116209. * @param {Function} func The function to flip arguments for.
  116210. * @returns {Function} Returns the new flipped function.
  116211. * @example
  116212. *
  116213. * var flipped = _.flip(function() {
  116214. * return _.toArray(arguments);
  116215. * });
  116216. *
  116217. * flipped('a', 'b', 'c', 'd');
  116218. * // => ['d', 'c', 'b', 'a']
  116219. */
  116220. function flip(func) {
  116221. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_FLIP_FLAG);
  116222. }
  116223. /* harmony default export */ __webpack_exports__["default"] = (flip);
  116224. /***/ }),
  116225. /***/ "./node_modules/lodash-es/floor.js":
  116226. /*!*****************************************!*\
  116227. !*** ./node_modules/lodash-es/floor.js ***!
  116228. \*****************************************/
  116229. /*! exports provided: default */
  116230. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116231. "use strict";
  116232. __webpack_require__.r(__webpack_exports__);
  116233. /* harmony import */ var _createRound_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRound.js */ "./node_modules/lodash-es/_createRound.js");
  116234. /**
  116235. * Computes `number` rounded down to `precision`.
  116236. *
  116237. * @static
  116238. * @memberOf _
  116239. * @since 3.10.0
  116240. * @category Math
  116241. * @param {number} number The number to round down.
  116242. * @param {number} [precision=0] The precision to round down to.
  116243. * @returns {number} Returns the rounded down number.
  116244. * @example
  116245. *
  116246. * _.floor(4.006);
  116247. * // => 4
  116248. *
  116249. * _.floor(0.046, 2);
  116250. * // => 0.04
  116251. *
  116252. * _.floor(4060, -2);
  116253. * // => 4000
  116254. */
  116255. var floor = Object(_createRound_js__WEBPACK_IMPORTED_MODULE_0__["default"])('floor');
  116256. /* harmony default export */ __webpack_exports__["default"] = (floor);
  116257. /***/ }),
  116258. /***/ "./node_modules/lodash-es/flow.js":
  116259. /*!****************************************!*\
  116260. !*** ./node_modules/lodash-es/flow.js ***!
  116261. \****************************************/
  116262. /*! exports provided: default */
  116263. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116264. "use strict";
  116265. __webpack_require__.r(__webpack_exports__);
  116266. /* harmony import */ var _createFlow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createFlow.js */ "./node_modules/lodash-es/_createFlow.js");
  116267. /**
  116268. * Creates a function that returns the result of invoking the given functions
  116269. * with the `this` binding of the created function, where each successive
  116270. * invocation is supplied the return value of the previous.
  116271. *
  116272. * @static
  116273. * @memberOf _
  116274. * @since 3.0.0
  116275. * @category Util
  116276. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  116277. * @returns {Function} Returns the new composite function.
  116278. * @see _.flowRight
  116279. * @example
  116280. *
  116281. * function square(n) {
  116282. * return n * n;
  116283. * }
  116284. *
  116285. * var addSquare = _.flow([_.add, square]);
  116286. * addSquare(1, 2);
  116287. * // => 9
  116288. */
  116289. var flow = Object(_createFlow_js__WEBPACK_IMPORTED_MODULE_0__["default"])();
  116290. /* harmony default export */ __webpack_exports__["default"] = (flow);
  116291. /***/ }),
  116292. /***/ "./node_modules/lodash-es/flowRight.js":
  116293. /*!*********************************************!*\
  116294. !*** ./node_modules/lodash-es/flowRight.js ***!
  116295. \*********************************************/
  116296. /*! exports provided: default */
  116297. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116298. "use strict";
  116299. __webpack_require__.r(__webpack_exports__);
  116300. /* harmony import */ var _createFlow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createFlow.js */ "./node_modules/lodash-es/_createFlow.js");
  116301. /**
  116302. * This method is like `_.flow` except that it creates a function that
  116303. * invokes the given functions from right to left.
  116304. *
  116305. * @static
  116306. * @since 3.0.0
  116307. * @memberOf _
  116308. * @category Util
  116309. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  116310. * @returns {Function} Returns the new composite function.
  116311. * @see _.flow
  116312. * @example
  116313. *
  116314. * function square(n) {
  116315. * return n * n;
  116316. * }
  116317. *
  116318. * var addSquare = _.flowRight([square, _.add]);
  116319. * addSquare(1, 2);
  116320. * // => 9
  116321. */
  116322. var flowRight = Object(_createFlow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(true);
  116323. /* harmony default export */ __webpack_exports__["default"] = (flowRight);
  116324. /***/ }),
  116325. /***/ "./node_modules/lodash-es/forEach.js":
  116326. /*!*******************************************!*\
  116327. !*** ./node_modules/lodash-es/forEach.js ***!
  116328. \*******************************************/
  116329. /*! exports provided: default */
  116330. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116331. "use strict";
  116332. __webpack_require__.r(__webpack_exports__);
  116333. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  116334. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  116335. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  116336. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  116337. /**
  116338. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  116339. * The iteratee is invoked with three arguments: (value, index|key, collection).
  116340. * Iteratee functions may exit iteration early by explicitly returning `false`.
  116341. *
  116342. * **Note:** As with other "Collections" methods, objects with a "length"
  116343. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  116344. * or `_.forOwn` for object iteration.
  116345. *
  116346. * @static
  116347. * @memberOf _
  116348. * @since 0.1.0
  116349. * @alias each
  116350. * @category Collection
  116351. * @param {Array|Object} collection The collection to iterate over.
  116352. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  116353. * @returns {Array|Object} Returns `collection`.
  116354. * @see _.forEachRight
  116355. * @example
  116356. *
  116357. * _.forEach([1, 2], function(value) {
  116358. * console.log(value);
  116359. * });
  116360. * // => Logs `1` then `2`.
  116361. *
  116362. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  116363. * console.log(key);
  116364. * });
  116365. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  116366. */
  116367. function forEach(collection, iteratee) {
  116368. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  116369. return func(collection, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee));
  116370. }
  116371. /* harmony default export */ __webpack_exports__["default"] = (forEach);
  116372. /***/ }),
  116373. /***/ "./node_modules/lodash-es/forEachRight.js":
  116374. /*!************************************************!*\
  116375. !*** ./node_modules/lodash-es/forEachRight.js ***!
  116376. \************************************************/
  116377. /*! exports provided: default */
  116378. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116379. "use strict";
  116380. __webpack_require__.r(__webpack_exports__);
  116381. /* harmony import */ var _arrayEachRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEachRight.js */ "./node_modules/lodash-es/_arrayEachRight.js");
  116382. /* harmony import */ var _baseEachRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEachRight.js */ "./node_modules/lodash-es/_baseEachRight.js");
  116383. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  116384. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  116385. /**
  116386. * This method is like `_.forEach` except that it iterates over elements of
  116387. * `collection` from right to left.
  116388. *
  116389. * @static
  116390. * @memberOf _
  116391. * @since 2.0.0
  116392. * @alias eachRight
  116393. * @category Collection
  116394. * @param {Array|Object} collection The collection to iterate over.
  116395. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  116396. * @returns {Array|Object} Returns `collection`.
  116397. * @see _.forEach
  116398. * @example
  116399. *
  116400. * _.forEachRight([1, 2], function(value) {
  116401. * console.log(value);
  116402. * });
  116403. * // => Logs `2` then `1`.
  116404. */
  116405. function forEachRight(collection, iteratee) {
  116406. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayEachRight_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseEachRight_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  116407. return func(collection, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee));
  116408. }
  116409. /* harmony default export */ __webpack_exports__["default"] = (forEachRight);
  116410. /***/ }),
  116411. /***/ "./node_modules/lodash-es/forIn.js":
  116412. /*!*****************************************!*\
  116413. !*** ./node_modules/lodash-es/forIn.js ***!
  116414. \*****************************************/
  116415. /*! exports provided: default */
  116416. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116417. "use strict";
  116418. __webpack_require__.r(__webpack_exports__);
  116419. /* harmony import */ var _baseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFor.js */ "./node_modules/lodash-es/_baseFor.js");
  116420. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  116421. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  116422. /**
  116423. * Iterates over own and inherited enumerable string keyed properties of an
  116424. * object and invokes `iteratee` for each property. The iteratee is invoked
  116425. * with three arguments: (value, key, object). Iteratee functions may exit
  116426. * iteration early by explicitly returning `false`.
  116427. *
  116428. * @static
  116429. * @memberOf _
  116430. * @since 0.3.0
  116431. * @category Object
  116432. * @param {Object} object The object to iterate over.
  116433. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  116434. * @returns {Object} Returns `object`.
  116435. * @see _.forInRight
  116436. * @example
  116437. *
  116438. * function Foo() {
  116439. * this.a = 1;
  116440. * this.b = 2;
  116441. * }
  116442. *
  116443. * Foo.prototype.c = 3;
  116444. *
  116445. * _.forIn(new Foo, function(value, key) {
  116446. * console.log(key);
  116447. * });
  116448. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  116449. */
  116450. function forIn(object, iteratee) {
  116451. return object == null
  116452. ? object
  116453. : Object(_baseFor_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee), _keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
  116454. }
  116455. /* harmony default export */ __webpack_exports__["default"] = (forIn);
  116456. /***/ }),
  116457. /***/ "./node_modules/lodash-es/forInRight.js":
  116458. /*!**********************************************!*\
  116459. !*** ./node_modules/lodash-es/forInRight.js ***!
  116460. \**********************************************/
  116461. /*! exports provided: default */
  116462. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116463. "use strict";
  116464. __webpack_require__.r(__webpack_exports__);
  116465. /* harmony import */ var _baseForRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForRight.js */ "./node_modules/lodash-es/_baseForRight.js");
  116466. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  116467. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  116468. /**
  116469. * This method is like `_.forIn` except that it iterates over properties of
  116470. * `object` in the opposite order.
  116471. *
  116472. * @static
  116473. * @memberOf _
  116474. * @since 2.0.0
  116475. * @category Object
  116476. * @param {Object} object The object to iterate over.
  116477. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  116478. * @returns {Object} Returns `object`.
  116479. * @see _.forIn
  116480. * @example
  116481. *
  116482. * function Foo() {
  116483. * this.a = 1;
  116484. * this.b = 2;
  116485. * }
  116486. *
  116487. * Foo.prototype.c = 3;
  116488. *
  116489. * _.forInRight(new Foo, function(value, key) {
  116490. * console.log(key);
  116491. * });
  116492. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  116493. */
  116494. function forInRight(object, iteratee) {
  116495. return object == null
  116496. ? object
  116497. : Object(_baseForRight_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee), _keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
  116498. }
  116499. /* harmony default export */ __webpack_exports__["default"] = (forInRight);
  116500. /***/ }),
  116501. /***/ "./node_modules/lodash-es/forOwn.js":
  116502. /*!******************************************!*\
  116503. !*** ./node_modules/lodash-es/forOwn.js ***!
  116504. \******************************************/
  116505. /*! exports provided: default */
  116506. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116507. "use strict";
  116508. __webpack_require__.r(__webpack_exports__);
  116509. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  116510. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  116511. /**
  116512. * Iterates over own enumerable string keyed properties of an object and
  116513. * invokes `iteratee` for each property. The iteratee is invoked with three
  116514. * arguments: (value, key, object). Iteratee functions may exit iteration
  116515. * early by explicitly returning `false`.
  116516. *
  116517. * @static
  116518. * @memberOf _
  116519. * @since 0.3.0
  116520. * @category Object
  116521. * @param {Object} object The object to iterate over.
  116522. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  116523. * @returns {Object} Returns `object`.
  116524. * @see _.forOwnRight
  116525. * @example
  116526. *
  116527. * function Foo() {
  116528. * this.a = 1;
  116529. * this.b = 2;
  116530. * }
  116531. *
  116532. * Foo.prototype.c = 3;
  116533. *
  116534. * _.forOwn(new Foo, function(value, key) {
  116535. * console.log(key);
  116536. * });
  116537. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  116538. */
  116539. function forOwn(object, iteratee) {
  116540. return object && Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee));
  116541. }
  116542. /* harmony default export */ __webpack_exports__["default"] = (forOwn);
  116543. /***/ }),
  116544. /***/ "./node_modules/lodash-es/forOwnRight.js":
  116545. /*!***********************************************!*\
  116546. !*** ./node_modules/lodash-es/forOwnRight.js ***!
  116547. \***********************************************/
  116548. /*! exports provided: default */
  116549. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116550. "use strict";
  116551. __webpack_require__.r(__webpack_exports__);
  116552. /* harmony import */ var _baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwnRight.js */ "./node_modules/lodash-es/_baseForOwnRight.js");
  116553. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  116554. /**
  116555. * This method is like `_.forOwn` except that it iterates over properties of
  116556. * `object` in the opposite order.
  116557. *
  116558. * @static
  116559. * @memberOf _
  116560. * @since 2.0.0
  116561. * @category Object
  116562. * @param {Object} object The object to iterate over.
  116563. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  116564. * @returns {Object} Returns `object`.
  116565. * @see _.forOwn
  116566. * @example
  116567. *
  116568. * function Foo() {
  116569. * this.a = 1;
  116570. * this.b = 2;
  116571. * }
  116572. *
  116573. * Foo.prototype.c = 3;
  116574. *
  116575. * _.forOwnRight(new Foo, function(value, key) {
  116576. * console.log(key);
  116577. * });
  116578. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  116579. */
  116580. function forOwnRight(object, iteratee) {
  116581. return object && Object(_baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee));
  116582. }
  116583. /* harmony default export */ __webpack_exports__["default"] = (forOwnRight);
  116584. /***/ }),
  116585. /***/ "./node_modules/lodash-es/fromPairs.js":
  116586. /*!*********************************************!*\
  116587. !*** ./node_modules/lodash-es/fromPairs.js ***!
  116588. \*********************************************/
  116589. /*! exports provided: default */
  116590. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116591. "use strict";
  116592. __webpack_require__.r(__webpack_exports__);
  116593. /**
  116594. * The inverse of `_.toPairs`; this method returns an object composed
  116595. * from key-value `pairs`.
  116596. *
  116597. * @static
  116598. * @memberOf _
  116599. * @since 4.0.0
  116600. * @category Array
  116601. * @param {Array} pairs The key-value pairs.
  116602. * @returns {Object} Returns the new object.
  116603. * @example
  116604. *
  116605. * _.fromPairs([['a', 1], ['b', 2]]);
  116606. * // => { 'a': 1, 'b': 2 }
  116607. */
  116608. function fromPairs(pairs) {
  116609. var index = -1,
  116610. length = pairs == null ? 0 : pairs.length,
  116611. result = {};
  116612. while (++index < length) {
  116613. var pair = pairs[index];
  116614. result[pair[0]] = pair[1];
  116615. }
  116616. return result;
  116617. }
  116618. /* harmony default export */ __webpack_exports__["default"] = (fromPairs);
  116619. /***/ }),
  116620. /***/ "./node_modules/lodash-es/function.default.js":
  116621. /*!****************************************************!*\
  116622. !*** ./node_modules/lodash-es/function.default.js ***!
  116623. \****************************************************/
  116624. /*! exports provided: default */
  116625. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116626. "use strict";
  116627. __webpack_require__.r(__webpack_exports__);
  116628. /* harmony import */ var _after_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./after.js */ "./node_modules/lodash-es/after.js");
  116629. /* harmony import */ var _ary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ary.js */ "./node_modules/lodash-es/ary.js");
  116630. /* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./before.js */ "./node_modules/lodash-es/before.js");
  116631. /* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bind.js */ "./node_modules/lodash-es/bind.js");
  116632. /* harmony import */ var _bindKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bindKey.js */ "./node_modules/lodash-es/bindKey.js");
  116633. /* harmony import */ var _curry_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./curry.js */ "./node_modules/lodash-es/curry.js");
  116634. /* harmony import */ var _curryRight_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./curryRight.js */ "./node_modules/lodash-es/curryRight.js");
  116635. /* harmony import */ var _debounce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./debounce.js */ "./node_modules/lodash-es/debounce.js");
  116636. /* harmony import */ var _defer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./defer.js */ "./node_modules/lodash-es/defer.js");
  116637. /* harmony import */ var _delay_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./delay.js */ "./node_modules/lodash-es/delay.js");
  116638. /* harmony import */ var _flip_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./flip.js */ "./node_modules/lodash-es/flip.js");
  116639. /* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/lodash-es/memoize.js");
  116640. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  116641. /* harmony import */ var _once_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./once.js */ "./node_modules/lodash-es/once.js");
  116642. /* harmony import */ var _overArgs_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./overArgs.js */ "./node_modules/lodash-es/overArgs.js");
  116643. /* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./partial.js */ "./node_modules/lodash-es/partial.js");
  116644. /* harmony import */ var _partialRight_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./partialRight.js */ "./node_modules/lodash-es/partialRight.js");
  116645. /* harmony import */ var _rearg_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./rearg.js */ "./node_modules/lodash-es/rearg.js");
  116646. /* harmony import */ var _rest_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./rest.js */ "./node_modules/lodash-es/rest.js");
  116647. /* harmony import */ var _spread_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./spread.js */ "./node_modules/lodash-es/spread.js");
  116648. /* harmony import */ var _throttle_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./throttle.js */ "./node_modules/lodash-es/throttle.js");
  116649. /* harmony import */ var _unary_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./unary.js */ "./node_modules/lodash-es/unary.js");
  116650. /* harmony import */ var _wrap_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./wrap.js */ "./node_modules/lodash-es/wrap.js");
  116651. /* harmony default export */ __webpack_exports__["default"] = ({
  116652. after: _after_js__WEBPACK_IMPORTED_MODULE_0__["default"], ary: _ary_js__WEBPACK_IMPORTED_MODULE_1__["default"], before: _before_js__WEBPACK_IMPORTED_MODULE_2__["default"], bind: _bind_js__WEBPACK_IMPORTED_MODULE_3__["default"], bindKey: _bindKey_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  116653. curry: _curry_js__WEBPACK_IMPORTED_MODULE_5__["default"], curryRight: _curryRight_js__WEBPACK_IMPORTED_MODULE_6__["default"], debounce: _debounce_js__WEBPACK_IMPORTED_MODULE_7__["default"], defer: _defer_js__WEBPACK_IMPORTED_MODULE_8__["default"], delay: _delay_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  116654. flip: _flip_js__WEBPACK_IMPORTED_MODULE_10__["default"], memoize: _memoize_js__WEBPACK_IMPORTED_MODULE_11__["default"], negate: _negate_js__WEBPACK_IMPORTED_MODULE_12__["default"], once: _once_js__WEBPACK_IMPORTED_MODULE_13__["default"], overArgs: _overArgs_js__WEBPACK_IMPORTED_MODULE_14__["default"],
  116655. partial: _partial_js__WEBPACK_IMPORTED_MODULE_15__["default"], partialRight: _partialRight_js__WEBPACK_IMPORTED_MODULE_16__["default"], rearg: _rearg_js__WEBPACK_IMPORTED_MODULE_17__["default"], rest: _rest_js__WEBPACK_IMPORTED_MODULE_18__["default"], spread: _spread_js__WEBPACK_IMPORTED_MODULE_19__["default"],
  116656. throttle: _throttle_js__WEBPACK_IMPORTED_MODULE_20__["default"], unary: _unary_js__WEBPACK_IMPORTED_MODULE_21__["default"], wrap: _wrap_js__WEBPACK_IMPORTED_MODULE_22__["default"]
  116657. });
  116658. /***/ }),
  116659. /***/ "./node_modules/lodash-es/function.js":
  116660. /*!********************************************!*\
  116661. !*** ./node_modules/lodash-es/function.js ***!
  116662. \********************************************/
  116663. /*! exports provided: after, ary, before, bind, bindKey, curry, curryRight, debounce, defer, delay, flip, memoize, negate, once, overArgs, partial, partialRight, rearg, rest, spread, throttle, unary, wrap, default */
  116664. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116665. "use strict";
  116666. __webpack_require__.r(__webpack_exports__);
  116667. /* harmony import */ var _after_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./after.js */ "./node_modules/lodash-es/after.js");
  116668. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "after", function() { return _after_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  116669. /* harmony import */ var _ary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ary.js */ "./node_modules/lodash-es/ary.js");
  116670. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ary", function() { return _ary_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  116671. /* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./before.js */ "./node_modules/lodash-es/before.js");
  116672. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "before", function() { return _before_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  116673. /* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bind.js */ "./node_modules/lodash-es/bind.js");
  116674. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return _bind_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  116675. /* harmony import */ var _bindKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bindKey.js */ "./node_modules/lodash-es/bindKey.js");
  116676. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindKey", function() { return _bindKey_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  116677. /* harmony import */ var _curry_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./curry.js */ "./node_modules/lodash-es/curry.js");
  116678. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curry", function() { return _curry_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  116679. /* harmony import */ var _curryRight_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./curryRight.js */ "./node_modules/lodash-es/curryRight.js");
  116680. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curryRight", function() { return _curryRight_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  116681. /* harmony import */ var _debounce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./debounce.js */ "./node_modules/lodash-es/debounce.js");
  116682. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _debounce_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  116683. /* harmony import */ var _defer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./defer.js */ "./node_modules/lodash-es/defer.js");
  116684. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return _defer_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  116685. /* harmony import */ var _delay_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./delay.js */ "./node_modules/lodash-es/delay.js");
  116686. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return _delay_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  116687. /* harmony import */ var _flip_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./flip.js */ "./node_modules/lodash-es/flip.js");
  116688. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flip", function() { return _flip_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  116689. /* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/lodash-es/memoize.js");
  116690. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return _memoize_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  116691. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  116692. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return _negate_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  116693. /* harmony import */ var _once_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./once.js */ "./node_modules/lodash-es/once.js");
  116694. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "once", function() { return _once_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  116695. /* harmony import */ var _overArgs_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./overArgs.js */ "./node_modules/lodash-es/overArgs.js");
  116696. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overArgs", function() { return _overArgs_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  116697. /* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./partial.js */ "./node_modules/lodash-es/partial.js");
  116698. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return _partial_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  116699. /* harmony import */ var _partialRight_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./partialRight.js */ "./node_modules/lodash-es/partialRight.js");
  116700. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partialRight", function() { return _partialRight_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  116701. /* harmony import */ var _rearg_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./rearg.js */ "./node_modules/lodash-es/rearg.js");
  116702. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rearg", function() { return _rearg_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  116703. /* harmony import */ var _rest_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./rest.js */ "./node_modules/lodash-es/rest.js");
  116704. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return _rest_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  116705. /* harmony import */ var _spread_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./spread.js */ "./node_modules/lodash-es/spread.js");
  116706. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "spread", function() { return _spread_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  116707. /* harmony import */ var _throttle_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./throttle.js */ "./node_modules/lodash-es/throttle.js");
  116708. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return _throttle_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  116709. /* harmony import */ var _unary_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./unary.js */ "./node_modules/lodash-es/unary.js");
  116710. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unary", function() { return _unary_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  116711. /* harmony import */ var _wrap_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./wrap.js */ "./node_modules/lodash-es/wrap.js");
  116712. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _wrap_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  116713. /* harmony import */ var _function_default_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./function.default.js */ "./node_modules/lodash-es/function.default.js");
  116714. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _function_default_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  116715. /***/ }),
  116716. /***/ "./node_modules/lodash-es/functions.js":
  116717. /*!*********************************************!*\
  116718. !*** ./node_modules/lodash-es/functions.js ***!
  116719. \*********************************************/
  116720. /*! exports provided: default */
  116721. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116722. "use strict";
  116723. __webpack_require__.r(__webpack_exports__);
  116724. /* harmony import */ var _baseFunctions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFunctions.js */ "./node_modules/lodash-es/_baseFunctions.js");
  116725. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  116726. /**
  116727. * Creates an array of function property names from own enumerable properties
  116728. * of `object`.
  116729. *
  116730. * @static
  116731. * @since 0.1.0
  116732. * @memberOf _
  116733. * @category Object
  116734. * @param {Object} object The object to inspect.
  116735. * @returns {Array} Returns the function names.
  116736. * @see _.functionsIn
  116737. * @example
  116738. *
  116739. * function Foo() {
  116740. * this.a = _.constant('a');
  116741. * this.b = _.constant('b');
  116742. * }
  116743. *
  116744. * Foo.prototype.c = _.constant('c');
  116745. *
  116746. * _.functions(new Foo);
  116747. * // => ['a', 'b']
  116748. */
  116749. function functions(object) {
  116750. return object == null ? [] : Object(_baseFunctions_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
  116751. }
  116752. /* harmony default export */ __webpack_exports__["default"] = (functions);
  116753. /***/ }),
  116754. /***/ "./node_modules/lodash-es/functionsIn.js":
  116755. /*!***********************************************!*\
  116756. !*** ./node_modules/lodash-es/functionsIn.js ***!
  116757. \***********************************************/
  116758. /*! exports provided: default */
  116759. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116760. "use strict";
  116761. __webpack_require__.r(__webpack_exports__);
  116762. /* harmony import */ var _baseFunctions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFunctions.js */ "./node_modules/lodash-es/_baseFunctions.js");
  116763. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  116764. /**
  116765. * Creates an array of function property names from own and inherited
  116766. * enumerable properties of `object`.
  116767. *
  116768. * @static
  116769. * @memberOf _
  116770. * @since 4.0.0
  116771. * @category Object
  116772. * @param {Object} object The object to inspect.
  116773. * @returns {Array} Returns the function names.
  116774. * @see _.functions
  116775. * @example
  116776. *
  116777. * function Foo() {
  116778. * this.a = _.constant('a');
  116779. * this.b = _.constant('b');
  116780. * }
  116781. *
  116782. * Foo.prototype.c = _.constant('c');
  116783. *
  116784. * _.functionsIn(new Foo);
  116785. * // => ['a', 'b', 'c']
  116786. */
  116787. function functionsIn(object) {
  116788. return object == null ? [] : Object(_baseFunctions_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
  116789. }
  116790. /* harmony default export */ __webpack_exports__["default"] = (functionsIn);
  116791. /***/ }),
  116792. /***/ "./node_modules/lodash-es/get.js":
  116793. /*!***************************************!*\
  116794. !*** ./node_modules/lodash-es/get.js ***!
  116795. \***************************************/
  116796. /*! exports provided: default */
  116797. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116798. "use strict";
  116799. __webpack_require__.r(__webpack_exports__);
  116800. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  116801. /**
  116802. * Gets the value at `path` of `object`. If the resolved value is
  116803. * `undefined`, the `defaultValue` is returned in its place.
  116804. *
  116805. * @static
  116806. * @memberOf _
  116807. * @since 3.7.0
  116808. * @category Object
  116809. * @param {Object} object The object to query.
  116810. * @param {Array|string} path The path of the property to get.
  116811. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  116812. * @returns {*} Returns the resolved value.
  116813. * @example
  116814. *
  116815. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  116816. *
  116817. * _.get(object, 'a[0].b.c');
  116818. * // => 3
  116819. *
  116820. * _.get(object, ['a', '0', 'b', 'c']);
  116821. * // => 3
  116822. *
  116823. * _.get(object, 'a.b.c', 'default');
  116824. * // => 'default'
  116825. */
  116826. function get(object, path, defaultValue) {
  116827. var result = object == null ? undefined : Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
  116828. return result === undefined ? defaultValue : result;
  116829. }
  116830. /* harmony default export */ __webpack_exports__["default"] = (get);
  116831. /***/ }),
  116832. /***/ "./node_modules/lodash-es/groupBy.js":
  116833. /*!*******************************************!*\
  116834. !*** ./node_modules/lodash-es/groupBy.js ***!
  116835. \*******************************************/
  116836. /*! exports provided: default */
  116837. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116838. "use strict";
  116839. __webpack_require__.r(__webpack_exports__);
  116840. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  116841. /* harmony import */ var _createAggregator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAggregator.js */ "./node_modules/lodash-es/_createAggregator.js");
  116842. /** Used for built-in method references. */
  116843. var objectProto = Object.prototype;
  116844. /** Used to check objects for own properties. */
  116845. var hasOwnProperty = objectProto.hasOwnProperty;
  116846. /**
  116847. * Creates an object composed of keys generated from the results of running
  116848. * each element of `collection` thru `iteratee`. The order of grouped values
  116849. * is determined by the order they occur in `collection`. The corresponding
  116850. * value of each key is an array of elements responsible for generating the
  116851. * key. The iteratee is invoked with one argument: (value).
  116852. *
  116853. * @static
  116854. * @memberOf _
  116855. * @since 0.1.0
  116856. * @category Collection
  116857. * @param {Array|Object} collection The collection to iterate over.
  116858. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  116859. * @returns {Object} Returns the composed aggregate object.
  116860. * @example
  116861. *
  116862. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  116863. * // => { '4': [4.2], '6': [6.1, 6.3] }
  116864. *
  116865. * // The `_.property` iteratee shorthand.
  116866. * _.groupBy(['one', 'two', 'three'], 'length');
  116867. * // => { '3': ['one', 'two'], '5': ['three'] }
  116868. */
  116869. var groupBy = Object(_createAggregator_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
  116870. if (hasOwnProperty.call(result, key)) {
  116871. result[key].push(value);
  116872. } else {
  116873. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, key, [value]);
  116874. }
  116875. });
  116876. /* harmony default export */ __webpack_exports__["default"] = (groupBy);
  116877. /***/ }),
  116878. /***/ "./node_modules/lodash-es/gt.js":
  116879. /*!**************************************!*\
  116880. !*** ./node_modules/lodash-es/gt.js ***!
  116881. \**************************************/
  116882. /*! exports provided: default */
  116883. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116884. "use strict";
  116885. __webpack_require__.r(__webpack_exports__);
  116886. /* harmony import */ var _baseGt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGt.js */ "./node_modules/lodash-es/_baseGt.js");
  116887. /* harmony import */ var _createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createRelationalOperation.js */ "./node_modules/lodash-es/_createRelationalOperation.js");
  116888. /**
  116889. * Checks if `value` is greater than `other`.
  116890. *
  116891. * @static
  116892. * @memberOf _
  116893. * @since 3.9.0
  116894. * @category Lang
  116895. * @param {*} value The value to compare.
  116896. * @param {*} other The other value to compare.
  116897. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  116898. * else `false`.
  116899. * @see _.lt
  116900. * @example
  116901. *
  116902. * _.gt(3, 1);
  116903. * // => true
  116904. *
  116905. * _.gt(3, 3);
  116906. * // => false
  116907. *
  116908. * _.gt(1, 3);
  116909. * // => false
  116910. */
  116911. var gt = Object(_createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseGt_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  116912. /* harmony default export */ __webpack_exports__["default"] = (gt);
  116913. /***/ }),
  116914. /***/ "./node_modules/lodash-es/gte.js":
  116915. /*!***************************************!*\
  116916. !*** ./node_modules/lodash-es/gte.js ***!
  116917. \***************************************/
  116918. /*! exports provided: default */
  116919. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116920. "use strict";
  116921. __webpack_require__.r(__webpack_exports__);
  116922. /* harmony import */ var _createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRelationalOperation.js */ "./node_modules/lodash-es/_createRelationalOperation.js");
  116923. /**
  116924. * Checks if `value` is greater than or equal to `other`.
  116925. *
  116926. * @static
  116927. * @memberOf _
  116928. * @since 3.9.0
  116929. * @category Lang
  116930. * @param {*} value The value to compare.
  116931. * @param {*} other The other value to compare.
  116932. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  116933. * `other`, else `false`.
  116934. * @see _.lte
  116935. * @example
  116936. *
  116937. * _.gte(3, 1);
  116938. * // => true
  116939. *
  116940. * _.gte(3, 3);
  116941. * // => true
  116942. *
  116943. * _.gte(1, 3);
  116944. * // => false
  116945. */
  116946. var gte = Object(_createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(value, other) {
  116947. return value >= other;
  116948. });
  116949. /* harmony default export */ __webpack_exports__["default"] = (gte);
  116950. /***/ }),
  116951. /***/ "./node_modules/lodash-es/has.js":
  116952. /*!***************************************!*\
  116953. !*** ./node_modules/lodash-es/has.js ***!
  116954. \***************************************/
  116955. /*! exports provided: default */
  116956. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116957. "use strict";
  116958. __webpack_require__.r(__webpack_exports__);
  116959. /* harmony import */ var _baseHas_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseHas.js */ "./node_modules/lodash-es/_baseHas.js");
  116960. /* harmony import */ var _hasPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasPath.js */ "./node_modules/lodash-es/_hasPath.js");
  116961. /**
  116962. * Checks if `path` is a direct property of `object`.
  116963. *
  116964. * @static
  116965. * @since 0.1.0
  116966. * @memberOf _
  116967. * @category Object
  116968. * @param {Object} object The object to query.
  116969. * @param {Array|string} path The path to check.
  116970. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  116971. * @example
  116972. *
  116973. * var object = { 'a': { 'b': 2 } };
  116974. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  116975. *
  116976. * _.has(object, 'a');
  116977. * // => true
  116978. *
  116979. * _.has(object, 'a.b');
  116980. * // => true
  116981. *
  116982. * _.has(object, ['a', 'b']);
  116983. * // => true
  116984. *
  116985. * _.has(other, 'a');
  116986. * // => false
  116987. */
  116988. function has(object, path) {
  116989. return object != null && Object(_hasPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path, _baseHas_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  116990. }
  116991. /* harmony default export */ __webpack_exports__["default"] = (has);
  116992. /***/ }),
  116993. /***/ "./node_modules/lodash-es/hasIn.js":
  116994. /*!*****************************************!*\
  116995. !*** ./node_modules/lodash-es/hasIn.js ***!
  116996. \*****************************************/
  116997. /*! exports provided: default */
  116998. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116999. "use strict";
  117000. __webpack_require__.r(__webpack_exports__);
  117001. /* harmony import */ var _baseHasIn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseHasIn.js */ "./node_modules/lodash-es/_baseHasIn.js");
  117002. /* harmony import */ var _hasPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasPath.js */ "./node_modules/lodash-es/_hasPath.js");
  117003. /**
  117004. * Checks if `path` is a direct or inherited property of `object`.
  117005. *
  117006. * @static
  117007. * @memberOf _
  117008. * @since 4.0.0
  117009. * @category Object
  117010. * @param {Object} object The object to query.
  117011. * @param {Array|string} path The path to check.
  117012. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  117013. * @example
  117014. *
  117015. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  117016. *
  117017. * _.hasIn(object, 'a');
  117018. * // => true
  117019. *
  117020. * _.hasIn(object, 'a.b');
  117021. * // => true
  117022. *
  117023. * _.hasIn(object, ['a', 'b']);
  117024. * // => true
  117025. *
  117026. * _.hasIn(object, 'b');
  117027. * // => false
  117028. */
  117029. function hasIn(object, path) {
  117030. return object != null && Object(_hasPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path, _baseHasIn_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  117031. }
  117032. /* harmony default export */ __webpack_exports__["default"] = (hasIn);
  117033. /***/ }),
  117034. /***/ "./node_modules/lodash-es/head.js":
  117035. /*!****************************************!*\
  117036. !*** ./node_modules/lodash-es/head.js ***!
  117037. \****************************************/
  117038. /*! exports provided: default */
  117039. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117040. "use strict";
  117041. __webpack_require__.r(__webpack_exports__);
  117042. /**
  117043. * Gets the first element of `array`.
  117044. *
  117045. * @static
  117046. * @memberOf _
  117047. * @since 0.1.0
  117048. * @alias first
  117049. * @category Array
  117050. * @param {Array} array The array to query.
  117051. * @returns {*} Returns the first element of `array`.
  117052. * @example
  117053. *
  117054. * _.head([1, 2, 3]);
  117055. * // => 1
  117056. *
  117057. * _.head([]);
  117058. * // => undefined
  117059. */
  117060. function head(array) {
  117061. return (array && array.length) ? array[0] : undefined;
  117062. }
  117063. /* harmony default export */ __webpack_exports__["default"] = (head);
  117064. /***/ }),
  117065. /***/ "./node_modules/lodash-es/identity.js":
  117066. /*!********************************************!*\
  117067. !*** ./node_modules/lodash-es/identity.js ***!
  117068. \********************************************/
  117069. /*! exports provided: default */
  117070. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117071. "use strict";
  117072. __webpack_require__.r(__webpack_exports__);
  117073. /**
  117074. * This method returns the first argument it receives.
  117075. *
  117076. * @static
  117077. * @since 0.1.0
  117078. * @memberOf _
  117079. * @category Util
  117080. * @param {*} value Any value.
  117081. * @returns {*} Returns `value`.
  117082. * @example
  117083. *
  117084. * var object = { 'a': 1 };
  117085. *
  117086. * console.log(_.identity(object) === object);
  117087. * // => true
  117088. */
  117089. function identity(value) {
  117090. return value;
  117091. }
  117092. /* harmony default export */ __webpack_exports__["default"] = (identity);
  117093. /***/ }),
  117094. /***/ "./node_modules/lodash-es/inRange.js":
  117095. /*!*******************************************!*\
  117096. !*** ./node_modules/lodash-es/inRange.js ***!
  117097. \*******************************************/
  117098. /*! exports provided: default */
  117099. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117100. "use strict";
  117101. __webpack_require__.r(__webpack_exports__);
  117102. /* harmony import */ var _baseInRange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInRange.js */ "./node_modules/lodash-es/_baseInRange.js");
  117103. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  117104. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  117105. /**
  117106. * Checks if `n` is between `start` and up to, but not including, `end`. If
  117107. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  117108. * If `start` is greater than `end` the params are swapped to support
  117109. * negative ranges.
  117110. *
  117111. * @static
  117112. * @memberOf _
  117113. * @since 3.3.0
  117114. * @category Number
  117115. * @param {number} number The number to check.
  117116. * @param {number} [start=0] The start of the range.
  117117. * @param {number} end The end of the range.
  117118. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  117119. * @see _.range, _.rangeRight
  117120. * @example
  117121. *
  117122. * _.inRange(3, 2, 4);
  117123. * // => true
  117124. *
  117125. * _.inRange(4, 8);
  117126. * // => true
  117127. *
  117128. * _.inRange(4, 2);
  117129. * // => false
  117130. *
  117131. * _.inRange(2, 2);
  117132. * // => false
  117133. *
  117134. * _.inRange(1.2, 2);
  117135. * // => true
  117136. *
  117137. * _.inRange(5.2, 4);
  117138. * // => false
  117139. *
  117140. * _.inRange(-3, -2, -6);
  117141. * // => true
  117142. */
  117143. function inRange(number, start, end) {
  117144. start = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start);
  117145. if (end === undefined) {
  117146. end = start;
  117147. start = 0;
  117148. } else {
  117149. end = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_1__["default"])(end);
  117150. }
  117151. number = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(number);
  117152. return Object(_baseInRange_js__WEBPACK_IMPORTED_MODULE_0__["default"])(number, start, end);
  117153. }
  117154. /* harmony default export */ __webpack_exports__["default"] = (inRange);
  117155. /***/ }),
  117156. /***/ "./node_modules/lodash-es/includes.js":
  117157. /*!********************************************!*\
  117158. !*** ./node_modules/lodash-es/includes.js ***!
  117159. \********************************************/
  117160. /*! exports provided: default */
  117161. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117162. "use strict";
  117163. __webpack_require__.r(__webpack_exports__);
  117164. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  117165. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  117166. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  117167. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  117168. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  117169. /* Built-in method references for those with the same name as other `lodash` methods. */
  117170. var nativeMax = Math.max;
  117171. /**
  117172. * Checks if `value` is in `collection`. If `collection` is a string, it's
  117173. * checked for a substring of `value`, otherwise
  117174. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  117175. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  117176. * the offset from the end of `collection`.
  117177. *
  117178. * @static
  117179. * @memberOf _
  117180. * @since 0.1.0
  117181. * @category Collection
  117182. * @param {Array|Object|string} collection The collection to inspect.
  117183. * @param {*} value The value to search for.
  117184. * @param {number} [fromIndex=0] The index to search from.
  117185. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  117186. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  117187. * @example
  117188. *
  117189. * _.includes([1, 2, 3], 1);
  117190. * // => true
  117191. *
  117192. * _.includes([1, 2, 3], 1, 2);
  117193. * // => false
  117194. *
  117195. * _.includes({ 'a': 1, 'b': 2 }, 1);
  117196. * // => true
  117197. *
  117198. * _.includes('abcd', 'bc');
  117199. * // => true
  117200. */
  117201. function includes(collection, value, fromIndex, guard) {
  117202. collection = Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection) ? collection : Object(_values_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection);
  117203. fromIndex = (fromIndex && !guard) ? Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_3__["default"])(fromIndex) : 0;
  117204. var length = collection.length;
  117205. if (fromIndex < 0) {
  117206. fromIndex = nativeMax(length + fromIndex, 0);
  117207. }
  117208. return Object(_isString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection)
  117209. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  117210. : (!!length && Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, value, fromIndex) > -1);
  117211. }
  117212. /* harmony default export */ __webpack_exports__["default"] = (includes);
  117213. /***/ }),
  117214. /***/ "./node_modules/lodash-es/indexOf.js":
  117215. /*!*******************************************!*\
  117216. !*** ./node_modules/lodash-es/indexOf.js ***!
  117217. \*******************************************/
  117218. /*! exports provided: default */
  117219. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117220. "use strict";
  117221. __webpack_require__.r(__webpack_exports__);
  117222. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  117223. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  117224. /* Built-in method references for those with the same name as other `lodash` methods. */
  117225. var nativeMax = Math.max;
  117226. /**
  117227. * Gets the index at which the first occurrence of `value` is found in `array`
  117228. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  117229. * for equality comparisons. If `fromIndex` is negative, it's used as the
  117230. * offset from the end of `array`.
  117231. *
  117232. * @static
  117233. * @memberOf _
  117234. * @since 0.1.0
  117235. * @category Array
  117236. * @param {Array} array The array to inspect.
  117237. * @param {*} value The value to search for.
  117238. * @param {number} [fromIndex=0] The index to search from.
  117239. * @returns {number} Returns the index of the matched value, else `-1`.
  117240. * @example
  117241. *
  117242. * _.indexOf([1, 2, 1, 2], 2);
  117243. * // => 1
  117244. *
  117245. * // Search from the `fromIndex`.
  117246. * _.indexOf([1, 2, 1, 2], 2, 2);
  117247. * // => 3
  117248. */
  117249. function indexOf(array, value, fromIndex) {
  117250. var length = array == null ? 0 : array.length;
  117251. if (!length) {
  117252. return -1;
  117253. }
  117254. var index = fromIndex == null ? 0 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(fromIndex);
  117255. if (index < 0) {
  117256. index = nativeMax(length + index, 0);
  117257. }
  117258. return Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, index);
  117259. }
  117260. /* harmony default export */ __webpack_exports__["default"] = (indexOf);
  117261. /***/ }),
  117262. /***/ "./node_modules/lodash-es/initial.js":
  117263. /*!*******************************************!*\
  117264. !*** ./node_modules/lodash-es/initial.js ***!
  117265. \*******************************************/
  117266. /*! exports provided: default */
  117267. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117268. "use strict";
  117269. __webpack_require__.r(__webpack_exports__);
  117270. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  117271. /**
  117272. * Gets all but the last element of `array`.
  117273. *
  117274. * @static
  117275. * @memberOf _
  117276. * @since 0.1.0
  117277. * @category Array
  117278. * @param {Array} array The array to query.
  117279. * @returns {Array} Returns the slice of `array`.
  117280. * @example
  117281. *
  117282. * _.initial([1, 2, 3]);
  117283. * // => [1, 2]
  117284. */
  117285. function initial(array) {
  117286. var length = array == null ? 0 : array.length;
  117287. return length ? Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 0, -1) : [];
  117288. }
  117289. /* harmony default export */ __webpack_exports__["default"] = (initial);
  117290. /***/ }),
  117291. /***/ "./node_modules/lodash-es/intersection.js":
  117292. /*!************************************************!*\
  117293. !*** ./node_modules/lodash-es/intersection.js ***!
  117294. \************************************************/
  117295. /*! exports provided: default */
  117296. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117297. "use strict";
  117298. __webpack_require__.r(__webpack_exports__);
  117299. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  117300. /* harmony import */ var _baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIntersection.js */ "./node_modules/lodash-es/_baseIntersection.js");
  117301. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  117302. /* harmony import */ var _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_castArrayLikeObject.js */ "./node_modules/lodash-es/_castArrayLikeObject.js");
  117303. /**
  117304. * Creates an array of unique values that are included in all given arrays
  117305. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  117306. * for equality comparisons. The order and references of result values are
  117307. * determined by the first array.
  117308. *
  117309. * @static
  117310. * @memberOf _
  117311. * @since 0.1.0
  117312. * @category Array
  117313. * @param {...Array} [arrays] The arrays to inspect.
  117314. * @returns {Array} Returns the new array of intersecting values.
  117315. * @example
  117316. *
  117317. * _.intersection([2, 1], [2, 3]);
  117318. * // => [2]
  117319. */
  117320. var intersection = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(arrays) {
  117321. var mapped = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"]);
  117322. return (mapped.length && mapped[0] === arrays[0])
  117323. ? Object(_baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__["default"])(mapped)
  117324. : [];
  117325. });
  117326. /* harmony default export */ __webpack_exports__["default"] = (intersection);
  117327. /***/ }),
  117328. /***/ "./node_modules/lodash-es/intersectionBy.js":
  117329. /*!**************************************************!*\
  117330. !*** ./node_modules/lodash-es/intersectionBy.js ***!
  117331. \**************************************************/
  117332. /*! exports provided: default */
  117333. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117334. "use strict";
  117335. __webpack_require__.r(__webpack_exports__);
  117336. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  117337. /* harmony import */ var _baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIntersection.js */ "./node_modules/lodash-es/_baseIntersection.js");
  117338. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  117339. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  117340. /* harmony import */ var _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_castArrayLikeObject.js */ "./node_modules/lodash-es/_castArrayLikeObject.js");
  117341. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  117342. /**
  117343. * This method is like `_.intersection` except that it accepts `iteratee`
  117344. * which is invoked for each element of each `arrays` to generate the criterion
  117345. * by which they're compared. The order and references of result values are
  117346. * determined by the first array. The iteratee is invoked with one argument:
  117347. * (value).
  117348. *
  117349. * @static
  117350. * @memberOf _
  117351. * @since 4.0.0
  117352. * @category Array
  117353. * @param {...Array} [arrays] The arrays to inspect.
  117354. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  117355. * @returns {Array} Returns the new array of intersecting values.
  117356. * @example
  117357. *
  117358. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  117359. * // => [2.1]
  117360. *
  117361. * // The `_.property` iteratee shorthand.
  117362. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  117363. * // => [{ 'x': 1 }]
  117364. */
  117365. var intersectionBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(arrays) {
  117366. var iteratee = Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(arrays),
  117367. mapped = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"]);
  117368. if (iteratee === Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(mapped)) {
  117369. iteratee = undefined;
  117370. } else {
  117371. mapped.pop();
  117372. }
  117373. return (mapped.length && mapped[0] === arrays[0])
  117374. ? Object(_baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__["default"])(mapped, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 2))
  117375. : [];
  117376. });
  117377. /* harmony default export */ __webpack_exports__["default"] = (intersectionBy);
  117378. /***/ }),
  117379. /***/ "./node_modules/lodash-es/intersectionWith.js":
  117380. /*!****************************************************!*\
  117381. !*** ./node_modules/lodash-es/intersectionWith.js ***!
  117382. \****************************************************/
  117383. /*! exports provided: default */
  117384. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117385. "use strict";
  117386. __webpack_require__.r(__webpack_exports__);
  117387. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  117388. /* harmony import */ var _baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIntersection.js */ "./node_modules/lodash-es/_baseIntersection.js");
  117389. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  117390. /* harmony import */ var _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_castArrayLikeObject.js */ "./node_modules/lodash-es/_castArrayLikeObject.js");
  117391. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  117392. /**
  117393. * This method is like `_.intersection` except that it accepts `comparator`
  117394. * which is invoked to compare elements of `arrays`. The order and references
  117395. * of result values are determined by the first array. The comparator is
  117396. * invoked with two arguments: (arrVal, othVal).
  117397. *
  117398. * @static
  117399. * @memberOf _
  117400. * @since 4.0.0
  117401. * @category Array
  117402. * @param {...Array} [arrays] The arrays to inspect.
  117403. * @param {Function} [comparator] The comparator invoked per element.
  117404. * @returns {Array} Returns the new array of intersecting values.
  117405. * @example
  117406. *
  117407. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  117408. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  117409. *
  117410. * _.intersectionWith(objects, others, _.isEqual);
  117411. * // => [{ 'x': 1, 'y': 2 }]
  117412. */
  117413. var intersectionWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(arrays) {
  117414. var comparator = Object(_last_js__WEBPACK_IMPORTED_MODULE_4__["default"])(arrays),
  117415. mapped = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"]);
  117416. comparator = typeof comparator == 'function' ? comparator : undefined;
  117417. if (comparator) {
  117418. mapped.pop();
  117419. }
  117420. return (mapped.length && mapped[0] === arrays[0])
  117421. ? Object(_baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__["default"])(mapped, undefined, comparator)
  117422. : [];
  117423. });
  117424. /* harmony default export */ __webpack_exports__["default"] = (intersectionWith);
  117425. /***/ }),
  117426. /***/ "./node_modules/lodash-es/invert.js":
  117427. /*!******************************************!*\
  117428. !*** ./node_modules/lodash-es/invert.js ***!
  117429. \******************************************/
  117430. /*! exports provided: default */
  117431. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117432. "use strict";
  117433. __webpack_require__.r(__webpack_exports__);
  117434. /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
  117435. /* harmony import */ var _createInverter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createInverter.js */ "./node_modules/lodash-es/_createInverter.js");
  117436. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  117437. /** Used for built-in method references. */
  117438. var objectProto = Object.prototype;
  117439. /**
  117440. * Used to resolve the
  117441. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  117442. * of values.
  117443. */
  117444. var nativeObjectToString = objectProto.toString;
  117445. /**
  117446. * Creates an object composed of the inverted keys and values of `object`.
  117447. * If `object` contains duplicate values, subsequent values overwrite
  117448. * property assignments of previous values.
  117449. *
  117450. * @static
  117451. * @memberOf _
  117452. * @since 0.7.0
  117453. * @category Object
  117454. * @param {Object} object The object to invert.
  117455. * @returns {Object} Returns the new inverted object.
  117456. * @example
  117457. *
  117458. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  117459. *
  117460. * _.invert(object);
  117461. * // => { '1': 'c', '2': 'b' }
  117462. */
  117463. var invert = Object(_createInverter_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
  117464. if (value != null &&
  117465. typeof value.toString != 'function') {
  117466. value = nativeObjectToString.call(value);
  117467. }
  117468. result[value] = key;
  117469. }, Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_identity_js__WEBPACK_IMPORTED_MODULE_2__["default"]));
  117470. /* harmony default export */ __webpack_exports__["default"] = (invert);
  117471. /***/ }),
  117472. /***/ "./node_modules/lodash-es/invertBy.js":
  117473. /*!********************************************!*\
  117474. !*** ./node_modules/lodash-es/invertBy.js ***!
  117475. \********************************************/
  117476. /*! exports provided: default */
  117477. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117478. "use strict";
  117479. __webpack_require__.r(__webpack_exports__);
  117480. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  117481. /* harmony import */ var _createInverter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createInverter.js */ "./node_modules/lodash-es/_createInverter.js");
  117482. /** Used for built-in method references. */
  117483. var objectProto = Object.prototype;
  117484. /** Used to check objects for own properties. */
  117485. var hasOwnProperty = objectProto.hasOwnProperty;
  117486. /**
  117487. * Used to resolve the
  117488. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  117489. * of values.
  117490. */
  117491. var nativeObjectToString = objectProto.toString;
  117492. /**
  117493. * This method is like `_.invert` except that the inverted object is generated
  117494. * from the results of running each element of `object` thru `iteratee`. The
  117495. * corresponding inverted value of each inverted key is an array of keys
  117496. * responsible for generating the inverted value. The iteratee is invoked
  117497. * with one argument: (value).
  117498. *
  117499. * @static
  117500. * @memberOf _
  117501. * @since 4.1.0
  117502. * @category Object
  117503. * @param {Object} object The object to invert.
  117504. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  117505. * @returns {Object} Returns the new inverted object.
  117506. * @example
  117507. *
  117508. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  117509. *
  117510. * _.invertBy(object);
  117511. * // => { '1': ['a', 'c'], '2': ['b'] }
  117512. *
  117513. * _.invertBy(object, function(value) {
  117514. * return 'group' + value;
  117515. * });
  117516. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  117517. */
  117518. var invertBy = Object(_createInverter_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
  117519. if (value != null &&
  117520. typeof value.toString != 'function') {
  117521. value = nativeObjectToString.call(value);
  117522. }
  117523. if (hasOwnProperty.call(result, value)) {
  117524. result[value].push(key);
  117525. } else {
  117526. result[value] = [key];
  117527. }
  117528. }, _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  117529. /* harmony default export */ __webpack_exports__["default"] = (invertBy);
  117530. /***/ }),
  117531. /***/ "./node_modules/lodash-es/invoke.js":
  117532. /*!******************************************!*\
  117533. !*** ./node_modules/lodash-es/invoke.js ***!
  117534. \******************************************/
  117535. /*! exports provided: default */
  117536. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117537. "use strict";
  117538. __webpack_require__.r(__webpack_exports__);
  117539. /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
  117540. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  117541. /**
  117542. * Invokes the method at `path` of `object`.
  117543. *
  117544. * @static
  117545. * @memberOf _
  117546. * @since 4.0.0
  117547. * @category Object
  117548. * @param {Object} object The object to query.
  117549. * @param {Array|string} path The path of the method to invoke.
  117550. * @param {...*} [args] The arguments to invoke the method with.
  117551. * @returns {*} Returns the result of the invoked method.
  117552. * @example
  117553. *
  117554. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  117555. *
  117556. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  117557. * // => [2, 3]
  117558. */
  117559. var invoke = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  117560. /* harmony default export */ __webpack_exports__["default"] = (invoke);
  117561. /***/ }),
  117562. /***/ "./node_modules/lodash-es/invokeMap.js":
  117563. /*!*********************************************!*\
  117564. !*** ./node_modules/lodash-es/invokeMap.js ***!
  117565. \*********************************************/
  117566. /*! exports provided: default */
  117567. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117568. "use strict";
  117569. __webpack_require__.r(__webpack_exports__);
  117570. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  117571. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  117572. /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
  117573. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  117574. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  117575. /**
  117576. * Invokes the method at `path` of each element in `collection`, returning
  117577. * an array of the results of each invoked method. Any additional arguments
  117578. * are provided to each invoked method. If `path` is a function, it's invoked
  117579. * for, and `this` bound to, each element in `collection`.
  117580. *
  117581. * @static
  117582. * @memberOf _
  117583. * @since 4.0.0
  117584. * @category Collection
  117585. * @param {Array|Object} collection The collection to iterate over.
  117586. * @param {Array|Function|string} path The path of the method to invoke or
  117587. * the function invoked per iteration.
  117588. * @param {...*} [args] The arguments to invoke each method with.
  117589. * @returns {Array} Returns the array of results.
  117590. * @example
  117591. *
  117592. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  117593. * // => [[1, 5, 7], [1, 2, 3]]
  117594. *
  117595. * _.invokeMap([123, 456], String.prototype.split, '');
  117596. * // => [['1', '2', '3'], ['4', '5', '6']]
  117597. */
  117598. var invokeMap = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(collection, path, args) {
  117599. var index = -1,
  117600. isFunc = typeof path == 'function',
  117601. result = Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection) ? Array(collection.length) : [];
  117602. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, function(value) {
  117603. result[++index] = isFunc ? Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, value, args) : Object(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value, path, args);
  117604. });
  117605. return result;
  117606. });
  117607. /* harmony default export */ __webpack_exports__["default"] = (invokeMap);
  117608. /***/ }),
  117609. /***/ "./node_modules/lodash-es/isArguments.js":
  117610. /*!***********************************************!*\
  117611. !*** ./node_modules/lodash-es/isArguments.js ***!
  117612. \***********************************************/
  117613. /*! exports provided: default */
  117614. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117615. "use strict";
  117616. __webpack_require__.r(__webpack_exports__);
  117617. /* harmony import */ var _baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsArguments.js */ "./node_modules/lodash-es/_baseIsArguments.js");
  117618. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  117619. /** Used for built-in method references. */
  117620. var objectProto = Object.prototype;
  117621. /** Used to check objects for own properties. */
  117622. var hasOwnProperty = objectProto.hasOwnProperty;
  117623. /** Built-in value references. */
  117624. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  117625. /**
  117626. * Checks if `value` is likely an `arguments` object.
  117627. *
  117628. * @static
  117629. * @memberOf _
  117630. * @since 0.1.0
  117631. * @category Lang
  117632. * @param {*} value The value to check.
  117633. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  117634. * else `false`.
  117635. * @example
  117636. *
  117637. * _.isArguments(function() { return arguments; }());
  117638. * // => true
  117639. *
  117640. * _.isArguments([1, 2, 3]);
  117641. * // => false
  117642. */
  117643. var isArguments = Object(_baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function() { return arguments; }()) ? _baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"] : function(value) {
  117644. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && hasOwnProperty.call(value, 'callee') &&
  117645. !propertyIsEnumerable.call(value, 'callee');
  117646. };
  117647. /* harmony default export */ __webpack_exports__["default"] = (isArguments);
  117648. /***/ }),
  117649. /***/ "./node_modules/lodash-es/isArray.js":
  117650. /*!*******************************************!*\
  117651. !*** ./node_modules/lodash-es/isArray.js ***!
  117652. \*******************************************/
  117653. /*! exports provided: default */
  117654. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117655. "use strict";
  117656. __webpack_require__.r(__webpack_exports__);
  117657. /**
  117658. * Checks if `value` is classified as an `Array` object.
  117659. *
  117660. * @static
  117661. * @memberOf _
  117662. * @since 0.1.0
  117663. * @category Lang
  117664. * @param {*} value The value to check.
  117665. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  117666. * @example
  117667. *
  117668. * _.isArray([1, 2, 3]);
  117669. * // => true
  117670. *
  117671. * _.isArray(document.body.children);
  117672. * // => false
  117673. *
  117674. * _.isArray('abc');
  117675. * // => false
  117676. *
  117677. * _.isArray(_.noop);
  117678. * // => false
  117679. */
  117680. var isArray = Array.isArray;
  117681. /* harmony default export */ __webpack_exports__["default"] = (isArray);
  117682. /***/ }),
  117683. /***/ "./node_modules/lodash-es/isArrayBuffer.js":
  117684. /*!*************************************************!*\
  117685. !*** ./node_modules/lodash-es/isArrayBuffer.js ***!
  117686. \*************************************************/
  117687. /*! exports provided: default */
  117688. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117689. "use strict";
  117690. __webpack_require__.r(__webpack_exports__);
  117691. /* harmony import */ var _baseIsArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsArrayBuffer.js */ "./node_modules/lodash-es/_baseIsArrayBuffer.js");
  117692. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  117693. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  117694. /* Node.js helper references. */
  117695. var nodeIsArrayBuffer = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isArrayBuffer;
  117696. /**
  117697. * Checks if `value` is classified as an `ArrayBuffer` object.
  117698. *
  117699. * @static
  117700. * @memberOf _
  117701. * @since 4.3.0
  117702. * @category Lang
  117703. * @param {*} value The value to check.
  117704. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  117705. * @example
  117706. *
  117707. * _.isArrayBuffer(new ArrayBuffer(2));
  117708. * // => true
  117709. *
  117710. * _.isArrayBuffer(new Array(2));
  117711. * // => false
  117712. */
  117713. var isArrayBuffer = nodeIsArrayBuffer ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsArrayBuffer) : _baseIsArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  117714. /* harmony default export */ __webpack_exports__["default"] = (isArrayBuffer);
  117715. /***/ }),
  117716. /***/ "./node_modules/lodash-es/isArrayLike.js":
  117717. /*!***********************************************!*\
  117718. !*** ./node_modules/lodash-es/isArrayLike.js ***!
  117719. \***********************************************/
  117720. /*! exports provided: default */
  117721. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117722. "use strict";
  117723. __webpack_require__.r(__webpack_exports__);
  117724. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  117725. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  117726. /**
  117727. * Checks if `value` is array-like. A value is considered array-like if it's
  117728. * not a function and has a `value.length` that's an integer greater than or
  117729. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  117730. *
  117731. * @static
  117732. * @memberOf _
  117733. * @since 4.0.0
  117734. * @category Lang
  117735. * @param {*} value The value to check.
  117736. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  117737. * @example
  117738. *
  117739. * _.isArrayLike([1, 2, 3]);
  117740. * // => true
  117741. *
  117742. * _.isArrayLike(document.body.children);
  117743. * // => true
  117744. *
  117745. * _.isArrayLike('abc');
  117746. * // => true
  117747. *
  117748. * _.isArrayLike(_.noop);
  117749. * // => false
  117750. */
  117751. function isArrayLike(value) {
  117752. return value != null && Object(_isLength_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value.length) && !Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  117753. }
  117754. /* harmony default export */ __webpack_exports__["default"] = (isArrayLike);
  117755. /***/ }),
  117756. /***/ "./node_modules/lodash-es/isArrayLikeObject.js":
  117757. /*!*****************************************************!*\
  117758. !*** ./node_modules/lodash-es/isArrayLikeObject.js ***!
  117759. \*****************************************************/
  117760. /*! exports provided: default */
  117761. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117762. "use strict";
  117763. __webpack_require__.r(__webpack_exports__);
  117764. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  117765. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  117766. /**
  117767. * This method is like `_.isArrayLike` except that it also checks if `value`
  117768. * is an object.
  117769. *
  117770. * @static
  117771. * @memberOf _
  117772. * @since 4.0.0
  117773. * @category Lang
  117774. * @param {*} value The value to check.
  117775. * @returns {boolean} Returns `true` if `value` is an array-like object,
  117776. * else `false`.
  117777. * @example
  117778. *
  117779. * _.isArrayLikeObject([1, 2, 3]);
  117780. * // => true
  117781. *
  117782. * _.isArrayLikeObject(document.body.children);
  117783. * // => true
  117784. *
  117785. * _.isArrayLikeObject('abc');
  117786. * // => false
  117787. *
  117788. * _.isArrayLikeObject(_.noop);
  117789. * // => false
  117790. */
  117791. function isArrayLikeObject(value) {
  117792. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  117793. }
  117794. /* harmony default export */ __webpack_exports__["default"] = (isArrayLikeObject);
  117795. /***/ }),
  117796. /***/ "./node_modules/lodash-es/isBoolean.js":
  117797. /*!*********************************************!*\
  117798. !*** ./node_modules/lodash-es/isBoolean.js ***!
  117799. \*********************************************/
  117800. /*! exports provided: default */
  117801. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117802. "use strict";
  117803. __webpack_require__.r(__webpack_exports__);
  117804. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  117805. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  117806. /** `Object#toString` result references. */
  117807. var boolTag = '[object Boolean]';
  117808. /**
  117809. * Checks if `value` is classified as a boolean primitive or object.
  117810. *
  117811. * @static
  117812. * @memberOf _
  117813. * @since 0.1.0
  117814. * @category Lang
  117815. * @param {*} value The value to check.
  117816. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  117817. * @example
  117818. *
  117819. * _.isBoolean(false);
  117820. * // => true
  117821. *
  117822. * _.isBoolean(null);
  117823. * // => false
  117824. */
  117825. function isBoolean(value) {
  117826. return value === true || value === false ||
  117827. (Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == boolTag);
  117828. }
  117829. /* harmony default export */ __webpack_exports__["default"] = (isBoolean);
  117830. /***/ }),
  117831. /***/ "./node_modules/lodash-es/isBuffer.js":
  117832. /*!********************************************!*\
  117833. !*** ./node_modules/lodash-es/isBuffer.js ***!
  117834. \********************************************/
  117835. /*! exports provided: default */
  117836. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117837. "use strict";
  117838. __webpack_require__.r(__webpack_exports__);
  117839. /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  117840. /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
  117841. /** Detect free variable `exports`. */
  117842. var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
  117843. /** Detect free variable `module`. */
  117844. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  117845. /** Detect the popular CommonJS extension `module.exports`. */
  117846. var moduleExports = freeModule && freeModule.exports === freeExports;
  117847. /** Built-in value references. */
  117848. var Buffer = moduleExports ? _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Buffer : undefined;
  117849. /* Built-in method references for those with the same name as other `lodash` methods. */
  117850. var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
  117851. /**
  117852. * Checks if `value` is a buffer.
  117853. *
  117854. * @static
  117855. * @memberOf _
  117856. * @since 4.3.0
  117857. * @category Lang
  117858. * @param {*} value The value to check.
  117859. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  117860. * @example
  117861. *
  117862. * _.isBuffer(new Buffer(2));
  117863. * // => true
  117864. *
  117865. * _.isBuffer(new Uint8Array(2));
  117866. * // => false
  117867. */
  117868. var isBuffer = nativeIsBuffer || _stubFalse_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  117869. /* harmony default export */ __webpack_exports__["default"] = (isBuffer);
  117870. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/harmony-module.js */ "./node_modules/webpack/buildin/harmony-module.js")(module)))
  117871. /***/ }),
  117872. /***/ "./node_modules/lodash-es/isDate.js":
  117873. /*!******************************************!*\
  117874. !*** ./node_modules/lodash-es/isDate.js ***!
  117875. \******************************************/
  117876. /*! exports provided: default */
  117877. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117878. "use strict";
  117879. __webpack_require__.r(__webpack_exports__);
  117880. /* harmony import */ var _baseIsDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsDate.js */ "./node_modules/lodash-es/_baseIsDate.js");
  117881. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  117882. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  117883. /* Node.js helper references. */
  117884. var nodeIsDate = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isDate;
  117885. /**
  117886. * Checks if `value` is classified as a `Date` object.
  117887. *
  117888. * @static
  117889. * @memberOf _
  117890. * @since 0.1.0
  117891. * @category Lang
  117892. * @param {*} value The value to check.
  117893. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  117894. * @example
  117895. *
  117896. * _.isDate(new Date);
  117897. * // => true
  117898. *
  117899. * _.isDate('Mon April 23 2012');
  117900. * // => false
  117901. */
  117902. var isDate = nodeIsDate ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsDate) : _baseIsDate_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  117903. /* harmony default export */ __webpack_exports__["default"] = (isDate);
  117904. /***/ }),
  117905. /***/ "./node_modules/lodash-es/isElement.js":
  117906. /*!*********************************************!*\
  117907. !*** ./node_modules/lodash-es/isElement.js ***!
  117908. \*********************************************/
  117909. /*! exports provided: default */
  117910. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117911. "use strict";
  117912. __webpack_require__.r(__webpack_exports__);
  117913. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  117914. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  117915. /**
  117916. * Checks if `value` is likely a DOM element.
  117917. *
  117918. * @static
  117919. * @memberOf _
  117920. * @since 0.1.0
  117921. * @category Lang
  117922. * @param {*} value The value to check.
  117923. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  117924. * @example
  117925. *
  117926. * _.isElement(document.body);
  117927. * // => true
  117928. *
  117929. * _.isElement('<body>');
  117930. * // => false
  117931. */
  117932. function isElement(value) {
  117933. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && value.nodeType === 1 && !Object(_isPlainObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
  117934. }
  117935. /* harmony default export */ __webpack_exports__["default"] = (isElement);
  117936. /***/ }),
  117937. /***/ "./node_modules/lodash-es/isEmpty.js":
  117938. /*!*******************************************!*\
  117939. !*** ./node_modules/lodash-es/isEmpty.js ***!
  117940. \*******************************************/
  117941. /*! exports provided: default */
  117942. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117943. "use strict";
  117944. __webpack_require__.r(__webpack_exports__);
  117945. /* harmony import */ var _baseKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseKeys.js */ "./node_modules/lodash-es/_baseKeys.js");
  117946. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  117947. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  117948. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  117949. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  117950. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  117951. /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
  117952. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  117953. /** `Object#toString` result references. */
  117954. var mapTag = '[object Map]',
  117955. setTag = '[object Set]';
  117956. /** Used for built-in method references. */
  117957. var objectProto = Object.prototype;
  117958. /** Used to check objects for own properties. */
  117959. var hasOwnProperty = objectProto.hasOwnProperty;
  117960. /**
  117961. * Checks if `value` is an empty object, collection, map, or set.
  117962. *
  117963. * Objects are considered empty if they have no own enumerable string keyed
  117964. * properties.
  117965. *
  117966. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  117967. * jQuery-like collections are considered empty if they have a `length` of `0`.
  117968. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  117969. *
  117970. * @static
  117971. * @memberOf _
  117972. * @since 0.1.0
  117973. * @category Lang
  117974. * @param {*} value The value to check.
  117975. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  117976. * @example
  117977. *
  117978. * _.isEmpty(null);
  117979. * // => true
  117980. *
  117981. * _.isEmpty(true);
  117982. * // => true
  117983. *
  117984. * _.isEmpty(1);
  117985. * // => true
  117986. *
  117987. * _.isEmpty([1, 2, 3]);
  117988. * // => false
  117989. *
  117990. * _.isEmpty({ 'a': 1 });
  117991. * // => false
  117992. */
  117993. function isEmpty(value) {
  117994. if (value == null) {
  117995. return true;
  117996. }
  117997. if (Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value) &&
  117998. (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  117999. Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value) || Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_7__["default"])(value) || Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value))) {
  118000. return !value.length;
  118001. }
  118002. var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
  118003. if (tag == mapTag || tag == setTag) {
  118004. return !value.size;
  118005. }
  118006. if (Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_6__["default"])(value)) {
  118007. return !Object(_baseKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value).length;
  118008. }
  118009. for (var key in value) {
  118010. if (hasOwnProperty.call(value, key)) {
  118011. return false;
  118012. }
  118013. }
  118014. return true;
  118015. }
  118016. /* harmony default export */ __webpack_exports__["default"] = (isEmpty);
  118017. /***/ }),
  118018. /***/ "./node_modules/lodash-es/isEqual.js":
  118019. /*!*******************************************!*\
  118020. !*** ./node_modules/lodash-es/isEqual.js ***!
  118021. \*******************************************/
  118022. /*! exports provided: default */
  118023. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118024. "use strict";
  118025. __webpack_require__.r(__webpack_exports__);
  118026. /* harmony import */ var _baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsEqual.js */ "./node_modules/lodash-es/_baseIsEqual.js");
  118027. /**
  118028. * Performs a deep comparison between two values to determine if they are
  118029. * equivalent.
  118030. *
  118031. * **Note:** This method supports comparing arrays, array buffers, booleans,
  118032. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  118033. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  118034. * by their own, not inherited, enumerable properties. Functions and DOM
  118035. * nodes are compared by strict equality, i.e. `===`.
  118036. *
  118037. * @static
  118038. * @memberOf _
  118039. * @since 0.1.0
  118040. * @category Lang
  118041. * @param {*} value The value to compare.
  118042. * @param {*} other The other value to compare.
  118043. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  118044. * @example
  118045. *
  118046. * var object = { 'a': 1 };
  118047. * var other = { 'a': 1 };
  118048. *
  118049. * _.isEqual(object, other);
  118050. * // => true
  118051. *
  118052. * object === other;
  118053. * // => false
  118054. */
  118055. function isEqual(value, other) {
  118056. return Object(_baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, other);
  118057. }
  118058. /* harmony default export */ __webpack_exports__["default"] = (isEqual);
  118059. /***/ }),
  118060. /***/ "./node_modules/lodash-es/isEqualWith.js":
  118061. /*!***********************************************!*\
  118062. !*** ./node_modules/lodash-es/isEqualWith.js ***!
  118063. \***********************************************/
  118064. /*! exports provided: default */
  118065. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118066. "use strict";
  118067. __webpack_require__.r(__webpack_exports__);
  118068. /* harmony import */ var _baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsEqual.js */ "./node_modules/lodash-es/_baseIsEqual.js");
  118069. /**
  118070. * This method is like `_.isEqual` except that it accepts `customizer` which
  118071. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  118072. * are handled by the method instead. The `customizer` is invoked with up to
  118073. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  118074. *
  118075. * @static
  118076. * @memberOf _
  118077. * @since 4.0.0
  118078. * @category Lang
  118079. * @param {*} value The value to compare.
  118080. * @param {*} other The other value to compare.
  118081. * @param {Function} [customizer] The function to customize comparisons.
  118082. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  118083. * @example
  118084. *
  118085. * function isGreeting(value) {
  118086. * return /^h(?:i|ello)$/.test(value);
  118087. * }
  118088. *
  118089. * function customizer(objValue, othValue) {
  118090. * if (isGreeting(objValue) && isGreeting(othValue)) {
  118091. * return true;
  118092. * }
  118093. * }
  118094. *
  118095. * var array = ['hello', 'goodbye'];
  118096. * var other = ['hi', 'goodbye'];
  118097. *
  118098. * _.isEqualWith(array, other, customizer);
  118099. * // => true
  118100. */
  118101. function isEqualWith(value, other, customizer) {
  118102. customizer = typeof customizer == 'function' ? customizer : undefined;
  118103. var result = customizer ? customizer(value, other) : undefined;
  118104. return result === undefined ? Object(_baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, other, undefined, customizer) : !!result;
  118105. }
  118106. /* harmony default export */ __webpack_exports__["default"] = (isEqualWith);
  118107. /***/ }),
  118108. /***/ "./node_modules/lodash-es/isError.js":
  118109. /*!*******************************************!*\
  118110. !*** ./node_modules/lodash-es/isError.js ***!
  118111. \*******************************************/
  118112. /*! exports provided: default */
  118113. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118114. "use strict";
  118115. __webpack_require__.r(__webpack_exports__);
  118116. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  118117. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  118118. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  118119. /** `Object#toString` result references. */
  118120. var domExcTag = '[object DOMException]',
  118121. errorTag = '[object Error]';
  118122. /**
  118123. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  118124. * `SyntaxError`, `TypeError`, or `URIError` object.
  118125. *
  118126. * @static
  118127. * @memberOf _
  118128. * @since 3.0.0
  118129. * @category Lang
  118130. * @param {*} value The value to check.
  118131. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  118132. * @example
  118133. *
  118134. * _.isError(new Error);
  118135. * // => true
  118136. *
  118137. * _.isError(Error);
  118138. * // => false
  118139. */
  118140. function isError(value) {
  118141. if (!Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  118142. return false;
  118143. }
  118144. var tag = Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  118145. return tag == errorTag || tag == domExcTag ||
  118146. (typeof value.message == 'string' && typeof value.name == 'string' && !Object(_isPlainObject_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value));
  118147. }
  118148. /* harmony default export */ __webpack_exports__["default"] = (isError);
  118149. /***/ }),
  118150. /***/ "./node_modules/lodash-es/isFinite.js":
  118151. /*!********************************************!*\
  118152. !*** ./node_modules/lodash-es/isFinite.js ***!
  118153. \********************************************/
  118154. /*! exports provided: default */
  118155. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118156. "use strict";
  118157. __webpack_require__.r(__webpack_exports__);
  118158. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  118159. /* Built-in method references for those with the same name as other `lodash` methods. */
  118160. var nativeIsFinite = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFinite;
  118161. /**
  118162. * Checks if `value` is a finite primitive number.
  118163. *
  118164. * **Note:** This method is based on
  118165. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  118166. *
  118167. * @static
  118168. * @memberOf _
  118169. * @since 0.1.0
  118170. * @category Lang
  118171. * @param {*} value The value to check.
  118172. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  118173. * @example
  118174. *
  118175. * _.isFinite(3);
  118176. * // => true
  118177. *
  118178. * _.isFinite(Number.MIN_VALUE);
  118179. * // => true
  118180. *
  118181. * _.isFinite(Infinity);
  118182. * // => false
  118183. *
  118184. * _.isFinite('3');
  118185. * // => false
  118186. */
  118187. function isFinite(value) {
  118188. return typeof value == 'number' && nativeIsFinite(value);
  118189. }
  118190. /* harmony default export */ __webpack_exports__["default"] = (isFinite);
  118191. /***/ }),
  118192. /***/ "./node_modules/lodash-es/isFunction.js":
  118193. /*!**********************************************!*\
  118194. !*** ./node_modules/lodash-es/isFunction.js ***!
  118195. \**********************************************/
  118196. /*! exports provided: default */
  118197. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118198. "use strict";
  118199. __webpack_require__.r(__webpack_exports__);
  118200. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  118201. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  118202. /** `Object#toString` result references. */
  118203. var asyncTag = '[object AsyncFunction]',
  118204. funcTag = '[object Function]',
  118205. genTag = '[object GeneratorFunction]',
  118206. proxyTag = '[object Proxy]';
  118207. /**
  118208. * Checks if `value` is classified as a `Function` object.
  118209. *
  118210. * @static
  118211. * @memberOf _
  118212. * @since 0.1.0
  118213. * @category Lang
  118214. * @param {*} value The value to check.
  118215. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  118216. * @example
  118217. *
  118218. * _.isFunction(_);
  118219. * // => true
  118220. *
  118221. * _.isFunction(/abc/);
  118222. * // => false
  118223. */
  118224. function isFunction(value) {
  118225. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  118226. return false;
  118227. }
  118228. // The use of `Object#toString` avoids issues with the `typeof` operator
  118229. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  118230. var tag = Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  118231. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  118232. }
  118233. /* harmony default export */ __webpack_exports__["default"] = (isFunction);
  118234. /***/ }),
  118235. /***/ "./node_modules/lodash-es/isInteger.js":
  118236. /*!*********************************************!*\
  118237. !*** ./node_modules/lodash-es/isInteger.js ***!
  118238. \*********************************************/
  118239. /*! exports provided: default */
  118240. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118241. "use strict";
  118242. __webpack_require__.r(__webpack_exports__);
  118243. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  118244. /**
  118245. * Checks if `value` is an integer.
  118246. *
  118247. * **Note:** This method is based on
  118248. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  118249. *
  118250. * @static
  118251. * @memberOf _
  118252. * @since 4.0.0
  118253. * @category Lang
  118254. * @param {*} value The value to check.
  118255. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  118256. * @example
  118257. *
  118258. * _.isInteger(3);
  118259. * // => true
  118260. *
  118261. * _.isInteger(Number.MIN_VALUE);
  118262. * // => false
  118263. *
  118264. * _.isInteger(Infinity);
  118265. * // => false
  118266. *
  118267. * _.isInteger('3');
  118268. * // => false
  118269. */
  118270. function isInteger(value) {
  118271. return typeof value == 'number' && value == Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  118272. }
  118273. /* harmony default export */ __webpack_exports__["default"] = (isInteger);
  118274. /***/ }),
  118275. /***/ "./node_modules/lodash-es/isLength.js":
  118276. /*!********************************************!*\
  118277. !*** ./node_modules/lodash-es/isLength.js ***!
  118278. \********************************************/
  118279. /*! exports provided: default */
  118280. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118281. "use strict";
  118282. __webpack_require__.r(__webpack_exports__);
  118283. /** Used as references for various `Number` constants. */
  118284. var MAX_SAFE_INTEGER = 9007199254740991;
  118285. /**
  118286. * Checks if `value` is a valid array-like length.
  118287. *
  118288. * **Note:** This method is loosely based on
  118289. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  118290. *
  118291. * @static
  118292. * @memberOf _
  118293. * @since 4.0.0
  118294. * @category Lang
  118295. * @param {*} value The value to check.
  118296. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  118297. * @example
  118298. *
  118299. * _.isLength(3);
  118300. * // => true
  118301. *
  118302. * _.isLength(Number.MIN_VALUE);
  118303. * // => false
  118304. *
  118305. * _.isLength(Infinity);
  118306. * // => false
  118307. *
  118308. * _.isLength('3');
  118309. * // => false
  118310. */
  118311. function isLength(value) {
  118312. return typeof value == 'number' &&
  118313. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  118314. }
  118315. /* harmony default export */ __webpack_exports__["default"] = (isLength);
  118316. /***/ }),
  118317. /***/ "./node_modules/lodash-es/isMap.js":
  118318. /*!*****************************************!*\
  118319. !*** ./node_modules/lodash-es/isMap.js ***!
  118320. \*****************************************/
  118321. /*! exports provided: default */
  118322. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118323. "use strict";
  118324. __webpack_require__.r(__webpack_exports__);
  118325. /* harmony import */ var _baseIsMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsMap.js */ "./node_modules/lodash-es/_baseIsMap.js");
  118326. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  118327. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  118328. /* Node.js helper references. */
  118329. var nodeIsMap = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isMap;
  118330. /**
  118331. * Checks if `value` is classified as a `Map` object.
  118332. *
  118333. * @static
  118334. * @memberOf _
  118335. * @since 4.3.0
  118336. * @category Lang
  118337. * @param {*} value The value to check.
  118338. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  118339. * @example
  118340. *
  118341. * _.isMap(new Map);
  118342. * // => true
  118343. *
  118344. * _.isMap(new WeakMap);
  118345. * // => false
  118346. */
  118347. var isMap = nodeIsMap ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsMap) : _baseIsMap_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  118348. /* harmony default export */ __webpack_exports__["default"] = (isMap);
  118349. /***/ }),
  118350. /***/ "./node_modules/lodash-es/isMatch.js":
  118351. /*!*******************************************!*\
  118352. !*** ./node_modules/lodash-es/isMatch.js ***!
  118353. \*******************************************/
  118354. /*! exports provided: default */
  118355. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118356. "use strict";
  118357. __webpack_require__.r(__webpack_exports__);
  118358. /* harmony import */ var _baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsMatch.js */ "./node_modules/lodash-es/_baseIsMatch.js");
  118359. /* harmony import */ var _getMatchData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getMatchData.js */ "./node_modules/lodash-es/_getMatchData.js");
  118360. /**
  118361. * Performs a partial deep comparison between `object` and `source` to
  118362. * determine if `object` contains equivalent property values.
  118363. *
  118364. * **Note:** This method is equivalent to `_.matches` when `source` is
  118365. * partially applied.
  118366. *
  118367. * Partial comparisons will match empty array and empty object `source`
  118368. * values against any array or object value, respectively. See `_.isEqual`
  118369. * for a list of supported value comparisons.
  118370. *
  118371. * @static
  118372. * @memberOf _
  118373. * @since 3.0.0
  118374. * @category Lang
  118375. * @param {Object} object The object to inspect.
  118376. * @param {Object} source The object of property values to match.
  118377. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  118378. * @example
  118379. *
  118380. * var object = { 'a': 1, 'b': 2 };
  118381. *
  118382. * _.isMatch(object, { 'b': 2 });
  118383. * // => true
  118384. *
  118385. * _.isMatch(object, { 'b': 1 });
  118386. * // => false
  118387. */
  118388. function isMatch(object, source) {
  118389. return object === source || Object(_baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, Object(_getMatchData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source));
  118390. }
  118391. /* harmony default export */ __webpack_exports__["default"] = (isMatch);
  118392. /***/ }),
  118393. /***/ "./node_modules/lodash-es/isMatchWith.js":
  118394. /*!***********************************************!*\
  118395. !*** ./node_modules/lodash-es/isMatchWith.js ***!
  118396. \***********************************************/
  118397. /*! exports provided: default */
  118398. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118399. "use strict";
  118400. __webpack_require__.r(__webpack_exports__);
  118401. /* harmony import */ var _baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsMatch.js */ "./node_modules/lodash-es/_baseIsMatch.js");
  118402. /* harmony import */ var _getMatchData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getMatchData.js */ "./node_modules/lodash-es/_getMatchData.js");
  118403. /**
  118404. * This method is like `_.isMatch` except that it accepts `customizer` which
  118405. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  118406. * are handled by the method instead. The `customizer` is invoked with five
  118407. * arguments: (objValue, srcValue, index|key, object, source).
  118408. *
  118409. * @static
  118410. * @memberOf _
  118411. * @since 4.0.0
  118412. * @category Lang
  118413. * @param {Object} object The object to inspect.
  118414. * @param {Object} source The object of property values to match.
  118415. * @param {Function} [customizer] The function to customize comparisons.
  118416. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  118417. * @example
  118418. *
  118419. * function isGreeting(value) {
  118420. * return /^h(?:i|ello)$/.test(value);
  118421. * }
  118422. *
  118423. * function customizer(objValue, srcValue) {
  118424. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  118425. * return true;
  118426. * }
  118427. * }
  118428. *
  118429. * var object = { 'greeting': 'hello' };
  118430. * var source = { 'greeting': 'hi' };
  118431. *
  118432. * _.isMatchWith(object, source, customizer);
  118433. * // => true
  118434. */
  118435. function isMatchWith(object, source, customizer) {
  118436. customizer = typeof customizer == 'function' ? customizer : undefined;
  118437. return Object(_baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, Object(_getMatchData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), customizer);
  118438. }
  118439. /* harmony default export */ __webpack_exports__["default"] = (isMatchWith);
  118440. /***/ }),
  118441. /***/ "./node_modules/lodash-es/isNaN.js":
  118442. /*!*****************************************!*\
  118443. !*** ./node_modules/lodash-es/isNaN.js ***!
  118444. \*****************************************/
  118445. /*! exports provided: default */
  118446. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118447. "use strict";
  118448. __webpack_require__.r(__webpack_exports__);
  118449. /* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/lodash-es/isNumber.js");
  118450. /**
  118451. * Checks if `value` is `NaN`.
  118452. *
  118453. * **Note:** This method is based on
  118454. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  118455. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  118456. * `undefined` and other non-number values.
  118457. *
  118458. * @static
  118459. * @memberOf _
  118460. * @since 0.1.0
  118461. * @category Lang
  118462. * @param {*} value The value to check.
  118463. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  118464. * @example
  118465. *
  118466. * _.isNaN(NaN);
  118467. * // => true
  118468. *
  118469. * _.isNaN(new Number(NaN));
  118470. * // => true
  118471. *
  118472. * isNaN(undefined);
  118473. * // => true
  118474. *
  118475. * _.isNaN(undefined);
  118476. * // => false
  118477. */
  118478. function isNaN(value) {
  118479. // An `NaN` primitive is the only value that is not equal to itself.
  118480. // Perform the `toStringTag` check first to avoid errors with some
  118481. // ActiveX objects in IE.
  118482. return Object(_isNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && value != +value;
  118483. }
  118484. /* harmony default export */ __webpack_exports__["default"] = (isNaN);
  118485. /***/ }),
  118486. /***/ "./node_modules/lodash-es/isNative.js":
  118487. /*!********************************************!*\
  118488. !*** ./node_modules/lodash-es/isNative.js ***!
  118489. \********************************************/
  118490. /*! exports provided: default */
  118491. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118492. "use strict";
  118493. __webpack_require__.r(__webpack_exports__);
  118494. /* harmony import */ var _baseIsNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsNative.js */ "./node_modules/lodash-es/_baseIsNative.js");
  118495. /* harmony import */ var _isMaskable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isMaskable.js */ "./node_modules/lodash-es/_isMaskable.js");
  118496. /** Error message constants. */
  118497. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.';
  118498. /**
  118499. * Checks if `value` is a pristine native function.
  118500. *
  118501. * **Note:** This method can't reliably detect native functions in the presence
  118502. * of the core-js package because core-js circumvents this kind of detection.
  118503. * Despite multiple requests, the core-js maintainer has made it clear: any
  118504. * attempt to fix the detection will be obstructed. As a result, we're left
  118505. * with little choice but to throw an error. Unfortunately, this also affects
  118506. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  118507. * which rely on core-js.
  118508. *
  118509. * @static
  118510. * @memberOf _
  118511. * @since 3.0.0
  118512. * @category Lang
  118513. * @param {*} value The value to check.
  118514. * @returns {boolean} Returns `true` if `value` is a native function,
  118515. * else `false`.
  118516. * @example
  118517. *
  118518. * _.isNative(Array.prototype.push);
  118519. * // => true
  118520. *
  118521. * _.isNative(_);
  118522. * // => false
  118523. */
  118524. function isNative(value) {
  118525. if (Object(_isMaskable_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  118526. throw new Error(CORE_ERROR_TEXT);
  118527. }
  118528. return Object(_baseIsNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  118529. }
  118530. /* harmony default export */ __webpack_exports__["default"] = (isNative);
  118531. /***/ }),
  118532. /***/ "./node_modules/lodash-es/isNil.js":
  118533. /*!*****************************************!*\
  118534. !*** ./node_modules/lodash-es/isNil.js ***!
  118535. \*****************************************/
  118536. /*! exports provided: default */
  118537. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118538. "use strict";
  118539. __webpack_require__.r(__webpack_exports__);
  118540. /**
  118541. * Checks if `value` is `null` or `undefined`.
  118542. *
  118543. * @static
  118544. * @memberOf _
  118545. * @since 4.0.0
  118546. * @category Lang
  118547. * @param {*} value The value to check.
  118548. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  118549. * @example
  118550. *
  118551. * _.isNil(null);
  118552. * // => true
  118553. *
  118554. * _.isNil(void 0);
  118555. * // => true
  118556. *
  118557. * _.isNil(NaN);
  118558. * // => false
  118559. */
  118560. function isNil(value) {
  118561. return value == null;
  118562. }
  118563. /* harmony default export */ __webpack_exports__["default"] = (isNil);
  118564. /***/ }),
  118565. /***/ "./node_modules/lodash-es/isNull.js":
  118566. /*!******************************************!*\
  118567. !*** ./node_modules/lodash-es/isNull.js ***!
  118568. \******************************************/
  118569. /*! exports provided: default */
  118570. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118571. "use strict";
  118572. __webpack_require__.r(__webpack_exports__);
  118573. /**
  118574. * Checks if `value` is `null`.
  118575. *
  118576. * @static
  118577. * @memberOf _
  118578. * @since 0.1.0
  118579. * @category Lang
  118580. * @param {*} value The value to check.
  118581. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  118582. * @example
  118583. *
  118584. * _.isNull(null);
  118585. * // => true
  118586. *
  118587. * _.isNull(void 0);
  118588. * // => false
  118589. */
  118590. function isNull(value) {
  118591. return value === null;
  118592. }
  118593. /* harmony default export */ __webpack_exports__["default"] = (isNull);
  118594. /***/ }),
  118595. /***/ "./node_modules/lodash-es/isNumber.js":
  118596. /*!********************************************!*\
  118597. !*** ./node_modules/lodash-es/isNumber.js ***!
  118598. \********************************************/
  118599. /*! exports provided: default */
  118600. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118601. "use strict";
  118602. __webpack_require__.r(__webpack_exports__);
  118603. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  118604. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  118605. /** `Object#toString` result references. */
  118606. var numberTag = '[object Number]';
  118607. /**
  118608. * Checks if `value` is classified as a `Number` primitive or object.
  118609. *
  118610. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  118611. * classified as numbers, use the `_.isFinite` method.
  118612. *
  118613. * @static
  118614. * @memberOf _
  118615. * @since 0.1.0
  118616. * @category Lang
  118617. * @param {*} value The value to check.
  118618. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  118619. * @example
  118620. *
  118621. * _.isNumber(3);
  118622. * // => true
  118623. *
  118624. * _.isNumber(Number.MIN_VALUE);
  118625. * // => true
  118626. *
  118627. * _.isNumber(Infinity);
  118628. * // => true
  118629. *
  118630. * _.isNumber('3');
  118631. * // => false
  118632. */
  118633. function isNumber(value) {
  118634. return typeof value == 'number' ||
  118635. (Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == numberTag);
  118636. }
  118637. /* harmony default export */ __webpack_exports__["default"] = (isNumber);
  118638. /***/ }),
  118639. /***/ "./node_modules/lodash-es/isObject.js":
  118640. /*!********************************************!*\
  118641. !*** ./node_modules/lodash-es/isObject.js ***!
  118642. \********************************************/
  118643. /*! exports provided: default */
  118644. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118645. "use strict";
  118646. __webpack_require__.r(__webpack_exports__);
  118647. /**
  118648. * Checks if `value` is the
  118649. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  118650. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  118651. *
  118652. * @static
  118653. * @memberOf _
  118654. * @since 0.1.0
  118655. * @category Lang
  118656. * @param {*} value The value to check.
  118657. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  118658. * @example
  118659. *
  118660. * _.isObject({});
  118661. * // => true
  118662. *
  118663. * _.isObject([1, 2, 3]);
  118664. * // => true
  118665. *
  118666. * _.isObject(_.noop);
  118667. * // => true
  118668. *
  118669. * _.isObject(null);
  118670. * // => false
  118671. */
  118672. function isObject(value) {
  118673. var type = typeof value;
  118674. return value != null && (type == 'object' || type == 'function');
  118675. }
  118676. /* harmony default export */ __webpack_exports__["default"] = (isObject);
  118677. /***/ }),
  118678. /***/ "./node_modules/lodash-es/isObjectLike.js":
  118679. /*!************************************************!*\
  118680. !*** ./node_modules/lodash-es/isObjectLike.js ***!
  118681. \************************************************/
  118682. /*! exports provided: default */
  118683. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118684. "use strict";
  118685. __webpack_require__.r(__webpack_exports__);
  118686. /**
  118687. * Checks if `value` is object-like. A value is object-like if it's not `null`
  118688. * and has a `typeof` result of "object".
  118689. *
  118690. * @static
  118691. * @memberOf _
  118692. * @since 4.0.0
  118693. * @category Lang
  118694. * @param {*} value The value to check.
  118695. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  118696. * @example
  118697. *
  118698. * _.isObjectLike({});
  118699. * // => true
  118700. *
  118701. * _.isObjectLike([1, 2, 3]);
  118702. * // => true
  118703. *
  118704. * _.isObjectLike(_.noop);
  118705. * // => false
  118706. *
  118707. * _.isObjectLike(null);
  118708. * // => false
  118709. */
  118710. function isObjectLike(value) {
  118711. return value != null && typeof value == 'object';
  118712. }
  118713. /* harmony default export */ __webpack_exports__["default"] = (isObjectLike);
  118714. /***/ }),
  118715. /***/ "./node_modules/lodash-es/isPlainObject.js":
  118716. /*!*************************************************!*\
  118717. !*** ./node_modules/lodash-es/isPlainObject.js ***!
  118718. \*************************************************/
  118719. /*! exports provided: default */
  118720. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118721. "use strict";
  118722. __webpack_require__.r(__webpack_exports__);
  118723. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  118724. /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
  118725. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  118726. /** `Object#toString` result references. */
  118727. var objectTag = '[object Object]';
  118728. /** Used for built-in method references. */
  118729. var funcProto = Function.prototype,
  118730. objectProto = Object.prototype;
  118731. /** Used to resolve the decompiled source of functions. */
  118732. var funcToString = funcProto.toString;
  118733. /** Used to check objects for own properties. */
  118734. var hasOwnProperty = objectProto.hasOwnProperty;
  118735. /** Used to infer the `Object` constructor. */
  118736. var objectCtorString = funcToString.call(Object);
  118737. /**
  118738. * Checks if `value` is a plain object, that is, an object created by the
  118739. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  118740. *
  118741. * @static
  118742. * @memberOf _
  118743. * @since 0.8.0
  118744. * @category Lang
  118745. * @param {*} value The value to check.
  118746. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  118747. * @example
  118748. *
  118749. * function Foo() {
  118750. * this.a = 1;
  118751. * }
  118752. *
  118753. * _.isPlainObject(new Foo);
  118754. * // => false
  118755. *
  118756. * _.isPlainObject([1, 2, 3]);
  118757. * // => false
  118758. *
  118759. * _.isPlainObject({ 'x': 0, 'y': 0 });
  118760. * // => true
  118761. *
  118762. * _.isPlainObject(Object.create(null));
  118763. * // => true
  118764. */
  118765. function isPlainObject(value) {
  118766. if (!Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) || Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) != objectTag) {
  118767. return false;
  118768. }
  118769. var proto = Object(_getPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
  118770. if (proto === null) {
  118771. return true;
  118772. }
  118773. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  118774. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  118775. funcToString.call(Ctor) == objectCtorString;
  118776. }
  118777. /* harmony default export */ __webpack_exports__["default"] = (isPlainObject);
  118778. /***/ }),
  118779. /***/ "./node_modules/lodash-es/isRegExp.js":
  118780. /*!********************************************!*\
  118781. !*** ./node_modules/lodash-es/isRegExp.js ***!
  118782. \********************************************/
  118783. /*! exports provided: default */
  118784. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118785. "use strict";
  118786. __webpack_require__.r(__webpack_exports__);
  118787. /* harmony import */ var _baseIsRegExp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsRegExp.js */ "./node_modules/lodash-es/_baseIsRegExp.js");
  118788. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  118789. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  118790. /* Node.js helper references. */
  118791. var nodeIsRegExp = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isRegExp;
  118792. /**
  118793. * Checks if `value` is classified as a `RegExp` object.
  118794. *
  118795. * @static
  118796. * @memberOf _
  118797. * @since 0.1.0
  118798. * @category Lang
  118799. * @param {*} value The value to check.
  118800. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  118801. * @example
  118802. *
  118803. * _.isRegExp(/abc/);
  118804. * // => true
  118805. *
  118806. * _.isRegExp('/abc/');
  118807. * // => false
  118808. */
  118809. var isRegExp = nodeIsRegExp ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsRegExp) : _baseIsRegExp_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  118810. /* harmony default export */ __webpack_exports__["default"] = (isRegExp);
  118811. /***/ }),
  118812. /***/ "./node_modules/lodash-es/isSafeInteger.js":
  118813. /*!*************************************************!*\
  118814. !*** ./node_modules/lodash-es/isSafeInteger.js ***!
  118815. \*************************************************/
  118816. /*! exports provided: default */
  118817. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118818. "use strict";
  118819. __webpack_require__.r(__webpack_exports__);
  118820. /* harmony import */ var _isInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isInteger.js */ "./node_modules/lodash-es/isInteger.js");
  118821. /** Used as references for various `Number` constants. */
  118822. var MAX_SAFE_INTEGER = 9007199254740991;
  118823. /**
  118824. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  118825. * double precision number which isn't the result of a rounded unsafe integer.
  118826. *
  118827. * **Note:** This method is based on
  118828. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  118829. *
  118830. * @static
  118831. * @memberOf _
  118832. * @since 4.0.0
  118833. * @category Lang
  118834. * @param {*} value The value to check.
  118835. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  118836. * @example
  118837. *
  118838. * _.isSafeInteger(3);
  118839. * // => true
  118840. *
  118841. * _.isSafeInteger(Number.MIN_VALUE);
  118842. * // => false
  118843. *
  118844. * _.isSafeInteger(Infinity);
  118845. * // => false
  118846. *
  118847. * _.isSafeInteger('3');
  118848. * // => false
  118849. */
  118850. function isSafeInteger(value) {
  118851. return Object(_isInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  118852. }
  118853. /* harmony default export */ __webpack_exports__["default"] = (isSafeInteger);
  118854. /***/ }),
  118855. /***/ "./node_modules/lodash-es/isSet.js":
  118856. /*!*****************************************!*\
  118857. !*** ./node_modules/lodash-es/isSet.js ***!
  118858. \*****************************************/
  118859. /*! exports provided: default */
  118860. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118861. "use strict";
  118862. __webpack_require__.r(__webpack_exports__);
  118863. /* harmony import */ var _baseIsSet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsSet.js */ "./node_modules/lodash-es/_baseIsSet.js");
  118864. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  118865. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  118866. /* Node.js helper references. */
  118867. var nodeIsSet = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isSet;
  118868. /**
  118869. * Checks if `value` is classified as a `Set` object.
  118870. *
  118871. * @static
  118872. * @memberOf _
  118873. * @since 4.3.0
  118874. * @category Lang
  118875. * @param {*} value The value to check.
  118876. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  118877. * @example
  118878. *
  118879. * _.isSet(new Set);
  118880. * // => true
  118881. *
  118882. * _.isSet(new WeakSet);
  118883. * // => false
  118884. */
  118885. var isSet = nodeIsSet ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsSet) : _baseIsSet_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  118886. /* harmony default export */ __webpack_exports__["default"] = (isSet);
  118887. /***/ }),
  118888. /***/ "./node_modules/lodash-es/isString.js":
  118889. /*!********************************************!*\
  118890. !*** ./node_modules/lodash-es/isString.js ***!
  118891. \********************************************/
  118892. /*! exports provided: default */
  118893. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118894. "use strict";
  118895. __webpack_require__.r(__webpack_exports__);
  118896. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  118897. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  118898. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  118899. /** `Object#toString` result references. */
  118900. var stringTag = '[object String]';
  118901. /**
  118902. * Checks if `value` is classified as a `String` primitive or object.
  118903. *
  118904. * @static
  118905. * @since 0.1.0
  118906. * @memberOf _
  118907. * @category Lang
  118908. * @param {*} value The value to check.
  118909. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  118910. * @example
  118911. *
  118912. * _.isString('abc');
  118913. * // => true
  118914. *
  118915. * _.isString(1);
  118916. * // => false
  118917. */
  118918. function isString(value) {
  118919. return typeof value == 'string' ||
  118920. (!Object(_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == stringTag);
  118921. }
  118922. /* harmony default export */ __webpack_exports__["default"] = (isString);
  118923. /***/ }),
  118924. /***/ "./node_modules/lodash-es/isSymbol.js":
  118925. /*!********************************************!*\
  118926. !*** ./node_modules/lodash-es/isSymbol.js ***!
  118927. \********************************************/
  118928. /*! exports provided: default */
  118929. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118930. "use strict";
  118931. __webpack_require__.r(__webpack_exports__);
  118932. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  118933. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  118934. /** `Object#toString` result references. */
  118935. var symbolTag = '[object Symbol]';
  118936. /**
  118937. * Checks if `value` is classified as a `Symbol` primitive or object.
  118938. *
  118939. * @static
  118940. * @memberOf _
  118941. * @since 4.0.0
  118942. * @category Lang
  118943. * @param {*} value The value to check.
  118944. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  118945. * @example
  118946. *
  118947. * _.isSymbol(Symbol.iterator);
  118948. * // => true
  118949. *
  118950. * _.isSymbol('abc');
  118951. * // => false
  118952. */
  118953. function isSymbol(value) {
  118954. return typeof value == 'symbol' ||
  118955. (Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == symbolTag);
  118956. }
  118957. /* harmony default export */ __webpack_exports__["default"] = (isSymbol);
  118958. /***/ }),
  118959. /***/ "./node_modules/lodash-es/isTypedArray.js":
  118960. /*!************************************************!*\
  118961. !*** ./node_modules/lodash-es/isTypedArray.js ***!
  118962. \************************************************/
  118963. /*! exports provided: default */
  118964. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118965. "use strict";
  118966. __webpack_require__.r(__webpack_exports__);
  118967. /* harmony import */ var _baseIsTypedArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsTypedArray.js */ "./node_modules/lodash-es/_baseIsTypedArray.js");
  118968. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  118969. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  118970. /* Node.js helper references. */
  118971. var nodeIsTypedArray = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isTypedArray;
  118972. /**
  118973. * Checks if `value` is classified as a typed array.
  118974. *
  118975. * @static
  118976. * @memberOf _
  118977. * @since 3.0.0
  118978. * @category Lang
  118979. * @param {*} value The value to check.
  118980. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  118981. * @example
  118982. *
  118983. * _.isTypedArray(new Uint8Array);
  118984. * // => true
  118985. *
  118986. * _.isTypedArray([]);
  118987. * // => false
  118988. */
  118989. var isTypedArray = nodeIsTypedArray ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsTypedArray) : _baseIsTypedArray_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  118990. /* harmony default export */ __webpack_exports__["default"] = (isTypedArray);
  118991. /***/ }),
  118992. /***/ "./node_modules/lodash-es/isUndefined.js":
  118993. /*!***********************************************!*\
  118994. !*** ./node_modules/lodash-es/isUndefined.js ***!
  118995. \***********************************************/
  118996. /*! exports provided: default */
  118997. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  118998. "use strict";
  118999. __webpack_require__.r(__webpack_exports__);
  119000. /**
  119001. * Checks if `value` is `undefined`.
  119002. *
  119003. * @static
  119004. * @since 0.1.0
  119005. * @memberOf _
  119006. * @category Lang
  119007. * @param {*} value The value to check.
  119008. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  119009. * @example
  119010. *
  119011. * _.isUndefined(void 0);
  119012. * // => true
  119013. *
  119014. * _.isUndefined(null);
  119015. * // => false
  119016. */
  119017. function isUndefined(value) {
  119018. return value === undefined;
  119019. }
  119020. /* harmony default export */ __webpack_exports__["default"] = (isUndefined);
  119021. /***/ }),
  119022. /***/ "./node_modules/lodash-es/isWeakMap.js":
  119023. /*!*********************************************!*\
  119024. !*** ./node_modules/lodash-es/isWeakMap.js ***!
  119025. \*********************************************/
  119026. /*! exports provided: default */
  119027. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119028. "use strict";
  119029. __webpack_require__.r(__webpack_exports__);
  119030. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  119031. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  119032. /** `Object#toString` result references. */
  119033. var weakMapTag = '[object WeakMap]';
  119034. /**
  119035. * Checks if `value` is classified as a `WeakMap` object.
  119036. *
  119037. * @static
  119038. * @memberOf _
  119039. * @since 4.3.0
  119040. * @category Lang
  119041. * @param {*} value The value to check.
  119042. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  119043. * @example
  119044. *
  119045. * _.isWeakMap(new WeakMap);
  119046. * // => true
  119047. *
  119048. * _.isWeakMap(new Map);
  119049. * // => false
  119050. */
  119051. function isWeakMap(value) {
  119052. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_getTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == weakMapTag;
  119053. }
  119054. /* harmony default export */ __webpack_exports__["default"] = (isWeakMap);
  119055. /***/ }),
  119056. /***/ "./node_modules/lodash-es/isWeakSet.js":
  119057. /*!*********************************************!*\
  119058. !*** ./node_modules/lodash-es/isWeakSet.js ***!
  119059. \*********************************************/
  119060. /*! exports provided: default */
  119061. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119062. "use strict";
  119063. __webpack_require__.r(__webpack_exports__);
  119064. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  119065. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  119066. /** `Object#toString` result references. */
  119067. var weakSetTag = '[object WeakSet]';
  119068. /**
  119069. * Checks if `value` is classified as a `WeakSet` object.
  119070. *
  119071. * @static
  119072. * @memberOf _
  119073. * @since 4.3.0
  119074. * @category Lang
  119075. * @param {*} value The value to check.
  119076. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  119077. * @example
  119078. *
  119079. * _.isWeakSet(new WeakSet);
  119080. * // => true
  119081. *
  119082. * _.isWeakSet(new Set);
  119083. * // => false
  119084. */
  119085. function isWeakSet(value) {
  119086. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == weakSetTag;
  119087. }
  119088. /* harmony default export */ __webpack_exports__["default"] = (isWeakSet);
  119089. /***/ }),
  119090. /***/ "./node_modules/lodash-es/iteratee.js":
  119091. /*!********************************************!*\
  119092. !*** ./node_modules/lodash-es/iteratee.js ***!
  119093. \********************************************/
  119094. /*! exports provided: default */
  119095. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119096. "use strict";
  119097. __webpack_require__.r(__webpack_exports__);
  119098. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  119099. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  119100. /** Used to compose bitmasks for cloning. */
  119101. var CLONE_DEEP_FLAG = 1;
  119102. /**
  119103. * Creates a function that invokes `func` with the arguments of the created
  119104. * function. If `func` is a property name, the created function returns the
  119105. * property value for a given element. If `func` is an array or object, the
  119106. * created function returns `true` for elements that contain the equivalent
  119107. * source properties, otherwise it returns `false`.
  119108. *
  119109. * @static
  119110. * @since 4.0.0
  119111. * @memberOf _
  119112. * @category Util
  119113. * @param {*} [func=_.identity] The value to convert to a callback.
  119114. * @returns {Function} Returns the callback.
  119115. * @example
  119116. *
  119117. * var users = [
  119118. * { 'user': 'barney', 'age': 36, 'active': true },
  119119. * { 'user': 'fred', 'age': 40, 'active': false }
  119120. * ];
  119121. *
  119122. * // The `_.matches` iteratee shorthand.
  119123. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  119124. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  119125. *
  119126. * // The `_.matchesProperty` iteratee shorthand.
  119127. * _.filter(users, _.iteratee(['user', 'fred']));
  119128. * // => [{ 'user': 'fred', 'age': 40 }]
  119129. *
  119130. * // The `_.property` iteratee shorthand.
  119131. * _.map(users, _.iteratee('user'));
  119132. * // => ['barney', 'fred']
  119133. *
  119134. * // Create custom iteratee shorthands.
  119135. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  119136. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  119137. * return func.test(string);
  119138. * };
  119139. * });
  119140. *
  119141. * _.filter(['abc', 'def'], /ef/);
  119142. * // => ['def']
  119143. */
  119144. function iteratee(func) {
  119145. return Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(typeof func == 'function' ? func : Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, CLONE_DEEP_FLAG));
  119146. }
  119147. /* harmony default export */ __webpack_exports__["default"] = (iteratee);
  119148. /***/ }),
  119149. /***/ "./node_modules/lodash-es/join.js":
  119150. /*!****************************************!*\
  119151. !*** ./node_modules/lodash-es/join.js ***!
  119152. \****************************************/
  119153. /*! exports provided: default */
  119154. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119155. "use strict";
  119156. __webpack_require__.r(__webpack_exports__);
  119157. /** Used for built-in method references. */
  119158. var arrayProto = Array.prototype;
  119159. /* Built-in method references for those with the same name as other `lodash` methods. */
  119160. var nativeJoin = arrayProto.join;
  119161. /**
  119162. * Converts all elements in `array` into a string separated by `separator`.
  119163. *
  119164. * @static
  119165. * @memberOf _
  119166. * @since 4.0.0
  119167. * @category Array
  119168. * @param {Array} array The array to convert.
  119169. * @param {string} [separator=','] The element separator.
  119170. * @returns {string} Returns the joined string.
  119171. * @example
  119172. *
  119173. * _.join(['a', 'b', 'c'], '~');
  119174. * // => 'a~b~c'
  119175. */
  119176. function join(array, separator) {
  119177. return array == null ? '' : nativeJoin.call(array, separator);
  119178. }
  119179. /* harmony default export */ __webpack_exports__["default"] = (join);
  119180. /***/ }),
  119181. /***/ "./node_modules/lodash-es/kebabCase.js":
  119182. /*!*********************************************!*\
  119183. !*** ./node_modules/lodash-es/kebabCase.js ***!
  119184. \*********************************************/
  119185. /*! exports provided: default */
  119186. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119187. "use strict";
  119188. __webpack_require__.r(__webpack_exports__);
  119189. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  119190. /**
  119191. * Converts `string` to
  119192. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  119193. *
  119194. * @static
  119195. * @memberOf _
  119196. * @since 3.0.0
  119197. * @category String
  119198. * @param {string} [string=''] The string to convert.
  119199. * @returns {string} Returns the kebab cased string.
  119200. * @example
  119201. *
  119202. * _.kebabCase('Foo Bar');
  119203. * // => 'foo-bar'
  119204. *
  119205. * _.kebabCase('fooBar');
  119206. * // => 'foo-bar'
  119207. *
  119208. * _.kebabCase('__FOO_BAR__');
  119209. * // => 'foo-bar'
  119210. */
  119211. var kebabCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
  119212. return result + (index ? '-' : '') + word.toLowerCase();
  119213. });
  119214. /* harmony default export */ __webpack_exports__["default"] = (kebabCase);
  119215. /***/ }),
  119216. /***/ "./node_modules/lodash-es/keyBy.js":
  119217. /*!*****************************************!*\
  119218. !*** ./node_modules/lodash-es/keyBy.js ***!
  119219. \*****************************************/
  119220. /*! exports provided: default */
  119221. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119222. "use strict";
  119223. __webpack_require__.r(__webpack_exports__);
  119224. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  119225. /* harmony import */ var _createAggregator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAggregator.js */ "./node_modules/lodash-es/_createAggregator.js");
  119226. /**
  119227. * Creates an object composed of keys generated from the results of running
  119228. * each element of `collection` thru `iteratee`. The corresponding value of
  119229. * each key is the last element responsible for generating the key. The
  119230. * iteratee is invoked with one argument: (value).
  119231. *
  119232. * @static
  119233. * @memberOf _
  119234. * @since 4.0.0
  119235. * @category Collection
  119236. * @param {Array|Object} collection The collection to iterate over.
  119237. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  119238. * @returns {Object} Returns the composed aggregate object.
  119239. * @example
  119240. *
  119241. * var array = [
  119242. * { 'dir': 'left', 'code': 97 },
  119243. * { 'dir': 'right', 'code': 100 }
  119244. * ];
  119245. *
  119246. * _.keyBy(array, function(o) {
  119247. * return String.fromCharCode(o.code);
  119248. * });
  119249. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  119250. *
  119251. * _.keyBy(array, 'dir');
  119252. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  119253. */
  119254. var keyBy = Object(_createAggregator_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
  119255. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, key, value);
  119256. });
  119257. /* harmony default export */ __webpack_exports__["default"] = (keyBy);
  119258. /***/ }),
  119259. /***/ "./node_modules/lodash-es/keys.js":
  119260. /*!****************************************!*\
  119261. !*** ./node_modules/lodash-es/keys.js ***!
  119262. \****************************************/
  119263. /*! exports provided: default */
  119264. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119265. "use strict";
  119266. __webpack_require__.r(__webpack_exports__);
  119267. /* harmony import */ var _arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayLikeKeys.js */ "./node_modules/lodash-es/_arrayLikeKeys.js");
  119268. /* harmony import */ var _baseKeys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseKeys.js */ "./node_modules/lodash-es/_baseKeys.js");
  119269. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  119270. /**
  119271. * Creates an array of the own enumerable property names of `object`.
  119272. *
  119273. * **Note:** Non-object values are coerced to objects. See the
  119274. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  119275. * for more details.
  119276. *
  119277. * @static
  119278. * @since 0.1.0
  119279. * @memberOf _
  119280. * @category Object
  119281. * @param {Object} object The object to query.
  119282. * @returns {Array} Returns the array of property names.
  119283. * @example
  119284. *
  119285. * function Foo() {
  119286. * this.a = 1;
  119287. * this.b = 2;
  119288. * }
  119289. *
  119290. * Foo.prototype.c = 3;
  119291. *
  119292. * _.keys(new Foo);
  119293. * // => ['a', 'b'] (iteration order is not guaranteed)
  119294. *
  119295. * _.keys('hi');
  119296. * // => ['0', '1']
  119297. */
  119298. function keys(object) {
  119299. return Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object) ? Object(_arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object) : Object(_baseKeys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
  119300. }
  119301. /* harmony default export */ __webpack_exports__["default"] = (keys);
  119302. /***/ }),
  119303. /***/ "./node_modules/lodash-es/keysIn.js":
  119304. /*!******************************************!*\
  119305. !*** ./node_modules/lodash-es/keysIn.js ***!
  119306. \******************************************/
  119307. /*! exports provided: default */
  119308. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119309. "use strict";
  119310. __webpack_require__.r(__webpack_exports__);
  119311. /* harmony import */ var _arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayLikeKeys.js */ "./node_modules/lodash-es/_arrayLikeKeys.js");
  119312. /* harmony import */ var _baseKeysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseKeysIn.js */ "./node_modules/lodash-es/_baseKeysIn.js");
  119313. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  119314. /**
  119315. * Creates an array of the own and inherited enumerable property names of `object`.
  119316. *
  119317. * **Note:** Non-object values are coerced to objects.
  119318. *
  119319. * @static
  119320. * @memberOf _
  119321. * @since 3.0.0
  119322. * @category Object
  119323. * @param {Object} object The object to query.
  119324. * @returns {Array} Returns the array of property names.
  119325. * @example
  119326. *
  119327. * function Foo() {
  119328. * this.a = 1;
  119329. * this.b = 2;
  119330. * }
  119331. *
  119332. * Foo.prototype.c = 3;
  119333. *
  119334. * _.keysIn(new Foo);
  119335. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  119336. */
  119337. function keysIn(object) {
  119338. return Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object) ? Object(_arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, true) : Object(_baseKeysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
  119339. }
  119340. /* harmony default export */ __webpack_exports__["default"] = (keysIn);
  119341. /***/ }),
  119342. /***/ "./node_modules/lodash-es/lang.default.js":
  119343. /*!************************************************!*\
  119344. !*** ./node_modules/lodash-es/lang.default.js ***!
  119345. \************************************************/
  119346. /*! exports provided: default */
  119347. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119348. "use strict";
  119349. __webpack_require__.r(__webpack_exports__);
  119350. /* harmony import */ var _castArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./castArray.js */ "./node_modules/lodash-es/castArray.js");
  119351. /* harmony import */ var _clone_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clone.js */ "./node_modules/lodash-es/clone.js");
  119352. /* harmony import */ var _cloneDeep_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cloneDeep.js */ "./node_modules/lodash-es/cloneDeep.js");
  119353. /* harmony import */ var _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cloneDeepWith.js */ "./node_modules/lodash-es/cloneDeepWith.js");
  119354. /* harmony import */ var _cloneWith_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cloneWith.js */ "./node_modules/lodash-es/cloneWith.js");
  119355. /* harmony import */ var _conformsTo_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./conformsTo.js */ "./node_modules/lodash-es/conformsTo.js");
  119356. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  119357. /* harmony import */ var _gt_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./gt.js */ "./node_modules/lodash-es/gt.js");
  119358. /* harmony import */ var _gte_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./gte.js */ "./node_modules/lodash-es/gte.js");
  119359. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  119360. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  119361. /* harmony import */ var _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./isArrayBuffer.js */ "./node_modules/lodash-es/isArrayBuffer.js");
  119362. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  119363. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  119364. /* harmony import */ var _isBoolean_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./isBoolean.js */ "./node_modules/lodash-es/isBoolean.js");
  119365. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  119366. /* harmony import */ var _isDate_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./isDate.js */ "./node_modules/lodash-es/isDate.js");
  119367. /* harmony import */ var _isElement_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./isElement.js */ "./node_modules/lodash-es/isElement.js");
  119368. /* harmony import */ var _isEmpty_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./isEmpty.js */ "./node_modules/lodash-es/isEmpty.js");
  119369. /* harmony import */ var _isEqual_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./isEqual.js */ "./node_modules/lodash-es/isEqual.js");
  119370. /* harmony import */ var _isEqualWith_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./isEqualWith.js */ "./node_modules/lodash-es/isEqualWith.js");
  119371. /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
  119372. /* harmony import */ var _isFinite_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./isFinite.js */ "./node_modules/lodash-es/isFinite.js");
  119373. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  119374. /* harmony import */ var _isInteger_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./isInteger.js */ "./node_modules/lodash-es/isInteger.js");
  119375. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  119376. /* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/lodash-es/isMap.js");
  119377. /* harmony import */ var _isMatch_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./isMatch.js */ "./node_modules/lodash-es/isMatch.js");
  119378. /* harmony import */ var _isMatchWith_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./isMatchWith.js */ "./node_modules/lodash-es/isMatchWith.js");
  119379. /* harmony import */ var _isNaN_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./isNaN.js */ "./node_modules/lodash-es/isNaN.js");
  119380. /* harmony import */ var _isNative_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./isNative.js */ "./node_modules/lodash-es/isNative.js");
  119381. /* harmony import */ var _isNil_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./isNil.js */ "./node_modules/lodash-es/isNil.js");
  119382. /* harmony import */ var _isNull_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./isNull.js */ "./node_modules/lodash-es/isNull.js");
  119383. /* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/lodash-es/isNumber.js");
  119384. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  119385. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  119386. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  119387. /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
  119388. /* harmony import */ var _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./isSafeInteger.js */ "./node_modules/lodash-es/isSafeInteger.js");
  119389. /* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/lodash-es/isSet.js");
  119390. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  119391. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  119392. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  119393. /* harmony import */ var _isUndefined_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./isUndefined.js */ "./node_modules/lodash-es/isUndefined.js");
  119394. /* harmony import */ var _isWeakMap_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./isWeakMap.js */ "./node_modules/lodash-es/isWeakMap.js");
  119395. /* harmony import */ var _isWeakSet_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./isWeakSet.js */ "./node_modules/lodash-es/isWeakSet.js");
  119396. /* harmony import */ var _lt_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./lt.js */ "./node_modules/lodash-es/lt.js");
  119397. /* harmony import */ var _lte_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./lte.js */ "./node_modules/lodash-es/lte.js");
  119398. /* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/lodash-es/toArray.js");
  119399. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  119400. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  119401. /* harmony import */ var _toLength_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./toLength.js */ "./node_modules/lodash-es/toLength.js");
  119402. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  119403. /* harmony import */ var _toPlainObject_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./toPlainObject.js */ "./node_modules/lodash-es/toPlainObject.js");
  119404. /* harmony import */ var _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./toSafeInteger.js */ "./node_modules/lodash-es/toSafeInteger.js");
  119405. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  119406. /* harmony default export */ __webpack_exports__["default"] = ({
  119407. castArray: _castArray_js__WEBPACK_IMPORTED_MODULE_0__["default"], clone: _clone_js__WEBPACK_IMPORTED_MODULE_1__["default"], cloneDeep: _cloneDeep_js__WEBPACK_IMPORTED_MODULE_2__["default"], cloneDeepWith: _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_3__["default"], cloneWith: _cloneWith_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  119408. conformsTo: _conformsTo_js__WEBPACK_IMPORTED_MODULE_5__["default"], eq: _eq_js__WEBPACK_IMPORTED_MODULE_6__["default"], gt: _gt_js__WEBPACK_IMPORTED_MODULE_7__["default"], gte: _gte_js__WEBPACK_IMPORTED_MODULE_8__["default"], isArguments: _isArguments_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  119409. isArray: _isArray_js__WEBPACK_IMPORTED_MODULE_10__["default"], isArrayBuffer: _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_11__["default"], isArrayLike: _isArrayLike_js__WEBPACK_IMPORTED_MODULE_12__["default"], isArrayLikeObject: _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_13__["default"], isBoolean: _isBoolean_js__WEBPACK_IMPORTED_MODULE_14__["default"],
  119410. isBuffer: _isBuffer_js__WEBPACK_IMPORTED_MODULE_15__["default"], isDate: _isDate_js__WEBPACK_IMPORTED_MODULE_16__["default"], isElement: _isElement_js__WEBPACK_IMPORTED_MODULE_17__["default"], isEmpty: _isEmpty_js__WEBPACK_IMPORTED_MODULE_18__["default"], isEqual: _isEqual_js__WEBPACK_IMPORTED_MODULE_19__["default"],
  119411. isEqualWith: _isEqualWith_js__WEBPACK_IMPORTED_MODULE_20__["default"], isError: _isError_js__WEBPACK_IMPORTED_MODULE_21__["default"], isFinite: _isFinite_js__WEBPACK_IMPORTED_MODULE_22__["default"], isFunction: _isFunction_js__WEBPACK_IMPORTED_MODULE_23__["default"], isInteger: _isInteger_js__WEBPACK_IMPORTED_MODULE_24__["default"],
  119412. isLength: _isLength_js__WEBPACK_IMPORTED_MODULE_25__["default"], isMap: _isMap_js__WEBPACK_IMPORTED_MODULE_26__["default"], isMatch: _isMatch_js__WEBPACK_IMPORTED_MODULE_27__["default"], isMatchWith: _isMatchWith_js__WEBPACK_IMPORTED_MODULE_28__["default"], isNaN: _isNaN_js__WEBPACK_IMPORTED_MODULE_29__["default"],
  119413. isNative: _isNative_js__WEBPACK_IMPORTED_MODULE_30__["default"], isNil: _isNil_js__WEBPACK_IMPORTED_MODULE_31__["default"], isNull: _isNull_js__WEBPACK_IMPORTED_MODULE_32__["default"], isNumber: _isNumber_js__WEBPACK_IMPORTED_MODULE_33__["default"], isObject: _isObject_js__WEBPACK_IMPORTED_MODULE_34__["default"],
  119414. isObjectLike: _isObjectLike_js__WEBPACK_IMPORTED_MODULE_35__["default"], isPlainObject: _isPlainObject_js__WEBPACK_IMPORTED_MODULE_36__["default"], isRegExp: _isRegExp_js__WEBPACK_IMPORTED_MODULE_37__["default"], isSafeInteger: _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_38__["default"], isSet: _isSet_js__WEBPACK_IMPORTED_MODULE_39__["default"],
  119415. isString: _isString_js__WEBPACK_IMPORTED_MODULE_40__["default"], isSymbol: _isSymbol_js__WEBPACK_IMPORTED_MODULE_41__["default"], isTypedArray: _isTypedArray_js__WEBPACK_IMPORTED_MODULE_42__["default"], isUndefined: _isUndefined_js__WEBPACK_IMPORTED_MODULE_43__["default"], isWeakMap: _isWeakMap_js__WEBPACK_IMPORTED_MODULE_44__["default"],
  119416. isWeakSet: _isWeakSet_js__WEBPACK_IMPORTED_MODULE_45__["default"], lt: _lt_js__WEBPACK_IMPORTED_MODULE_46__["default"], lte: _lte_js__WEBPACK_IMPORTED_MODULE_47__["default"], toArray: _toArray_js__WEBPACK_IMPORTED_MODULE_48__["default"], toFinite: _toFinite_js__WEBPACK_IMPORTED_MODULE_49__["default"],
  119417. toInteger: _toInteger_js__WEBPACK_IMPORTED_MODULE_50__["default"], toLength: _toLength_js__WEBPACK_IMPORTED_MODULE_51__["default"], toNumber: _toNumber_js__WEBPACK_IMPORTED_MODULE_52__["default"], toPlainObject: _toPlainObject_js__WEBPACK_IMPORTED_MODULE_53__["default"], toSafeInteger: _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_54__["default"],
  119418. toString: _toString_js__WEBPACK_IMPORTED_MODULE_55__["default"]
  119419. });
  119420. /***/ }),
  119421. /***/ "./node_modules/lodash-es/lang.js":
  119422. /*!****************************************!*\
  119423. !*** ./node_modules/lodash-es/lang.js ***!
  119424. \****************************************/
  119425. /*! exports provided: castArray, clone, cloneDeep, cloneDeepWith, cloneWith, conformsTo, eq, gt, gte, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, lt, lte, toArray, toFinite, toInteger, toLength, toNumber, toPlainObject, toSafeInteger, toString, default */
  119426. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119427. "use strict";
  119428. __webpack_require__.r(__webpack_exports__);
  119429. /* harmony import */ var _castArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./castArray.js */ "./node_modules/lodash-es/castArray.js");
  119430. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "castArray", function() { return _castArray_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  119431. /* harmony import */ var _clone_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clone.js */ "./node_modules/lodash-es/clone.js");
  119432. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return _clone_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  119433. /* harmony import */ var _cloneDeep_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cloneDeep.js */ "./node_modules/lodash-es/cloneDeep.js");
  119434. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneDeep", function() { return _cloneDeep_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  119435. /* harmony import */ var _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cloneDeepWith.js */ "./node_modules/lodash-es/cloneDeepWith.js");
  119436. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneDeepWith", function() { return _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  119437. /* harmony import */ var _cloneWith_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cloneWith.js */ "./node_modules/lodash-es/cloneWith.js");
  119438. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneWith", function() { return _cloneWith_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  119439. /* harmony import */ var _conformsTo_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./conformsTo.js */ "./node_modules/lodash-es/conformsTo.js");
  119440. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "conformsTo", function() { return _conformsTo_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  119441. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  119442. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eq", function() { return _eq_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  119443. /* harmony import */ var _gt_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./gt.js */ "./node_modules/lodash-es/gt.js");
  119444. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gt", function() { return _gt_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  119445. /* harmony import */ var _gte_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./gte.js */ "./node_modules/lodash-es/gte.js");
  119446. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gte", function() { return _gte_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  119447. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  119448. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return _isArguments_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  119449. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  119450. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return _isArray_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  119451. /* harmony import */ var _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./isArrayBuffer.js */ "./node_modules/lodash-es/isArrayBuffer.js");
  119452. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  119453. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  119454. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLike", function() { return _isArrayLike_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  119455. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  119456. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLikeObject", function() { return _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  119457. /* harmony import */ var _isBoolean_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./isBoolean.js */ "./node_modules/lodash-es/isBoolean.js");
  119458. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return _isBoolean_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  119459. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  119460. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBuffer", function() { return _isBuffer_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  119461. /* harmony import */ var _isDate_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./isDate.js */ "./node_modules/lodash-es/isDate.js");
  119462. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return _isDate_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  119463. /* harmony import */ var _isElement_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./isElement.js */ "./node_modules/lodash-es/isElement.js");
  119464. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return _isElement_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  119465. /* harmony import */ var _isEmpty_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./isEmpty.js */ "./node_modules/lodash-es/isEmpty.js");
  119466. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _isEmpty_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  119467. /* harmony import */ var _isEqual_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./isEqual.js */ "./node_modules/lodash-es/isEqual.js");
  119468. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return _isEqual_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  119469. /* harmony import */ var _isEqualWith_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./isEqualWith.js */ "./node_modules/lodash-es/isEqualWith.js");
  119470. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqualWith", function() { return _isEqualWith_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  119471. /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
  119472. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return _isError_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  119473. /* harmony import */ var _isFinite_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./isFinite.js */ "./node_modules/lodash-es/isFinite.js");
  119474. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return _isFinite_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  119475. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  119476. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return _isFunction_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  119477. /* harmony import */ var _isInteger_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./isInteger.js */ "./node_modules/lodash-es/isInteger.js");
  119478. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isInteger", function() { return _isInteger_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  119479. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  119480. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return _isLength_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  119481. /* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/lodash-es/isMap.js");
  119482. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return _isMap_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  119483. /* harmony import */ var _isMatch_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./isMatch.js */ "./node_modules/lodash-es/isMatch.js");
  119484. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return _isMatch_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  119485. /* harmony import */ var _isMatchWith_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./isMatchWith.js */ "./node_modules/lodash-es/isMatchWith.js");
  119486. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatchWith", function() { return _isMatchWith_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  119487. /* harmony import */ var _isNaN_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./isNaN.js */ "./node_modules/lodash-es/isNaN.js");
  119488. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return _isNaN_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  119489. /* harmony import */ var _isNative_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./isNative.js */ "./node_modules/lodash-es/isNative.js");
  119490. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNative", function() { return _isNative_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  119491. /* harmony import */ var _isNil_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./isNil.js */ "./node_modules/lodash-es/isNil.js");
  119492. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNil", function() { return _isNil_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  119493. /* harmony import */ var _isNull_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./isNull.js */ "./node_modules/lodash-es/isNull.js");
  119494. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return _isNull_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  119495. /* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/lodash-es/isNumber.js");
  119496. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return _isNumber_js__WEBPACK_IMPORTED_MODULE_33__["default"]; });
  119497. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  119498. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return _isObject_js__WEBPACK_IMPORTED_MODULE_34__["default"]; });
  119499. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  119500. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObjectLike", function() { return _isObjectLike_js__WEBPACK_IMPORTED_MODULE_35__["default"]; });
  119501. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  119502. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return _isPlainObject_js__WEBPACK_IMPORTED_MODULE_36__["default"]; });
  119503. /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
  119504. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return _isRegExp_js__WEBPACK_IMPORTED_MODULE_37__["default"]; });
  119505. /* harmony import */ var _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./isSafeInteger.js */ "./node_modules/lodash-es/isSafeInteger.js");
  119506. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSafeInteger", function() { return _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_38__["default"]; });
  119507. /* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/lodash-es/isSet.js");
  119508. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return _isSet_js__WEBPACK_IMPORTED_MODULE_39__["default"]; });
  119509. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  119510. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return _isString_js__WEBPACK_IMPORTED_MODULE_40__["default"]; });
  119511. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  119512. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return _isSymbol_js__WEBPACK_IMPORTED_MODULE_41__["default"]; });
  119513. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  119514. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return _isTypedArray_js__WEBPACK_IMPORTED_MODULE_42__["default"]; });
  119515. /* harmony import */ var _isUndefined_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./isUndefined.js */ "./node_modules/lodash-es/isUndefined.js");
  119516. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return _isUndefined_js__WEBPACK_IMPORTED_MODULE_43__["default"]; });
  119517. /* harmony import */ var _isWeakMap_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./isWeakMap.js */ "./node_modules/lodash-es/isWeakMap.js");
  119518. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return _isWeakMap_js__WEBPACK_IMPORTED_MODULE_44__["default"]; });
  119519. /* harmony import */ var _isWeakSet_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./isWeakSet.js */ "./node_modules/lodash-es/isWeakSet.js");
  119520. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return _isWeakSet_js__WEBPACK_IMPORTED_MODULE_45__["default"]; });
  119521. /* harmony import */ var _lt_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./lt.js */ "./node_modules/lodash-es/lt.js");
  119522. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lt", function() { return _lt_js__WEBPACK_IMPORTED_MODULE_46__["default"]; });
  119523. /* harmony import */ var _lte_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./lte.js */ "./node_modules/lodash-es/lte.js");
  119524. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lte", function() { return _lte_js__WEBPACK_IMPORTED_MODULE_47__["default"]; });
  119525. /* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/lodash-es/toArray.js");
  119526. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _toArray_js__WEBPACK_IMPORTED_MODULE_48__["default"]; });
  119527. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  119528. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toFinite", function() { return _toFinite_js__WEBPACK_IMPORTED_MODULE_49__["default"]; });
  119529. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  119530. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toInteger", function() { return _toInteger_js__WEBPACK_IMPORTED_MODULE_50__["default"]; });
  119531. /* harmony import */ var _toLength_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./toLength.js */ "./node_modules/lodash-es/toLength.js");
  119532. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toLength", function() { return _toLength_js__WEBPACK_IMPORTED_MODULE_51__["default"]; });
  119533. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  119534. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toNumber", function() { return _toNumber_js__WEBPACK_IMPORTED_MODULE_52__["default"]; });
  119535. /* harmony import */ var _toPlainObject_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./toPlainObject.js */ "./node_modules/lodash-es/toPlainObject.js");
  119536. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPlainObject", function() { return _toPlainObject_js__WEBPACK_IMPORTED_MODULE_53__["default"]; });
  119537. /* harmony import */ var _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./toSafeInteger.js */ "./node_modules/lodash-es/toSafeInteger.js");
  119538. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toSafeInteger", function() { return _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_54__["default"]; });
  119539. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  119540. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return _toString_js__WEBPACK_IMPORTED_MODULE_55__["default"]; });
  119541. /* harmony import */ var _lang_default_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./lang.default.js */ "./node_modules/lodash-es/lang.default.js");
  119542. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _lang_default_js__WEBPACK_IMPORTED_MODULE_56__["default"]; });
  119543. /***/ }),
  119544. /***/ "./node_modules/lodash-es/last.js":
  119545. /*!****************************************!*\
  119546. !*** ./node_modules/lodash-es/last.js ***!
  119547. \****************************************/
  119548. /*! exports provided: default */
  119549. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119550. "use strict";
  119551. __webpack_require__.r(__webpack_exports__);
  119552. /**
  119553. * Gets the last element of `array`.
  119554. *
  119555. * @static
  119556. * @memberOf _
  119557. * @since 0.1.0
  119558. * @category Array
  119559. * @param {Array} array The array to query.
  119560. * @returns {*} Returns the last element of `array`.
  119561. * @example
  119562. *
  119563. * _.last([1, 2, 3]);
  119564. * // => 3
  119565. */
  119566. function last(array) {
  119567. var length = array == null ? 0 : array.length;
  119568. return length ? array[length - 1] : undefined;
  119569. }
  119570. /* harmony default export */ __webpack_exports__["default"] = (last);
  119571. /***/ }),
  119572. /***/ "./node_modules/lodash-es/lastIndexOf.js":
  119573. /*!***********************************************!*\
  119574. !*** ./node_modules/lodash-es/lastIndexOf.js ***!
  119575. \***********************************************/
  119576. /*! exports provided: default */
  119577. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119578. "use strict";
  119579. __webpack_require__.r(__webpack_exports__);
  119580. /* harmony import */ var _baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindIndex.js */ "./node_modules/lodash-es/_baseFindIndex.js");
  119581. /* harmony import */ var _baseIsNaN_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIsNaN.js */ "./node_modules/lodash-es/_baseIsNaN.js");
  119582. /* harmony import */ var _strictLastIndexOf_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_strictLastIndexOf.js */ "./node_modules/lodash-es/_strictLastIndexOf.js");
  119583. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  119584. /* Built-in method references for those with the same name as other `lodash` methods. */
  119585. var nativeMax = Math.max,
  119586. nativeMin = Math.min;
  119587. /**
  119588. * This method is like `_.indexOf` except that it iterates over elements of
  119589. * `array` from right to left.
  119590. *
  119591. * @static
  119592. * @memberOf _
  119593. * @since 0.1.0
  119594. * @category Array
  119595. * @param {Array} array The array to inspect.
  119596. * @param {*} value The value to search for.
  119597. * @param {number} [fromIndex=array.length-1] The index to search from.
  119598. * @returns {number} Returns the index of the matched value, else `-1`.
  119599. * @example
  119600. *
  119601. * _.lastIndexOf([1, 2, 1, 2], 2);
  119602. * // => 3
  119603. *
  119604. * // Search from the `fromIndex`.
  119605. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  119606. * // => 1
  119607. */
  119608. function lastIndexOf(array, value, fromIndex) {
  119609. var length = array == null ? 0 : array.length;
  119610. if (!length) {
  119611. return -1;
  119612. }
  119613. var index = length;
  119614. if (fromIndex !== undefined) {
  119615. index = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_3__["default"])(fromIndex);
  119616. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  119617. }
  119618. return value === value
  119619. ? Object(_strictLastIndexOf_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array, value, index)
  119620. : Object(_baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _baseIsNaN_js__WEBPACK_IMPORTED_MODULE_1__["default"], index, true);
  119621. }
  119622. /* harmony default export */ __webpack_exports__["default"] = (lastIndexOf);
  119623. /***/ }),
  119624. /***/ "./node_modules/lodash-es/lodash.default.js":
  119625. /*!**************************************************!*\
  119626. !*** ./node_modules/lodash-es/lodash.default.js ***!
  119627. \**************************************************/
  119628. /*! exports provided: default */
  119629. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  119630. "use strict";
  119631. __webpack_require__.r(__webpack_exports__);
  119632. /* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./array.js */ "./node_modules/lodash-es/array.js");
  119633. /* harmony import */ var _collection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./collection.js */ "./node_modules/lodash-es/collection.js");
  119634. /* harmony import */ var _date_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./date.js */ "./node_modules/lodash-es/date.js");
  119635. /* harmony import */ var _function_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./function.js */ "./node_modules/lodash-es/function.js");
  119636. /* harmony import */ var _lang_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lang.js */ "./node_modules/lodash-es/lang.js");
  119637. /* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./math.js */ "./node_modules/lodash-es/math.js");
  119638. /* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./number.js */ "./node_modules/lodash-es/number.js");
  119639. /* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./object.js */ "./node_modules/lodash-es/object.js");
  119640. /* harmony import */ var _seq_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./seq.js */ "./node_modules/lodash-es/seq.js");
  119641. /* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./string.js */ "./node_modules/lodash-es/string.js");
  119642. /* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./util.js */ "./node_modules/lodash-es/util.js");
  119643. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  119644. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  119645. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  119646. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  119647. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  119648. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  119649. /* harmony import */ var _baseFunctions_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./_baseFunctions.js */ "./node_modules/lodash-es/_baseFunctions.js");
  119650. /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
  119651. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  119652. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  119653. /* harmony import */ var _createHybrid_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./_createHybrid.js */ "./node_modules/lodash-es/_createHybrid.js");
  119654. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  119655. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  119656. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  119657. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  119658. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  119659. /* harmony import */ var _lazyClone_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./_lazyClone.js */ "./node_modules/lodash-es/_lazyClone.js");
  119660. /* harmony import */ var _lazyReverse_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./_lazyReverse.js */ "./node_modules/lodash-es/_lazyReverse.js");
  119661. /* harmony import */ var _lazyValue_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./_lazyValue.js */ "./node_modules/lodash-es/_lazyValue.js");
  119662. /* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./mixin.js */ "./node_modules/lodash-es/mixin.js");
  119663. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  119664. /* harmony import */ var _realNames_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./_realNames.js */ "./node_modules/lodash-es/_realNames.js");
  119665. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  119666. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  119667. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  119668. /**
  119669. * @license
  119670. * Lodash (Custom Build) <https://lodash.com/>
  119671. * Build: `lodash modularize exports="es" -o ./`
  119672. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  119673. * Released under MIT license <https://lodash.com/license>
  119674. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  119675. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  119676. */
  119677. /** Used as the semantic version number. */
  119678. var VERSION = '4.17.21';
  119679. /** Used to compose bitmasks for function metadata. */
  119680. var WRAP_BIND_KEY_FLAG = 2;
  119681. /** Used to indicate the type of lazy iteratees. */
  119682. var LAZY_FILTER_FLAG = 1,
  119683. LAZY_WHILE_FLAG = 3;
  119684. /** Used as references for the maximum length and index of an array. */
  119685. var MAX_ARRAY_LENGTH = 4294967295;
  119686. /** Used for built-in method references. */
  119687. var arrayProto = Array.prototype,
  119688. objectProto = Object.prototype;
  119689. /** Used to check objects for own properties. */
  119690. var hasOwnProperty = objectProto.hasOwnProperty;
  119691. /** Built-in value references. */
  119692. var symIterator = _Symbol_js__WEBPACK_IMPORTED_MODULE_13__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_13__["default"].iterator : undefined;
  119693. /* Built-in method references for those with the same name as other `lodash` methods. */
  119694. var nativeMax = Math.max,
  119695. nativeMin = Math.min;
  119696. // wrap `_.mixin` so it works when provided only one argument
  119697. var mixin = (function(func) {
  119698. return function(object, source, options) {
  119699. if (options == null) {
  119700. var isObj = Object(_isObject_js__WEBPACK_IMPORTED_MODULE_24__["default"])(source),
  119701. props = isObj && Object(_keys_js__WEBPACK_IMPORTED_MODULE_25__["default"])(source),
  119702. methodNames = props && props.length && Object(_baseFunctions_js__WEBPACK_IMPORTED_MODULE_17__["default"])(source, props);
  119703. if (!(methodNames ? methodNames.length : isObj)) {
  119704. options = source;
  119705. source = object;
  119706. object = this;
  119707. }
  119708. }
  119709. return func(object, source, options);
  119710. };
  119711. }(_mixin_js__WEBPACK_IMPORTED_MODULE_30__["default"]));
  119712. // Add methods that return wrapped values in chain sequences.
  119713. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].after = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].after;
  119714. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].ary = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].ary;
  119715. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].assign = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assign;
  119716. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].assignIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignIn;
  119717. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].assignInWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignInWith;
  119718. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].assignWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignWith;
  119719. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].at = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].at;
  119720. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].before = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].before;
  119721. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].bind = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].bind;
  119722. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].bindAll = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].bindAll;
  119723. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].bindKey = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].bindKey;
  119724. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].castArray = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].castArray;
  119725. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].chain = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].chain;
  119726. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].chunk = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].chunk;
  119727. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].compact = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].compact;
  119728. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].concat = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].concat;
  119729. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].cond = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].cond;
  119730. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].conforms = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].conforms;
  119731. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].constant = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].constant;
  119732. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].countBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].countBy;
  119733. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].create = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].create;
  119734. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].curry = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].curry;
  119735. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].curryRight = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].curryRight;
  119736. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].debounce = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].debounce;
  119737. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].defaults = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].defaults;
  119738. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].defaultsDeep = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].defaultsDeep;
  119739. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].defer = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].defer;
  119740. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].delay = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].delay;
  119741. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].difference = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].difference;
  119742. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].differenceBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].differenceBy;
  119743. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].differenceWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].differenceWith;
  119744. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].drop = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].drop;
  119745. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].dropRight = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].dropRight;
  119746. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].dropRightWhile = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].dropRightWhile;
  119747. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].dropWhile = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].dropWhile;
  119748. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].fill = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].fill;
  119749. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].filter = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].filter;
  119750. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flatMap = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].flatMap;
  119751. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flatMapDeep = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].flatMapDeep;
  119752. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flatMapDepth = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].flatMapDepth;
  119753. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flatten = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].flatten;
  119754. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flattenDeep = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].flattenDeep;
  119755. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flattenDepth = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].flattenDepth;
  119756. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flip = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].flip;
  119757. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flow = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].flow;
  119758. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flowRight = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].flowRight;
  119759. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].fromPairs = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].fromPairs;
  119760. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].functions = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].functions;
  119761. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].functionsIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].functionsIn;
  119762. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].groupBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].groupBy;
  119763. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].initial = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].initial;
  119764. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].intersection = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].intersection;
  119765. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].intersectionBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].intersectionBy;
  119766. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].intersectionWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].intersectionWith;
  119767. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].invert = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].invert;
  119768. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].invertBy = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].invertBy;
  119769. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].invokeMap = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].invokeMap;
  119770. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].iteratee = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].iteratee;
  119771. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].keyBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].keyBy;
  119772. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].keys = _keys_js__WEBPACK_IMPORTED_MODULE_25__["default"];
  119773. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].keysIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].keysIn;
  119774. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].map = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].map;
  119775. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mapKeys = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].mapKeys;
  119776. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mapValues = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].mapValues;
  119777. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].matches = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].matches;
  119778. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].matchesProperty = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].matchesProperty;
  119779. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].memoize = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].memoize;
  119780. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].merge = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].merge;
  119781. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mergeWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].mergeWith;
  119782. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].method = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].method;
  119783. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].methodOf = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].methodOf;
  119784. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mixin = mixin;
  119785. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].negate = _negate_js__WEBPACK_IMPORTED_MODULE_31__["default"];
  119786. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].nthArg = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].nthArg;
  119787. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].omit = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].omit;
  119788. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].omitBy = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].omitBy;
  119789. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].once = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].once;
  119790. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].orderBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].orderBy;
  119791. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].over = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].over;
  119792. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].overArgs = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].overArgs;
  119793. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].overEvery = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].overEvery;
  119794. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].overSome = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].overSome;
  119795. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].partial = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].partial;
  119796. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].partialRight = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].partialRight;
  119797. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].partition = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].partition;
  119798. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pick = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].pick;
  119799. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pickBy = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].pickBy;
  119800. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].property = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].property;
  119801. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].propertyOf = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].propertyOf;
  119802. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pull = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pull;
  119803. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pullAll = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pullAll;
  119804. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pullAllBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pullAllBy;
  119805. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pullAllWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pullAllWith;
  119806. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pullAt = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pullAt;
  119807. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].range = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].range;
  119808. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].rangeRight = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].rangeRight;
  119809. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].rearg = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].rearg;
  119810. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].reject = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].reject;
  119811. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].remove = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].remove;
  119812. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].rest = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].rest;
  119813. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].reverse = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].reverse;
  119814. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sampleSize = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].sampleSize;
  119815. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].set = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].set;
  119816. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].setWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].setWith;
  119817. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].shuffle = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].shuffle;
  119818. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].slice = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].slice;
  119819. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].sortBy;
  119820. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedUniq = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedUniq;
  119821. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedUniqBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedUniqBy;
  119822. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].split = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].split;
  119823. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].spread = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].spread;
  119824. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].tail = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].tail;
  119825. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].take = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].take;
  119826. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].takeRight = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].takeRight;
  119827. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].takeRightWhile = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].takeRightWhile;
  119828. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].takeWhile = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].takeWhile;
  119829. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].tap = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].tap;
  119830. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].throttle = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].throttle;
  119831. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].thru = _thru_js__WEBPACK_IMPORTED_MODULE_33__["default"];
  119832. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toArray = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toArray;
  119833. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toPairs = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].toPairs;
  119834. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toPairsIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].toPairsIn;
  119835. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toPath = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].toPath;
  119836. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toPlainObject = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toPlainObject;
  119837. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].transform = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].transform;
  119838. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unary = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].unary;
  119839. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].union = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].union;
  119840. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unionBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].unionBy;
  119841. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unionWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].unionWith;
  119842. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].uniq = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].uniq;
  119843. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].uniqBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].uniqBy;
  119844. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].uniqWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].uniqWith;
  119845. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unset = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].unset;
  119846. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unzip = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].unzip;
  119847. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unzipWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].unzipWith;
  119848. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].update = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].update;
  119849. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].updateWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].updateWith;
  119850. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].values = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].values;
  119851. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].valuesIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].valuesIn;
  119852. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].without = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].without;
  119853. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].words = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].words;
  119854. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].wrap = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].wrap;
  119855. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].xor = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].xor;
  119856. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].xorBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].xorBy;
  119857. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].xorWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].xorWith;
  119858. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].zip = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].zip;
  119859. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].zipObject = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].zipObject;
  119860. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].zipObjectDeep = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].zipObjectDeep;
  119861. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].zipWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].zipWith;
  119862. // Add aliases.
  119863. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].entries = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].toPairs;
  119864. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].entriesIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].toPairsIn;
  119865. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].extend = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignIn;
  119866. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].extendWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignInWith;
  119867. // Add methods to `lodash.prototype`.
  119868. mixin(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"], _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"]);
  119869. // Add methods that return unwrapped values in chain sequences.
  119870. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].add = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].add;
  119871. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].attempt = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].attempt;
  119872. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].camelCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].camelCase;
  119873. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].capitalize = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].capitalize;
  119874. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].ceil = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].ceil;
  119875. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].clamp = _number_js__WEBPACK_IMPORTED_MODULE_6__["default"].clamp;
  119876. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].clone = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].clone;
  119877. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].cloneDeep = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].cloneDeep;
  119878. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].cloneDeepWith = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].cloneDeepWith;
  119879. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].cloneWith = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].cloneWith;
  119880. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].conformsTo = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].conformsTo;
  119881. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].deburr = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].deburr;
  119882. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].defaultTo = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].defaultTo;
  119883. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].divide = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].divide;
  119884. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].endsWith = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].endsWith;
  119885. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].eq = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].eq;
  119886. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].escape = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].escape;
  119887. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].escapeRegExp = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].escapeRegExp;
  119888. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].every = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].every;
  119889. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].find = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].find;
  119890. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findIndex = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].findIndex;
  119891. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findKey = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].findKey;
  119892. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findLast = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].findLast;
  119893. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findLastIndex = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].findLastIndex;
  119894. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findLastKey = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].findLastKey;
  119895. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].floor = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].floor;
  119896. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forEach = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach;
  119897. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forEachRight = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEachRight;
  119898. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].forIn;
  119899. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forInRight = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].forInRight;
  119900. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forOwn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].forOwn;
  119901. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forOwnRight = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].forOwnRight;
  119902. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].get = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].get;
  119903. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].gt = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].gt;
  119904. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].gte = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].gte;
  119905. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].has = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].has;
  119906. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].hasIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].hasIn;
  119907. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].head = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].head;
  119908. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].identity = _identity_js__WEBPACK_IMPORTED_MODULE_22__["default"];
  119909. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].includes = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].includes;
  119910. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].indexOf = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].indexOf;
  119911. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].inRange = _number_js__WEBPACK_IMPORTED_MODULE_6__["default"].inRange;
  119912. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].invoke = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].invoke;
  119913. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArguments = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isArguments;
  119914. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArray = _isArray_js__WEBPACK_IMPORTED_MODULE_23__["default"];
  119915. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArrayBuffer = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isArrayBuffer;
  119916. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArrayLike = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isArrayLike;
  119917. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArrayLikeObject = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isArrayLikeObject;
  119918. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isBoolean = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isBoolean;
  119919. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isBuffer = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isBuffer;
  119920. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isDate = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isDate;
  119921. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isElement = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isElement;
  119922. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isEmpty = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isEmpty;
  119923. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isEqual = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isEqual;
  119924. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isEqualWith = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isEqualWith;
  119925. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isError = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isError;
  119926. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isFinite = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isFinite;
  119927. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isFunction = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isFunction;
  119928. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isInteger = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isInteger;
  119929. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isLength = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isLength;
  119930. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isMap = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isMap;
  119931. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isMatch = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isMatch;
  119932. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isMatchWith = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isMatchWith;
  119933. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNaN = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNaN;
  119934. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNative = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNative;
  119935. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNil = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNil;
  119936. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNull = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNull;
  119937. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNumber = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNumber;
  119938. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isObject = _isObject_js__WEBPACK_IMPORTED_MODULE_24__["default"];
  119939. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isObjectLike = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isObjectLike;
  119940. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isPlainObject = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isPlainObject;
  119941. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isRegExp = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isRegExp;
  119942. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isSafeInteger = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isSafeInteger;
  119943. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isSet = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isSet;
  119944. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isString = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isString;
  119945. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isSymbol = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isSymbol;
  119946. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isTypedArray = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isTypedArray;
  119947. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isUndefined = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isUndefined;
  119948. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isWeakMap = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isWeakMap;
  119949. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isWeakSet = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isWeakSet;
  119950. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].join = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].join;
  119951. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].kebabCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].kebabCase;
  119952. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].last = _last_js__WEBPACK_IMPORTED_MODULE_26__["default"];
  119953. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lastIndexOf = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].lastIndexOf;
  119954. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lowerCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].lowerCase;
  119955. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lowerFirst = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].lowerFirst;
  119956. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lt = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].lt;
  119957. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lte = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].lte;
  119958. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].max = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].max;
  119959. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].maxBy = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].maxBy;
  119960. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mean = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].mean;
  119961. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].meanBy = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].meanBy;
  119962. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].min = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].min;
  119963. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].minBy = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].minBy;
  119964. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubArray = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubArray;
  119965. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubFalse = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubFalse;
  119966. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubObject = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubObject;
  119967. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubString = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubString;
  119968. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubTrue = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubTrue;
  119969. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].multiply = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].multiply;
  119970. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].nth = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].nth;
  119971. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].noop = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].noop;
  119972. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].now = _date_js__WEBPACK_IMPORTED_MODULE_2__["default"].now;
  119973. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pad = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].pad;
  119974. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].padEnd = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].padEnd;
  119975. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].padStart = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].padStart;
  119976. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].parseInt = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].parseInt;
  119977. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].random = _number_js__WEBPACK_IMPORTED_MODULE_6__["default"].random;
  119978. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].reduce = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].reduce;
  119979. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].reduceRight = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].reduceRight;
  119980. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].repeat = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].repeat;
  119981. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].replace = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].replace;
  119982. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].result = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].result;
  119983. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].round = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].round;
  119984. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sample = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].sample;
  119985. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].size = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].size;
  119986. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].snakeCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].snakeCase;
  119987. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].some = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].some;
  119988. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedIndex = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedIndex;
  119989. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedIndexBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedIndexBy;
  119990. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedIndexOf = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedIndexOf;
  119991. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedLastIndex = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedLastIndex;
  119992. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedLastIndexBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedLastIndexBy;
  119993. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedLastIndexOf = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedLastIndexOf;
  119994. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].startCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].startCase;
  119995. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].startsWith = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].startsWith;
  119996. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].subtract = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].subtract;
  119997. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sum = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].sum;
  119998. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sumBy = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].sumBy;
  119999. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].template = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].template;
  120000. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].times = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].times;
  120001. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toFinite = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toFinite;
  120002. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toInteger = _toInteger_js__WEBPACK_IMPORTED_MODULE_34__["default"];
  120003. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toLength = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toLength;
  120004. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toLower = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].toLower;
  120005. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toNumber = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toNumber;
  120006. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toSafeInteger = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toSafeInteger;
  120007. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toString = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toString;
  120008. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toUpper = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].toUpper;
  120009. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].trim = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].trim;
  120010. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].trimEnd = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].trimEnd;
  120011. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].trimStart = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].trimStart;
  120012. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].truncate = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].truncate;
  120013. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unescape = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].unescape;
  120014. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].uniqueId = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].uniqueId;
  120015. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].upperCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].upperCase;
  120016. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].upperFirst = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].upperFirst;
  120017. // Add aliases.
  120018. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].each = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach;
  120019. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].eachRight = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEachRight;
  120020. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].first = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].head;
  120021. mixin(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"], (function() {
  120022. var source = {};
  120023. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"])(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"], function(func, methodName) {
  120024. if (!hasOwnProperty.call(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype, methodName)) {
  120025. source[methodName] = func;
  120026. }
  120027. });
  120028. return source;
  120029. }()), { 'chain': false });
  120030. /**
  120031. * The semantic version number.
  120032. *
  120033. * @static
  120034. * @memberOf _
  120035. * @type {string}
  120036. */
  120037. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].VERSION = VERSION;
  120038. (_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].templateSettings = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].templateSettings).imports._ = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"];
  120039. // Assign default placeholders.
  120040. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  120041. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"][methodName].placeholder = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"];
  120042. });
  120043. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  120044. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['drop', 'take'], function(methodName, index) {
  120045. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName] = function(n) {
  120046. n = n === undefined ? 1 : nativeMax(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_34__["default"])(n), 0);
  120047. var result = (this.__filtered__ && !index)
  120048. ? new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](this)
  120049. : this.clone();
  120050. if (result.__filtered__) {
  120051. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  120052. } else {
  120053. result.__views__.push({
  120054. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  120055. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  120056. });
  120057. }
  120058. return result;
  120059. };
  120060. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName + 'Right'] = function(n) {
  120061. return this.reverse()[methodName](n).reverse();
  120062. };
  120063. });
  120064. // Add `LazyWrapper` methods that accept an `iteratee` value.
  120065. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['filter', 'map', 'takeWhile'], function(methodName, index) {
  120066. var type = index + 1,
  120067. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  120068. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName] = function(iteratee) {
  120069. var result = this.clone();
  120070. result.__iteratees__.push({
  120071. 'iteratee': Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_19__["default"])(iteratee, 3),
  120072. 'type': type
  120073. });
  120074. result.__filtered__ = result.__filtered__ || isFilter;
  120075. return result;
  120076. };
  120077. });
  120078. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  120079. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['head', 'last'], function(methodName, index) {
  120080. var takeName = 'take' + (index ? 'Right' : '');
  120081. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName] = function() {
  120082. return this[takeName](1).value()[0];
  120083. };
  120084. });
  120085. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  120086. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['initial', 'tail'], function(methodName, index) {
  120087. var dropName = 'drop' + (index ? '' : 'Right');
  120088. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName] = function() {
  120089. return this.__filtered__ ? new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](this) : this[dropName](1);
  120090. };
  120091. });
  120092. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.compact = function() {
  120093. return this.filter(_identity_js__WEBPACK_IMPORTED_MODULE_22__["default"]);
  120094. };
  120095. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.find = function(predicate) {
  120096. return this.filter(predicate).head();
  120097. };
  120098. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.findLast = function(predicate) {
  120099. return this.reverse().find(predicate);
  120100. };
  120101. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.invokeMap = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_20__["default"])(function(path, args) {
  120102. if (typeof path == 'function') {
  120103. return new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](this);
  120104. }
  120105. return this.map(function(value) {
  120106. return Object(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_18__["default"])(value, path, args);
  120107. });
  120108. });
  120109. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.reject = function(predicate) {
  120110. return this.filter(Object(_negate_js__WEBPACK_IMPORTED_MODULE_31__["default"])(Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_19__["default"])(predicate)));
  120111. };
  120112. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.slice = function(start, end) {
  120113. start = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_34__["default"])(start);
  120114. var result = this;
  120115. if (result.__filtered__ && (start > 0 || end < 0)) {
  120116. return new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](result);
  120117. }
  120118. if (start < 0) {
  120119. result = result.takeRight(-start);
  120120. } else if (start) {
  120121. result = result.drop(start);
  120122. }
  120123. if (end !== undefined) {
  120124. end = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_34__["default"])(end);
  120125. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  120126. }
  120127. return result;
  120128. };
  120129. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.takeRightWhile = function(predicate) {
  120130. return this.reverse().takeWhile(predicate).reverse();
  120131. };
  120132. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.toArray = function() {
  120133. return this.take(MAX_ARRAY_LENGTH);
  120134. };
  120135. // Add `LazyWrapper` methods to `lodash.prototype`.
  120136. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"])(_LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype, function(func, methodName) {
  120137. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  120138. isTaker = /^(?:head|last)$/.test(methodName),
  120139. lodashFunc = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"][isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  120140. retUnwrapped = isTaker || /^find/.test(methodName);
  120141. if (!lodashFunc) {
  120142. return;
  120143. }
  120144. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype[methodName] = function() {
  120145. var value = this.__wrapped__,
  120146. args = isTaker ? [1] : arguments,
  120147. isLazy = value instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"],
  120148. iteratee = args[0],
  120149. useLazy = isLazy || Object(_isArray_js__WEBPACK_IMPORTED_MODULE_23__["default"])(value);
  120150. var interceptor = function(value) {
  120151. var result = lodashFunc.apply(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"], Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_15__["default"])([value], args));
  120152. return (isTaker && chainAll) ? result[0] : result;
  120153. };
  120154. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  120155. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  120156. isLazy = useLazy = false;
  120157. }
  120158. var chainAll = this.__chain__,
  120159. isHybrid = !!this.__actions__.length,
  120160. isUnwrapped = retUnwrapped && !chainAll,
  120161. onlyLazy = isLazy && !isHybrid;
  120162. if (!retUnwrapped && useLazy) {
  120163. value = onlyLazy ? value : new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](this);
  120164. var result = func.apply(value, args);
  120165. result.__actions__.push({ 'func': _thru_js__WEBPACK_IMPORTED_MODULE_33__["default"], 'args': [interceptor], 'thisArg': undefined });
  120166. return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_12__["default"](result, chainAll);
  120167. }
  120168. if (isUnwrapped && onlyLazy) {
  120169. return func.apply(this, args);
  120170. }
  120171. result = this.thru(interceptor);
  120172. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  120173. };
  120174. });
  120175. // Add `Array` methods to `lodash.prototype`.
  120176. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  120177. var func = arrayProto[methodName],
  120178. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  120179. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  120180. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype[methodName] = function() {
  120181. var args = arguments;
  120182. if (retUnwrapped && !this.__chain__) {
  120183. var value = this.value();
  120184. return func.apply(Object(_isArray_js__WEBPACK_IMPORTED_MODULE_23__["default"])(value) ? value : [], args);
  120185. }
  120186. return this[chainName](function(value) {
  120187. return func.apply(Object(_isArray_js__WEBPACK_IMPORTED_MODULE_23__["default"])(value) ? value : [], args);
  120188. });
  120189. };
  120190. });
  120191. // Map minified method names to their real names.
  120192. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"])(_LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype, function(func, methodName) {
  120193. var lodashFunc = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"][methodName];
  120194. if (lodashFunc) {
  120195. var key = lodashFunc.name + '';
  120196. if (!hasOwnProperty.call(_realNames_js__WEBPACK_IMPORTED_MODULE_32__["default"], key)) {
  120197. _realNames_js__WEBPACK_IMPORTED_MODULE_32__["default"][key] = [];
  120198. }
  120199. _realNames_js__WEBPACK_IMPORTED_MODULE_32__["default"][key].push({ 'name': methodName, 'func': lodashFunc });
  120200. }
  120201. });
  120202. _realNames_js__WEBPACK_IMPORTED_MODULE_32__["default"][Object(_createHybrid_js__WEBPACK_IMPORTED_MODULE_21__["default"])(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  120203. 'name': 'wrapper',
  120204. 'func': undefined
  120205. }];
  120206. // Add methods to `LazyWrapper`.
  120207. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.clone = _lazyClone_js__WEBPACK_IMPORTED_MODULE_27__["default"];
  120208. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.reverse = _lazyReverse_js__WEBPACK_IMPORTED_MODULE_28__["default"];
  120209. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.value = _lazyValue_js__WEBPACK_IMPORTED_MODULE_29__["default"];
  120210. // Add chain sequence methods to the `lodash` wrapper.
  120211. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.at = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].at;
  120212. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.chain = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].wrapperChain;
  120213. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.commit = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].commit;
  120214. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.next = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].next;
  120215. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.plant = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].plant;
  120216. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.reverse = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].reverse;
  120217. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.toJSON = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.valueOf = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.value = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].value;
  120218. // Add lazy aliases.
  120219. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.first = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.head;
  120220. if (symIterator) {
  120221. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype[symIterator] = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].toIterator;
  120222. }
  120223. /* harmony default export */ __webpack_exports__["default"] = (_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"]);
  120224. /***/ }),
  120225. /***/ "./node_modules/lodash-es/lodash.js":
  120226. /*!******************************************!*\
  120227. !*** ./node_modules/lodash-es/lodash.js ***!
  120228. \******************************************/
  120229. /*! exports provided: add, after, ary, assign, assignIn, assignInWith, assignWith, at, attempt, before, bind, bindAll, bindKey, camelCase, capitalize, castArray, ceil, chain, chunk, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, commit, compact, concat, cond, conforms, conformsTo, constant, countBy, create, curry, curryRight, debounce, deburr, defaultTo, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, divide, drop, dropRight, dropRightWhile, dropWhile, each, eachRight, endsWith, entries, entriesIn, eq, escape, escapeRegExp, every, extend, extendWith, fill, filter, find, findIndex, findKey, findLast, findLastIndex, findLastKey, first, flatMap, flatMapDeep, flatMapDepth, flatten, flattenDeep, flattenDepth, flip, floor, flow, flowRight, forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, fromPairs, functions, functionsIn, get, groupBy, gt, gte, has, hasIn, head, identity, inRange, includes, indexOf, initial, intersection, intersectionBy, intersectionWith, invert, invertBy, invoke, invokeMap, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, iteratee, join, kebabCase, keyBy, keys, keysIn, last, lastIndexOf, lodash, lowerCase, lowerFirst, lt, lte, map, mapKeys, mapValues, matches, matchesProperty, max, maxBy, mean, meanBy, memoize, merge, mergeWith, method, methodOf, min, minBy, mixin, multiply, negate, next, noop, now, nth, nthArg, omit, omitBy, once, orderBy, over, overArgs, overEvery, overSome, pad, padEnd, padStart, parseInt, partial, partialRight, partition, pick, pickBy, plant, property, propertyOf, pull, pullAll, pullAllBy, pullAllWith, pullAt, random, range, rangeRight, rearg, reduce, reduceRight, reject, remove, repeat, replace, rest, result, reverse, round, sample, sampleSize, set, setWith, shuffle, size, slice, snakeCase, some, sortBy, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, sortedUniq, sortedUniqBy, split, spread, startCase, startsWith, stubArray, stubFalse, stubObject, stubString, stubTrue, subtract, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, tap, template, templateSettings, throttle, thru, times, toArray, toFinite, toInteger, toIterator, toJSON, toLength, toLower, toNumber, toPairs, toPairsIn, toPath, toPlainObject, toSafeInteger, toString, toUpper, transform, trim, trimEnd, trimStart, truncate, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, uniqueId, unset, unzip, unzipWith, update, updateWith, upperCase, upperFirst, value, valueOf, values, valuesIn, without, words, wrap, wrapperAt, wrapperChain, wrapperCommit, wrapperLodash, wrapperNext, wrapperPlant, wrapperReverse, wrapperToIterator, wrapperValue, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, zipWith, default */
  120230. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120231. "use strict";
  120232. __webpack_require__.r(__webpack_exports__);
  120233. /* harmony import */ var _add_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.js */ "./node_modules/lodash-es/add.js");
  120234. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "add", function() { return _add_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  120235. /* harmony import */ var _after_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./after.js */ "./node_modules/lodash-es/after.js");
  120236. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "after", function() { return _after_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  120237. /* harmony import */ var _ary_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ary.js */ "./node_modules/lodash-es/ary.js");
  120238. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ary", function() { return _ary_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  120239. /* harmony import */ var _assign_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./assign.js */ "./node_modules/lodash-es/assign.js");
  120240. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return _assign_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  120241. /* harmony import */ var _assignIn_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./assignIn.js */ "./node_modules/lodash-es/assignIn.js");
  120242. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignIn", function() { return _assignIn_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  120243. /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
  120244. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignInWith", function() { return _assignInWith_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  120245. /* harmony import */ var _assignWith_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./assignWith.js */ "./node_modules/lodash-es/assignWith.js");
  120246. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignWith", function() { return _assignWith_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  120247. /* harmony import */ var _at_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./at.js */ "./node_modules/lodash-es/at.js");
  120248. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "at", function() { return _at_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  120249. /* harmony import */ var _attempt_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./attempt.js */ "./node_modules/lodash-es/attempt.js");
  120250. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "attempt", function() { return _attempt_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  120251. /* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./before.js */ "./node_modules/lodash-es/before.js");
  120252. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "before", function() { return _before_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  120253. /* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./bind.js */ "./node_modules/lodash-es/bind.js");
  120254. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return _bind_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  120255. /* harmony import */ var _bindAll_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./bindAll.js */ "./node_modules/lodash-es/bindAll.js");
  120256. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return _bindAll_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  120257. /* harmony import */ var _bindKey_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./bindKey.js */ "./node_modules/lodash-es/bindKey.js");
  120258. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindKey", function() { return _bindKey_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  120259. /* harmony import */ var _camelCase_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./camelCase.js */ "./node_modules/lodash-es/camelCase.js");
  120260. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "camelCase", function() { return _camelCase_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  120261. /* harmony import */ var _capitalize_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./capitalize.js */ "./node_modules/lodash-es/capitalize.js");
  120262. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "capitalize", function() { return _capitalize_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  120263. /* harmony import */ var _castArray_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./castArray.js */ "./node_modules/lodash-es/castArray.js");
  120264. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "castArray", function() { return _castArray_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  120265. /* harmony import */ var _ceil_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./ceil.js */ "./node_modules/lodash-es/ceil.js");
  120266. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return _ceil_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  120267. /* harmony import */ var _chain_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./chain.js */ "./node_modules/lodash-es/chain.js");
  120268. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return _chain_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  120269. /* harmony import */ var _chunk_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./chunk.js */ "./node_modules/lodash-es/chunk.js");
  120270. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return _chunk_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  120271. /* harmony import */ var _clamp_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./clamp.js */ "./node_modules/lodash-es/clamp.js");
  120272. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return _clamp_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  120273. /* harmony import */ var _clone_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./clone.js */ "./node_modules/lodash-es/clone.js");
  120274. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return _clone_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  120275. /* harmony import */ var _cloneDeep_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./cloneDeep.js */ "./node_modules/lodash-es/cloneDeep.js");
  120276. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneDeep", function() { return _cloneDeep_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  120277. /* harmony import */ var _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./cloneDeepWith.js */ "./node_modules/lodash-es/cloneDeepWith.js");
  120278. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneDeepWith", function() { return _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  120279. /* harmony import */ var _cloneWith_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./cloneWith.js */ "./node_modules/lodash-es/cloneWith.js");
  120280. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneWith", function() { return _cloneWith_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  120281. /* harmony import */ var _commit_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./commit.js */ "./node_modules/lodash-es/commit.js");
  120282. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "commit", function() { return _commit_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  120283. /* harmony import */ var _compact_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./compact.js */ "./node_modules/lodash-es/compact.js");
  120284. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return _compact_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  120285. /* harmony import */ var _concat_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./concat.js */ "./node_modules/lodash-es/concat.js");
  120286. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _concat_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  120287. /* harmony import */ var _cond_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./cond.js */ "./node_modules/lodash-es/cond.js");
  120288. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cond", function() { return _cond_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  120289. /* harmony import */ var _conforms_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./conforms.js */ "./node_modules/lodash-es/conforms.js");
  120290. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "conforms", function() { return _conforms_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  120291. /* harmony import */ var _conformsTo_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./conformsTo.js */ "./node_modules/lodash-es/conformsTo.js");
  120292. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "conformsTo", function() { return _conformsTo_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  120293. /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
  120294. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return _constant_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  120295. /* harmony import */ var _countBy_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./countBy.js */ "./node_modules/lodash-es/countBy.js");
  120296. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return _countBy_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  120297. /* harmony import */ var _create_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./create.js */ "./node_modules/lodash-es/create.js");
  120298. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "create", function() { return _create_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  120299. /* harmony import */ var _curry_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./curry.js */ "./node_modules/lodash-es/curry.js");
  120300. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curry", function() { return _curry_js__WEBPACK_IMPORTED_MODULE_33__["default"]; });
  120301. /* harmony import */ var _curryRight_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./curryRight.js */ "./node_modules/lodash-es/curryRight.js");
  120302. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curryRight", function() { return _curryRight_js__WEBPACK_IMPORTED_MODULE_34__["default"]; });
  120303. /* harmony import */ var _debounce_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./debounce.js */ "./node_modules/lodash-es/debounce.js");
  120304. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _debounce_js__WEBPACK_IMPORTED_MODULE_35__["default"]; });
  120305. /* harmony import */ var _deburr_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./deburr.js */ "./node_modules/lodash-es/deburr.js");
  120306. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "deburr", function() { return _deburr_js__WEBPACK_IMPORTED_MODULE_36__["default"]; });
  120307. /* harmony import */ var _defaultTo_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./defaultTo.js */ "./node_modules/lodash-es/defaultTo.js");
  120308. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultTo", function() { return _defaultTo_js__WEBPACK_IMPORTED_MODULE_37__["default"]; });
  120309. /* harmony import */ var _defaults_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./defaults.js */ "./node_modules/lodash-es/defaults.js");
  120310. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return _defaults_js__WEBPACK_IMPORTED_MODULE_38__["default"]; });
  120311. /* harmony import */ var _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./defaultsDeep.js */ "./node_modules/lodash-es/defaultsDeep.js");
  120312. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultsDeep", function() { return _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_39__["default"]; });
  120313. /* harmony import */ var _defer_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./defer.js */ "./node_modules/lodash-es/defer.js");
  120314. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return _defer_js__WEBPACK_IMPORTED_MODULE_40__["default"]; });
  120315. /* harmony import */ var _delay_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./delay.js */ "./node_modules/lodash-es/delay.js");
  120316. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return _delay_js__WEBPACK_IMPORTED_MODULE_41__["default"]; });
  120317. /* harmony import */ var _difference_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./difference.js */ "./node_modules/lodash-es/difference.js");
  120318. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return _difference_js__WEBPACK_IMPORTED_MODULE_42__["default"]; });
  120319. /* harmony import */ var _differenceBy_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./differenceBy.js */ "./node_modules/lodash-es/differenceBy.js");
  120320. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceBy", function() { return _differenceBy_js__WEBPACK_IMPORTED_MODULE_43__["default"]; });
  120321. /* harmony import */ var _differenceWith_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./differenceWith.js */ "./node_modules/lodash-es/differenceWith.js");
  120322. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceWith", function() { return _differenceWith_js__WEBPACK_IMPORTED_MODULE_44__["default"]; });
  120323. /* harmony import */ var _divide_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./divide.js */ "./node_modules/lodash-es/divide.js");
  120324. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "divide", function() { return _divide_js__WEBPACK_IMPORTED_MODULE_45__["default"]; });
  120325. /* harmony import */ var _drop_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./drop.js */ "./node_modules/lodash-es/drop.js");
  120326. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return _drop_js__WEBPACK_IMPORTED_MODULE_46__["default"]; });
  120327. /* harmony import */ var _dropRight_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./dropRight.js */ "./node_modules/lodash-es/dropRight.js");
  120328. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropRight", function() { return _dropRight_js__WEBPACK_IMPORTED_MODULE_47__["default"]; });
  120329. /* harmony import */ var _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./dropRightWhile.js */ "./node_modules/lodash-es/dropRightWhile.js");
  120330. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropRightWhile", function() { return _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_48__["default"]; });
  120331. /* harmony import */ var _dropWhile_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./dropWhile.js */ "./node_modules/lodash-es/dropWhile.js");
  120332. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropWhile", function() { return _dropWhile_js__WEBPACK_IMPORTED_MODULE_49__["default"]; });
  120333. /* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./each.js */ "./node_modules/lodash-es/each.js");
  120334. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "each", function() { return _each_js__WEBPACK_IMPORTED_MODULE_50__["default"]; });
  120335. /* harmony import */ var _eachRight_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./eachRight.js */ "./node_modules/lodash-es/eachRight.js");
  120336. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eachRight", function() { return _eachRight_js__WEBPACK_IMPORTED_MODULE_51__["default"]; });
  120337. /* harmony import */ var _endsWith_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./endsWith.js */ "./node_modules/lodash-es/endsWith.js");
  120338. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return _endsWith_js__WEBPACK_IMPORTED_MODULE_52__["default"]; });
  120339. /* harmony import */ var _entries_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./entries.js */ "./node_modules/lodash-es/entries.js");
  120340. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entries", function() { return _entries_js__WEBPACK_IMPORTED_MODULE_53__["default"]; });
  120341. /* harmony import */ var _entriesIn_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./entriesIn.js */ "./node_modules/lodash-es/entriesIn.js");
  120342. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entriesIn", function() { return _entriesIn_js__WEBPACK_IMPORTED_MODULE_54__["default"]; });
  120343. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  120344. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eq", function() { return _eq_js__WEBPACK_IMPORTED_MODULE_55__["default"]; });
  120345. /* harmony import */ var _escape_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./escape.js */ "./node_modules/lodash-es/escape.js");
  120346. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return _escape_js__WEBPACK_IMPORTED_MODULE_56__["default"]; });
  120347. /* harmony import */ var _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./escapeRegExp.js */ "./node_modules/lodash-es/escapeRegExp.js");
  120348. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escapeRegExp", function() { return _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_57__["default"]; });
  120349. /* harmony import */ var _every_js__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./every.js */ "./node_modules/lodash-es/every.js");
  120350. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "every", function() { return _every_js__WEBPACK_IMPORTED_MODULE_58__["default"]; });
  120351. /* harmony import */ var _extend_js__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./extend.js */ "./node_modules/lodash-es/extend.js");
  120352. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return _extend_js__WEBPACK_IMPORTED_MODULE_59__["default"]; });
  120353. /* harmony import */ var _extendWith_js__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./extendWith.js */ "./node_modules/lodash-es/extendWith.js");
  120354. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extendWith", function() { return _extendWith_js__WEBPACK_IMPORTED_MODULE_60__["default"]; });
  120355. /* harmony import */ var _fill_js__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./fill.js */ "./node_modules/lodash-es/fill.js");
  120356. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return _fill_js__WEBPACK_IMPORTED_MODULE_61__["default"]; });
  120357. /* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./filter.js */ "./node_modules/lodash-es/filter.js");
  120358. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return _filter_js__WEBPACK_IMPORTED_MODULE_62__["default"]; });
  120359. /* harmony import */ var _find_js__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./find.js */ "./node_modules/lodash-es/find.js");
  120360. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "find", function() { return _find_js__WEBPACK_IMPORTED_MODULE_63__["default"]; });
  120361. /* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/lodash-es/findIndex.js");
  120362. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _findIndex_js__WEBPACK_IMPORTED_MODULE_64__["default"]; });
  120363. /* harmony import */ var _findKey_js__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./findKey.js */ "./node_modules/lodash-es/findKey.js");
  120364. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return _findKey_js__WEBPACK_IMPORTED_MODULE_65__["default"]; });
  120365. /* harmony import */ var _findLast_js__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./findLast.js */ "./node_modules/lodash-es/findLast.js");
  120366. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLast", function() { return _findLast_js__WEBPACK_IMPORTED_MODULE_66__["default"]; });
  120367. /* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/lodash-es/findLastIndex.js");
  120368. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return _findLastIndex_js__WEBPACK_IMPORTED_MODULE_67__["default"]; });
  120369. /* harmony import */ var _findLastKey_js__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./findLastKey.js */ "./node_modules/lodash-es/findLastKey.js");
  120370. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLastKey", function() { return _findLastKey_js__WEBPACK_IMPORTED_MODULE_68__["default"]; });
  120371. /* harmony import */ var _first_js__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./first.js */ "./node_modules/lodash-es/first.js");
  120372. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _first_js__WEBPACK_IMPORTED_MODULE_69__["default"]; });
  120373. /* harmony import */ var _flatMap_js__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./flatMap.js */ "./node_modules/lodash-es/flatMap.js");
  120374. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return _flatMap_js__WEBPACK_IMPORTED_MODULE_70__["default"]; });
  120375. /* harmony import */ var _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./flatMapDeep.js */ "./node_modules/lodash-es/flatMapDeep.js");
  120376. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMapDeep", function() { return _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_71__["default"]; });
  120377. /* harmony import */ var _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./flatMapDepth.js */ "./node_modules/lodash-es/flatMapDepth.js");
  120378. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMapDepth", function() { return _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_72__["default"]; });
  120379. /* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/lodash-es/flatten.js");
  120380. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return _flatten_js__WEBPACK_IMPORTED_MODULE_73__["default"]; });
  120381. /* harmony import */ var _flattenDeep_js__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./flattenDeep.js */ "./node_modules/lodash-es/flattenDeep.js");
  120382. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDeep", function() { return _flattenDeep_js__WEBPACK_IMPORTED_MODULE_74__["default"]; });
  120383. /* harmony import */ var _flattenDepth_js__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ./flattenDepth.js */ "./node_modules/lodash-es/flattenDepth.js");
  120384. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDepth", function() { return _flattenDepth_js__WEBPACK_IMPORTED_MODULE_75__["default"]; });
  120385. /* harmony import */ var _flip_js__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ./flip.js */ "./node_modules/lodash-es/flip.js");
  120386. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flip", function() { return _flip_js__WEBPACK_IMPORTED_MODULE_76__["default"]; });
  120387. /* harmony import */ var _floor_js__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ./floor.js */ "./node_modules/lodash-es/floor.js");
  120388. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return _floor_js__WEBPACK_IMPORTED_MODULE_77__["default"]; });
  120389. /* harmony import */ var _flow_js__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ./flow.js */ "./node_modules/lodash-es/flow.js");
  120390. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flow", function() { return _flow_js__WEBPACK_IMPORTED_MODULE_78__["default"]; });
  120391. /* harmony import */ var _flowRight_js__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ./flowRight.js */ "./node_modules/lodash-es/flowRight.js");
  120392. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flowRight", function() { return _flowRight_js__WEBPACK_IMPORTED_MODULE_79__["default"]; });
  120393. /* harmony import */ var _forEach_js__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ./forEach.js */ "./node_modules/lodash-es/forEach.js");
  120394. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return _forEach_js__WEBPACK_IMPORTED_MODULE_80__["default"]; });
  120395. /* harmony import */ var _forEachRight_js__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ./forEachRight.js */ "./node_modules/lodash-es/forEachRight.js");
  120396. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEachRight", function() { return _forEachRight_js__WEBPACK_IMPORTED_MODULE_81__["default"]; });
  120397. /* harmony import */ var _forIn_js__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ./forIn.js */ "./node_modules/lodash-es/forIn.js");
  120398. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forIn", function() { return _forIn_js__WEBPACK_IMPORTED_MODULE_82__["default"]; });
  120399. /* harmony import */ var _forInRight_js__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ./forInRight.js */ "./node_modules/lodash-es/forInRight.js");
  120400. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forInRight", function() { return _forInRight_js__WEBPACK_IMPORTED_MODULE_83__["default"]; });
  120401. /* harmony import */ var _forOwn_js__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ./forOwn.js */ "./node_modules/lodash-es/forOwn.js");
  120402. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forOwn", function() { return _forOwn_js__WEBPACK_IMPORTED_MODULE_84__["default"]; });
  120403. /* harmony import */ var _forOwnRight_js__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ./forOwnRight.js */ "./node_modules/lodash-es/forOwnRight.js");
  120404. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forOwnRight", function() { return _forOwnRight_js__WEBPACK_IMPORTED_MODULE_85__["default"]; });
  120405. /* harmony import */ var _fromPairs_js__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./fromPairs.js */ "./node_modules/lodash-es/fromPairs.js");
  120406. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromPairs", function() { return _fromPairs_js__WEBPACK_IMPORTED_MODULE_86__["default"]; });
  120407. /* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./functions.js */ "./node_modules/lodash-es/functions.js");
  120408. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return _functions_js__WEBPACK_IMPORTED_MODULE_87__["default"]; });
  120409. /* harmony import */ var _functionsIn_js__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ./functionsIn.js */ "./node_modules/lodash-es/functionsIn.js");
  120410. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "functionsIn", function() { return _functionsIn_js__WEBPACK_IMPORTED_MODULE_88__["default"]; });
  120411. /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
  120412. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "get", function() { return _get_js__WEBPACK_IMPORTED_MODULE_89__["default"]; });
  120413. /* harmony import */ var _groupBy_js__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(/*! ./groupBy.js */ "./node_modules/lodash-es/groupBy.js");
  120414. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _groupBy_js__WEBPACK_IMPORTED_MODULE_90__["default"]; });
  120415. /* harmony import */ var _gt_js__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(/*! ./gt.js */ "./node_modules/lodash-es/gt.js");
  120416. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gt", function() { return _gt_js__WEBPACK_IMPORTED_MODULE_91__["default"]; });
  120417. /* harmony import */ var _gte_js__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(/*! ./gte.js */ "./node_modules/lodash-es/gte.js");
  120418. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gte", function() { return _gte_js__WEBPACK_IMPORTED_MODULE_92__["default"]; });
  120419. /* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(/*! ./has.js */ "./node_modules/lodash-es/has.js");
  120420. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "has", function() { return _has_js__WEBPACK_IMPORTED_MODULE_93__["default"]; });
  120421. /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
  120422. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hasIn", function() { return _hasIn_js__WEBPACK_IMPORTED_MODULE_94__["default"]; });
  120423. /* harmony import */ var _head_js__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(/*! ./head.js */ "./node_modules/lodash-es/head.js");
  120424. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "head", function() { return _head_js__WEBPACK_IMPORTED_MODULE_95__["default"]; });
  120425. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  120426. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return _identity_js__WEBPACK_IMPORTED_MODULE_96__["default"]; });
  120427. /* harmony import */ var _inRange_js__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(/*! ./inRange.js */ "./node_modules/lodash-es/inRange.js");
  120428. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "inRange", function() { return _inRange_js__WEBPACK_IMPORTED_MODULE_97__["default"]; });
  120429. /* harmony import */ var _includes_js__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(/*! ./includes.js */ "./node_modules/lodash-es/includes.js");
  120430. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return _includes_js__WEBPACK_IMPORTED_MODULE_98__["default"]; });
  120431. /* harmony import */ var _indexOf_js__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(/*! ./indexOf.js */ "./node_modules/lodash-es/indexOf.js");
  120432. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return _indexOf_js__WEBPACK_IMPORTED_MODULE_99__["default"]; });
  120433. /* harmony import */ var _initial_js__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(/*! ./initial.js */ "./node_modules/lodash-es/initial.js");
  120434. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return _initial_js__WEBPACK_IMPORTED_MODULE_100__["default"]; });
  120435. /* harmony import */ var _intersection_js__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(/*! ./intersection.js */ "./node_modules/lodash-es/intersection.js");
  120436. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return _intersection_js__WEBPACK_IMPORTED_MODULE_101__["default"]; });
  120437. /* harmony import */ var _intersectionBy_js__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(/*! ./intersectionBy.js */ "./node_modules/lodash-es/intersectionBy.js");
  120438. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersectionBy", function() { return _intersectionBy_js__WEBPACK_IMPORTED_MODULE_102__["default"]; });
  120439. /* harmony import */ var _intersectionWith_js__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(/*! ./intersectionWith.js */ "./node_modules/lodash-es/intersectionWith.js");
  120440. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersectionWith", function() { return _intersectionWith_js__WEBPACK_IMPORTED_MODULE_103__["default"]; });
  120441. /* harmony import */ var _invert_js__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(/*! ./invert.js */ "./node_modules/lodash-es/invert.js");
  120442. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return _invert_js__WEBPACK_IMPORTED_MODULE_104__["default"]; });
  120443. /* harmony import */ var _invertBy_js__WEBPACK_IMPORTED_MODULE_105__ = __webpack_require__(/*! ./invertBy.js */ "./node_modules/lodash-es/invertBy.js");
  120444. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invertBy", function() { return _invertBy_js__WEBPACK_IMPORTED_MODULE_105__["default"]; });
  120445. /* harmony import */ var _invoke_js__WEBPACK_IMPORTED_MODULE_106__ = __webpack_require__(/*! ./invoke.js */ "./node_modules/lodash-es/invoke.js");
  120446. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return _invoke_js__WEBPACK_IMPORTED_MODULE_106__["default"]; });
  120447. /* harmony import */ var _invokeMap_js__WEBPACK_IMPORTED_MODULE_107__ = __webpack_require__(/*! ./invokeMap.js */ "./node_modules/lodash-es/invokeMap.js");
  120448. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invokeMap", function() { return _invokeMap_js__WEBPACK_IMPORTED_MODULE_107__["default"]; });
  120449. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_108__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  120450. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return _isArguments_js__WEBPACK_IMPORTED_MODULE_108__["default"]; });
  120451. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_109__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  120452. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return _isArray_js__WEBPACK_IMPORTED_MODULE_109__["default"]; });
  120453. /* harmony import */ var _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_110__ = __webpack_require__(/*! ./isArrayBuffer.js */ "./node_modules/lodash-es/isArrayBuffer.js");
  120454. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_110__["default"]; });
  120455. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_111__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  120456. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLike", function() { return _isArrayLike_js__WEBPACK_IMPORTED_MODULE_111__["default"]; });
  120457. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_112__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  120458. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLikeObject", function() { return _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_112__["default"]; });
  120459. /* harmony import */ var _isBoolean_js__WEBPACK_IMPORTED_MODULE_113__ = __webpack_require__(/*! ./isBoolean.js */ "./node_modules/lodash-es/isBoolean.js");
  120460. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return _isBoolean_js__WEBPACK_IMPORTED_MODULE_113__["default"]; });
  120461. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_114__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  120462. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBuffer", function() { return _isBuffer_js__WEBPACK_IMPORTED_MODULE_114__["default"]; });
  120463. /* harmony import */ var _isDate_js__WEBPACK_IMPORTED_MODULE_115__ = __webpack_require__(/*! ./isDate.js */ "./node_modules/lodash-es/isDate.js");
  120464. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return _isDate_js__WEBPACK_IMPORTED_MODULE_115__["default"]; });
  120465. /* harmony import */ var _isElement_js__WEBPACK_IMPORTED_MODULE_116__ = __webpack_require__(/*! ./isElement.js */ "./node_modules/lodash-es/isElement.js");
  120466. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return _isElement_js__WEBPACK_IMPORTED_MODULE_116__["default"]; });
  120467. /* harmony import */ var _isEmpty_js__WEBPACK_IMPORTED_MODULE_117__ = __webpack_require__(/*! ./isEmpty.js */ "./node_modules/lodash-es/isEmpty.js");
  120468. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _isEmpty_js__WEBPACK_IMPORTED_MODULE_117__["default"]; });
  120469. /* harmony import */ var _isEqual_js__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(/*! ./isEqual.js */ "./node_modules/lodash-es/isEqual.js");
  120470. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return _isEqual_js__WEBPACK_IMPORTED_MODULE_118__["default"]; });
  120471. /* harmony import */ var _isEqualWith_js__WEBPACK_IMPORTED_MODULE_119__ = __webpack_require__(/*! ./isEqualWith.js */ "./node_modules/lodash-es/isEqualWith.js");
  120472. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqualWith", function() { return _isEqualWith_js__WEBPACK_IMPORTED_MODULE_119__["default"]; });
  120473. /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_120__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
  120474. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return _isError_js__WEBPACK_IMPORTED_MODULE_120__["default"]; });
  120475. /* harmony import */ var _isFinite_js__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(/*! ./isFinite.js */ "./node_modules/lodash-es/isFinite.js");
  120476. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return _isFinite_js__WEBPACK_IMPORTED_MODULE_121__["default"]; });
  120477. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  120478. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return _isFunction_js__WEBPACK_IMPORTED_MODULE_122__["default"]; });
  120479. /* harmony import */ var _isInteger_js__WEBPACK_IMPORTED_MODULE_123__ = __webpack_require__(/*! ./isInteger.js */ "./node_modules/lodash-es/isInteger.js");
  120480. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isInteger", function() { return _isInteger_js__WEBPACK_IMPORTED_MODULE_123__["default"]; });
  120481. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_124__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  120482. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return _isLength_js__WEBPACK_IMPORTED_MODULE_124__["default"]; });
  120483. /* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_125__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/lodash-es/isMap.js");
  120484. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return _isMap_js__WEBPACK_IMPORTED_MODULE_125__["default"]; });
  120485. /* harmony import */ var _isMatch_js__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(/*! ./isMatch.js */ "./node_modules/lodash-es/isMatch.js");
  120486. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return _isMatch_js__WEBPACK_IMPORTED_MODULE_126__["default"]; });
  120487. /* harmony import */ var _isMatchWith_js__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(/*! ./isMatchWith.js */ "./node_modules/lodash-es/isMatchWith.js");
  120488. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatchWith", function() { return _isMatchWith_js__WEBPACK_IMPORTED_MODULE_127__["default"]; });
  120489. /* harmony import */ var _isNaN_js__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(/*! ./isNaN.js */ "./node_modules/lodash-es/isNaN.js");
  120490. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return _isNaN_js__WEBPACK_IMPORTED_MODULE_128__["default"]; });
  120491. /* harmony import */ var _isNative_js__WEBPACK_IMPORTED_MODULE_129__ = __webpack_require__(/*! ./isNative.js */ "./node_modules/lodash-es/isNative.js");
  120492. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNative", function() { return _isNative_js__WEBPACK_IMPORTED_MODULE_129__["default"]; });
  120493. /* harmony import */ var _isNil_js__WEBPACK_IMPORTED_MODULE_130__ = __webpack_require__(/*! ./isNil.js */ "./node_modules/lodash-es/isNil.js");
  120494. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNil", function() { return _isNil_js__WEBPACK_IMPORTED_MODULE_130__["default"]; });
  120495. /* harmony import */ var _isNull_js__WEBPACK_IMPORTED_MODULE_131__ = __webpack_require__(/*! ./isNull.js */ "./node_modules/lodash-es/isNull.js");
  120496. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return _isNull_js__WEBPACK_IMPORTED_MODULE_131__["default"]; });
  120497. /* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_132__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/lodash-es/isNumber.js");
  120498. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return _isNumber_js__WEBPACK_IMPORTED_MODULE_132__["default"]; });
  120499. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_133__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  120500. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return _isObject_js__WEBPACK_IMPORTED_MODULE_133__["default"]; });
  120501. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_134__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  120502. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObjectLike", function() { return _isObjectLike_js__WEBPACK_IMPORTED_MODULE_134__["default"]; });
  120503. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_135__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  120504. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return _isPlainObject_js__WEBPACK_IMPORTED_MODULE_135__["default"]; });
  120505. /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_136__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
  120506. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return _isRegExp_js__WEBPACK_IMPORTED_MODULE_136__["default"]; });
  120507. /* harmony import */ var _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_137__ = __webpack_require__(/*! ./isSafeInteger.js */ "./node_modules/lodash-es/isSafeInteger.js");
  120508. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSafeInteger", function() { return _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_137__["default"]; });
  120509. /* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_138__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/lodash-es/isSet.js");
  120510. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return _isSet_js__WEBPACK_IMPORTED_MODULE_138__["default"]; });
  120511. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_139__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  120512. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return _isString_js__WEBPACK_IMPORTED_MODULE_139__["default"]; });
  120513. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_140__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  120514. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return _isSymbol_js__WEBPACK_IMPORTED_MODULE_140__["default"]; });
  120515. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_141__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  120516. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return _isTypedArray_js__WEBPACK_IMPORTED_MODULE_141__["default"]; });
  120517. /* harmony import */ var _isUndefined_js__WEBPACK_IMPORTED_MODULE_142__ = __webpack_require__(/*! ./isUndefined.js */ "./node_modules/lodash-es/isUndefined.js");
  120518. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return _isUndefined_js__WEBPACK_IMPORTED_MODULE_142__["default"]; });
  120519. /* harmony import */ var _isWeakMap_js__WEBPACK_IMPORTED_MODULE_143__ = __webpack_require__(/*! ./isWeakMap.js */ "./node_modules/lodash-es/isWeakMap.js");
  120520. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return _isWeakMap_js__WEBPACK_IMPORTED_MODULE_143__["default"]; });
  120521. /* harmony import */ var _isWeakSet_js__WEBPACK_IMPORTED_MODULE_144__ = __webpack_require__(/*! ./isWeakSet.js */ "./node_modules/lodash-es/isWeakSet.js");
  120522. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return _isWeakSet_js__WEBPACK_IMPORTED_MODULE_144__["default"]; });
  120523. /* harmony import */ var _iteratee_js__WEBPACK_IMPORTED_MODULE_145__ = __webpack_require__(/*! ./iteratee.js */ "./node_modules/lodash-es/iteratee.js");
  120524. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return _iteratee_js__WEBPACK_IMPORTED_MODULE_145__["default"]; });
  120525. /* harmony import */ var _join_js__WEBPACK_IMPORTED_MODULE_146__ = __webpack_require__(/*! ./join.js */ "./node_modules/lodash-es/join.js");
  120526. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "join", function() { return _join_js__WEBPACK_IMPORTED_MODULE_146__["default"]; });
  120527. /* harmony import */ var _kebabCase_js__WEBPACK_IMPORTED_MODULE_147__ = __webpack_require__(/*! ./kebabCase.js */ "./node_modules/lodash-es/kebabCase.js");
  120528. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "kebabCase", function() { return _kebabCase_js__WEBPACK_IMPORTED_MODULE_147__["default"]; });
  120529. /* harmony import */ var _keyBy_js__WEBPACK_IMPORTED_MODULE_148__ = __webpack_require__(/*! ./keyBy.js */ "./node_modules/lodash-es/keyBy.js");
  120530. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keyBy", function() { return _keyBy_js__WEBPACK_IMPORTED_MODULE_148__["default"]; });
  120531. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_149__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  120532. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return _keys_js__WEBPACK_IMPORTED_MODULE_149__["default"]; });
  120533. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_150__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  120534. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keysIn", function() { return _keysIn_js__WEBPACK_IMPORTED_MODULE_150__["default"]; });
  120535. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_151__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  120536. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "last", function() { return _last_js__WEBPACK_IMPORTED_MODULE_151__["default"]; });
  120537. /* harmony import */ var _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_152__ = __webpack_require__(/*! ./lastIndexOf.js */ "./node_modules/lodash-es/lastIndexOf.js");
  120538. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_152__["default"]; });
  120539. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_153__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  120540. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lodash", function() { return _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_153__["default"]; });
  120541. /* harmony import */ var _lowerCase_js__WEBPACK_IMPORTED_MODULE_154__ = __webpack_require__(/*! ./lowerCase.js */ "./node_modules/lodash-es/lowerCase.js");
  120542. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerCase", function() { return _lowerCase_js__WEBPACK_IMPORTED_MODULE_154__["default"]; });
  120543. /* harmony import */ var _lowerFirst_js__WEBPACK_IMPORTED_MODULE_155__ = __webpack_require__(/*! ./lowerFirst.js */ "./node_modules/lodash-es/lowerFirst.js");
  120544. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerFirst", function() { return _lowerFirst_js__WEBPACK_IMPORTED_MODULE_155__["default"]; });
  120545. /* harmony import */ var _lt_js__WEBPACK_IMPORTED_MODULE_156__ = __webpack_require__(/*! ./lt.js */ "./node_modules/lodash-es/lt.js");
  120546. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lt", function() { return _lt_js__WEBPACK_IMPORTED_MODULE_156__["default"]; });
  120547. /* harmony import */ var _lte_js__WEBPACK_IMPORTED_MODULE_157__ = __webpack_require__(/*! ./lte.js */ "./node_modules/lodash-es/lte.js");
  120548. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lte", function() { return _lte_js__WEBPACK_IMPORTED_MODULE_157__["default"]; });
  120549. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_158__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  120550. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _map_js__WEBPACK_IMPORTED_MODULE_158__["default"]; });
  120551. /* harmony import */ var _mapKeys_js__WEBPACK_IMPORTED_MODULE_159__ = __webpack_require__(/*! ./mapKeys.js */ "./node_modules/lodash-es/mapKeys.js");
  120552. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapKeys", function() { return _mapKeys_js__WEBPACK_IMPORTED_MODULE_159__["default"]; });
  120553. /* harmony import */ var _mapValues_js__WEBPACK_IMPORTED_MODULE_160__ = __webpack_require__(/*! ./mapValues.js */ "./node_modules/lodash-es/mapValues.js");
  120554. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapValues", function() { return _mapValues_js__WEBPACK_IMPORTED_MODULE_160__["default"]; });
  120555. /* harmony import */ var _matches_js__WEBPACK_IMPORTED_MODULE_161__ = __webpack_require__(/*! ./matches.js */ "./node_modules/lodash-es/matches.js");
  120556. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return _matches_js__WEBPACK_IMPORTED_MODULE_161__["default"]; });
  120557. /* harmony import */ var _matchesProperty_js__WEBPACK_IMPORTED_MODULE_162__ = __webpack_require__(/*! ./matchesProperty.js */ "./node_modules/lodash-es/matchesProperty.js");
  120558. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matchesProperty", function() { return _matchesProperty_js__WEBPACK_IMPORTED_MODULE_162__["default"]; });
  120559. /* harmony import */ var _max_js__WEBPACK_IMPORTED_MODULE_163__ = __webpack_require__(/*! ./max.js */ "./node_modules/lodash-es/max.js");
  120560. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _max_js__WEBPACK_IMPORTED_MODULE_163__["default"]; });
  120561. /* harmony import */ var _maxBy_js__WEBPACK_IMPORTED_MODULE_164__ = __webpack_require__(/*! ./maxBy.js */ "./node_modules/lodash-es/maxBy.js");
  120562. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maxBy", function() { return _maxBy_js__WEBPACK_IMPORTED_MODULE_164__["default"]; });
  120563. /* harmony import */ var _mean_js__WEBPACK_IMPORTED_MODULE_165__ = __webpack_require__(/*! ./mean.js */ "./node_modules/lodash-es/mean.js");
  120564. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mean", function() { return _mean_js__WEBPACK_IMPORTED_MODULE_165__["default"]; });
  120565. /* harmony import */ var _meanBy_js__WEBPACK_IMPORTED_MODULE_166__ = __webpack_require__(/*! ./meanBy.js */ "./node_modules/lodash-es/meanBy.js");
  120566. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "meanBy", function() { return _meanBy_js__WEBPACK_IMPORTED_MODULE_166__["default"]; });
  120567. /* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_167__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/lodash-es/memoize.js");
  120568. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return _memoize_js__WEBPACK_IMPORTED_MODULE_167__["default"]; });
  120569. /* harmony import */ var _merge_js__WEBPACK_IMPORTED_MODULE_168__ = __webpack_require__(/*! ./merge.js */ "./node_modules/lodash-es/merge.js");
  120570. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _merge_js__WEBPACK_IMPORTED_MODULE_168__["default"]; });
  120571. /* harmony import */ var _mergeWith_js__WEBPACK_IMPORTED_MODULE_169__ = __webpack_require__(/*! ./mergeWith.js */ "./node_modules/lodash-es/mergeWith.js");
  120572. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeWith", function() { return _mergeWith_js__WEBPACK_IMPORTED_MODULE_169__["default"]; });
  120573. /* harmony import */ var _method_js__WEBPACK_IMPORTED_MODULE_170__ = __webpack_require__(/*! ./method.js */ "./node_modules/lodash-es/method.js");
  120574. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "method", function() { return _method_js__WEBPACK_IMPORTED_MODULE_170__["default"]; });
  120575. /* harmony import */ var _methodOf_js__WEBPACK_IMPORTED_MODULE_171__ = __webpack_require__(/*! ./methodOf.js */ "./node_modules/lodash-es/methodOf.js");
  120576. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "methodOf", function() { return _methodOf_js__WEBPACK_IMPORTED_MODULE_171__["default"]; });
  120577. /* harmony import */ var _min_js__WEBPACK_IMPORTED_MODULE_172__ = __webpack_require__(/*! ./min.js */ "./node_modules/lodash-es/min.js");
  120578. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return _min_js__WEBPACK_IMPORTED_MODULE_172__["default"]; });
  120579. /* harmony import */ var _minBy_js__WEBPACK_IMPORTED_MODULE_173__ = __webpack_require__(/*! ./minBy.js */ "./node_modules/lodash-es/minBy.js");
  120580. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "minBy", function() { return _minBy_js__WEBPACK_IMPORTED_MODULE_173__["default"]; });
  120581. /* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_174__ = __webpack_require__(/*! ./mixin.js */ "./node_modules/lodash-es/mixin.js");
  120582. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return _mixin_js__WEBPACK_IMPORTED_MODULE_174__["default"]; });
  120583. /* harmony import */ var _multiply_js__WEBPACK_IMPORTED_MODULE_175__ = __webpack_require__(/*! ./multiply.js */ "./node_modules/lodash-es/multiply.js");
  120584. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return _multiply_js__WEBPACK_IMPORTED_MODULE_175__["default"]; });
  120585. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_176__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  120586. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return _negate_js__WEBPACK_IMPORTED_MODULE_176__["default"]; });
  120587. /* harmony import */ var _next_js__WEBPACK_IMPORTED_MODULE_177__ = __webpack_require__(/*! ./next.js */ "./node_modules/lodash-es/next.js");
  120588. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "next", function() { return _next_js__WEBPACK_IMPORTED_MODULE_177__["default"]; });
  120589. /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_178__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
  120590. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return _noop_js__WEBPACK_IMPORTED_MODULE_178__["default"]; });
  120591. /* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_179__ = __webpack_require__(/*! ./now.js */ "./node_modules/lodash-es/now.js");
  120592. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "now", function() { return _now_js__WEBPACK_IMPORTED_MODULE_179__["default"]; });
  120593. /* harmony import */ var _nth_js__WEBPACK_IMPORTED_MODULE_180__ = __webpack_require__(/*! ./nth.js */ "./node_modules/lodash-es/nth.js");
  120594. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nth", function() { return _nth_js__WEBPACK_IMPORTED_MODULE_180__["default"]; });
  120595. /* harmony import */ var _nthArg_js__WEBPACK_IMPORTED_MODULE_181__ = __webpack_require__(/*! ./nthArg.js */ "./node_modules/lodash-es/nthArg.js");
  120596. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nthArg", function() { return _nthArg_js__WEBPACK_IMPORTED_MODULE_181__["default"]; });
  120597. /* harmony import */ var _omit_js__WEBPACK_IMPORTED_MODULE_182__ = __webpack_require__(/*! ./omit.js */ "./node_modules/lodash-es/omit.js");
  120598. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return _omit_js__WEBPACK_IMPORTED_MODULE_182__["default"]; });
  120599. /* harmony import */ var _omitBy_js__WEBPACK_IMPORTED_MODULE_183__ = __webpack_require__(/*! ./omitBy.js */ "./node_modules/lodash-es/omitBy.js");
  120600. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "omitBy", function() { return _omitBy_js__WEBPACK_IMPORTED_MODULE_183__["default"]; });
  120601. /* harmony import */ var _once_js__WEBPACK_IMPORTED_MODULE_184__ = __webpack_require__(/*! ./once.js */ "./node_modules/lodash-es/once.js");
  120602. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "once", function() { return _once_js__WEBPACK_IMPORTED_MODULE_184__["default"]; });
  120603. /* harmony import */ var _orderBy_js__WEBPACK_IMPORTED_MODULE_185__ = __webpack_require__(/*! ./orderBy.js */ "./node_modules/lodash-es/orderBy.js");
  120604. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "orderBy", function() { return _orderBy_js__WEBPACK_IMPORTED_MODULE_185__["default"]; });
  120605. /* harmony import */ var _over_js__WEBPACK_IMPORTED_MODULE_186__ = __webpack_require__(/*! ./over.js */ "./node_modules/lodash-es/over.js");
  120606. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "over", function() { return _over_js__WEBPACK_IMPORTED_MODULE_186__["default"]; });
  120607. /* harmony import */ var _overArgs_js__WEBPACK_IMPORTED_MODULE_187__ = __webpack_require__(/*! ./overArgs.js */ "./node_modules/lodash-es/overArgs.js");
  120608. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overArgs", function() { return _overArgs_js__WEBPACK_IMPORTED_MODULE_187__["default"]; });
  120609. /* harmony import */ var _overEvery_js__WEBPACK_IMPORTED_MODULE_188__ = __webpack_require__(/*! ./overEvery.js */ "./node_modules/lodash-es/overEvery.js");
  120610. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overEvery", function() { return _overEvery_js__WEBPACK_IMPORTED_MODULE_188__["default"]; });
  120611. /* harmony import */ var _overSome_js__WEBPACK_IMPORTED_MODULE_189__ = __webpack_require__(/*! ./overSome.js */ "./node_modules/lodash-es/overSome.js");
  120612. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overSome", function() { return _overSome_js__WEBPACK_IMPORTED_MODULE_189__["default"]; });
  120613. /* harmony import */ var _pad_js__WEBPACK_IMPORTED_MODULE_190__ = __webpack_require__(/*! ./pad.js */ "./node_modules/lodash-es/pad.js");
  120614. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return _pad_js__WEBPACK_IMPORTED_MODULE_190__["default"]; });
  120615. /* harmony import */ var _padEnd_js__WEBPACK_IMPORTED_MODULE_191__ = __webpack_require__(/*! ./padEnd.js */ "./node_modules/lodash-es/padEnd.js");
  120616. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padEnd", function() { return _padEnd_js__WEBPACK_IMPORTED_MODULE_191__["default"]; });
  120617. /* harmony import */ var _padStart_js__WEBPACK_IMPORTED_MODULE_192__ = __webpack_require__(/*! ./padStart.js */ "./node_modules/lodash-es/padStart.js");
  120618. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padStart", function() { return _padStart_js__WEBPACK_IMPORTED_MODULE_192__["default"]; });
  120619. /* harmony import */ var _parseInt_js__WEBPACK_IMPORTED_MODULE_193__ = __webpack_require__(/*! ./parseInt.js */ "./node_modules/lodash-es/parseInt.js");
  120620. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseInt", function() { return _parseInt_js__WEBPACK_IMPORTED_MODULE_193__["default"]; });
  120621. /* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_194__ = __webpack_require__(/*! ./partial.js */ "./node_modules/lodash-es/partial.js");
  120622. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return _partial_js__WEBPACK_IMPORTED_MODULE_194__["default"]; });
  120623. /* harmony import */ var _partialRight_js__WEBPACK_IMPORTED_MODULE_195__ = __webpack_require__(/*! ./partialRight.js */ "./node_modules/lodash-es/partialRight.js");
  120624. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partialRight", function() { return _partialRight_js__WEBPACK_IMPORTED_MODULE_195__["default"]; });
  120625. /* harmony import */ var _partition_js__WEBPACK_IMPORTED_MODULE_196__ = __webpack_require__(/*! ./partition.js */ "./node_modules/lodash-es/partition.js");
  120626. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _partition_js__WEBPACK_IMPORTED_MODULE_196__["default"]; });
  120627. /* harmony import */ var _pick_js__WEBPACK_IMPORTED_MODULE_197__ = __webpack_require__(/*! ./pick.js */ "./node_modules/lodash-es/pick.js");
  120628. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return _pick_js__WEBPACK_IMPORTED_MODULE_197__["default"]; });
  120629. /* harmony import */ var _pickBy_js__WEBPACK_IMPORTED_MODULE_198__ = __webpack_require__(/*! ./pickBy.js */ "./node_modules/lodash-es/pickBy.js");
  120630. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pickBy", function() { return _pickBy_js__WEBPACK_IMPORTED_MODULE_198__["default"]; });
  120631. /* harmony import */ var _plant_js__WEBPACK_IMPORTED_MODULE_199__ = __webpack_require__(/*! ./plant.js */ "./node_modules/lodash-es/plant.js");
  120632. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "plant", function() { return _plant_js__WEBPACK_IMPORTED_MODULE_199__["default"]; });
  120633. /* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_200__ = __webpack_require__(/*! ./property.js */ "./node_modules/lodash-es/property.js");
  120634. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "property", function() { return _property_js__WEBPACK_IMPORTED_MODULE_200__["default"]; });
  120635. /* harmony import */ var _propertyOf_js__WEBPACK_IMPORTED_MODULE_201__ = __webpack_require__(/*! ./propertyOf.js */ "./node_modules/lodash-es/propertyOf.js");
  120636. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return _propertyOf_js__WEBPACK_IMPORTED_MODULE_201__["default"]; });
  120637. /* harmony import */ var _pull_js__WEBPACK_IMPORTED_MODULE_202__ = __webpack_require__(/*! ./pull.js */ "./node_modules/lodash-es/pull.js");
  120638. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pull", function() { return _pull_js__WEBPACK_IMPORTED_MODULE_202__["default"]; });
  120639. /* harmony import */ var _pullAll_js__WEBPACK_IMPORTED_MODULE_203__ = __webpack_require__(/*! ./pullAll.js */ "./node_modules/lodash-es/pullAll.js");
  120640. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAll", function() { return _pullAll_js__WEBPACK_IMPORTED_MODULE_203__["default"]; });
  120641. /* harmony import */ var _pullAllBy_js__WEBPACK_IMPORTED_MODULE_204__ = __webpack_require__(/*! ./pullAllBy.js */ "./node_modules/lodash-es/pullAllBy.js");
  120642. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAllBy", function() { return _pullAllBy_js__WEBPACK_IMPORTED_MODULE_204__["default"]; });
  120643. /* harmony import */ var _pullAllWith_js__WEBPACK_IMPORTED_MODULE_205__ = __webpack_require__(/*! ./pullAllWith.js */ "./node_modules/lodash-es/pullAllWith.js");
  120644. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAllWith", function() { return _pullAllWith_js__WEBPACK_IMPORTED_MODULE_205__["default"]; });
  120645. /* harmony import */ var _pullAt_js__WEBPACK_IMPORTED_MODULE_206__ = __webpack_require__(/*! ./pullAt.js */ "./node_modules/lodash-es/pullAt.js");
  120646. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAt", function() { return _pullAt_js__WEBPACK_IMPORTED_MODULE_206__["default"]; });
  120647. /* harmony import */ var _random_js__WEBPACK_IMPORTED_MODULE_207__ = __webpack_require__(/*! ./random.js */ "./node_modules/lodash-es/random.js");
  120648. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "random", function() { return _random_js__WEBPACK_IMPORTED_MODULE_207__["default"]; });
  120649. /* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_208__ = __webpack_require__(/*! ./range.js */ "./node_modules/lodash-es/range.js");
  120650. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "range", function() { return _range_js__WEBPACK_IMPORTED_MODULE_208__["default"]; });
  120651. /* harmony import */ var _rangeRight_js__WEBPACK_IMPORTED_MODULE_209__ = __webpack_require__(/*! ./rangeRight.js */ "./node_modules/lodash-es/rangeRight.js");
  120652. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rangeRight", function() { return _rangeRight_js__WEBPACK_IMPORTED_MODULE_209__["default"]; });
  120653. /* harmony import */ var _rearg_js__WEBPACK_IMPORTED_MODULE_210__ = __webpack_require__(/*! ./rearg.js */ "./node_modules/lodash-es/rearg.js");
  120654. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rearg", function() { return _rearg_js__WEBPACK_IMPORTED_MODULE_210__["default"]; });
  120655. /* harmony import */ var _reduce_js__WEBPACK_IMPORTED_MODULE_211__ = __webpack_require__(/*! ./reduce.js */ "./node_modules/lodash-es/reduce.js");
  120656. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return _reduce_js__WEBPACK_IMPORTED_MODULE_211__["default"]; });
  120657. /* harmony import */ var _reduceRight_js__WEBPACK_IMPORTED_MODULE_212__ = __webpack_require__(/*! ./reduceRight.js */ "./node_modules/lodash-es/reduceRight.js");
  120658. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return _reduceRight_js__WEBPACK_IMPORTED_MODULE_212__["default"]; });
  120659. /* harmony import */ var _reject_js__WEBPACK_IMPORTED_MODULE_213__ = __webpack_require__(/*! ./reject.js */ "./node_modules/lodash-es/reject.js");
  120660. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return _reject_js__WEBPACK_IMPORTED_MODULE_213__["default"]; });
  120661. /* harmony import */ var _remove_js__WEBPACK_IMPORTED_MODULE_214__ = __webpack_require__(/*! ./remove.js */ "./node_modules/lodash-es/remove.js");
  120662. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return _remove_js__WEBPACK_IMPORTED_MODULE_214__["default"]; });
  120663. /* harmony import */ var _repeat_js__WEBPACK_IMPORTED_MODULE_215__ = __webpack_require__(/*! ./repeat.js */ "./node_modules/lodash-es/repeat.js");
  120664. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return _repeat_js__WEBPACK_IMPORTED_MODULE_215__["default"]; });
  120665. /* harmony import */ var _replace_js__WEBPACK_IMPORTED_MODULE_216__ = __webpack_require__(/*! ./replace.js */ "./node_modules/lodash-es/replace.js");
  120666. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "replace", function() { return _replace_js__WEBPACK_IMPORTED_MODULE_216__["default"]; });
  120667. /* harmony import */ var _rest_js__WEBPACK_IMPORTED_MODULE_217__ = __webpack_require__(/*! ./rest.js */ "./node_modules/lodash-es/rest.js");
  120668. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return _rest_js__WEBPACK_IMPORTED_MODULE_217__["default"]; });
  120669. /* harmony import */ var _result_js__WEBPACK_IMPORTED_MODULE_218__ = __webpack_require__(/*! ./result.js */ "./node_modules/lodash-es/result.js");
  120670. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "result", function() { return _result_js__WEBPACK_IMPORTED_MODULE_218__["default"]; });
  120671. /* harmony import */ var _reverse_js__WEBPACK_IMPORTED_MODULE_219__ = __webpack_require__(/*! ./reverse.js */ "./node_modules/lodash-es/reverse.js");
  120672. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reverse", function() { return _reverse_js__WEBPACK_IMPORTED_MODULE_219__["default"]; });
  120673. /* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_220__ = __webpack_require__(/*! ./round.js */ "./node_modules/lodash-es/round.js");
  120674. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "round", function() { return _round_js__WEBPACK_IMPORTED_MODULE_220__["default"]; });
  120675. /* harmony import */ var _sample_js__WEBPACK_IMPORTED_MODULE_221__ = __webpack_require__(/*! ./sample.js */ "./node_modules/lodash-es/sample.js");
  120676. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return _sample_js__WEBPACK_IMPORTED_MODULE_221__["default"]; });
  120677. /* harmony import */ var _sampleSize_js__WEBPACK_IMPORTED_MODULE_222__ = __webpack_require__(/*! ./sampleSize.js */ "./node_modules/lodash-es/sampleSize.js");
  120678. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sampleSize", function() { return _sampleSize_js__WEBPACK_IMPORTED_MODULE_222__["default"]; });
  120679. /* harmony import */ var _set_js__WEBPACK_IMPORTED_MODULE_223__ = __webpack_require__(/*! ./set.js */ "./node_modules/lodash-es/set.js");
  120680. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "set", function() { return _set_js__WEBPACK_IMPORTED_MODULE_223__["default"]; });
  120681. /* harmony import */ var _setWith_js__WEBPACK_IMPORTED_MODULE_224__ = __webpack_require__(/*! ./setWith.js */ "./node_modules/lodash-es/setWith.js");
  120682. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setWith", function() { return _setWith_js__WEBPACK_IMPORTED_MODULE_224__["default"]; });
  120683. /* harmony import */ var _shuffle_js__WEBPACK_IMPORTED_MODULE_225__ = __webpack_require__(/*! ./shuffle.js */ "./node_modules/lodash-es/shuffle.js");
  120684. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return _shuffle_js__WEBPACK_IMPORTED_MODULE_225__["default"]; });
  120685. /* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_226__ = __webpack_require__(/*! ./size.js */ "./node_modules/lodash-es/size.js");
  120686. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "size", function() { return _size_js__WEBPACK_IMPORTED_MODULE_226__["default"]; });
  120687. /* harmony import */ var _slice_js__WEBPACK_IMPORTED_MODULE_227__ = __webpack_require__(/*! ./slice.js */ "./node_modules/lodash-es/slice.js");
  120688. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return _slice_js__WEBPACK_IMPORTED_MODULE_227__["default"]; });
  120689. /* harmony import */ var _snakeCase_js__WEBPACK_IMPORTED_MODULE_228__ = __webpack_require__(/*! ./snakeCase.js */ "./node_modules/lodash-es/snakeCase.js");
  120690. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "snakeCase", function() { return _snakeCase_js__WEBPACK_IMPORTED_MODULE_228__["default"]; });
  120691. /* harmony import */ var _some_js__WEBPACK_IMPORTED_MODULE_229__ = __webpack_require__(/*! ./some.js */ "./node_modules/lodash-es/some.js");
  120692. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "some", function() { return _some_js__WEBPACK_IMPORTED_MODULE_229__["default"]; });
  120693. /* harmony import */ var _sortBy_js__WEBPACK_IMPORTED_MODULE_230__ = __webpack_require__(/*! ./sortBy.js */ "./node_modules/lodash-es/sortBy.js");
  120694. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return _sortBy_js__WEBPACK_IMPORTED_MODULE_230__["default"]; });
  120695. /* harmony import */ var _sortedIndex_js__WEBPACK_IMPORTED_MODULE_231__ = __webpack_require__(/*! ./sortedIndex.js */ "./node_modules/lodash-es/sortedIndex.js");
  120696. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return _sortedIndex_js__WEBPACK_IMPORTED_MODULE_231__["default"]; });
  120697. /* harmony import */ var _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_232__ = __webpack_require__(/*! ./sortedIndexBy.js */ "./node_modules/lodash-es/sortedIndexBy.js");
  120698. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndexBy", function() { return _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_232__["default"]; });
  120699. /* harmony import */ var _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_233__ = __webpack_require__(/*! ./sortedIndexOf.js */ "./node_modules/lodash-es/sortedIndexOf.js");
  120700. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndexOf", function() { return _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_233__["default"]; });
  120701. /* harmony import */ var _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_234__ = __webpack_require__(/*! ./sortedLastIndex.js */ "./node_modules/lodash-es/sortedLastIndex.js");
  120702. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndex", function() { return _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_234__["default"]; });
  120703. /* harmony import */ var _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_235__ = __webpack_require__(/*! ./sortedLastIndexBy.js */ "./node_modules/lodash-es/sortedLastIndexBy.js");
  120704. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndexBy", function() { return _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_235__["default"]; });
  120705. /* harmony import */ var _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_236__ = __webpack_require__(/*! ./sortedLastIndexOf.js */ "./node_modules/lodash-es/sortedLastIndexOf.js");
  120706. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndexOf", function() { return _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_236__["default"]; });
  120707. /* harmony import */ var _sortedUniq_js__WEBPACK_IMPORTED_MODULE_237__ = __webpack_require__(/*! ./sortedUniq.js */ "./node_modules/lodash-es/sortedUniq.js");
  120708. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedUniq", function() { return _sortedUniq_js__WEBPACK_IMPORTED_MODULE_237__["default"]; });
  120709. /* harmony import */ var _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_238__ = __webpack_require__(/*! ./sortedUniqBy.js */ "./node_modules/lodash-es/sortedUniqBy.js");
  120710. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedUniqBy", function() { return _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_238__["default"]; });
  120711. /* harmony import */ var _split_js__WEBPACK_IMPORTED_MODULE_239__ = __webpack_require__(/*! ./split.js */ "./node_modules/lodash-es/split.js");
  120712. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "split", function() { return _split_js__WEBPACK_IMPORTED_MODULE_239__["default"]; });
  120713. /* harmony import */ var _spread_js__WEBPACK_IMPORTED_MODULE_240__ = __webpack_require__(/*! ./spread.js */ "./node_modules/lodash-es/spread.js");
  120714. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "spread", function() { return _spread_js__WEBPACK_IMPORTED_MODULE_240__["default"]; });
  120715. /* harmony import */ var _startCase_js__WEBPACK_IMPORTED_MODULE_241__ = __webpack_require__(/*! ./startCase.js */ "./node_modules/lodash-es/startCase.js");
  120716. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startCase", function() { return _startCase_js__WEBPACK_IMPORTED_MODULE_241__["default"]; });
  120717. /* harmony import */ var _startsWith_js__WEBPACK_IMPORTED_MODULE_242__ = __webpack_require__(/*! ./startsWith.js */ "./node_modules/lodash-es/startsWith.js");
  120718. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return _startsWith_js__WEBPACK_IMPORTED_MODULE_242__["default"]; });
  120719. /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_243__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
  120720. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubArray", function() { return _stubArray_js__WEBPACK_IMPORTED_MODULE_243__["default"]; });
  120721. /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_244__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
  120722. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubFalse", function() { return _stubFalse_js__WEBPACK_IMPORTED_MODULE_244__["default"]; });
  120723. /* harmony import */ var _stubObject_js__WEBPACK_IMPORTED_MODULE_245__ = __webpack_require__(/*! ./stubObject.js */ "./node_modules/lodash-es/stubObject.js");
  120724. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubObject", function() { return _stubObject_js__WEBPACK_IMPORTED_MODULE_245__["default"]; });
  120725. /* harmony import */ var _stubString_js__WEBPACK_IMPORTED_MODULE_246__ = __webpack_require__(/*! ./stubString.js */ "./node_modules/lodash-es/stubString.js");
  120726. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubString", function() { return _stubString_js__WEBPACK_IMPORTED_MODULE_246__["default"]; });
  120727. /* harmony import */ var _stubTrue_js__WEBPACK_IMPORTED_MODULE_247__ = __webpack_require__(/*! ./stubTrue.js */ "./node_modules/lodash-es/stubTrue.js");
  120728. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubTrue", function() { return _stubTrue_js__WEBPACK_IMPORTED_MODULE_247__["default"]; });
  120729. /* harmony import */ var _subtract_js__WEBPACK_IMPORTED_MODULE_248__ = __webpack_require__(/*! ./subtract.js */ "./node_modules/lodash-es/subtract.js");
  120730. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return _subtract_js__WEBPACK_IMPORTED_MODULE_248__["default"]; });
  120731. /* harmony import */ var _sum_js__WEBPACK_IMPORTED_MODULE_249__ = __webpack_require__(/*! ./sum.js */ "./node_modules/lodash-es/sum.js");
  120732. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sum", function() { return _sum_js__WEBPACK_IMPORTED_MODULE_249__["default"]; });
  120733. /* harmony import */ var _sumBy_js__WEBPACK_IMPORTED_MODULE_250__ = __webpack_require__(/*! ./sumBy.js */ "./node_modules/lodash-es/sumBy.js");
  120734. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sumBy", function() { return _sumBy_js__WEBPACK_IMPORTED_MODULE_250__["default"]; });
  120735. /* harmony import */ var _tail_js__WEBPACK_IMPORTED_MODULE_251__ = __webpack_require__(/*! ./tail.js */ "./node_modules/lodash-es/tail.js");
  120736. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return _tail_js__WEBPACK_IMPORTED_MODULE_251__["default"]; });
  120737. /* harmony import */ var _take_js__WEBPACK_IMPORTED_MODULE_252__ = __webpack_require__(/*! ./take.js */ "./node_modules/lodash-es/take.js");
  120738. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "take", function() { return _take_js__WEBPACK_IMPORTED_MODULE_252__["default"]; });
  120739. /* harmony import */ var _takeRight_js__WEBPACK_IMPORTED_MODULE_253__ = __webpack_require__(/*! ./takeRight.js */ "./node_modules/lodash-es/takeRight.js");
  120740. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeRight", function() { return _takeRight_js__WEBPACK_IMPORTED_MODULE_253__["default"]; });
  120741. /* harmony import */ var _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_254__ = __webpack_require__(/*! ./takeRightWhile.js */ "./node_modules/lodash-es/takeRightWhile.js");
  120742. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeRightWhile", function() { return _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_254__["default"]; });
  120743. /* harmony import */ var _takeWhile_js__WEBPACK_IMPORTED_MODULE_255__ = __webpack_require__(/*! ./takeWhile.js */ "./node_modules/lodash-es/takeWhile.js");
  120744. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return _takeWhile_js__WEBPACK_IMPORTED_MODULE_255__["default"]; });
  120745. /* harmony import */ var _tap_js__WEBPACK_IMPORTED_MODULE_256__ = __webpack_require__(/*! ./tap.js */ "./node_modules/lodash-es/tap.js");
  120746. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return _tap_js__WEBPACK_IMPORTED_MODULE_256__["default"]; });
  120747. /* harmony import */ var _template_js__WEBPACK_IMPORTED_MODULE_257__ = __webpack_require__(/*! ./template.js */ "./node_modules/lodash-es/template.js");
  120748. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "template", function() { return _template_js__WEBPACK_IMPORTED_MODULE_257__["default"]; });
  120749. /* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_258__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/lodash-es/templateSettings.js");
  120750. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return _templateSettings_js__WEBPACK_IMPORTED_MODULE_258__["default"]; });
  120751. /* harmony import */ var _throttle_js__WEBPACK_IMPORTED_MODULE_259__ = __webpack_require__(/*! ./throttle.js */ "./node_modules/lodash-es/throttle.js");
  120752. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return _throttle_js__WEBPACK_IMPORTED_MODULE_259__["default"]; });
  120753. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_260__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  120754. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "thru", function() { return _thru_js__WEBPACK_IMPORTED_MODULE_260__["default"]; });
  120755. /* harmony import */ var _times_js__WEBPACK_IMPORTED_MODULE_261__ = __webpack_require__(/*! ./times.js */ "./node_modules/lodash-es/times.js");
  120756. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "times", function() { return _times_js__WEBPACK_IMPORTED_MODULE_261__["default"]; });
  120757. /* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_262__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/lodash-es/toArray.js");
  120758. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _toArray_js__WEBPACK_IMPORTED_MODULE_262__["default"]; });
  120759. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_263__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  120760. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toFinite", function() { return _toFinite_js__WEBPACK_IMPORTED_MODULE_263__["default"]; });
  120761. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_264__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  120762. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toInteger", function() { return _toInteger_js__WEBPACK_IMPORTED_MODULE_264__["default"]; });
  120763. /* harmony import */ var _toIterator_js__WEBPACK_IMPORTED_MODULE_265__ = __webpack_require__(/*! ./toIterator.js */ "./node_modules/lodash-es/toIterator.js");
  120764. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toIterator", function() { return _toIterator_js__WEBPACK_IMPORTED_MODULE_265__["default"]; });
  120765. /* harmony import */ var _toJSON_js__WEBPACK_IMPORTED_MODULE_266__ = __webpack_require__(/*! ./toJSON.js */ "./node_modules/lodash-es/toJSON.js");
  120766. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toJSON", function() { return _toJSON_js__WEBPACK_IMPORTED_MODULE_266__["default"]; });
  120767. /* harmony import */ var _toLength_js__WEBPACK_IMPORTED_MODULE_267__ = __webpack_require__(/*! ./toLength.js */ "./node_modules/lodash-es/toLength.js");
  120768. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toLength", function() { return _toLength_js__WEBPACK_IMPORTED_MODULE_267__["default"]; });
  120769. /* harmony import */ var _toLower_js__WEBPACK_IMPORTED_MODULE_268__ = __webpack_require__(/*! ./toLower.js */ "./node_modules/lodash-es/toLower.js");
  120770. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toLower", function() { return _toLower_js__WEBPACK_IMPORTED_MODULE_268__["default"]; });
  120771. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_269__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  120772. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toNumber", function() { return _toNumber_js__WEBPACK_IMPORTED_MODULE_269__["default"]; });
  120773. /* harmony import */ var _toPairs_js__WEBPACK_IMPORTED_MODULE_270__ = __webpack_require__(/*! ./toPairs.js */ "./node_modules/lodash-es/toPairs.js");
  120774. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPairs", function() { return _toPairs_js__WEBPACK_IMPORTED_MODULE_270__["default"]; });
  120775. /* harmony import */ var _toPairsIn_js__WEBPACK_IMPORTED_MODULE_271__ = __webpack_require__(/*! ./toPairsIn.js */ "./node_modules/lodash-es/toPairsIn.js");
  120776. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPairsIn", function() { return _toPairsIn_js__WEBPACK_IMPORTED_MODULE_271__["default"]; });
  120777. /* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_272__ = __webpack_require__(/*! ./toPath.js */ "./node_modules/lodash-es/toPath.js");
  120778. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return _toPath_js__WEBPACK_IMPORTED_MODULE_272__["default"]; });
  120779. /* harmony import */ var _toPlainObject_js__WEBPACK_IMPORTED_MODULE_273__ = __webpack_require__(/*! ./toPlainObject.js */ "./node_modules/lodash-es/toPlainObject.js");
  120780. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPlainObject", function() { return _toPlainObject_js__WEBPACK_IMPORTED_MODULE_273__["default"]; });
  120781. /* harmony import */ var _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_274__ = __webpack_require__(/*! ./toSafeInteger.js */ "./node_modules/lodash-es/toSafeInteger.js");
  120782. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toSafeInteger", function() { return _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_274__["default"]; });
  120783. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_275__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  120784. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return _toString_js__WEBPACK_IMPORTED_MODULE_275__["default"]; });
  120785. /* harmony import */ var _toUpper_js__WEBPACK_IMPORTED_MODULE_276__ = __webpack_require__(/*! ./toUpper.js */ "./node_modules/lodash-es/toUpper.js");
  120786. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toUpper", function() { return _toUpper_js__WEBPACK_IMPORTED_MODULE_276__["default"]; });
  120787. /* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_277__ = __webpack_require__(/*! ./transform.js */ "./node_modules/lodash-es/transform.js");
  120788. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transform", function() { return _transform_js__WEBPACK_IMPORTED_MODULE_277__["default"]; });
  120789. /* harmony import */ var _trim_js__WEBPACK_IMPORTED_MODULE_278__ = __webpack_require__(/*! ./trim.js */ "./node_modules/lodash-es/trim.js");
  120790. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trim", function() { return _trim_js__WEBPACK_IMPORTED_MODULE_278__["default"]; });
  120791. /* harmony import */ var _trimEnd_js__WEBPACK_IMPORTED_MODULE_279__ = __webpack_require__(/*! ./trimEnd.js */ "./node_modules/lodash-es/trimEnd.js");
  120792. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trimEnd", function() { return _trimEnd_js__WEBPACK_IMPORTED_MODULE_279__["default"]; });
  120793. /* harmony import */ var _trimStart_js__WEBPACK_IMPORTED_MODULE_280__ = __webpack_require__(/*! ./trimStart.js */ "./node_modules/lodash-es/trimStart.js");
  120794. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trimStart", function() { return _trimStart_js__WEBPACK_IMPORTED_MODULE_280__["default"]; });
  120795. /* harmony import */ var _truncate_js__WEBPACK_IMPORTED_MODULE_281__ = __webpack_require__(/*! ./truncate.js */ "./node_modules/lodash-es/truncate.js");
  120796. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "truncate", function() { return _truncate_js__WEBPACK_IMPORTED_MODULE_281__["default"]; });
  120797. /* harmony import */ var _unary_js__WEBPACK_IMPORTED_MODULE_282__ = __webpack_require__(/*! ./unary.js */ "./node_modules/lodash-es/unary.js");
  120798. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unary", function() { return _unary_js__WEBPACK_IMPORTED_MODULE_282__["default"]; });
  120799. /* harmony import */ var _unescape_js__WEBPACK_IMPORTED_MODULE_283__ = __webpack_require__(/*! ./unescape.js */ "./node_modules/lodash-es/unescape.js");
  120800. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return _unescape_js__WEBPACK_IMPORTED_MODULE_283__["default"]; });
  120801. /* harmony import */ var _union_js__WEBPACK_IMPORTED_MODULE_284__ = __webpack_require__(/*! ./union.js */ "./node_modules/lodash-es/union.js");
  120802. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "union", function() { return _union_js__WEBPACK_IMPORTED_MODULE_284__["default"]; });
  120803. /* harmony import */ var _unionBy_js__WEBPACK_IMPORTED_MODULE_285__ = __webpack_require__(/*! ./unionBy.js */ "./node_modules/lodash-es/unionBy.js");
  120804. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unionBy", function() { return _unionBy_js__WEBPACK_IMPORTED_MODULE_285__["default"]; });
  120805. /* harmony import */ var _unionWith_js__WEBPACK_IMPORTED_MODULE_286__ = __webpack_require__(/*! ./unionWith.js */ "./node_modules/lodash-es/unionWith.js");
  120806. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unionWith", function() { return _unionWith_js__WEBPACK_IMPORTED_MODULE_286__["default"]; });
  120807. /* harmony import */ var _uniq_js__WEBPACK_IMPORTED_MODULE_287__ = __webpack_require__(/*! ./uniq.js */ "./node_modules/lodash-es/uniq.js");
  120808. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return _uniq_js__WEBPACK_IMPORTED_MODULE_287__["default"]; });
  120809. /* harmony import */ var _uniqBy_js__WEBPACK_IMPORTED_MODULE_288__ = __webpack_require__(/*! ./uniqBy.js */ "./node_modules/lodash-es/uniqBy.js");
  120810. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqBy", function() { return _uniqBy_js__WEBPACK_IMPORTED_MODULE_288__["default"]; });
  120811. /* harmony import */ var _uniqWith_js__WEBPACK_IMPORTED_MODULE_289__ = __webpack_require__(/*! ./uniqWith.js */ "./node_modules/lodash-es/uniqWith.js");
  120812. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqWith", function() { return _uniqWith_js__WEBPACK_IMPORTED_MODULE_289__["default"]; });
  120813. /* harmony import */ var _uniqueId_js__WEBPACK_IMPORTED_MODULE_290__ = __webpack_require__(/*! ./uniqueId.js */ "./node_modules/lodash-es/uniqueId.js");
  120814. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return _uniqueId_js__WEBPACK_IMPORTED_MODULE_290__["default"]; });
  120815. /* harmony import */ var _unset_js__WEBPACK_IMPORTED_MODULE_291__ = __webpack_require__(/*! ./unset.js */ "./node_modules/lodash-es/unset.js");
  120816. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unset", function() { return _unset_js__WEBPACK_IMPORTED_MODULE_291__["default"]; });
  120817. /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_292__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
  120818. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return _unzip_js__WEBPACK_IMPORTED_MODULE_292__["default"]; });
  120819. /* harmony import */ var _unzipWith_js__WEBPACK_IMPORTED_MODULE_293__ = __webpack_require__(/*! ./unzipWith.js */ "./node_modules/lodash-es/unzipWith.js");
  120820. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unzipWith", function() { return _unzipWith_js__WEBPACK_IMPORTED_MODULE_293__["default"]; });
  120821. /* harmony import */ var _update_js__WEBPACK_IMPORTED_MODULE_294__ = __webpack_require__(/*! ./update.js */ "./node_modules/lodash-es/update.js");
  120822. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "update", function() { return _update_js__WEBPACK_IMPORTED_MODULE_294__["default"]; });
  120823. /* harmony import */ var _updateWith_js__WEBPACK_IMPORTED_MODULE_295__ = __webpack_require__(/*! ./updateWith.js */ "./node_modules/lodash-es/updateWith.js");
  120824. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "updateWith", function() { return _updateWith_js__WEBPACK_IMPORTED_MODULE_295__["default"]; });
  120825. /* harmony import */ var _upperCase_js__WEBPACK_IMPORTED_MODULE_296__ = __webpack_require__(/*! ./upperCase.js */ "./node_modules/lodash-es/upperCase.js");
  120826. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperCase", function() { return _upperCase_js__WEBPACK_IMPORTED_MODULE_296__["default"]; });
  120827. /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_297__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
  120828. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperFirst", function() { return _upperFirst_js__WEBPACK_IMPORTED_MODULE_297__["default"]; });
  120829. /* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_298__ = __webpack_require__(/*! ./value.js */ "./node_modules/lodash-es/value.js");
  120830. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "value", function() { return _value_js__WEBPACK_IMPORTED_MODULE_298__["default"]; });
  120831. /* harmony import */ var _valueOf_js__WEBPACK_IMPORTED_MODULE_299__ = __webpack_require__(/*! ./valueOf.js */ "./node_modules/lodash-es/valueOf.js");
  120832. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valueOf", function() { return _valueOf_js__WEBPACK_IMPORTED_MODULE_299__["default"]; });
  120833. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_300__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  120834. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "values", function() { return _values_js__WEBPACK_IMPORTED_MODULE_300__["default"]; });
  120835. /* harmony import */ var _valuesIn_js__WEBPACK_IMPORTED_MODULE_301__ = __webpack_require__(/*! ./valuesIn.js */ "./node_modules/lodash-es/valuesIn.js");
  120836. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valuesIn", function() { return _valuesIn_js__WEBPACK_IMPORTED_MODULE_301__["default"]; });
  120837. /* harmony import */ var _without_js__WEBPACK_IMPORTED_MODULE_302__ = __webpack_require__(/*! ./without.js */ "./node_modules/lodash-es/without.js");
  120838. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "without", function() { return _without_js__WEBPACK_IMPORTED_MODULE_302__["default"]; });
  120839. /* harmony import */ var _words_js__WEBPACK_IMPORTED_MODULE_303__ = __webpack_require__(/*! ./words.js */ "./node_modules/lodash-es/words.js");
  120840. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "words", function() { return _words_js__WEBPACK_IMPORTED_MODULE_303__["default"]; });
  120841. /* harmony import */ var _wrap_js__WEBPACK_IMPORTED_MODULE_304__ = __webpack_require__(/*! ./wrap.js */ "./node_modules/lodash-es/wrap.js");
  120842. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _wrap_js__WEBPACK_IMPORTED_MODULE_304__["default"]; });
  120843. /* harmony import */ var _wrapperAt_js__WEBPACK_IMPORTED_MODULE_305__ = __webpack_require__(/*! ./wrapperAt.js */ "./node_modules/lodash-es/wrapperAt.js");
  120844. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperAt", function() { return _wrapperAt_js__WEBPACK_IMPORTED_MODULE_305__["default"]; });
  120845. /* harmony import */ var _wrapperChain_js__WEBPACK_IMPORTED_MODULE_306__ = __webpack_require__(/*! ./wrapperChain.js */ "./node_modules/lodash-es/wrapperChain.js");
  120846. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperChain", function() { return _wrapperChain_js__WEBPACK_IMPORTED_MODULE_306__["default"]; });
  120847. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperCommit", function() { return _commit_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  120848. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperLodash", function() { return _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_153__["default"]; });
  120849. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperNext", function() { return _next_js__WEBPACK_IMPORTED_MODULE_177__["default"]; });
  120850. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperPlant", function() { return _plant_js__WEBPACK_IMPORTED_MODULE_199__["default"]; });
  120851. /* harmony import */ var _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_307__ = __webpack_require__(/*! ./wrapperReverse.js */ "./node_modules/lodash-es/wrapperReverse.js");
  120852. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperReverse", function() { return _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_307__["default"]; });
  120853. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperToIterator", function() { return _toIterator_js__WEBPACK_IMPORTED_MODULE_265__["default"]; });
  120854. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_308__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  120855. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperValue", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_308__["default"]; });
  120856. /* harmony import */ var _xor_js__WEBPACK_IMPORTED_MODULE_309__ = __webpack_require__(/*! ./xor.js */ "./node_modules/lodash-es/xor.js");
  120857. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xor", function() { return _xor_js__WEBPACK_IMPORTED_MODULE_309__["default"]; });
  120858. /* harmony import */ var _xorBy_js__WEBPACK_IMPORTED_MODULE_310__ = __webpack_require__(/*! ./xorBy.js */ "./node_modules/lodash-es/xorBy.js");
  120859. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xorBy", function() { return _xorBy_js__WEBPACK_IMPORTED_MODULE_310__["default"]; });
  120860. /* harmony import */ var _xorWith_js__WEBPACK_IMPORTED_MODULE_311__ = __webpack_require__(/*! ./xorWith.js */ "./node_modules/lodash-es/xorWith.js");
  120861. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xorWith", function() { return _xorWith_js__WEBPACK_IMPORTED_MODULE_311__["default"]; });
  120862. /* harmony import */ var _zip_js__WEBPACK_IMPORTED_MODULE_312__ = __webpack_require__(/*! ./zip.js */ "./node_modules/lodash-es/zip.js");
  120863. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _zip_js__WEBPACK_IMPORTED_MODULE_312__["default"]; });
  120864. /* harmony import */ var _zipObject_js__WEBPACK_IMPORTED_MODULE_313__ = __webpack_require__(/*! ./zipObject.js */ "./node_modules/lodash-es/zipObject.js");
  120865. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipObject", function() { return _zipObject_js__WEBPACK_IMPORTED_MODULE_313__["default"]; });
  120866. /* harmony import */ var _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_314__ = __webpack_require__(/*! ./zipObjectDeep.js */ "./node_modules/lodash-es/zipObjectDeep.js");
  120867. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipObjectDeep", function() { return _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_314__["default"]; });
  120868. /* harmony import */ var _zipWith_js__WEBPACK_IMPORTED_MODULE_315__ = __webpack_require__(/*! ./zipWith.js */ "./node_modules/lodash-es/zipWith.js");
  120869. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipWith", function() { return _zipWith_js__WEBPACK_IMPORTED_MODULE_315__["default"]; });
  120870. /* harmony import */ var _lodash_default_js__WEBPACK_IMPORTED_MODULE_316__ = __webpack_require__(/*! ./lodash.default.js */ "./node_modules/lodash-es/lodash.default.js");
  120871. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _lodash_default_js__WEBPACK_IMPORTED_MODULE_316__["default"]; });
  120872. /**
  120873. * @license
  120874. * Lodash (Custom Build) <https://lodash.com/>
  120875. * Build: `lodash modularize exports="es" -o ./`
  120876. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  120877. * Released under MIT license <https://lodash.com/license>
  120878. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  120879. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  120880. */
  120881. /***/ }),
  120882. /***/ "./node_modules/lodash-es/lowerCase.js":
  120883. /*!*********************************************!*\
  120884. !*** ./node_modules/lodash-es/lowerCase.js ***!
  120885. \*********************************************/
  120886. /*! exports provided: default */
  120887. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120888. "use strict";
  120889. __webpack_require__.r(__webpack_exports__);
  120890. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  120891. /**
  120892. * Converts `string`, as space separated words, to lower case.
  120893. *
  120894. * @static
  120895. * @memberOf _
  120896. * @since 4.0.0
  120897. * @category String
  120898. * @param {string} [string=''] The string to convert.
  120899. * @returns {string} Returns the lower cased string.
  120900. * @example
  120901. *
  120902. * _.lowerCase('--Foo-Bar--');
  120903. * // => 'foo bar'
  120904. *
  120905. * _.lowerCase('fooBar');
  120906. * // => 'foo bar'
  120907. *
  120908. * _.lowerCase('__FOO_BAR__');
  120909. * // => 'foo bar'
  120910. */
  120911. var lowerCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
  120912. return result + (index ? ' ' : '') + word.toLowerCase();
  120913. });
  120914. /* harmony default export */ __webpack_exports__["default"] = (lowerCase);
  120915. /***/ }),
  120916. /***/ "./node_modules/lodash-es/lowerFirst.js":
  120917. /*!**********************************************!*\
  120918. !*** ./node_modules/lodash-es/lowerFirst.js ***!
  120919. \**********************************************/
  120920. /*! exports provided: default */
  120921. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120922. "use strict";
  120923. __webpack_require__.r(__webpack_exports__);
  120924. /* harmony import */ var _createCaseFirst_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCaseFirst.js */ "./node_modules/lodash-es/_createCaseFirst.js");
  120925. /**
  120926. * Converts the first character of `string` to lower case.
  120927. *
  120928. * @static
  120929. * @memberOf _
  120930. * @since 4.0.0
  120931. * @category String
  120932. * @param {string} [string=''] The string to convert.
  120933. * @returns {string} Returns the converted string.
  120934. * @example
  120935. *
  120936. * _.lowerFirst('Fred');
  120937. * // => 'fred'
  120938. *
  120939. * _.lowerFirst('FRED');
  120940. * // => 'fRED'
  120941. */
  120942. var lowerFirst = Object(_createCaseFirst_js__WEBPACK_IMPORTED_MODULE_0__["default"])('toLowerCase');
  120943. /* harmony default export */ __webpack_exports__["default"] = (lowerFirst);
  120944. /***/ }),
  120945. /***/ "./node_modules/lodash-es/lt.js":
  120946. /*!**************************************!*\
  120947. !*** ./node_modules/lodash-es/lt.js ***!
  120948. \**************************************/
  120949. /*! exports provided: default */
  120950. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120951. "use strict";
  120952. __webpack_require__.r(__webpack_exports__);
  120953. /* harmony import */ var _baseLt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseLt.js */ "./node_modules/lodash-es/_baseLt.js");
  120954. /* harmony import */ var _createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createRelationalOperation.js */ "./node_modules/lodash-es/_createRelationalOperation.js");
  120955. /**
  120956. * Checks if `value` is less than `other`.
  120957. *
  120958. * @static
  120959. * @memberOf _
  120960. * @since 3.9.0
  120961. * @category Lang
  120962. * @param {*} value The value to compare.
  120963. * @param {*} other The other value to compare.
  120964. * @returns {boolean} Returns `true` if `value` is less than `other`,
  120965. * else `false`.
  120966. * @see _.gt
  120967. * @example
  120968. *
  120969. * _.lt(1, 3);
  120970. * // => true
  120971. *
  120972. * _.lt(3, 3);
  120973. * // => false
  120974. *
  120975. * _.lt(3, 1);
  120976. * // => false
  120977. */
  120978. var lt = Object(_createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseLt_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  120979. /* harmony default export */ __webpack_exports__["default"] = (lt);
  120980. /***/ }),
  120981. /***/ "./node_modules/lodash-es/lte.js":
  120982. /*!***************************************!*\
  120983. !*** ./node_modules/lodash-es/lte.js ***!
  120984. \***************************************/
  120985. /*! exports provided: default */
  120986. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120987. "use strict";
  120988. __webpack_require__.r(__webpack_exports__);
  120989. /* harmony import */ var _createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRelationalOperation.js */ "./node_modules/lodash-es/_createRelationalOperation.js");
  120990. /**
  120991. * Checks if `value` is less than or equal to `other`.
  120992. *
  120993. * @static
  120994. * @memberOf _
  120995. * @since 3.9.0
  120996. * @category Lang
  120997. * @param {*} value The value to compare.
  120998. * @param {*} other The other value to compare.
  120999. * @returns {boolean} Returns `true` if `value` is less than or equal to
  121000. * `other`, else `false`.
  121001. * @see _.gte
  121002. * @example
  121003. *
  121004. * _.lte(1, 3);
  121005. * // => true
  121006. *
  121007. * _.lte(3, 3);
  121008. * // => true
  121009. *
  121010. * _.lte(3, 1);
  121011. * // => false
  121012. */
  121013. var lte = Object(_createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(value, other) {
  121014. return value <= other;
  121015. });
  121016. /* harmony default export */ __webpack_exports__["default"] = (lte);
  121017. /***/ }),
  121018. /***/ "./node_modules/lodash-es/map.js":
  121019. /*!***************************************!*\
  121020. !*** ./node_modules/lodash-es/map.js ***!
  121021. \***************************************/
  121022. /*! exports provided: default */
  121023. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121024. "use strict";
  121025. __webpack_require__.r(__webpack_exports__);
  121026. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  121027. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  121028. /* harmony import */ var _baseMap_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseMap.js */ "./node_modules/lodash-es/_baseMap.js");
  121029. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  121030. /**
  121031. * Creates an array of values by running each element in `collection` thru
  121032. * `iteratee`. The iteratee is invoked with three arguments:
  121033. * (value, index|key, collection).
  121034. *
  121035. * Many lodash methods are guarded to work as iteratees for methods like
  121036. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  121037. *
  121038. * The guarded methods are:
  121039. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  121040. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  121041. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  121042. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  121043. *
  121044. * @static
  121045. * @memberOf _
  121046. * @since 0.1.0
  121047. * @category Collection
  121048. * @param {Array|Object} collection The collection to iterate over.
  121049. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  121050. * @returns {Array} Returns the new mapped array.
  121051. * @example
  121052. *
  121053. * function square(n) {
  121054. * return n * n;
  121055. * }
  121056. *
  121057. * _.map([4, 8], square);
  121058. * // => [16, 64]
  121059. *
  121060. * _.map({ 'a': 4, 'b': 8 }, square);
  121061. * // => [16, 64] (iteration order is not guaranteed)
  121062. *
  121063. * var users = [
  121064. * { 'user': 'barney' },
  121065. * { 'user': 'fred' }
  121066. * ];
  121067. *
  121068. * // The `_.property` iteratee shorthand.
  121069. * _.map(users, 'user');
  121070. * // => ['barney', 'fred']
  121071. */
  121072. function map(collection, iteratee) {
  121073. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseMap_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  121074. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee, 3));
  121075. }
  121076. /* harmony default export */ __webpack_exports__["default"] = (map);
  121077. /***/ }),
  121078. /***/ "./node_modules/lodash-es/mapKeys.js":
  121079. /*!*******************************************!*\
  121080. !*** ./node_modules/lodash-es/mapKeys.js ***!
  121081. \*******************************************/
  121082. /*! exports provided: default */
  121083. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121084. "use strict";
  121085. __webpack_require__.r(__webpack_exports__);
  121086. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  121087. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  121088. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  121089. /**
  121090. * The opposite of `_.mapValues`; this method creates an object with the
  121091. * same values as `object` and keys generated by running each own enumerable
  121092. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  121093. * with three arguments: (value, key, object).
  121094. *
  121095. * @static
  121096. * @memberOf _
  121097. * @since 3.8.0
  121098. * @category Object
  121099. * @param {Object} object The object to iterate over.
  121100. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  121101. * @returns {Object} Returns the new mapped object.
  121102. * @see _.mapValues
  121103. * @example
  121104. *
  121105. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  121106. * return key + value;
  121107. * });
  121108. * // => { 'a1': 1, 'b2': 2 }
  121109. */
  121110. function mapKeys(object, iteratee) {
  121111. var result = {};
  121112. iteratee = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 3);
  121113. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, function(value, key, object) {
  121114. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, iteratee(value, key, object), value);
  121115. });
  121116. return result;
  121117. }
  121118. /* harmony default export */ __webpack_exports__["default"] = (mapKeys);
  121119. /***/ }),
  121120. /***/ "./node_modules/lodash-es/mapValues.js":
  121121. /*!*********************************************!*\
  121122. !*** ./node_modules/lodash-es/mapValues.js ***!
  121123. \*********************************************/
  121124. /*! exports provided: default */
  121125. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121126. "use strict";
  121127. __webpack_require__.r(__webpack_exports__);
  121128. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  121129. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  121130. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  121131. /**
  121132. * Creates an object with the same keys as `object` and values generated
  121133. * by running each own enumerable string keyed property of `object` thru
  121134. * `iteratee`. The iteratee is invoked with three arguments:
  121135. * (value, key, object).
  121136. *
  121137. * @static
  121138. * @memberOf _
  121139. * @since 2.4.0
  121140. * @category Object
  121141. * @param {Object} object The object to iterate over.
  121142. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  121143. * @returns {Object} Returns the new mapped object.
  121144. * @see _.mapKeys
  121145. * @example
  121146. *
  121147. * var users = {
  121148. * 'fred': { 'user': 'fred', 'age': 40 },
  121149. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  121150. * };
  121151. *
  121152. * _.mapValues(users, function(o) { return o.age; });
  121153. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  121154. *
  121155. * // The `_.property` iteratee shorthand.
  121156. * _.mapValues(users, 'age');
  121157. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  121158. */
  121159. function mapValues(object, iteratee) {
  121160. var result = {};
  121161. iteratee = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 3);
  121162. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, function(value, key, object) {
  121163. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, key, iteratee(value, key, object));
  121164. });
  121165. return result;
  121166. }
  121167. /* harmony default export */ __webpack_exports__["default"] = (mapValues);
  121168. /***/ }),
  121169. /***/ "./node_modules/lodash-es/matches.js":
  121170. /*!*******************************************!*\
  121171. !*** ./node_modules/lodash-es/matches.js ***!
  121172. \*******************************************/
  121173. /*! exports provided: default */
  121174. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121175. "use strict";
  121176. __webpack_require__.r(__webpack_exports__);
  121177. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  121178. /* harmony import */ var _baseMatches_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMatches.js */ "./node_modules/lodash-es/_baseMatches.js");
  121179. /** Used to compose bitmasks for cloning. */
  121180. var CLONE_DEEP_FLAG = 1;
  121181. /**
  121182. * Creates a function that performs a partial deep comparison between a given
  121183. * object and `source`, returning `true` if the given object has equivalent
  121184. * property values, else `false`.
  121185. *
  121186. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  121187. * partially applied.
  121188. *
  121189. * Partial comparisons will match empty array and empty object `source`
  121190. * values against any array or object value, respectively. See `_.isEqual`
  121191. * for a list of supported value comparisons.
  121192. *
  121193. * **Note:** Multiple values can be checked by combining several matchers
  121194. * using `_.overSome`
  121195. *
  121196. * @static
  121197. * @memberOf _
  121198. * @since 3.0.0
  121199. * @category Util
  121200. * @param {Object} source The object of property values to match.
  121201. * @returns {Function} Returns the new spec function.
  121202. * @example
  121203. *
  121204. * var objects = [
  121205. * { 'a': 1, 'b': 2, 'c': 3 },
  121206. * { 'a': 4, 'b': 5, 'c': 6 }
  121207. * ];
  121208. *
  121209. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  121210. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  121211. *
  121212. * // Checking for several possible values
  121213. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  121214. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  121215. */
  121216. function matches(source) {
  121217. return Object(_baseMatches_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, CLONE_DEEP_FLAG));
  121218. }
  121219. /* harmony default export */ __webpack_exports__["default"] = (matches);
  121220. /***/ }),
  121221. /***/ "./node_modules/lodash-es/matchesProperty.js":
  121222. /*!***************************************************!*\
  121223. !*** ./node_modules/lodash-es/matchesProperty.js ***!
  121224. \***************************************************/
  121225. /*! exports provided: default */
  121226. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121227. "use strict";
  121228. __webpack_require__.r(__webpack_exports__);
  121229. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  121230. /* harmony import */ var _baseMatchesProperty_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMatchesProperty.js */ "./node_modules/lodash-es/_baseMatchesProperty.js");
  121231. /** Used to compose bitmasks for cloning. */
  121232. var CLONE_DEEP_FLAG = 1;
  121233. /**
  121234. * Creates a function that performs a partial deep comparison between the
  121235. * value at `path` of a given object to `srcValue`, returning `true` if the
  121236. * object value is equivalent, else `false`.
  121237. *
  121238. * **Note:** Partial comparisons will match empty array and empty object
  121239. * `srcValue` values against any array or object value, respectively. See
  121240. * `_.isEqual` for a list of supported value comparisons.
  121241. *
  121242. * **Note:** Multiple values can be checked by combining several matchers
  121243. * using `_.overSome`
  121244. *
  121245. * @static
  121246. * @memberOf _
  121247. * @since 3.2.0
  121248. * @category Util
  121249. * @param {Array|string} path The path of the property to get.
  121250. * @param {*} srcValue The value to match.
  121251. * @returns {Function} Returns the new spec function.
  121252. * @example
  121253. *
  121254. * var objects = [
  121255. * { 'a': 1, 'b': 2, 'c': 3 },
  121256. * { 'a': 4, 'b': 5, 'c': 6 }
  121257. * ];
  121258. *
  121259. * _.find(objects, _.matchesProperty('a', 4));
  121260. * // => { 'a': 4, 'b': 5, 'c': 6 }
  121261. *
  121262. * // Checking for several possible values
  121263. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  121264. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  121265. */
  121266. function matchesProperty(path, srcValue) {
  121267. return Object(_baseMatchesProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path, Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(srcValue, CLONE_DEEP_FLAG));
  121268. }
  121269. /* harmony default export */ __webpack_exports__["default"] = (matchesProperty);
  121270. /***/ }),
  121271. /***/ "./node_modules/lodash-es/math.default.js":
  121272. /*!************************************************!*\
  121273. !*** ./node_modules/lodash-es/math.default.js ***!
  121274. \************************************************/
  121275. /*! exports provided: default */
  121276. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121277. "use strict";
  121278. __webpack_require__.r(__webpack_exports__);
  121279. /* harmony import */ var _add_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.js */ "./node_modules/lodash-es/add.js");
  121280. /* harmony import */ var _ceil_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ceil.js */ "./node_modules/lodash-es/ceil.js");
  121281. /* harmony import */ var _divide_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./divide.js */ "./node_modules/lodash-es/divide.js");
  121282. /* harmony import */ var _floor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./floor.js */ "./node_modules/lodash-es/floor.js");
  121283. /* harmony import */ var _max_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./max.js */ "./node_modules/lodash-es/max.js");
  121284. /* harmony import */ var _maxBy_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./maxBy.js */ "./node_modules/lodash-es/maxBy.js");
  121285. /* harmony import */ var _mean_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mean.js */ "./node_modules/lodash-es/mean.js");
  121286. /* harmony import */ var _meanBy_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./meanBy.js */ "./node_modules/lodash-es/meanBy.js");
  121287. /* harmony import */ var _min_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./min.js */ "./node_modules/lodash-es/min.js");
  121288. /* harmony import */ var _minBy_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./minBy.js */ "./node_modules/lodash-es/minBy.js");
  121289. /* harmony import */ var _multiply_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./multiply.js */ "./node_modules/lodash-es/multiply.js");
  121290. /* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./round.js */ "./node_modules/lodash-es/round.js");
  121291. /* harmony import */ var _subtract_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./subtract.js */ "./node_modules/lodash-es/subtract.js");
  121292. /* harmony import */ var _sum_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./sum.js */ "./node_modules/lodash-es/sum.js");
  121293. /* harmony import */ var _sumBy_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./sumBy.js */ "./node_modules/lodash-es/sumBy.js");
  121294. /* harmony default export */ __webpack_exports__["default"] = ({
  121295. add: _add_js__WEBPACK_IMPORTED_MODULE_0__["default"], ceil: _ceil_js__WEBPACK_IMPORTED_MODULE_1__["default"], divide: _divide_js__WEBPACK_IMPORTED_MODULE_2__["default"], floor: _floor_js__WEBPACK_IMPORTED_MODULE_3__["default"], max: _max_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  121296. maxBy: _maxBy_js__WEBPACK_IMPORTED_MODULE_5__["default"], mean: _mean_js__WEBPACK_IMPORTED_MODULE_6__["default"], meanBy: _meanBy_js__WEBPACK_IMPORTED_MODULE_7__["default"], min: _min_js__WEBPACK_IMPORTED_MODULE_8__["default"], minBy: _minBy_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  121297. multiply: _multiply_js__WEBPACK_IMPORTED_MODULE_10__["default"], round: _round_js__WEBPACK_IMPORTED_MODULE_11__["default"], subtract: _subtract_js__WEBPACK_IMPORTED_MODULE_12__["default"], sum: _sum_js__WEBPACK_IMPORTED_MODULE_13__["default"], sumBy: _sumBy_js__WEBPACK_IMPORTED_MODULE_14__["default"]
  121298. });
  121299. /***/ }),
  121300. /***/ "./node_modules/lodash-es/math.js":
  121301. /*!****************************************!*\
  121302. !*** ./node_modules/lodash-es/math.js ***!
  121303. \****************************************/
  121304. /*! exports provided: add, ceil, divide, floor, max, maxBy, mean, meanBy, min, minBy, multiply, round, subtract, sum, sumBy, default */
  121305. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121306. "use strict";
  121307. __webpack_require__.r(__webpack_exports__);
  121308. /* harmony import */ var _add_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.js */ "./node_modules/lodash-es/add.js");
  121309. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "add", function() { return _add_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  121310. /* harmony import */ var _ceil_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ceil.js */ "./node_modules/lodash-es/ceil.js");
  121311. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return _ceil_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  121312. /* harmony import */ var _divide_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./divide.js */ "./node_modules/lodash-es/divide.js");
  121313. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "divide", function() { return _divide_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  121314. /* harmony import */ var _floor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./floor.js */ "./node_modules/lodash-es/floor.js");
  121315. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return _floor_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  121316. /* harmony import */ var _max_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./max.js */ "./node_modules/lodash-es/max.js");
  121317. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _max_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  121318. /* harmony import */ var _maxBy_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./maxBy.js */ "./node_modules/lodash-es/maxBy.js");
  121319. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maxBy", function() { return _maxBy_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  121320. /* harmony import */ var _mean_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mean.js */ "./node_modules/lodash-es/mean.js");
  121321. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mean", function() { return _mean_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  121322. /* harmony import */ var _meanBy_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./meanBy.js */ "./node_modules/lodash-es/meanBy.js");
  121323. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "meanBy", function() { return _meanBy_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  121324. /* harmony import */ var _min_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./min.js */ "./node_modules/lodash-es/min.js");
  121325. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return _min_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  121326. /* harmony import */ var _minBy_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./minBy.js */ "./node_modules/lodash-es/minBy.js");
  121327. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "minBy", function() { return _minBy_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  121328. /* harmony import */ var _multiply_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./multiply.js */ "./node_modules/lodash-es/multiply.js");
  121329. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return _multiply_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  121330. /* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./round.js */ "./node_modules/lodash-es/round.js");
  121331. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "round", function() { return _round_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  121332. /* harmony import */ var _subtract_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./subtract.js */ "./node_modules/lodash-es/subtract.js");
  121333. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return _subtract_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  121334. /* harmony import */ var _sum_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./sum.js */ "./node_modules/lodash-es/sum.js");
  121335. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sum", function() { return _sum_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  121336. /* harmony import */ var _sumBy_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./sumBy.js */ "./node_modules/lodash-es/sumBy.js");
  121337. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sumBy", function() { return _sumBy_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  121338. /* harmony import */ var _math_default_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./math.default.js */ "./node_modules/lodash-es/math.default.js");
  121339. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _math_default_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  121340. /***/ }),
  121341. /***/ "./node_modules/lodash-es/max.js":
  121342. /*!***************************************!*\
  121343. !*** ./node_modules/lodash-es/max.js ***!
  121344. \***************************************/
  121345. /*! exports provided: default */
  121346. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121347. "use strict";
  121348. __webpack_require__.r(__webpack_exports__);
  121349. /* harmony import */ var _baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseExtremum.js */ "./node_modules/lodash-es/_baseExtremum.js");
  121350. /* harmony import */ var _baseGt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseGt.js */ "./node_modules/lodash-es/_baseGt.js");
  121351. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  121352. /**
  121353. * Computes the maximum value of `array`. If `array` is empty or falsey,
  121354. * `undefined` is returned.
  121355. *
  121356. * @static
  121357. * @since 0.1.0
  121358. * @memberOf _
  121359. * @category Math
  121360. * @param {Array} array The array to iterate over.
  121361. * @returns {*} Returns the maximum value.
  121362. * @example
  121363. *
  121364. * _.max([4, 2, 8, 6]);
  121365. * // => 8
  121366. *
  121367. * _.max([]);
  121368. * // => undefined
  121369. */
  121370. function max(array) {
  121371. return (array && array.length)
  121372. ? Object(_baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"], _baseGt_js__WEBPACK_IMPORTED_MODULE_1__["default"])
  121373. : undefined;
  121374. }
  121375. /* harmony default export */ __webpack_exports__["default"] = (max);
  121376. /***/ }),
  121377. /***/ "./node_modules/lodash-es/maxBy.js":
  121378. /*!*****************************************!*\
  121379. !*** ./node_modules/lodash-es/maxBy.js ***!
  121380. \*****************************************/
  121381. /*! exports provided: default */
  121382. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121383. "use strict";
  121384. __webpack_require__.r(__webpack_exports__);
  121385. /* harmony import */ var _baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseExtremum.js */ "./node_modules/lodash-es/_baseExtremum.js");
  121386. /* harmony import */ var _baseGt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseGt.js */ "./node_modules/lodash-es/_baseGt.js");
  121387. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  121388. /**
  121389. * This method is like `_.max` except that it accepts `iteratee` which is
  121390. * invoked for each element in `array` to generate the criterion by which
  121391. * the value is ranked. The iteratee is invoked with one argument: (value).
  121392. *
  121393. * @static
  121394. * @memberOf _
  121395. * @since 4.0.0
  121396. * @category Math
  121397. * @param {Array} array The array to iterate over.
  121398. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  121399. * @returns {*} Returns the maximum value.
  121400. * @example
  121401. *
  121402. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  121403. *
  121404. * _.maxBy(objects, function(o) { return o.n; });
  121405. * // => { 'n': 2 }
  121406. *
  121407. * // The `_.property` iteratee shorthand.
  121408. * _.maxBy(objects, 'n');
  121409. * // => { 'n': 2 }
  121410. */
  121411. function maxBy(array, iteratee) {
  121412. return (array && array.length)
  121413. ? Object(_baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 2), _baseGt_js__WEBPACK_IMPORTED_MODULE_1__["default"])
  121414. : undefined;
  121415. }
  121416. /* harmony default export */ __webpack_exports__["default"] = (maxBy);
  121417. /***/ }),
  121418. /***/ "./node_modules/lodash-es/mean.js":
  121419. /*!****************************************!*\
  121420. !*** ./node_modules/lodash-es/mean.js ***!
  121421. \****************************************/
  121422. /*! exports provided: default */
  121423. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121424. "use strict";
  121425. __webpack_require__.r(__webpack_exports__);
  121426. /* harmony import */ var _baseMean_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMean.js */ "./node_modules/lodash-es/_baseMean.js");
  121427. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  121428. /**
  121429. * Computes the mean of the values in `array`.
  121430. *
  121431. * @static
  121432. * @memberOf _
  121433. * @since 4.0.0
  121434. * @category Math
  121435. * @param {Array} array The array to iterate over.
  121436. * @returns {number} Returns the mean.
  121437. * @example
  121438. *
  121439. * _.mean([4, 2, 8, 6]);
  121440. * // => 5
  121441. */
  121442. function mean(array) {
  121443. return Object(_baseMean_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _identity_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  121444. }
  121445. /* harmony default export */ __webpack_exports__["default"] = (mean);
  121446. /***/ }),
  121447. /***/ "./node_modules/lodash-es/meanBy.js":
  121448. /*!******************************************!*\
  121449. !*** ./node_modules/lodash-es/meanBy.js ***!
  121450. \******************************************/
  121451. /*! exports provided: default */
  121452. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121453. "use strict";
  121454. __webpack_require__.r(__webpack_exports__);
  121455. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  121456. /* harmony import */ var _baseMean_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMean.js */ "./node_modules/lodash-es/_baseMean.js");
  121457. /**
  121458. * This method is like `_.mean` except that it accepts `iteratee` which is
  121459. * invoked for each element in `array` to generate the value to be averaged.
  121460. * The iteratee is invoked with one argument: (value).
  121461. *
  121462. * @static
  121463. * @memberOf _
  121464. * @since 4.7.0
  121465. * @category Math
  121466. * @param {Array} array The array to iterate over.
  121467. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  121468. * @returns {number} Returns the mean.
  121469. * @example
  121470. *
  121471. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  121472. *
  121473. * _.meanBy(objects, function(o) { return o.n; });
  121474. * // => 5
  121475. *
  121476. * // The `_.property` iteratee shorthand.
  121477. * _.meanBy(objects, 'n');
  121478. * // => 5
  121479. */
  121480. function meanBy(array, iteratee) {
  121481. return Object(_baseMean_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2));
  121482. }
  121483. /* harmony default export */ __webpack_exports__["default"] = (meanBy);
  121484. /***/ }),
  121485. /***/ "./node_modules/lodash-es/memoize.js":
  121486. /*!*******************************************!*\
  121487. !*** ./node_modules/lodash-es/memoize.js ***!
  121488. \*******************************************/
  121489. /*! exports provided: default */
  121490. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121491. "use strict";
  121492. __webpack_require__.r(__webpack_exports__);
  121493. /* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_MapCache.js */ "./node_modules/lodash-es/_MapCache.js");
  121494. /** Error message constants. */
  121495. var FUNC_ERROR_TEXT = 'Expected a function';
  121496. /**
  121497. * Creates a function that memoizes the result of `func`. If `resolver` is
  121498. * provided, it determines the cache key for storing the result based on the
  121499. * arguments provided to the memoized function. By default, the first argument
  121500. * provided to the memoized function is used as the map cache key. The `func`
  121501. * is invoked with the `this` binding of the memoized function.
  121502. *
  121503. * **Note:** The cache is exposed as the `cache` property on the memoized
  121504. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  121505. * constructor with one whose instances implement the
  121506. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  121507. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  121508. *
  121509. * @static
  121510. * @memberOf _
  121511. * @since 0.1.0
  121512. * @category Function
  121513. * @param {Function} func The function to have its output memoized.
  121514. * @param {Function} [resolver] The function to resolve the cache key.
  121515. * @returns {Function} Returns the new memoized function.
  121516. * @example
  121517. *
  121518. * var object = { 'a': 1, 'b': 2 };
  121519. * var other = { 'c': 3, 'd': 4 };
  121520. *
  121521. * var values = _.memoize(_.values);
  121522. * values(object);
  121523. * // => [1, 2]
  121524. *
  121525. * values(other);
  121526. * // => [3, 4]
  121527. *
  121528. * object.a = 2;
  121529. * values(object);
  121530. * // => [1, 2]
  121531. *
  121532. * // Modify the result cache.
  121533. * values.cache.set(object, ['a', 'b']);
  121534. * values(object);
  121535. * // => ['a', 'b']
  121536. *
  121537. * // Replace `_.memoize.Cache`.
  121538. * _.memoize.Cache = WeakMap;
  121539. */
  121540. function memoize(func, resolver) {
  121541. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  121542. throw new TypeError(FUNC_ERROR_TEXT);
  121543. }
  121544. var memoized = function() {
  121545. var args = arguments,
  121546. key = resolver ? resolver.apply(this, args) : args[0],
  121547. cache = memoized.cache;
  121548. if (cache.has(key)) {
  121549. return cache.get(key);
  121550. }
  121551. var result = func.apply(this, args);
  121552. memoized.cache = cache.set(key, result) || cache;
  121553. return result;
  121554. };
  121555. memoized.cache = new (memoize.Cache || _MapCache_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  121556. return memoized;
  121557. }
  121558. // Expose `MapCache`.
  121559. memoize.Cache = _MapCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  121560. /* harmony default export */ __webpack_exports__["default"] = (memoize);
  121561. /***/ }),
  121562. /***/ "./node_modules/lodash-es/merge.js":
  121563. /*!*****************************************!*\
  121564. !*** ./node_modules/lodash-es/merge.js ***!
  121565. \*****************************************/
  121566. /*! exports provided: default */
  121567. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121568. "use strict";
  121569. __webpack_require__.r(__webpack_exports__);
  121570. /* harmony import */ var _baseMerge_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMerge.js */ "./node_modules/lodash-es/_baseMerge.js");
  121571. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  121572. /**
  121573. * This method is like `_.assign` except that it recursively merges own and
  121574. * inherited enumerable string keyed properties of source objects into the
  121575. * destination object. Source properties that resolve to `undefined` are
  121576. * skipped if a destination value exists. Array and plain object properties
  121577. * are merged recursively. Other objects and value types are overridden by
  121578. * assignment. Source objects are applied from left to right. Subsequent
  121579. * sources overwrite property assignments of previous sources.
  121580. *
  121581. * **Note:** This method mutates `object`.
  121582. *
  121583. * @static
  121584. * @memberOf _
  121585. * @since 0.5.0
  121586. * @category Object
  121587. * @param {Object} object The destination object.
  121588. * @param {...Object} [sources] The source objects.
  121589. * @returns {Object} Returns `object`.
  121590. * @example
  121591. *
  121592. * var object = {
  121593. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  121594. * };
  121595. *
  121596. * var other = {
  121597. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  121598. * };
  121599. *
  121600. * _.merge(object, other);
  121601. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  121602. */
  121603. var merge = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source, srcIndex) {
  121604. Object(_baseMerge_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, srcIndex);
  121605. });
  121606. /* harmony default export */ __webpack_exports__["default"] = (merge);
  121607. /***/ }),
  121608. /***/ "./node_modules/lodash-es/mergeWith.js":
  121609. /*!*********************************************!*\
  121610. !*** ./node_modules/lodash-es/mergeWith.js ***!
  121611. \*********************************************/
  121612. /*! exports provided: default */
  121613. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121614. "use strict";
  121615. __webpack_require__.r(__webpack_exports__);
  121616. /* harmony import */ var _baseMerge_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMerge.js */ "./node_modules/lodash-es/_baseMerge.js");
  121617. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  121618. /**
  121619. * This method is like `_.merge` except that it accepts `customizer` which
  121620. * is invoked to produce the merged values of the destination and source
  121621. * properties. If `customizer` returns `undefined`, merging is handled by the
  121622. * method instead. The `customizer` is invoked with six arguments:
  121623. * (objValue, srcValue, key, object, source, stack).
  121624. *
  121625. * **Note:** This method mutates `object`.
  121626. *
  121627. * @static
  121628. * @memberOf _
  121629. * @since 4.0.0
  121630. * @category Object
  121631. * @param {Object} object The destination object.
  121632. * @param {...Object} sources The source objects.
  121633. * @param {Function} customizer The function to customize assigned values.
  121634. * @returns {Object} Returns `object`.
  121635. * @example
  121636. *
  121637. * function customizer(objValue, srcValue) {
  121638. * if (_.isArray(objValue)) {
  121639. * return objValue.concat(srcValue);
  121640. * }
  121641. * }
  121642. *
  121643. * var object = { 'a': [1], 'b': [2] };
  121644. * var other = { 'a': [3], 'b': [4] };
  121645. *
  121646. * _.mergeWith(object, other, customizer);
  121647. * // => { 'a': [1, 3], 'b': [2, 4] }
  121648. */
  121649. var mergeWith = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source, srcIndex, customizer) {
  121650. Object(_baseMerge_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, srcIndex, customizer);
  121651. });
  121652. /* harmony default export */ __webpack_exports__["default"] = (mergeWith);
  121653. /***/ }),
  121654. /***/ "./node_modules/lodash-es/method.js":
  121655. /*!******************************************!*\
  121656. !*** ./node_modules/lodash-es/method.js ***!
  121657. \******************************************/
  121658. /*! exports provided: default */
  121659. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121660. "use strict";
  121661. __webpack_require__.r(__webpack_exports__);
  121662. /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
  121663. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  121664. /**
  121665. * Creates a function that invokes the method at `path` of a given object.
  121666. * Any additional arguments are provided to the invoked method.
  121667. *
  121668. * @static
  121669. * @memberOf _
  121670. * @since 3.7.0
  121671. * @category Util
  121672. * @param {Array|string} path The path of the method to invoke.
  121673. * @param {...*} [args] The arguments to invoke the method with.
  121674. * @returns {Function} Returns the new invoker function.
  121675. * @example
  121676. *
  121677. * var objects = [
  121678. * { 'a': { 'b': _.constant(2) } },
  121679. * { 'a': { 'b': _.constant(1) } }
  121680. * ];
  121681. *
  121682. * _.map(objects, _.method('a.b'));
  121683. * // => [2, 1]
  121684. *
  121685. * _.map(objects, _.method(['a', 'b']));
  121686. * // => [2, 1]
  121687. */
  121688. var method = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(path, args) {
  121689. return function(object) {
  121690. return Object(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, args);
  121691. };
  121692. });
  121693. /* harmony default export */ __webpack_exports__["default"] = (method);
  121694. /***/ }),
  121695. /***/ "./node_modules/lodash-es/methodOf.js":
  121696. /*!********************************************!*\
  121697. !*** ./node_modules/lodash-es/methodOf.js ***!
  121698. \********************************************/
  121699. /*! exports provided: default */
  121700. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121701. "use strict";
  121702. __webpack_require__.r(__webpack_exports__);
  121703. /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
  121704. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  121705. /**
  121706. * The opposite of `_.method`; this method creates a function that invokes
  121707. * the method at a given path of `object`. Any additional arguments are
  121708. * provided to the invoked method.
  121709. *
  121710. * @static
  121711. * @memberOf _
  121712. * @since 3.7.0
  121713. * @category Util
  121714. * @param {Object} object The object to query.
  121715. * @param {...*} [args] The arguments to invoke the method with.
  121716. * @returns {Function} Returns the new invoker function.
  121717. * @example
  121718. *
  121719. * var array = _.times(3, _.constant),
  121720. * object = { 'a': array, 'b': array, 'c': array };
  121721. *
  121722. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  121723. * // => [2, 0]
  121724. *
  121725. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  121726. * // => [2, 0]
  121727. */
  121728. var methodOf = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, args) {
  121729. return function(path) {
  121730. return Object(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, args);
  121731. };
  121732. });
  121733. /* harmony default export */ __webpack_exports__["default"] = (methodOf);
  121734. /***/ }),
  121735. /***/ "./node_modules/lodash-es/min.js":
  121736. /*!***************************************!*\
  121737. !*** ./node_modules/lodash-es/min.js ***!
  121738. \***************************************/
  121739. /*! exports provided: default */
  121740. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121741. "use strict";
  121742. __webpack_require__.r(__webpack_exports__);
  121743. /* harmony import */ var _baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseExtremum.js */ "./node_modules/lodash-es/_baseExtremum.js");
  121744. /* harmony import */ var _baseLt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseLt.js */ "./node_modules/lodash-es/_baseLt.js");
  121745. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  121746. /**
  121747. * Computes the minimum value of `array`. If `array` is empty or falsey,
  121748. * `undefined` is returned.
  121749. *
  121750. * @static
  121751. * @since 0.1.0
  121752. * @memberOf _
  121753. * @category Math
  121754. * @param {Array} array The array to iterate over.
  121755. * @returns {*} Returns the minimum value.
  121756. * @example
  121757. *
  121758. * _.min([4, 2, 8, 6]);
  121759. * // => 2
  121760. *
  121761. * _.min([]);
  121762. * // => undefined
  121763. */
  121764. function min(array) {
  121765. return (array && array.length)
  121766. ? Object(_baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"], _baseLt_js__WEBPACK_IMPORTED_MODULE_1__["default"])
  121767. : undefined;
  121768. }
  121769. /* harmony default export */ __webpack_exports__["default"] = (min);
  121770. /***/ }),
  121771. /***/ "./node_modules/lodash-es/minBy.js":
  121772. /*!*****************************************!*\
  121773. !*** ./node_modules/lodash-es/minBy.js ***!
  121774. \*****************************************/
  121775. /*! exports provided: default */
  121776. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121777. "use strict";
  121778. __webpack_require__.r(__webpack_exports__);
  121779. /* harmony import */ var _baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseExtremum.js */ "./node_modules/lodash-es/_baseExtremum.js");
  121780. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  121781. /* harmony import */ var _baseLt_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseLt.js */ "./node_modules/lodash-es/_baseLt.js");
  121782. /**
  121783. * This method is like `_.min` except that it accepts `iteratee` which is
  121784. * invoked for each element in `array` to generate the criterion by which
  121785. * the value is ranked. The iteratee is invoked with one argument: (value).
  121786. *
  121787. * @static
  121788. * @memberOf _
  121789. * @since 4.0.0
  121790. * @category Math
  121791. * @param {Array} array The array to iterate over.
  121792. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  121793. * @returns {*} Returns the minimum value.
  121794. * @example
  121795. *
  121796. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  121797. *
  121798. * _.minBy(objects, function(o) { return o.n; });
  121799. * // => { 'n': 1 }
  121800. *
  121801. * // The `_.property` iteratee shorthand.
  121802. * _.minBy(objects, 'n');
  121803. * // => { 'n': 1 }
  121804. */
  121805. function minBy(array, iteratee) {
  121806. return (array && array.length)
  121807. ? Object(_baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee, 2), _baseLt_js__WEBPACK_IMPORTED_MODULE_2__["default"])
  121808. : undefined;
  121809. }
  121810. /* harmony default export */ __webpack_exports__["default"] = (minBy);
  121811. /***/ }),
  121812. /***/ "./node_modules/lodash-es/mixin.js":
  121813. /*!*****************************************!*\
  121814. !*** ./node_modules/lodash-es/mixin.js ***!
  121815. \*****************************************/
  121816. /*! exports provided: default */
  121817. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121818. "use strict";
  121819. __webpack_require__.r(__webpack_exports__);
  121820. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  121821. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  121822. /* harmony import */ var _baseFunctions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseFunctions.js */ "./node_modules/lodash-es/_baseFunctions.js");
  121823. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  121824. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  121825. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  121826. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  121827. /**
  121828. * Adds all own enumerable string keyed function properties of a source
  121829. * object to the destination object. If `object` is a function, then methods
  121830. * are added to its prototype as well.
  121831. *
  121832. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  121833. * avoid conflicts caused by modifying the original.
  121834. *
  121835. * @static
  121836. * @since 0.1.0
  121837. * @memberOf _
  121838. * @category Util
  121839. * @param {Function|Object} [object=lodash] The destination object.
  121840. * @param {Object} source The object of functions to add.
  121841. * @param {Object} [options={}] The options object.
  121842. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  121843. * @returns {Function|Object} Returns `object`.
  121844. * @example
  121845. *
  121846. * function vowels(string) {
  121847. * return _.filter(string, function(v) {
  121848. * return /[aeiou]/i.test(v);
  121849. * });
  121850. * }
  121851. *
  121852. * _.mixin({ 'vowels': vowels });
  121853. * _.vowels('fred');
  121854. * // => ['e']
  121855. *
  121856. * _('fred').vowels().value();
  121857. * // => ['e']
  121858. *
  121859. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  121860. * _('fred').vowels();
  121861. * // => ['e']
  121862. */
  121863. function mixin(object, source, options) {
  121864. var props = Object(_keys_js__WEBPACK_IMPORTED_MODULE_6__["default"])(source),
  121865. methodNames = Object(_baseFunctions_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source, props);
  121866. var chain = !(Object(_isObject_js__WEBPACK_IMPORTED_MODULE_5__["default"])(options) && 'chain' in options) || !!options.chain,
  121867. isFunc = Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object);
  121868. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(methodNames, function(methodName) {
  121869. var func = source[methodName];
  121870. object[methodName] = func;
  121871. if (isFunc) {
  121872. object.prototype[methodName] = function() {
  121873. var chainAll = this.__chain__;
  121874. if (chain || chainAll) {
  121875. var result = object(this.__wrapped__),
  121876. actions = result.__actions__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this.__actions__);
  121877. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  121878. result.__chain__ = chainAll;
  121879. return result;
  121880. }
  121881. return func.apply(object, Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_1__["default"])([this.value()], arguments));
  121882. };
  121883. }
  121884. });
  121885. return object;
  121886. }
  121887. /* harmony default export */ __webpack_exports__["default"] = (mixin);
  121888. /***/ }),
  121889. /***/ "./node_modules/lodash-es/multiply.js":
  121890. /*!********************************************!*\
  121891. !*** ./node_modules/lodash-es/multiply.js ***!
  121892. \********************************************/
  121893. /*! exports provided: default */
  121894. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121895. "use strict";
  121896. __webpack_require__.r(__webpack_exports__);
  121897. /* harmony import */ var _createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createMathOperation.js */ "./node_modules/lodash-es/_createMathOperation.js");
  121898. /**
  121899. * Multiply two numbers.
  121900. *
  121901. * @static
  121902. * @memberOf _
  121903. * @since 4.7.0
  121904. * @category Math
  121905. * @param {number} multiplier The first number in a multiplication.
  121906. * @param {number} multiplicand The second number in a multiplication.
  121907. * @returns {number} Returns the product.
  121908. * @example
  121909. *
  121910. * _.multiply(6, 4);
  121911. * // => 24
  121912. */
  121913. var multiply = Object(_createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(multiplier, multiplicand) {
  121914. return multiplier * multiplicand;
  121915. }, 1);
  121916. /* harmony default export */ __webpack_exports__["default"] = (multiply);
  121917. /***/ }),
  121918. /***/ "./node_modules/lodash-es/negate.js":
  121919. /*!******************************************!*\
  121920. !*** ./node_modules/lodash-es/negate.js ***!
  121921. \******************************************/
  121922. /*! exports provided: default */
  121923. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121924. "use strict";
  121925. __webpack_require__.r(__webpack_exports__);
  121926. /** Error message constants. */
  121927. var FUNC_ERROR_TEXT = 'Expected a function';
  121928. /**
  121929. * Creates a function that negates the result of the predicate `func`. The
  121930. * `func` predicate is invoked with the `this` binding and arguments of the
  121931. * created function.
  121932. *
  121933. * @static
  121934. * @memberOf _
  121935. * @since 3.0.0
  121936. * @category Function
  121937. * @param {Function} predicate The predicate to negate.
  121938. * @returns {Function} Returns the new negated function.
  121939. * @example
  121940. *
  121941. * function isEven(n) {
  121942. * return n % 2 == 0;
  121943. * }
  121944. *
  121945. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  121946. * // => [1, 3, 5]
  121947. */
  121948. function negate(predicate) {
  121949. if (typeof predicate != 'function') {
  121950. throw new TypeError(FUNC_ERROR_TEXT);
  121951. }
  121952. return function() {
  121953. var args = arguments;
  121954. switch (args.length) {
  121955. case 0: return !predicate.call(this);
  121956. case 1: return !predicate.call(this, args[0]);
  121957. case 2: return !predicate.call(this, args[0], args[1]);
  121958. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  121959. }
  121960. return !predicate.apply(this, args);
  121961. };
  121962. }
  121963. /* harmony default export */ __webpack_exports__["default"] = (negate);
  121964. /***/ }),
  121965. /***/ "./node_modules/lodash-es/next.js":
  121966. /*!****************************************!*\
  121967. !*** ./node_modules/lodash-es/next.js ***!
  121968. \****************************************/
  121969. /*! exports provided: default */
  121970. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121971. "use strict";
  121972. __webpack_require__.r(__webpack_exports__);
  121973. /* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/lodash-es/toArray.js");
  121974. /**
  121975. * Gets the next value on a wrapped object following the
  121976. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  121977. *
  121978. * @name next
  121979. * @memberOf _
  121980. * @since 4.0.0
  121981. * @category Seq
  121982. * @returns {Object} Returns the next iterator value.
  121983. * @example
  121984. *
  121985. * var wrapped = _([1, 2]);
  121986. *
  121987. * wrapped.next();
  121988. * // => { 'done': false, 'value': 1 }
  121989. *
  121990. * wrapped.next();
  121991. * // => { 'done': false, 'value': 2 }
  121992. *
  121993. * wrapped.next();
  121994. * // => { 'done': true, 'value': undefined }
  121995. */
  121996. function wrapperNext() {
  121997. if (this.__values__ === undefined) {
  121998. this.__values__ = Object(_toArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.value());
  121999. }
  122000. var done = this.__index__ >= this.__values__.length,
  122001. value = done ? undefined : this.__values__[this.__index__++];
  122002. return { 'done': done, 'value': value };
  122003. }
  122004. /* harmony default export */ __webpack_exports__["default"] = (wrapperNext);
  122005. /***/ }),
  122006. /***/ "./node_modules/lodash-es/noop.js":
  122007. /*!****************************************!*\
  122008. !*** ./node_modules/lodash-es/noop.js ***!
  122009. \****************************************/
  122010. /*! exports provided: default */
  122011. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122012. "use strict";
  122013. __webpack_require__.r(__webpack_exports__);
  122014. /**
  122015. * This method returns `undefined`.
  122016. *
  122017. * @static
  122018. * @memberOf _
  122019. * @since 2.3.0
  122020. * @category Util
  122021. * @example
  122022. *
  122023. * _.times(2, _.noop);
  122024. * // => [undefined, undefined]
  122025. */
  122026. function noop() {
  122027. // No operation performed.
  122028. }
  122029. /* harmony default export */ __webpack_exports__["default"] = (noop);
  122030. /***/ }),
  122031. /***/ "./node_modules/lodash-es/now.js":
  122032. /*!***************************************!*\
  122033. !*** ./node_modules/lodash-es/now.js ***!
  122034. \***************************************/
  122035. /*! exports provided: default */
  122036. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122037. "use strict";
  122038. __webpack_require__.r(__webpack_exports__);
  122039. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  122040. /**
  122041. * Gets the timestamp of the number of milliseconds that have elapsed since
  122042. * the Unix epoch (1 January 1970 00:00:00 UTC).
  122043. *
  122044. * @static
  122045. * @memberOf _
  122046. * @since 2.4.0
  122047. * @category Date
  122048. * @returns {number} Returns the timestamp.
  122049. * @example
  122050. *
  122051. * _.defer(function(stamp) {
  122052. * console.log(_.now() - stamp);
  122053. * }, _.now());
  122054. * // => Logs the number of milliseconds it took for the deferred invocation.
  122055. */
  122056. var now = function() {
  122057. return _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Date.now();
  122058. };
  122059. /* harmony default export */ __webpack_exports__["default"] = (now);
  122060. /***/ }),
  122061. /***/ "./node_modules/lodash-es/nth.js":
  122062. /*!***************************************!*\
  122063. !*** ./node_modules/lodash-es/nth.js ***!
  122064. \***************************************/
  122065. /*! exports provided: default */
  122066. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122067. "use strict";
  122068. __webpack_require__.r(__webpack_exports__);
  122069. /* harmony import */ var _baseNth_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseNth.js */ "./node_modules/lodash-es/_baseNth.js");
  122070. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  122071. /**
  122072. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  122073. * element from the end is returned.
  122074. *
  122075. * @static
  122076. * @memberOf _
  122077. * @since 4.11.0
  122078. * @category Array
  122079. * @param {Array} array The array to query.
  122080. * @param {number} [n=0] The index of the element to return.
  122081. * @returns {*} Returns the nth element of `array`.
  122082. * @example
  122083. *
  122084. * var array = ['a', 'b', 'c', 'd'];
  122085. *
  122086. * _.nth(array, 1);
  122087. * // => 'b'
  122088. *
  122089. * _.nth(array, -2);
  122090. * // => 'c';
  122091. */
  122092. function nth(array, n) {
  122093. return (array && array.length) ? Object(_baseNth_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n)) : undefined;
  122094. }
  122095. /* harmony default export */ __webpack_exports__["default"] = (nth);
  122096. /***/ }),
  122097. /***/ "./node_modules/lodash-es/nthArg.js":
  122098. /*!******************************************!*\
  122099. !*** ./node_modules/lodash-es/nthArg.js ***!
  122100. \******************************************/
  122101. /*! exports provided: default */
  122102. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122103. "use strict";
  122104. __webpack_require__.r(__webpack_exports__);
  122105. /* harmony import */ var _baseNth_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseNth.js */ "./node_modules/lodash-es/_baseNth.js");
  122106. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  122107. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  122108. /**
  122109. * Creates a function that gets the argument at index `n`. If `n` is negative,
  122110. * the nth argument from the end is returned.
  122111. *
  122112. * @static
  122113. * @memberOf _
  122114. * @since 4.0.0
  122115. * @category Util
  122116. * @param {number} [n=0] The index of the argument to return.
  122117. * @returns {Function} Returns the new pass-thru function.
  122118. * @example
  122119. *
  122120. * var func = _.nthArg(1);
  122121. * func('a', 'b', 'c', 'd');
  122122. * // => 'b'
  122123. *
  122124. * var func = _.nthArg(-2);
  122125. * func('a', 'b', 'c', 'd');
  122126. * // => 'c'
  122127. */
  122128. function nthArg(n) {
  122129. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(n);
  122130. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(args) {
  122131. return Object(_baseNth_js__WEBPACK_IMPORTED_MODULE_0__["default"])(args, n);
  122132. });
  122133. }
  122134. /* harmony default export */ __webpack_exports__["default"] = (nthArg);
  122135. /***/ }),
  122136. /***/ "./node_modules/lodash-es/number.default.js":
  122137. /*!**************************************************!*\
  122138. !*** ./node_modules/lodash-es/number.default.js ***!
  122139. \**************************************************/
  122140. /*! exports provided: default */
  122141. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122142. "use strict";
  122143. __webpack_require__.r(__webpack_exports__);
  122144. /* harmony import */ var _clamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clamp.js */ "./node_modules/lodash-es/clamp.js");
  122145. /* harmony import */ var _inRange_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inRange.js */ "./node_modules/lodash-es/inRange.js");
  122146. /* harmony import */ var _random_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./random.js */ "./node_modules/lodash-es/random.js");
  122147. /* harmony default export */ __webpack_exports__["default"] = ({
  122148. clamp: _clamp_js__WEBPACK_IMPORTED_MODULE_0__["default"], inRange: _inRange_js__WEBPACK_IMPORTED_MODULE_1__["default"], random: _random_js__WEBPACK_IMPORTED_MODULE_2__["default"]
  122149. });
  122150. /***/ }),
  122151. /***/ "./node_modules/lodash-es/number.js":
  122152. /*!******************************************!*\
  122153. !*** ./node_modules/lodash-es/number.js ***!
  122154. \******************************************/
  122155. /*! exports provided: clamp, inRange, random, default */
  122156. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122157. "use strict";
  122158. __webpack_require__.r(__webpack_exports__);
  122159. /* harmony import */ var _clamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clamp.js */ "./node_modules/lodash-es/clamp.js");
  122160. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return _clamp_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  122161. /* harmony import */ var _inRange_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inRange.js */ "./node_modules/lodash-es/inRange.js");
  122162. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "inRange", function() { return _inRange_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  122163. /* harmony import */ var _random_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./random.js */ "./node_modules/lodash-es/random.js");
  122164. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "random", function() { return _random_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  122165. /* harmony import */ var _number_default_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./number.default.js */ "./node_modules/lodash-es/number.default.js");
  122166. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _number_default_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  122167. /***/ }),
  122168. /***/ "./node_modules/lodash-es/object.default.js":
  122169. /*!**************************************************!*\
  122170. !*** ./node_modules/lodash-es/object.default.js ***!
  122171. \**************************************************/
  122172. /*! exports provided: default */
  122173. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122174. "use strict";
  122175. __webpack_require__.r(__webpack_exports__);
  122176. /* harmony import */ var _assign_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assign.js */ "./node_modules/lodash-es/assign.js");
  122177. /* harmony import */ var _assignIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assignIn.js */ "./node_modules/lodash-es/assignIn.js");
  122178. /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
  122179. /* harmony import */ var _assignWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./assignWith.js */ "./node_modules/lodash-es/assignWith.js");
  122180. /* harmony import */ var _at_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./at.js */ "./node_modules/lodash-es/at.js");
  122181. /* harmony import */ var _create_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./create.js */ "./node_modules/lodash-es/create.js");
  122182. /* harmony import */ var _defaults_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./defaults.js */ "./node_modules/lodash-es/defaults.js");
  122183. /* harmony import */ var _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./defaultsDeep.js */ "./node_modules/lodash-es/defaultsDeep.js");
  122184. /* harmony import */ var _entries_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./entries.js */ "./node_modules/lodash-es/entries.js");
  122185. /* harmony import */ var _entriesIn_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./entriesIn.js */ "./node_modules/lodash-es/entriesIn.js");
  122186. /* harmony import */ var _extend_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./extend.js */ "./node_modules/lodash-es/extend.js");
  122187. /* harmony import */ var _extendWith_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./extendWith.js */ "./node_modules/lodash-es/extendWith.js");
  122188. /* harmony import */ var _findKey_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./findKey.js */ "./node_modules/lodash-es/findKey.js");
  122189. /* harmony import */ var _findLastKey_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./findLastKey.js */ "./node_modules/lodash-es/findLastKey.js");
  122190. /* harmony import */ var _forIn_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./forIn.js */ "./node_modules/lodash-es/forIn.js");
  122191. /* harmony import */ var _forInRight_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./forInRight.js */ "./node_modules/lodash-es/forInRight.js");
  122192. /* harmony import */ var _forOwn_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./forOwn.js */ "./node_modules/lodash-es/forOwn.js");
  122193. /* harmony import */ var _forOwnRight_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./forOwnRight.js */ "./node_modules/lodash-es/forOwnRight.js");
  122194. /* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./functions.js */ "./node_modules/lodash-es/functions.js");
  122195. /* harmony import */ var _functionsIn_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./functionsIn.js */ "./node_modules/lodash-es/functionsIn.js");
  122196. /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
  122197. /* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./has.js */ "./node_modules/lodash-es/has.js");
  122198. /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
  122199. /* harmony import */ var _invert_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./invert.js */ "./node_modules/lodash-es/invert.js");
  122200. /* harmony import */ var _invertBy_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./invertBy.js */ "./node_modules/lodash-es/invertBy.js");
  122201. /* harmony import */ var _invoke_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./invoke.js */ "./node_modules/lodash-es/invoke.js");
  122202. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  122203. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  122204. /* harmony import */ var _mapKeys_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./mapKeys.js */ "./node_modules/lodash-es/mapKeys.js");
  122205. /* harmony import */ var _mapValues_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./mapValues.js */ "./node_modules/lodash-es/mapValues.js");
  122206. /* harmony import */ var _merge_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./merge.js */ "./node_modules/lodash-es/merge.js");
  122207. /* harmony import */ var _mergeWith_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./mergeWith.js */ "./node_modules/lodash-es/mergeWith.js");
  122208. /* harmony import */ var _omit_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./omit.js */ "./node_modules/lodash-es/omit.js");
  122209. /* harmony import */ var _omitBy_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./omitBy.js */ "./node_modules/lodash-es/omitBy.js");
  122210. /* harmony import */ var _pick_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./pick.js */ "./node_modules/lodash-es/pick.js");
  122211. /* harmony import */ var _pickBy_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./pickBy.js */ "./node_modules/lodash-es/pickBy.js");
  122212. /* harmony import */ var _result_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./result.js */ "./node_modules/lodash-es/result.js");
  122213. /* harmony import */ var _set_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./set.js */ "./node_modules/lodash-es/set.js");
  122214. /* harmony import */ var _setWith_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./setWith.js */ "./node_modules/lodash-es/setWith.js");
  122215. /* harmony import */ var _toPairs_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./toPairs.js */ "./node_modules/lodash-es/toPairs.js");
  122216. /* harmony import */ var _toPairsIn_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./toPairsIn.js */ "./node_modules/lodash-es/toPairsIn.js");
  122217. /* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./transform.js */ "./node_modules/lodash-es/transform.js");
  122218. /* harmony import */ var _unset_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./unset.js */ "./node_modules/lodash-es/unset.js");
  122219. /* harmony import */ var _update_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./update.js */ "./node_modules/lodash-es/update.js");
  122220. /* harmony import */ var _updateWith_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./updateWith.js */ "./node_modules/lodash-es/updateWith.js");
  122221. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  122222. /* harmony import */ var _valuesIn_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./valuesIn.js */ "./node_modules/lodash-es/valuesIn.js");
  122223. /* harmony default export */ __webpack_exports__["default"] = ({
  122224. assign: _assign_js__WEBPACK_IMPORTED_MODULE_0__["default"], assignIn: _assignIn_js__WEBPACK_IMPORTED_MODULE_1__["default"], assignInWith: _assignInWith_js__WEBPACK_IMPORTED_MODULE_2__["default"], assignWith: _assignWith_js__WEBPACK_IMPORTED_MODULE_3__["default"], at: _at_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  122225. create: _create_js__WEBPACK_IMPORTED_MODULE_5__["default"], defaults: _defaults_js__WEBPACK_IMPORTED_MODULE_6__["default"], defaultsDeep: _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_7__["default"], entries: _entries_js__WEBPACK_IMPORTED_MODULE_8__["default"], entriesIn: _entriesIn_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  122226. extend: _extend_js__WEBPACK_IMPORTED_MODULE_10__["default"], extendWith: _extendWith_js__WEBPACK_IMPORTED_MODULE_11__["default"], findKey: _findKey_js__WEBPACK_IMPORTED_MODULE_12__["default"], findLastKey: _findLastKey_js__WEBPACK_IMPORTED_MODULE_13__["default"], forIn: _forIn_js__WEBPACK_IMPORTED_MODULE_14__["default"],
  122227. forInRight: _forInRight_js__WEBPACK_IMPORTED_MODULE_15__["default"], forOwn: _forOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"], forOwnRight: _forOwnRight_js__WEBPACK_IMPORTED_MODULE_17__["default"], functions: _functions_js__WEBPACK_IMPORTED_MODULE_18__["default"], functionsIn: _functionsIn_js__WEBPACK_IMPORTED_MODULE_19__["default"],
  122228. get: _get_js__WEBPACK_IMPORTED_MODULE_20__["default"], has: _has_js__WEBPACK_IMPORTED_MODULE_21__["default"], hasIn: _hasIn_js__WEBPACK_IMPORTED_MODULE_22__["default"], invert: _invert_js__WEBPACK_IMPORTED_MODULE_23__["default"], invertBy: _invertBy_js__WEBPACK_IMPORTED_MODULE_24__["default"],
  122229. invoke: _invoke_js__WEBPACK_IMPORTED_MODULE_25__["default"], keys: _keys_js__WEBPACK_IMPORTED_MODULE_26__["default"], keysIn: _keysIn_js__WEBPACK_IMPORTED_MODULE_27__["default"], mapKeys: _mapKeys_js__WEBPACK_IMPORTED_MODULE_28__["default"], mapValues: _mapValues_js__WEBPACK_IMPORTED_MODULE_29__["default"],
  122230. merge: _merge_js__WEBPACK_IMPORTED_MODULE_30__["default"], mergeWith: _mergeWith_js__WEBPACK_IMPORTED_MODULE_31__["default"], omit: _omit_js__WEBPACK_IMPORTED_MODULE_32__["default"], omitBy: _omitBy_js__WEBPACK_IMPORTED_MODULE_33__["default"], pick: _pick_js__WEBPACK_IMPORTED_MODULE_34__["default"],
  122231. pickBy: _pickBy_js__WEBPACK_IMPORTED_MODULE_35__["default"], result: _result_js__WEBPACK_IMPORTED_MODULE_36__["default"], set: _set_js__WEBPACK_IMPORTED_MODULE_37__["default"], setWith: _setWith_js__WEBPACK_IMPORTED_MODULE_38__["default"], toPairs: _toPairs_js__WEBPACK_IMPORTED_MODULE_39__["default"],
  122232. toPairsIn: _toPairsIn_js__WEBPACK_IMPORTED_MODULE_40__["default"], transform: _transform_js__WEBPACK_IMPORTED_MODULE_41__["default"], unset: _unset_js__WEBPACK_IMPORTED_MODULE_42__["default"], update: _update_js__WEBPACK_IMPORTED_MODULE_43__["default"], updateWith: _updateWith_js__WEBPACK_IMPORTED_MODULE_44__["default"],
  122233. values: _values_js__WEBPACK_IMPORTED_MODULE_45__["default"], valuesIn: _valuesIn_js__WEBPACK_IMPORTED_MODULE_46__["default"]
  122234. });
  122235. /***/ }),
  122236. /***/ "./node_modules/lodash-es/object.js":
  122237. /*!******************************************!*\
  122238. !*** ./node_modules/lodash-es/object.js ***!
  122239. \******************************************/
  122240. /*! exports provided: assign, assignIn, assignInWith, assignWith, at, create, defaults, defaultsDeep, entries, entriesIn, extend, extendWith, findKey, findLastKey, forIn, forInRight, forOwn, forOwnRight, functions, functionsIn, get, has, hasIn, invert, invertBy, invoke, keys, keysIn, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, result, set, setWith, toPairs, toPairsIn, transform, unset, update, updateWith, values, valuesIn, default */
  122241. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122242. "use strict";
  122243. __webpack_require__.r(__webpack_exports__);
  122244. /* harmony import */ var _assign_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assign.js */ "./node_modules/lodash-es/assign.js");
  122245. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return _assign_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  122246. /* harmony import */ var _assignIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assignIn.js */ "./node_modules/lodash-es/assignIn.js");
  122247. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignIn", function() { return _assignIn_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  122248. /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
  122249. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignInWith", function() { return _assignInWith_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  122250. /* harmony import */ var _assignWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./assignWith.js */ "./node_modules/lodash-es/assignWith.js");
  122251. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignWith", function() { return _assignWith_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  122252. /* harmony import */ var _at_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./at.js */ "./node_modules/lodash-es/at.js");
  122253. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "at", function() { return _at_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  122254. /* harmony import */ var _create_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./create.js */ "./node_modules/lodash-es/create.js");
  122255. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "create", function() { return _create_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  122256. /* harmony import */ var _defaults_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./defaults.js */ "./node_modules/lodash-es/defaults.js");
  122257. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return _defaults_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  122258. /* harmony import */ var _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./defaultsDeep.js */ "./node_modules/lodash-es/defaultsDeep.js");
  122259. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultsDeep", function() { return _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  122260. /* harmony import */ var _entries_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./entries.js */ "./node_modules/lodash-es/entries.js");
  122261. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entries", function() { return _entries_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  122262. /* harmony import */ var _entriesIn_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./entriesIn.js */ "./node_modules/lodash-es/entriesIn.js");
  122263. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entriesIn", function() { return _entriesIn_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  122264. /* harmony import */ var _extend_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./extend.js */ "./node_modules/lodash-es/extend.js");
  122265. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return _extend_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  122266. /* harmony import */ var _extendWith_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./extendWith.js */ "./node_modules/lodash-es/extendWith.js");
  122267. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extendWith", function() { return _extendWith_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  122268. /* harmony import */ var _findKey_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./findKey.js */ "./node_modules/lodash-es/findKey.js");
  122269. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return _findKey_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  122270. /* harmony import */ var _findLastKey_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./findLastKey.js */ "./node_modules/lodash-es/findLastKey.js");
  122271. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLastKey", function() { return _findLastKey_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  122272. /* harmony import */ var _forIn_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./forIn.js */ "./node_modules/lodash-es/forIn.js");
  122273. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forIn", function() { return _forIn_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  122274. /* harmony import */ var _forInRight_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./forInRight.js */ "./node_modules/lodash-es/forInRight.js");
  122275. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forInRight", function() { return _forInRight_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  122276. /* harmony import */ var _forOwn_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./forOwn.js */ "./node_modules/lodash-es/forOwn.js");
  122277. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forOwn", function() { return _forOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  122278. /* harmony import */ var _forOwnRight_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./forOwnRight.js */ "./node_modules/lodash-es/forOwnRight.js");
  122279. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forOwnRight", function() { return _forOwnRight_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  122280. /* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./functions.js */ "./node_modules/lodash-es/functions.js");
  122281. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return _functions_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  122282. /* harmony import */ var _functionsIn_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./functionsIn.js */ "./node_modules/lodash-es/functionsIn.js");
  122283. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "functionsIn", function() { return _functionsIn_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  122284. /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
  122285. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "get", function() { return _get_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  122286. /* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./has.js */ "./node_modules/lodash-es/has.js");
  122287. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "has", function() { return _has_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  122288. /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
  122289. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hasIn", function() { return _hasIn_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  122290. /* harmony import */ var _invert_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./invert.js */ "./node_modules/lodash-es/invert.js");
  122291. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return _invert_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  122292. /* harmony import */ var _invertBy_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./invertBy.js */ "./node_modules/lodash-es/invertBy.js");
  122293. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invertBy", function() { return _invertBy_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  122294. /* harmony import */ var _invoke_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./invoke.js */ "./node_modules/lodash-es/invoke.js");
  122295. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return _invoke_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  122296. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  122297. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return _keys_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  122298. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  122299. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keysIn", function() { return _keysIn_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  122300. /* harmony import */ var _mapKeys_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./mapKeys.js */ "./node_modules/lodash-es/mapKeys.js");
  122301. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapKeys", function() { return _mapKeys_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  122302. /* harmony import */ var _mapValues_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./mapValues.js */ "./node_modules/lodash-es/mapValues.js");
  122303. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapValues", function() { return _mapValues_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  122304. /* harmony import */ var _merge_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./merge.js */ "./node_modules/lodash-es/merge.js");
  122305. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _merge_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  122306. /* harmony import */ var _mergeWith_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./mergeWith.js */ "./node_modules/lodash-es/mergeWith.js");
  122307. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeWith", function() { return _mergeWith_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  122308. /* harmony import */ var _omit_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./omit.js */ "./node_modules/lodash-es/omit.js");
  122309. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return _omit_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  122310. /* harmony import */ var _omitBy_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./omitBy.js */ "./node_modules/lodash-es/omitBy.js");
  122311. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "omitBy", function() { return _omitBy_js__WEBPACK_IMPORTED_MODULE_33__["default"]; });
  122312. /* harmony import */ var _pick_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./pick.js */ "./node_modules/lodash-es/pick.js");
  122313. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return _pick_js__WEBPACK_IMPORTED_MODULE_34__["default"]; });
  122314. /* harmony import */ var _pickBy_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./pickBy.js */ "./node_modules/lodash-es/pickBy.js");
  122315. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pickBy", function() { return _pickBy_js__WEBPACK_IMPORTED_MODULE_35__["default"]; });
  122316. /* harmony import */ var _result_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./result.js */ "./node_modules/lodash-es/result.js");
  122317. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "result", function() { return _result_js__WEBPACK_IMPORTED_MODULE_36__["default"]; });
  122318. /* harmony import */ var _set_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./set.js */ "./node_modules/lodash-es/set.js");
  122319. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "set", function() { return _set_js__WEBPACK_IMPORTED_MODULE_37__["default"]; });
  122320. /* harmony import */ var _setWith_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./setWith.js */ "./node_modules/lodash-es/setWith.js");
  122321. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setWith", function() { return _setWith_js__WEBPACK_IMPORTED_MODULE_38__["default"]; });
  122322. /* harmony import */ var _toPairs_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./toPairs.js */ "./node_modules/lodash-es/toPairs.js");
  122323. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPairs", function() { return _toPairs_js__WEBPACK_IMPORTED_MODULE_39__["default"]; });
  122324. /* harmony import */ var _toPairsIn_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./toPairsIn.js */ "./node_modules/lodash-es/toPairsIn.js");
  122325. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPairsIn", function() { return _toPairsIn_js__WEBPACK_IMPORTED_MODULE_40__["default"]; });
  122326. /* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./transform.js */ "./node_modules/lodash-es/transform.js");
  122327. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transform", function() { return _transform_js__WEBPACK_IMPORTED_MODULE_41__["default"]; });
  122328. /* harmony import */ var _unset_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./unset.js */ "./node_modules/lodash-es/unset.js");
  122329. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unset", function() { return _unset_js__WEBPACK_IMPORTED_MODULE_42__["default"]; });
  122330. /* harmony import */ var _update_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./update.js */ "./node_modules/lodash-es/update.js");
  122331. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "update", function() { return _update_js__WEBPACK_IMPORTED_MODULE_43__["default"]; });
  122332. /* harmony import */ var _updateWith_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./updateWith.js */ "./node_modules/lodash-es/updateWith.js");
  122333. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "updateWith", function() { return _updateWith_js__WEBPACK_IMPORTED_MODULE_44__["default"]; });
  122334. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  122335. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "values", function() { return _values_js__WEBPACK_IMPORTED_MODULE_45__["default"]; });
  122336. /* harmony import */ var _valuesIn_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./valuesIn.js */ "./node_modules/lodash-es/valuesIn.js");
  122337. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valuesIn", function() { return _valuesIn_js__WEBPACK_IMPORTED_MODULE_46__["default"]; });
  122338. /* harmony import */ var _object_default_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./object.default.js */ "./node_modules/lodash-es/object.default.js");
  122339. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _object_default_js__WEBPACK_IMPORTED_MODULE_47__["default"]; });
  122340. /***/ }),
  122341. /***/ "./node_modules/lodash-es/omit.js":
  122342. /*!****************************************!*\
  122343. !*** ./node_modules/lodash-es/omit.js ***!
  122344. \****************************************/
  122345. /*! exports provided: default */
  122346. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122347. "use strict";
  122348. __webpack_require__.r(__webpack_exports__);
  122349. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  122350. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  122351. /* harmony import */ var _baseUnset_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseUnset.js */ "./node_modules/lodash-es/_baseUnset.js");
  122352. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  122353. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  122354. /* harmony import */ var _customOmitClone_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_customOmitClone.js */ "./node_modules/lodash-es/_customOmitClone.js");
  122355. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  122356. /* harmony import */ var _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_getAllKeysIn.js */ "./node_modules/lodash-es/_getAllKeysIn.js");
  122357. /** Used to compose bitmasks for cloning. */
  122358. var CLONE_DEEP_FLAG = 1,
  122359. CLONE_FLAT_FLAG = 2,
  122360. CLONE_SYMBOLS_FLAG = 4;
  122361. /**
  122362. * The opposite of `_.pick`; this method creates an object composed of the
  122363. * own and inherited enumerable property paths of `object` that are not omitted.
  122364. *
  122365. * **Note:** This method is considerably slower than `_.pick`.
  122366. *
  122367. * @static
  122368. * @since 0.1.0
  122369. * @memberOf _
  122370. * @category Object
  122371. * @param {Object} object The source object.
  122372. * @param {...(string|string[])} [paths] The property paths to omit.
  122373. * @returns {Object} Returns the new object.
  122374. * @example
  122375. *
  122376. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  122377. *
  122378. * _.omit(object, ['a', 'c']);
  122379. * // => { 'b': '2' }
  122380. */
  122381. var omit = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_6__["default"])(function(object, paths) {
  122382. var result = {};
  122383. if (object == null) {
  122384. return result;
  122385. }
  122386. var isDeep = false;
  122387. paths = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(paths, function(path) {
  122388. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_3__["default"])(path, object);
  122389. isDeep || (isDeep = path.length > 1);
  122390. return path;
  122391. });
  122392. Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object, Object(_getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_7__["default"])(object), result);
  122393. if (isDeep) {
  122394. result = Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, _customOmitClone_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
  122395. }
  122396. var length = paths.length;
  122397. while (length--) {
  122398. Object(_baseUnset_js__WEBPACK_IMPORTED_MODULE_2__["default"])(result, paths[length]);
  122399. }
  122400. return result;
  122401. });
  122402. /* harmony default export */ __webpack_exports__["default"] = (omit);
  122403. /***/ }),
  122404. /***/ "./node_modules/lodash-es/omitBy.js":
  122405. /*!******************************************!*\
  122406. !*** ./node_modules/lodash-es/omitBy.js ***!
  122407. \******************************************/
  122408. /*! exports provided: default */
  122409. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122410. "use strict";
  122411. __webpack_require__.r(__webpack_exports__);
  122412. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  122413. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  122414. /* harmony import */ var _pickBy_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pickBy.js */ "./node_modules/lodash-es/pickBy.js");
  122415. /**
  122416. * The opposite of `_.pickBy`; this method creates an object composed of
  122417. * the own and inherited enumerable string keyed properties of `object` that
  122418. * `predicate` doesn't return truthy for. The predicate is invoked with two
  122419. * arguments: (value, key).
  122420. *
  122421. * @static
  122422. * @memberOf _
  122423. * @since 4.0.0
  122424. * @category Object
  122425. * @param {Object} object The source object.
  122426. * @param {Function} [predicate=_.identity] The function invoked per property.
  122427. * @returns {Object} Returns the new object.
  122428. * @example
  122429. *
  122430. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  122431. *
  122432. * _.omitBy(object, _.isNumber);
  122433. * // => { 'b': '2' }
  122434. */
  122435. function omitBy(object, predicate) {
  122436. return Object(_pickBy_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, Object(_negate_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate)));
  122437. }
  122438. /* harmony default export */ __webpack_exports__["default"] = (omitBy);
  122439. /***/ }),
  122440. /***/ "./node_modules/lodash-es/once.js":
  122441. /*!****************************************!*\
  122442. !*** ./node_modules/lodash-es/once.js ***!
  122443. \****************************************/
  122444. /*! exports provided: default */
  122445. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122446. "use strict";
  122447. __webpack_require__.r(__webpack_exports__);
  122448. /* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./before.js */ "./node_modules/lodash-es/before.js");
  122449. /**
  122450. * Creates a function that is restricted to invoking `func` once. Repeat calls
  122451. * to the function return the value of the first invocation. The `func` is
  122452. * invoked with the `this` binding and arguments of the created function.
  122453. *
  122454. * @static
  122455. * @memberOf _
  122456. * @since 0.1.0
  122457. * @category Function
  122458. * @param {Function} func The function to restrict.
  122459. * @returns {Function} Returns the new restricted function.
  122460. * @example
  122461. *
  122462. * var initialize = _.once(createApplication);
  122463. * initialize();
  122464. * initialize();
  122465. * // => `createApplication` is invoked once
  122466. */
  122467. function once(func) {
  122468. return Object(_before_js__WEBPACK_IMPORTED_MODULE_0__["default"])(2, func);
  122469. }
  122470. /* harmony default export */ __webpack_exports__["default"] = (once);
  122471. /***/ }),
  122472. /***/ "./node_modules/lodash-es/orderBy.js":
  122473. /*!*******************************************!*\
  122474. !*** ./node_modules/lodash-es/orderBy.js ***!
  122475. \*******************************************/
  122476. /*! exports provided: default */
  122477. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122478. "use strict";
  122479. __webpack_require__.r(__webpack_exports__);
  122480. /* harmony import */ var _baseOrderBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseOrderBy.js */ "./node_modules/lodash-es/_baseOrderBy.js");
  122481. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  122482. /**
  122483. * This method is like `_.sortBy` except that it allows specifying the sort
  122484. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  122485. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  122486. * descending or "asc" for ascending sort order of corresponding values.
  122487. *
  122488. * @static
  122489. * @memberOf _
  122490. * @since 4.0.0
  122491. * @category Collection
  122492. * @param {Array|Object} collection The collection to iterate over.
  122493. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  122494. * The iteratees to sort by.
  122495. * @param {string[]} [orders] The sort orders of `iteratees`.
  122496. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  122497. * @returns {Array} Returns the new sorted array.
  122498. * @example
  122499. *
  122500. * var users = [
  122501. * { 'user': 'fred', 'age': 48 },
  122502. * { 'user': 'barney', 'age': 34 },
  122503. * { 'user': 'fred', 'age': 40 },
  122504. * { 'user': 'barney', 'age': 36 }
  122505. * ];
  122506. *
  122507. * // Sort by `user` in ascending order and by `age` in descending order.
  122508. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  122509. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  122510. */
  122511. function orderBy(collection, iteratees, orders, guard) {
  122512. if (collection == null) {
  122513. return [];
  122514. }
  122515. if (!Object(_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratees)) {
  122516. iteratees = iteratees == null ? [] : [iteratees];
  122517. }
  122518. orders = guard ? undefined : orders;
  122519. if (!Object(_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(orders)) {
  122520. orders = orders == null ? [] : [orders];
  122521. }
  122522. return Object(_baseOrderBy_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, iteratees, orders);
  122523. }
  122524. /* harmony default export */ __webpack_exports__["default"] = (orderBy);
  122525. /***/ }),
  122526. /***/ "./node_modules/lodash-es/over.js":
  122527. /*!****************************************!*\
  122528. !*** ./node_modules/lodash-es/over.js ***!
  122529. \****************************************/
  122530. /*! exports provided: default */
  122531. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122532. "use strict";
  122533. __webpack_require__.r(__webpack_exports__);
  122534. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  122535. /* harmony import */ var _createOver_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createOver.js */ "./node_modules/lodash-es/_createOver.js");
  122536. /**
  122537. * Creates a function that invokes `iteratees` with the arguments it receives
  122538. * and returns their results.
  122539. *
  122540. * @static
  122541. * @memberOf _
  122542. * @since 4.0.0
  122543. * @category Util
  122544. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  122545. * The iteratees to invoke.
  122546. * @returns {Function} Returns the new function.
  122547. * @example
  122548. *
  122549. * var func = _.over([Math.max, Math.min]);
  122550. *
  122551. * func(1, 2, 3, 4);
  122552. * // => [4, 1]
  122553. */
  122554. var over = Object(_createOver_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  122555. /* harmony default export */ __webpack_exports__["default"] = (over);
  122556. /***/ }),
  122557. /***/ "./node_modules/lodash-es/overArgs.js":
  122558. /*!********************************************!*\
  122559. !*** ./node_modules/lodash-es/overArgs.js ***!
  122560. \********************************************/
  122561. /*! exports provided: default */
  122562. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122563. "use strict";
  122564. __webpack_require__.r(__webpack_exports__);
  122565. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  122566. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  122567. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  122568. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  122569. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  122570. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  122571. /* harmony import */ var _castRest_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_castRest.js */ "./node_modules/lodash-es/_castRest.js");
  122572. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  122573. /* Built-in method references for those with the same name as other `lodash` methods. */
  122574. var nativeMin = Math.min;
  122575. /**
  122576. * Creates a function that invokes `func` with its arguments transformed.
  122577. *
  122578. * @static
  122579. * @since 4.0.0
  122580. * @memberOf _
  122581. * @category Function
  122582. * @param {Function} func The function to wrap.
  122583. * @param {...(Function|Function[])} [transforms=[_.identity]]
  122584. * The argument transforms.
  122585. * @returns {Function} Returns the new function.
  122586. * @example
  122587. *
  122588. * function doubled(n) {
  122589. * return n * 2;
  122590. * }
  122591. *
  122592. * function square(n) {
  122593. * return n * n;
  122594. * }
  122595. *
  122596. * var func = _.overArgs(function(x, y) {
  122597. * return [x, y];
  122598. * }, [square, doubled]);
  122599. *
  122600. * func(9, 3);
  122601. * // => [81, 6]
  122602. *
  122603. * func(10, 5);
  122604. * // => [100, 10]
  122605. */
  122606. var overArgs = Object(_castRest_js__WEBPACK_IMPORTED_MODULE_6__["default"])(function(func, transforms) {
  122607. transforms = (transforms.length == 1 && Object(_isArray_js__WEBPACK_IMPORTED_MODULE_7__["default"])(transforms[0]))
  122608. ? Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(transforms[0], Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__["default"]))
  122609. : Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_2__["default"])(transforms, 1), Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__["default"]));
  122610. var funcsLength = transforms.length;
  122611. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_4__["default"])(function(args) {
  122612. var index = -1,
  122613. length = nativeMin(args.length, funcsLength);
  122614. while (++index < length) {
  122615. args[index] = transforms[index].call(this, args[index]);
  122616. }
  122617. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, this, args);
  122618. });
  122619. });
  122620. /* harmony default export */ __webpack_exports__["default"] = (overArgs);
  122621. /***/ }),
  122622. /***/ "./node_modules/lodash-es/overEvery.js":
  122623. /*!*********************************************!*\
  122624. !*** ./node_modules/lodash-es/overEvery.js ***!
  122625. \*********************************************/
  122626. /*! exports provided: default */
  122627. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122628. "use strict";
  122629. __webpack_require__.r(__webpack_exports__);
  122630. /* harmony import */ var _arrayEvery_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEvery.js */ "./node_modules/lodash-es/_arrayEvery.js");
  122631. /* harmony import */ var _createOver_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createOver.js */ "./node_modules/lodash-es/_createOver.js");
  122632. /**
  122633. * Creates a function that checks if **all** of the `predicates` return
  122634. * truthy when invoked with the arguments it receives.
  122635. *
  122636. * Following shorthands are possible for providing predicates.
  122637. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  122638. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  122639. *
  122640. * @static
  122641. * @memberOf _
  122642. * @since 4.0.0
  122643. * @category Util
  122644. * @param {...(Function|Function[])} [predicates=[_.identity]]
  122645. * The predicates to check.
  122646. * @returns {Function} Returns the new function.
  122647. * @example
  122648. *
  122649. * var func = _.overEvery([Boolean, isFinite]);
  122650. *
  122651. * func('1');
  122652. * // => true
  122653. *
  122654. * func(null);
  122655. * // => false
  122656. *
  122657. * func(NaN);
  122658. * // => false
  122659. */
  122660. var overEvery = Object(_createOver_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_arrayEvery_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  122661. /* harmony default export */ __webpack_exports__["default"] = (overEvery);
  122662. /***/ }),
  122663. /***/ "./node_modules/lodash-es/overSome.js":
  122664. /*!********************************************!*\
  122665. !*** ./node_modules/lodash-es/overSome.js ***!
  122666. \********************************************/
  122667. /*! exports provided: default */
  122668. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122669. "use strict";
  122670. __webpack_require__.r(__webpack_exports__);
  122671. /* harmony import */ var _arraySome_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySome.js */ "./node_modules/lodash-es/_arraySome.js");
  122672. /* harmony import */ var _createOver_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createOver.js */ "./node_modules/lodash-es/_createOver.js");
  122673. /**
  122674. * Creates a function that checks if **any** of the `predicates` return
  122675. * truthy when invoked with the arguments it receives.
  122676. *
  122677. * Following shorthands are possible for providing predicates.
  122678. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  122679. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  122680. *
  122681. * @static
  122682. * @memberOf _
  122683. * @since 4.0.0
  122684. * @category Util
  122685. * @param {...(Function|Function[])} [predicates=[_.identity]]
  122686. * The predicates to check.
  122687. * @returns {Function} Returns the new function.
  122688. * @example
  122689. *
  122690. * var func = _.overSome([Boolean, isFinite]);
  122691. *
  122692. * func('1');
  122693. * // => true
  122694. *
  122695. * func(null);
  122696. * // => true
  122697. *
  122698. * func(NaN);
  122699. * // => false
  122700. *
  122701. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  122702. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  122703. */
  122704. var overSome = Object(_createOver_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_arraySome_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  122705. /* harmony default export */ __webpack_exports__["default"] = (overSome);
  122706. /***/ }),
  122707. /***/ "./node_modules/lodash-es/pad.js":
  122708. /*!***************************************!*\
  122709. !*** ./node_modules/lodash-es/pad.js ***!
  122710. \***************************************/
  122711. /*! exports provided: default */
  122712. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122713. "use strict";
  122714. __webpack_require__.r(__webpack_exports__);
  122715. /* harmony import */ var _createPadding_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createPadding.js */ "./node_modules/lodash-es/_createPadding.js");
  122716. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  122717. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  122718. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  122719. /* Built-in method references for those with the same name as other `lodash` methods. */
  122720. var nativeCeil = Math.ceil,
  122721. nativeFloor = Math.floor;
  122722. /**
  122723. * Pads `string` on the left and right sides if it's shorter than `length`.
  122724. * Padding characters are truncated if they can't be evenly divided by `length`.
  122725. *
  122726. * @static
  122727. * @memberOf _
  122728. * @since 3.0.0
  122729. * @category String
  122730. * @param {string} [string=''] The string to pad.
  122731. * @param {number} [length=0] The padding length.
  122732. * @param {string} [chars=' '] The string used as padding.
  122733. * @returns {string} Returns the padded string.
  122734. * @example
  122735. *
  122736. * _.pad('abc', 8);
  122737. * // => ' abc '
  122738. *
  122739. * _.pad('abc', 8, '_-');
  122740. * // => '_-abc_-_'
  122741. *
  122742. * _.pad('abc', 3);
  122743. * // => 'abc'
  122744. */
  122745. function pad(string, length, chars) {
  122746. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  122747. length = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(length);
  122748. var strLength = length ? Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string) : 0;
  122749. if (!length || strLength >= length) {
  122750. return string;
  122751. }
  122752. var mid = (length - strLength) / 2;
  122753. return (
  122754. Object(_createPadding_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nativeFloor(mid), chars) +
  122755. string +
  122756. Object(_createPadding_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nativeCeil(mid), chars)
  122757. );
  122758. }
  122759. /* harmony default export */ __webpack_exports__["default"] = (pad);
  122760. /***/ }),
  122761. /***/ "./node_modules/lodash-es/padEnd.js":
  122762. /*!******************************************!*\
  122763. !*** ./node_modules/lodash-es/padEnd.js ***!
  122764. \******************************************/
  122765. /*! exports provided: default */
  122766. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122767. "use strict";
  122768. __webpack_require__.r(__webpack_exports__);
  122769. /* harmony import */ var _createPadding_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createPadding.js */ "./node_modules/lodash-es/_createPadding.js");
  122770. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  122771. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  122772. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  122773. /**
  122774. * Pads `string` on the right side if it's shorter than `length`. Padding
  122775. * characters are truncated if they exceed `length`.
  122776. *
  122777. * @static
  122778. * @memberOf _
  122779. * @since 4.0.0
  122780. * @category String
  122781. * @param {string} [string=''] The string to pad.
  122782. * @param {number} [length=0] The padding length.
  122783. * @param {string} [chars=' '] The string used as padding.
  122784. * @returns {string} Returns the padded string.
  122785. * @example
  122786. *
  122787. * _.padEnd('abc', 6);
  122788. * // => 'abc '
  122789. *
  122790. * _.padEnd('abc', 6, '_-');
  122791. * // => 'abc_-_'
  122792. *
  122793. * _.padEnd('abc', 3);
  122794. * // => 'abc'
  122795. */
  122796. function padEnd(string, length, chars) {
  122797. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  122798. length = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(length);
  122799. var strLength = length ? Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string) : 0;
  122800. return (length && strLength < length)
  122801. ? (string + Object(_createPadding_js__WEBPACK_IMPORTED_MODULE_0__["default"])(length - strLength, chars))
  122802. : string;
  122803. }
  122804. /* harmony default export */ __webpack_exports__["default"] = (padEnd);
  122805. /***/ }),
  122806. /***/ "./node_modules/lodash-es/padStart.js":
  122807. /*!********************************************!*\
  122808. !*** ./node_modules/lodash-es/padStart.js ***!
  122809. \********************************************/
  122810. /*! exports provided: default */
  122811. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122812. "use strict";
  122813. __webpack_require__.r(__webpack_exports__);
  122814. /* harmony import */ var _createPadding_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createPadding.js */ "./node_modules/lodash-es/_createPadding.js");
  122815. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  122816. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  122817. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  122818. /**
  122819. * Pads `string` on the left side if it's shorter than `length`. Padding
  122820. * characters are truncated if they exceed `length`.
  122821. *
  122822. * @static
  122823. * @memberOf _
  122824. * @since 4.0.0
  122825. * @category String
  122826. * @param {string} [string=''] The string to pad.
  122827. * @param {number} [length=0] The padding length.
  122828. * @param {string} [chars=' '] The string used as padding.
  122829. * @returns {string} Returns the padded string.
  122830. * @example
  122831. *
  122832. * _.padStart('abc', 6);
  122833. * // => ' abc'
  122834. *
  122835. * _.padStart('abc', 6, '_-');
  122836. * // => '_-_abc'
  122837. *
  122838. * _.padStart('abc', 3);
  122839. * // => 'abc'
  122840. */
  122841. function padStart(string, length, chars) {
  122842. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  122843. length = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(length);
  122844. var strLength = length ? Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string) : 0;
  122845. return (length && strLength < length)
  122846. ? (Object(_createPadding_js__WEBPACK_IMPORTED_MODULE_0__["default"])(length - strLength, chars) + string)
  122847. : string;
  122848. }
  122849. /* harmony default export */ __webpack_exports__["default"] = (padStart);
  122850. /***/ }),
  122851. /***/ "./node_modules/lodash-es/parseInt.js":
  122852. /*!********************************************!*\
  122853. !*** ./node_modules/lodash-es/parseInt.js ***!
  122854. \********************************************/
  122855. /*! exports provided: default */
  122856. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122857. "use strict";
  122858. __webpack_require__.r(__webpack_exports__);
  122859. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  122860. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  122861. /** Used to match leading whitespace. */
  122862. var reTrimStart = /^\s+/;
  122863. /* Built-in method references for those with the same name as other `lodash` methods. */
  122864. var nativeParseInt = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].parseInt;
  122865. /**
  122866. * Converts `string` to an integer of the specified radix. If `radix` is
  122867. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  122868. * hexadecimal, in which case a `radix` of `16` is used.
  122869. *
  122870. * **Note:** This method aligns with the
  122871. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  122872. *
  122873. * @static
  122874. * @memberOf _
  122875. * @since 1.1.0
  122876. * @category String
  122877. * @param {string} string The string to convert.
  122878. * @param {number} [radix=10] The radix to interpret `value` by.
  122879. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  122880. * @returns {number} Returns the converted integer.
  122881. * @example
  122882. *
  122883. * _.parseInt('08');
  122884. * // => 8
  122885. *
  122886. * _.map(['6', '08', '10'], _.parseInt);
  122887. * // => [6, 8, 10]
  122888. */
  122889. function parseInt(string, radix, guard) {
  122890. if (guard || radix == null) {
  122891. radix = 0;
  122892. } else if (radix) {
  122893. radix = +radix;
  122894. }
  122895. return nativeParseInt(Object(_toString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string).replace(reTrimStart, ''), radix || 0);
  122896. }
  122897. /* harmony default export */ __webpack_exports__["default"] = (parseInt);
  122898. /***/ }),
  122899. /***/ "./node_modules/lodash-es/partial.js":
  122900. /*!*******************************************!*\
  122901. !*** ./node_modules/lodash-es/partial.js ***!
  122902. \*******************************************/
  122903. /*! exports provided: default */
  122904. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122905. "use strict";
  122906. __webpack_require__.r(__webpack_exports__);
  122907. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  122908. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  122909. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  122910. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  122911. /** Used to compose bitmasks for function metadata. */
  122912. var WRAP_PARTIAL_FLAG = 32;
  122913. /**
  122914. * Creates a function that invokes `func` with `partials` prepended to the
  122915. * arguments it receives. This method is like `_.bind` except it does **not**
  122916. * alter the `this` binding.
  122917. *
  122918. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  122919. * builds, may be used as a placeholder for partially applied arguments.
  122920. *
  122921. * **Note:** This method doesn't set the "length" property of partially
  122922. * applied functions.
  122923. *
  122924. * @static
  122925. * @memberOf _
  122926. * @since 0.2.0
  122927. * @category Function
  122928. * @param {Function} func The function to partially apply arguments to.
  122929. * @param {...*} [partials] The arguments to be partially applied.
  122930. * @returns {Function} Returns the new partially applied function.
  122931. * @example
  122932. *
  122933. * function greet(greeting, name) {
  122934. * return greeting + ' ' + name;
  122935. * }
  122936. *
  122937. * var sayHelloTo = _.partial(greet, 'hello');
  122938. * sayHelloTo('fred');
  122939. * // => 'hello fred'
  122940. *
  122941. * // Partially applied with placeholders.
  122942. * var greetFred = _.partial(greet, _, 'fred');
  122943. * greetFred('hi');
  122944. * // => 'hi fred'
  122945. */
  122946. var partial = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(func, partials) {
  122947. var holders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__["default"])(partials, Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(partial));
  122948. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  122949. });
  122950. // Assign default placeholders.
  122951. partial.placeholder = {};
  122952. /* harmony default export */ __webpack_exports__["default"] = (partial);
  122953. /***/ }),
  122954. /***/ "./node_modules/lodash-es/partialRight.js":
  122955. /*!************************************************!*\
  122956. !*** ./node_modules/lodash-es/partialRight.js ***!
  122957. \************************************************/
  122958. /*! exports provided: default */
  122959. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122960. "use strict";
  122961. __webpack_require__.r(__webpack_exports__);
  122962. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  122963. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  122964. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  122965. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  122966. /** Used to compose bitmasks for function metadata. */
  122967. var WRAP_PARTIAL_RIGHT_FLAG = 64;
  122968. /**
  122969. * This method is like `_.partial` except that partially applied arguments
  122970. * are appended to the arguments it receives.
  122971. *
  122972. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  122973. * builds, may be used as a placeholder for partially applied arguments.
  122974. *
  122975. * **Note:** This method doesn't set the "length" property of partially
  122976. * applied functions.
  122977. *
  122978. * @static
  122979. * @memberOf _
  122980. * @since 1.0.0
  122981. * @category Function
  122982. * @param {Function} func The function to partially apply arguments to.
  122983. * @param {...*} [partials] The arguments to be partially applied.
  122984. * @returns {Function} Returns the new partially applied function.
  122985. * @example
  122986. *
  122987. * function greet(greeting, name) {
  122988. * return greeting + ' ' + name;
  122989. * }
  122990. *
  122991. * var greetFred = _.partialRight(greet, 'fred');
  122992. * greetFred('hi');
  122993. * // => 'hi fred'
  122994. *
  122995. * // Partially applied with placeholders.
  122996. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  122997. * sayHelloTo('fred');
  122998. * // => 'hello fred'
  122999. */
  123000. var partialRight = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(func, partials) {
  123001. var holders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__["default"])(partials, Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(partialRight));
  123002. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  123003. });
  123004. // Assign default placeholders.
  123005. partialRight.placeholder = {};
  123006. /* harmony default export */ __webpack_exports__["default"] = (partialRight);
  123007. /***/ }),
  123008. /***/ "./node_modules/lodash-es/partition.js":
  123009. /*!*********************************************!*\
  123010. !*** ./node_modules/lodash-es/partition.js ***!
  123011. \*********************************************/
  123012. /*! exports provided: default */
  123013. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123014. "use strict";
  123015. __webpack_require__.r(__webpack_exports__);
  123016. /* harmony import */ var _createAggregator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createAggregator.js */ "./node_modules/lodash-es/_createAggregator.js");
  123017. /**
  123018. * Creates an array of elements split into two groups, the first of which
  123019. * contains elements `predicate` returns truthy for, the second of which
  123020. * contains elements `predicate` returns falsey for. The predicate is
  123021. * invoked with one argument: (value).
  123022. *
  123023. * @static
  123024. * @memberOf _
  123025. * @since 3.0.0
  123026. * @category Collection
  123027. * @param {Array|Object} collection The collection to iterate over.
  123028. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  123029. * @returns {Array} Returns the array of grouped elements.
  123030. * @example
  123031. *
  123032. * var users = [
  123033. * { 'user': 'barney', 'age': 36, 'active': false },
  123034. * { 'user': 'fred', 'age': 40, 'active': true },
  123035. * { 'user': 'pebbles', 'age': 1, 'active': false }
  123036. * ];
  123037. *
  123038. * _.partition(users, function(o) { return o.active; });
  123039. * // => objects for [['fred'], ['barney', 'pebbles']]
  123040. *
  123041. * // The `_.matches` iteratee shorthand.
  123042. * _.partition(users, { 'age': 1, 'active': false });
  123043. * // => objects for [['pebbles'], ['barney', 'fred']]
  123044. *
  123045. * // The `_.matchesProperty` iteratee shorthand.
  123046. * _.partition(users, ['active', false]);
  123047. * // => objects for [['barney', 'pebbles'], ['fred']]
  123048. *
  123049. * // The `_.property` iteratee shorthand.
  123050. * _.partition(users, 'active');
  123051. * // => objects for [['fred'], ['barney', 'pebbles']]
  123052. */
  123053. var partition = Object(_createAggregator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, value, key) {
  123054. result[key ? 0 : 1].push(value);
  123055. }, function() { return [[], []]; });
  123056. /* harmony default export */ __webpack_exports__["default"] = (partition);
  123057. /***/ }),
  123058. /***/ "./node_modules/lodash-es/pick.js":
  123059. /*!****************************************!*\
  123060. !*** ./node_modules/lodash-es/pick.js ***!
  123061. \****************************************/
  123062. /*! exports provided: default */
  123063. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123064. "use strict";
  123065. __webpack_require__.r(__webpack_exports__);
  123066. /* harmony import */ var _basePick_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePick.js */ "./node_modules/lodash-es/_basePick.js");
  123067. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  123068. /**
  123069. * Creates an object composed of the picked `object` properties.
  123070. *
  123071. * @static
  123072. * @since 0.1.0
  123073. * @memberOf _
  123074. * @category Object
  123075. * @param {Object} object The source object.
  123076. * @param {...(string|string[])} [paths] The property paths to pick.
  123077. * @returns {Object} Returns the new object.
  123078. * @example
  123079. *
  123080. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  123081. *
  123082. * _.pick(object, ['a', 'c']);
  123083. * // => { 'a': 1, 'c': 3 }
  123084. */
  123085. var pick = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, paths) {
  123086. return object == null ? {} : Object(_basePick_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, paths);
  123087. });
  123088. /* harmony default export */ __webpack_exports__["default"] = (pick);
  123089. /***/ }),
  123090. /***/ "./node_modules/lodash-es/pickBy.js":
  123091. /*!******************************************!*\
  123092. !*** ./node_modules/lodash-es/pickBy.js ***!
  123093. \******************************************/
  123094. /*! exports provided: default */
  123095. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123096. "use strict";
  123097. __webpack_require__.r(__webpack_exports__);
  123098. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  123099. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  123100. /* harmony import */ var _basePickBy_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_basePickBy.js */ "./node_modules/lodash-es/_basePickBy.js");
  123101. /* harmony import */ var _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_getAllKeysIn.js */ "./node_modules/lodash-es/_getAllKeysIn.js");
  123102. /**
  123103. * Creates an object composed of the `object` properties `predicate` returns
  123104. * truthy for. The predicate is invoked with two arguments: (value, key).
  123105. *
  123106. * @static
  123107. * @memberOf _
  123108. * @since 4.0.0
  123109. * @category Object
  123110. * @param {Object} object The source object.
  123111. * @param {Function} [predicate=_.identity] The function invoked per property.
  123112. * @returns {Object} Returns the new object.
  123113. * @example
  123114. *
  123115. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  123116. *
  123117. * _.pickBy(object, _.isNumber);
  123118. * // => { 'a': 1, 'c': 3 }
  123119. */
  123120. function pickBy(object, predicate) {
  123121. if (object == null) {
  123122. return {};
  123123. }
  123124. var props = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object), function(prop) {
  123125. return [prop];
  123126. });
  123127. predicate = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(predicate);
  123128. return Object(_basePickBy_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, props, function(value, path) {
  123129. return predicate(value, path[0]);
  123130. });
  123131. }
  123132. /* harmony default export */ __webpack_exports__["default"] = (pickBy);
  123133. /***/ }),
  123134. /***/ "./node_modules/lodash-es/plant.js":
  123135. /*!*****************************************!*\
  123136. !*** ./node_modules/lodash-es/plant.js ***!
  123137. \*****************************************/
  123138. /*! exports provided: default */
  123139. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123140. "use strict";
  123141. __webpack_require__.r(__webpack_exports__);
  123142. /* harmony import */ var _baseLodash_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseLodash.js */ "./node_modules/lodash-es/_baseLodash.js");
  123143. /* harmony import */ var _wrapperClone_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_wrapperClone.js */ "./node_modules/lodash-es/_wrapperClone.js");
  123144. /**
  123145. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  123146. *
  123147. * @name plant
  123148. * @memberOf _
  123149. * @since 3.2.0
  123150. * @category Seq
  123151. * @param {*} value The value to plant.
  123152. * @returns {Object} Returns the new `lodash` wrapper instance.
  123153. * @example
  123154. *
  123155. * function square(n) {
  123156. * return n * n;
  123157. * }
  123158. *
  123159. * var wrapped = _([1, 2]).map(square);
  123160. * var other = wrapped.plant([3, 4]);
  123161. *
  123162. * other.value();
  123163. * // => [9, 16]
  123164. *
  123165. * wrapped.value();
  123166. * // => [1, 4]
  123167. */
  123168. function wrapperPlant(value) {
  123169. var result,
  123170. parent = this;
  123171. while (parent instanceof _baseLodash_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  123172. var clone = Object(_wrapperClone_js__WEBPACK_IMPORTED_MODULE_1__["default"])(parent);
  123173. clone.__index__ = 0;
  123174. clone.__values__ = undefined;
  123175. if (result) {
  123176. previous.__wrapped__ = clone;
  123177. } else {
  123178. result = clone;
  123179. }
  123180. var previous = clone;
  123181. parent = parent.__wrapped__;
  123182. }
  123183. previous.__wrapped__ = value;
  123184. return result;
  123185. }
  123186. /* harmony default export */ __webpack_exports__["default"] = (wrapperPlant);
  123187. /***/ }),
  123188. /***/ "./node_modules/lodash-es/property.js":
  123189. /*!********************************************!*\
  123190. !*** ./node_modules/lodash-es/property.js ***!
  123191. \********************************************/
  123192. /*! exports provided: default */
  123193. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123194. "use strict";
  123195. __webpack_require__.r(__webpack_exports__);
  123196. /* harmony import */ var _baseProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseProperty.js */ "./node_modules/lodash-es/_baseProperty.js");
  123197. /* harmony import */ var _basePropertyDeep_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_basePropertyDeep.js */ "./node_modules/lodash-es/_basePropertyDeep.js");
  123198. /* harmony import */ var _isKey_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isKey.js */ "./node_modules/lodash-es/_isKey.js");
  123199. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  123200. /**
  123201. * Creates a function that returns the value at `path` of a given object.
  123202. *
  123203. * @static
  123204. * @memberOf _
  123205. * @since 2.4.0
  123206. * @category Util
  123207. * @param {Array|string} path The path of the property to get.
  123208. * @returns {Function} Returns the new accessor function.
  123209. * @example
  123210. *
  123211. * var objects = [
  123212. * { 'a': { 'b': 2 } },
  123213. * { 'a': { 'b': 1 } }
  123214. * ];
  123215. *
  123216. * _.map(objects, _.property('a.b'));
  123217. * // => [2, 1]
  123218. *
  123219. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  123220. * // => [1, 2]
  123221. */
  123222. function property(path) {
  123223. return Object(_isKey_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path) ? Object(_baseProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toKey_js__WEBPACK_IMPORTED_MODULE_3__["default"])(path)) : Object(_basePropertyDeep_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path);
  123224. }
  123225. /* harmony default export */ __webpack_exports__["default"] = (property);
  123226. /***/ }),
  123227. /***/ "./node_modules/lodash-es/propertyOf.js":
  123228. /*!**********************************************!*\
  123229. !*** ./node_modules/lodash-es/propertyOf.js ***!
  123230. \**********************************************/
  123231. /*! exports provided: default */
  123232. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123233. "use strict";
  123234. __webpack_require__.r(__webpack_exports__);
  123235. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  123236. /**
  123237. * The opposite of `_.property`; this method creates a function that returns
  123238. * the value at a given path of `object`.
  123239. *
  123240. * @static
  123241. * @memberOf _
  123242. * @since 3.0.0
  123243. * @category Util
  123244. * @param {Object} object The object to query.
  123245. * @returns {Function} Returns the new accessor function.
  123246. * @example
  123247. *
  123248. * var array = [0, 1, 2],
  123249. * object = { 'a': array, 'b': array, 'c': array };
  123250. *
  123251. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  123252. * // => [2, 0]
  123253. *
  123254. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  123255. * // => [2, 0]
  123256. */
  123257. function propertyOf(object) {
  123258. return function(path) {
  123259. return object == null ? undefined : Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
  123260. };
  123261. }
  123262. /* harmony default export */ __webpack_exports__["default"] = (propertyOf);
  123263. /***/ }),
  123264. /***/ "./node_modules/lodash-es/pull.js":
  123265. /*!****************************************!*\
  123266. !*** ./node_modules/lodash-es/pull.js ***!
  123267. \****************************************/
  123268. /*! exports provided: default */
  123269. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123270. "use strict";
  123271. __webpack_require__.r(__webpack_exports__);
  123272. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  123273. /* harmony import */ var _pullAll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pullAll.js */ "./node_modules/lodash-es/pullAll.js");
  123274. /**
  123275. * Removes all given values from `array` using
  123276. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  123277. * for equality comparisons.
  123278. *
  123279. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  123280. * to remove elements from an array by predicate.
  123281. *
  123282. * @static
  123283. * @memberOf _
  123284. * @since 2.0.0
  123285. * @category Array
  123286. * @param {Array} array The array to modify.
  123287. * @param {...*} [values] The values to remove.
  123288. * @returns {Array} Returns `array`.
  123289. * @example
  123290. *
  123291. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  123292. *
  123293. * _.pull(array, 'a', 'c');
  123294. * console.log(array);
  123295. * // => ['b', 'b']
  123296. */
  123297. var pull = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_pullAll_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  123298. /* harmony default export */ __webpack_exports__["default"] = (pull);
  123299. /***/ }),
  123300. /***/ "./node_modules/lodash-es/pullAll.js":
  123301. /*!*******************************************!*\
  123302. !*** ./node_modules/lodash-es/pullAll.js ***!
  123303. \*******************************************/
  123304. /*! exports provided: default */
  123305. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123306. "use strict";
  123307. __webpack_require__.r(__webpack_exports__);
  123308. /* harmony import */ var _basePullAll_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePullAll.js */ "./node_modules/lodash-es/_basePullAll.js");
  123309. /**
  123310. * This method is like `_.pull` except that it accepts an array of values to remove.
  123311. *
  123312. * **Note:** Unlike `_.difference`, this method mutates `array`.
  123313. *
  123314. * @static
  123315. * @memberOf _
  123316. * @since 4.0.0
  123317. * @category Array
  123318. * @param {Array} array The array to modify.
  123319. * @param {Array} values The values to remove.
  123320. * @returns {Array} Returns `array`.
  123321. * @example
  123322. *
  123323. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  123324. *
  123325. * _.pullAll(array, ['a', 'c']);
  123326. * console.log(array);
  123327. * // => ['b', 'b']
  123328. */
  123329. function pullAll(array, values) {
  123330. return (array && array.length && values && values.length)
  123331. ? Object(_basePullAll_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, values)
  123332. : array;
  123333. }
  123334. /* harmony default export */ __webpack_exports__["default"] = (pullAll);
  123335. /***/ }),
  123336. /***/ "./node_modules/lodash-es/pullAllBy.js":
  123337. /*!*********************************************!*\
  123338. !*** ./node_modules/lodash-es/pullAllBy.js ***!
  123339. \*********************************************/
  123340. /*! exports provided: default */
  123341. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123342. "use strict";
  123343. __webpack_require__.r(__webpack_exports__);
  123344. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  123345. /* harmony import */ var _basePullAll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_basePullAll.js */ "./node_modules/lodash-es/_basePullAll.js");
  123346. /**
  123347. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  123348. * invoked for each element of `array` and `values` to generate the criterion
  123349. * by which they're compared. The iteratee is invoked with one argument: (value).
  123350. *
  123351. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  123352. *
  123353. * @static
  123354. * @memberOf _
  123355. * @since 4.0.0
  123356. * @category Array
  123357. * @param {Array} array The array to modify.
  123358. * @param {Array} values The values to remove.
  123359. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  123360. * @returns {Array} Returns `array`.
  123361. * @example
  123362. *
  123363. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  123364. *
  123365. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  123366. * console.log(array);
  123367. * // => [{ 'x': 2 }]
  123368. */
  123369. function pullAllBy(array, values, iteratee) {
  123370. return (array && array.length && values && values.length)
  123371. ? Object(_basePullAll_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, values, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2))
  123372. : array;
  123373. }
  123374. /* harmony default export */ __webpack_exports__["default"] = (pullAllBy);
  123375. /***/ }),
  123376. /***/ "./node_modules/lodash-es/pullAllWith.js":
  123377. /*!***********************************************!*\
  123378. !*** ./node_modules/lodash-es/pullAllWith.js ***!
  123379. \***********************************************/
  123380. /*! exports provided: default */
  123381. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123382. "use strict";
  123383. __webpack_require__.r(__webpack_exports__);
  123384. /* harmony import */ var _basePullAll_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePullAll.js */ "./node_modules/lodash-es/_basePullAll.js");
  123385. /**
  123386. * This method is like `_.pullAll` except that it accepts `comparator` which
  123387. * is invoked to compare elements of `array` to `values`. The comparator is
  123388. * invoked with two arguments: (arrVal, othVal).
  123389. *
  123390. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  123391. *
  123392. * @static
  123393. * @memberOf _
  123394. * @since 4.6.0
  123395. * @category Array
  123396. * @param {Array} array The array to modify.
  123397. * @param {Array} values The values to remove.
  123398. * @param {Function} [comparator] The comparator invoked per element.
  123399. * @returns {Array} Returns `array`.
  123400. * @example
  123401. *
  123402. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  123403. *
  123404. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  123405. * console.log(array);
  123406. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  123407. */
  123408. function pullAllWith(array, values, comparator) {
  123409. return (array && array.length && values && values.length)
  123410. ? Object(_basePullAll_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, values, undefined, comparator)
  123411. : array;
  123412. }
  123413. /* harmony default export */ __webpack_exports__["default"] = (pullAllWith);
  123414. /***/ }),
  123415. /***/ "./node_modules/lodash-es/pullAt.js":
  123416. /*!******************************************!*\
  123417. !*** ./node_modules/lodash-es/pullAt.js ***!
  123418. \******************************************/
  123419. /*! exports provided: default */
  123420. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123421. "use strict";
  123422. __webpack_require__.r(__webpack_exports__);
  123423. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  123424. /* harmony import */ var _baseAt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAt.js */ "./node_modules/lodash-es/_baseAt.js");
  123425. /* harmony import */ var _basePullAt_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_basePullAt.js */ "./node_modules/lodash-es/_basePullAt.js");
  123426. /* harmony import */ var _compareAscending_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_compareAscending.js */ "./node_modules/lodash-es/_compareAscending.js");
  123427. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  123428. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  123429. /**
  123430. * Removes elements from `array` corresponding to `indexes` and returns an
  123431. * array of removed elements.
  123432. *
  123433. * **Note:** Unlike `_.at`, this method mutates `array`.
  123434. *
  123435. * @static
  123436. * @memberOf _
  123437. * @since 3.0.0
  123438. * @category Array
  123439. * @param {Array} array The array to modify.
  123440. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  123441. * @returns {Array} Returns the new array of removed elements.
  123442. * @example
  123443. *
  123444. * var array = ['a', 'b', 'c', 'd'];
  123445. * var pulled = _.pullAt(array, [1, 3]);
  123446. *
  123447. * console.log(array);
  123448. * // => ['a', 'c']
  123449. *
  123450. * console.log(pulled);
  123451. * // => ['b', 'd']
  123452. */
  123453. var pullAt = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_4__["default"])(function(array, indexes) {
  123454. var length = array == null ? 0 : array.length,
  123455. result = Object(_baseAt_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, indexes);
  123456. Object(_basePullAt_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array, Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(indexes, function(index) {
  123457. return Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_5__["default"])(index, length) ? +index : index;
  123458. }).sort(_compareAscending_js__WEBPACK_IMPORTED_MODULE_3__["default"]));
  123459. return result;
  123460. });
  123461. /* harmony default export */ __webpack_exports__["default"] = (pullAt);
  123462. /***/ }),
  123463. /***/ "./node_modules/lodash-es/random.js":
  123464. /*!******************************************!*\
  123465. !*** ./node_modules/lodash-es/random.js ***!
  123466. \******************************************/
  123467. /*! exports provided: default */
  123468. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123469. "use strict";
  123470. __webpack_require__.r(__webpack_exports__);
  123471. /* harmony import */ var _baseRandom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRandom.js */ "./node_modules/lodash-es/_baseRandom.js");
  123472. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  123473. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  123474. /** Built-in method references without a dependency on `root`. */
  123475. var freeParseFloat = parseFloat;
  123476. /* Built-in method references for those with the same name as other `lodash` methods. */
  123477. var nativeMin = Math.min,
  123478. nativeRandom = Math.random;
  123479. /**
  123480. * Produces a random number between the inclusive `lower` and `upper` bounds.
  123481. * If only one argument is provided a number between `0` and the given number
  123482. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  123483. * floats, a floating-point number is returned instead of an integer.
  123484. *
  123485. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  123486. * floating-point values which can produce unexpected results.
  123487. *
  123488. * @static
  123489. * @memberOf _
  123490. * @since 0.7.0
  123491. * @category Number
  123492. * @param {number} [lower=0] The lower bound.
  123493. * @param {number} [upper=1] The upper bound.
  123494. * @param {boolean} [floating] Specify returning a floating-point number.
  123495. * @returns {number} Returns the random number.
  123496. * @example
  123497. *
  123498. * _.random(0, 5);
  123499. * // => an integer between 0 and 5
  123500. *
  123501. * _.random(5);
  123502. * // => also an integer between 0 and 5
  123503. *
  123504. * _.random(5, true);
  123505. * // => a floating-point number between 0 and 5
  123506. *
  123507. * _.random(1.2, 5.2);
  123508. * // => a floating-point number between 1.2 and 5.2
  123509. */
  123510. function random(lower, upper, floating) {
  123511. if (floating && typeof floating != 'boolean' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(lower, upper, floating)) {
  123512. upper = floating = undefined;
  123513. }
  123514. if (floating === undefined) {
  123515. if (typeof upper == 'boolean') {
  123516. floating = upper;
  123517. upper = undefined;
  123518. }
  123519. else if (typeof lower == 'boolean') {
  123520. floating = lower;
  123521. lower = undefined;
  123522. }
  123523. }
  123524. if (lower === undefined && upper === undefined) {
  123525. lower = 0;
  123526. upper = 1;
  123527. }
  123528. else {
  123529. lower = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(lower);
  123530. if (upper === undefined) {
  123531. upper = lower;
  123532. lower = 0;
  123533. } else {
  123534. upper = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(upper);
  123535. }
  123536. }
  123537. if (lower > upper) {
  123538. var temp = lower;
  123539. lower = upper;
  123540. upper = temp;
  123541. }
  123542. if (floating || lower % 1 || upper % 1) {
  123543. var rand = nativeRandom();
  123544. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  123545. }
  123546. return Object(_baseRandom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(lower, upper);
  123547. }
  123548. /* harmony default export */ __webpack_exports__["default"] = (random);
  123549. /***/ }),
  123550. /***/ "./node_modules/lodash-es/range.js":
  123551. /*!*****************************************!*\
  123552. !*** ./node_modules/lodash-es/range.js ***!
  123553. \*****************************************/
  123554. /*! exports provided: default */
  123555. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123556. "use strict";
  123557. __webpack_require__.r(__webpack_exports__);
  123558. /* harmony import */ var _createRange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRange.js */ "./node_modules/lodash-es/_createRange.js");
  123559. /**
  123560. * Creates an array of numbers (positive and/or negative) progressing from
  123561. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  123562. * `start` is specified without an `end` or `step`. If `end` is not specified,
  123563. * it's set to `start` with `start` then set to `0`.
  123564. *
  123565. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  123566. * floating-point values which can produce unexpected results.
  123567. *
  123568. * @static
  123569. * @since 0.1.0
  123570. * @memberOf _
  123571. * @category Util
  123572. * @param {number} [start=0] The start of the range.
  123573. * @param {number} end The end of the range.
  123574. * @param {number} [step=1] The value to increment or decrement by.
  123575. * @returns {Array} Returns the range of numbers.
  123576. * @see _.inRange, _.rangeRight
  123577. * @example
  123578. *
  123579. * _.range(4);
  123580. * // => [0, 1, 2, 3]
  123581. *
  123582. * _.range(-4);
  123583. * // => [0, -1, -2, -3]
  123584. *
  123585. * _.range(1, 5);
  123586. * // => [1, 2, 3, 4]
  123587. *
  123588. * _.range(0, 20, 5);
  123589. * // => [0, 5, 10, 15]
  123590. *
  123591. * _.range(0, -4, -1);
  123592. * // => [0, -1, -2, -3]
  123593. *
  123594. * _.range(1, 4, 0);
  123595. * // => [1, 1, 1]
  123596. *
  123597. * _.range(0);
  123598. * // => []
  123599. */
  123600. var range = Object(_createRange_js__WEBPACK_IMPORTED_MODULE_0__["default"])();
  123601. /* harmony default export */ __webpack_exports__["default"] = (range);
  123602. /***/ }),
  123603. /***/ "./node_modules/lodash-es/rangeRight.js":
  123604. /*!**********************************************!*\
  123605. !*** ./node_modules/lodash-es/rangeRight.js ***!
  123606. \**********************************************/
  123607. /*! exports provided: default */
  123608. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123609. "use strict";
  123610. __webpack_require__.r(__webpack_exports__);
  123611. /* harmony import */ var _createRange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRange.js */ "./node_modules/lodash-es/_createRange.js");
  123612. /**
  123613. * This method is like `_.range` except that it populates values in
  123614. * descending order.
  123615. *
  123616. * @static
  123617. * @memberOf _
  123618. * @since 4.0.0
  123619. * @category Util
  123620. * @param {number} [start=0] The start of the range.
  123621. * @param {number} end The end of the range.
  123622. * @param {number} [step=1] The value to increment or decrement by.
  123623. * @returns {Array} Returns the range of numbers.
  123624. * @see _.inRange, _.range
  123625. * @example
  123626. *
  123627. * _.rangeRight(4);
  123628. * // => [3, 2, 1, 0]
  123629. *
  123630. * _.rangeRight(-4);
  123631. * // => [-3, -2, -1, 0]
  123632. *
  123633. * _.rangeRight(1, 5);
  123634. * // => [4, 3, 2, 1]
  123635. *
  123636. * _.rangeRight(0, 20, 5);
  123637. * // => [15, 10, 5, 0]
  123638. *
  123639. * _.rangeRight(0, -4, -1);
  123640. * // => [-3, -2, -1, 0]
  123641. *
  123642. * _.rangeRight(1, 4, 0);
  123643. * // => [1, 1, 1]
  123644. *
  123645. * _.rangeRight(0);
  123646. * // => []
  123647. */
  123648. var rangeRight = Object(_createRange_js__WEBPACK_IMPORTED_MODULE_0__["default"])(true);
  123649. /* harmony default export */ __webpack_exports__["default"] = (rangeRight);
  123650. /***/ }),
  123651. /***/ "./node_modules/lodash-es/rearg.js":
  123652. /*!*****************************************!*\
  123653. !*** ./node_modules/lodash-es/rearg.js ***!
  123654. \*****************************************/
  123655. /*! exports provided: default */
  123656. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123657. "use strict";
  123658. __webpack_require__.r(__webpack_exports__);
  123659. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  123660. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  123661. /** Used to compose bitmasks for function metadata. */
  123662. var WRAP_REARG_FLAG = 256;
  123663. /**
  123664. * Creates a function that invokes `func` with arguments arranged according
  123665. * to the specified `indexes` where the argument value at the first index is
  123666. * provided as the first argument, the argument value at the second index is
  123667. * provided as the second argument, and so on.
  123668. *
  123669. * @static
  123670. * @memberOf _
  123671. * @since 3.0.0
  123672. * @category Function
  123673. * @param {Function} func The function to rearrange arguments for.
  123674. * @param {...(number|number[])} indexes The arranged argument indexes.
  123675. * @returns {Function} Returns the new function.
  123676. * @example
  123677. *
  123678. * var rearged = _.rearg(function(a, b, c) {
  123679. * return [a, b, c];
  123680. * }, [2, 0, 1]);
  123681. *
  123682. * rearged('b', 'c', 'a')
  123683. * // => ['a', 'b', 'c']
  123684. */
  123685. var rearg = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(func, indexes) {
  123686. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  123687. });
  123688. /* harmony default export */ __webpack_exports__["default"] = (rearg);
  123689. /***/ }),
  123690. /***/ "./node_modules/lodash-es/reduce.js":
  123691. /*!******************************************!*\
  123692. !*** ./node_modules/lodash-es/reduce.js ***!
  123693. \******************************************/
  123694. /*! exports provided: default */
  123695. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123696. "use strict";
  123697. __webpack_require__.r(__webpack_exports__);
  123698. /* harmony import */ var _arrayReduce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayReduce.js */ "./node_modules/lodash-es/_arrayReduce.js");
  123699. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  123700. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  123701. /* harmony import */ var _baseReduce_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseReduce.js */ "./node_modules/lodash-es/_baseReduce.js");
  123702. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  123703. /**
  123704. * Reduces `collection` to a value which is the accumulated result of running
  123705. * each element in `collection` thru `iteratee`, where each successive
  123706. * invocation is supplied the return value of the previous. If `accumulator`
  123707. * is not given, the first element of `collection` is used as the initial
  123708. * value. The iteratee is invoked with four arguments:
  123709. * (accumulator, value, index|key, collection).
  123710. *
  123711. * Many lodash methods are guarded to work as iteratees for methods like
  123712. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  123713. *
  123714. * The guarded methods are:
  123715. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  123716. * and `sortBy`
  123717. *
  123718. * @static
  123719. * @memberOf _
  123720. * @since 0.1.0
  123721. * @category Collection
  123722. * @param {Array|Object} collection The collection to iterate over.
  123723. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  123724. * @param {*} [accumulator] The initial value.
  123725. * @returns {*} Returns the accumulated value.
  123726. * @see _.reduceRight
  123727. * @example
  123728. *
  123729. * _.reduce([1, 2], function(sum, n) {
  123730. * return sum + n;
  123731. * }, 0);
  123732. * // => 3
  123733. *
  123734. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  123735. * (result[value] || (result[value] = [])).push(key);
  123736. * return result;
  123737. * }, {});
  123738. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  123739. */
  123740. function reduce(collection, iteratee, accumulator) {
  123741. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection) ? _arrayReduce_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseReduce_js__WEBPACK_IMPORTED_MODULE_3__["default"],
  123742. initAccum = arguments.length < 3;
  123743. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 4), accumulator, initAccum, _baseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  123744. }
  123745. /* harmony default export */ __webpack_exports__["default"] = (reduce);
  123746. /***/ }),
  123747. /***/ "./node_modules/lodash-es/reduceRight.js":
  123748. /*!***********************************************!*\
  123749. !*** ./node_modules/lodash-es/reduceRight.js ***!
  123750. \***********************************************/
  123751. /*! exports provided: default */
  123752. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123753. "use strict";
  123754. __webpack_require__.r(__webpack_exports__);
  123755. /* harmony import */ var _arrayReduceRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayReduceRight.js */ "./node_modules/lodash-es/_arrayReduceRight.js");
  123756. /* harmony import */ var _baseEachRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEachRight.js */ "./node_modules/lodash-es/_baseEachRight.js");
  123757. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  123758. /* harmony import */ var _baseReduce_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseReduce.js */ "./node_modules/lodash-es/_baseReduce.js");
  123759. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  123760. /**
  123761. * This method is like `_.reduce` except that it iterates over elements of
  123762. * `collection` from right to left.
  123763. *
  123764. * @static
  123765. * @memberOf _
  123766. * @since 0.1.0
  123767. * @category Collection
  123768. * @param {Array|Object} collection The collection to iterate over.
  123769. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  123770. * @param {*} [accumulator] The initial value.
  123771. * @returns {*} Returns the accumulated value.
  123772. * @see _.reduce
  123773. * @example
  123774. *
  123775. * var array = [[0, 1], [2, 3], [4, 5]];
  123776. *
  123777. * _.reduceRight(array, function(flattened, other) {
  123778. * return flattened.concat(other);
  123779. * }, []);
  123780. * // => [4, 5, 2, 3, 0, 1]
  123781. */
  123782. function reduceRight(collection, iteratee, accumulator) {
  123783. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection) ? _arrayReduceRight_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseReduce_js__WEBPACK_IMPORTED_MODULE_3__["default"],
  123784. initAccum = arguments.length < 3;
  123785. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 4), accumulator, initAccum, _baseEachRight_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  123786. }
  123787. /* harmony default export */ __webpack_exports__["default"] = (reduceRight);
  123788. /***/ }),
  123789. /***/ "./node_modules/lodash-es/reject.js":
  123790. /*!******************************************!*\
  123791. !*** ./node_modules/lodash-es/reject.js ***!
  123792. \******************************************/
  123793. /*! exports provided: default */
  123794. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123795. "use strict";
  123796. __webpack_require__.r(__webpack_exports__);
  123797. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  123798. /* harmony import */ var _baseFilter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFilter.js */ "./node_modules/lodash-es/_baseFilter.js");
  123799. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  123800. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  123801. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  123802. /**
  123803. * The opposite of `_.filter`; this method returns the elements of `collection`
  123804. * that `predicate` does **not** return truthy for.
  123805. *
  123806. * @static
  123807. * @memberOf _
  123808. * @since 0.1.0
  123809. * @category Collection
  123810. * @param {Array|Object} collection The collection to iterate over.
  123811. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  123812. * @returns {Array} Returns the new filtered array.
  123813. * @see _.filter
  123814. * @example
  123815. *
  123816. * var users = [
  123817. * { 'user': 'barney', 'age': 36, 'active': false },
  123818. * { 'user': 'fred', 'age': 40, 'active': true }
  123819. * ];
  123820. *
  123821. * _.reject(users, function(o) { return !o.active; });
  123822. * // => objects for ['fred']
  123823. *
  123824. * // The `_.matches` iteratee shorthand.
  123825. * _.reject(users, { 'age': 40, 'active': true });
  123826. * // => objects for ['barney']
  123827. *
  123828. * // The `_.matchesProperty` iteratee shorthand.
  123829. * _.reject(users, ['active', false]);
  123830. * // => objects for ['fred']
  123831. *
  123832. * // The `_.property` iteratee shorthand.
  123833. * _.reject(users, 'active');
  123834. * // => objects for ['barney']
  123835. */
  123836. function reject(collection, predicate) {
  123837. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseFilter_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  123838. return func(collection, Object(_negate_js__WEBPACK_IMPORTED_MODULE_4__["default"])(Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3)));
  123839. }
  123840. /* harmony default export */ __webpack_exports__["default"] = (reject);
  123841. /***/ }),
  123842. /***/ "./node_modules/lodash-es/remove.js":
  123843. /*!******************************************!*\
  123844. !*** ./node_modules/lodash-es/remove.js ***!
  123845. \******************************************/
  123846. /*! exports provided: default */
  123847. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123848. "use strict";
  123849. __webpack_require__.r(__webpack_exports__);
  123850. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  123851. /* harmony import */ var _basePullAt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_basePullAt.js */ "./node_modules/lodash-es/_basePullAt.js");
  123852. /**
  123853. * Removes all elements from `array` that `predicate` returns truthy for
  123854. * and returns an array of the removed elements. The predicate is invoked
  123855. * with three arguments: (value, index, array).
  123856. *
  123857. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  123858. * to pull elements from an array by value.
  123859. *
  123860. * @static
  123861. * @memberOf _
  123862. * @since 2.0.0
  123863. * @category Array
  123864. * @param {Array} array The array to modify.
  123865. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  123866. * @returns {Array} Returns the new array of removed elements.
  123867. * @example
  123868. *
  123869. * var array = [1, 2, 3, 4];
  123870. * var evens = _.remove(array, function(n) {
  123871. * return n % 2 == 0;
  123872. * });
  123873. *
  123874. * console.log(array);
  123875. * // => [1, 3]
  123876. *
  123877. * console.log(evens);
  123878. * // => [2, 4]
  123879. */
  123880. function remove(array, predicate) {
  123881. var result = [];
  123882. if (!(array && array.length)) {
  123883. return result;
  123884. }
  123885. var index = -1,
  123886. indexes = [],
  123887. length = array.length;
  123888. predicate = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3);
  123889. while (++index < length) {
  123890. var value = array[index];
  123891. if (predicate(value, index, array)) {
  123892. result.push(value);
  123893. indexes.push(index);
  123894. }
  123895. }
  123896. Object(_basePullAt_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, indexes);
  123897. return result;
  123898. }
  123899. /* harmony default export */ __webpack_exports__["default"] = (remove);
  123900. /***/ }),
  123901. /***/ "./node_modules/lodash-es/repeat.js":
  123902. /*!******************************************!*\
  123903. !*** ./node_modules/lodash-es/repeat.js ***!
  123904. \******************************************/
  123905. /*! exports provided: default */
  123906. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123907. "use strict";
  123908. __webpack_require__.r(__webpack_exports__);
  123909. /* harmony import */ var _baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRepeat.js */ "./node_modules/lodash-es/_baseRepeat.js");
  123910. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  123911. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  123912. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  123913. /**
  123914. * Repeats the given string `n` times.
  123915. *
  123916. * @static
  123917. * @memberOf _
  123918. * @since 3.0.0
  123919. * @category String
  123920. * @param {string} [string=''] The string to repeat.
  123921. * @param {number} [n=1] The number of times to repeat the string.
  123922. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  123923. * @returns {string} Returns the repeated string.
  123924. * @example
  123925. *
  123926. * _.repeat('*', 3);
  123927. * // => '***'
  123928. *
  123929. * _.repeat('abc', 2);
  123930. * // => 'abcabc'
  123931. *
  123932. * _.repeat('abc', 0);
  123933. * // => ''
  123934. */
  123935. function repeat(string, n, guard) {
  123936. if ((guard ? Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string, n, guard) : n === undefined)) {
  123937. n = 1;
  123938. } else {
  123939. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(n);
  123940. }
  123941. return Object(_baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string), n);
  123942. }
  123943. /* harmony default export */ __webpack_exports__["default"] = (repeat);
  123944. /***/ }),
  123945. /***/ "./node_modules/lodash-es/replace.js":
  123946. /*!*******************************************!*\
  123947. !*** ./node_modules/lodash-es/replace.js ***!
  123948. \*******************************************/
  123949. /*! exports provided: default */
  123950. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123951. "use strict";
  123952. __webpack_require__.r(__webpack_exports__);
  123953. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  123954. /**
  123955. * Replaces matches for `pattern` in `string` with `replacement`.
  123956. *
  123957. * **Note:** This method is based on
  123958. * [`String#replace`](https://mdn.io/String/replace).
  123959. *
  123960. * @static
  123961. * @memberOf _
  123962. * @since 4.0.0
  123963. * @category String
  123964. * @param {string} [string=''] The string to modify.
  123965. * @param {RegExp|string} pattern The pattern to replace.
  123966. * @param {Function|string} replacement The match replacement.
  123967. * @returns {string} Returns the modified string.
  123968. * @example
  123969. *
  123970. * _.replace('Hi Fred', 'Fred', 'Barney');
  123971. * // => 'Hi Barney'
  123972. */
  123973. function replace() {
  123974. var args = arguments,
  123975. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(args[0]);
  123976. return args.length < 3 ? string : string.replace(args[1], args[2]);
  123977. }
  123978. /* harmony default export */ __webpack_exports__["default"] = (replace);
  123979. /***/ }),
  123980. /***/ "./node_modules/lodash-es/rest.js":
  123981. /*!****************************************!*\
  123982. !*** ./node_modules/lodash-es/rest.js ***!
  123983. \****************************************/
  123984. /*! exports provided: default */
  123985. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123986. "use strict";
  123987. __webpack_require__.r(__webpack_exports__);
  123988. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  123989. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  123990. /** Error message constants. */
  123991. var FUNC_ERROR_TEXT = 'Expected a function';
  123992. /**
  123993. * Creates a function that invokes `func` with the `this` binding of the
  123994. * created function and arguments from `start` and beyond provided as
  123995. * an array.
  123996. *
  123997. * **Note:** This method is based on the
  123998. * [rest parameter](https://mdn.io/rest_parameters).
  123999. *
  124000. * @static
  124001. * @memberOf _
  124002. * @since 4.0.0
  124003. * @category Function
  124004. * @param {Function} func The function to apply a rest parameter to.
  124005. * @param {number} [start=func.length-1] The start position of the rest parameter.
  124006. * @returns {Function} Returns the new function.
  124007. * @example
  124008. *
  124009. * var say = _.rest(function(what, names) {
  124010. * return what + ' ' + _.initial(names).join(', ') +
  124011. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  124012. * });
  124013. *
  124014. * say('hello', 'fred', 'barney', 'pebbles');
  124015. * // => 'hello fred, barney, & pebbles'
  124016. */
  124017. function rest(func, start) {
  124018. if (typeof func != 'function') {
  124019. throw new TypeError(FUNC_ERROR_TEXT);
  124020. }
  124021. start = start === undefined ? start : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start);
  124022. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, start);
  124023. }
  124024. /* harmony default export */ __webpack_exports__["default"] = (rest);
  124025. /***/ }),
  124026. /***/ "./node_modules/lodash-es/result.js":
  124027. /*!******************************************!*\
  124028. !*** ./node_modules/lodash-es/result.js ***!
  124029. \******************************************/
  124030. /*! exports provided: default */
  124031. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124032. "use strict";
  124033. __webpack_require__.r(__webpack_exports__);
  124034. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  124035. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  124036. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  124037. /**
  124038. * This method is like `_.get` except that if the resolved value is a
  124039. * function it's invoked with the `this` binding of its parent object and
  124040. * its result is returned.
  124041. *
  124042. * @static
  124043. * @since 0.1.0
  124044. * @memberOf _
  124045. * @category Object
  124046. * @param {Object} object The object to query.
  124047. * @param {Array|string} path The path of the property to resolve.
  124048. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  124049. * @returns {*} Returns the resolved value.
  124050. * @example
  124051. *
  124052. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  124053. *
  124054. * _.result(object, 'a[0].b.c1');
  124055. * // => 3
  124056. *
  124057. * _.result(object, 'a[0].b.c2');
  124058. * // => 4
  124059. *
  124060. * _.result(object, 'a[0].b.c3', 'default');
  124061. * // => 'default'
  124062. *
  124063. * _.result(object, 'a[0].b.c3', _.constant('default'));
  124064. * // => 'default'
  124065. */
  124066. function result(object, path, defaultValue) {
  124067. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);
  124068. var index = -1,
  124069. length = path.length;
  124070. // Ensure the loop is entered when path is empty.
  124071. if (!length) {
  124072. length = 1;
  124073. object = undefined;
  124074. }
  124075. while (++index < length) {
  124076. var value = object == null ? undefined : object[Object(_toKey_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path[index])];
  124077. if (value === undefined) {
  124078. index = length;
  124079. value = defaultValue;
  124080. }
  124081. object = Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) ? value.call(object) : value;
  124082. }
  124083. return object;
  124084. }
  124085. /* harmony default export */ __webpack_exports__["default"] = (result);
  124086. /***/ }),
  124087. /***/ "./node_modules/lodash-es/reverse.js":
  124088. /*!*******************************************!*\
  124089. !*** ./node_modules/lodash-es/reverse.js ***!
  124090. \*******************************************/
  124091. /*! exports provided: default */
  124092. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124093. "use strict";
  124094. __webpack_require__.r(__webpack_exports__);
  124095. /** Used for built-in method references. */
  124096. var arrayProto = Array.prototype;
  124097. /* Built-in method references for those with the same name as other `lodash` methods. */
  124098. var nativeReverse = arrayProto.reverse;
  124099. /**
  124100. * Reverses `array` so that the first element becomes the last, the second
  124101. * element becomes the second to last, and so on.
  124102. *
  124103. * **Note:** This method mutates `array` and is based on
  124104. * [`Array#reverse`](https://mdn.io/Array/reverse).
  124105. *
  124106. * @static
  124107. * @memberOf _
  124108. * @since 4.0.0
  124109. * @category Array
  124110. * @param {Array} array The array to modify.
  124111. * @returns {Array} Returns `array`.
  124112. * @example
  124113. *
  124114. * var array = [1, 2, 3];
  124115. *
  124116. * _.reverse(array);
  124117. * // => [3, 2, 1]
  124118. *
  124119. * console.log(array);
  124120. * // => [3, 2, 1]
  124121. */
  124122. function reverse(array) {
  124123. return array == null ? array : nativeReverse.call(array);
  124124. }
  124125. /* harmony default export */ __webpack_exports__["default"] = (reverse);
  124126. /***/ }),
  124127. /***/ "./node_modules/lodash-es/round.js":
  124128. /*!*****************************************!*\
  124129. !*** ./node_modules/lodash-es/round.js ***!
  124130. \*****************************************/
  124131. /*! exports provided: default */
  124132. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124133. "use strict";
  124134. __webpack_require__.r(__webpack_exports__);
  124135. /* harmony import */ var _createRound_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRound.js */ "./node_modules/lodash-es/_createRound.js");
  124136. /**
  124137. * Computes `number` rounded to `precision`.
  124138. *
  124139. * @static
  124140. * @memberOf _
  124141. * @since 3.10.0
  124142. * @category Math
  124143. * @param {number} number The number to round.
  124144. * @param {number} [precision=0] The precision to round to.
  124145. * @returns {number} Returns the rounded number.
  124146. * @example
  124147. *
  124148. * _.round(4.006);
  124149. * // => 4
  124150. *
  124151. * _.round(4.006, 2);
  124152. * // => 4.01
  124153. *
  124154. * _.round(4060, -2);
  124155. * // => 4100
  124156. */
  124157. var round = Object(_createRound_js__WEBPACK_IMPORTED_MODULE_0__["default"])('round');
  124158. /* harmony default export */ __webpack_exports__["default"] = (round);
  124159. /***/ }),
  124160. /***/ "./node_modules/lodash-es/sample.js":
  124161. /*!******************************************!*\
  124162. !*** ./node_modules/lodash-es/sample.js ***!
  124163. \******************************************/
  124164. /*! exports provided: default */
  124165. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124166. "use strict";
  124167. __webpack_require__.r(__webpack_exports__);
  124168. /* harmony import */ var _arraySample_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySample.js */ "./node_modules/lodash-es/_arraySample.js");
  124169. /* harmony import */ var _baseSample_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSample.js */ "./node_modules/lodash-es/_baseSample.js");
  124170. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  124171. /**
  124172. * Gets a random element from `collection`.
  124173. *
  124174. * @static
  124175. * @memberOf _
  124176. * @since 2.0.0
  124177. * @category Collection
  124178. * @param {Array|Object} collection The collection to sample.
  124179. * @returns {*} Returns the random element.
  124180. * @example
  124181. *
  124182. * _.sample([1, 2, 3, 4]);
  124183. * // => 2
  124184. */
  124185. function sample(collection) {
  124186. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection) ? _arraySample_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseSample_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  124187. return func(collection);
  124188. }
  124189. /* harmony default export */ __webpack_exports__["default"] = (sample);
  124190. /***/ }),
  124191. /***/ "./node_modules/lodash-es/sampleSize.js":
  124192. /*!**********************************************!*\
  124193. !*** ./node_modules/lodash-es/sampleSize.js ***!
  124194. \**********************************************/
  124195. /*! exports provided: default */
  124196. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124197. "use strict";
  124198. __webpack_require__.r(__webpack_exports__);
  124199. /* harmony import */ var _arraySampleSize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySampleSize.js */ "./node_modules/lodash-es/_arraySampleSize.js");
  124200. /* harmony import */ var _baseSampleSize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSampleSize.js */ "./node_modules/lodash-es/_baseSampleSize.js");
  124201. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  124202. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  124203. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  124204. /**
  124205. * Gets `n` random elements at unique keys from `collection` up to the
  124206. * size of `collection`.
  124207. *
  124208. * @static
  124209. * @memberOf _
  124210. * @since 4.0.0
  124211. * @category Collection
  124212. * @param {Array|Object} collection The collection to sample.
  124213. * @param {number} [n=1] The number of elements to sample.
  124214. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  124215. * @returns {Array} Returns the random elements.
  124216. * @example
  124217. *
  124218. * _.sampleSize([1, 2, 3], 2);
  124219. * // => [3, 1]
  124220. *
  124221. * _.sampleSize([1, 2, 3], 4);
  124222. * // => [2, 3, 1]
  124223. */
  124224. function sampleSize(collection, n, guard) {
  124225. if ((guard ? Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection, n, guard) : n === undefined)) {
  124226. n = 1;
  124227. } else {
  124228. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_4__["default"])(n);
  124229. }
  124230. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection) ? _arraySampleSize_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseSampleSize_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  124231. return func(collection, n);
  124232. }
  124233. /* harmony default export */ __webpack_exports__["default"] = (sampleSize);
  124234. /***/ }),
  124235. /***/ "./node_modules/lodash-es/seq.default.js":
  124236. /*!***********************************************!*\
  124237. !*** ./node_modules/lodash-es/seq.default.js ***!
  124238. \***********************************************/
  124239. /*! exports provided: default */
  124240. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124241. "use strict";
  124242. __webpack_require__.r(__webpack_exports__);
  124243. /* harmony import */ var _wrapperAt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperAt.js */ "./node_modules/lodash-es/wrapperAt.js");
  124244. /* harmony import */ var _chain_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chain.js */ "./node_modules/lodash-es/chain.js");
  124245. /* harmony import */ var _commit_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commit.js */ "./node_modules/lodash-es/commit.js");
  124246. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  124247. /* harmony import */ var _next_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./next.js */ "./node_modules/lodash-es/next.js");
  124248. /* harmony import */ var _plant_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./plant.js */ "./node_modules/lodash-es/plant.js");
  124249. /* harmony import */ var _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./wrapperReverse.js */ "./node_modules/lodash-es/wrapperReverse.js");
  124250. /* harmony import */ var _tap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./tap.js */ "./node_modules/lodash-es/tap.js");
  124251. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  124252. /* harmony import */ var _toIterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./toIterator.js */ "./node_modules/lodash-es/toIterator.js");
  124253. /* harmony import */ var _toJSON_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./toJSON.js */ "./node_modules/lodash-es/toJSON.js");
  124254. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  124255. /* harmony import */ var _valueOf_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./valueOf.js */ "./node_modules/lodash-es/valueOf.js");
  124256. /* harmony import */ var _wrapperChain_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./wrapperChain.js */ "./node_modules/lodash-es/wrapperChain.js");
  124257. /* harmony default export */ __webpack_exports__["default"] = ({
  124258. at: _wrapperAt_js__WEBPACK_IMPORTED_MODULE_0__["default"], chain: _chain_js__WEBPACK_IMPORTED_MODULE_1__["default"], commit: _commit_js__WEBPACK_IMPORTED_MODULE_2__["default"], lodash: _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__["default"], next: _next_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  124259. plant: _plant_js__WEBPACK_IMPORTED_MODULE_5__["default"], reverse: _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_6__["default"], tap: _tap_js__WEBPACK_IMPORTED_MODULE_7__["default"], thru: _thru_js__WEBPACK_IMPORTED_MODULE_8__["default"], toIterator: _toIterator_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  124260. toJSON: _toJSON_js__WEBPACK_IMPORTED_MODULE_10__["default"], value: _wrapperValue_js__WEBPACK_IMPORTED_MODULE_11__["default"], valueOf: _valueOf_js__WEBPACK_IMPORTED_MODULE_12__["default"], wrapperChain: _wrapperChain_js__WEBPACK_IMPORTED_MODULE_13__["default"]
  124261. });
  124262. /***/ }),
  124263. /***/ "./node_modules/lodash-es/seq.js":
  124264. /*!***************************************!*\
  124265. !*** ./node_modules/lodash-es/seq.js ***!
  124266. \***************************************/
  124267. /*! exports provided: at, chain, commit, lodash, next, plant, reverse, tap, thru, toIterator, toJSON, value, valueOf, wrapperChain, default */
  124268. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124269. "use strict";
  124270. __webpack_require__.r(__webpack_exports__);
  124271. /* harmony import */ var _wrapperAt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperAt.js */ "./node_modules/lodash-es/wrapperAt.js");
  124272. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "at", function() { return _wrapperAt_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  124273. /* harmony import */ var _chain_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chain.js */ "./node_modules/lodash-es/chain.js");
  124274. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return _chain_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  124275. /* harmony import */ var _commit_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commit.js */ "./node_modules/lodash-es/commit.js");
  124276. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "commit", function() { return _commit_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  124277. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  124278. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lodash", function() { return _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  124279. /* harmony import */ var _next_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./next.js */ "./node_modules/lodash-es/next.js");
  124280. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "next", function() { return _next_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  124281. /* harmony import */ var _plant_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./plant.js */ "./node_modules/lodash-es/plant.js");
  124282. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "plant", function() { return _plant_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  124283. /* harmony import */ var _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./wrapperReverse.js */ "./node_modules/lodash-es/wrapperReverse.js");
  124284. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reverse", function() { return _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  124285. /* harmony import */ var _tap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./tap.js */ "./node_modules/lodash-es/tap.js");
  124286. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return _tap_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  124287. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  124288. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "thru", function() { return _thru_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  124289. /* harmony import */ var _toIterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./toIterator.js */ "./node_modules/lodash-es/toIterator.js");
  124290. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toIterator", function() { return _toIterator_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  124291. /* harmony import */ var _toJSON_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./toJSON.js */ "./node_modules/lodash-es/toJSON.js");
  124292. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toJSON", function() { return _toJSON_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  124293. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  124294. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "value", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  124295. /* harmony import */ var _valueOf_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./valueOf.js */ "./node_modules/lodash-es/valueOf.js");
  124296. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valueOf", function() { return _valueOf_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  124297. /* harmony import */ var _wrapperChain_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./wrapperChain.js */ "./node_modules/lodash-es/wrapperChain.js");
  124298. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperChain", function() { return _wrapperChain_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  124299. /* harmony import */ var _seq_default_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./seq.default.js */ "./node_modules/lodash-es/seq.default.js");
  124300. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _seq_default_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  124301. /***/ }),
  124302. /***/ "./node_modules/lodash-es/set.js":
  124303. /*!***************************************!*\
  124304. !*** ./node_modules/lodash-es/set.js ***!
  124305. \***************************************/
  124306. /*! exports provided: default */
  124307. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124308. "use strict";
  124309. __webpack_require__.r(__webpack_exports__);
  124310. /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
  124311. /**
  124312. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  124313. * it's created. Arrays are created for missing index properties while objects
  124314. * are created for all other missing properties. Use `_.setWith` to customize
  124315. * `path` creation.
  124316. *
  124317. * **Note:** This method mutates `object`.
  124318. *
  124319. * @static
  124320. * @memberOf _
  124321. * @since 3.7.0
  124322. * @category Object
  124323. * @param {Object} object The object to modify.
  124324. * @param {Array|string} path The path of the property to set.
  124325. * @param {*} value The value to set.
  124326. * @returns {Object} Returns `object`.
  124327. * @example
  124328. *
  124329. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  124330. *
  124331. * _.set(object, 'a[0].b.c', 4);
  124332. * console.log(object.a[0].b.c);
  124333. * // => 4
  124334. *
  124335. * _.set(object, ['x', '0', 'y', 'z'], 5);
  124336. * console.log(object.x[0].y.z);
  124337. * // => 5
  124338. */
  124339. function set(object, path, value) {
  124340. return object == null ? object : Object(_baseSet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, value);
  124341. }
  124342. /* harmony default export */ __webpack_exports__["default"] = (set);
  124343. /***/ }),
  124344. /***/ "./node_modules/lodash-es/setWith.js":
  124345. /*!*******************************************!*\
  124346. !*** ./node_modules/lodash-es/setWith.js ***!
  124347. \*******************************************/
  124348. /*! exports provided: default */
  124349. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124350. "use strict";
  124351. __webpack_require__.r(__webpack_exports__);
  124352. /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
  124353. /**
  124354. * This method is like `_.set` except that it accepts `customizer` which is
  124355. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  124356. * path creation is handled by the method instead. The `customizer` is invoked
  124357. * with three arguments: (nsValue, key, nsObject).
  124358. *
  124359. * **Note:** This method mutates `object`.
  124360. *
  124361. * @static
  124362. * @memberOf _
  124363. * @since 4.0.0
  124364. * @category Object
  124365. * @param {Object} object The object to modify.
  124366. * @param {Array|string} path The path of the property to set.
  124367. * @param {*} value The value to set.
  124368. * @param {Function} [customizer] The function to customize assigned values.
  124369. * @returns {Object} Returns `object`.
  124370. * @example
  124371. *
  124372. * var object = {};
  124373. *
  124374. * _.setWith(object, '[0][1]', 'a', Object);
  124375. * // => { '0': { '1': 'a' } }
  124376. */
  124377. function setWith(object, path, value, customizer) {
  124378. customizer = typeof customizer == 'function' ? customizer : undefined;
  124379. return object == null ? object : Object(_baseSet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, value, customizer);
  124380. }
  124381. /* harmony default export */ __webpack_exports__["default"] = (setWith);
  124382. /***/ }),
  124383. /***/ "./node_modules/lodash-es/shuffle.js":
  124384. /*!*******************************************!*\
  124385. !*** ./node_modules/lodash-es/shuffle.js ***!
  124386. \*******************************************/
  124387. /*! exports provided: default */
  124388. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124389. "use strict";
  124390. __webpack_require__.r(__webpack_exports__);
  124391. /* harmony import */ var _arrayShuffle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayShuffle.js */ "./node_modules/lodash-es/_arrayShuffle.js");
  124392. /* harmony import */ var _baseShuffle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseShuffle.js */ "./node_modules/lodash-es/_baseShuffle.js");
  124393. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  124394. /**
  124395. * Creates an array of shuffled values, using a version of the
  124396. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  124397. *
  124398. * @static
  124399. * @memberOf _
  124400. * @since 0.1.0
  124401. * @category Collection
  124402. * @param {Array|Object} collection The collection to shuffle.
  124403. * @returns {Array} Returns the new shuffled array.
  124404. * @example
  124405. *
  124406. * _.shuffle([1, 2, 3, 4]);
  124407. * // => [4, 1, 3, 2]
  124408. */
  124409. function shuffle(collection) {
  124410. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection) ? _arrayShuffle_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseShuffle_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  124411. return func(collection);
  124412. }
  124413. /* harmony default export */ __webpack_exports__["default"] = (shuffle);
  124414. /***/ }),
  124415. /***/ "./node_modules/lodash-es/size.js":
  124416. /*!****************************************!*\
  124417. !*** ./node_modules/lodash-es/size.js ***!
  124418. \****************************************/
  124419. /*! exports provided: default */
  124420. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124421. "use strict";
  124422. __webpack_require__.r(__webpack_exports__);
  124423. /* harmony import */ var _baseKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseKeys.js */ "./node_modules/lodash-es/_baseKeys.js");
  124424. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  124425. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  124426. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  124427. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  124428. /** `Object#toString` result references. */
  124429. var mapTag = '[object Map]',
  124430. setTag = '[object Set]';
  124431. /**
  124432. * Gets the size of `collection` by returning its length for array-like
  124433. * values or the number of own enumerable string keyed properties for objects.
  124434. *
  124435. * @static
  124436. * @memberOf _
  124437. * @since 0.1.0
  124438. * @category Collection
  124439. * @param {Array|Object|string} collection The collection to inspect.
  124440. * @returns {number} Returns the collection size.
  124441. * @example
  124442. *
  124443. * _.size([1, 2, 3]);
  124444. * // => 3
  124445. *
  124446. * _.size({ 'a': 1, 'b': 2 });
  124447. * // => 2
  124448. *
  124449. * _.size('pebbles');
  124450. * // => 7
  124451. */
  124452. function size(collection) {
  124453. if (collection == null) {
  124454. return 0;
  124455. }
  124456. if (Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection)) {
  124457. return Object(_isString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection) : collection.length;
  124458. }
  124459. var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection);
  124460. if (tag == mapTag || tag == setTag) {
  124461. return collection.size;
  124462. }
  124463. return Object(_baseKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection).length;
  124464. }
  124465. /* harmony default export */ __webpack_exports__["default"] = (size);
  124466. /***/ }),
  124467. /***/ "./node_modules/lodash-es/slice.js":
  124468. /*!*****************************************!*\
  124469. !*** ./node_modules/lodash-es/slice.js ***!
  124470. \*****************************************/
  124471. /*! exports provided: default */
  124472. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124473. "use strict";
  124474. __webpack_require__.r(__webpack_exports__);
  124475. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  124476. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  124477. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  124478. /**
  124479. * Creates a slice of `array` from `start` up to, but not including, `end`.
  124480. *
  124481. * **Note:** This method is used instead of
  124482. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  124483. * returned.
  124484. *
  124485. * @static
  124486. * @memberOf _
  124487. * @since 3.0.0
  124488. * @category Array
  124489. * @param {Array} array The array to slice.
  124490. * @param {number} [start=0] The start position.
  124491. * @param {number} [end=array.length] The end position.
  124492. * @returns {Array} Returns the slice of `array`.
  124493. */
  124494. function slice(array, start, end) {
  124495. var length = array == null ? 0 : array.length;
  124496. if (!length) {
  124497. return [];
  124498. }
  124499. if (end && typeof end != 'number' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, start, end)) {
  124500. start = 0;
  124501. end = length;
  124502. }
  124503. else {
  124504. start = start == null ? 0 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(start);
  124505. end = end === undefined ? length : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(end);
  124506. }
  124507. return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, start, end);
  124508. }
  124509. /* harmony default export */ __webpack_exports__["default"] = (slice);
  124510. /***/ }),
  124511. /***/ "./node_modules/lodash-es/snakeCase.js":
  124512. /*!*********************************************!*\
  124513. !*** ./node_modules/lodash-es/snakeCase.js ***!
  124514. \*********************************************/
  124515. /*! exports provided: default */
  124516. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124517. "use strict";
  124518. __webpack_require__.r(__webpack_exports__);
  124519. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  124520. /**
  124521. * Converts `string` to
  124522. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  124523. *
  124524. * @static
  124525. * @memberOf _
  124526. * @since 3.0.0
  124527. * @category String
  124528. * @param {string} [string=''] The string to convert.
  124529. * @returns {string} Returns the snake cased string.
  124530. * @example
  124531. *
  124532. * _.snakeCase('Foo Bar');
  124533. * // => 'foo_bar'
  124534. *
  124535. * _.snakeCase('fooBar');
  124536. * // => 'foo_bar'
  124537. *
  124538. * _.snakeCase('--FOO-BAR--');
  124539. * // => 'foo_bar'
  124540. */
  124541. var snakeCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
  124542. return result + (index ? '_' : '') + word.toLowerCase();
  124543. });
  124544. /* harmony default export */ __webpack_exports__["default"] = (snakeCase);
  124545. /***/ }),
  124546. /***/ "./node_modules/lodash-es/some.js":
  124547. /*!****************************************!*\
  124548. !*** ./node_modules/lodash-es/some.js ***!
  124549. \****************************************/
  124550. /*! exports provided: default */
  124551. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124552. "use strict";
  124553. __webpack_require__.r(__webpack_exports__);
  124554. /* harmony import */ var _arraySome_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySome.js */ "./node_modules/lodash-es/_arraySome.js");
  124555. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  124556. /* harmony import */ var _baseSome_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseSome.js */ "./node_modules/lodash-es/_baseSome.js");
  124557. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  124558. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  124559. /**
  124560. * Checks if `predicate` returns truthy for **any** element of `collection`.
  124561. * Iteration is stopped once `predicate` returns truthy. The predicate is
  124562. * invoked with three arguments: (value, index|key, collection).
  124563. *
  124564. * @static
  124565. * @memberOf _
  124566. * @since 0.1.0
  124567. * @category Collection
  124568. * @param {Array|Object} collection The collection to iterate over.
  124569. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  124570. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  124571. * @returns {boolean} Returns `true` if any element passes the predicate check,
  124572. * else `false`.
  124573. * @example
  124574. *
  124575. * _.some([null, 0, 'yes', false], Boolean);
  124576. * // => true
  124577. *
  124578. * var users = [
  124579. * { 'user': 'barney', 'active': true },
  124580. * { 'user': 'fred', 'active': false }
  124581. * ];
  124582. *
  124583. * // The `_.matches` iteratee shorthand.
  124584. * _.some(users, { 'user': 'barney', 'active': false });
  124585. * // => false
  124586. *
  124587. * // The `_.matchesProperty` iteratee shorthand.
  124588. * _.some(users, ['active', false]);
  124589. * // => true
  124590. *
  124591. * // The `_.property` iteratee shorthand.
  124592. * _.some(users, 'active');
  124593. * // => true
  124594. */
  124595. function some(collection, predicate, guard) {
  124596. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arraySome_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseSome_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  124597. if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection, predicate, guard)) {
  124598. predicate = undefined;
  124599. }
  124600. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(predicate, 3));
  124601. }
  124602. /* harmony default export */ __webpack_exports__["default"] = (some);
  124603. /***/ }),
  124604. /***/ "./node_modules/lodash-es/sortBy.js":
  124605. /*!******************************************!*\
  124606. !*** ./node_modules/lodash-es/sortBy.js ***!
  124607. \******************************************/
  124608. /*! exports provided: default */
  124609. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124610. "use strict";
  124611. __webpack_require__.r(__webpack_exports__);
  124612. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  124613. /* harmony import */ var _baseOrderBy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseOrderBy.js */ "./node_modules/lodash-es/_baseOrderBy.js");
  124614. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  124615. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  124616. /**
  124617. * Creates an array of elements, sorted in ascending order by the results of
  124618. * running each element in a collection thru each iteratee. This method
  124619. * performs a stable sort, that is, it preserves the original sort order of
  124620. * equal elements. The iteratees are invoked with one argument: (value).
  124621. *
  124622. * @static
  124623. * @memberOf _
  124624. * @since 0.1.0
  124625. * @category Collection
  124626. * @param {Array|Object} collection The collection to iterate over.
  124627. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  124628. * The iteratees to sort by.
  124629. * @returns {Array} Returns the new sorted array.
  124630. * @example
  124631. *
  124632. * var users = [
  124633. * { 'user': 'fred', 'age': 48 },
  124634. * { 'user': 'barney', 'age': 36 },
  124635. * { 'user': 'fred', 'age': 30 },
  124636. * { 'user': 'barney', 'age': 34 }
  124637. * ];
  124638. *
  124639. * _.sortBy(users, [function(o) { return o.user; }]);
  124640. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  124641. *
  124642. * _.sortBy(users, ['user', 'age']);
  124643. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  124644. */
  124645. var sortBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(collection, iteratees) {
  124646. if (collection == null) {
  124647. return [];
  124648. }
  124649. var length = iteratees.length;
  124650. if (length > 1 && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection, iteratees[0], iteratees[1])) {
  124651. iteratees = [];
  124652. } else if (length > 2 && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__["default"])(iteratees[0], iteratees[1], iteratees[2])) {
  124653. iteratees = [iteratees[0]];
  124654. }
  124655. return Object(_baseOrderBy_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratees, 1), []);
  124656. });
  124657. /* harmony default export */ __webpack_exports__["default"] = (sortBy);
  124658. /***/ }),
  124659. /***/ "./node_modules/lodash-es/sortedIndex.js":
  124660. /*!***********************************************!*\
  124661. !*** ./node_modules/lodash-es/sortedIndex.js ***!
  124662. \***********************************************/
  124663. /*! exports provided: default */
  124664. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124665. "use strict";
  124666. __webpack_require__.r(__webpack_exports__);
  124667. /* harmony import */ var _baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndex.js */ "./node_modules/lodash-es/_baseSortedIndex.js");
  124668. /**
  124669. * Uses a binary search to determine the lowest index at which `value`
  124670. * should be inserted into `array` in order to maintain its sort order.
  124671. *
  124672. * @static
  124673. * @memberOf _
  124674. * @since 0.1.0
  124675. * @category Array
  124676. * @param {Array} array The sorted array to inspect.
  124677. * @param {*} value The value to evaluate.
  124678. * @returns {number} Returns the index at which `value` should be inserted
  124679. * into `array`.
  124680. * @example
  124681. *
  124682. * _.sortedIndex([30, 50], 40);
  124683. * // => 1
  124684. */
  124685. function sortedIndex(array, value) {
  124686. return Object(_baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value);
  124687. }
  124688. /* harmony default export */ __webpack_exports__["default"] = (sortedIndex);
  124689. /***/ }),
  124690. /***/ "./node_modules/lodash-es/sortedIndexBy.js":
  124691. /*!*************************************************!*\
  124692. !*** ./node_modules/lodash-es/sortedIndexBy.js ***!
  124693. \*************************************************/
  124694. /*! exports provided: default */
  124695. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124696. "use strict";
  124697. __webpack_require__.r(__webpack_exports__);
  124698. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  124699. /* harmony import */ var _baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSortedIndexBy.js */ "./node_modules/lodash-es/_baseSortedIndexBy.js");
  124700. /**
  124701. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  124702. * which is invoked for `value` and each element of `array` to compute their
  124703. * sort ranking. The iteratee is invoked with one argument: (value).
  124704. *
  124705. * @static
  124706. * @memberOf _
  124707. * @since 4.0.0
  124708. * @category Array
  124709. * @param {Array} array The sorted array to inspect.
  124710. * @param {*} value The value to evaluate.
  124711. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  124712. * @returns {number} Returns the index at which `value` should be inserted
  124713. * into `array`.
  124714. * @example
  124715. *
  124716. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  124717. *
  124718. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  124719. * // => 0
  124720. *
  124721. * // The `_.property` iteratee shorthand.
  124722. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  124723. * // => 0
  124724. */
  124725. function sortedIndexBy(array, value, iteratee) {
  124726. return Object(_baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, value, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2));
  124727. }
  124728. /* harmony default export */ __webpack_exports__["default"] = (sortedIndexBy);
  124729. /***/ }),
  124730. /***/ "./node_modules/lodash-es/sortedIndexOf.js":
  124731. /*!*************************************************!*\
  124732. !*** ./node_modules/lodash-es/sortedIndexOf.js ***!
  124733. \*************************************************/
  124734. /*! exports provided: default */
  124735. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124736. "use strict";
  124737. __webpack_require__.r(__webpack_exports__);
  124738. /* harmony import */ var _baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndex.js */ "./node_modules/lodash-es/_baseSortedIndex.js");
  124739. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  124740. /**
  124741. * This method is like `_.indexOf` except that it performs a binary
  124742. * search on a sorted `array`.
  124743. *
  124744. * @static
  124745. * @memberOf _
  124746. * @since 4.0.0
  124747. * @category Array
  124748. * @param {Array} array The array to inspect.
  124749. * @param {*} value The value to search for.
  124750. * @returns {number} Returns the index of the matched value, else `-1`.
  124751. * @example
  124752. *
  124753. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  124754. * // => 1
  124755. */
  124756. function sortedIndexOf(array, value) {
  124757. var length = array == null ? 0 : array.length;
  124758. if (length) {
  124759. var index = Object(_baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value);
  124760. if (index < length && Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array[index], value)) {
  124761. return index;
  124762. }
  124763. }
  124764. return -1;
  124765. }
  124766. /* harmony default export */ __webpack_exports__["default"] = (sortedIndexOf);
  124767. /***/ }),
  124768. /***/ "./node_modules/lodash-es/sortedLastIndex.js":
  124769. /*!***************************************************!*\
  124770. !*** ./node_modules/lodash-es/sortedLastIndex.js ***!
  124771. \***************************************************/
  124772. /*! exports provided: default */
  124773. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124774. "use strict";
  124775. __webpack_require__.r(__webpack_exports__);
  124776. /* harmony import */ var _baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndex.js */ "./node_modules/lodash-es/_baseSortedIndex.js");
  124777. /**
  124778. * This method is like `_.sortedIndex` except that it returns the highest
  124779. * index at which `value` should be inserted into `array` in order to
  124780. * maintain its sort order.
  124781. *
  124782. * @static
  124783. * @memberOf _
  124784. * @since 3.0.0
  124785. * @category Array
  124786. * @param {Array} array The sorted array to inspect.
  124787. * @param {*} value The value to evaluate.
  124788. * @returns {number} Returns the index at which `value` should be inserted
  124789. * into `array`.
  124790. * @example
  124791. *
  124792. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  124793. * // => 4
  124794. */
  124795. function sortedLastIndex(array, value) {
  124796. return Object(_baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, true);
  124797. }
  124798. /* harmony default export */ __webpack_exports__["default"] = (sortedLastIndex);
  124799. /***/ }),
  124800. /***/ "./node_modules/lodash-es/sortedLastIndexBy.js":
  124801. /*!*****************************************************!*\
  124802. !*** ./node_modules/lodash-es/sortedLastIndexBy.js ***!
  124803. \*****************************************************/
  124804. /*! exports provided: default */
  124805. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124806. "use strict";
  124807. __webpack_require__.r(__webpack_exports__);
  124808. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  124809. /* harmony import */ var _baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSortedIndexBy.js */ "./node_modules/lodash-es/_baseSortedIndexBy.js");
  124810. /**
  124811. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  124812. * which is invoked for `value` and each element of `array` to compute their
  124813. * sort ranking. The iteratee is invoked with one argument: (value).
  124814. *
  124815. * @static
  124816. * @memberOf _
  124817. * @since 4.0.0
  124818. * @category Array
  124819. * @param {Array} array The sorted array to inspect.
  124820. * @param {*} value The value to evaluate.
  124821. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  124822. * @returns {number} Returns the index at which `value` should be inserted
  124823. * into `array`.
  124824. * @example
  124825. *
  124826. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  124827. *
  124828. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  124829. * // => 1
  124830. *
  124831. * // The `_.property` iteratee shorthand.
  124832. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  124833. * // => 1
  124834. */
  124835. function sortedLastIndexBy(array, value, iteratee) {
  124836. return Object(_baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, value, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2), true);
  124837. }
  124838. /* harmony default export */ __webpack_exports__["default"] = (sortedLastIndexBy);
  124839. /***/ }),
  124840. /***/ "./node_modules/lodash-es/sortedLastIndexOf.js":
  124841. /*!*****************************************************!*\
  124842. !*** ./node_modules/lodash-es/sortedLastIndexOf.js ***!
  124843. \*****************************************************/
  124844. /*! exports provided: default */
  124845. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124846. "use strict";
  124847. __webpack_require__.r(__webpack_exports__);
  124848. /* harmony import */ var _baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndex.js */ "./node_modules/lodash-es/_baseSortedIndex.js");
  124849. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  124850. /**
  124851. * This method is like `_.lastIndexOf` except that it performs a binary
  124852. * search on a sorted `array`.
  124853. *
  124854. * @static
  124855. * @memberOf _
  124856. * @since 4.0.0
  124857. * @category Array
  124858. * @param {Array} array The array to inspect.
  124859. * @param {*} value The value to search for.
  124860. * @returns {number} Returns the index of the matched value, else `-1`.
  124861. * @example
  124862. *
  124863. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  124864. * // => 3
  124865. */
  124866. function sortedLastIndexOf(array, value) {
  124867. var length = array == null ? 0 : array.length;
  124868. if (length) {
  124869. var index = Object(_baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, true) - 1;
  124870. if (Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array[index], value)) {
  124871. return index;
  124872. }
  124873. }
  124874. return -1;
  124875. }
  124876. /* harmony default export */ __webpack_exports__["default"] = (sortedLastIndexOf);
  124877. /***/ }),
  124878. /***/ "./node_modules/lodash-es/sortedUniq.js":
  124879. /*!**********************************************!*\
  124880. !*** ./node_modules/lodash-es/sortedUniq.js ***!
  124881. \**********************************************/
  124882. /*! exports provided: default */
  124883. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124884. "use strict";
  124885. __webpack_require__.r(__webpack_exports__);
  124886. /* harmony import */ var _baseSortedUniq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedUniq.js */ "./node_modules/lodash-es/_baseSortedUniq.js");
  124887. /**
  124888. * This method is like `_.uniq` except that it's designed and optimized
  124889. * for sorted arrays.
  124890. *
  124891. * @static
  124892. * @memberOf _
  124893. * @since 4.0.0
  124894. * @category Array
  124895. * @param {Array} array The array to inspect.
  124896. * @returns {Array} Returns the new duplicate free array.
  124897. * @example
  124898. *
  124899. * _.sortedUniq([1, 1, 2]);
  124900. * // => [1, 2]
  124901. */
  124902. function sortedUniq(array) {
  124903. return (array && array.length)
  124904. ? Object(_baseSortedUniq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array)
  124905. : [];
  124906. }
  124907. /* harmony default export */ __webpack_exports__["default"] = (sortedUniq);
  124908. /***/ }),
  124909. /***/ "./node_modules/lodash-es/sortedUniqBy.js":
  124910. /*!************************************************!*\
  124911. !*** ./node_modules/lodash-es/sortedUniqBy.js ***!
  124912. \************************************************/
  124913. /*! exports provided: default */
  124914. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124915. "use strict";
  124916. __webpack_require__.r(__webpack_exports__);
  124917. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  124918. /* harmony import */ var _baseSortedUniq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSortedUniq.js */ "./node_modules/lodash-es/_baseSortedUniq.js");
  124919. /**
  124920. * This method is like `_.uniqBy` except that it's designed and optimized
  124921. * for sorted arrays.
  124922. *
  124923. * @static
  124924. * @memberOf _
  124925. * @since 4.0.0
  124926. * @category Array
  124927. * @param {Array} array The array to inspect.
  124928. * @param {Function} [iteratee] The iteratee invoked per element.
  124929. * @returns {Array} Returns the new duplicate free array.
  124930. * @example
  124931. *
  124932. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  124933. * // => [1.1, 2.3]
  124934. */
  124935. function sortedUniqBy(array, iteratee) {
  124936. return (array && array.length)
  124937. ? Object(_baseSortedUniq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2))
  124938. : [];
  124939. }
  124940. /* harmony default export */ __webpack_exports__["default"] = (sortedUniqBy);
  124941. /***/ }),
  124942. /***/ "./node_modules/lodash-es/split.js":
  124943. /*!*****************************************!*\
  124944. !*** ./node_modules/lodash-es/split.js ***!
  124945. \*****************************************/
  124946. /*! exports provided: default */
  124947. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124948. "use strict";
  124949. __webpack_require__.r(__webpack_exports__);
  124950. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  124951. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  124952. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  124953. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  124954. /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
  124955. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  124956. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  124957. /** Used as references for the maximum length and index of an array. */
  124958. var MAX_ARRAY_LENGTH = 4294967295;
  124959. /**
  124960. * Splits `string` by `separator`.
  124961. *
  124962. * **Note:** This method is based on
  124963. * [`String#split`](https://mdn.io/String/split).
  124964. *
  124965. * @static
  124966. * @memberOf _
  124967. * @since 4.0.0
  124968. * @category String
  124969. * @param {string} [string=''] The string to split.
  124970. * @param {RegExp|string} separator The separator pattern to split by.
  124971. * @param {number} [limit] The length to truncate results to.
  124972. * @returns {Array} Returns the string segments.
  124973. * @example
  124974. *
  124975. * _.split('a-b-c', '-', 2);
  124976. * // => ['a', 'b']
  124977. */
  124978. function split(string, separator, limit) {
  124979. if (limit && typeof limit != 'number' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string, separator, limit)) {
  124980. separator = limit = undefined;
  124981. }
  124982. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  124983. if (!limit) {
  124984. return [];
  124985. }
  124986. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_6__["default"])(string);
  124987. if (string && (
  124988. typeof separator == 'string' ||
  124989. (separator != null && !Object(_isRegExp_js__WEBPACK_IMPORTED_MODULE_4__["default"])(separator))
  124990. )) {
  124991. separator = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(separator);
  124992. if (!separator && Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)) {
  124993. return Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(string), 0, limit);
  124994. }
  124995. }
  124996. return string.split(separator, limit);
  124997. }
  124998. /* harmony default export */ __webpack_exports__["default"] = (split);
  124999. /***/ }),
  125000. /***/ "./node_modules/lodash-es/spread.js":
  125001. /*!******************************************!*\
  125002. !*** ./node_modules/lodash-es/spread.js ***!
  125003. \******************************************/
  125004. /*! exports provided: default */
  125005. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125006. "use strict";
  125007. __webpack_require__.r(__webpack_exports__);
  125008. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  125009. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  125010. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  125011. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  125012. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  125013. /** Error message constants. */
  125014. var FUNC_ERROR_TEXT = 'Expected a function';
  125015. /* Built-in method references for those with the same name as other `lodash` methods. */
  125016. var nativeMax = Math.max;
  125017. /**
  125018. * Creates a function that invokes `func` with the `this` binding of the
  125019. * create function and an array of arguments much like
  125020. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  125021. *
  125022. * **Note:** This method is based on the
  125023. * [spread operator](https://mdn.io/spread_operator).
  125024. *
  125025. * @static
  125026. * @memberOf _
  125027. * @since 3.2.0
  125028. * @category Function
  125029. * @param {Function} func The function to spread arguments over.
  125030. * @param {number} [start=0] The start position of the spread.
  125031. * @returns {Function} Returns the new function.
  125032. * @example
  125033. *
  125034. * var say = _.spread(function(who, what) {
  125035. * return who + ' says ' + what;
  125036. * });
  125037. *
  125038. * say(['fred', 'hello']);
  125039. * // => 'fred says hello'
  125040. *
  125041. * var numbers = Promise.all([
  125042. * Promise.resolve(40),
  125043. * Promise.resolve(36)
  125044. * ]);
  125045. *
  125046. * numbers.then(_.spread(function(x, y) {
  125047. * return x + y;
  125048. * }));
  125049. * // => a Promise of 76
  125050. */
  125051. function spread(func, start) {
  125052. if (typeof func != 'function') {
  125053. throw new TypeError(FUNC_ERROR_TEXT);
  125054. }
  125055. start = start == null ? 0 : nativeMax(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_4__["default"])(start), 0);
  125056. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(args) {
  125057. var array = args[start],
  125058. otherArgs = Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_3__["default"])(args, 0, start);
  125059. if (array) {
  125060. Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_1__["default"])(otherArgs, array);
  125061. }
  125062. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, this, otherArgs);
  125063. });
  125064. }
  125065. /* harmony default export */ __webpack_exports__["default"] = (spread);
  125066. /***/ }),
  125067. /***/ "./node_modules/lodash-es/startCase.js":
  125068. /*!*********************************************!*\
  125069. !*** ./node_modules/lodash-es/startCase.js ***!
  125070. \*********************************************/
  125071. /*! exports provided: default */
  125072. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125073. "use strict";
  125074. __webpack_require__.r(__webpack_exports__);
  125075. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  125076. /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
  125077. /**
  125078. * Converts `string` to
  125079. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  125080. *
  125081. * @static
  125082. * @memberOf _
  125083. * @since 3.1.0
  125084. * @category String
  125085. * @param {string} [string=''] The string to convert.
  125086. * @returns {string} Returns the start cased string.
  125087. * @example
  125088. *
  125089. * _.startCase('--foo-bar--');
  125090. * // => 'Foo Bar'
  125091. *
  125092. * _.startCase('fooBar');
  125093. * // => 'Foo Bar'
  125094. *
  125095. * _.startCase('__FOO_BAR__');
  125096. * // => 'FOO BAR'
  125097. */
  125098. var startCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
  125099. return result + (index ? ' ' : '') + Object(_upperFirst_js__WEBPACK_IMPORTED_MODULE_1__["default"])(word);
  125100. });
  125101. /* harmony default export */ __webpack_exports__["default"] = (startCase);
  125102. /***/ }),
  125103. /***/ "./node_modules/lodash-es/startsWith.js":
  125104. /*!**********************************************!*\
  125105. !*** ./node_modules/lodash-es/startsWith.js ***!
  125106. \**********************************************/
  125107. /*! exports provided: default */
  125108. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125109. "use strict";
  125110. __webpack_require__.r(__webpack_exports__);
  125111. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  125112. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  125113. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  125114. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  125115. /**
  125116. * Checks if `string` starts with the given target string.
  125117. *
  125118. * @static
  125119. * @memberOf _
  125120. * @since 3.0.0
  125121. * @category String
  125122. * @param {string} [string=''] The string to inspect.
  125123. * @param {string} [target] The string to search for.
  125124. * @param {number} [position=0] The position to search from.
  125125. * @returns {boolean} Returns `true` if `string` starts with `target`,
  125126. * else `false`.
  125127. * @example
  125128. *
  125129. * _.startsWith('abc', 'a');
  125130. * // => true
  125131. *
  125132. * _.startsWith('abc', 'b');
  125133. * // => false
  125134. *
  125135. * _.startsWith('abc', 'b', 1);
  125136. * // => true
  125137. */
  125138. function startsWith(string, target, position) {
  125139. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  125140. position = position == null
  125141. ? 0
  125142. : Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(position), 0, string.length);
  125143. target = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(target);
  125144. return string.slice(position, position + target.length) == target;
  125145. }
  125146. /* harmony default export */ __webpack_exports__["default"] = (startsWith);
  125147. /***/ }),
  125148. /***/ "./node_modules/lodash-es/string.default.js":
  125149. /*!**************************************************!*\
  125150. !*** ./node_modules/lodash-es/string.default.js ***!
  125151. \**************************************************/
  125152. /*! exports provided: default */
  125153. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125154. "use strict";
  125155. __webpack_require__.r(__webpack_exports__);
  125156. /* harmony import */ var _camelCase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./camelCase.js */ "./node_modules/lodash-es/camelCase.js");
  125157. /* harmony import */ var _capitalize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./capitalize.js */ "./node_modules/lodash-es/capitalize.js");
  125158. /* harmony import */ var _deburr_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./deburr.js */ "./node_modules/lodash-es/deburr.js");
  125159. /* harmony import */ var _endsWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./endsWith.js */ "./node_modules/lodash-es/endsWith.js");
  125160. /* harmony import */ var _escape_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./escape.js */ "./node_modules/lodash-es/escape.js");
  125161. /* harmony import */ var _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./escapeRegExp.js */ "./node_modules/lodash-es/escapeRegExp.js");
  125162. /* harmony import */ var _kebabCase_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./kebabCase.js */ "./node_modules/lodash-es/kebabCase.js");
  125163. /* harmony import */ var _lowerCase_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lowerCase.js */ "./node_modules/lodash-es/lowerCase.js");
  125164. /* harmony import */ var _lowerFirst_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./lowerFirst.js */ "./node_modules/lodash-es/lowerFirst.js");
  125165. /* harmony import */ var _pad_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./pad.js */ "./node_modules/lodash-es/pad.js");
  125166. /* harmony import */ var _padEnd_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./padEnd.js */ "./node_modules/lodash-es/padEnd.js");
  125167. /* harmony import */ var _padStart_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./padStart.js */ "./node_modules/lodash-es/padStart.js");
  125168. /* harmony import */ var _parseInt_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./parseInt.js */ "./node_modules/lodash-es/parseInt.js");
  125169. /* harmony import */ var _repeat_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./repeat.js */ "./node_modules/lodash-es/repeat.js");
  125170. /* harmony import */ var _replace_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./replace.js */ "./node_modules/lodash-es/replace.js");
  125171. /* harmony import */ var _snakeCase_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./snakeCase.js */ "./node_modules/lodash-es/snakeCase.js");
  125172. /* harmony import */ var _split_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./split.js */ "./node_modules/lodash-es/split.js");
  125173. /* harmony import */ var _startCase_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./startCase.js */ "./node_modules/lodash-es/startCase.js");
  125174. /* harmony import */ var _startsWith_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./startsWith.js */ "./node_modules/lodash-es/startsWith.js");
  125175. /* harmony import */ var _template_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./template.js */ "./node_modules/lodash-es/template.js");
  125176. /* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/lodash-es/templateSettings.js");
  125177. /* harmony import */ var _toLower_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./toLower.js */ "./node_modules/lodash-es/toLower.js");
  125178. /* harmony import */ var _toUpper_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./toUpper.js */ "./node_modules/lodash-es/toUpper.js");
  125179. /* harmony import */ var _trim_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./trim.js */ "./node_modules/lodash-es/trim.js");
  125180. /* harmony import */ var _trimEnd_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./trimEnd.js */ "./node_modules/lodash-es/trimEnd.js");
  125181. /* harmony import */ var _trimStart_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./trimStart.js */ "./node_modules/lodash-es/trimStart.js");
  125182. /* harmony import */ var _truncate_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./truncate.js */ "./node_modules/lodash-es/truncate.js");
  125183. /* harmony import */ var _unescape_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./unescape.js */ "./node_modules/lodash-es/unescape.js");
  125184. /* harmony import */ var _upperCase_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./upperCase.js */ "./node_modules/lodash-es/upperCase.js");
  125185. /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
  125186. /* harmony import */ var _words_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./words.js */ "./node_modules/lodash-es/words.js");
  125187. /* harmony default export */ __webpack_exports__["default"] = ({
  125188. camelCase: _camelCase_js__WEBPACK_IMPORTED_MODULE_0__["default"], capitalize: _capitalize_js__WEBPACK_IMPORTED_MODULE_1__["default"], deburr: _deburr_js__WEBPACK_IMPORTED_MODULE_2__["default"], endsWith: _endsWith_js__WEBPACK_IMPORTED_MODULE_3__["default"], escape: _escape_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  125189. escapeRegExp: _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_5__["default"], kebabCase: _kebabCase_js__WEBPACK_IMPORTED_MODULE_6__["default"], lowerCase: _lowerCase_js__WEBPACK_IMPORTED_MODULE_7__["default"], lowerFirst: _lowerFirst_js__WEBPACK_IMPORTED_MODULE_8__["default"], pad: _pad_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  125190. padEnd: _padEnd_js__WEBPACK_IMPORTED_MODULE_10__["default"], padStart: _padStart_js__WEBPACK_IMPORTED_MODULE_11__["default"], parseInt: _parseInt_js__WEBPACK_IMPORTED_MODULE_12__["default"], repeat: _repeat_js__WEBPACK_IMPORTED_MODULE_13__["default"], replace: _replace_js__WEBPACK_IMPORTED_MODULE_14__["default"],
  125191. snakeCase: _snakeCase_js__WEBPACK_IMPORTED_MODULE_15__["default"], split: _split_js__WEBPACK_IMPORTED_MODULE_16__["default"], startCase: _startCase_js__WEBPACK_IMPORTED_MODULE_17__["default"], startsWith: _startsWith_js__WEBPACK_IMPORTED_MODULE_18__["default"], template: _template_js__WEBPACK_IMPORTED_MODULE_19__["default"],
  125192. templateSettings: _templateSettings_js__WEBPACK_IMPORTED_MODULE_20__["default"], toLower: _toLower_js__WEBPACK_IMPORTED_MODULE_21__["default"], toUpper: _toUpper_js__WEBPACK_IMPORTED_MODULE_22__["default"], trim: _trim_js__WEBPACK_IMPORTED_MODULE_23__["default"], trimEnd: _trimEnd_js__WEBPACK_IMPORTED_MODULE_24__["default"],
  125193. trimStart: _trimStart_js__WEBPACK_IMPORTED_MODULE_25__["default"], truncate: _truncate_js__WEBPACK_IMPORTED_MODULE_26__["default"], unescape: _unescape_js__WEBPACK_IMPORTED_MODULE_27__["default"], upperCase: _upperCase_js__WEBPACK_IMPORTED_MODULE_28__["default"], upperFirst: _upperFirst_js__WEBPACK_IMPORTED_MODULE_29__["default"],
  125194. words: _words_js__WEBPACK_IMPORTED_MODULE_30__["default"]
  125195. });
  125196. /***/ }),
  125197. /***/ "./node_modules/lodash-es/string.js":
  125198. /*!******************************************!*\
  125199. !*** ./node_modules/lodash-es/string.js ***!
  125200. \******************************************/
  125201. /*! exports provided: camelCase, capitalize, deburr, endsWith, escape, escapeRegExp, kebabCase, lowerCase, lowerFirst, pad, padEnd, padStart, parseInt, repeat, replace, snakeCase, split, startCase, startsWith, template, templateSettings, toLower, toUpper, trim, trimEnd, trimStart, truncate, unescape, upperCase, upperFirst, words, default */
  125202. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125203. "use strict";
  125204. __webpack_require__.r(__webpack_exports__);
  125205. /* harmony import */ var _camelCase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./camelCase.js */ "./node_modules/lodash-es/camelCase.js");
  125206. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "camelCase", function() { return _camelCase_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  125207. /* harmony import */ var _capitalize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./capitalize.js */ "./node_modules/lodash-es/capitalize.js");
  125208. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "capitalize", function() { return _capitalize_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  125209. /* harmony import */ var _deburr_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./deburr.js */ "./node_modules/lodash-es/deburr.js");
  125210. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "deburr", function() { return _deburr_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  125211. /* harmony import */ var _endsWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./endsWith.js */ "./node_modules/lodash-es/endsWith.js");
  125212. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return _endsWith_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  125213. /* harmony import */ var _escape_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./escape.js */ "./node_modules/lodash-es/escape.js");
  125214. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return _escape_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  125215. /* harmony import */ var _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./escapeRegExp.js */ "./node_modules/lodash-es/escapeRegExp.js");
  125216. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escapeRegExp", function() { return _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  125217. /* harmony import */ var _kebabCase_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./kebabCase.js */ "./node_modules/lodash-es/kebabCase.js");
  125218. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "kebabCase", function() { return _kebabCase_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  125219. /* harmony import */ var _lowerCase_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lowerCase.js */ "./node_modules/lodash-es/lowerCase.js");
  125220. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerCase", function() { return _lowerCase_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  125221. /* harmony import */ var _lowerFirst_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./lowerFirst.js */ "./node_modules/lodash-es/lowerFirst.js");
  125222. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerFirst", function() { return _lowerFirst_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  125223. /* harmony import */ var _pad_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./pad.js */ "./node_modules/lodash-es/pad.js");
  125224. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return _pad_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  125225. /* harmony import */ var _padEnd_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./padEnd.js */ "./node_modules/lodash-es/padEnd.js");
  125226. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padEnd", function() { return _padEnd_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  125227. /* harmony import */ var _padStart_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./padStart.js */ "./node_modules/lodash-es/padStart.js");
  125228. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padStart", function() { return _padStart_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  125229. /* harmony import */ var _parseInt_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./parseInt.js */ "./node_modules/lodash-es/parseInt.js");
  125230. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseInt", function() { return _parseInt_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  125231. /* harmony import */ var _repeat_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./repeat.js */ "./node_modules/lodash-es/repeat.js");
  125232. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return _repeat_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  125233. /* harmony import */ var _replace_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./replace.js */ "./node_modules/lodash-es/replace.js");
  125234. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "replace", function() { return _replace_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  125235. /* harmony import */ var _snakeCase_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./snakeCase.js */ "./node_modules/lodash-es/snakeCase.js");
  125236. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "snakeCase", function() { return _snakeCase_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  125237. /* harmony import */ var _split_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./split.js */ "./node_modules/lodash-es/split.js");
  125238. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "split", function() { return _split_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  125239. /* harmony import */ var _startCase_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./startCase.js */ "./node_modules/lodash-es/startCase.js");
  125240. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startCase", function() { return _startCase_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  125241. /* harmony import */ var _startsWith_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./startsWith.js */ "./node_modules/lodash-es/startsWith.js");
  125242. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return _startsWith_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  125243. /* harmony import */ var _template_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./template.js */ "./node_modules/lodash-es/template.js");
  125244. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "template", function() { return _template_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  125245. /* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/lodash-es/templateSettings.js");
  125246. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return _templateSettings_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  125247. /* harmony import */ var _toLower_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./toLower.js */ "./node_modules/lodash-es/toLower.js");
  125248. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toLower", function() { return _toLower_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  125249. /* harmony import */ var _toUpper_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./toUpper.js */ "./node_modules/lodash-es/toUpper.js");
  125250. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toUpper", function() { return _toUpper_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  125251. /* harmony import */ var _trim_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./trim.js */ "./node_modules/lodash-es/trim.js");
  125252. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trim", function() { return _trim_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  125253. /* harmony import */ var _trimEnd_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./trimEnd.js */ "./node_modules/lodash-es/trimEnd.js");
  125254. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trimEnd", function() { return _trimEnd_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  125255. /* harmony import */ var _trimStart_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./trimStart.js */ "./node_modules/lodash-es/trimStart.js");
  125256. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trimStart", function() { return _trimStart_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  125257. /* harmony import */ var _truncate_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./truncate.js */ "./node_modules/lodash-es/truncate.js");
  125258. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "truncate", function() { return _truncate_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  125259. /* harmony import */ var _unescape_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./unescape.js */ "./node_modules/lodash-es/unescape.js");
  125260. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return _unescape_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  125261. /* harmony import */ var _upperCase_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./upperCase.js */ "./node_modules/lodash-es/upperCase.js");
  125262. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperCase", function() { return _upperCase_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  125263. /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
  125264. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperFirst", function() { return _upperFirst_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  125265. /* harmony import */ var _words_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./words.js */ "./node_modules/lodash-es/words.js");
  125266. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "words", function() { return _words_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  125267. /* harmony import */ var _string_default_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./string.default.js */ "./node_modules/lodash-es/string.default.js");
  125268. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _string_default_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  125269. /***/ }),
  125270. /***/ "./node_modules/lodash-es/stubArray.js":
  125271. /*!*********************************************!*\
  125272. !*** ./node_modules/lodash-es/stubArray.js ***!
  125273. \*********************************************/
  125274. /*! exports provided: default */
  125275. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125276. "use strict";
  125277. __webpack_require__.r(__webpack_exports__);
  125278. /**
  125279. * This method returns a new empty array.
  125280. *
  125281. * @static
  125282. * @memberOf _
  125283. * @since 4.13.0
  125284. * @category Util
  125285. * @returns {Array} Returns the new empty array.
  125286. * @example
  125287. *
  125288. * var arrays = _.times(2, _.stubArray);
  125289. *
  125290. * console.log(arrays);
  125291. * // => [[], []]
  125292. *
  125293. * console.log(arrays[0] === arrays[1]);
  125294. * // => false
  125295. */
  125296. function stubArray() {
  125297. return [];
  125298. }
  125299. /* harmony default export */ __webpack_exports__["default"] = (stubArray);
  125300. /***/ }),
  125301. /***/ "./node_modules/lodash-es/stubFalse.js":
  125302. /*!*********************************************!*\
  125303. !*** ./node_modules/lodash-es/stubFalse.js ***!
  125304. \*********************************************/
  125305. /*! exports provided: default */
  125306. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125307. "use strict";
  125308. __webpack_require__.r(__webpack_exports__);
  125309. /**
  125310. * This method returns `false`.
  125311. *
  125312. * @static
  125313. * @memberOf _
  125314. * @since 4.13.0
  125315. * @category Util
  125316. * @returns {boolean} Returns `false`.
  125317. * @example
  125318. *
  125319. * _.times(2, _.stubFalse);
  125320. * // => [false, false]
  125321. */
  125322. function stubFalse() {
  125323. return false;
  125324. }
  125325. /* harmony default export */ __webpack_exports__["default"] = (stubFalse);
  125326. /***/ }),
  125327. /***/ "./node_modules/lodash-es/stubObject.js":
  125328. /*!**********************************************!*\
  125329. !*** ./node_modules/lodash-es/stubObject.js ***!
  125330. \**********************************************/
  125331. /*! exports provided: default */
  125332. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125333. "use strict";
  125334. __webpack_require__.r(__webpack_exports__);
  125335. /**
  125336. * This method returns a new empty object.
  125337. *
  125338. * @static
  125339. * @memberOf _
  125340. * @since 4.13.0
  125341. * @category Util
  125342. * @returns {Object} Returns the new empty object.
  125343. * @example
  125344. *
  125345. * var objects = _.times(2, _.stubObject);
  125346. *
  125347. * console.log(objects);
  125348. * // => [{}, {}]
  125349. *
  125350. * console.log(objects[0] === objects[1]);
  125351. * // => false
  125352. */
  125353. function stubObject() {
  125354. return {};
  125355. }
  125356. /* harmony default export */ __webpack_exports__["default"] = (stubObject);
  125357. /***/ }),
  125358. /***/ "./node_modules/lodash-es/stubString.js":
  125359. /*!**********************************************!*\
  125360. !*** ./node_modules/lodash-es/stubString.js ***!
  125361. \**********************************************/
  125362. /*! exports provided: default */
  125363. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125364. "use strict";
  125365. __webpack_require__.r(__webpack_exports__);
  125366. /**
  125367. * This method returns an empty string.
  125368. *
  125369. * @static
  125370. * @memberOf _
  125371. * @since 4.13.0
  125372. * @category Util
  125373. * @returns {string} Returns the empty string.
  125374. * @example
  125375. *
  125376. * _.times(2, _.stubString);
  125377. * // => ['', '']
  125378. */
  125379. function stubString() {
  125380. return '';
  125381. }
  125382. /* harmony default export */ __webpack_exports__["default"] = (stubString);
  125383. /***/ }),
  125384. /***/ "./node_modules/lodash-es/stubTrue.js":
  125385. /*!********************************************!*\
  125386. !*** ./node_modules/lodash-es/stubTrue.js ***!
  125387. \********************************************/
  125388. /*! exports provided: default */
  125389. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125390. "use strict";
  125391. __webpack_require__.r(__webpack_exports__);
  125392. /**
  125393. * This method returns `true`.
  125394. *
  125395. * @static
  125396. * @memberOf _
  125397. * @since 4.13.0
  125398. * @category Util
  125399. * @returns {boolean} Returns `true`.
  125400. * @example
  125401. *
  125402. * _.times(2, _.stubTrue);
  125403. * // => [true, true]
  125404. */
  125405. function stubTrue() {
  125406. return true;
  125407. }
  125408. /* harmony default export */ __webpack_exports__["default"] = (stubTrue);
  125409. /***/ }),
  125410. /***/ "./node_modules/lodash-es/subtract.js":
  125411. /*!********************************************!*\
  125412. !*** ./node_modules/lodash-es/subtract.js ***!
  125413. \********************************************/
  125414. /*! exports provided: default */
  125415. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125416. "use strict";
  125417. __webpack_require__.r(__webpack_exports__);
  125418. /* harmony import */ var _createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createMathOperation.js */ "./node_modules/lodash-es/_createMathOperation.js");
  125419. /**
  125420. * Subtract two numbers.
  125421. *
  125422. * @static
  125423. * @memberOf _
  125424. * @since 4.0.0
  125425. * @category Math
  125426. * @param {number} minuend The first number in a subtraction.
  125427. * @param {number} subtrahend The second number in a subtraction.
  125428. * @returns {number} Returns the difference.
  125429. * @example
  125430. *
  125431. * _.subtract(6, 4);
  125432. * // => 2
  125433. */
  125434. var subtract = Object(_createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(minuend, subtrahend) {
  125435. return minuend - subtrahend;
  125436. }, 0);
  125437. /* harmony default export */ __webpack_exports__["default"] = (subtract);
  125438. /***/ }),
  125439. /***/ "./node_modules/lodash-es/sum.js":
  125440. /*!***************************************!*\
  125441. !*** ./node_modules/lodash-es/sum.js ***!
  125442. \***************************************/
  125443. /*! exports provided: default */
  125444. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125445. "use strict";
  125446. __webpack_require__.r(__webpack_exports__);
  125447. /* harmony import */ var _baseSum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSum.js */ "./node_modules/lodash-es/_baseSum.js");
  125448. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  125449. /**
  125450. * Computes the sum of the values in `array`.
  125451. *
  125452. * @static
  125453. * @memberOf _
  125454. * @since 3.4.0
  125455. * @category Math
  125456. * @param {Array} array The array to iterate over.
  125457. * @returns {number} Returns the sum.
  125458. * @example
  125459. *
  125460. * _.sum([4, 2, 8, 6]);
  125461. * // => 20
  125462. */
  125463. function sum(array) {
  125464. return (array && array.length)
  125465. ? Object(_baseSum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _identity_js__WEBPACK_IMPORTED_MODULE_1__["default"])
  125466. : 0;
  125467. }
  125468. /* harmony default export */ __webpack_exports__["default"] = (sum);
  125469. /***/ }),
  125470. /***/ "./node_modules/lodash-es/sumBy.js":
  125471. /*!*****************************************!*\
  125472. !*** ./node_modules/lodash-es/sumBy.js ***!
  125473. \*****************************************/
  125474. /*! exports provided: default */
  125475. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125476. "use strict";
  125477. __webpack_require__.r(__webpack_exports__);
  125478. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  125479. /* harmony import */ var _baseSum_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSum.js */ "./node_modules/lodash-es/_baseSum.js");
  125480. /**
  125481. * This method is like `_.sum` except that it accepts `iteratee` which is
  125482. * invoked for each element in `array` to generate the value to be summed.
  125483. * The iteratee is invoked with one argument: (value).
  125484. *
  125485. * @static
  125486. * @memberOf _
  125487. * @since 4.0.0
  125488. * @category Math
  125489. * @param {Array} array The array to iterate over.
  125490. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  125491. * @returns {number} Returns the sum.
  125492. * @example
  125493. *
  125494. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  125495. *
  125496. * _.sumBy(objects, function(o) { return o.n; });
  125497. * // => 20
  125498. *
  125499. * // The `_.property` iteratee shorthand.
  125500. * _.sumBy(objects, 'n');
  125501. * // => 20
  125502. */
  125503. function sumBy(array, iteratee) {
  125504. return (array && array.length)
  125505. ? Object(_baseSum_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2))
  125506. : 0;
  125507. }
  125508. /* harmony default export */ __webpack_exports__["default"] = (sumBy);
  125509. /***/ }),
  125510. /***/ "./node_modules/lodash-es/tail.js":
  125511. /*!****************************************!*\
  125512. !*** ./node_modules/lodash-es/tail.js ***!
  125513. \****************************************/
  125514. /*! exports provided: default */
  125515. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125516. "use strict";
  125517. __webpack_require__.r(__webpack_exports__);
  125518. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  125519. /**
  125520. * Gets all but the first element of `array`.
  125521. *
  125522. * @static
  125523. * @memberOf _
  125524. * @since 4.0.0
  125525. * @category Array
  125526. * @param {Array} array The array to query.
  125527. * @returns {Array} Returns the slice of `array`.
  125528. * @example
  125529. *
  125530. * _.tail([1, 2, 3]);
  125531. * // => [2, 3]
  125532. */
  125533. function tail(array) {
  125534. var length = array == null ? 0 : array.length;
  125535. return length ? Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 1, length) : [];
  125536. }
  125537. /* harmony default export */ __webpack_exports__["default"] = (tail);
  125538. /***/ }),
  125539. /***/ "./node_modules/lodash-es/take.js":
  125540. /*!****************************************!*\
  125541. !*** ./node_modules/lodash-es/take.js ***!
  125542. \****************************************/
  125543. /*! exports provided: default */
  125544. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125545. "use strict";
  125546. __webpack_require__.r(__webpack_exports__);
  125547. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  125548. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  125549. /**
  125550. * Creates a slice of `array` with `n` elements taken from the beginning.
  125551. *
  125552. * @static
  125553. * @memberOf _
  125554. * @since 0.1.0
  125555. * @category Array
  125556. * @param {Array} array The array to query.
  125557. * @param {number} [n=1] The number of elements to take.
  125558. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  125559. * @returns {Array} Returns the slice of `array`.
  125560. * @example
  125561. *
  125562. * _.take([1, 2, 3]);
  125563. * // => [1]
  125564. *
  125565. * _.take([1, 2, 3], 2);
  125566. * // => [1, 2]
  125567. *
  125568. * _.take([1, 2, 3], 5);
  125569. * // => [1, 2, 3]
  125570. *
  125571. * _.take([1, 2, 3], 0);
  125572. * // => []
  125573. */
  125574. function take(array, n, guard) {
  125575. if (!(array && array.length)) {
  125576. return [];
  125577. }
  125578. n = (guard || n === undefined) ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n);
  125579. return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 0, n < 0 ? 0 : n);
  125580. }
  125581. /* harmony default export */ __webpack_exports__["default"] = (take);
  125582. /***/ }),
  125583. /***/ "./node_modules/lodash-es/takeRight.js":
  125584. /*!*********************************************!*\
  125585. !*** ./node_modules/lodash-es/takeRight.js ***!
  125586. \*********************************************/
  125587. /*! exports provided: default */
  125588. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125589. "use strict";
  125590. __webpack_require__.r(__webpack_exports__);
  125591. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  125592. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  125593. /**
  125594. * Creates a slice of `array` with `n` elements taken from the end.
  125595. *
  125596. * @static
  125597. * @memberOf _
  125598. * @since 3.0.0
  125599. * @category Array
  125600. * @param {Array} array The array to query.
  125601. * @param {number} [n=1] The number of elements to take.
  125602. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  125603. * @returns {Array} Returns the slice of `array`.
  125604. * @example
  125605. *
  125606. * _.takeRight([1, 2, 3]);
  125607. * // => [3]
  125608. *
  125609. * _.takeRight([1, 2, 3], 2);
  125610. * // => [2, 3]
  125611. *
  125612. * _.takeRight([1, 2, 3], 5);
  125613. * // => [1, 2, 3]
  125614. *
  125615. * _.takeRight([1, 2, 3], 0);
  125616. * // => []
  125617. */
  125618. function takeRight(array, n, guard) {
  125619. var length = array == null ? 0 : array.length;
  125620. if (!length) {
  125621. return [];
  125622. }
  125623. n = (guard || n === undefined) ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n);
  125624. n = length - n;
  125625. return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, n < 0 ? 0 : n, length);
  125626. }
  125627. /* harmony default export */ __webpack_exports__["default"] = (takeRight);
  125628. /***/ }),
  125629. /***/ "./node_modules/lodash-es/takeRightWhile.js":
  125630. /*!**************************************************!*\
  125631. !*** ./node_modules/lodash-es/takeRightWhile.js ***!
  125632. \**************************************************/
  125633. /*! exports provided: default */
  125634. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125635. "use strict";
  125636. __webpack_require__.r(__webpack_exports__);
  125637. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  125638. /* harmony import */ var _baseWhile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseWhile.js */ "./node_modules/lodash-es/_baseWhile.js");
  125639. /**
  125640. * Creates a slice of `array` with elements taken from the end. Elements are
  125641. * taken until `predicate` returns falsey. The predicate is invoked with
  125642. * three arguments: (value, index, array).
  125643. *
  125644. * @static
  125645. * @memberOf _
  125646. * @since 3.0.0
  125647. * @category Array
  125648. * @param {Array} array The array to query.
  125649. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  125650. * @returns {Array} Returns the slice of `array`.
  125651. * @example
  125652. *
  125653. * var users = [
  125654. * { 'user': 'barney', 'active': true },
  125655. * { 'user': 'fred', 'active': false },
  125656. * { 'user': 'pebbles', 'active': false }
  125657. * ];
  125658. *
  125659. * _.takeRightWhile(users, function(o) { return !o.active; });
  125660. * // => objects for ['fred', 'pebbles']
  125661. *
  125662. * // The `_.matches` iteratee shorthand.
  125663. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  125664. * // => objects for ['pebbles']
  125665. *
  125666. * // The `_.matchesProperty` iteratee shorthand.
  125667. * _.takeRightWhile(users, ['active', false]);
  125668. * // => objects for ['fred', 'pebbles']
  125669. *
  125670. * // The `_.property` iteratee shorthand.
  125671. * _.takeRightWhile(users, 'active');
  125672. * // => []
  125673. */
  125674. function takeRightWhile(array, predicate) {
  125675. return (array && array.length)
  125676. ? Object(_baseWhile_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3), false, true)
  125677. : [];
  125678. }
  125679. /* harmony default export */ __webpack_exports__["default"] = (takeRightWhile);
  125680. /***/ }),
  125681. /***/ "./node_modules/lodash-es/takeWhile.js":
  125682. /*!*********************************************!*\
  125683. !*** ./node_modules/lodash-es/takeWhile.js ***!
  125684. \*********************************************/
  125685. /*! exports provided: default */
  125686. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125687. "use strict";
  125688. __webpack_require__.r(__webpack_exports__);
  125689. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  125690. /* harmony import */ var _baseWhile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseWhile.js */ "./node_modules/lodash-es/_baseWhile.js");
  125691. /**
  125692. * Creates a slice of `array` with elements taken from the beginning. Elements
  125693. * are taken until `predicate` returns falsey. The predicate is invoked with
  125694. * three arguments: (value, index, array).
  125695. *
  125696. * @static
  125697. * @memberOf _
  125698. * @since 3.0.0
  125699. * @category Array
  125700. * @param {Array} array The array to query.
  125701. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  125702. * @returns {Array} Returns the slice of `array`.
  125703. * @example
  125704. *
  125705. * var users = [
  125706. * { 'user': 'barney', 'active': false },
  125707. * { 'user': 'fred', 'active': false },
  125708. * { 'user': 'pebbles', 'active': true }
  125709. * ];
  125710. *
  125711. * _.takeWhile(users, function(o) { return !o.active; });
  125712. * // => objects for ['barney', 'fred']
  125713. *
  125714. * // The `_.matches` iteratee shorthand.
  125715. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  125716. * // => objects for ['barney']
  125717. *
  125718. * // The `_.matchesProperty` iteratee shorthand.
  125719. * _.takeWhile(users, ['active', false]);
  125720. * // => objects for ['barney', 'fred']
  125721. *
  125722. * // The `_.property` iteratee shorthand.
  125723. * _.takeWhile(users, 'active');
  125724. * // => []
  125725. */
  125726. function takeWhile(array, predicate) {
  125727. return (array && array.length)
  125728. ? Object(_baseWhile_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3))
  125729. : [];
  125730. }
  125731. /* harmony default export */ __webpack_exports__["default"] = (takeWhile);
  125732. /***/ }),
  125733. /***/ "./node_modules/lodash-es/tap.js":
  125734. /*!***************************************!*\
  125735. !*** ./node_modules/lodash-es/tap.js ***!
  125736. \***************************************/
  125737. /*! exports provided: default */
  125738. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125739. "use strict";
  125740. __webpack_require__.r(__webpack_exports__);
  125741. /**
  125742. * This method invokes `interceptor` and returns `value`. The interceptor
  125743. * is invoked with one argument; (value). The purpose of this method is to
  125744. * "tap into" a method chain sequence in order to modify intermediate results.
  125745. *
  125746. * @static
  125747. * @memberOf _
  125748. * @since 0.1.0
  125749. * @category Seq
  125750. * @param {*} value The value to provide to `interceptor`.
  125751. * @param {Function} interceptor The function to invoke.
  125752. * @returns {*} Returns `value`.
  125753. * @example
  125754. *
  125755. * _([1, 2, 3])
  125756. * .tap(function(array) {
  125757. * // Mutate input array.
  125758. * array.pop();
  125759. * })
  125760. * .reverse()
  125761. * .value();
  125762. * // => [2, 1]
  125763. */
  125764. function tap(value, interceptor) {
  125765. interceptor(value);
  125766. return value;
  125767. }
  125768. /* harmony default export */ __webpack_exports__["default"] = (tap);
  125769. /***/ }),
  125770. /***/ "./node_modules/lodash-es/template.js":
  125771. /*!********************************************!*\
  125772. !*** ./node_modules/lodash-es/template.js ***!
  125773. \********************************************/
  125774. /*! exports provided: default */
  125775. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125776. "use strict";
  125777. __webpack_require__.r(__webpack_exports__);
  125778. /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
  125779. /* harmony import */ var _attempt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./attempt.js */ "./node_modules/lodash-es/attempt.js");
  125780. /* harmony import */ var _baseValues_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseValues.js */ "./node_modules/lodash-es/_baseValues.js");
  125781. /* harmony import */ var _customDefaultsAssignIn_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_customDefaultsAssignIn.js */ "./node_modules/lodash-es/_customDefaultsAssignIn.js");
  125782. /* harmony import */ var _escapeStringChar_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_escapeStringChar.js */ "./node_modules/lodash-es/_escapeStringChar.js");
  125783. /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
  125784. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  125785. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  125786. /* harmony import */ var _reInterpolate_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_reInterpolate.js */ "./node_modules/lodash-es/_reInterpolate.js");
  125787. /* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/lodash-es/templateSettings.js");
  125788. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  125789. /** Error message constants. */
  125790. var INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  125791. /** Used to match empty string literals in compiled template source. */
  125792. var reEmptyStringLeading = /\b__p \+= '';/g,
  125793. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  125794. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  125795. /**
  125796. * Used to validate the `validate` option in `_.template` variable.
  125797. *
  125798. * Forbids characters which could potentially change the meaning of the function argument definition:
  125799. * - "()," (modification of function parameters)
  125800. * - "=" (default value)
  125801. * - "[]{}" (destructuring of function parameters)
  125802. * - "/" (beginning of a comment)
  125803. * - whitespace
  125804. */
  125805. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  125806. /**
  125807. * Used to match
  125808. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  125809. */
  125810. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  125811. /** Used to ensure capturing order of template delimiters. */
  125812. var reNoMatch = /($^)/;
  125813. /** Used to match unescaped characters in compiled string literals. */
  125814. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  125815. /** Used for built-in method references. */
  125816. var objectProto = Object.prototype;
  125817. /** Used to check objects for own properties. */
  125818. var hasOwnProperty = objectProto.hasOwnProperty;
  125819. /**
  125820. * Creates a compiled template function that can interpolate data properties
  125821. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  125822. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  125823. * properties may be accessed as free variables in the template. If a setting
  125824. * object is given, it takes precedence over `_.templateSettings` values.
  125825. *
  125826. * **Note:** In the development build `_.template` utilizes
  125827. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  125828. * for easier debugging.
  125829. *
  125830. * For more information on precompiling templates see
  125831. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  125832. *
  125833. * For more information on Chrome extension sandboxes see
  125834. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  125835. *
  125836. * @static
  125837. * @since 0.1.0
  125838. * @memberOf _
  125839. * @category String
  125840. * @param {string} [string=''] The template string.
  125841. * @param {Object} [options={}] The options object.
  125842. * @param {RegExp} [options.escape=_.templateSettings.escape]
  125843. * The HTML "escape" delimiter.
  125844. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  125845. * The "evaluate" delimiter.
  125846. * @param {Object} [options.imports=_.templateSettings.imports]
  125847. * An object to import into the template as free variables.
  125848. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  125849. * The "interpolate" delimiter.
  125850. * @param {string} [options.sourceURL='templateSources[n]']
  125851. * The sourceURL of the compiled template.
  125852. * @param {string} [options.variable='obj']
  125853. * The data object variable name.
  125854. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  125855. * @returns {Function} Returns the compiled template function.
  125856. * @example
  125857. *
  125858. * // Use the "interpolate" delimiter to create a compiled template.
  125859. * var compiled = _.template('hello <%= user %>!');
  125860. * compiled({ 'user': 'fred' });
  125861. * // => 'hello fred!'
  125862. *
  125863. * // Use the HTML "escape" delimiter to escape data property values.
  125864. * var compiled = _.template('<b><%- value %></b>');
  125865. * compiled({ 'value': '<script>' });
  125866. * // => '<b>&lt;script&gt;</b>'
  125867. *
  125868. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  125869. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  125870. * compiled({ 'users': ['fred', 'barney'] });
  125871. * // => '<li>fred</li><li>barney</li>'
  125872. *
  125873. * // Use the internal `print` function in "evaluate" delimiters.
  125874. * var compiled = _.template('<% print("hello " + user); %>!');
  125875. * compiled({ 'user': 'barney' });
  125876. * // => 'hello barney!'
  125877. *
  125878. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  125879. * // Disable support by replacing the "interpolate" delimiter.
  125880. * var compiled = _.template('hello ${ user }!');
  125881. * compiled({ 'user': 'pebbles' });
  125882. * // => 'hello pebbles!'
  125883. *
  125884. * // Use backslashes to treat delimiters as plain text.
  125885. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  125886. * compiled({ 'value': 'ignored' });
  125887. * // => '<%- value %>'
  125888. *
  125889. * // Use the `imports` option to import `jQuery` as `jq`.
  125890. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  125891. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  125892. * compiled({ 'users': ['fred', 'barney'] });
  125893. * // => '<li>fred</li><li>barney</li>'
  125894. *
  125895. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  125896. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  125897. * compiled(data);
  125898. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  125899. *
  125900. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  125901. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  125902. * compiled.source;
  125903. * // => function(data) {
  125904. * // var __t, __p = '';
  125905. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  125906. * // return __p;
  125907. * // }
  125908. *
  125909. * // Use custom template delimiters.
  125910. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  125911. * var compiled = _.template('hello {{ user }}!');
  125912. * compiled({ 'user': 'mustache' });
  125913. * // => 'hello mustache!'
  125914. *
  125915. * // Use the `source` property to inline compiled templates for meaningful
  125916. * // line numbers in error messages and stack traces.
  125917. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  125918. * var JST = {\
  125919. * "main": ' + _.template(mainText).source + '\
  125920. * };\
  125921. * ');
  125922. */
  125923. function template(string, options, guard) {
  125924. // Based on John Resig's `tmpl` implementation
  125925. // (http://ejohn.org/blog/javascript-micro-templating/)
  125926. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  125927. var settings = _templateSettings_js__WEBPACK_IMPORTED_MODULE_9__["default"].imports._.templateSettings || _templateSettings_js__WEBPACK_IMPORTED_MODULE_9__["default"];
  125928. if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_6__["default"])(string, options, guard)) {
  125929. options = undefined;
  125930. }
  125931. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_10__["default"])(string);
  125932. options = Object(_assignInWith_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options, settings, _customDefaultsAssignIn_js__WEBPACK_IMPORTED_MODULE_3__["default"]);
  125933. var imports = Object(_assignInWith_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options.imports, settings.imports, _customDefaultsAssignIn_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
  125934. importsKeys = Object(_keys_js__WEBPACK_IMPORTED_MODULE_7__["default"])(imports),
  125935. importsValues = Object(_baseValues_js__WEBPACK_IMPORTED_MODULE_2__["default"])(imports, importsKeys);
  125936. var isEscaping,
  125937. isEvaluating,
  125938. index = 0,
  125939. interpolate = options.interpolate || reNoMatch,
  125940. source = "__p += '";
  125941. // Compile the regexp to match each delimiter.
  125942. var reDelimiters = RegExp(
  125943. (options.escape || reNoMatch).source + '|' +
  125944. interpolate.source + '|' +
  125945. (interpolate === _reInterpolate_js__WEBPACK_IMPORTED_MODULE_8__["default"] ? reEsTemplate : reNoMatch).source + '|' +
  125946. (options.evaluate || reNoMatch).source + '|$'
  125947. , 'g');
  125948. // Use a sourceURL for easier debugging.
  125949. // The sourceURL gets injected into the source that's eval-ed, so be careful
  125950. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  125951. // and escape the comment, thus injecting code that gets evaled.
  125952. var sourceURL = hasOwnProperty.call(options, 'sourceURL')
  125953. ? ('//# sourceURL=' +
  125954. (options.sourceURL + '').replace(/\s/g, ' ') +
  125955. '\n')
  125956. : '';
  125957. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  125958. interpolateValue || (interpolateValue = esTemplateValue);
  125959. // Escape characters that can't be included in string literals.
  125960. source += string.slice(index, offset).replace(reUnescapedString, _escapeStringChar_js__WEBPACK_IMPORTED_MODULE_4__["default"]);
  125961. // Replace delimiters with snippets.
  125962. if (escapeValue) {
  125963. isEscaping = true;
  125964. source += "' +\n__e(" + escapeValue + ") +\n'";
  125965. }
  125966. if (evaluateValue) {
  125967. isEvaluating = true;
  125968. source += "';\n" + evaluateValue + ";\n__p += '";
  125969. }
  125970. if (interpolateValue) {
  125971. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  125972. }
  125973. index = offset + match.length;
  125974. // The JS engine embedded in Adobe products needs `match` returned in
  125975. // order to produce the correct `offset` value.
  125976. return match;
  125977. });
  125978. source += "';\n";
  125979. // If `variable` is not specified wrap a with-statement around the generated
  125980. // code to add the data object to the top of the scope chain.
  125981. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  125982. if (!variable) {
  125983. source = 'with (obj) {\n' + source + '\n}\n';
  125984. }
  125985. // Throw an error if a forbidden character was found in `variable`, to prevent
  125986. // potential command injection attacks.
  125987. else if (reForbiddenIdentifierChars.test(variable)) {
  125988. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  125989. }
  125990. // Cleanup code by stripping empty strings.
  125991. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  125992. .replace(reEmptyStringMiddle, '$1')
  125993. .replace(reEmptyStringTrailing, '$1;');
  125994. // Frame code as the function body.
  125995. source = 'function(' + (variable || 'obj') + ') {\n' +
  125996. (variable
  125997. ? ''
  125998. : 'obj || (obj = {});\n'
  125999. ) +
  126000. "var __t, __p = ''" +
  126001. (isEscaping
  126002. ? ', __e = _.escape'
  126003. : ''
  126004. ) +
  126005. (isEvaluating
  126006. ? ', __j = Array.prototype.join;\n' +
  126007. "function print() { __p += __j.call(arguments, '') }\n"
  126008. : ';\n'
  126009. ) +
  126010. source +
  126011. 'return __p\n}';
  126012. var result = Object(_attempt_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function() {
  126013. return Function(importsKeys, sourceURL + 'return ' + source)
  126014. .apply(undefined, importsValues);
  126015. });
  126016. // Provide the compiled function's source by its `toString` method or
  126017. // the `source` property as a convenience for inlining compiled templates.
  126018. result.source = source;
  126019. if (Object(_isError_js__WEBPACK_IMPORTED_MODULE_5__["default"])(result)) {
  126020. throw result;
  126021. }
  126022. return result;
  126023. }
  126024. /* harmony default export */ __webpack_exports__["default"] = (template);
  126025. /***/ }),
  126026. /***/ "./node_modules/lodash-es/templateSettings.js":
  126027. /*!****************************************************!*\
  126028. !*** ./node_modules/lodash-es/templateSettings.js ***!
  126029. \****************************************************/
  126030. /*! exports provided: default */
  126031. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126032. "use strict";
  126033. __webpack_require__.r(__webpack_exports__);
  126034. /* harmony import */ var _escape_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./escape.js */ "./node_modules/lodash-es/escape.js");
  126035. /* harmony import */ var _reEscape_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_reEscape.js */ "./node_modules/lodash-es/_reEscape.js");
  126036. /* harmony import */ var _reEvaluate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_reEvaluate.js */ "./node_modules/lodash-es/_reEvaluate.js");
  126037. /* harmony import */ var _reInterpolate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_reInterpolate.js */ "./node_modules/lodash-es/_reInterpolate.js");
  126038. /**
  126039. * By default, the template delimiters used by lodash are like those in
  126040. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  126041. * following template settings to use alternative delimiters.
  126042. *
  126043. * @static
  126044. * @memberOf _
  126045. * @type {Object}
  126046. */
  126047. var templateSettings = {
  126048. /**
  126049. * Used to detect `data` property values to be HTML-escaped.
  126050. *
  126051. * @memberOf _.templateSettings
  126052. * @type {RegExp}
  126053. */
  126054. 'escape': _reEscape_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  126055. /**
  126056. * Used to detect code to be evaluated.
  126057. *
  126058. * @memberOf _.templateSettings
  126059. * @type {RegExp}
  126060. */
  126061. 'evaluate': _reEvaluate_js__WEBPACK_IMPORTED_MODULE_2__["default"],
  126062. /**
  126063. * Used to detect `data` property values to inject.
  126064. *
  126065. * @memberOf _.templateSettings
  126066. * @type {RegExp}
  126067. */
  126068. 'interpolate': _reInterpolate_js__WEBPACK_IMPORTED_MODULE_3__["default"],
  126069. /**
  126070. * Used to reference the data object in the template text.
  126071. *
  126072. * @memberOf _.templateSettings
  126073. * @type {string}
  126074. */
  126075. 'variable': '',
  126076. /**
  126077. * Used to import variables into the compiled template.
  126078. *
  126079. * @memberOf _.templateSettings
  126080. * @type {Object}
  126081. */
  126082. 'imports': {
  126083. /**
  126084. * A reference to the `lodash` function.
  126085. *
  126086. * @memberOf _.templateSettings.imports
  126087. * @type {Function}
  126088. */
  126089. '_': { 'escape': _escape_js__WEBPACK_IMPORTED_MODULE_0__["default"] }
  126090. }
  126091. };
  126092. /* harmony default export */ __webpack_exports__["default"] = (templateSettings);
  126093. /***/ }),
  126094. /***/ "./node_modules/lodash-es/throttle.js":
  126095. /*!********************************************!*\
  126096. !*** ./node_modules/lodash-es/throttle.js ***!
  126097. \********************************************/
  126098. /*! exports provided: default */
  126099. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126100. "use strict";
  126101. __webpack_require__.r(__webpack_exports__);
  126102. /* harmony import */ var _debounce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./debounce.js */ "./node_modules/lodash-es/debounce.js");
  126103. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  126104. /** Error message constants. */
  126105. var FUNC_ERROR_TEXT = 'Expected a function';
  126106. /**
  126107. * Creates a throttled function that only invokes `func` at most once per
  126108. * every `wait` milliseconds. The throttled function comes with a `cancel`
  126109. * method to cancel delayed `func` invocations and a `flush` method to
  126110. * immediately invoke them. Provide `options` to indicate whether `func`
  126111. * should be invoked on the leading and/or trailing edge of the `wait`
  126112. * timeout. The `func` is invoked with the last arguments provided to the
  126113. * throttled function. Subsequent calls to the throttled function return the
  126114. * result of the last `func` invocation.
  126115. *
  126116. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  126117. * invoked on the trailing edge of the timeout only if the throttled function
  126118. * is invoked more than once during the `wait` timeout.
  126119. *
  126120. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  126121. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  126122. *
  126123. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  126124. * for details over the differences between `_.throttle` and `_.debounce`.
  126125. *
  126126. * @static
  126127. * @memberOf _
  126128. * @since 0.1.0
  126129. * @category Function
  126130. * @param {Function} func The function to throttle.
  126131. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  126132. * @param {Object} [options={}] The options object.
  126133. * @param {boolean} [options.leading=true]
  126134. * Specify invoking on the leading edge of the timeout.
  126135. * @param {boolean} [options.trailing=true]
  126136. * Specify invoking on the trailing edge of the timeout.
  126137. * @returns {Function} Returns the new throttled function.
  126138. * @example
  126139. *
  126140. * // Avoid excessively updating the position while scrolling.
  126141. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  126142. *
  126143. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  126144. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  126145. * jQuery(element).on('click', throttled);
  126146. *
  126147. * // Cancel the trailing throttled invocation.
  126148. * jQuery(window).on('popstate', throttled.cancel);
  126149. */
  126150. function throttle(func, wait, options) {
  126151. var leading = true,
  126152. trailing = true;
  126153. if (typeof func != 'function') {
  126154. throw new TypeError(FUNC_ERROR_TEXT);
  126155. }
  126156. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(options)) {
  126157. leading = 'leading' in options ? !!options.leading : leading;
  126158. trailing = 'trailing' in options ? !!options.trailing : trailing;
  126159. }
  126160. return Object(_debounce_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, wait, {
  126161. 'leading': leading,
  126162. 'maxWait': wait,
  126163. 'trailing': trailing
  126164. });
  126165. }
  126166. /* harmony default export */ __webpack_exports__["default"] = (throttle);
  126167. /***/ }),
  126168. /***/ "./node_modules/lodash-es/thru.js":
  126169. /*!****************************************!*\
  126170. !*** ./node_modules/lodash-es/thru.js ***!
  126171. \****************************************/
  126172. /*! exports provided: default */
  126173. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126174. "use strict";
  126175. __webpack_require__.r(__webpack_exports__);
  126176. /**
  126177. * This method is like `_.tap` except that it returns the result of `interceptor`.
  126178. * The purpose of this method is to "pass thru" values replacing intermediate
  126179. * results in a method chain sequence.
  126180. *
  126181. * @static
  126182. * @memberOf _
  126183. * @since 3.0.0
  126184. * @category Seq
  126185. * @param {*} value The value to provide to `interceptor`.
  126186. * @param {Function} interceptor The function to invoke.
  126187. * @returns {*} Returns the result of `interceptor`.
  126188. * @example
  126189. *
  126190. * _(' abc ')
  126191. * .chain()
  126192. * .trim()
  126193. * .thru(function(value) {
  126194. * return [value];
  126195. * })
  126196. * .value();
  126197. * // => ['abc']
  126198. */
  126199. function thru(value, interceptor) {
  126200. return interceptor(value);
  126201. }
  126202. /* harmony default export */ __webpack_exports__["default"] = (thru);
  126203. /***/ }),
  126204. /***/ "./node_modules/lodash-es/times.js":
  126205. /*!*****************************************!*\
  126206. !*** ./node_modules/lodash-es/times.js ***!
  126207. \*****************************************/
  126208. /*! exports provided: default */
  126209. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126210. "use strict";
  126211. __webpack_require__.r(__webpack_exports__);
  126212. /* harmony import */ var _baseTimes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseTimes.js */ "./node_modules/lodash-es/_baseTimes.js");
  126213. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  126214. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  126215. /** Used as references for various `Number` constants. */
  126216. var MAX_SAFE_INTEGER = 9007199254740991;
  126217. /** Used as references for the maximum length and index of an array. */
  126218. var MAX_ARRAY_LENGTH = 4294967295;
  126219. /* Built-in method references for those with the same name as other `lodash` methods. */
  126220. var nativeMin = Math.min;
  126221. /**
  126222. * Invokes the iteratee `n` times, returning an array of the results of
  126223. * each invocation. The iteratee is invoked with one argument; (index).
  126224. *
  126225. * @static
  126226. * @since 0.1.0
  126227. * @memberOf _
  126228. * @category Util
  126229. * @param {number} n The number of times to invoke `iteratee`.
  126230. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  126231. * @returns {Array} Returns the array of results.
  126232. * @example
  126233. *
  126234. * _.times(3, String);
  126235. * // => ['0', '1', '2']
  126236. *
  126237. * _.times(4, _.constant(0));
  126238. * // => [0, 0, 0, 0]
  126239. */
  126240. function times(n, iteratee) {
  126241. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(n);
  126242. if (n < 1 || n > MAX_SAFE_INTEGER) {
  126243. return [];
  126244. }
  126245. var index = MAX_ARRAY_LENGTH,
  126246. length = nativeMin(n, MAX_ARRAY_LENGTH);
  126247. iteratee = Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee);
  126248. n -= MAX_ARRAY_LENGTH;
  126249. var result = Object(_baseTimes_js__WEBPACK_IMPORTED_MODULE_0__["default"])(length, iteratee);
  126250. while (++index < n) {
  126251. iteratee(index);
  126252. }
  126253. return result;
  126254. }
  126255. /* harmony default export */ __webpack_exports__["default"] = (times);
  126256. /***/ }),
  126257. /***/ "./node_modules/lodash-es/toArray.js":
  126258. /*!*******************************************!*\
  126259. !*** ./node_modules/lodash-es/toArray.js ***!
  126260. \*******************************************/
  126261. /*! exports provided: default */
  126262. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126263. "use strict";
  126264. __webpack_require__.r(__webpack_exports__);
  126265. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  126266. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  126267. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  126268. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  126269. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  126270. /* harmony import */ var _iteratorToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_iteratorToArray.js */ "./node_modules/lodash-es/_iteratorToArray.js");
  126271. /* harmony import */ var _mapToArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_mapToArray.js */ "./node_modules/lodash-es/_mapToArray.js");
  126272. /* harmony import */ var _setToArray_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_setToArray.js */ "./node_modules/lodash-es/_setToArray.js");
  126273. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  126274. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  126275. /** `Object#toString` result references. */
  126276. var mapTag = '[object Map]',
  126277. setTag = '[object Set]';
  126278. /** Built-in value references. */
  126279. var symIterator = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].iterator : undefined;
  126280. /**
  126281. * Converts `value` to an array.
  126282. *
  126283. * @static
  126284. * @since 0.1.0
  126285. * @memberOf _
  126286. * @category Lang
  126287. * @param {*} value The value to convert.
  126288. * @returns {Array} Returns the converted array.
  126289. * @example
  126290. *
  126291. * _.toArray({ 'a': 1, 'b': 2 });
  126292. * // => [1, 2]
  126293. *
  126294. * _.toArray('abc');
  126295. * // => ['a', 'b', 'c']
  126296. *
  126297. * _.toArray(1);
  126298. * // => []
  126299. *
  126300. * _.toArray(null);
  126301. * // => []
  126302. */
  126303. function toArray(value) {
  126304. if (!value) {
  126305. return [];
  126306. }
  126307. if (Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value)) {
  126308. return Object(_isString_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value) ? Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_8__["default"])(value) : Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
  126309. }
  126310. if (symIterator && value[symIterator]) {
  126311. return Object(_iteratorToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value[symIterator]());
  126312. }
  126313. var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value),
  126314. func = tag == mapTag ? _mapToArray_js__WEBPACK_IMPORTED_MODULE_6__["default"] : (tag == setTag ? _setToArray_js__WEBPACK_IMPORTED_MODULE_7__["default"] : _values_js__WEBPACK_IMPORTED_MODULE_9__["default"]);
  126315. return func(value);
  126316. }
  126317. /* harmony default export */ __webpack_exports__["default"] = (toArray);
  126318. /***/ }),
  126319. /***/ "./node_modules/lodash-es/toFinite.js":
  126320. /*!********************************************!*\
  126321. !*** ./node_modules/lodash-es/toFinite.js ***!
  126322. \********************************************/
  126323. /*! exports provided: default */
  126324. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126325. "use strict";
  126326. __webpack_require__.r(__webpack_exports__);
  126327. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  126328. /** Used as references for various `Number` constants. */
  126329. var INFINITY = 1 / 0,
  126330. MAX_INTEGER = 1.7976931348623157e+308;
  126331. /**
  126332. * Converts `value` to a finite number.
  126333. *
  126334. * @static
  126335. * @memberOf _
  126336. * @since 4.12.0
  126337. * @category Lang
  126338. * @param {*} value The value to convert.
  126339. * @returns {number} Returns the converted number.
  126340. * @example
  126341. *
  126342. * _.toFinite(3.2);
  126343. * // => 3.2
  126344. *
  126345. * _.toFinite(Number.MIN_VALUE);
  126346. * // => 5e-324
  126347. *
  126348. * _.toFinite(Infinity);
  126349. * // => 1.7976931348623157e+308
  126350. *
  126351. * _.toFinite('3.2');
  126352. * // => 3.2
  126353. */
  126354. function toFinite(value) {
  126355. if (!value) {
  126356. return value === 0 ? value : 0;
  126357. }
  126358. value = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  126359. if (value === INFINITY || value === -INFINITY) {
  126360. var sign = (value < 0 ? -1 : 1);
  126361. return sign * MAX_INTEGER;
  126362. }
  126363. return value === value ? value : 0;
  126364. }
  126365. /* harmony default export */ __webpack_exports__["default"] = (toFinite);
  126366. /***/ }),
  126367. /***/ "./node_modules/lodash-es/toInteger.js":
  126368. /*!*********************************************!*\
  126369. !*** ./node_modules/lodash-es/toInteger.js ***!
  126370. \*********************************************/
  126371. /*! exports provided: default */
  126372. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126373. "use strict";
  126374. __webpack_require__.r(__webpack_exports__);
  126375. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  126376. /**
  126377. * Converts `value` to an integer.
  126378. *
  126379. * **Note:** This method is loosely based on
  126380. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  126381. *
  126382. * @static
  126383. * @memberOf _
  126384. * @since 4.0.0
  126385. * @category Lang
  126386. * @param {*} value The value to convert.
  126387. * @returns {number} Returns the converted integer.
  126388. * @example
  126389. *
  126390. * _.toInteger(3.2);
  126391. * // => 3
  126392. *
  126393. * _.toInteger(Number.MIN_VALUE);
  126394. * // => 0
  126395. *
  126396. * _.toInteger(Infinity);
  126397. * // => 1.7976931348623157e+308
  126398. *
  126399. * _.toInteger('3.2');
  126400. * // => 3
  126401. */
  126402. function toInteger(value) {
  126403. var result = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value),
  126404. remainder = result % 1;
  126405. return result === result ? (remainder ? result - remainder : result) : 0;
  126406. }
  126407. /* harmony default export */ __webpack_exports__["default"] = (toInteger);
  126408. /***/ }),
  126409. /***/ "./node_modules/lodash-es/toIterator.js":
  126410. /*!**********************************************!*\
  126411. !*** ./node_modules/lodash-es/toIterator.js ***!
  126412. \**********************************************/
  126413. /*! exports provided: default */
  126414. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126415. "use strict";
  126416. __webpack_require__.r(__webpack_exports__);
  126417. /**
  126418. * Enables the wrapper to be iterable.
  126419. *
  126420. * @name Symbol.iterator
  126421. * @memberOf _
  126422. * @since 4.0.0
  126423. * @category Seq
  126424. * @returns {Object} Returns the wrapper object.
  126425. * @example
  126426. *
  126427. * var wrapped = _([1, 2]);
  126428. *
  126429. * wrapped[Symbol.iterator]() === wrapped;
  126430. * // => true
  126431. *
  126432. * Array.from(wrapped);
  126433. * // => [1, 2]
  126434. */
  126435. function wrapperToIterator() {
  126436. return this;
  126437. }
  126438. /* harmony default export */ __webpack_exports__["default"] = (wrapperToIterator);
  126439. /***/ }),
  126440. /***/ "./node_modules/lodash-es/toJSON.js":
  126441. /*!******************************************!*\
  126442. !*** ./node_modules/lodash-es/toJSON.js ***!
  126443. \******************************************/
  126444. /*! exports provided: default */
  126445. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126446. "use strict";
  126447. __webpack_require__.r(__webpack_exports__);
  126448. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  126449. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  126450. /***/ }),
  126451. /***/ "./node_modules/lodash-es/toLength.js":
  126452. /*!********************************************!*\
  126453. !*** ./node_modules/lodash-es/toLength.js ***!
  126454. \********************************************/
  126455. /*! exports provided: default */
  126456. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126457. "use strict";
  126458. __webpack_require__.r(__webpack_exports__);
  126459. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  126460. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  126461. /** Used as references for the maximum length and index of an array. */
  126462. var MAX_ARRAY_LENGTH = 4294967295;
  126463. /**
  126464. * Converts `value` to an integer suitable for use as the length of an
  126465. * array-like object.
  126466. *
  126467. * **Note:** This method is based on
  126468. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  126469. *
  126470. * @static
  126471. * @memberOf _
  126472. * @since 4.0.0
  126473. * @category Lang
  126474. * @param {*} value The value to convert.
  126475. * @returns {number} Returns the converted integer.
  126476. * @example
  126477. *
  126478. * _.toLength(3.2);
  126479. * // => 3
  126480. *
  126481. * _.toLength(Number.MIN_VALUE);
  126482. * // => 0
  126483. *
  126484. * _.toLength(Infinity);
  126485. * // => 4294967295
  126486. *
  126487. * _.toLength('3.2');
  126488. * // => 3
  126489. */
  126490. function toLength(value) {
  126491. return value ? Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value), 0, MAX_ARRAY_LENGTH) : 0;
  126492. }
  126493. /* harmony default export */ __webpack_exports__["default"] = (toLength);
  126494. /***/ }),
  126495. /***/ "./node_modules/lodash-es/toLower.js":
  126496. /*!*******************************************!*\
  126497. !*** ./node_modules/lodash-es/toLower.js ***!
  126498. \*******************************************/
  126499. /*! exports provided: default */
  126500. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126501. "use strict";
  126502. __webpack_require__.r(__webpack_exports__);
  126503. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  126504. /**
  126505. * Converts `string`, as a whole, to lower case just like
  126506. * [String#toLowerCase](https://mdn.io/toLowerCase).
  126507. *
  126508. * @static
  126509. * @memberOf _
  126510. * @since 4.0.0
  126511. * @category String
  126512. * @param {string} [string=''] The string to convert.
  126513. * @returns {string} Returns the lower cased string.
  126514. * @example
  126515. *
  126516. * _.toLower('--Foo-Bar--');
  126517. * // => '--foo-bar--'
  126518. *
  126519. * _.toLower('fooBar');
  126520. * // => 'foobar'
  126521. *
  126522. * _.toLower('__FOO_BAR__');
  126523. * // => '__foo_bar__'
  126524. */
  126525. function toLower(value) {
  126526. return Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value).toLowerCase();
  126527. }
  126528. /* harmony default export */ __webpack_exports__["default"] = (toLower);
  126529. /***/ }),
  126530. /***/ "./node_modules/lodash-es/toNumber.js":
  126531. /*!********************************************!*\
  126532. !*** ./node_modules/lodash-es/toNumber.js ***!
  126533. \********************************************/
  126534. /*! exports provided: default */
  126535. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126536. "use strict";
  126537. __webpack_require__.r(__webpack_exports__);
  126538. /* harmony import */ var _baseTrim_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseTrim.js */ "./node_modules/lodash-es/_baseTrim.js");
  126539. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  126540. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  126541. /** Used as references for various `Number` constants. */
  126542. var NAN = 0 / 0;
  126543. /** Used to detect bad signed hexadecimal string values. */
  126544. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  126545. /** Used to detect binary string values. */
  126546. var reIsBinary = /^0b[01]+$/i;
  126547. /** Used to detect octal string values. */
  126548. var reIsOctal = /^0o[0-7]+$/i;
  126549. /** Built-in method references without a dependency on `root`. */
  126550. var freeParseInt = parseInt;
  126551. /**
  126552. * Converts `value` to a number.
  126553. *
  126554. * @static
  126555. * @memberOf _
  126556. * @since 4.0.0
  126557. * @category Lang
  126558. * @param {*} value The value to process.
  126559. * @returns {number} Returns the number.
  126560. * @example
  126561. *
  126562. * _.toNumber(3.2);
  126563. * // => 3.2
  126564. *
  126565. * _.toNumber(Number.MIN_VALUE);
  126566. * // => 5e-324
  126567. *
  126568. * _.toNumber(Infinity);
  126569. * // => Infinity
  126570. *
  126571. * _.toNumber('3.2');
  126572. * // => 3.2
  126573. */
  126574. function toNumber(value) {
  126575. if (typeof value == 'number') {
  126576. return value;
  126577. }
  126578. if (Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value)) {
  126579. return NAN;
  126580. }
  126581. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  126582. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  126583. value = Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other) ? (other + '') : other;
  126584. }
  126585. if (typeof value != 'string') {
  126586. return value === 0 ? value : +value;
  126587. }
  126588. value = Object(_baseTrim_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  126589. var isBinary = reIsBinary.test(value);
  126590. return (isBinary || reIsOctal.test(value))
  126591. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  126592. : (reIsBadHex.test(value) ? NAN : +value);
  126593. }
  126594. /* harmony default export */ __webpack_exports__["default"] = (toNumber);
  126595. /***/ }),
  126596. /***/ "./node_modules/lodash-es/toPairs.js":
  126597. /*!*******************************************!*\
  126598. !*** ./node_modules/lodash-es/toPairs.js ***!
  126599. \*******************************************/
  126600. /*! exports provided: default */
  126601. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126602. "use strict";
  126603. __webpack_require__.r(__webpack_exports__);
  126604. /* harmony import */ var _createToPairs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createToPairs.js */ "./node_modules/lodash-es/_createToPairs.js");
  126605. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  126606. /**
  126607. * Creates an array of own enumerable string keyed-value pairs for `object`
  126608. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  126609. * entries are returned.
  126610. *
  126611. * @static
  126612. * @memberOf _
  126613. * @since 4.0.0
  126614. * @alias entries
  126615. * @category Object
  126616. * @param {Object} object The object to query.
  126617. * @returns {Array} Returns the key-value pairs.
  126618. * @example
  126619. *
  126620. * function Foo() {
  126621. * this.a = 1;
  126622. * this.b = 2;
  126623. * }
  126624. *
  126625. * Foo.prototype.c = 3;
  126626. *
  126627. * _.toPairs(new Foo);
  126628. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  126629. */
  126630. var toPairs = Object(_createToPairs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  126631. /* harmony default export */ __webpack_exports__["default"] = (toPairs);
  126632. /***/ }),
  126633. /***/ "./node_modules/lodash-es/toPairsIn.js":
  126634. /*!*********************************************!*\
  126635. !*** ./node_modules/lodash-es/toPairsIn.js ***!
  126636. \*********************************************/
  126637. /*! exports provided: default */
  126638. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126639. "use strict";
  126640. __webpack_require__.r(__webpack_exports__);
  126641. /* harmony import */ var _createToPairs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createToPairs.js */ "./node_modules/lodash-es/_createToPairs.js");
  126642. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  126643. /**
  126644. * Creates an array of own and inherited enumerable string keyed-value pairs
  126645. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  126646. * or set, its entries are returned.
  126647. *
  126648. * @static
  126649. * @memberOf _
  126650. * @since 4.0.0
  126651. * @alias entriesIn
  126652. * @category Object
  126653. * @param {Object} object The object to query.
  126654. * @returns {Array} Returns the key-value pairs.
  126655. * @example
  126656. *
  126657. * function Foo() {
  126658. * this.a = 1;
  126659. * this.b = 2;
  126660. * }
  126661. *
  126662. * Foo.prototype.c = 3;
  126663. *
  126664. * _.toPairsIn(new Foo);
  126665. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  126666. */
  126667. var toPairsIn = Object(_createToPairs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  126668. /* harmony default export */ __webpack_exports__["default"] = (toPairsIn);
  126669. /***/ }),
  126670. /***/ "./node_modules/lodash-es/toPath.js":
  126671. /*!******************************************!*\
  126672. !*** ./node_modules/lodash-es/toPath.js ***!
  126673. \******************************************/
  126674. /*! exports provided: default */
  126675. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126676. "use strict";
  126677. __webpack_require__.r(__webpack_exports__);
  126678. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  126679. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  126680. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  126681. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  126682. /* harmony import */ var _stringToPath_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_stringToPath.js */ "./node_modules/lodash-es/_stringToPath.js");
  126683. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  126684. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  126685. /**
  126686. * Converts `value` to a property path array.
  126687. *
  126688. * @static
  126689. * @memberOf _
  126690. * @since 4.0.0
  126691. * @category Util
  126692. * @param {*} value The value to convert.
  126693. * @returns {Array} Returns the new property path array.
  126694. * @example
  126695. *
  126696. * _.toPath('a.b.c');
  126697. * // => ['a', 'b', 'c']
  126698. *
  126699. * _.toPath('a[0].b.c');
  126700. * // => ['a', '0', 'b', 'c']
  126701. */
  126702. function toPath(value) {
  126703. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value)) {
  126704. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, _toKey_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
  126705. }
  126706. return Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value) ? [value] : Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_stringToPath_js__WEBPACK_IMPORTED_MODULE_4__["default"])(Object(_toString_js__WEBPACK_IMPORTED_MODULE_6__["default"])(value)));
  126707. }
  126708. /* harmony default export */ __webpack_exports__["default"] = (toPath);
  126709. /***/ }),
  126710. /***/ "./node_modules/lodash-es/toPlainObject.js":
  126711. /*!*************************************************!*\
  126712. !*** ./node_modules/lodash-es/toPlainObject.js ***!
  126713. \*************************************************/
  126714. /*! exports provided: default */
  126715. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126716. "use strict";
  126717. __webpack_require__.r(__webpack_exports__);
  126718. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  126719. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  126720. /**
  126721. * Converts `value` to a plain object flattening inherited enumerable string
  126722. * keyed properties of `value` to own properties of the plain object.
  126723. *
  126724. * @static
  126725. * @memberOf _
  126726. * @since 3.0.0
  126727. * @category Lang
  126728. * @param {*} value The value to convert.
  126729. * @returns {Object} Returns the converted plain object.
  126730. * @example
  126731. *
  126732. * function Foo() {
  126733. * this.b = 2;
  126734. * }
  126735. *
  126736. * Foo.prototype.c = 3;
  126737. *
  126738. * _.assign({ 'a': 1 }, new Foo);
  126739. * // => { 'a': 1, 'b': 2 }
  126740. *
  126741. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  126742. * // => { 'a': 1, 'b': 2, 'c': 3 }
  126743. */
  126744. function toPlainObject(value) {
  126745. return Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value));
  126746. }
  126747. /* harmony default export */ __webpack_exports__["default"] = (toPlainObject);
  126748. /***/ }),
  126749. /***/ "./node_modules/lodash-es/toSafeInteger.js":
  126750. /*!*************************************************!*\
  126751. !*** ./node_modules/lodash-es/toSafeInteger.js ***!
  126752. \*************************************************/
  126753. /*! exports provided: default */
  126754. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126755. "use strict";
  126756. __webpack_require__.r(__webpack_exports__);
  126757. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  126758. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  126759. /** Used as references for various `Number` constants. */
  126760. var MAX_SAFE_INTEGER = 9007199254740991;
  126761. /**
  126762. * Converts `value` to a safe integer. A safe integer can be compared and
  126763. * represented correctly.
  126764. *
  126765. * @static
  126766. * @memberOf _
  126767. * @since 4.0.0
  126768. * @category Lang
  126769. * @param {*} value The value to convert.
  126770. * @returns {number} Returns the converted integer.
  126771. * @example
  126772. *
  126773. * _.toSafeInteger(3.2);
  126774. * // => 3
  126775. *
  126776. * _.toSafeInteger(Number.MIN_VALUE);
  126777. * // => 0
  126778. *
  126779. * _.toSafeInteger(Infinity);
  126780. * // => 9007199254740991
  126781. *
  126782. * _.toSafeInteger('3.2');
  126783. * // => 3
  126784. */
  126785. function toSafeInteger(value) {
  126786. return value
  126787. ? Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  126788. : (value === 0 ? value : 0);
  126789. }
  126790. /* harmony default export */ __webpack_exports__["default"] = (toSafeInteger);
  126791. /***/ }),
  126792. /***/ "./node_modules/lodash-es/toString.js":
  126793. /*!********************************************!*\
  126794. !*** ./node_modules/lodash-es/toString.js ***!
  126795. \********************************************/
  126796. /*! exports provided: default */
  126797. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126798. "use strict";
  126799. __webpack_require__.r(__webpack_exports__);
  126800. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  126801. /**
  126802. * Converts `value` to a string. An empty string is returned for `null`
  126803. * and `undefined` values. The sign of `-0` is preserved.
  126804. *
  126805. * @static
  126806. * @memberOf _
  126807. * @since 4.0.0
  126808. * @category Lang
  126809. * @param {*} value The value to convert.
  126810. * @returns {string} Returns the converted string.
  126811. * @example
  126812. *
  126813. * _.toString(null);
  126814. * // => ''
  126815. *
  126816. * _.toString(-0);
  126817. * // => '-0'
  126818. *
  126819. * _.toString([1, 2, 3]);
  126820. * // => '1,2,3'
  126821. */
  126822. function toString(value) {
  126823. return value == null ? '' : Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  126824. }
  126825. /* harmony default export */ __webpack_exports__["default"] = (toString);
  126826. /***/ }),
  126827. /***/ "./node_modules/lodash-es/toUpper.js":
  126828. /*!*******************************************!*\
  126829. !*** ./node_modules/lodash-es/toUpper.js ***!
  126830. \*******************************************/
  126831. /*! exports provided: default */
  126832. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126833. "use strict";
  126834. __webpack_require__.r(__webpack_exports__);
  126835. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  126836. /**
  126837. * Converts `string`, as a whole, to upper case just like
  126838. * [String#toUpperCase](https://mdn.io/toUpperCase).
  126839. *
  126840. * @static
  126841. * @memberOf _
  126842. * @since 4.0.0
  126843. * @category String
  126844. * @param {string} [string=''] The string to convert.
  126845. * @returns {string} Returns the upper cased string.
  126846. * @example
  126847. *
  126848. * _.toUpper('--foo-bar--');
  126849. * // => '--FOO-BAR--'
  126850. *
  126851. * _.toUpper('fooBar');
  126852. * // => 'FOOBAR'
  126853. *
  126854. * _.toUpper('__foo_bar__');
  126855. * // => '__FOO_BAR__'
  126856. */
  126857. function toUpper(value) {
  126858. return Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value).toUpperCase();
  126859. }
  126860. /* harmony default export */ __webpack_exports__["default"] = (toUpper);
  126861. /***/ }),
  126862. /***/ "./node_modules/lodash-es/transform.js":
  126863. /*!*********************************************!*\
  126864. !*** ./node_modules/lodash-es/transform.js ***!
  126865. \*********************************************/
  126866. /*! exports provided: default */
  126867. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126868. "use strict";
  126869. __webpack_require__.r(__webpack_exports__);
  126870. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  126871. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  126872. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  126873. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  126874. /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
  126875. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  126876. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  126877. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  126878. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  126879. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  126880. /**
  126881. * An alternative to `_.reduce`; this method transforms `object` to a new
  126882. * `accumulator` object which is the result of running each of its own
  126883. * enumerable string keyed properties thru `iteratee`, with each invocation
  126884. * potentially mutating the `accumulator` object. If `accumulator` is not
  126885. * provided, a new object with the same `[[Prototype]]` will be used. The
  126886. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  126887. * Iteratee functions may exit iteration early by explicitly returning `false`.
  126888. *
  126889. * @static
  126890. * @memberOf _
  126891. * @since 1.3.0
  126892. * @category Object
  126893. * @param {Object} object The object to iterate over.
  126894. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  126895. * @param {*} [accumulator] The custom accumulator value.
  126896. * @returns {*} Returns the accumulated value.
  126897. * @example
  126898. *
  126899. * _.transform([2, 3, 4], function(result, n) {
  126900. * result.push(n *= n);
  126901. * return n % 2 == 0;
  126902. * }, []);
  126903. * // => [4, 9]
  126904. *
  126905. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  126906. * (result[value] || (result[value] = [])).push(key);
  126907. * }, {});
  126908. * // => { '1': ['a', 'c'], '2': ['b'] }
  126909. */
  126910. function transform(object, iteratee, accumulator) {
  126911. var isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(object),
  126912. isArrLike = isArr || Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_6__["default"])(object) || Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_9__["default"])(object);
  126913. iteratee = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__["default"])(iteratee, 4);
  126914. if (accumulator == null) {
  126915. var Ctor = object && object.constructor;
  126916. if (isArrLike) {
  126917. accumulator = isArr ? new Ctor : [];
  126918. }
  126919. else if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_8__["default"])(object)) {
  126920. accumulator = Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_7__["default"])(Ctor) ? Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_getPrototype_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object)) : {};
  126921. }
  126922. else {
  126923. accumulator = {};
  126924. }
  126925. }
  126926. (isArrLike ? _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseForOwn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, function(value, index, object) {
  126927. return iteratee(accumulator, value, index, object);
  126928. });
  126929. return accumulator;
  126930. }
  126931. /* harmony default export */ __webpack_exports__["default"] = (transform);
  126932. /***/ }),
  126933. /***/ "./node_modules/lodash-es/trim.js":
  126934. /*!****************************************!*\
  126935. !*** ./node_modules/lodash-es/trim.js ***!
  126936. \****************************************/
  126937. /*! exports provided: default */
  126938. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126939. "use strict";
  126940. __webpack_require__.r(__webpack_exports__);
  126941. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  126942. /* harmony import */ var _baseTrim_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseTrim.js */ "./node_modules/lodash-es/_baseTrim.js");
  126943. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  126944. /* harmony import */ var _charsEndIndex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_charsEndIndex.js */ "./node_modules/lodash-es/_charsEndIndex.js");
  126945. /* harmony import */ var _charsStartIndex_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_charsStartIndex.js */ "./node_modules/lodash-es/_charsStartIndex.js");
  126946. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  126947. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  126948. /**
  126949. * Removes leading and trailing whitespace or specified characters from `string`.
  126950. *
  126951. * @static
  126952. * @memberOf _
  126953. * @since 3.0.0
  126954. * @category String
  126955. * @param {string} [string=''] The string to trim.
  126956. * @param {string} [chars=whitespace] The characters to trim.
  126957. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  126958. * @returns {string} Returns the trimmed string.
  126959. * @example
  126960. *
  126961. * _.trim(' abc ');
  126962. * // => 'abc'
  126963. *
  126964. * _.trim('-_-abc-_-', '_-');
  126965. * // => 'abc'
  126966. *
  126967. * _.map([' foo ', ' bar '], _.trim);
  126968. * // => ['foo', 'bar']
  126969. */
  126970. function trim(string, chars, guard) {
  126971. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_6__["default"])(string);
  126972. if (string && (guard || chars === undefined)) {
  126973. return Object(_baseTrim_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string);
  126974. }
  126975. if (!string || !(chars = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars))) {
  126976. return string;
  126977. }
  126978. var strSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(string),
  126979. chrSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(chars),
  126980. start = Object(_charsStartIndex_js__WEBPACK_IMPORTED_MODULE_4__["default"])(strSymbols, chrSymbols),
  126981. end = Object(_charsEndIndex_js__WEBPACK_IMPORTED_MODULE_3__["default"])(strSymbols, chrSymbols) + 1;
  126982. return Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_2__["default"])(strSymbols, start, end).join('');
  126983. }
  126984. /* harmony default export */ __webpack_exports__["default"] = (trim);
  126985. /***/ }),
  126986. /***/ "./node_modules/lodash-es/trimEnd.js":
  126987. /*!*******************************************!*\
  126988. !*** ./node_modules/lodash-es/trimEnd.js ***!
  126989. \*******************************************/
  126990. /*! exports provided: default */
  126991. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126992. "use strict";
  126993. __webpack_require__.r(__webpack_exports__);
  126994. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  126995. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  126996. /* harmony import */ var _charsEndIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_charsEndIndex.js */ "./node_modules/lodash-es/_charsEndIndex.js");
  126997. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  126998. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  126999. /* harmony import */ var _trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_trimmedEndIndex.js */ "./node_modules/lodash-es/_trimmedEndIndex.js");
  127000. /**
  127001. * Removes trailing whitespace or specified characters from `string`.
  127002. *
  127003. * @static
  127004. * @memberOf _
  127005. * @since 4.0.0
  127006. * @category String
  127007. * @param {string} [string=''] The string to trim.
  127008. * @param {string} [chars=whitespace] The characters to trim.
  127009. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  127010. * @returns {string} Returns the trimmed string.
  127011. * @example
  127012. *
  127013. * _.trimEnd(' abc ');
  127014. * // => ' abc'
  127015. *
  127016. * _.trimEnd('-_-abc-_-', '_-');
  127017. * // => '-_-abc'
  127018. */
  127019. function trimEnd(string, chars, guard) {
  127020. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_4__["default"])(string);
  127021. if (string && (guard || chars === undefined)) {
  127022. return string.slice(0, Object(_trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_5__["default"])(string) + 1);
  127023. }
  127024. if (!string || !(chars = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars))) {
  127025. return string;
  127026. }
  127027. var strSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string),
  127028. end = Object(_charsEndIndex_js__WEBPACK_IMPORTED_MODULE_2__["default"])(strSymbols, Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(chars)) + 1;
  127029. return Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(strSymbols, 0, end).join('');
  127030. }
  127031. /* harmony default export */ __webpack_exports__["default"] = (trimEnd);
  127032. /***/ }),
  127033. /***/ "./node_modules/lodash-es/trimStart.js":
  127034. /*!*********************************************!*\
  127035. !*** ./node_modules/lodash-es/trimStart.js ***!
  127036. \*********************************************/
  127037. /*! exports provided: default */
  127038. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127039. "use strict";
  127040. __webpack_require__.r(__webpack_exports__);
  127041. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  127042. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  127043. /* harmony import */ var _charsStartIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_charsStartIndex.js */ "./node_modules/lodash-es/_charsStartIndex.js");
  127044. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  127045. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  127046. /** Used to match leading whitespace. */
  127047. var reTrimStart = /^\s+/;
  127048. /**
  127049. * Removes leading whitespace or specified characters from `string`.
  127050. *
  127051. * @static
  127052. * @memberOf _
  127053. * @since 4.0.0
  127054. * @category String
  127055. * @param {string} [string=''] The string to trim.
  127056. * @param {string} [chars=whitespace] The characters to trim.
  127057. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  127058. * @returns {string} Returns the trimmed string.
  127059. * @example
  127060. *
  127061. * _.trimStart(' abc ');
  127062. * // => 'abc '
  127063. *
  127064. * _.trimStart('-_-abc-_-', '_-');
  127065. * // => 'abc-_-'
  127066. */
  127067. function trimStart(string, chars, guard) {
  127068. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_4__["default"])(string);
  127069. if (string && (guard || chars === undefined)) {
  127070. return string.replace(reTrimStart, '');
  127071. }
  127072. if (!string || !(chars = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars))) {
  127073. return string;
  127074. }
  127075. var strSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string),
  127076. start = Object(_charsStartIndex_js__WEBPACK_IMPORTED_MODULE_2__["default"])(strSymbols, Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(chars));
  127077. return Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(strSymbols, start).join('');
  127078. }
  127079. /* harmony default export */ __webpack_exports__["default"] = (trimStart);
  127080. /***/ }),
  127081. /***/ "./node_modules/lodash-es/truncate.js":
  127082. /*!********************************************!*\
  127083. !*** ./node_modules/lodash-es/truncate.js ***!
  127084. \********************************************/
  127085. /*! exports provided: default */
  127086. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127087. "use strict";
  127088. __webpack_require__.r(__webpack_exports__);
  127089. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  127090. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  127091. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  127092. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  127093. /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
  127094. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  127095. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  127096. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  127097. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  127098. /** Used as default options for `_.truncate`. */
  127099. var DEFAULT_TRUNC_LENGTH = 30,
  127100. DEFAULT_TRUNC_OMISSION = '...';
  127101. /** Used to match `RegExp` flags from their coerced string values. */
  127102. var reFlags = /\w*$/;
  127103. /**
  127104. * Truncates `string` if it's longer than the given maximum string length.
  127105. * The last characters of the truncated string are replaced with the omission
  127106. * string which defaults to "...".
  127107. *
  127108. * @static
  127109. * @memberOf _
  127110. * @since 4.0.0
  127111. * @category String
  127112. * @param {string} [string=''] The string to truncate.
  127113. * @param {Object} [options={}] The options object.
  127114. * @param {number} [options.length=30] The maximum string length.
  127115. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  127116. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  127117. * @returns {string} Returns the truncated string.
  127118. * @example
  127119. *
  127120. * _.truncate('hi-diddly-ho there, neighborino');
  127121. * // => 'hi-diddly-ho there, neighbo...'
  127122. *
  127123. * _.truncate('hi-diddly-ho there, neighborino', {
  127124. * 'length': 24,
  127125. * 'separator': ' '
  127126. * });
  127127. * // => 'hi-diddly-ho there,...'
  127128. *
  127129. * _.truncate('hi-diddly-ho there, neighborino', {
  127130. * 'length': 24,
  127131. * 'separator': /,? +/
  127132. * });
  127133. * // => 'hi-diddly-ho there...'
  127134. *
  127135. * _.truncate('hi-diddly-ho there, neighborino', {
  127136. * 'omission': ' [...]'
  127137. * });
  127138. * // => 'hi-diddly-ho there, neig [...]'
  127139. */
  127140. function truncate(string, options) {
  127141. var length = DEFAULT_TRUNC_LENGTH,
  127142. omission = DEFAULT_TRUNC_OMISSION;
  127143. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(options)) {
  127144. var separator = 'separator' in options ? options.separator : separator;
  127145. length = 'length' in options ? Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_7__["default"])(options.length) : length;
  127146. omission = 'omission' in options ? Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.omission) : omission;
  127147. }
  127148. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_8__["default"])(string);
  127149. var strLength = string.length;
  127150. if (Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)) {
  127151. var strSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(string);
  127152. strLength = strSymbols.length;
  127153. }
  127154. if (length >= strLength) {
  127155. return string;
  127156. }
  127157. var end = length - Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_5__["default"])(omission);
  127158. if (end < 1) {
  127159. return omission;
  127160. }
  127161. var result = strSymbols
  127162. ? Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(strSymbols, 0, end).join('')
  127163. : string.slice(0, end);
  127164. if (separator === undefined) {
  127165. return result + omission;
  127166. }
  127167. if (strSymbols) {
  127168. end += (result.length - end);
  127169. }
  127170. if (Object(_isRegExp_js__WEBPACK_IMPORTED_MODULE_4__["default"])(separator)) {
  127171. if (string.slice(end).search(separator)) {
  127172. var match,
  127173. substring = result;
  127174. if (!separator.global) {
  127175. separator = RegExp(separator.source, Object(_toString_js__WEBPACK_IMPORTED_MODULE_8__["default"])(reFlags.exec(separator)) + 'g');
  127176. }
  127177. separator.lastIndex = 0;
  127178. while ((match = separator.exec(substring))) {
  127179. var newEnd = match.index;
  127180. }
  127181. result = result.slice(0, newEnd === undefined ? end : newEnd);
  127182. }
  127183. } else if (string.indexOf(Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(separator), end) != end) {
  127184. var index = result.lastIndexOf(separator);
  127185. if (index > -1) {
  127186. result = result.slice(0, index);
  127187. }
  127188. }
  127189. return result + omission;
  127190. }
  127191. /* harmony default export */ __webpack_exports__["default"] = (truncate);
  127192. /***/ }),
  127193. /***/ "./node_modules/lodash-es/unary.js":
  127194. /*!*****************************************!*\
  127195. !*** ./node_modules/lodash-es/unary.js ***!
  127196. \*****************************************/
  127197. /*! exports provided: default */
  127198. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127199. "use strict";
  127200. __webpack_require__.r(__webpack_exports__);
  127201. /* harmony import */ var _ary_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ary.js */ "./node_modules/lodash-es/ary.js");
  127202. /**
  127203. * Creates a function that accepts up to one argument, ignoring any
  127204. * additional arguments.
  127205. *
  127206. * @static
  127207. * @memberOf _
  127208. * @since 4.0.0
  127209. * @category Function
  127210. * @param {Function} func The function to cap arguments for.
  127211. * @returns {Function} Returns the new capped function.
  127212. * @example
  127213. *
  127214. * _.map(['6', '8', '10'], _.unary(parseInt));
  127215. * // => [6, 8, 10]
  127216. */
  127217. function unary(func) {
  127218. return Object(_ary_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, 1);
  127219. }
  127220. /* harmony default export */ __webpack_exports__["default"] = (unary);
  127221. /***/ }),
  127222. /***/ "./node_modules/lodash-es/unescape.js":
  127223. /*!********************************************!*\
  127224. !*** ./node_modules/lodash-es/unescape.js ***!
  127225. \********************************************/
  127226. /*! exports provided: default */
  127227. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127228. "use strict";
  127229. __webpack_require__.r(__webpack_exports__);
  127230. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  127231. /* harmony import */ var _unescapeHtmlChar_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_unescapeHtmlChar.js */ "./node_modules/lodash-es/_unescapeHtmlChar.js");
  127232. /** Used to match HTML entities and HTML characters. */
  127233. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  127234. reHasEscapedHtml = RegExp(reEscapedHtml.source);
  127235. /**
  127236. * The inverse of `_.escape`; this method converts the HTML entities
  127237. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  127238. * their corresponding characters.
  127239. *
  127240. * **Note:** No other HTML entities are unescaped. To unescape additional
  127241. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  127242. *
  127243. * @static
  127244. * @memberOf _
  127245. * @since 0.6.0
  127246. * @category String
  127247. * @param {string} [string=''] The string to unescape.
  127248. * @returns {string} Returns the unescaped string.
  127249. * @example
  127250. *
  127251. * _.unescape('fred, barney, &amp; pebbles');
  127252. * // => 'fred, barney, & pebbles'
  127253. */
  127254. function unescape(string) {
  127255. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
  127256. return (string && reHasEscapedHtml.test(string))
  127257. ? string.replace(reEscapedHtml, _unescapeHtmlChar_js__WEBPACK_IMPORTED_MODULE_1__["default"])
  127258. : string;
  127259. }
  127260. /* harmony default export */ __webpack_exports__["default"] = (unescape);
  127261. /***/ }),
  127262. /***/ "./node_modules/lodash-es/union.js":
  127263. /*!*****************************************!*\
  127264. !*** ./node_modules/lodash-es/union.js ***!
  127265. \*****************************************/
  127266. /*! exports provided: default */
  127267. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127268. "use strict";
  127269. __webpack_require__.r(__webpack_exports__);
  127270. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  127271. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  127272. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  127273. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  127274. /**
  127275. * Creates an array of unique values, in order, from all given arrays using
  127276. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  127277. * for equality comparisons.
  127278. *
  127279. * @static
  127280. * @memberOf _
  127281. * @since 0.1.0
  127282. * @category Array
  127283. * @param {...Array} [arrays] The arrays to inspect.
  127284. * @returns {Array} Returns the new array of combined values.
  127285. * @example
  127286. *
  127287. * _.union([2], [1, 2]);
  127288. * // => [2, 1]
  127289. */
  127290. var union = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(arrays) {
  127291. return Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"], true));
  127292. });
  127293. /* harmony default export */ __webpack_exports__["default"] = (union);
  127294. /***/ }),
  127295. /***/ "./node_modules/lodash-es/unionBy.js":
  127296. /*!*******************************************!*\
  127297. !*** ./node_modules/lodash-es/unionBy.js ***!
  127298. \*******************************************/
  127299. /*! exports provided: default */
  127300. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127301. "use strict";
  127302. __webpack_require__.r(__webpack_exports__);
  127303. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  127304. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  127305. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  127306. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  127307. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  127308. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  127309. /**
  127310. * This method is like `_.union` except that it accepts `iteratee` which is
  127311. * invoked for each element of each `arrays` to generate the criterion by
  127312. * which uniqueness is computed. Result values are chosen from the first
  127313. * array in which the value occurs. The iteratee is invoked with one argument:
  127314. * (value).
  127315. *
  127316. * @static
  127317. * @memberOf _
  127318. * @since 4.0.0
  127319. * @category Array
  127320. * @param {...Array} [arrays] The arrays to inspect.
  127321. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  127322. * @returns {Array} Returns the new array of combined values.
  127323. * @example
  127324. *
  127325. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  127326. * // => [2.1, 1.2]
  127327. *
  127328. * // The `_.property` iteratee shorthand.
  127329. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  127330. * // => [{ 'x': 1 }, { 'x': 2 }]
  127331. */
  127332. var unionBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(arrays) {
  127333. var iteratee = Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(arrays);
  127334. if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee)) {
  127335. iteratee = undefined;
  127336. }
  127337. return Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"], true), Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee, 2));
  127338. });
  127339. /* harmony default export */ __webpack_exports__["default"] = (unionBy);
  127340. /***/ }),
  127341. /***/ "./node_modules/lodash-es/unionWith.js":
  127342. /*!*********************************************!*\
  127343. !*** ./node_modules/lodash-es/unionWith.js ***!
  127344. \*********************************************/
  127345. /*! exports provided: default */
  127346. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127347. "use strict";
  127348. __webpack_require__.r(__webpack_exports__);
  127349. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  127350. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  127351. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  127352. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  127353. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  127354. /**
  127355. * This method is like `_.union` except that it accepts `comparator` which
  127356. * is invoked to compare elements of `arrays`. Result values are chosen from
  127357. * the first array in which the value occurs. The comparator is invoked
  127358. * with two arguments: (arrVal, othVal).
  127359. *
  127360. * @static
  127361. * @memberOf _
  127362. * @since 4.0.0
  127363. * @category Array
  127364. * @param {...Array} [arrays] The arrays to inspect.
  127365. * @param {Function} [comparator] The comparator invoked per element.
  127366. * @returns {Array} Returns the new array of combined values.
  127367. * @example
  127368. *
  127369. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  127370. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  127371. *
  127372. * _.unionWith(objects, others, _.isEqual);
  127373. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  127374. */
  127375. var unionWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(arrays) {
  127376. var comparator = Object(_last_js__WEBPACK_IMPORTED_MODULE_4__["default"])(arrays);
  127377. comparator = typeof comparator == 'function' ? comparator : undefined;
  127378. return Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"], true), undefined, comparator);
  127379. });
  127380. /* harmony default export */ __webpack_exports__["default"] = (unionWith);
  127381. /***/ }),
  127382. /***/ "./node_modules/lodash-es/uniq.js":
  127383. /*!****************************************!*\
  127384. !*** ./node_modules/lodash-es/uniq.js ***!
  127385. \****************************************/
  127386. /*! exports provided: default */
  127387. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127388. "use strict";
  127389. __webpack_require__.r(__webpack_exports__);
  127390. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  127391. /**
  127392. * Creates a duplicate-free version of an array, using
  127393. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  127394. * for equality comparisons, in which only the first occurrence of each element
  127395. * is kept. The order of result values is determined by the order they occur
  127396. * in the array.
  127397. *
  127398. * @static
  127399. * @memberOf _
  127400. * @since 0.1.0
  127401. * @category Array
  127402. * @param {Array} array The array to inspect.
  127403. * @returns {Array} Returns the new duplicate free array.
  127404. * @example
  127405. *
  127406. * _.uniq([2, 1, 2]);
  127407. * // => [2, 1]
  127408. */
  127409. function uniq(array) {
  127410. return (array && array.length) ? Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array) : [];
  127411. }
  127412. /* harmony default export */ __webpack_exports__["default"] = (uniq);
  127413. /***/ }),
  127414. /***/ "./node_modules/lodash-es/uniqBy.js":
  127415. /*!******************************************!*\
  127416. !*** ./node_modules/lodash-es/uniqBy.js ***!
  127417. \******************************************/
  127418. /*! exports provided: default */
  127419. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127420. "use strict";
  127421. __webpack_require__.r(__webpack_exports__);
  127422. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  127423. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  127424. /**
  127425. * This method is like `_.uniq` except that it accepts `iteratee` which is
  127426. * invoked for each element in `array` to generate the criterion by which
  127427. * uniqueness is computed. The order of result values is determined by the
  127428. * order they occur in the array. The iteratee is invoked with one argument:
  127429. * (value).
  127430. *
  127431. * @static
  127432. * @memberOf _
  127433. * @since 4.0.0
  127434. * @category Array
  127435. * @param {Array} array The array to inspect.
  127436. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  127437. * @returns {Array} Returns the new duplicate free array.
  127438. * @example
  127439. *
  127440. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  127441. * // => [2.1, 1.2]
  127442. *
  127443. * // The `_.property` iteratee shorthand.
  127444. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  127445. * // => [{ 'x': 1 }, { 'x': 2 }]
  127446. */
  127447. function uniqBy(array, iteratee) {
  127448. return (array && array.length) ? Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2)) : [];
  127449. }
  127450. /* harmony default export */ __webpack_exports__["default"] = (uniqBy);
  127451. /***/ }),
  127452. /***/ "./node_modules/lodash-es/uniqWith.js":
  127453. /*!********************************************!*\
  127454. !*** ./node_modules/lodash-es/uniqWith.js ***!
  127455. \********************************************/
  127456. /*! exports provided: default */
  127457. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127458. "use strict";
  127459. __webpack_require__.r(__webpack_exports__);
  127460. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  127461. /**
  127462. * This method is like `_.uniq` except that it accepts `comparator` which
  127463. * is invoked to compare elements of `array`. The order of result values is
  127464. * determined by the order they occur in the array.The comparator is invoked
  127465. * with two arguments: (arrVal, othVal).
  127466. *
  127467. * @static
  127468. * @memberOf _
  127469. * @since 4.0.0
  127470. * @category Array
  127471. * @param {Array} array The array to inspect.
  127472. * @param {Function} [comparator] The comparator invoked per element.
  127473. * @returns {Array} Returns the new duplicate free array.
  127474. * @example
  127475. *
  127476. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  127477. *
  127478. * _.uniqWith(objects, _.isEqual);
  127479. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  127480. */
  127481. function uniqWith(array, comparator) {
  127482. comparator = typeof comparator == 'function' ? comparator : undefined;
  127483. return (array && array.length) ? Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, undefined, comparator) : [];
  127484. }
  127485. /* harmony default export */ __webpack_exports__["default"] = (uniqWith);
  127486. /***/ }),
  127487. /***/ "./node_modules/lodash-es/uniqueId.js":
  127488. /*!********************************************!*\
  127489. !*** ./node_modules/lodash-es/uniqueId.js ***!
  127490. \********************************************/
  127491. /*! exports provided: default */
  127492. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127493. "use strict";
  127494. __webpack_require__.r(__webpack_exports__);
  127495. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  127496. /** Used to generate unique IDs. */
  127497. var idCounter = 0;
  127498. /**
  127499. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  127500. *
  127501. * @static
  127502. * @since 0.1.0
  127503. * @memberOf _
  127504. * @category Util
  127505. * @param {string} [prefix=''] The value to prefix the ID with.
  127506. * @returns {string} Returns the unique ID.
  127507. * @example
  127508. *
  127509. * _.uniqueId('contact_');
  127510. * // => 'contact_104'
  127511. *
  127512. * _.uniqueId();
  127513. * // => '105'
  127514. */
  127515. function uniqueId(prefix) {
  127516. var id = ++idCounter;
  127517. return Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(prefix) + id;
  127518. }
  127519. /* harmony default export */ __webpack_exports__["default"] = (uniqueId);
  127520. /***/ }),
  127521. /***/ "./node_modules/lodash-es/unset.js":
  127522. /*!*****************************************!*\
  127523. !*** ./node_modules/lodash-es/unset.js ***!
  127524. \*****************************************/
  127525. /*! exports provided: default */
  127526. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127527. "use strict";
  127528. __webpack_require__.r(__webpack_exports__);
  127529. /* harmony import */ var _baseUnset_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUnset.js */ "./node_modules/lodash-es/_baseUnset.js");
  127530. /**
  127531. * Removes the property at `path` of `object`.
  127532. *
  127533. * **Note:** This method mutates `object`.
  127534. *
  127535. * @static
  127536. * @memberOf _
  127537. * @since 4.0.0
  127538. * @category Object
  127539. * @param {Object} object The object to modify.
  127540. * @param {Array|string} path The path of the property to unset.
  127541. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  127542. * @example
  127543. *
  127544. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  127545. * _.unset(object, 'a[0].b.c');
  127546. * // => true
  127547. *
  127548. * console.log(object);
  127549. * // => { 'a': [{ 'b': {} }] };
  127550. *
  127551. * _.unset(object, ['a', '0', 'b', 'c']);
  127552. * // => true
  127553. *
  127554. * console.log(object);
  127555. * // => { 'a': [{ 'b': {} }] };
  127556. */
  127557. function unset(object, path) {
  127558. return object == null ? true : Object(_baseUnset_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
  127559. }
  127560. /* harmony default export */ __webpack_exports__["default"] = (unset);
  127561. /***/ }),
  127562. /***/ "./node_modules/lodash-es/unzip.js":
  127563. /*!*****************************************!*\
  127564. !*** ./node_modules/lodash-es/unzip.js ***!
  127565. \*****************************************/
  127566. /*! exports provided: default */
  127567. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127568. "use strict";
  127569. __webpack_require__.r(__webpack_exports__);
  127570. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  127571. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  127572. /* harmony import */ var _baseProperty_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseProperty.js */ "./node_modules/lodash-es/_baseProperty.js");
  127573. /* harmony import */ var _baseTimes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseTimes.js */ "./node_modules/lodash-es/_baseTimes.js");
  127574. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  127575. /* Built-in method references for those with the same name as other `lodash` methods. */
  127576. var nativeMax = Math.max;
  127577. /**
  127578. * This method is like `_.zip` except that it accepts an array of grouped
  127579. * elements and creates an array regrouping the elements to their pre-zip
  127580. * configuration.
  127581. *
  127582. * @static
  127583. * @memberOf _
  127584. * @since 1.2.0
  127585. * @category Array
  127586. * @param {Array} array The array of grouped elements to process.
  127587. * @returns {Array} Returns the new array of regrouped elements.
  127588. * @example
  127589. *
  127590. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  127591. * // => [['a', 1, true], ['b', 2, false]]
  127592. *
  127593. * _.unzip(zipped);
  127594. * // => [['a', 'b'], [1, 2], [true, false]]
  127595. */
  127596. function unzip(array) {
  127597. if (!(array && array.length)) {
  127598. return [];
  127599. }
  127600. var length = 0;
  127601. array = Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, function(group) {
  127602. if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(group)) {
  127603. length = nativeMax(group.length, length);
  127604. return true;
  127605. }
  127606. });
  127607. return Object(_baseTimes_js__WEBPACK_IMPORTED_MODULE_3__["default"])(length, function(index) {
  127608. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(index));
  127609. });
  127610. }
  127611. /* harmony default export */ __webpack_exports__["default"] = (unzip);
  127612. /***/ }),
  127613. /***/ "./node_modules/lodash-es/unzipWith.js":
  127614. /*!*********************************************!*\
  127615. !*** ./node_modules/lodash-es/unzipWith.js ***!
  127616. \*********************************************/
  127617. /*! exports provided: default */
  127618. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127619. "use strict";
  127620. __webpack_require__.r(__webpack_exports__);
  127621. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  127622. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  127623. /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
  127624. /**
  127625. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  127626. * how regrouped values should be combined. The iteratee is invoked with the
  127627. * elements of each group: (...group).
  127628. *
  127629. * @static
  127630. * @memberOf _
  127631. * @since 3.8.0
  127632. * @category Array
  127633. * @param {Array} array The array of grouped elements to process.
  127634. * @param {Function} [iteratee=_.identity] The function to combine
  127635. * regrouped values.
  127636. * @returns {Array} Returns the new array of regrouped elements.
  127637. * @example
  127638. *
  127639. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  127640. * // => [[1, 10, 100], [2, 20, 200]]
  127641. *
  127642. * _.unzipWith(zipped, _.add);
  127643. * // => [3, 30, 300]
  127644. */
  127645. function unzipWith(array, iteratee) {
  127646. if (!(array && array.length)) {
  127647. return [];
  127648. }
  127649. var result = Object(_unzip_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array);
  127650. if (iteratee == null) {
  127651. return result;
  127652. }
  127653. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, function(group) {
  127654. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, undefined, group);
  127655. });
  127656. }
  127657. /* harmony default export */ __webpack_exports__["default"] = (unzipWith);
  127658. /***/ }),
  127659. /***/ "./node_modules/lodash-es/update.js":
  127660. /*!******************************************!*\
  127661. !*** ./node_modules/lodash-es/update.js ***!
  127662. \******************************************/
  127663. /*! exports provided: default */
  127664. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127665. "use strict";
  127666. __webpack_require__.r(__webpack_exports__);
  127667. /* harmony import */ var _baseUpdate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUpdate.js */ "./node_modules/lodash-es/_baseUpdate.js");
  127668. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  127669. /**
  127670. * This method is like `_.set` except that accepts `updater` to produce the
  127671. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  127672. * is invoked with one argument: (value).
  127673. *
  127674. * **Note:** This method mutates `object`.
  127675. *
  127676. * @static
  127677. * @memberOf _
  127678. * @since 4.6.0
  127679. * @category Object
  127680. * @param {Object} object The object to modify.
  127681. * @param {Array|string} path The path of the property to set.
  127682. * @param {Function} updater The function to produce the updated value.
  127683. * @returns {Object} Returns `object`.
  127684. * @example
  127685. *
  127686. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  127687. *
  127688. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  127689. * console.log(object.a[0].b.c);
  127690. * // => 9
  127691. *
  127692. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  127693. * console.log(object.x[0].y.z);
  127694. * // => 0
  127695. */
  127696. function update(object, path, updater) {
  127697. return object == null ? object : Object(_baseUpdate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(updater));
  127698. }
  127699. /* harmony default export */ __webpack_exports__["default"] = (update);
  127700. /***/ }),
  127701. /***/ "./node_modules/lodash-es/updateWith.js":
  127702. /*!**********************************************!*\
  127703. !*** ./node_modules/lodash-es/updateWith.js ***!
  127704. \**********************************************/
  127705. /*! exports provided: default */
  127706. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127707. "use strict";
  127708. __webpack_require__.r(__webpack_exports__);
  127709. /* harmony import */ var _baseUpdate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUpdate.js */ "./node_modules/lodash-es/_baseUpdate.js");
  127710. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  127711. /**
  127712. * This method is like `_.update` except that it accepts `customizer` which is
  127713. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  127714. * path creation is handled by the method instead. The `customizer` is invoked
  127715. * with three arguments: (nsValue, key, nsObject).
  127716. *
  127717. * **Note:** This method mutates `object`.
  127718. *
  127719. * @static
  127720. * @memberOf _
  127721. * @since 4.6.0
  127722. * @category Object
  127723. * @param {Object} object The object to modify.
  127724. * @param {Array|string} path The path of the property to set.
  127725. * @param {Function} updater The function to produce the updated value.
  127726. * @param {Function} [customizer] The function to customize assigned values.
  127727. * @returns {Object} Returns `object`.
  127728. * @example
  127729. *
  127730. * var object = {};
  127731. *
  127732. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  127733. * // => { '0': { '1': 'a' } }
  127734. */
  127735. function updateWith(object, path, updater, customizer) {
  127736. customizer = typeof customizer == 'function' ? customizer : undefined;
  127737. return object == null ? object : Object(_baseUpdate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(updater), customizer);
  127738. }
  127739. /* harmony default export */ __webpack_exports__["default"] = (updateWith);
  127740. /***/ }),
  127741. /***/ "./node_modules/lodash-es/upperCase.js":
  127742. /*!*********************************************!*\
  127743. !*** ./node_modules/lodash-es/upperCase.js ***!
  127744. \*********************************************/
  127745. /*! exports provided: default */
  127746. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127747. "use strict";
  127748. __webpack_require__.r(__webpack_exports__);
  127749. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  127750. /**
  127751. * Converts `string`, as space separated words, to upper case.
  127752. *
  127753. * @static
  127754. * @memberOf _
  127755. * @since 4.0.0
  127756. * @category String
  127757. * @param {string} [string=''] The string to convert.
  127758. * @returns {string} Returns the upper cased string.
  127759. * @example
  127760. *
  127761. * _.upperCase('--foo-bar');
  127762. * // => 'FOO BAR'
  127763. *
  127764. * _.upperCase('fooBar');
  127765. * // => 'FOO BAR'
  127766. *
  127767. * _.upperCase('__foo_bar__');
  127768. * // => 'FOO BAR'
  127769. */
  127770. var upperCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
  127771. return result + (index ? ' ' : '') + word.toUpperCase();
  127772. });
  127773. /* harmony default export */ __webpack_exports__["default"] = (upperCase);
  127774. /***/ }),
  127775. /***/ "./node_modules/lodash-es/upperFirst.js":
  127776. /*!**********************************************!*\
  127777. !*** ./node_modules/lodash-es/upperFirst.js ***!
  127778. \**********************************************/
  127779. /*! exports provided: default */
  127780. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127781. "use strict";
  127782. __webpack_require__.r(__webpack_exports__);
  127783. /* harmony import */ var _createCaseFirst_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCaseFirst.js */ "./node_modules/lodash-es/_createCaseFirst.js");
  127784. /**
  127785. * Converts the first character of `string` to upper case.
  127786. *
  127787. * @static
  127788. * @memberOf _
  127789. * @since 4.0.0
  127790. * @category String
  127791. * @param {string} [string=''] The string to convert.
  127792. * @returns {string} Returns the converted string.
  127793. * @example
  127794. *
  127795. * _.upperFirst('fred');
  127796. * // => 'Fred'
  127797. *
  127798. * _.upperFirst('FRED');
  127799. * // => 'FRED'
  127800. */
  127801. var upperFirst = Object(_createCaseFirst_js__WEBPACK_IMPORTED_MODULE_0__["default"])('toUpperCase');
  127802. /* harmony default export */ __webpack_exports__["default"] = (upperFirst);
  127803. /***/ }),
  127804. /***/ "./node_modules/lodash-es/util.default.js":
  127805. /*!************************************************!*\
  127806. !*** ./node_modules/lodash-es/util.default.js ***!
  127807. \************************************************/
  127808. /*! exports provided: default */
  127809. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127810. "use strict";
  127811. __webpack_require__.r(__webpack_exports__);
  127812. /* harmony import */ var _attempt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./attempt.js */ "./node_modules/lodash-es/attempt.js");
  127813. /* harmony import */ var _bindAll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bindAll.js */ "./node_modules/lodash-es/bindAll.js");
  127814. /* harmony import */ var _cond_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cond.js */ "./node_modules/lodash-es/cond.js");
  127815. /* harmony import */ var _conforms_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conforms.js */ "./node_modules/lodash-es/conforms.js");
  127816. /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
  127817. /* harmony import */ var _defaultTo_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./defaultTo.js */ "./node_modules/lodash-es/defaultTo.js");
  127818. /* harmony import */ var _flow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flow.js */ "./node_modules/lodash-es/flow.js");
  127819. /* harmony import */ var _flowRight_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flowRight.js */ "./node_modules/lodash-es/flowRight.js");
  127820. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  127821. /* harmony import */ var _iteratee_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./iteratee.js */ "./node_modules/lodash-es/iteratee.js");
  127822. /* harmony import */ var _matches_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./matches.js */ "./node_modules/lodash-es/matches.js");
  127823. /* harmony import */ var _matchesProperty_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./matchesProperty.js */ "./node_modules/lodash-es/matchesProperty.js");
  127824. /* harmony import */ var _method_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./method.js */ "./node_modules/lodash-es/method.js");
  127825. /* harmony import */ var _methodOf_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./methodOf.js */ "./node_modules/lodash-es/methodOf.js");
  127826. /* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./mixin.js */ "./node_modules/lodash-es/mixin.js");
  127827. /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
  127828. /* harmony import */ var _nthArg_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./nthArg.js */ "./node_modules/lodash-es/nthArg.js");
  127829. /* harmony import */ var _over_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./over.js */ "./node_modules/lodash-es/over.js");
  127830. /* harmony import */ var _overEvery_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./overEvery.js */ "./node_modules/lodash-es/overEvery.js");
  127831. /* harmony import */ var _overSome_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./overSome.js */ "./node_modules/lodash-es/overSome.js");
  127832. /* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./property.js */ "./node_modules/lodash-es/property.js");
  127833. /* harmony import */ var _propertyOf_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./propertyOf.js */ "./node_modules/lodash-es/propertyOf.js");
  127834. /* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./range.js */ "./node_modules/lodash-es/range.js");
  127835. /* harmony import */ var _rangeRight_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./rangeRight.js */ "./node_modules/lodash-es/rangeRight.js");
  127836. /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
  127837. /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
  127838. /* harmony import */ var _stubObject_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./stubObject.js */ "./node_modules/lodash-es/stubObject.js");
  127839. /* harmony import */ var _stubString_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./stubString.js */ "./node_modules/lodash-es/stubString.js");
  127840. /* harmony import */ var _stubTrue_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./stubTrue.js */ "./node_modules/lodash-es/stubTrue.js");
  127841. /* harmony import */ var _times_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./times.js */ "./node_modules/lodash-es/times.js");
  127842. /* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./toPath.js */ "./node_modules/lodash-es/toPath.js");
  127843. /* harmony import */ var _uniqueId_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./uniqueId.js */ "./node_modules/lodash-es/uniqueId.js");
  127844. /* harmony default export */ __webpack_exports__["default"] = ({
  127845. attempt: _attempt_js__WEBPACK_IMPORTED_MODULE_0__["default"], bindAll: _bindAll_js__WEBPACK_IMPORTED_MODULE_1__["default"], cond: _cond_js__WEBPACK_IMPORTED_MODULE_2__["default"], conforms: _conforms_js__WEBPACK_IMPORTED_MODULE_3__["default"], constant: _constant_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  127846. defaultTo: _defaultTo_js__WEBPACK_IMPORTED_MODULE_5__["default"], flow: _flow_js__WEBPACK_IMPORTED_MODULE_6__["default"], flowRight: _flowRight_js__WEBPACK_IMPORTED_MODULE_7__["default"], identity: _identity_js__WEBPACK_IMPORTED_MODULE_8__["default"], iteratee: _iteratee_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  127847. matches: _matches_js__WEBPACK_IMPORTED_MODULE_10__["default"], matchesProperty: _matchesProperty_js__WEBPACK_IMPORTED_MODULE_11__["default"], method: _method_js__WEBPACK_IMPORTED_MODULE_12__["default"], methodOf: _methodOf_js__WEBPACK_IMPORTED_MODULE_13__["default"], mixin: _mixin_js__WEBPACK_IMPORTED_MODULE_14__["default"],
  127848. noop: _noop_js__WEBPACK_IMPORTED_MODULE_15__["default"], nthArg: _nthArg_js__WEBPACK_IMPORTED_MODULE_16__["default"], over: _over_js__WEBPACK_IMPORTED_MODULE_17__["default"], overEvery: _overEvery_js__WEBPACK_IMPORTED_MODULE_18__["default"], overSome: _overSome_js__WEBPACK_IMPORTED_MODULE_19__["default"],
  127849. property: _property_js__WEBPACK_IMPORTED_MODULE_20__["default"], propertyOf: _propertyOf_js__WEBPACK_IMPORTED_MODULE_21__["default"], range: _range_js__WEBPACK_IMPORTED_MODULE_22__["default"], rangeRight: _rangeRight_js__WEBPACK_IMPORTED_MODULE_23__["default"], stubArray: _stubArray_js__WEBPACK_IMPORTED_MODULE_24__["default"],
  127850. stubFalse: _stubFalse_js__WEBPACK_IMPORTED_MODULE_25__["default"], stubObject: _stubObject_js__WEBPACK_IMPORTED_MODULE_26__["default"], stubString: _stubString_js__WEBPACK_IMPORTED_MODULE_27__["default"], stubTrue: _stubTrue_js__WEBPACK_IMPORTED_MODULE_28__["default"], times: _times_js__WEBPACK_IMPORTED_MODULE_29__["default"],
  127851. toPath: _toPath_js__WEBPACK_IMPORTED_MODULE_30__["default"], uniqueId: _uniqueId_js__WEBPACK_IMPORTED_MODULE_31__["default"]
  127852. });
  127853. /***/ }),
  127854. /***/ "./node_modules/lodash-es/util.js":
  127855. /*!****************************************!*\
  127856. !*** ./node_modules/lodash-es/util.js ***!
  127857. \****************************************/
  127858. /*! exports provided: attempt, bindAll, cond, conforms, constant, defaultTo, flow, flowRight, identity, iteratee, matches, matchesProperty, method, methodOf, mixin, noop, nthArg, over, overEvery, overSome, property, propertyOf, range, rangeRight, stubArray, stubFalse, stubObject, stubString, stubTrue, times, toPath, uniqueId, default */
  127859. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127860. "use strict";
  127861. __webpack_require__.r(__webpack_exports__);
  127862. /* harmony import */ var _attempt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./attempt.js */ "./node_modules/lodash-es/attempt.js");
  127863. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "attempt", function() { return _attempt_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  127864. /* harmony import */ var _bindAll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bindAll.js */ "./node_modules/lodash-es/bindAll.js");
  127865. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return _bindAll_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  127866. /* harmony import */ var _cond_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cond.js */ "./node_modules/lodash-es/cond.js");
  127867. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cond", function() { return _cond_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  127868. /* harmony import */ var _conforms_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conforms.js */ "./node_modules/lodash-es/conforms.js");
  127869. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "conforms", function() { return _conforms_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  127870. /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
  127871. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return _constant_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  127872. /* harmony import */ var _defaultTo_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./defaultTo.js */ "./node_modules/lodash-es/defaultTo.js");
  127873. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultTo", function() { return _defaultTo_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  127874. /* harmony import */ var _flow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flow.js */ "./node_modules/lodash-es/flow.js");
  127875. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flow", function() { return _flow_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  127876. /* harmony import */ var _flowRight_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flowRight.js */ "./node_modules/lodash-es/flowRight.js");
  127877. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flowRight", function() { return _flowRight_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  127878. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  127879. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return _identity_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  127880. /* harmony import */ var _iteratee_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./iteratee.js */ "./node_modules/lodash-es/iteratee.js");
  127881. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return _iteratee_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  127882. /* harmony import */ var _matches_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./matches.js */ "./node_modules/lodash-es/matches.js");
  127883. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return _matches_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  127884. /* harmony import */ var _matchesProperty_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./matchesProperty.js */ "./node_modules/lodash-es/matchesProperty.js");
  127885. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matchesProperty", function() { return _matchesProperty_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  127886. /* harmony import */ var _method_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./method.js */ "./node_modules/lodash-es/method.js");
  127887. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "method", function() { return _method_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  127888. /* harmony import */ var _methodOf_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./methodOf.js */ "./node_modules/lodash-es/methodOf.js");
  127889. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "methodOf", function() { return _methodOf_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  127890. /* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./mixin.js */ "./node_modules/lodash-es/mixin.js");
  127891. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return _mixin_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  127892. /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
  127893. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return _noop_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  127894. /* harmony import */ var _nthArg_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./nthArg.js */ "./node_modules/lodash-es/nthArg.js");
  127895. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nthArg", function() { return _nthArg_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  127896. /* harmony import */ var _over_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./over.js */ "./node_modules/lodash-es/over.js");
  127897. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "over", function() { return _over_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  127898. /* harmony import */ var _overEvery_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./overEvery.js */ "./node_modules/lodash-es/overEvery.js");
  127899. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overEvery", function() { return _overEvery_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  127900. /* harmony import */ var _overSome_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./overSome.js */ "./node_modules/lodash-es/overSome.js");
  127901. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overSome", function() { return _overSome_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  127902. /* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./property.js */ "./node_modules/lodash-es/property.js");
  127903. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "property", function() { return _property_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  127904. /* harmony import */ var _propertyOf_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./propertyOf.js */ "./node_modules/lodash-es/propertyOf.js");
  127905. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return _propertyOf_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  127906. /* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./range.js */ "./node_modules/lodash-es/range.js");
  127907. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "range", function() { return _range_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  127908. /* harmony import */ var _rangeRight_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./rangeRight.js */ "./node_modules/lodash-es/rangeRight.js");
  127909. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rangeRight", function() { return _rangeRight_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  127910. /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
  127911. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubArray", function() { return _stubArray_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  127912. /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
  127913. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubFalse", function() { return _stubFalse_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  127914. /* harmony import */ var _stubObject_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./stubObject.js */ "./node_modules/lodash-es/stubObject.js");
  127915. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubObject", function() { return _stubObject_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  127916. /* harmony import */ var _stubString_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./stubString.js */ "./node_modules/lodash-es/stubString.js");
  127917. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubString", function() { return _stubString_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  127918. /* harmony import */ var _stubTrue_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./stubTrue.js */ "./node_modules/lodash-es/stubTrue.js");
  127919. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubTrue", function() { return _stubTrue_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  127920. /* harmony import */ var _times_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./times.js */ "./node_modules/lodash-es/times.js");
  127921. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "times", function() { return _times_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  127922. /* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./toPath.js */ "./node_modules/lodash-es/toPath.js");
  127923. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return _toPath_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  127924. /* harmony import */ var _uniqueId_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./uniqueId.js */ "./node_modules/lodash-es/uniqueId.js");
  127925. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return _uniqueId_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  127926. /* harmony import */ var _util_default_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./util.default.js */ "./node_modules/lodash-es/util.default.js");
  127927. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _util_default_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  127928. /***/ }),
  127929. /***/ "./node_modules/lodash-es/value.js":
  127930. /*!*****************************************!*\
  127931. !*** ./node_modules/lodash-es/value.js ***!
  127932. \*****************************************/
  127933. /*! exports provided: default */
  127934. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127935. "use strict";
  127936. __webpack_require__.r(__webpack_exports__);
  127937. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  127938. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  127939. /***/ }),
  127940. /***/ "./node_modules/lodash-es/valueOf.js":
  127941. /*!*******************************************!*\
  127942. !*** ./node_modules/lodash-es/valueOf.js ***!
  127943. \*******************************************/
  127944. /*! exports provided: default */
  127945. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127946. "use strict";
  127947. __webpack_require__.r(__webpack_exports__);
  127948. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  127949. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  127950. /***/ }),
  127951. /***/ "./node_modules/lodash-es/values.js":
  127952. /*!******************************************!*\
  127953. !*** ./node_modules/lodash-es/values.js ***!
  127954. \******************************************/
  127955. /*! exports provided: default */
  127956. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127957. "use strict";
  127958. __webpack_require__.r(__webpack_exports__);
  127959. /* harmony import */ var _baseValues_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseValues.js */ "./node_modules/lodash-es/_baseValues.js");
  127960. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  127961. /**
  127962. * Creates an array of the own enumerable string keyed property values of `object`.
  127963. *
  127964. * **Note:** Non-object values are coerced to objects.
  127965. *
  127966. * @static
  127967. * @since 0.1.0
  127968. * @memberOf _
  127969. * @category Object
  127970. * @param {Object} object The object to query.
  127971. * @returns {Array} Returns the array of property values.
  127972. * @example
  127973. *
  127974. * function Foo() {
  127975. * this.a = 1;
  127976. * this.b = 2;
  127977. * }
  127978. *
  127979. * Foo.prototype.c = 3;
  127980. *
  127981. * _.values(new Foo);
  127982. * // => [1, 2] (iteration order is not guaranteed)
  127983. *
  127984. * _.values('hi');
  127985. * // => ['h', 'i']
  127986. */
  127987. function values(object) {
  127988. return object == null ? [] : Object(_baseValues_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
  127989. }
  127990. /* harmony default export */ __webpack_exports__["default"] = (values);
  127991. /***/ }),
  127992. /***/ "./node_modules/lodash-es/valuesIn.js":
  127993. /*!********************************************!*\
  127994. !*** ./node_modules/lodash-es/valuesIn.js ***!
  127995. \********************************************/
  127996. /*! exports provided: default */
  127997. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  127998. "use strict";
  127999. __webpack_require__.r(__webpack_exports__);
  128000. /* harmony import */ var _baseValues_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseValues.js */ "./node_modules/lodash-es/_baseValues.js");
  128001. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  128002. /**
  128003. * Creates an array of the own and inherited enumerable string keyed property
  128004. * values of `object`.
  128005. *
  128006. * **Note:** Non-object values are coerced to objects.
  128007. *
  128008. * @static
  128009. * @memberOf _
  128010. * @since 3.0.0
  128011. * @category Object
  128012. * @param {Object} object The object to query.
  128013. * @returns {Array} Returns the array of property values.
  128014. * @example
  128015. *
  128016. * function Foo() {
  128017. * this.a = 1;
  128018. * this.b = 2;
  128019. * }
  128020. *
  128021. * Foo.prototype.c = 3;
  128022. *
  128023. * _.valuesIn(new Foo);
  128024. * // => [1, 2, 3] (iteration order is not guaranteed)
  128025. */
  128026. function valuesIn(object) {
  128027. return object == null ? [] : Object(_baseValues_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
  128028. }
  128029. /* harmony default export */ __webpack_exports__["default"] = (valuesIn);
  128030. /***/ }),
  128031. /***/ "./node_modules/lodash-es/without.js":
  128032. /*!*******************************************!*\
  128033. !*** ./node_modules/lodash-es/without.js ***!
  128034. \*******************************************/
  128035. /*! exports provided: default */
  128036. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  128037. "use strict";
  128038. __webpack_require__.r(__webpack_exports__);
  128039. /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
  128040. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  128041. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  128042. /**
  128043. * Creates an array excluding all given values using
  128044. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  128045. * for equality comparisons.
  128046. *
  128047. * **Note:** Unlike `_.pull`, this method returns a new array.
  128048. *
  128049. * @static
  128050. * @memberOf _
  128051. * @since 0.1.0
  128052. * @category Array
  128053. * @param {Array} array The array to inspect.
  128054. * @param {...*} [values] The values to exclude.
  128055. * @returns {Array} Returns the new array of filtered values.
  128056. * @see _.difference, _.xor
  128057. * @example
  128058. *
  128059. * _.without([2, 1, 2, 3], 1, 2);
  128060. * // => [3]
  128061. */
  128062. var without = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(array, values) {
  128063. return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array)
  128064. ? Object(_baseDifference_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, values)
  128065. : [];
  128066. });
  128067. /* harmony default export */ __webpack_exports__["default"] = (without);
  128068. /***/ }),
  128069. /***/ "./node_modules/lodash-es/words.js":
  128070. /*!*****************************************!*\
  128071. !*** ./node_modules/lodash-es/words.js ***!
  128072. \*****************************************/
  128073. /*! exports provided: default */
  128074. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  128075. "use strict";
  128076. __webpack_require__.r(__webpack_exports__);
  128077. /* harmony import */ var _asciiWords_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_asciiWords.js */ "./node_modules/lodash-es/_asciiWords.js");
  128078. /* harmony import */ var _hasUnicodeWord_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasUnicodeWord.js */ "./node_modules/lodash-es/_hasUnicodeWord.js");
  128079. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  128080. /* harmony import */ var _unicodeWords_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_unicodeWords.js */ "./node_modules/lodash-es/_unicodeWords.js");
  128081. /**
  128082. * Splits `string` into an array of its words.
  128083. *
  128084. * @static
  128085. * @memberOf _
  128086. * @since 3.0.0
  128087. * @category String
  128088. * @param {string} [string=''] The string to inspect.
  128089. * @param {RegExp|string} [pattern] The pattern to match words.
  128090. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  128091. * @returns {Array} Returns the words of `string`.
  128092. * @example
  128093. *
  128094. * _.words('fred, barney, & pebbles');
  128095. * // => ['fred', 'barney', 'pebbles']
  128096. *
  128097. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  128098. * // => ['fred', 'barney', '&', 'pebbles']
  128099. */
  128100. function words(string, pattern, guard) {
  128101. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string);
  128102. pattern = guard ? undefined : pattern;
  128103. if (pattern === undefined) {
  128104. return Object(_hasUnicodeWord_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string) ? Object(_unicodeWords_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string) : Object(_asciiWords_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
  128105. }
  128106. return string.match(pattern) || [];
  128107. }
  128108. /* harmony default export */ __webpack_exports__["default"] = (words);
  128109. /***/ }),
  128110. /***/ "./node_modules/lodash-es/wrap.js":
  128111. /*!****************************************!*\
  128112. !*** ./node_modules/lodash-es/wrap.js ***!
  128113. \****************************************/
  128114. /*! exports provided: default */
  128115. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  128116. "use strict";
  128117. __webpack_require__.r(__webpack_exports__);
  128118. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  128119. /* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./partial.js */ "./node_modules/lodash-es/partial.js");
  128120. /**
  128121. * Creates a function that provides `value` to `wrapper` as its first
  128122. * argument. Any additional arguments provided to the function are appended
  128123. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  128124. * binding of the created function.
  128125. *
  128126. * @static
  128127. * @memberOf _
  128128. * @since 0.1.0
  128129. * @category Function
  128130. * @param {*} value The value to wrap.
  128131. * @param {Function} [wrapper=identity] The wrapper function.
  128132. * @returns {Function} Returns the new function.
  128133. * @example
  128134. *
  128135. * var p = _.wrap(_.escape, function(func, text) {
  128136. * return '<p>' + func(text) + '</p>';
  128137. * });
  128138. *
  128139. * p('fred, barney, & pebbles');
  128140. * // => '<p>fred, barney, &amp; pebbles</p>'
  128141. */
  128142. function wrap(value, wrapper) {
  128143. return Object(_partial_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_0__["default"])(wrapper), value);
  128144. }
  128145. /* harmony default export */ __webpack_exports__["default"] = (wrap);
  128146. /***/ }),
  128147. /***/ "./node_modules/lodash-es/wrapperAt.js":
  128148. /*!*********************************************!*\
  128149. !*** ./node_modules/lodash-es/wrapperAt.js ***!
  128150. \*********************************************/
  128151. /*! exports provided: default */
  128152. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  128153. "use strict";
  128154. __webpack_require__.r(__webpack_exports__);
  128155. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  128156. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  128157. /* harmony import */ var _baseAt_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseAt.js */ "./node_modules/lodash-es/_baseAt.js");
  128158. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  128159. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  128160. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  128161. /**
  128162. * This method is the wrapper version of `_.at`.
  128163. *
  128164. * @name at
  128165. * @memberOf _
  128166. * @since 1.0.0
  128167. * @category Seq
  128168. * @param {...(string|string[])} [paths] The property paths to pick.
  128169. * @returns {Object} Returns the new `lodash` wrapper instance.
  128170. * @example
  128171. *
  128172. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  128173. *
  128174. * _(object).at(['a[0].b.c', 'a[1]']).value();
  128175. * // => [3, 4]
  128176. */
  128177. var wrapperAt = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(paths) {
  128178. var length = paths.length,
  128179. start = length ? paths[0] : 0,
  128180. value = this.__wrapped__,
  128181. interceptor = function(object) { return Object(_baseAt_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, paths); };
  128182. if (length > 1 || this.__actions__.length ||
  128183. !(value instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]) || !Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_4__["default"])(start)) {
  128184. return this.thru(interceptor);
  128185. }
  128186. value = value.slice(start, +start + (length ? 1 : 0));
  128187. value.__actions__.push({
  128188. 'func': _thru_js__WEBPACK_IMPORTED_MODULE_5__["default"],
  128189. 'args': [interceptor],
  128190. 'thisArg': undefined
  128191. });
  128192. return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"](value, this.__chain__).thru(function(array) {
  128193. if (length && !array.length) {
  128194. array.push(undefined);
  128195. }
  128196. return array;
  128197. });
  128198. });
  128199. /* harmony default export */ __webpack_exports__["default"] = (wrapperAt);
  128200. /***/ }),
  128201. /***/ "./node_modules/lodash-es/wrapperChain.js":
  128202. /*!************************************************!*\
  128203. !*** ./node_modules/lodash-es/wrapperChain.js ***!
  128204. \************************************************/
  128205. /*! exports provided: default */
  128206. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  128207. "use strict";
  128208. __webpack_require__.r(__webpack_exports__);
  128209. /* harmony import */ var _chain_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chain.js */ "./node_modules/lodash-es/chain.js");
  128210. /**
  128211. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  128212. *
  128213. * @name chain
  128214. * @memberOf _
  128215. * @since 0.1.0
  128216. * @category Seq
  128217. * @returns {Object} Returns the new `lodash` wrapper instance.
  128218. * @example
  128219. *
  128220. * var users = [
  128221. * { 'user': 'barney', 'age': 36 },
  128222. * { 'user': 'fred', 'age': 40 }
  128223. * ];
  128224. *
  128225. * // A sequence without explicit chaining.
  128226. * _(users).head();
  128227. * // => { 'user': 'barney', 'age': 36 }
  128228. *
  128229. * // A sequence with explicit chaining.
  128230. * _(users)
  128231. * .chain()
  128232. * .head()
  128233. * .pick('user')
  128234. * .value();
  128235. * // => { 'user': 'barney' }
  128236. */
  128237. function wrapperChain() {
  128238. return Object(_chain_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this);
  128239. }
  128240. /* harmony default export */ __webpack_exports__["default"] = (wrapperChain);
  128241. /***/ }),
  128242. /***/ "./node_modules/lodash-es/wrapperLodash.js":
  128243. /*!*************************************************!*\
  128244. !*** ./node_modules/lodash-es/wrapperLodash.js ***!
  128245. \*************************************************/
  128246. /*! exports provided: default */
  128247. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  128248. "use strict";
  128249. __webpack_require__.r(__webpack_exports__);
  128250. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  128251. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  128252. /* harmony import */ var _baseLodash_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseLodash.js */ "./node_modules/lodash-es/_baseLodash.js");
  128253. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  128254. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  128255. /* harmony import */ var _wrapperClone_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_wrapperClone.js */ "./node_modules/lodash-es/_wrapperClone.js");
  128256. /** Used for built-in method references. */
  128257. var objectProto = Object.prototype;
  128258. /** Used to check objects for own properties. */
  128259. var hasOwnProperty = objectProto.hasOwnProperty;
  128260. /**
  128261. * Creates a `lodash` object which wraps `value` to enable implicit method
  128262. * chain sequences. Methods that operate on and return arrays, collections,
  128263. * and functions can be chained together. Methods that retrieve a single value
  128264. * or may return a primitive value will automatically end the chain sequence
  128265. * and return the unwrapped value. Otherwise, the value must be unwrapped
  128266. * with `_#value`.
  128267. *
  128268. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  128269. * enabled using `_.chain`.
  128270. *
  128271. * The execution of chained methods is lazy, that is, it's deferred until
  128272. * `_#value` is implicitly or explicitly called.
  128273. *
  128274. * Lazy evaluation allows several methods to support shortcut fusion.
  128275. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  128276. * the creation of intermediate arrays and can greatly reduce the number of
  128277. * iteratee executions. Sections of a chain sequence qualify for shortcut
  128278. * fusion if the section is applied to an array and iteratees accept only
  128279. * one argument. The heuristic for whether a section qualifies for shortcut
  128280. * fusion is subject to change.
  128281. *
  128282. * Chaining is supported in custom builds as long as the `_#value` method is
  128283. * directly or indirectly included in the build.
  128284. *
  128285. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  128286. *
  128287. * The wrapper `Array` methods are:
  128288. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  128289. *
  128290. * The wrapper `String` methods are:
  128291. * `replace` and `split`
  128292. *
  128293. * The wrapper methods that support shortcut fusion are:
  128294. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  128295. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  128296. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  128297. *
  128298. * The chainable wrapper methods are:
  128299. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  128300. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  128301. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  128302. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  128303. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  128304. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  128305. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  128306. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  128307. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  128308. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  128309. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  128310. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  128311. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  128312. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  128313. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  128314. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  128315. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  128316. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  128317. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  128318. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  128319. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  128320. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  128321. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  128322. * `zipObject`, `zipObjectDeep`, and `zipWith`
  128323. *
  128324. * The wrapper methods that are **not** chainable by default are:
  128325. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  128326. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  128327. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  128328. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  128329. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  128330. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  128331. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  128332. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  128333. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  128334. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  128335. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  128336. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  128337. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  128338. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  128339. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  128340. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  128341. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  128342. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  128343. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  128344. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  128345. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  128346. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  128347. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  128348. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  128349. * `upperFirst`, `value`, and `words`
  128350. *
  128351. * @name _
  128352. * @constructor
  128353. * @category Seq
  128354. * @param {*} value The value to wrap in a `lodash` instance.
  128355. * @returns {Object} Returns the new `lodash` wrapper instance.
  128356. * @example
  128357. *
  128358. * function square(n) {
  128359. * return n * n;
  128360. * }
  128361. *
  128362. * var wrapped = _([1, 2, 3]);
  128363. *
  128364. * // Returns an unwrapped value.
  128365. * wrapped.reduce(_.add);
  128366. * // => 6
  128367. *
  128368. * // Returns a wrapped value.
  128369. * var squares = wrapped.map(square);
  128370. *
  128371. * _.isArray(squares);
  128372. * // => false
  128373. *
  128374. * _.isArray(squares.value());
  128375. * // => true
  128376. */
  128377. function lodash(value) {
  128378. if (Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value) && !Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value) && !(value instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"])) {
  128379. if (value instanceof _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"]) {
  128380. return value;
  128381. }
  128382. if (hasOwnProperty.call(value, '__wrapped__')) {
  128383. return Object(_wrapperClone_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value);
  128384. }
  128385. }
  128386. return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"](value);
  128387. }
  128388. // Ensure wrappers are instances of `baseLodash`.
  128389. lodash.prototype = _baseLodash_js__WEBPACK_IMPORTED_MODULE_2__["default"].prototype;
  128390. lodash.prototype.constructor = lodash;
  128391. /* harmony default export */ __webpack_exports__["default"] = (lodash);
  128392. /***/ }),
  128393. /***/ "./node_modules/lodash-es/wrapperReverse.js":
  128394. /*!**************************************************!*\
  128395. !*** ./node_modules/lodash-es/wrapperReverse.js ***!
  128396. \**************************************************/
  128397. /*! exports provided: default */
  128398. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  128399. "use strict";
  128400. __webpack_require__.r(__webpack_exports__);
  128401. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  128402. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  128403. /* harmony import */ var _reverse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./reverse.js */ "./node_modules/lodash-es/reverse.js");
  128404. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  128405. /**
  128406. * This method is the wrapper version of `_.reverse`.
  128407. *
  128408. * **Note:** This method mutates the wrapped array.
  128409. *
  128410. * @name reverse
  128411. * @memberOf _
  128412. * @since 0.1.0
  128413. * @category Seq
  128414. * @returns {Object} Returns the new `lodash` wrapper instance.
  128415. * @example
  128416. *
  128417. * var array = [1, 2, 3];
  128418. *
  128419. * _(array).reverse().value()
  128420. * // => [3, 2, 1]
  128421. *
  128422. * console.log(array);
  128423. * // => [3, 2, 1]
  128424. */
  128425. function wrapperReverse() {
  128426. var value = this.__wrapped__;
  128427. if (value instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  128428. var wrapped = value;
  128429. if (this.__actions__.length) {
  128430. wrapped = new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"](this);
  128431. }
  128432. wrapped = wrapped.reverse();
  128433. wrapped.__actions__.push({
  128434. 'func': _thru_js__WEBPACK_IMPORTED_MODULE_3__["default"],
  128435. 'args': [_reverse_js__WEBPACK_IMPORTED_MODULE_2__["default"]],
  128436. 'thisArg': undefined
  128437. });
  128438. return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"](wrapped, this.__chain__);
  128439. }
  128440. return this.thru(_reverse_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
  128441. }
  128442. /* harmony default export */ __webpack_exports__["default"] = (wrapperReverse);
  128443. /***/ }),
  128444. /***/ "./node_modules/lodash-es/wrapperValue.js":
  128445. /*!************************************************!*\
  128446. !*** ./node_modules/lodash-es/wrapperValue.js ***!
  128447. \************************************************/
  128448. /*! exports provided: default */
  128449. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  128450. "use strict";
  128451. __webpack_require__.r(__webpack_exports__);
  128452. /* harmony import */ var _baseWrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseWrapperValue.js */ "./node_modules/lodash-es/_baseWrapperValue.js");
  128453. /**
  128454. * Executes the chain sequence to resolve the unwrapped value.
  128455. *
  128456. * @name value
  128457. * @memberOf _
  128458. * @since 0.1.0
  128459. * @alias toJSON, valueOf
  128460. * @category Seq
  128461. * @returns {*} Returns the resolved unwrapped value.
  128462. * @example
  128463. *
  128464. * _([1, 2, 3]).value();
  128465. * // => [1, 2, 3]
  128466. */
  128467. function wrapperValue() {
  128468. return Object(_baseWrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.__wrapped__, this.__actions__);
  128469. }
  128470. /* harmony default export */ __webpack_exports__["default"] = (wrapperValue);
  128471. /***/ }),
  128472. /***/ "./node_modules/lodash-es/xor.js":
  128473. /*!***************************************!*\
  128474. !*** ./node_modules/lodash-es/xor.js ***!
  128475. \***************************************/
  128476. /*! exports provided: default */
  128477. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  128478. "use strict";
  128479. __webpack_require__.r(__webpack_exports__);
  128480. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  128481. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  128482. /* harmony import */ var _baseXor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseXor.js */ "./node_modules/lodash-es/_baseXor.js");
  128483. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  128484. /**
  128485. * Creates an array of unique values that is the
  128486. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  128487. * of the given arrays. The order of result values is determined by the order
  128488. * they occur in the arrays.
  128489. *
  128490. * @static
  128491. * @memberOf _
  128492. * @since 2.4.0
  128493. * @category Array
  128494. * @param {...Array} [arrays] The arrays to inspect.
  128495. * @returns {Array} Returns the new array of filtered values.
  128496. * @see _.difference, _.without
  128497. * @example
  128498. *
  128499. * _.xor([2, 1], [2, 3]);
  128500. * // => [1, 3]
  128501. */
  128502. var xor = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(arrays) {
  128503. return Object(_baseXor_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"]));
  128504. });
  128505. /* harmony default export */ __webpack_exports__["default"] = (xor);
  128506. /***/ }),
  128507. /***/ "./node_modules/lodash-es/xorBy.js":
  128508. /*!*****************************************!*\
  128509. !*** ./node_modules/lodash-es/xorBy.js ***!
  128510. \*****************************************/
  128511. /*! exports provided: default */
  128512. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  128513. "use strict";
  128514. __webpack_require__.r(__webpack_exports__);
  128515. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  128516. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  128517. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  128518. /* harmony import */ var _baseXor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseXor.js */ "./node_modules/lodash-es/_baseXor.js");
  128519. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  128520. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  128521. /**
  128522. * This method is like `_.xor` except that it accepts `iteratee` which is
  128523. * invoked for each element of each `arrays` to generate the criterion by
  128524. * which by which they're compared. The order of result values is determined
  128525. * by the order they occur in the arrays. The iteratee is invoked with one
  128526. * argument: (value).
  128527. *
  128528. * @static
  128529. * @memberOf _
  128530. * @since 4.0.0
  128531. * @category Array
  128532. * @param {...Array} [arrays] The arrays to inspect.
  128533. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  128534. * @returns {Array} Returns the new array of filtered values.
  128535. * @example
  128536. *
  128537. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  128538. * // => [1.2, 3.4]
  128539. *
  128540. * // The `_.property` iteratee shorthand.
  128541. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  128542. * // => [{ 'x': 2 }]
  128543. */
  128544. var xorBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(arrays) {
  128545. var iteratee = Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(arrays);
  128546. if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee)) {
  128547. iteratee = undefined;
  128548. }
  128549. return Object(_baseXor_js__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"]), Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee, 2));
  128550. });
  128551. /* harmony default export */ __webpack_exports__["default"] = (xorBy);
  128552. /***/ }),
  128553. /***/ "./node_modules/lodash-es/xorWith.js":
  128554. /*!*******************************************!*\
  128555. !*** ./node_modules/lodash-es/xorWith.js ***!
  128556. \*******************************************/
  128557. /*! exports provided: default */
  128558. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  128559. "use strict";
  128560. __webpack_require__.r(__webpack_exports__);
  128561. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  128562. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  128563. /* harmony import */ var _baseXor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseXor.js */ "./node_modules/lodash-es/_baseXor.js");
  128564. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  128565. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  128566. /**
  128567. * This method is like `_.xor` except that it accepts `comparator` which is
  128568. * invoked to compare elements of `arrays`. The order of result values is
  128569. * determined by the order they occur in the arrays. The comparator is invoked
  128570. * with two arguments: (arrVal, othVal).
  128571. *
  128572. * @static
  128573. * @memberOf _
  128574. * @since 4.0.0
  128575. * @category Array
  128576. * @param {...Array} [arrays] The arrays to inspect.
  128577. * @param {Function} [comparator] The comparator invoked per element.
  128578. * @returns {Array} Returns the new array of filtered values.
  128579. * @example
  128580. *
  128581. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  128582. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  128583. *
  128584. * _.xorWith(objects, others, _.isEqual);
  128585. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  128586. */
  128587. var xorWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(arrays) {
  128588. var comparator = Object(_last_js__WEBPACK_IMPORTED_MODULE_4__["default"])(arrays);
  128589. comparator = typeof comparator == 'function' ? comparator : undefined;
  128590. return Object(_baseXor_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"]), undefined, comparator);
  128591. });
  128592. /* harmony default export */ __webpack_exports__["default"] = (xorWith);
  128593. /***/ }),
  128594. /***/ "./node_modules/lodash-es/zip.js":
  128595. /*!***************************************!*\
  128596. !*** ./node_modules/lodash-es/zip.js ***!
  128597. \***************************************/
  128598. /*! exports provided: default */
  128599. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  128600. "use strict";
  128601. __webpack_require__.r(__webpack_exports__);
  128602. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  128603. /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
  128604. /**
  128605. * Creates an array of grouped elements, the first of which contains the
  128606. * first elements of the given arrays, the second of which contains the
  128607. * second elements of the given arrays, and so on.
  128608. *
  128609. * @static
  128610. * @memberOf _
  128611. * @since 0.1.0
  128612. * @category Array
  128613. * @param {...Array} [arrays] The arrays to process.
  128614. * @returns {Array} Returns the new array of grouped elements.
  128615. * @example
  128616. *
  128617. * _.zip(['a', 'b'], [1, 2], [true, false]);
  128618. * // => [['a', 1, true], ['b', 2, false]]
  128619. */
  128620. var zip = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_unzip_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  128621. /* harmony default export */ __webpack_exports__["default"] = (zip);
  128622. /***/ }),
  128623. /***/ "./node_modules/lodash-es/zipObject.js":
  128624. /*!*********************************************!*\
  128625. !*** ./node_modules/lodash-es/zipObject.js ***!
  128626. \*********************************************/
  128627. /*! exports provided: default */
  128628. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  128629. "use strict";
  128630. __webpack_require__.r(__webpack_exports__);
  128631. /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
  128632. /* harmony import */ var _baseZipObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseZipObject.js */ "./node_modules/lodash-es/_baseZipObject.js");
  128633. /**
  128634. * This method is like `_.fromPairs` except that it accepts two arrays,
  128635. * one of property identifiers and one of corresponding values.
  128636. *
  128637. * @static
  128638. * @memberOf _
  128639. * @since 0.4.0
  128640. * @category Array
  128641. * @param {Array} [props=[]] The property identifiers.
  128642. * @param {Array} [values=[]] The property values.
  128643. * @returns {Object} Returns the new object.
  128644. * @example
  128645. *
  128646. * _.zipObject(['a', 'b'], [1, 2]);
  128647. * // => { 'a': 1, 'b': 2 }
  128648. */
  128649. function zipObject(props, values) {
  128650. return Object(_baseZipObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(props || [], values || [], _assignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  128651. }
  128652. /* harmony default export */ __webpack_exports__["default"] = (zipObject);
  128653. /***/ }),
  128654. /***/ "./node_modules/lodash-es/zipObjectDeep.js":
  128655. /*!*************************************************!*\
  128656. !*** ./node_modules/lodash-es/zipObjectDeep.js ***!
  128657. \*************************************************/
  128658. /*! exports provided: default */
  128659. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  128660. "use strict";
  128661. __webpack_require__.r(__webpack_exports__);
  128662. /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
  128663. /* harmony import */ var _baseZipObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseZipObject.js */ "./node_modules/lodash-es/_baseZipObject.js");
  128664. /**
  128665. * This method is like `_.zipObject` except that it supports property paths.
  128666. *
  128667. * @static
  128668. * @memberOf _
  128669. * @since 4.1.0
  128670. * @category Array
  128671. * @param {Array} [props=[]] The property identifiers.
  128672. * @param {Array} [values=[]] The property values.
  128673. * @returns {Object} Returns the new object.
  128674. * @example
  128675. *
  128676. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  128677. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  128678. */
  128679. function zipObjectDeep(props, values) {
  128680. return Object(_baseZipObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(props || [], values || [], _baseSet_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  128681. }
  128682. /* harmony default export */ __webpack_exports__["default"] = (zipObjectDeep);
  128683. /***/ }),
  128684. /***/ "./node_modules/lodash-es/zipWith.js":
  128685. /*!*******************************************!*\
  128686. !*** ./node_modules/lodash-es/zipWith.js ***!
  128687. \*******************************************/
  128688. /*! exports provided: default */
  128689. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  128690. "use strict";
  128691. __webpack_require__.r(__webpack_exports__);
  128692. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  128693. /* harmony import */ var _unzipWith_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./unzipWith.js */ "./node_modules/lodash-es/unzipWith.js");
  128694. /**
  128695. * This method is like `_.zip` except that it accepts `iteratee` to specify
  128696. * how grouped values should be combined. The iteratee is invoked with the
  128697. * elements of each group: (...group).
  128698. *
  128699. * @static
  128700. * @memberOf _
  128701. * @since 3.8.0
  128702. * @category Array
  128703. * @param {...Array} [arrays] The arrays to process.
  128704. * @param {Function} [iteratee=_.identity] The function to combine
  128705. * grouped values.
  128706. * @returns {Array} Returns the new array of grouped elements.
  128707. * @example
  128708. *
  128709. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  128710. * return a + b + c;
  128711. * });
  128712. * // => [111, 222]
  128713. */
  128714. var zipWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(arrays) {
  128715. var length = arrays.length,
  128716. iteratee = length > 1 ? arrays[length - 1] : undefined;
  128717. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  128718. return Object(_unzipWith_js__WEBPACK_IMPORTED_MODULE_1__["default"])(arrays, iteratee);
  128719. });
  128720. /* harmony default export */ __webpack_exports__["default"] = (zipWith);
  128721. /***/ }),
  128722. /***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":
  128723. /*!****************************************************************************!*\
  128724. !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
  128725. \****************************************************************************/
  128726. /*! no static exports found */
  128727. /***/ (function(module, exports, __webpack_require__) {
  128728. "use strict";
  128729. var isOldIE = function isOldIE() {
  128730. var memo;
  128731. return function memorize() {
  128732. if (typeof memo === 'undefined') {
  128733. // Test for IE <= 9 as proposed by Browserhacks
  128734. // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
  128735. // Tests for existence of standard globals is to allow style-loader
  128736. // to operate correctly into non-standard environments
  128737. // @see https://github.com/webpack-contrib/style-loader/issues/177
  128738. memo = Boolean(window && document && document.all && !window.atob);
  128739. }
  128740. return memo;
  128741. };
  128742. }();
  128743. var getTarget = function getTarget() {
  128744. var memo = {};
  128745. return function memorize(target) {
  128746. if (typeof memo[target] === 'undefined') {
  128747. var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
  128748. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  128749. try {
  128750. // This will throw an exception if access to iframe is blocked
  128751. // due to cross-origin restrictions
  128752. styleTarget = styleTarget.contentDocument.head;
  128753. } catch (e) {
  128754. // istanbul ignore next
  128755. styleTarget = null;
  128756. }
  128757. }
  128758. memo[target] = styleTarget;
  128759. }
  128760. return memo[target];
  128761. };
  128762. }();
  128763. var stylesInDom = [];
  128764. function getIndexByIdentifier(identifier) {
  128765. var result = -1;
  128766. for (var i = 0; i < stylesInDom.length; i++) {
  128767. if (stylesInDom[i].identifier === identifier) {
  128768. result = i;
  128769. break;
  128770. }
  128771. }
  128772. return result;
  128773. }
  128774. function modulesToDom(list, options) {
  128775. var idCountMap = {};
  128776. var identifiers = [];
  128777. for (var i = 0; i < list.length; i++) {
  128778. var item = list[i];
  128779. var id = options.base ? item[0] + options.base : item[0];
  128780. var count = idCountMap[id] || 0;
  128781. var identifier = "".concat(id, " ").concat(count);
  128782. idCountMap[id] = count + 1;
  128783. var index = getIndexByIdentifier(identifier);
  128784. var obj = {
  128785. css: item[1],
  128786. media: item[2],
  128787. sourceMap: item[3]
  128788. };
  128789. if (index !== -1) {
  128790. stylesInDom[index].references++;
  128791. stylesInDom[index].updater(obj);
  128792. } else {
  128793. stylesInDom.push({
  128794. identifier: identifier,
  128795. updater: addStyle(obj, options),
  128796. references: 1
  128797. });
  128798. }
  128799. identifiers.push(identifier);
  128800. }
  128801. return identifiers;
  128802. }
  128803. function insertStyleElement(options) {
  128804. var style = document.createElement('style');
  128805. var attributes = options.attributes || {};
  128806. if (typeof attributes.nonce === 'undefined') {
  128807. var nonce = true ? __webpack_require__.nc : undefined;
  128808. if (nonce) {
  128809. attributes.nonce = nonce;
  128810. }
  128811. }
  128812. Object.keys(attributes).forEach(function (key) {
  128813. style.setAttribute(key, attributes[key]);
  128814. });
  128815. if (typeof options.insert === 'function') {
  128816. options.insert(style);
  128817. } else {
  128818. var target = getTarget(options.insert || 'head');
  128819. if (!target) {
  128820. throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
  128821. }
  128822. target.appendChild(style);
  128823. }
  128824. return style;
  128825. }
  128826. function removeStyleElement(style) {
  128827. // istanbul ignore if
  128828. if (style.parentNode === null) {
  128829. return false;
  128830. }
  128831. style.parentNode.removeChild(style);
  128832. }
  128833. /* istanbul ignore next */
  128834. var replaceText = function replaceText() {
  128835. var textStore = [];
  128836. return function replace(index, replacement) {
  128837. textStore[index] = replacement;
  128838. return textStore.filter(Boolean).join('\n');
  128839. };
  128840. }();
  128841. function applyToSingletonTag(style, index, remove, obj) {
  128842. var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE
  128843. /* istanbul ignore if */
  128844. if (style.styleSheet) {
  128845. style.styleSheet.cssText = replaceText(index, css);
  128846. } else {
  128847. var cssNode = document.createTextNode(css);
  128848. var childNodes = style.childNodes;
  128849. if (childNodes[index]) {
  128850. style.removeChild(childNodes[index]);
  128851. }
  128852. if (childNodes.length) {
  128853. style.insertBefore(cssNode, childNodes[index]);
  128854. } else {
  128855. style.appendChild(cssNode);
  128856. }
  128857. }
  128858. }
  128859. function applyToTag(style, options, obj) {
  128860. var css = obj.css;
  128861. var media = obj.media;
  128862. var sourceMap = obj.sourceMap;
  128863. if (media) {
  128864. style.setAttribute('media', media);
  128865. } else {
  128866. style.removeAttribute('media');
  128867. }
  128868. if (sourceMap && typeof btoa !== 'undefined') {
  128869. css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  128870. } // For old IE
  128871. /* istanbul ignore if */
  128872. if (style.styleSheet) {
  128873. style.styleSheet.cssText = css;
  128874. } else {
  128875. while (style.firstChild) {
  128876. style.removeChild(style.firstChild);
  128877. }
  128878. style.appendChild(document.createTextNode(css));
  128879. }
  128880. }
  128881. var singleton = null;
  128882. var singletonCounter = 0;
  128883. function addStyle(obj, options) {
  128884. var style;
  128885. var update;
  128886. var remove;
  128887. if (options.singleton) {
  128888. var styleIndex = singletonCounter++;
  128889. style = singleton || (singleton = insertStyleElement(options));
  128890. update = applyToSingletonTag.bind(null, style, styleIndex, false);
  128891. remove = applyToSingletonTag.bind(null, style, styleIndex, true);
  128892. } else {
  128893. style = insertStyleElement(options);
  128894. update = applyToTag.bind(null, style, options);
  128895. remove = function remove() {
  128896. removeStyleElement(style);
  128897. };
  128898. }
  128899. update(obj);
  128900. return function updateStyle(newObj) {
  128901. if (newObj) {
  128902. if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
  128903. return;
  128904. }
  128905. update(obj = newObj);
  128906. } else {
  128907. remove();
  128908. }
  128909. };
  128910. }
  128911. module.exports = function (list, options) {
  128912. options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  128913. // tags it will allow on a page
  128914. if (!options.singleton && typeof options.singleton !== 'boolean') {
  128915. options.singleton = isOldIE();
  128916. }
  128917. list = list || [];
  128918. var lastIdentifiers = modulesToDom(list, options);
  128919. return function update(newList) {
  128920. newList = newList || [];
  128921. if (Object.prototype.toString.call(newList) !== '[object Array]') {
  128922. return;
  128923. }
  128924. for (var i = 0; i < lastIdentifiers.length; i++) {
  128925. var identifier = lastIdentifiers[i];
  128926. var index = getIndexByIdentifier(identifier);
  128927. stylesInDom[index].references--;
  128928. }
  128929. var newLastIdentifiers = modulesToDom(newList, options);
  128930. for (var _i = 0; _i < lastIdentifiers.length; _i++) {
  128931. var _identifier = lastIdentifiers[_i];
  128932. var _index = getIndexByIdentifier(_identifier);
  128933. if (stylesInDom[_index].references === 0) {
  128934. stylesInDom[_index].updater();
  128935. stylesInDom.splice(_index, 1);
  128936. }
  128937. }
  128938. lastIdentifiers = newLastIdentifiers;
  128939. };
  128940. };
  128941. /***/ }),
  128942. /***/ "./node_modules/webpack/buildin/global.js":
  128943. /*!***********************************!*\
  128944. !*** (webpack)/buildin/global.js ***!
  128945. \***********************************/
  128946. /*! no static exports found */
  128947. /***/ (function(module, exports) {
  128948. var g;
  128949. // This works in non-strict mode
  128950. g = (function() {
  128951. return this;
  128952. })();
  128953. try {
  128954. // This works if eval is allowed (see CSP)
  128955. g = g || new Function("return this")();
  128956. } catch (e) {
  128957. // This works if the window reference is available
  128958. if (typeof window === "object") g = window;
  128959. }
  128960. // g can still be undefined, but nothing to do about it...
  128961. // We return undefined, instead of nothing here, so it's
  128962. // easier to handle this case. if(!global) { ...}
  128963. module.exports = g;
  128964. /***/ }),
  128965. /***/ "./node_modules/webpack/buildin/harmony-module.js":
  128966. /*!*******************************************!*\
  128967. !*** (webpack)/buildin/harmony-module.js ***!
  128968. \*******************************************/
  128969. /*! no static exports found */
  128970. /***/ (function(module, exports) {
  128971. module.exports = function(originalModule) {
  128972. if (!originalModule.webpackPolyfill) {
  128973. var module = Object.create(originalModule);
  128974. // module.parent = undefined by default
  128975. if (!module.children) module.children = [];
  128976. Object.defineProperty(module, "loaded", {
  128977. enumerable: true,
  128978. get: function() {
  128979. return module.l;
  128980. }
  128981. });
  128982. Object.defineProperty(module, "id", {
  128983. enumerable: true,
  128984. get: function() {
  128985. return module.i;
  128986. }
  128987. });
  128988. Object.defineProperty(module, "exports", {
  128989. enumerable: true
  128990. });
  128991. module.webpackPolyfill = 1;
  128992. }
  128993. return module;
  128994. };
  128995. /***/ }),
  128996. /***/ "./src/ckeditor.js":
  128997. /*!*************************!*\
  128998. !*** ./src/ckeditor.js ***!
  128999. \*************************/
  129000. /*! exports provided: default */
  129001. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  129002. "use strict";
  129003. __webpack_require__.r(__webpack_exports__);
  129004. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClassicEditor; });
  129005. /* harmony import */ var _ckeditor_ckeditor5_editor_classic_src_classiceditor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-editor-classic/src/classiceditor */ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js");
  129006. /* harmony import */ var _ckeditor_ckeditor5_essentials_src_essentials__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-essentials/src/essentials */ "./node_modules/@ckeditor/ckeditor5-essentials/src/essentials.js");
  129007. /* harmony import */ var _ckeditor_ckeditor5_adapter_ckfinder_src_uploadadapter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter */ "./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js");
  129008. /* harmony import */ var _ckeditor_ckeditor5_autoformat_src_autoformat__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-autoformat/src/autoformat */ "./node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js");
  129009. /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_bold__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/bold */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js");
  129010. /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_italic__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/italic */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js");
  129011. /* harmony import */ var _ckeditor_ckeditor5_block_quote_src_blockquote__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-block-quote/src/blockquote */ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js");
  129012. /* harmony import */ var _ckeditor_ckeditor5_ckfinder_src_ckfinder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-ckfinder/src/ckfinder */ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinder.js");
  129013. /* harmony import */ var _ckeditor_ckeditor5_easy_image_src_easyimage__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-easy-image/src/easyimage */ "./node_modules/@ckeditor/ckeditor5-easy-image/src/easyimage.js");
  129014. /* harmony import */ var _ckeditor_ckeditor5_heading_src_heading__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-heading/src/heading */ "./node_modules/@ckeditor/ckeditor5-heading/src/heading.js");
  129015. /* harmony import */ var _ckeditor_ckeditor5_html_embed_src_htmlembed__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-html-embed/src/htmlembed */ "./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembed.js");
  129016. /* harmony import */ var _ckeditor_ckeditor5_image_src_image__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/image */ "./node_modules/@ckeditor/ckeditor5-image/src/image.js");
  129017. /* harmony import */ var _ckeditor_ckeditor5_image_src_imagecaption__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imagecaption */ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption.js");
  129018. /* harmony import */ var _ckeditor_ckeditor5_image_src_imagestyle__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imagestyle */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle.js");
  129019. /* harmony import */ var _ckeditor_ckeditor5_image_src_imagetoolbar__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imagetoolbar */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetoolbar.js");
  129020. /* harmony import */ var _ckeditor_ckeditor5_image_src_imageupload__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imageupload */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload.js");
  129021. /* harmony import */ var _ckeditor_ckeditor5_image_src_imageresize__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imageresize */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize.js");
  129022. /* harmony import */ var _ckeditor_ckeditor5_link_src_linkimage__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @ckeditor/ckeditor5-link/src/linkimage */ "./node_modules/@ckeditor/ckeditor5-link/src/linkimage.js");
  129023. /* harmony import */ var _ckeditor_ckeditor5_indent_src_indent__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @ckeditor/ckeditor5-indent/src/indent */ "./node_modules/@ckeditor/ckeditor5-indent/src/indent.js");
  129024. /* harmony import */ var _ckeditor_ckeditor5_link_src_link__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @ckeditor/ckeditor5-link/src/link */ "./node_modules/@ckeditor/ckeditor5-link/src/link.js");
  129025. /* harmony import */ var _ckeditor_ckeditor5_list_src_list__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @ckeditor/ckeditor5-list/src/list */ "./node_modules/@ckeditor/ckeditor5-list/src/list.js");
  129026. /* harmony import */ var _ckeditor_ckeditor5_paragraph_src_paragraph__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @ckeditor/ckeditor5-paragraph/src/paragraph */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js");
  129027. /* harmony import */ var _ckeditor_ckeditor5_paste_from_office_src_pastefromoffice__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @ckeditor/ckeditor5-paste-from-office/src/pastefromoffice */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js");
  129028. /* harmony import */ var _ckeditor_ckeditor5_remove_format_src_removeformat__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @ckeditor/ckeditor5-remove-format/src/removeformat */ "./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformat.js");
  129029. /* harmony import */ var _ckeditor_ckeditor5_table_src_table__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @ckeditor/ckeditor5-table/src/table */ "./node_modules/@ckeditor/ckeditor5-table/src/table.js");
  129030. /* harmony import */ var _ckeditor_ckeditor5_table_src_tabletoolbar__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @ckeditor/ckeditor5-table/src/tabletoolbar */ "./node_modules/@ckeditor/ckeditor5-table/src/tabletoolbar.js");
  129031. /* harmony import */ var _ckeditor_ckeditor5_typing_src_texttransformation__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/texttransformation */ "./node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js");
  129032. /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_superscript__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/superscript */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js");
  129033. /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_subscript__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/subscript */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js");
  129034. /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_strikethrough__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/strikethrough */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js");
  129035. /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_underline__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/underline */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js");
  129036. /* harmony import */ var _ckeditor_ckeditor5_font_src_fontcolor__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @ckeditor/ckeditor5-font/src/fontcolor */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor.js");
  129037. /* harmony import */ var _ckeditor_ckeditor5_font_src_fontbackgroundcolor__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @ckeditor/ckeditor5-font/src/fontbackgroundcolor */ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js");
  129038. /* harmony import */ var _ckeditor_ckeditor5_alignment_src_alignment__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! @ckeditor/ckeditor5-alignment/src/alignment */ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignment.js");
  129039. // import MediaEmbed from '@ckeditor/ckeditor5-media-embed/src/mediaembed';
  129040. class ClassicEditor extends _ckeditor_ckeditor5_editor_classic_src_classiceditor__WEBPACK_IMPORTED_MODULE_0__["default"] {
  129041. }
  129042. // Plugins to include in the build.
  129043. ClassicEditor.builtinPlugins = [
  129044. _ckeditor_ckeditor5_essentials_src_essentials__WEBPACK_IMPORTED_MODULE_1__["default"],
  129045. _ckeditor_ckeditor5_adapter_ckfinder_src_uploadadapter__WEBPACK_IMPORTED_MODULE_2__["default"],
  129046. _ckeditor_ckeditor5_autoformat_src_autoformat__WEBPACK_IMPORTED_MODULE_3__["default"],
  129047. _ckeditor_ckeditor5_basic_styles_src_bold__WEBPACK_IMPORTED_MODULE_4__["default"],
  129048. _ckeditor_ckeditor5_basic_styles_src_italic__WEBPACK_IMPORTED_MODULE_5__["default"],
  129049. _ckeditor_ckeditor5_basic_styles_src_underline__WEBPACK_IMPORTED_MODULE_30__["default"],
  129050. _ckeditor_ckeditor5_basic_styles_src_strikethrough__WEBPACK_IMPORTED_MODULE_29__["default"],
  129051. _ckeditor_ckeditor5_basic_styles_src_subscript__WEBPACK_IMPORTED_MODULE_28__["default"],
  129052. _ckeditor_ckeditor5_basic_styles_src_superscript__WEBPACK_IMPORTED_MODULE_27__["default"],
  129053. _ckeditor_ckeditor5_block_quote_src_blockquote__WEBPACK_IMPORTED_MODULE_6__["default"],
  129054. _ckeditor_ckeditor5_ckfinder_src_ckfinder__WEBPACK_IMPORTED_MODULE_7__["default"],
  129055. // EasyImage,
  129056. _ckeditor_ckeditor5_heading_src_heading__WEBPACK_IMPORTED_MODULE_9__["default"],
  129057. _ckeditor_ckeditor5_html_embed_src_htmlembed__WEBPACK_IMPORTED_MODULE_10__["default"],
  129058. _ckeditor_ckeditor5_image_src_image__WEBPACK_IMPORTED_MODULE_11__["default"],
  129059. _ckeditor_ckeditor5_image_src_imagecaption__WEBPACK_IMPORTED_MODULE_12__["default"],
  129060. _ckeditor_ckeditor5_image_src_imagestyle__WEBPACK_IMPORTED_MODULE_13__["default"],
  129061. _ckeditor_ckeditor5_image_src_imagetoolbar__WEBPACK_IMPORTED_MODULE_14__["default"],
  129062. _ckeditor_ckeditor5_image_src_imageupload__WEBPACK_IMPORTED_MODULE_15__["default"],
  129063. _ckeditor_ckeditor5_image_src_imageresize__WEBPACK_IMPORTED_MODULE_16__["default"],
  129064. _ckeditor_ckeditor5_link_src_linkimage__WEBPACK_IMPORTED_MODULE_17__["default"],
  129065. _ckeditor_ckeditor5_indent_src_indent__WEBPACK_IMPORTED_MODULE_18__["default"],
  129066. _ckeditor_ckeditor5_link_src_link__WEBPACK_IMPORTED_MODULE_19__["default"],
  129067. _ckeditor_ckeditor5_list_src_list__WEBPACK_IMPORTED_MODULE_20__["default"],
  129068. // MediaEmbed,
  129069. _ckeditor_ckeditor5_paragraph_src_paragraph__WEBPACK_IMPORTED_MODULE_21__["default"],
  129070. _ckeditor_ckeditor5_paste_from_office_src_pastefromoffice__WEBPACK_IMPORTED_MODULE_22__["default"],
  129071. _ckeditor_ckeditor5_remove_format_src_removeformat__WEBPACK_IMPORTED_MODULE_23__["default"],
  129072. _ckeditor_ckeditor5_table_src_table__WEBPACK_IMPORTED_MODULE_24__["default"],
  129073. _ckeditor_ckeditor5_table_src_tabletoolbar__WEBPACK_IMPORTED_MODULE_25__["default"],
  129074. _ckeditor_ckeditor5_typing_src_texttransformation__WEBPACK_IMPORTED_MODULE_26__["default"],
  129075. _ckeditor_ckeditor5_font_src_fontcolor__WEBPACK_IMPORTED_MODULE_31__["default"],
  129076. _ckeditor_ckeditor5_font_src_fontbackgroundcolor__WEBPACK_IMPORTED_MODULE_32__["default"],
  129077. _ckeditor_ckeditor5_alignment_src_alignment__WEBPACK_IMPORTED_MODULE_33__["default"]
  129078. ];
  129079. // Editor configuration.
  129080. ClassicEditor.defaultConfig = {
  129081. alignment: {
  129082. options: ['left', 'center', 'right', 'justify']
  129083. },
  129084. toolbar: {
  129085. items: [
  129086. 'heading',
  129087. '|',
  129088. 'bold', 'italic', 'underline', 'strikethrough', 'subscript', 'superscript',
  129089. 'link', 'bulletedList', 'numberedList',
  129090. '|',
  129091. 'fontColor', 'fontBackgroundColor',
  129092. '|',
  129093. 'alignment',
  129094. '|',
  129095. 'indent', 'outdent',
  129096. '|',
  129097. 'imageUpload', 'blockQuote', 'insertTable',
  129098. // 'mediaEmbed',
  129099. 'undo', 'redo'
  129100. ]
  129101. },
  129102. image: {
  129103. styles: [
  129104. 'alignLeft', 'alignCenter', 'alignRight'
  129105. ],
  129106. toolbar: [
  129107. 'imageStyle:full',
  129108. 'imageStyle:side',
  129109. 'imageStyle:alignLeft',
  129110. 'imageStyle:alignRight',
  129111. 'imageStyle:alignCenter',
  129112. 'imageStyle:alignBlockLeft',
  129113. 'imageStyle:alignBlockRight',
  129114. '|',
  129115. 'imageResize',
  129116. '|',
  129117. 'imageTextAlternative',
  129118. ]
  129119. },
  129120. table: {
  129121. contentToolbar: [
  129122. 'tableColumn',
  129123. 'tableRow',
  129124. 'mergeTableCells'
  129125. ]
  129126. },
  129127. // This value must be kept in sync with the language defined in webpack.config.js.
  129128. language: 'en'
  129129. };
  129130. /***/ })
  129131. /******/ })["default"];
  129132. });
  129133. //# sourceMappingURL=ckeditor.js.map